diff -Naurw moodle-clean/moodle/blocks/mrbs/lang/en_utf8/block_mrbs.php moodle-dev/blocks/mrbs/lang/en_utf8/block_mrbs.php --- moodle-clean/moodle/blocks/mrbs/lang/en_utf8/block_mrbs.php 2009-04-22 12:31:36.000000000 +0100 +++ moodle-dev/blocks/mrbs/lang/en_utf8/block_mrbs.php 2009-05-08 11:17:09.000000000 +0100 @@ -22,6 +22,7 @@ $string['charset'] = 'UTF-8'; $string['class'] = 'class'; $string['click_to_reserve'] = 'Click on the cell to make a reservation.'; +$string['computerroom'] = 'Computer rooms only'; $string['config_admin_email'] = 'MRBS admin email'; $string['config_admin_email2'] = 'Email address of the MRBS administrator. In order to receive MRBS email notifications, the email address must be associated with a Moodle user account.'; $string['config_admin'] = 'MRBS Admin'; @@ -162,6 +163,7 @@ $string['match_entry'] = 'Match brief description'; $string['match_room'] = 'Match room'; $string['match_type'] = 'Match type'; +$string['mincapacity'] = 'Minimum capacity'; $string['minutes'] = 'minutes'; //duplicated in moodle.php but needed for view_entry.php foreach loop $string['monthafter'] = 'Go To Month After'; $string['monthbefore'] = 'Go To Month Before'; @@ -186,7 +188,7 @@ $string['of'] = ' of '; $string['pagewindow'] = 'Same window'; $string['password_twice'] = 'If you wish to change the password, please type the new password twice'; -$string['period'] = 'Period'; +$string['period'] = 'Start Period'; $string['periods'] = 'periods'; $string['please_contact'] = 'Please contact '; $string['postbrowserlang'] = 'language.'; @@ -222,6 +224,7 @@ $string['room_admin_email'] = 'Room admin email'; $string['room'] = 'Room'; $string['rooms'] = 'Rooms'; +$string['roomsearch'] = 'Room Search'; $string['sched_conflict'] = 'Scheduling Conflict'; $string['search_for'] = 'Search For'; $string['search_results'] = 'Search Results for'; @@ -231,6 +234,7 @@ $string['slot'] = 'Slot'; $string['sort_rep_time'] = 'Start Date/Time'; $string['sort_rep'] = 'Sort Report by'; +$string['specialroom'] = 'Exclude special rooms'; $string['start_date'] = 'Start Time'; $string['submitquery'] = 'Run Report'; $string['sum_by_creator'] = 'Creator'; @@ -241,6 +245,7 @@ $string['summary_only'] = 'Summary only'; $string['sure'] = 'Are you sure?'; $string['system'] = 'System'; +$string['teachingroom'] = 'Teaching rooms only'; $string['through'] = ' through '; $string['too_may_entrys'] = 'The selected options will create too many entries.
Please use different options!'; $string['type'] = 'Type'; diff -Naurw moodle-clean/moodle/blocks/mrbs/web/edit_entry.php moodle-dev/blocks/mrbs/web/edit_entry.php --- moodle-clean/moodle/blocks/mrbs/web/edit_entry.php 2009-05-08 11:11:13.000000000 +0100 +++ moodle-dev/blocks/mrbs/web/edit_entry.php 2009-05-08 11:07:14.000000000 +0100 @@ -21,6 +21,8 @@ // $rep_type could use a closer look but I believe this is not passed via URL -ab. $start_min = optional_param('start_min', 0, PARAM_INT); $rep_num_weeks = optional_param('rep_num_weeks', 0, PARAM_INT); +$duration = optional_param('duration', 60, PARAM_INT); +$all_day = optional_param('all_day', FALSE, PARAM_BOOL); #If we dont know the right date then make it up if(($day==0) or ($month==0) or ($year==0)) @@ -72,14 +74,18 @@ $name = $row[0]; $create_by = $row[1]; $description = $row[2]; + $start_time = $row[3]; $start_day = userdate($row[3], '%d'); $start_month = userdate($row[3], '%m'); $start_year = userdate($row[3], '%Y'); $start_hour = userdate($row[3], '%H'); $start_min = userdate($row[3], '%M'); + $end_time = $row[4]; $duration = $row[4] - $row[3] - cross_dst($row[3], $row[4]); $type = $row[5]; $room_id = $row[6]; + //put this here so that a move can be coded into the get data + if(!empty($room)){$room_id=$room;} $entry_type = $row[7]; $rep_id = $row[8]; @@ -151,11 +157,12 @@ // Avoid notices for $hour and $minute if periods is enabled (isset($hour)) ? $start_hour = $hour : ''; (isset($minute)) ? $start_min = $minute : ''; - $duration = ($enable_periods ? 60 : 60 * 60); + //$duration = ($enable_periods ? 60 : 60 * 60); $type = "I"; $room_id = $room; + $start_time = mktime(12,$period,00,$start_month,$start_day,$start_year); unset($id); - + $end_time=$start_time; $rep_id = 0; $rep_type = 0; $rep_end_day = $day; diff -Naurw moodle-clean/moodle/blocks/mrbs/web/functions.php moodle-dev/blocks/mrbs/web/functions.php --- moodle-clean/moodle/blocks/mrbs/web/functions.php 2009-05-08 11:11:13.000000000 +0100 +++ moodle-dev/blocks/mrbs/web/functions.php 2009-05-08 11:09:20.000000000 +0100 @@ -74,7 +74,7 @@ <?php echo get_string('mrbs','block_mrbs') ?> + + + + + + +

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
: + ".userdate(mktime(1,0,0,1,1,2000), "%p"); + $checked = ($start_hour >= 12) ? "checked" : ""; + echo "".userdate(mktime(13,0,0,1,1,2000), "%p"); + } + ?> +
+ + +
+ + onClick="OnAllDayClick()"> '; ?> +
+
+ +
+ + +

