Revision: 1364
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1364&view=rev
Author:   cimorrison
Date:     2010-07-01 13:12:47 +0000 (Thu, 01 Jul 2010)

Log Message:
-----------
Removed the getting of the standard variables $day, $month, $year, $area and 
$room together with the setting of sensible defaults into a new include file, 
standard_vars.inc.php.

Modified Paths:
--------------
    mrbs/trunk/web/add.php
    mrbs/trunk/web/admin.php
    mrbs/trunk/web/confirm_entry_handler.php
    mrbs/trunk/web/day.php
    mrbs/trunk/web/defaultincludes.inc
    mrbs/trunk/web/del.php
    mrbs/trunk/web/del_entry.php
    mrbs/trunk/web/edit_area_room.php
    mrbs/trunk/web/edit_entry.php
    mrbs/trunk/web/edit_entry_handler.php
    mrbs/trunk/web/edit_users.php
    mrbs/trunk/web/help.php
    mrbs/trunk/web/index.php
    mrbs/trunk/web/month.php
    mrbs/trunk/web/pending.php
    mrbs/trunk/web/report.php
    mrbs/trunk/web/search.php
    mrbs/trunk/web/session_cookie.inc
    mrbs/trunk/web/session_php.inc
    mrbs/trunk/web/view_entry.php
    mrbs/trunk/web/week.php

Added Paths:
-----------
    mrbs/trunk/web/standard_vars.inc.php

Modified: mrbs/trunk/web/add.php
===================================================================
--- mrbs/trunk/web/add.php      2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/add.php      2010-07-01 13:12:47 UTC (rev 1364)
@@ -4,11 +4,7 @@
 
 require_once "defaultincludes.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
+// Get non-standard form variables
 $name = get_form_var('name', 'string');
 $description = get_form_var('description', 'string');
 $capacity = get_form_var('capacity', 'int');

Modified: mrbs/trunk/web/admin.php
===================================================================
--- mrbs/trunk/web/admin.php    2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/admin.php    2010-07-01 13:12:47 UTC (rev 1364)
@@ -4,12 +4,7 @@
 
 require_once "defaultincludes.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
+// Get non-standard form variables
 $area_name = get_form_var('area_name', 'string');
 $error = get_form_var('error', 'string');
 // the image buttons:  need to specify edit_x rather than edit etc. because
@@ -17,20 +12,7 @@
 $edit_x = get_form_var('edit_x', 'int');
 $delete_x = get_form_var('delete_x', 'int');
 
-// If we dont know the right date then make it up 
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
-
 // Check to see whether the Edit or Delete buttons have been pressed and 
redirect
 // as appropriate
 $std_query_string = "area=$area&day=$day&month=$month&year=$year";

Modified: mrbs/trunk/web/confirm_entry_handler.php
===================================================================
--- mrbs/trunk/web/confirm_entry_handler.php    2010-06-29 21:48:54 UTC (rev 
1363)
+++ mrbs/trunk/web/confirm_entry_handler.php    2010-07-01 13:12:47 UTC (rev 
1364)
@@ -7,11 +7,7 @@
 require_once "mrbs_sql.inc";
 require_once "functions_mail.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
+// Get non-standard form variables
 $action = get_form_var('action', 'string');
 $id = get_form_var('id', 'int');
 $series = get_form_var('series', 'int');
@@ -19,19 +15,7 @@
 $room_id = get_form_var('room_id', 'int');
 $note = get_form_var('note', 'string');
 
-// If we dont know the right date then make it up 
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 $user = getUserName();

Modified: mrbs/trunk/web/day.php
===================================================================
--- mrbs/trunk/web/day.php      2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/day.php      2010-07-01 13:12:47 UTC (rev 1364)
@@ -2,16 +2,10 @@
 // $Id$
 
 require_once "defaultincludes.inc";
-
 require_once "mincals.inc";
 require_once "theme.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');  // not needed for the main display, but 
needed for trailer links
+// Get non-standard form variables
 $timetohighlight = get_form_var('timetohighlight', 'int');
 $debug_flag = get_form_var('debug_flag', 'int');
 
