Page 1 of 1

[BUG] Inconsistency in booking statuses between public and admin side

Posted: Apr 28th, '18, 00:57
by PrinceOfAbyss
In include/classes/Bookings.class.php at line ~147 there is the following code:

Code: Select all

      if($user_id != ''){
         $this->user_id = $user_id;
         $this->page = 'customer=my_bookings';
         $this->actions   = array('add'=>false, 'edit'=>false, 'details'=>false, 'delete'=>false);
         $arr_statuses_filter = array('1'=>_PENDING, '2'=>_RESERVED, '3'=>_COMPLETED, '4'=>_REFUNDED, '5'=>_PAYMENT_ERROR, '6'=>_CANCELED);
         $arr_statuses_edit = array('1'=>_PENDING, '2'=>_RESERVED, '3'=>_COMPLETED);
         $arr_statuses_edit_completed = array('2'=>_COMPLETED, '3'=>_REFUNDED);
      }else{
         $this->user_id = '';
         $this->page = 'admin=mod_booking_bookings';
         
         $allow_editing = !$objLogin->HasPrivileges('edit_bookings') ? false : true;
         $allow_deleting = !$objLogin->HasPrivileges('delete_bookings') ? false : true;
         $allow_cancelation = !$objLogin->HasPrivileges('cancel_bookings') ? false : true;
         
         $this->actions = array('add'=>false, 'edit'=>$allow_editing, 'details'=>false, 'delete'=>$allow_deleting);
         $arr_statuses_filter = array('0'=>_PREBOOKING, '1'=>_PENDING, '2'=>_RESERVED, '3'=>_COMPLETED, '4'=>_REFUNDED, '5'=>_PAYMENT_ERROR, '6'=>_CANCELED);
         $arr_statuses_edit = array('1'=>_PENDING, '2'=>_RESERVED, '3'=>_COMPLETED, '4'=>_REFUNDED);
         $arr_statuses_edit_completed = array('3'=>_COMPLETED, '4'=>_REFUNDED);
      }

I haven't seen it happening, but at least according to the code here, there is an inconsistency regarding the completed booking statuses (array $arr_statuses_edit_completed) between the admin and public side. As it is obvious, if status is 3 for a booking, the admin will see it as Completed, while the user will see it as Refunded. Let alone that a status 2 booking is not even Completed but Reserved.

I suppose that for the public side it should be

Code: Select all

         $arr_statuses_edit_completed = array('3'=>_COMPLETED, '4'=>_REFUNDED);

Re: [BUG] Inconsistency in booking statuses between public and admin side

Posted: Apr 29th, '18, 13:57
by administrator
Thanks, we'll check this