### Eclipse Workspace Patch 1.0
#P contrib
Index: plugins/blocks/mrbs/web/mincals.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/web/mincals.php,v
retrieving revision 1.3
diff -u -r1.3 mincals.php
--- plugins/blocks/mrbs/web/mincals.php	4 Aug 2008 01:17:51 -0000	1.3
+++ plugins/blocks/mrbs/web/mincals.php	15 Aug 2008 09:08:41 -0000
@@ -97,7 +97,7 @@
       for ($i = 0, $s = ""; $i < 7; $i++)
       {
          $show = $basetime + ($i * 24 * 60 * 60);
-         $fl = userdate($show, '%a');
+         $fl = strftime('%a', $show);
          $s .= "<td align=center valign=top class=\"calendarHeader\">$fl</td>\n";
       }
       return $s;
@@ -129,7 +129,7 @@
         $daysInPrevMonth = $this->getDaysInMonth($prevMonth, $prevYear);
         $date = mktime(12, 0, 0, $this->month, 1, $this->year);
         
-        $first = (userdate($date, "%w") + 7 - $weekstarts) % 7;
+        $first = (strftime('%w', $date) + 7 - $weekstarts) % 7;
         $monthName = userdate($date, "%B");
         
         //$prevMonth = $this->getCalendarLink($this->month - 1 >   0 ? $this->month - 1 : 12, $this->month - 1 >   0 ? $this->year : $this->year - 1);
Index: plugins/blocks/mrbs/web/mrbs_sql.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/web/mrbs_sql.php,v
retrieving revision 1.6
diff -u -r1.6 mrbs_sql.php
--- plugins/blocks/mrbs/web/mrbs_sql.php	4 Aug 2008 01:17:51 -0000	1.6
+++ plugins/blocks/mrbs/web/mrbs_sql.php	15 Aug 2008 09:08:41 -0000
@@ -199,6 +199,7 @@
 	$sql_coln[] = 'create_by';	$sql_val[] = '\''.$owner.'\'';
 	$sql_coln[] = 'type';		$sql_val[] = '\''.$type.'\'';
 	$sql_coln[] = 'name';		$sql_val[] = '\''.$name.'\'';
+    $sql_coln[] = 'timestamp'; $sql_val[]  = $timestamp;
 
 	// Optional things, pgsql doesn't like empty strings!
 	if (!empty($rep_opt))
@@ -211,9 +212,8 @@
 		{$sql_coln[] = 'rep_num_weeks';	$sql_val[] = $rep_num_weeks;}
 
 	$sql = 'INSERT INTO ' . $tbl_repeat .
-	       ' (' . implode(', ',$sql_coln) . 'timestamp) '.
-	       'VALUES (' . implode(', ',$sql_val) . ',$timestamp)';
-
+	       ' (' . implode(', ',$sql_coln) . ') '.
+	       'VALUES (' . implode(', ',$sql_val) . ')';
 
 	if (sql_command($sql) < 0) return 0;
 	
@@ -403,6 +403,7 @@
 	}
 	
 	$ent = mrbsCreateRepeatEntry($starttime, $endtime, $rep_type, $rep_enddate, $rep_opt, $room_id, $owner, $name, $type, $description, $rep_num_weeks);
+    
 	if($ent)
 	{
 	
Index: plugins/blocks/mrbs/web/edit_entry_handler.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/web/edit_entry_handler.php,v
retrieving revision 1.6
diff -u -r1.6 edit_entry_handler.php
--- plugins/blocks/mrbs/web/edit_entry_handler.php	5 Aug 2008 04:54:59 -0000	1.6
+++ plugins/blocks/mrbs/web/edit_entry_handler.php	15 Aug 2008 09:08:41 -0000
@@ -14,7 +14,17 @@
 $area = optional_param('area', get_default_area(),  PARAM_INT);
 $create_by = optional_param('create_by', '', PARAM_TEXT);
 $id = optional_param('id', 0, PARAM_INT);
+$rep_type = optional_param('rep_type', 0, PARAM_INT);
+$rep_end_month = optional_param('rep_end_month', 0, PARAM_INT);
+$rep_end_day = optional_param('rep_end_day', 0, PARAM_INT);
+$rep_end_year = optional_param('rep_end_year', 0, PARAM_INT);
+$rep_num_weeks = optional_param('rep_num_weeks', 0, PARAM_INT);
+$rep_day = optional_param('rep_day',NULL, PARAM_RAW);
+$rep_opt = optional_param('rep_opt','',PARAM_SEQUENCE);
+$rep_enddate = optional_param('rep_enddate',0,PARAM_INT);
 
+# $all_day
+# echo $rep_type;
 
 // $rooms - followup and see how this is passed -ab.
 // $edit_type  - followup and see how this is passed -ab.
@@ -137,13 +147,12 @@
     $endtime += cross_dst( $starttime, $endtime );
 }
 
-if(isset($rep_type) && isset($rep_end_month) && isset($rep_end_day) && isset($rep_end_year))
-{
+if(isset($rep_type) && isset($rep_end_month) && isset($rep_end_day) && isset($rep_end_year)) {
     // Get the repeat entry settings
     $rep_enddate = mktime($hour, $minute, 0, $rep_end_month, $rep_end_day, $rep_end_year);
-}
-else
-    $rep_type = 0;
+    } else {
+        $rep_type = 0; 
+    }
 
 if(!isset($rep_day))
     $rep_day = array();
@@ -216,6 +225,7 @@
             $new_id = mrbsCreateRepeatingEntrys($starttime, $endtime,   $rep_type, $rep_enddate, $rep_opt,
                                       $room_id,   $create_by, $name,     $type,        $description,
                                       isset($rep_num_weeks) ? $rep_num_weeks : 0);
+                               
             // Send a mail to the Administrator
             if (MAIL_ADMIN_ON_BOOKINGS or MAIL_AREA_ADMIN_ON_BOOKINGS or MAIL_ROOM_ADMIN_ON_BOOKINGS or MAIL_BOOKER) {
                 // Send a mail only if this a new entry, or if this is an
