Jump to content

MRBS stop booking X days in advance code mod


Recommended Posts

Posted

Updated to MRBS 1.4.3 - the only change to the post above is that in the 'To create a maximum and minimum book-ahead time, which can be bypassed by administrators:' section, where it says

 

Add the following to del_entry.php just before 'if (MAIL_ADMIN_ON_DELETE)':

 

it should now say

 

Add the following to del_entry.php just before 'if ($mail_settings['admin_on_delete'])':

 

Hope this helps!

  • 1 month later...
Posted

Have added the files with the Minkus code to prevent non administrators creating a series of repeating entries.

 

However when I tried to delete a entry I got an error message, so I changed the code back to what it was orginally. However now when I try to delete an entry I get the following error message.

 

Parse error: syntax error, unexpected '{' in /home7/cshsvleo/public_html/mrbs/web/del_entry.php on line 37

 

Where have I went wrong. I have Minkus code installed to pervent booking a single entry no future than 7 days in advance. All help gratefully received.

Posted

I use MRBS in an office/conference environment, I was wondering is there a way of putting in a button which says request a booking comes up with a form which will have for example, Contact Name, Email, Company name, Department, Telephone number, Requirements etc. which is then sent to the girls in the office who can then make the booking, trying to save the phone going all the time.

 

Would this be done through editing the code or is it just not worth it? any ideas?

  • 3 months later...
Posted (edited)

Hi all,

 

As of MRBS 1.4.4, most of the above code has been implemented into MRBS itself, with a few small exceptions. You can now set a minimum and maximum book ahead time using $min_book_ahead_enabled, $max_book_ahead_enabled, $min_book_ahead_days and $max_book_ahead_days, and you can specify that only admins should be able to create repeat bookings using $auth['only_admin_can_book_repeat']. Thanks to the MRBS team for making these changes!

 

The only ones which some people may still want to make in schools are as follows:

 

To make it so that any logged-in user can edit an existing booking, not just the owner and administrators:

Edit mrbs_auth.inc

Inside function getWritable, just before '// Otherwise you have to be a (booking) admin for this room', add:

  if(authGetUserLevel($user) >= 1)
 {
   return 1;
 }

 

 

To prevent non-administrators from deleting a repeat booking, or deleting any booking outside the minimum / maximum book ahead times:

NB This is only necessary if you make the change above - normally you can only delete an item if you created it in the first place, in which case the repeat / book ahead restrictions will have been applied at that point

Edit del_entry.php

Find '$authorised = auth_book_admin($user, $info['room_id']);'

Just after the closing } for the above statement, add:

  elseif ($series && !empty($auth['only_admin_can_book_repeat']))
 {
   $authorised = (authGetUserLevel($user) >= 2);
 }
 elseif (mrbsCheckPolicy($info['start_time']))
 {
   $authorised = auth_book_admin($user, $info['room_id']);
 }

 

If anyone from the MRBS team would like to add these as an option in the next version, it would be much appreciated!

 

Kind regards,

Edited by Minkus
  • 3 years later...
Posted

For Moodle

 

go into 'config.inc.php' and replace the line:

 

$max_advance_days = isset($cfg_mrbs->max_advance_days) ? $cfg_mrbs->max_advance_days : -1;

 

with is

 

if (is_siteadmin()) {

$max_advance_days = -1;

} else {

$max_advance_days = 2;

}

$cfg_mrbs->max_advance_days = $max_advance_days;

 

 

it allows site administrators to alter/add/delete any bookings outside of the max advance days setting

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...