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

Discuss everything related to PHP Hotel Site. All versions. Any questions related to the PHP Hotel Site developing or using should be posted to this forum.

Moderators: ne_moj, zewa, vadimako, ne_moj, zewa, vadimako

PrinceOfAbyss
Junior
Junior
Posts: 13
Joined: Apr 1st, '18, 23:17

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

Postby PrinceOfAbyss » Apr 28th, '18, 00:57

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);

administrator
Site Admin
Site Admin
Posts: 5981
Joined: Jan 7th, '09, 23:18
Contact:

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

Postby administrator » Apr 29th, '18, 13:57

Thanks, we'll check this


Return to “ApPHP HotelSite / uHotelBooking Talk {developers/users}”