@@ -20,38 +14,6 @@
   $debug_flag = 0;
 }
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
-// Get the timeslot settings (resolution, etc.) for this area
-get_area_settings($area);
-
-
-// If we don't know the right date then use today:
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-else
-{
-  // Make the date valid if day is more than number of days in month:
-  while (!checkdate($month, $day, $year))
-  {
-    $day--;
-    if ($day == 0)
-    {
-      $day   = date("d");
-      $month = date("m");
-      $year  = date("Y");   
-      break;
-    }
-  }
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/defaultincludes.inc
===================================================================
--- mrbs/trunk/web/defaultincludes.inc  2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/defaultincludes.inc  2010-07-01 13:12:47 UTC (rev 1364)
@@ -8,5 +8,6 @@
 require_once "functions.inc";
 require_once "dbsys.inc";
 require_once "mrbs_auth.inc";
+require_once "standard_vars.inc.php";
 
 ?>

Modified: mrbs/trunk/web/del.php
===================================================================
--- mrbs/trunk/web/del.php      2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/del.php      2010-07-01 13:12:47 UTC (rev 1364)
@@ -3,26 +3,10 @@
 
 require_once "defaultincludes.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
+// Get non-standard form variables
 $type = get_form_var('type', 'string');
 $confirm = get_form_var('confirm', 'string');
 
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-if (empty($area))
-{
-  $area = get_default_area();
-}
 
 // Check the user is authorised for this page
 checkAuthorised();

Modified: mrbs/trunk/web/del_entry.php
===================================================================
--- mrbs/trunk/web/del_entry.php        2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/del_entry.php        2010-07-01 13:12:47 UTC (rev 1364)
@@ -2,14 +2,9 @@
 // $Id$
 
 require_once "defaultincludes.inc";
-
 require_once "mrbs_sql.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
+// Get non-standard form variables
 $id = get_form_var('id', 'int');
 $series = get_form_var('series', 'int');
 $returl = get_form_var('returl', 'string');

Modified: mrbs/trunk/web/edit_area_room.php
===================================================================
--- mrbs/trunk/web/edit_area_room.php   2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/edit_area_room.php   2010-07-01 13:12:47 UTC (rev 1364)
@@ -43,17 +43,11 @@
 // the fieldname, eg 'coffee_machine'.
 
 require_once "defaultincludes.inc";
-
 require_once "mrbs_sql.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
+// Get non-standard form variables
 $new_area = get_form_var ('new_area', 'int');
 $old_area = get_form_var ('old_area', 'int');
-$room = get_form_var('room', 'int');
 $room_name = get_form_var('room_name', 'string');
 $sort_key = get_form_var('sort_key', 'string');
 $old_room_name = get_form_var('old_room_name', 'string');
@@ -115,14 +109,6 @@
   }
 }
 
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/edit_entry.php
===================================================================
--- mrbs/trunk/web/edit_entry.php       2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/edit_entry.php       2010-07-01 13:12:47 UTC (rev 1364)
@@ -2,44 +2,20 @@
 // $Id$
 
 require_once "defaultincludes.inc";
