Jump to content

MRBS - Use user type to assign booking type.


Recommended Posts

Posted

Hi all,

 

Does anyone know if it's possible to have the booking type (internal, external) be pre-selected based on a user's login?

That would be great, as students could be part of one auth type, teachers another, and techs another. That way, when they made a booking, the type would be selected for them.

Also, I want to add rules to each auth class. Admins would have no rules, but regular users would be limited to x number of hours of booking per day.

Anyone have any ideas on these?

Thanks very much.

Posted

I don't think the first is possible by default. You could probably modify the php code to do it. I think it would need to go in edit_entry.php. Look at the part where it outputs the select box for this.

 

How are you defining the user types? IIRC, mrbs only has admin and user, but you might be able to do some sort of regular expression or pattern matching if you have students starting with a different prefix (ie st01anon or c11anon), you could probably code that in.

 

There are various options to restrict user bookings, if you look through systemdefaults.inc.php or areadefaults.inc.php (but that might not be in your version), you might find something that does the job. this bit seems similar to what you want:

 

219 /******************

220 * Booking policies

221 ******************/

222

223 // Most booking policies can be configured on a per-area basis, so these variables

224 // appear in the areadefaults.inc.php file.

225

226 // The settings below are global policy settings

227

228 // Set a maximum duration for bookings

229 $max_duration_enabled = FALSE; // Set to TRUE if you want to enforce a maximum duration

230 $max_duration_secs = 60*60*2; // (seconds) - when using "times"

231 $max_duration_periods = 2; // (periods) - when using "periods"

 

Any settings that you change need to go in config.inc.php, or they get overwritten the next time you upgrade.

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...