Revision: 1259
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1259&view=rev
Author:   cimorrison
Date:     2009-11-12 14:19:25 +0000 (Thu, 12 Nov 2009)

Log Message:
-----------
Added a print_simple_header() function for use when the normal header uses 
features which are not yet available.   Used in the first instance by the 
database upgrade procedure as the normal header now checks the database for 
outstanding provisional bookings.

Modified Paths:
--------------
    mrbs/branches/provisional_bookings/web/Themes/default/header.inc
    mrbs/branches/provisional_bookings/web/dbsys.inc
    mrbs/branches/provisional_bookings/web/functions.inc
    mrbs/branches/provisional_bookings/web/systemdefaults.inc.php

Modified: mrbs/branches/provisional_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/provisional_bookings/web/Themes/default/header.inc    
2009-11-12 00:35:47 UTC (rev 1258)
+++ mrbs/branches/provisional_bookings/web/Themes/default/header.inc    
2009-11-12 14:19:25 UTC (rev 1259)
@@ -33,9 +33,9 @@
   header("Content-Type: text/html; charset=" . get_charset());
   header("Pragma: no-cache");                          // HTTP 1.0
   header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
+  echo DOCTYPE;
+?>
 
-?>
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>
 <html>
   <head>
 <?php

Modified: mrbs/branches/provisional_bookings/web/dbsys.inc
===================================================================
--- mrbs/branches/provisional_bookings/web/dbsys.inc    2009-11-12 00:35:47 UTC 
(rev 1258)
+++ mrbs/branches/provisional_bookings/web/dbsys.inc    2009-11-12 14:19:25 UTC 
(rev 1259)
@@ -634,12 +634,16 @@
   require_once "functions.inc";
   require_once "upgrade.inc";
 
-  print_header(0,0,0,0,"");
+  // Just use a simple header as the normal header may (a) use features
+  // which are not available until after the database upgrade or (b) use
+  // functions which are not available until after dbsys has run.
+  print_simple_header();
  
+  echo "<h1>" . get_vocab("mrbs") . "</h1>\n";
+  echo "<p class=\"error\">" . get_vocab("upgrade_required") . "</p>\n"; 
+
   // We need to open a connection to the database with a database
   // username that has admin rights.
-  echo "<p class=\"error\">" . get_vocab("upgrade_required") . "</p>\n"; 
-
   while (empty($admin_handle))
   {
     $db_admin_username = get_form_var('form_username', 'string');

Modified: mrbs/branches/provisional_bookings/web/functions.inc
===================================================================
--- mrbs/branches/provisional_bookings/web/functions.inc        2009-11-12 
00:35:47 UTC (rev 1258)
+++ mrbs/branches/provisional_bookings/web/functions.inc        2009-11-12 
14:19:25 UTC (rev 1259)
@@ -35,7 +35,36 @@
 
 $done_header = FALSE;
 
+// Prints a very simple header.  This may be necessary on occasions, such as
+// during a database upgrade, when some of the features that the normal
+// header uses are not yet available.
+function print_simple_header()
+{
+  global $done_header;
+ 
+  if ($done_header)
+  {
+    return;
+  } 
+  
+  header("Content-Type: text/html; charset=" . get_charset());
+  header("Pragma: no-cache");                          // HTTP 1.0
+  header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
+  echo DOCTYPE;
+ ?>
 
+<html>
+  <head>
+    <?php
+      require_once "style.inc";
+    ?>
+    <title><?php echo get_vocab("mrbs") ?></title>
+  </head>
+  <body>
+  <?php
+  $done_header = TRUE; 
+}
+
 // Print the page header
 function print_header($day, $month, $year, $area, $room)
 {

Modified: mrbs/branches/provisional_bookings/web/systemdefaults.inc.php
===================================================================
--- mrbs/branches/provisional_bookings/web/systemdefaults.inc.php       
2009-11-12 00:35:47 UTC (rev 1258)
+++ mrbs/branches/provisional_bookings/web/systemdefaults.inc.php       
2009-11-12 14:19:25 UTC (rev 1259)
@@ -743,6 +743,8 @@
  * DOCTYPE - internal use, do not change
  ***************************************/
 
+ define('DOCTYPE', '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd";>');
+ 
  // Records which DOCTYPE is being used.    Do not change - it will not change 
the DOCTYPE
  // that is used;  it is merely used when the code needs to know the DOCTYPE, 
for example
  // in calls to nl2br.   TRUE means XHTML, FALSE means HTML.


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

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to