+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
Scripts Thread, MRBS stop booking X days in advance code mod in Coding and Web Development; Cheers, just added the code by Minkus and its working a treat. Many thanks Ste....
  1. #16
    mullet_man's Avatar
    Join Date
    Oct 2005
    Location
    Oldham
    Posts
    740
    Thank Post
    35
    Thanked 48 Times in 46 Posts
    Rep Power
    28
    Cheers, just added the code by Minkus and its working a treat.

    Many thanks

    Ste.

  2. #17

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    132

    Still struggling

    I'm still having difficulties with this. Are we talking of altering the 3 files in the MRBS\web folder? When I've applied the changes the room booking system page fails to load, I just get a blank.

  3. #18

    Join Date
    Oct 2007
    Location
    Rugby, Warwickshire
    Posts
    7
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks for the post on how to add this feature it was just what we needed at the school I work at.

    I've added a comment to a feature request for this feature on the MRBS website notifying that the feature has been written by an edugeek member.
    https://sourceforge.net/tracker/inde...13&atid=355113

    So I'm hoping one of the MRBS developers will follow the link here and add the feature into the next version either inspired from the code here or if theres no objections copied from here so next time someone needs this feature or I do an upgrade I won't have to cut and paste code from here.

    Thanks,
    Daniel

  4. #19
    AdamM's Avatar
    Join Date
    Feb 2009
    Location
    Abingdon, UK
    Posts
    4
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi Chris,

    Did you ever manage to create the bulk upload page for timetabled lessons? I have been looking at MRBS for some time trying to do this but have been unsuccessful so far...

    MTIA

  5. #20
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    5,006
    Thank Post
    124
    Thanked 286 Times in 263 Posts
    Rep Power
    109
    Quote Originally Posted by AdamM View Post
    Hi Chris,

    Did you ever manage to create the bulk upload page for timetabled lessons? I have been looking at MRBS for some time trying to do this but have been unsuccessful so far...

    MTIA

    No sorry I never did it in the end as I got lazy when we got another member of staff so I delegated it :P . I think Webmans booking system might have this functionality?

  6. Thanks to ChrisH from:

    AdamM (4th March 2009)

  7. #21
    AdamM's Avatar
    Join Date
    Feb 2009
    Location
    Abingdon, UK
    Posts
    4
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thanks looks like I'll just have to keep plodding on with it
    Have some Thanks!!

  8. #22

    Join Date
    Mar 2009
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Have added minkus code and go the mrbs working to allow booking 5 days in advance. However am getting an error message display above the company title when I try to book more than 5 days in advance
    Warning: Missing argument 5 for check_allowed(), called in C:\wamp\www\edit_entry_handler.php on line 345 and defined in C:\wamp\www\functions.inc on line 781
    Can anyone help solve this problem

  9. #23

    Join Date
    Jun 2007
    Location
    Colchester, Essex, UK
    Posts
    56
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    22
    Hi all,

    Have just upgraded to MRBS 1.4.2, and some of the code in the posts above needs updating. Unfortunately I don't seem to be able to edit the originals, so here's an up-to-date version with the latest code:

    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, change
    PHP Code:
      if(authGetUserLevel($user) >= 2
    to
    PHP Code:
      if(authGetUserLevel($user) >= 1
    To create a maximum and minimum book-ahead time, which can be bypassed by administrators:

    Add the following settings to config.inc.php:
    PHP Code:
    $max_days_ahead 14;
    $min_days_ahead 1
    Add the following to functions.inc before the final '?>':

    PHP Code:
    #Function to determine the amount of days between 2 dates
    function check_allowed($month1$day1$year1$max_days_ahead$min_days_ahead)
    {
    $daysbetween check_days($month1$day1$year1);
    if (
    $daysbetween $max_days_ahead or $daysbetween $min_days_ahead)
    {
    return(
    0);
    }
    Else
    {
    return(
    1);
    }
    }
    function 
    check_days($month1$day1$year1)
    {
    # Get Current Date
    $month2 date('m');
    $day2 date('d');
    $year2 date('y');
    # Turn the dates into a timestamp and subtract the current date from the date supplied.
    $dateDiff mktime(0,0,0,$month1$day1$year1) - mktime(0,0,0,$month2$day2$year2);
    #Round the date down
    $dateDiff floor($dateDiff/60/60/24);
    return(
    $dateDiff);

    Add the following to edit_entry_handler.php just after '$rules_broken = array();'

    PHP Code:
    $required_level = (isset($max_level) ? $max_level 2);
    If (
    check_allowed($_GET["month"], $_GET["day"], $_GET["year"], $max_days_ahead$min_days_ahead) or getAuthorised($required_level)){
    }
    else{
    $valid_booking FALSE;
    $rules_broken[] = "You cannot book more than ".$max_days_ahead." or less than ".$min_days_ahead." day(s) ahead";

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

    PHP Code:
      $required_level = (isset($max_level) ? $max_level 2);
      if (
    check_allowed($month$day$year$max_days_ahead$min_days_ahead) or getAuthorised($required_level)){
      }
      else{
      
    showAccessDenied($day$month$year$area"");
      exit();
      } 
    To prevent non-administrators from creating or deleting a series of repeating entries:

    Edit edit_entry_handler.php
    Change
    PHP Code:
        if(count($reps) < $max_rep_entrys
    to
    PHP Code:
        $required_level = (isset($max_level) ? $max_level 2);
        if(
    count($reps) < $max_rep_entrys and getAuthorised($required_level)) 
    Edit del_entry.php
    Change
    PHP Code:
    if (getAuthorised(1) && ($info mrbsGetEntryInfo($id))) 
    to
    PHP Code:
    $required_level = (isset($max_level) ? $max_level 2);
    if (
    getAuthorised(1) && ($info mrbsGetEntryInfo($id)) && ($series != || getAuthorised($required_level))) 
    Hope this helps!
    Last edited by Minkus; 25th September 2009 at 04:46 PM. Reason: Updated to use MRBS 1.4.2 $max_level config value

  10. #24

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    132
    I think this is the stand alone version of MRBS not the version which integrates with Moodle?

  11. #25

    Join Date
    Mar 2009
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    MRBS Booking in advance

    I have entered the excellent code from Minkus to prevent booking more than 5 days in advance. Works perfectly on a wamp virtual server. However when I upload this I am getting a error message for non admin users 'Scheduling Conflict Cannot book more than days in advance' This happens even it if try to book on today's date.

    Anyone any ideas please

  12. #26

    Join Date
    Jun 2007
    Location
    Colchester, Essex, UK
    Posts
    56
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    22
    Outlaw27,

    Try setting $min_days_ahead to 0.

    Kind regards,
    Chris

  13. #27

    Join Date
    Jun 2007
    Location
    Colchester, Essex, UK
    Posts
    56
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    22

    MRBS 1.4.3 updates

    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!

  14. #28

    Join Date
    Mar 2009
    Posts
    4
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    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.

  15. #29
    neilmc's Avatar
    Join Date
    Nov 2008
    Location
    Edinburgh
    Posts
    302
    Thank Post
    69
    Thanked 19 Times in 17 Posts
    Rep Power
    16
    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?

  16. #30

    Join Date
    Jun 2007
    Location
    Colchester, Essex, UK
    Posts
    56
    Thank Post
    2
    Thanked 16 Times in 14 Posts
    Rep Power
    22
    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:
    PHP Code:
      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:
    PHP Code:
      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,
    Last edited by Minkus; 21st May 2010 at 05:00 PM.



SHARE:
+ Post New Thread
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Slow days, nothing to do!
    By Samson in forum General Chat
    Replies: 20
    Last Post: 3rd July 2007, 11:33 AM
  2. MRBS
    By j17sparky in forum Web Development
    Replies: 6
    Last Post: 17th November 2006, 04:11 PM
  3. 6 Months In Few Days
    By russdev in forum General EduGeek News/Announcements
    Replies: 2
    Last Post: 6th December 2005, 03:52 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •