Index: plugins/blocks/mrbs/settings.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/settings.php,v
retrieving revision 1.2
diff -u -r1.2 settings.php
--- plugins/blocks/mrbs/settings.php	9 May 2008 21:33:55 -0000	1.2
+++ plugins/blocks/mrbs/settings.php	30 Jul 2008 17:23:22 -0000
@@ -1,7 +1,68 @@
-<?php  //$Id: settings.php,v 1.2 2008/05/09 21:33:55 arborrow Exp $
+<?php  //$Id: settings.php,v 1.0 2008-05-02 17:38:47 sbourget Exp $
 
 
 $settings->add(new admin_setting_configtext('block_mrbs_serverpath', get_string('serverpath', 'block_mrbs'),
-                   get_string('adminview', 'block_mrbs'), $CFG->wwwroot.'/blocks/mrbs/web', PARAM_URL));
+get_string('adminview', 'block_mrbs'), $CFG->wwwroot.'/blocks/mrbs/web', PARAM_URL));
 
+$settings->add(new admin_setting_configtext('block_mrbs_admin', get_string('config_admin', 'block_mrbs'), get_string('config_admin2', 'block_mrbs'), $CFG->supportname, PARAM_TEXT));
+
+$settings->add(new admin_setting_configtext('block_mrbs_admin_email', get_string('config_admin_email', 'block_mrbs'),get_string('config_admin_email2', 'block_mrbs'), $CFG->supportemail, PARAM_TEXT));
+
+$options = array(0 => get_string('no'), 1=> get_string('yes'));
+$settings->add(new admin_setting_configselect('block_mrbs_enable_periods', get_string('config_enable_periods', 'block_mrbs'),get_string('config_enable_periods2', 'block_mrbs'), 1, $options));
+
+if (isset($CFG->block_mrbs_enable_periods)) {
+    if($CFG->block_mrbs_enable_periods ==0) {
+
+        // Resolution
+
+        unset($options);
+        $strunits = get_string('resolution_units', 'block_mrbs');
+        $options = array('900' => '15' .$strunits , '1800'=> '30' . $strunits, '2700'=> '45' . $strunits, '3600'=> '60' . $strunits, '4500'=> '75' . $strunits, '5400'=> '90' . $strunits, '6300'=> '105' . $strunits, '7200'=> '120' . $strunits);
+        $settings->add(new admin_setting_configselect('block_mrbs_resolution', get_string('config_resolution', 'block_mrbs'),get_string('config_resolution2', 'block_mrbs'), '1800', $options));
+
+        // Start Time (Hours)
+        unset($options);
+        $options = array(1 => '01', 2=> '02', 3=> '03', 4=> '04', 5=> '05', 6=> '06', 7=> '07', 8=> '08', 9=> '09', 10=> '10', 11=> '11', 12=> '12', 13=> '13', 14=> '14', 15=> '15', 16=> '16', 17=> '17', 18=> '18', 19=> '19', 20=> '20', 21=> '21', 22=> '22', 23=> '23');
+        $settings->add(new admin_setting_configselect('block_mrbs_morningstarts', get_string('config_morningstarts', 'block_mrbs'),get_string('config_morningstarts2', 'block_mrbs'), 7, $options));
+
+        // Start Time (Min)
+        unset($options);
+        $options = array(0 => '00', 5=> '05', 10=> '10', 15=> '15', 20=> '20', 25=> '25', 30=> '30', 35=> '35', 40=> '40', 45=> '45', 50=> '50', 55=> '55');
+        $settings->add(new admin_setting_configselect('block_mrbs_morningstarts_min', get_string('config_morningstarts_min', 'block_mrbs'),get_string('config_morningstarts_min2', 'block_mrbs'), 0, $options));
+
+        // End Time (Hours)
+        unset($options);
+        $options = array(1 => '01', 2=> '02', 3=> '03', 4=> '04', 5=> '05', 6=> '06', 7=> '07', 8=> '08', 9=> '09', 10=> '10', 11=> '11', 12=> '12', 13=> '13', 14=> '14', 15=> '15', 16=> '16', 17=> '17', 18=> '18', 19=> '19', 20=> '20', 21=> '21', 22=> '22', 23=> '23'     );
+        $settings->add(new admin_setting_configselect('block_mrbs_eveningends', get_string('config_eveningends', 'block_mrbs'),get_string('config_eveningends2', 'block_mrbs'), 19, $options));
+
+        // End Time Time (Min)
+        unset($options);
+        $options = array(0 => '00', 5=> '05', 10=> '10', 15=> '15', 20=> '20', 25=> '25', 30=> '30', 35=> '35', 40=> '40', 45=> '45', 50=> '50', 55=> '55');
+        $settings->add(new admin_setting_configselect('block_mrbs_eveningends_min', get_string('config_eveningends_min', 'block_mrbs'),get_string('config_eveningends_min2', 'block_mrbs'), 0, $options));
+    }
+    else {  //Use Custom Periods
+    
+        $settings->add(new admin_setting_configtextarea('block_mrbs_periods', get_string('config_periods', 'block_mrbs'),get_string('config_periods2', 'block_mrbs'),''));
+    }
+}
+
+// Date Information
+
+//Start of Week
+unset($options);
+$options = array(0 => get_string('sunday', 'calendar'),1 => get_string('monday', 'calendar'),2 => get_string('tuesday', 'calendar'),3 => get_string('wednesday', 'calendar'),4 => get_string('thursday', 'calendar'),5 => get_string('friday', 'calendar'),6 => get_string('saturday', 'calendar'));
+
+$settings->add(new admin_setting_configselect('block_mrbs_weekstarts', get_string('config_weekstarts', 'block_mrbs'),get_string('config_weekstarts2', 'block_mrbs'), 0, $options));
+
+//Date Format
+unset($options);
+$options = array(0 => get_string('config_date_mmddyy', 'block_mrbs'),1 => get_string('config_date_ddmmyy', 'block_mrbs'));
+
+$settings->add(new admin_setting_configselect('block_mrbs_dateformat', get_string('config_dateformat', 'block_mrbs'),get_string('config_dateformat2', 'block_mrbs'), 0, $options));
+
+//Time format
+unset($options);
+$options = array(0 => get_string('timeformat_12', 'calendar'),1 => get_string('timeformat_24', 'calendar'));
+$settings->add(new admin_setting_configselect('block_mrbs_timeformat', get_string('config_timeformat', 'block_mrbs'),get_string('config_timeformat2', 'block_mrbs'), 1, $options));
 ?>
