Page 1 of 1

Errors of the version 1.25.1

PostPosted: 08 Jul 2018, 16:39
by support
Errors of the version 1.25.1

Re: Errors of the version 1.25.1

PostPosted: 02 Aug 2018, 15:30
by Foton
Error appears in theme Basis during booking:
Error "Please fix the following input errors:
Check-In Time cannot be blank.
Check-Out Time cannot be blank."

is solve by changing in file themes\basis\views\modules\booking\views\_form.php code
Code: Select all

<div class="full-multicolumn-first col-md-6 col-sm-6 date_z">
        <?php echo $form->labelEx($model, 'date_start'); ?>

        <?php
        if 
(!$model->date_start) {
            if (issetModule('bookingcalendar') && isset($apartment) && $apartment) {
                if (isset($forceStartDay) && $forceStartDay) {
                    $time = $forceStartDay;
                } else {
                    $time = Bookingcalendar::getFirstFreeDay($apartment->id);
                }
            } else {
                $time = time();
            }

            if (Yii::app()->language != 'ru') {
                $model->date_start = date('m/d/Y', $time);
            } else {
                $model->date_start = date('d.m.Y', $time);
                //$model->date_start = Yii::app()->dateFormatter->formatDateTime($time, 'medium', null);
            }
        }
        if (!$isSimpleForm && $useBookingCalendar) {
            $this->widget('application.modules.bookingcalendar.extensions.FFJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_start',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    //'showAnim'=>'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control',
                //'id' => 'date_start_' . rand(1, 9999)
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        } else {
            $this->widget('application.extensions.FJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_start',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control'
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        }

        ?>
        <?php //echo $form->error($model,'date_start'); ?>
    </div>
    <div class="full-multicolumn-first col-md-6 col-sm-6 date_v">
        <?php echo $form->labelEx($model, 'date_end'); ?>
        <?php
        
/* if(!$model->date_end){
          $model->date_end = Yii::app()->dateFormatter->formatDateTime(time()+60*60*24, 'medium', null);
          } */
        if (!$isSimpleForm && $useBookingCalendar) {
            $this->widget('application.modules.bookingcalendar.extensions.FFJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_end',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    //'showAnim'=>'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control',
                //'id' => 'date_end_' . rand(1, 9999)
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        } else {
            $this->widget('application.extensions.FJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_end',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control'
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        }

        ?>
        <?php //echo $form->error($model,'date_end');  ?>
    </div>


for
Code: Select all

<div class="full-multicolumn-first col-md-6 col-sm-6 date_z">
        <?php echo $form->labelEx($model, 'date_start'); ?>

        <?php
        if 
(!$model->date_start) {
            if (issetModule('bookingcalendar') && isset($apartment) && $apartment) {
                if (isset($forceStartDay) && $forceStartDay) {
                    $time = $forceStartDay;
                } else {
                    $time = Bookingcalendar::getFirstFreeDay($apartment->id);
                }
            } else {
                $time = time();
            }

            if (Yii::app()->language != 'ru') {
                $model->date_start = date('m/d/Y', $time);
            } else {
                $model->date_start = date('d.m.Y', $time);
                //$model->date_start = Yii::app()->dateFormatter->formatDateTime($time, 'medium', null);
            }
        }
        if (!$isSimpleForm && $useBookingCalendar) {
            $this->widget('application.modules.bookingcalendar.extensions.FFJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_start',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    //'showAnim'=>'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control',
                //'id' => 'date_start_' . rand(1, 9999)
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        } else {
            $this->widget('application.extensions.FJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_start',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control'
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        }

        ?>
        <?php //echo $form->error($model,'date_start'); ?>
    </div>
    <div class="full-multicolumn-second col-md-6 col-sm-6">
        <?php echo $form->labelEx($model, 'time_in'); ?>
        <?php echo $form->dropDownList($model, 'time_in', HBooking::getTimesIn(), array('class' => 'form-control')); ?>
        <?php //echo $form->error($model,'time_in');   ?>
    </div>
</div>
<div class="form-group row">
    <div class="full-multicolumn-first col-md-6 col-sm-6 date_v">
        <?php echo $form->labelEx($model, 'date_end'); ?>
        <?php
        
/* if(!$model->date_end){
          $model->date_end = Yii::app()->dateFormatter->formatDateTime(time()+60*60*24, 'medium', null);
          } */
        if (!$isSimpleForm && $useBookingCalendar) {
            $this->widget('application.modules.bookingcalendar.extensions.FFJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_end',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    //'showAnim'=>'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control',
                //'id' => 'date_end_' . rand(1, 9999)
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        } else {
            $this->widget('application.extensions.FJuiDatePicker', array(
                'model' => $model,
                'attribute' => 'date_end',
                'range' => 'eval_period',
                'language' => Yii::app()->controller->datePickerLang,
                'options' => array(
                    'showAnim' => 'fold',
                    'dateFormat' => Booking::getJsDateFormat(),
                    'minDate' => 'new Date()',
                ),
                'htmlOptions' => array(
                    'readonly' => 'true',
                    'class' => 'form-control'
                ),
            ));
            echo '<i class="fa fa-calendar" aria-hidden="true"></i>';
        }

        ?>
        <?php //echo $form->error($model,'date_end');  ?>
    </div>
    <div class="full-multicolumn-second col-md-6 col-sm-6">
        <?php echo $form->labelEx($model, 'time_out'); ?>
        <?php echo $form->dropDownList($model, 'time_out', HBooking::getTimesOut(), array('class' => 'form-control')); ?>
        <?php //echo $form->error($model,'time_out');  ?>
    </div>


Re: Errors of the version 1.25.1

PostPosted: 04 Aug 2018, 12:48
by cismih
I have tried, to change the code. But same error.
No changes

Re: Errors of the version 1.25.1

PostPosted: 04 Aug 2018, 22:04
by Xpycm
Impossible. You did something wrong. What coding skill you have?