Install MRBS Scheduling Calendar on SFU Fraser
PHP icalendar Google Calendar and PHP icalendar MRBS Room booking Calendar  Feed2JS (RSS Feed to JavaScript)

Setting up MRBS on Customizations

I created a .htaccess restricted subdirectory named restricted. Then I copied all the files to the subdirectory (chmod as required), and changed the files in the unrestricted directory to point to the restricted directory [e.g. in day.php etc, href=\"restricted/edit_entry.php] and removed the links to admin.php. I deleted the edit_entry.php and admin.php in the unrestricted directory.

If you only use english you may modify wording by changing the lang.en file and change to disable_automatic_language_changing = 1; (0 is the default and sets the language based on the user's preference).

We get the error message [Warning: Server failed to set locale to "_" (Unix)] so we used the command 'locale -a' on fraser, e.g.,

science_fraser% locale -a
en_US  [etc]
Then set the locale in as shown here:
// Set this to a valid locale (for the OS you run the MRBS server on)
// if you want to override the automatic locale determination MRBS
// performs
$override_locale = "en_CA.UTF-8";  //SFU changed to n_CA.UTF-8 from blank
and the error message was gone.

In order to show that a booking is part of a series in day.php I added an asterisk to the booking:

Line 182: changed sql $tbl_entry.description AS entry_description to

$tbl_entry.description AS entry_description, entry_type

Line 233: Added line after $today[$row['room_id']][date($format,$t)]["long_descr"] = "";

$today[$row['room_id']][date($format,$t)]["repeatdc"]  = ($row['entry_type'] ? '*' : '');	//Added SFU to show repeating

Line 423: Added line after $long_descr = htmlspecialchars($today[$room_id][$time_t]["long_descr"]);

$repeatdc = $today[$room_id][$time_t]["repeatdc"];   //Added by Dave Carmean SFU to show repeating

Line 500: Added $repeatdc to show asterisk in

echo "<a href=\"view_entry.php?id=$id&area=$area&day=$day&month=$month&year=$year\" title=\"$long_descr\">$descr$repeatdc</a>\n";

I commented out the "lastmonth" table cell at the bottom of to remove the small calendar for the previous month (people generally don't want to know what rooms were available in the past, and it made extra space for comments).

See my comments about creating additional tables in so you can have different administrators and different websites.

In day.php I changed it so depending on the area it would display capacity as "(seats ##)"  or not display capacity (e.g, most people do not want their capacity shown).
        echo "<th width=\"$room_column_width%\">"
            . htmlspecialchars($row[0]) . ($row[1] > 0 ? "<small> (seats $row[1])</small>" : " ") . "</th>";

The original (which has links) was:
        echo "<th width=\"$room_column_width%\">
            <a href=\"week.php?year=$year&month=$month&day=$day&area=$area&room=$row[2]\"
            title=\"" . get_vocab("viewweek") . " &#10;&#10;$row[3]\">"
            . htmlspecialchars($row[0]) . ($row[1] > 0 ? "($row[1])" : "") . "</a></th>";

Last login: Fri Feb 22 19:46:31 on console
account-iMac:~ account$ ssh
Assigned terminal type is: xterm-color

1: account_fraser% cd sec_html

[On the mac I renamed the downloaded mrbs-1.4.9.tar.gz to mrbs.tar.gz and dragged it to the open sec_html directory]
5: account_fraser% ls
.                .AppleDouble     mrbs.tar.gz
..               :2e_mrbs.tar.gz

6: account_fraser% tar -xvzf mrbs.tar.gz
tar: z: unknown function modifier

8: account_fraser% gtar  -xvzf mrbs.tar.gz
.... [approx 1300 files extracted]

9: account_fraser% chmod 711 mrbs

10: account_fraser% cd mrbs

11: account_fraser% chmod 711 web

12: account_fraser% cd web

13: account_fraser% mysql -h -u mysqluser -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2638668
Server version: 5.1.xx-log MySQL Community Server (GPL) by Remi

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> source /home/account/sec_html/mrbs/;
Current database: dept_advising

Query OK, 0 rows affected (0.08 sec)
Query OK, 0 rows affected (0.01 sec)
Query OK, 0 rows affected (0.03 sec)
Query OK, 1 row affected (0.00 sec)
Query OK, 1 row affected (0.00 sec)
mysql> show tables;
| Tables_in_dept_advising |
| mrbs_dept_area         | 
| mrbs_dept_entry        | 
| mrbs_dept_repeat       | 
| mrbs_dept_room         | 
| mrbs_dept_users        | 
| mrbs_dept_variables    | 
| mrbs_dept_zoneinfo     | 
20 rows in set (0.00 sec)
mysql> exit;

14: account_fraser% cd web

15: account_fraser% chmod 644 *.html

16: account_fraser% chmod 644 *.txt

33: account_fraser% cat .htaccess
<Files ~ "\.inc$">
   Order allow,deny
   Deny from all

34: account_fraser% pico .htaccess
[added lines to control access to all sfu accounts]

35: account_fraser% cat .htaccess
AuthType CAS
require valid-sfu-user
<Files ~ "\.inc$">
   Order allow,deny
   Deny from all

23: account_fraser% chmod 644 .htaccess

24: account_fraser% chmod 700 *.php

25: account_fraser% chmod 711 css

26: account_fraser% cd css

27: account_fraser% chmod 644 *.css

28: account_fraser% chmod 700 *.php

32: account_fraser% cd ..

36: account_fraser% chmod 711 Themes

37: account_fraser% cd Themes 

38: account_fraser% chmod 711 default

39: account_fraser% cd default

41: account_fraser% cd /home/account/sec_html/mrbs/web/images

42: account_fraser% chmod 644 *.*

43: account_fraser% chmod 711 /home/account/sec_html/mrbs/web/images

29: account_fraser% locale -a


53: userhome_fraser% cd /home/user/sec_html/

54: userhome_fraser% mkdir web

55: userhome_fraser% chmod 711 web

56: userhome_fraser% cd web

57: userhome_fraser% pico .htaccess

58: userhome_fraser% chmod 644 .htaccess

59: userhome_fraser% cat .htaccess
AuthType CAS
require valid-sfu-user
<Files ~ "\.inc$">
   Order allow,deny
   Deny from all

60: userhome_fraser% chmod 711 Blowfish
chmod 711 css
chmod 711 File
chmod 711 File/Passwd
chmod 711 Mail
chmod 711 Net
chmod 711 Themes
chmod 711 Themes/default
chmod 711 Themes/classic126
chmod 711 js

chmod 700 *.php
chmod 700 Blowfish/*.php
chmod 700 css/*.php
chmod 700 File/Passwd/*.php
chmod 700 File/*.php
chmod 700 js/*.php
chmod 700 Mail/*.php
chmod 700 Net/*.php

61: userhome_fraser% 
78: userhome_fraser%