Menu

#1178 Public booking

open
nobody
None
1
2017-03-13
2017-03-09
Anonymous
No

Hi, great job on this code.
I'm making a few minor changes, but I need your help on this.
I'm using it to booking cars instead of rooms in our organization, and I would like to change the following:
1 - Colaborators should be able to make car reservations without authentication, it would require to add the extra field e-mail for further contact.
2 - the admin receives the booking reservation and when confirms/reject the user receives a e-mail regarding the confirmation or not of the car (room) booking.

Is this possible?
Thank you.
Paulo Resende

Discussion

  • Anonymous

    Anonymous - 2017-03-09

    Maybe we could change the Type (internal/external) to e-mail, mandatory field (change to text on the DB) and use it to send e-mail of confirmation/no confirmation.

     
  • Campbell Morrison

    No, I think it would be better to have a custom field for the email address and make it mandatory. Then you need to modify edit_entry_handler.php so that create_by becomes the email address.

    You will also have to set the delete_ahead policies so that ordinary users can't delete bookings. Otherwise, anybody can come along and delete all your bookings.

     
  • Campbell Morrison

    Go to mrbs_auth.inc and set the page levels for edit_entry.php and edit_entry_handler.php to 0.

     
  • Anonymous

    Anonymous - 2017-03-10

    Thank you for the support. I took the liberty to correct some minor bugs/errors on the translation to Portuguese. I'm sending you the updated lang file.
    Regards
    PS: Probably I will require some support again. Thank you.

     

    Last edit: Anonymous 2017-03-10
  • Campbell Morrison

    Many thanks. I've committed the new translations to the default branch in b3d5d0.

     
  • Anonymous

    Anonymous - 2017-03-10

    Hi, I need some help to modify edit_entry_handler.php so that create_by becomes the email address wich I named mail_reserva. Coul you be more explicit?
    and also where to make it mandatory?
    Thanks
    Paulo

     
  • Campbell Morrison

    To make the field mandatory, set the following in your config file:

    $is_mandatory_field['entry.mail_reserva'] = true;
    

    Then to make create_by become the email address, edit edit_entry_handler.php and add at line 156 (in 1.6.1)

    $create_by = $custom_fields['mail_reserva'];
    
     
  • Anonymous

    Anonymous - 2017-03-10

    Gives me a error: access denied ,you don't have permission to change/view this item :(

     
  • Campbell Morrison

    When you try and do what?

     
  • Anonymous

    Anonymous - 2017-03-10

    copy paste that code to line 156

    }

    $create_by = $custom_fields['mail_reserva'];

    // (3) Clean up the form variables

    and when I try to book, i just gives me a error because public can do that, as admin it works.
    it seems that code line needs admin permissions on MRBS :(

     
  • Campbell Morrison

    Did you edit mrbs_auth.inc and set the page levels for edit_entry.php and edit_entry_handler.php to 0?

     
  • Anonymous

    Anonymous - 2017-03-10

    yes, I just don't know if I did it correctly

    $page_level['edit_entry.php'] = 0; //($auth['only_admin_can_book']) ? 2 : 1;
    $page_level['edit_entry_handler.php'] = 0; //($auth['only_admin_can_book']) ? 2 : 1;

    is it ok like this?

     
    • Campbell Morrison

      Yes, that's OK.

       
  • Anonymous

    Anonymous - 2017-03-10

    Still got the error when public tries to booking...
    all the other options are fine, just tested... public user can't edit, delete or confirm bookings, only admin.
    But with that code line, the public can't book also :(

    also found a missing word on lang.pt. add this:
    $vocab["back"] = "Voltar";

     

    Last edit: Anonymous 2017-03-10
    • Campbell Morrison

      Thanks. I have now added the missing word.

       
  • Campbell Morrison

    OK, you need to add the line

    $user = $create_by;
    

    so now at line 156 you add

    $create_by = $custom_fields['mail_reserva'];
    $user = $create_by;
    
     
  • Anonymous

    Anonymous - 2017-03-13

    Hi,
    It solved, there is just one thing that's not working, the booker isn't getting the e-mail regarding is reservation (no mail at all)..

     
  • Campbell Morrison

    You;ll need to modify functions_mail.inc and change line 834 (in 1.6.1) from this:

        $booker_email = authGetUserEmail($booker);
    

    to this:

        // If the booker's name looks like an email address then use that.  Otherwise
        // get the email address for that user.
        $booker_email = (validate_email($booker)) ? $booker : authGetUserEmail($booker);