+
DepartmentRoomDescriptionCapacity
+ + + + + + + diff -Naurw moodle-clean/moodle/blocks/mrbs/web/roomsearch_ss.php moodle-dev/blocks/mrbs/web/roomsearch_ss.php --- moodle-clean/moodle/blocks/mrbs/web/roomsearch_ss.php 1970-01-01 01:00:00.000000000 +0100 +++ moodle-dev/blocks/mrbs/web/roomsearch_ss.php 2009-03-26 16:38:11.000000000 +0000 @@ -0,0 +1,139 @@ + $max_periods ) + { + $duration = (24*60*floor($duration/$max_periods)) + ($duration%$max_periods); + } + if( $dur_units == "days" && $minute == 0 ) + { + $dur_units = "periods"; + $duration = $max_periods + ($duration-1)*60*24; + } + } + + // Units start in seconds + $units = 1.0; + + switch($dur_units) + { + case "years": + $units *= 52; + case "weeks": + $units *= 7; + case "days": + $units *= 24; + case "hours": + $units *= 60; + case "periods": + case "minutes": + $units *= 60; + case "seconds": + break; + } + + // Units are now in "$dur_units" numbers of seconds + + + if(isset($all_day) && ($all_day == "yes")) + { + if( $enable_periods ) + { + $starttime = mktime(12, 0, 0, $month, $day, $year); + $endtime = mktime(12, $max_periods, 0, $month, $day, $year); + } + else + { + $starttime = mktime($morningstarts, 0, 0, $month, $day , $year, is_dst($month, $day , $year)); + $end_minutes = $eveningends_minutes + $morningstarts_minutes; + ($eveningends_minutes > 59) ? $end_minutes += 60 : ''; + $endtime = mktime($eveningends, $end_minutes, 0, $month, $day, $year, is_dst($month, $day, $year)); + } + } + else + { + if (!$twentyfourhour_format) + { + if (isset($ampm) && ($ampm == "pm") && ($hour<12)) + { + $hour += 12; + } + if (isset($ampm) && ($ampm == "am") && ($hour>11)) + { + $hour -= 12; + } + } + + $starttime = mktime($hour, $minute, 0, $month, $day, $year, is_dst($month, $day, $year, $hour)); + $endtime = mktime($hour, $minute, 0, $month, $day, $year, is_dst($month, $day, $year, $hour)) + ($units * $duration); + # Round up the duration to the next whole resolution unit. + # If they asked for 0 minutes, push that up to 1 resolution unit. + $diff = $endtime - $starttime; + if (($tmp = $diff % $resolution) != 0 || $diff == 0) + $endtime += $resolution - $tmp; + + $endtime += cross_dst( $starttime, $endtime ); + } + + $sql = "SELECT $tbl_room.id, $tbl_room.room_name, $tbl_room.description, $tbl_room.capacity, $tbl_area.area_name, $tbl_room.area_id FROM $tbl_room JOIN $tbl_area on $tbl_room.area_id=$tbl_area.id WHERE ( SELECT COUNT(*) FROM $tbl_entry "; + +//old booking fully inside new booking +$sql .= "WHERE (($tbl_entry.start_time>=$starttime AND $tbl_entry.end_time<$endtime) "; +//new start time within old booking +$sql .= "OR ($tbl_entry.start_time<$starttime AND $tbl_entry.end_time>$starttime) "; +//new end time within old booking +$sql .= "OR ($tbl_entry.start_time<$endtime AND $tbl_entry.end_time>=$endtime)) "; + +$sql .= "AND mdl_mrbs_entry.room_id = mdl_mrbs_room.id ) < 1 AND $tbl_room.capacity >= $mincap "; + +if($computer){$sql.="AND description like 'Teaching IT%' ";} +if($teaching){$sql.="AND description like 'Teaching%' ";} +if($special){$sql.="AND description not like 'Teaching Specialist%' ";} + +$sql .= "ORDER BY area_name,room_name"; + + //echo$sql; + $res = get_records_sql($sql); + if($res){ + $list=''; + foreach ($res as $room){ + $list.=$room->area_name.','.$room->room_name.','.$room->description.','.$room->capacity."\n"; + } + //remove last \n to prevent blank row in table + echo substr($list, 0, -1); + } + + +?> \ No newline at end of file