-
 require_once "mrbs_sql.inc";
 
 global $twentyfourhour_format;
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
+// Get non-standard form variables
 $hour = get_form_var('hour', 'int');
 $minute = get_form_var('minute', 'int');
 $period = get_form_var('period', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
 $id = get_form_var('id', 'int');
 $copy = get_form_var('copy', 'int');
 $edit_type = get_form_var('edit_type', 'string');
 $returl = get_form_var('returl', 'string');
 $private = get_form_var('private', 'string');
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
-// Get the timeslot settings (resolution, etc.) for this area
-// (We will need to update them later if we are editing an existing
-//  booking - once we know the area for that booking)
-get_area_settings($area);
-
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-
 if (!isset($edit_type))
 {
   $edit_type = "";

Modified: mrbs/trunk/web/edit_entry_handler.php
===================================================================
--- mrbs/trunk/web/edit_entry_handler.php       2010-06-29 21:48:54 UTC (rev 
1363)
+++ mrbs/trunk/web/edit_entry_handler.php       2010-07-01 13:12:47 UTC (rev 
1364)
@@ -2,15 +2,9 @@
 // $Id$
 
 require_once "defaultincludes.inc";
-
 require_once "mrbs_sql.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
+// Get non-standard form variables
 $create_by = get_form_var('create_by', 'string');
 $name = get_form_var('name', 'string');
 $rep_type = get_form_var('rep_type', 'int');
@@ -45,22 +39,18 @@
 // rather than silent truncation of the string.
 $name = substr($name, 0, $maxlength['entry.name']);
 
-if (empty($area))
+// Make sure the area corresponds to the room that is being booked
+if (!empty($rooms[0]))
 {
-  if (empty($rooms[0]))
-  {
-    $area = get_default_area();
-  }
-  else
-  {
-    $area = get_area($rooms[0]);
-  }
+  $area = get_area($rooms[0]);
+  get_area_settings($area);  // Update the area settings
 }
+// and that $room is in $area
+if (get_area($room) != $area)
+{
+  $room = get_default_room($area);
+}
 
-// Get the timeslot settings (resolution, etc.) for this area
-get_area_settings($area);
-
-
 // When $all_day is set, the hour and minute (or $period) fields are set to 
disabled, which means 
 // that they are not passed through by the form.   We need to set them because 
they are needed below  
 // in various places. (We could change the JavaScript in edit_entry.php to set 
the fields to readonly

Modified: mrbs/trunk/web/edit_users.php
===================================================================
--- mrbs/trunk/web/edit_users.php       2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/edit_users.php       2010-07-01 13:12:47 UTC (rev 1364)
@@ -40,11 +40,7 @@
 
 require_once "defaultincludes.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
+// Get non-standard form variables
 $Action = get_form_var('Action', 'string');
 $Id = get_form_var('Id', 'int');
 $password0 = get_form_var('password0', 'string');

Modified: mrbs/trunk/web/help.php
===================================================================
--- mrbs/trunk/web/help.php     2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/help.php     2010-07-01 13:12:47 UTC (rev 1364)
@@ -3,28 +3,8 @@
 // $Id$
 
 require_once "defaultincludes.inc";
-
 require_once "version.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
-
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/index.php
===================================================================
--- mrbs/trunk/web/index.php    2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/index.php    2010-07-01 13:12:47 UTC (rev 1364)
@@ -10,22 +10,20 @@
 require_once "defaultincludes.inc";
 require_once "mrbs_sql.inc";
 
-$day   = date("d");
-$month = date("m");
-$year  = date("Y");
-
 switch ($default_view)
 {
   case "month":
-    $redirect_str = "month.php?year=$year&month=$month";
+    $redirect_str = "month.php";
     break;
   case "week":
-    $redirect_str = "week.php?year=$year&month=$month&day=$day";
+    $redirect_str = "week.php";
     break;
   default:
-    $redirect_str = "day.php?day=$day&month=$month&year=$year";
+    $redirect_str = "day.php";
 }
 
+$redirect_str .= "?year=$year&month=$month&day=$day";
+
 if ( ! empty($default_room) )
 {
   $area = mrbsGetRoomArea($default_room);

Modified: mrbs/trunk/web/month.php
===================================================================
--- mrbs/trunk/web/month.php    2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/month.php    2010-07-01 13:12:47 UTC (rev 1364)
@@ -4,15 +4,8 @@
 // mrbs/month.php - Month-at-a-time view
 
 require_once "defaultincludes.inc";
-
 require_once "mincals.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
 $debug_flag = get_form_var('debug_flag', 'int');
 
 // 3-value compare: Returns result of compare as "< " "= " or "> ".
@@ -35,42 +28,6 @@
   $debug_flag = 0;
 }
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
-// Get the timeslot settings (resolution, etc.) for this area
-get_area_settings($area);
-
-// If we don't know the right date then use today:
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-else
-{
-  // Make the date valid if day is more than number of days in month:
-  while (!checkdate($month, $day, $year))
-  {
-    $day--;
-    if ($day == 0)
-    {
-      $day   = date("d");
-      $month = date("m");
-      $year  = date("Y");   
-      break;
-    }
-  }
-}
-
-if (empty($room))
-{
-  $room = get_default_room($area);
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/pending.php
===================================================================
--- mrbs/trunk/web/pending.php  2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/pending.php  2010-07-01 13:12:47 UTC (rev 1364)
@@ -133,25 +133,7 @@
   echo "</tr>\n";  
 }
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
 
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/report.php
===================================================================
--- mrbs/trunk/web/report.php   2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/report.php   2010-07-01 13:12:47 UTC (rev 1364)
@@ -534,12 +534,7 @@
   }
 }
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
+// Get non-standard form variables
 $From_day = get_form_var('From_day', 'int');
 $From_month = get_form_var('From_month', 'int');
 $From_year = get_form_var('From_year', 'int');
@@ -558,18 +553,6 @@
 $sumby = get_form_var('sumby', 'string');
 
 
-//If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-if(empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/search.php
===================================================================
--- mrbs/trunk/web/search.php   2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/search.php   2010-07-01 13:12:47 UTC (rev 1364)
@@ -3,31 +3,12 @@
 
 require_once "defaultincludes.inc";
 
-// Get form variables
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
+// Get non-standard form variables
 $search_str = get_form_var('search_str', 'string');
 $search_pos = get_form_var('search_pos', 'int');
 $total = get_form_var('total', 'int');
 $advanced = get_form_var('advanced', 'int');
 
-
-// If we dont know the right date then make it up 
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/session_cookie.inc
===================================================================
--- mrbs/trunk/web/session_cookie.inc   2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/session_cookie.inc   2010-07-01 13:12:47 UTC (rev 1364)
@@ -22,12 +22,11 @@
 
 // We use some functions from here
 require_once "functions.inc";
-
 require_once('Blowfish.php');
 
 $blowfish = new Crypt_Blowfish($auth['session_cookie']['secret']);
 
-// Get form variables
+// Get non-standard form variables
 $Action = get_form_var('Action', 'string');
 $NewUserName = get_form_var('NewUserName', 'string');
 $NewUserPassword = get_form_var('NewUserPassword', 'string');