Index: plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php,v
retrieving revision 1.2
diff -u -r1.2 block_mrbs.php
--- plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php	9 May 2008 21:33:55 -0000	1.2
+++ plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php	30 Jul 2008 17:23:22 -0000
@@ -1,4 +1,4 @@
-<?php // $Id: block_mrbs.php,v 1.2 2008/05/09 21:33:55 arborrow Exp $
+<?php // $Id: block_mrbs.php,v 1.1 2007/04/05 22:25:22 arborrow Exp $
 $string['blockname'] = 'Resource Scheduling';
 $string['adminview'] = 'What is URL to your MRBS Install?';
 $string['mustlogin'] = 'You must be logged in to Moodle before you can access the calendar';
@@ -7,4 +7,35 @@
 $string['mrbs:editmrbs'] = 'Access MRBS (Read / Write)';
 $string['mrbs:administermrbs'] = 'Access MRBS (Read / Write / Admin)';
 $string['serverpath'] = 'MRBS Installation path';
+$string['config_admin'] = 'MRBS Admin';
+$string['config_admin2'] = 'Name of the MRBS administrator';
+$string['config_admin_email'] = 'MRBS admin email';
+$string['config_admin_email2'] = 'Email address of the MRBS administrator';
+$string['config_enable_periods'] = 'Use Periods';
+$string['config_enable_periods2'] = 'Use custom periods for MRBS scheduling.  If this is set to no then MRBS will schedule using time blocks';
+$string['config_resolution'] = 'Time blocks';
+$string['config_resolution2']  = 'Time blocks to be scheduled, Periods must be disabled to use this option.';
+$string['resolution_units'] = ' Minutes';
+
+$string['config_morningstarts'] = 'Start Hour';
+$string['config_morningstarts2']  = 'Start time (Hour) for the day, Periods must be disabled to use this option.';
+$string['config_morningstarts_min'] = 'Start Minutes';
+$string['config_morningstarts_min2']  = 'Start time (Minutes) for the day, Periods must be disabled to use this option.';
+
+$string['config_eveningends'] = 'End Hour';
+$string['config_eveningends2']  = 'End time (Hour) for the day, Periods must be disabled to use this option.';
+$string['config_eveningends_min'] = 'End Minutes';
+$string['config_eveningends_min2']  = 'End time (Minutes) for the day, Periods must be disabled to use this option.';
+
+$string['config_periods'] = 'Custom Periods';
+$string['config_periods2']  = 'Define the name or description for your periods in chronological order.  One entry per line.';
+
+$string['config_weekstarts'] = 'Start of Week';
+$string['config_weekstarts2']  = 'Select the start of week.';
+$string['config_dateformat'] = 'Date format';
+$string['config_dateformat2']  = 'Date format to be used by MRBS.';
+$string['config_date_mmddyy'] = 'July 10';
+$string['config_date_ddmmyy']  = '10 July';
+$string['config_timeformat'] = 'Time format';
+$string['config_timeformat2']  = 'Time format to be used by MRBS.';
 ?>