Modified: mrbs/trunk/web/session_php.inc
===================================================================
--- mrbs/trunk/web/session_php.inc      2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/session_php.inc      2010-07-01 13:12:47 UTC (rev 1364)
@@ -20,7 +20,7 @@
 
 global $PHP_SELF;
 
-// Get form variables
+// Get non-standard form variables
 $Action = get_form_var('Action', 'string');
 $NewUserName = get_form_var('NewUserName', 'string');
 $NewUserPassword = get_form_var('NewUserPassword', 'string');

Added: mrbs/trunk/web/standard_vars.inc.php
===================================================================
--- mrbs/trunk/web/standard_vars.inc.php                                (rev 0)
+++ mrbs/trunk/web/standard_vars.inc.php        2010-07-01 13:12:47 UTC (rev 
1364)
@@ -0,0 +1,51 @@
+<?php
+
+// $Id$
+
+// Gets the standard variables of $day, $month, $year, $area and $room
+// Checks that they are valid and assigns sensible defaults if not
+
+// Get the standard form variables
+$day = get_form_var('day', 'int');
+$month = get_form_var('month', 'int');
+$year = get_form_var('year', 'int');
+$area = get_form_var('area', 'int');
+$room = get_form_var('room', 'int');
+
+// If we don't know the right date then use today's date
+if (!isset($day) or !isset($month) or !isset($year))
+{
+  $day   = date("d");
+  $month = date("m");
+  $year  = date("Y");
+}
+else
+{
+  // Make the date valid if day is more than number of days in month:
+  while (!checkdate($month, $day, $year))
+  {
+    $day--;
+    if ($day == 0)
+    {
+      $day   = date("d");
+      $month = date("m");
+      $year  = date("Y");   
+      break;
+    }
+  }
+}
+
+if (empty($area))
+{
+  $area = get_default_area();
+}
+
+if (empty($room))
+{
+  $room = get_default_room($area);
+}
+
+// Get the settings (resolution, etc.) for this area
+get_area_settings($area);
+
+?>
\ No newline at end of file


Property changes on: mrbs/trunk/web/standard_vars.inc.php
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Modified: mrbs/trunk/web/view_entry.php
===================================================================
--- mrbs/trunk/web/view_entry.php       2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/view_entry.php       2010-07-01 13:12:47 UTC (rev 1364)
@@ -84,33 +84,16 @@
 }
     
 
-// Get form variables
+// Get non-standard form variables
 //
 // If $series is TRUE, it means that the $id is the id of an 
 // entry in the repeat table.  Otherwise it's from the entry table.
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
 $id = get_form_var('id', 'int');
 $series = get_form_var('series', 'int');
 $action = get_form_var('action', 'string');
 $returl = get_form_var('returl', 'string');
 $error = get_form_var('error', 'string');
 
-// If we dont know the right date then make it up
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 

Modified: mrbs/trunk/web/week.php
===================================================================
--- mrbs/trunk/web/week.php     2010-06-29 21:48:54 UTC (rev 1363)
+++ mrbs/trunk/web/week.php     2010-07-01 13:12:47 UTC (rev 1364)
@@ -4,17 +4,11 @@
 // mrbs/week.php - Week-at-a-time view
 
 require_once "defaultincludes.inc";
-
 require_once "mincals.inc";
 require_once "theme.inc";
 
-// Get form variables
+// Get non-standard form variables
 $debug_flag = get_form_var('debug_flag', 'int');
-$day = get_form_var('day', 'int');
-$month = get_form_var('month', 'int');
-$year = get_form_var('year', 'int');
-$area = get_form_var('area', 'int');
-$room = get_form_var('room', 'int');
 $timetohighlight = get_form_var('timetohighlight', 'int');
 
 if (empty($debug_flag))
@@ -22,39 +16,8 @@
   $debug_flag = 0;
 }
 
-if (empty($area))
-{
-  $area = get_default_area();
-}
-
-// Get the timeslot settings (resolution, etc.) for this area
-get_area_settings($area);
-
 $num_of_days=7; //could also pass this in as a parameter or whatever
 
-// If we don't know the right date then use today:
-if (!isset($day) or !isset($month) or !isset($year))
-{
-  $day   = date("d");
-  $month = date("m");
-  $year  = date("Y");
-}
-else
-{
-  // Make the date valid if day is more than number of days in month:
-  while (!checkdate($month, $day, $year))
-  {
-    $day--;
-    if ($day == 0)
-    {
-      $day   = date("d");
-      $month = date("m");
-      $year  = date("Y");   
-      break;
-    }
-  }
-}
-
 // Check the user is authorised for this page
 checkAuthorised();
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to