Index: plugins/blocks/mrbs/web/config.inc.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/web/config.inc.php,v
retrieving revision 1.1
diff -u -r1.1 config.inc.php
--- plugins/blocks/mrbs/web/config.inc.php	5 Apr 2007 22:25:26 -0000	1.1
+++ plugins/blocks/mrbs/web/config.inc.php	30 Jul 2008 17:23:22 -0000
@@ -38,8 +38,8 @@
 ################################
 # Site identification information
 #################################
-$mrbs_admin = "admin"; //moodle username of the mrbs administrator
-$mrbs_admin_email = "admin@MyMoodleSite.com";
+$mrbs_admin = $CFG->block_mrbs_admin;  //moodle username of the mrbs administrator
+$mrbs_admin_email = $CFG->block_mrbs_admin_email; // "admin@MyMoodleSite.com";
 
 # This is the text displayed in the upper left corner of every page. Either
 # type the name of your organization, or you can put your logo like this :
@@ -55,7 +55,7 @@
 # It is also recommended that you set this if you intend to use email
 # notifications, to ensure that the correct URL is displayed in the
 # notification.
-$url_base = "";
+$url_base = $CFG->block_mrbs_serverpath;
 
 
 ###################
@@ -68,32 +68,34 @@
 # the default) or user defined periods (TRUE).  If user-defined periods
 # are used then $resolution, $morningstarts, $eveningends,
 # $eveningends_minutes and $twentyfourhour_format are ignored.
-$enable_periods = TRUE;
+$enable_periods = $CFG->block_mrbs_enable_periods;
 
-# Resolution - what blocks can be booked, in seconds.
-# Default is half an hour: 1800 seconds.
-$resolution = 1800;
-
-# Start and end of day, NOTE: These are integer hours only, 0-23, and
-# morningstarts must be < eveningends. See also eveningends_minutes.
-$morningstarts = 7;
-$eveningends   = 19;
-
-# Minutes to add to $morningstarts to get to the real start of the day.
-# Be sure to consider the value of $eveningends_minutes if you change
-# this, so that you do not cause a day to finish before the start of
-# the last period.  For example if resolution=3600 (1 hour)
-# morningstarts = 8 and morningstarts_minutes = 30 then for the last
-# period to start at say 4:30pm you would need to set eveningends = 16
-# and eveningends_minutes = 30
-$morningstarts_minutes = 0;
-
-# Minutes to add to $eveningends hours to get the real end of the day.
-# Examples: To get the last slot on the calendar to be 16:30-17:00, set
-# eveningends=16 and eveningends_minutes=30. To get a full 24 hour display
-# with 15-minute steps, set morningstarts=0; eveningends=23;
-# eveningends_minutes=45; and resolution=900.
-$eveningends_minutes = 0;
+if ($enable_periods == 0) { //if we are not using periods then set the following values, prevents error of unset variables
+    # Resolution - what blocks can be booked, in seconds.
+    # Default is half an hour: 1800 seconds.
+    $resolution = $CFG->block_mrbs_resolution;
+
+    # Start and end of day, NOTE: These are integer hours only, 0-23, and
+    # morningstarts must be < eveningends. See also eveningends_minutes.
+    $morningstarts = $CFG->block_mrbs_morningstarts;
+    $eveningends   =$CFG->block_mrbs_eveningends;
+
+    # Minutes to add to $morningstarts to get to the real start of the day.
+    # Be sure to consider the value of $eveningends_minutes if you change
+    # this, so that you do not cause a day to finish before the start of
+    # the last period.  For example if resolution=3600 (1 hour)
+    # morningstarts = 8 and morningstarts_minutes = 30 then for the last
+    # period to start at say 4:30pm you would need to set eveningends = 16
+    # and eveningends_minutes = 30
+    $morningstarts_minutes = $CFG->block_mrbs_morningstarts_min;
+
+    # Minutes to add to $eveningends hours to get the real end of the day.
+    # Examples: To get the last slot on the calendar to be 16:30-17:00, set
+    # eveningends=16 and eveningends_minutes=30. To get a full 24 hour display
+    # with 15-minute steps, set morningstarts=0; eveningends=23;
+    # eveningends_minutes=45; and resolution=900.
+    $eveningends_minutes = $CFG->block_mrbs_eveningends_min;
+}
 
 # Define the name or description for your periods in chronological order
 # For example:
@@ -108,28 +110,39 @@
 # when the browser determines the column widths to use in day and week
 # views
 
-$periods[] = "Period&nbsp;1";
-$periods[] = "Period&nbsp;2";
-$periods[] = "Period&nbsp;3";
-$periods[] = "Period&nbsp;4";
-$periods[] = "Period&nbsp;5";
-$periods[] = "Period&nbsp;6";
-$periods[] = "Period&nbsp;7";
-$periods[] = "Period&nbsp;8";
-$periods[] = "Period&nbsp;9";
-$periods[] = "Period&nbsp;10";
-$periods[] = "Period&nbsp;11";
-$periods[] = "Period&nbsp;12";
+// Moodle HACK
+
+if(!isset($CFG->block_mrbs_periods) or empty($CFG->block_mrbs_periods)) {
+    $periods[] = "Period&nbsp;1";
+    $periods[] = "Period&nbsp;2";
+    $periods[] = "Period&nbsp;3";
+    $periods[] = "Period&nbsp;4";
+    $periods[] = "Period&nbsp;5";
+    $periods[] = "Period&nbsp;6";
+    $periods[] = "Period&nbsp;7";
+    $periods[] = "Period&nbsp;8";
+    $periods[] = "Period&nbsp;9";
+    $periods[] = "Period&nbsp;10";
+    $periods[] = "Period&nbsp;11";
+    $periods[] = "Period&nbsp;12";
+}
+else {
+    $pds = explode("\n", $CFG->block_mrbs_periods);
+    foreach ($pds as $pd) {
+        $pd = trim($pd);
+        $periods[] = $pd;
+    }
+}
 
 # Start of week: 0 for Sunday, 1 for Monday, etc.
-$weekstarts = 0;
+$weekstarts = $CFG->block_mrbs_weekstarts;
 
 # Trailer date format: 0 to show dates as "Jul 10", 1 for "10 Jul"
-$dateformat = 0;
+$dateformat = $CFG->block_mrbs_dateformat;
 
 # Time format in pages. 0 to show dates in 12 hour format, 1 to show them
 # in 24 hour format
-$twentyfourhour_format = 1;
+$twentyfourhour_format = $CFG->block_mrbs_timeformat;
 
 ########################
 # Miscellaneous settings
Index: plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php,v
retrieving revision 1.2
diff -u -r1.2 block_mrbs.php
--- plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php	19 Mar 2008 15:46:17 -0000	1.2
+++ plugins/blocks/mrbs/lang/de_utf8/block_mrbs.php	30 Jul 2008 17:23:22 -0000
@@ -1,4 +1,4 @@
-<?php // $Id: block_mrbs.php,v 1.2 2008/03/19 15:46:17 arborrow Exp $
+<?php // $Id: block_mrbs.php,v 1.1.2.4 2008/03/19 15:48:17 arborrow Exp $
 $string['blockname'] = 'Buchungs-System';
 $string['adminview'] = 'Unter welcher URL ist Ihr  MRBS installiert?';
 $string['mustlogin'] = 'Sie müssen sich anmelden um den Kalender zu sehen';
@@ -6,4 +6,36 @@
 $string['mrbs:viewmrbs'] = 'Zugriff MRBS (nur lesen)';
 $string['mrbs:editmrbs'] = 'Zugriff MRBS (lesen / schreiben)';
 $string['mrbs:administermrbs'] = 'Zugriff MRBS (lesen / schreiben / administration)';
+$string['serverpath'] = 'MRBS Installationspfad';
+$string['config_admin'] = 'MRBS Admin';
+$string['config_admin2'] = 'Name vom MRBS Administrator';
+$string['config_admin_email'] = 'MRBS Administrator E-Mail';
+$string['config_admin_email2'] = 'E-Mail Adresse vom MRBS Administrator';
+$string['config_enable_periods'] = 'Selbst definierte Zeitangaben';
+$string['config_enable_periods2'] = 'Eigene Zeitangaben für MRBS Buchung. Wenn hier NEIN gewählt wird, die die folgende - Zeit-Block - Einstellung übernommen.';
+$string['config_resolution'] = 'Zeit-Block';
+$string['config_resolution2']  = 'Zeit-Block in dem gebucht werden kann. \"Selbst definierte Zeitangaben\" muss deaktiviert sein, damit diese Einstellung übernommen wird.';
+$string['resolution_units'] = ' Minuten';
+
+$string['config_morningstarts'] = 'Start Stunde';
+$string['config_morningstarts2']  = 'Startzeit (Stunde) des Tages, \"Selbst definierte Zeitangabe\" muss deaktiviert sein, damit diese Einstellung übernommen wird.';
+$string['config_morningstarts_min'] = 'Start Minute';
+$string['config_morningstarts_min2']  = 'Startzeit (Minute) des Tages, \"Selbst definierte Zeitangabe\" muss deaktiviert sein, damit diese Einstellung übernommen wird.';
+
+$string['config_eveningends'] = 'Endzeit Stunde';
+$string['config_eveningends2']  = 'Endzeit (Stunde) des Tages, \"Selbst definierte Zeitangabe\" muss deaktiviert sein, damit diese Einstellung übernommen wird.';
+$string['config_eveningends_min'] = 'Endzeit Minute';
+$string['config_eveningends_min2']  = 'Endzeit (Minute) des Tages, \"Selbst definierte Zeitangabe\" muss deaktiviert sein, damit diese Einstellung übernommen wird.';
+
+$string['config_periods'] = 'Selbstdefinierte Zeiten';
+$string['config_periods2']  = 'Definieren Sie Ihre eigenen Namen oder Beschreibungen für Ihre Bedürfnisse in zeitlicher Reihenfolge. Ein Eintrag pro Zeile (Beispiel: 1.Std:7.30 - 9.00 Uhr)';
+
+$string['config_weekstarts'] = '1.Wochentag';
+$string['config_weekstarts2']  = 'Wählen Sie hier den ersten Wochentag aus.';
+$string['config_dateformat'] = 'Datumsformatierung';
+$string['config_dateformat2']  = 'Datumsformat wie es MRBS darstellt.';
+$string['config_date_mmddyy'] = 'Juli 10';
+$string['config_date_ddmmyy']  = '10 Juli';
+$string['config_timeformat'] = 'Zeitformatierung';
+$string['config_timeformat2']  = 'Zeitformat wie es MRBS darstellt.';
 ?>

