Revision: 1881
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1881&view=rev
Author:   cimorrison
Date:     2011-08-24 09:28:52 +0000 (Wed, 24 Aug 2011)
Log Message:
-----------
- restructured report so that the output is in the form of a table.  Only very 
basic at this stage; not yet a DataTable
- removed the "Display" option from the form as it is now superfluous.  Start 
time, end time and duration will all be displayed as columns in the table and 
the column visibility feature will allow users to remove any columns they don't 
want.

Modified Paths:
--------------
    mrbs/branches/datatables/web/Themes/classic126/styling.inc
    mrbs/branches/datatables/web/Themes/default/styling.inc
    mrbs/branches/datatables/web/lang.ca
    mrbs/branches/datatables/web/lang.cs
    mrbs/branches/datatables/web/lang.da
    mrbs/branches/datatables/web/lang.de
    mrbs/branches/datatables/web/lang.el
    mrbs/branches/datatables/web/lang.en
    mrbs/branches/datatables/web/lang.es
    mrbs/branches/datatables/web/lang.eu
    mrbs/branches/datatables/web/lang.fi
    mrbs/branches/datatables/web/lang.fr
    mrbs/branches/datatables/web/lang.it
    mrbs/branches/datatables/web/lang.ja
    mrbs/branches/datatables/web/lang.ko
    mrbs/branches/datatables/web/lang.nl
    mrbs/branches/datatables/web/lang.no
    mrbs/branches/datatables/web/lang.pl
    mrbs/branches/datatables/web/lang.pt
    mrbs/branches/datatables/web/lang.sl
    mrbs/branches/datatables/web/lang.sv
    mrbs/branches/datatables/web/lang.tr
    mrbs/branches/datatables/web/lang.zh-cn
    mrbs/branches/datatables/web/lang.zh-tw
    mrbs/branches/datatables/web/mrbs.css.php
    mrbs/branches/datatables/web/report.php

Modified: mrbs/branches/datatables/web/Themes/classic126/styling.inc
===================================================================
--- mrbs/branches/datatables/web/Themes/classic126/styling.inc  2011-08-23 
10:39:00 UTC (rev 1880)
+++ mrbs/branches/datatables/web/Themes/classic126/styling.inc  2011-08-24 
09:28:52 UTC (rev 1881)
@@ -41,11 +41,10 @@
 $report_table_border_color      = $standard_font_color;
 $report_h2_border_color         = $banner_back_color;     // border colour for 
<h2> in report.php
 $report_h3_border_color         = "#879AA8";              // border colour for 
<h2> in report.php
-$report_entry_border_color      = "#C3CCD3";              // used to separate 
individual bookings in report.php
 
 $search_table_border_color      = $standard_font_color;
 
-$site_faq_entry_border_color    = $report_entry_border_color;    // used to 
separate individual FAQ's in help.php
+$site_faq_entry_border_color    = "#C3CCD3";          // used to separate 
individual FAQ's in help.php
 
 $trailer_border_color           = $main_table_border_color;
 

Modified: mrbs/branches/datatables/web/Themes/default/styling.inc
===================================================================
--- mrbs/branches/datatables/web/Themes/default/styling.inc     2011-08-23 
10:39:00 UTC (rev 1880)
+++ mrbs/branches/datatables/web/Themes/default/styling.inc     2011-08-24 
09:28:52 UTC (rev 1881)
@@ -41,11 +41,10 @@
 $report_table_border_color      = $standard_font_color;
 $report_h2_border_color         = $banner_back_color;     // border colour for 
<h2> in report.php
 $report_h3_border_color         = "#879AA8";              // border colour for 
<h2> in report.php
-$report_entry_border_color      = "#C3CCD3";              // used to separate 
individual bookings in report.php
 
 $search_table_border_color      = $standard_font_color;
 
-$site_faq_entry_border_color    = $report_entry_border_color;    // used to 
separate individual FAQ's in help.php
+$site_faq_entry_border_color    = "#C3CCD3";              // used to separate 
individual FAQ's in help.php
 
 $trailer_border_color           = $standard_font_color;
 

Modified: mrbs/branches/datatables/web/lang.ca
===================================================================
--- mrbs/branches/datatables/web/lang.ca        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.ca        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -176,9 +176,6 @@
 $vocab["submitquery"]        = "Executar informe";
 $vocab["sort_rep"]           = "Ordenar informe per";
 $vocab["sort_rep_time"]      = "Inici data/hora";
-$vocab["rep_dsp"]            = "Ensenya en l'informe";
-$vocab["rep_dsp_dur"]        = "Duració";
-$vocab["rep_dsp_end"]        = "Temps esgotat";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Anar a la setmana anterior";

Modified: mrbs/branches/datatables/web/lang.cs
===================================================================
--- mrbs/branches/datatables/web/lang.cs        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.cs        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "Vytvořit sestavu";
 $vocab["sort_rep"]           = "Seřadit výpis podle";
 $vocab["sort_rep_time"]      = "Výchozí den/čas";
-$vocab["rep_dsp"]            = "Zobrazit ve výpisu";
-$vocab["rep_dsp_dur"]        = "Trvání";
-$vocab["rep_dsp_end"]        = "Čas ukončení";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Týden dozadu";

Modified: mrbs/branches/datatables/web/lang.da
===================================================================
--- mrbs/branches/datatables/web/lang.da        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.da        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "Kør rapport";
 $vocab["sort_rep"]           = "Sort Report by";
 $vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Gå til ugen før";

Modified: mrbs/branches/datatables/web/lang.de
===================================================================
--- mrbs/branches/datatables/web/lang.de        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.de        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -274,9 +274,6 @@
 $vocab["submitquery"]        = "Bericht erstellen";
 $vocab["sort_rep"]           = "Sortiere Bericht nach";
 $vocab["sort_rep_time"]      = "Startzeit/Datum ";
-$vocab["rep_dsp"]            = "zeige im Bericht";
-$vocab["rep_dsp_dur"]        = "Dauer";
-$vocab["rep_dsp_end"]        = "Endzeit";
 $vocab["fulldescription_short"] = "Vollständige Beschreibung";
 $vocab["both"]               = "Alle";
 $vocab["privacy_status"]     = "Privatsphärenstatus";

Modified: mrbs/branches/datatables/web/lang.el
===================================================================
--- mrbs/branches/datatables/web/lang.el        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.el        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "Εκτέλεση αναφοράς";
 $vocab["sort_rep"]           = "Sort Report by";
 $vocab["sort_rep_time"]      = "Start Date/Time";
-$vocab["rep_dsp"]            = "Display in report";
-$vocab["rep_dsp_dur"]        = "Duration";
-$vocab["rep_dsp_end"]        = "End Time";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Μετάβαση στην προηγούμενη εβδομάδα";

Modified: mrbs/branches/datatables/web/lang.en
===================================================================
--- mrbs/branches/datatables/web/lang.en        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.en        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -279,9 +279,6 @@
 $vocab["submitquery"]           = "Run Report";
 $vocab["sort_rep"]              = "Sort report by";
 $vocab["sort_rep_time"]         = "Start date/time";
-$vocab["rep_dsp"]               = "Display in report";
-$vocab["rep_dsp_dur"]           = "Duration";
-$vocab["rep_dsp_end"]           = "End time";
 $vocab["fulldescription_short"] = "Full Description";
 $vocab["both"]                  = "All";
 $vocab["privacy_status"]        = "Privacy status";

Modified: mrbs/branches/datatables/web/lang.es
===================================================================
--- mrbs/branches/datatables/web/lang.es        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.es        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -278,9 +278,6 @@
 $vocab["submitquery"]        = "Pedir Informe";
 $vocab["sort_rep"]           = "Ordenar Informe por";
 $vocab["sort_rep_time"]      = "Fecha/Hora de Comienzo";
-$vocab["rep_dsp"]            = "Mostrar en Informe";
-$vocab["rep_dsp_dur"]        = "Duración";
-$vocab["rep_dsp_end"]        = "Hora de Finalización";
 $vocab["fulldescription_short"] = "Descripción completa";
 $vocab["both"]                  = "Todos";
 $vocab["privacy_status"]        = "Estado de privacidad";

Modified: mrbs/branches/datatables/web/lang.eu
===================================================================
--- mrbs/branches/datatables/web/lang.eu        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.eu        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "Bidali";
 $vocab["sort_rep"]           = "Zeren arabera:";
 $vocab["sort_rep_time"]      = "Hasiera data/ordua";
-$vocab["rep_dsp"]            = "Txostenean erakutsi:";
-$vocab["rep_dsp_dur"]        = "Iraupena";
-$vocab["rep_dsp_end"]        = "Bukaera";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Aurreko astera joan";

Modified: mrbs/branches/datatables/web/lang.fi
===================================================================
--- mrbs/branches/datatables/web/lang.fi        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.fi        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -207,9 +207,6 @@
 $vocab["submitquery"]        = "Tee raportti";
 $vocab["sort_rep"]           = "Raporttien lajittelun peruste";
 $vocab["sort_rep_time"]      = "Aloitusaika";
-$vocab["rep_dsp"]            = "Näytä raportissa";
-$vocab["rep_dsp_dur"]        = "Kesto";
-$vocab["rep_dsp_end"]        = "Loppumisaika";
  
 // Used in week.php
 $vocab["weekbefore"]         = "Edelliseen viikkoon";

Modified: mrbs/branches/datatables/web/lang.fr
===================================================================
--- mrbs/branches/datatables/web/lang.fr        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.fr        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -269,9 +269,6 @@
 $vocab["submitquery"]        = "Afficher le rapport";
 $vocab["sort_rep"]           = "Trier par&nbsp;";
 $vocab["sort_rep_time"]      = "Date/Heure";
-$vocab["rep_dsp"]            = "Afficher&nbsp;";
-$vocab["rep_dsp_dur"]        = "la durée";
-$vocab["rep_dsp_end"]        = "l'heure de fin";
 $vocab["fulldescription_short"] = "Description complète";
 $vocab["both"]                  = "Tous";
 $vocab["privacy_status"]        = "Etat caractère privé";

Modified: mrbs/branches/datatables/web/lang.it
===================================================================
--- mrbs/branches/datatables/web/lang.it        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.it        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -187,9 +187,6 @@
 $vocab["submitquery"]        = "Esegui Report";
 $vocab["sort_rep"]           = "Ordina Report per";
 $vocab["sort_rep_time"]      = "Inizio Data/Ora";
-$vocab["rep_dsp"]            = "Visualizza sul report";
-$vocab["rep_dsp_dur"]        = "Durata";
-$vocab["rep_dsp_end"]        = "Ora fine";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Vai alla Settimana Precedente";

Modified: mrbs/branches/datatables/web/lang.ja
===================================================================
--- mrbs/branches/datatables/web/lang.ja        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.ja        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -246,9 +246,6 @@
 $vocab["submitquery"]        = "報告の作成";
 $vocab["sort_rep"]           = "報告の並べ方";
 $vocab["sort_rep_time"]      = "開始日時";
-$vocab["rep_dsp"]            = "報告の表示";
-$vocab["rep_dsp_dur"]        = "使用期間";
-$vocab["rep_dsp_end"]        = "終了時刻";
 $vocab["fulldescription_short"] = "完全な説明";
 
 // Used in week.php

Modified: mrbs/branches/datatables/web/lang.ko
===================================================================
--- mrbs/branches/datatables/web/lang.ko        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.ko        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -174,9 +174,6 @@
 $vocab["submitquery"]        = "보고서 실행";
 $vocab["sort_rep"]           = "정렬 순서";
 $vocab["sort_rep_time"]      = "시작 일/시간";
-$vocab["rep_dsp"]            = "Display in report";
-$vocab["rep_dsp_dur"]        = "기간";
-$vocab["rep_dsp_end"]        = "종료 시간";
 
 // Used in week.php
 $vocab["weekbefore"]         = "저번 주로";

Modified: mrbs/branches/datatables/web/lang.nl
===================================================================
--- mrbs/branches/datatables/web/lang.nl        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.nl        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -270,9 +270,6 @@
 $vocab["submitquery"]        = "Rapport uitvoeren";
 $vocab["sort_rep"]           = "Rapport sorteren op";
 $vocab["sort_rep_time"]      = "Start Datum/Tijd";
-$vocab["rep_dsp"]            = "Weergeven in rapport";
-$vocab["rep_dsp_dur"]        = "Duur";
-$vocab["rep_dsp_end"]        = "Eind Tijd";
 $vocab["fulldescription_short"] = "Volledige omschrijving";
 $vocab["both"]                  = "Alles";
 $vocab["privacy_status"]        = "Privacy status";

Modified: mrbs/branches/datatables/web/lang.no
===================================================================
--- mrbs/branches/datatables/web/lang.no        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.no        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -188,9 +188,6 @@
 $vocab["submitquery"]        = "Kjør rapport";
 $vocab["sort_rep"]           = "Sorter rapport etter";
 $vocab["sort_rep_time"]      = "Dato/tid";
-$vocab["rep_dsp"]            = "Vis i rapport";
-$vocab["rep_dsp_dur"]        = "Varighet";
-$vocab["rep_dsp_end"]        = "Slutt-tid";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Gå til uken før";

Modified: mrbs/branches/datatables/web/lang.pl
===================================================================
--- mrbs/branches/datatables/web/lang.pl        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.pl        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -186,9 +186,6 @@
 $vocab["submitquery"]        = "Uruchom Raport";
 $vocab["sort_rep"]           = "Sortuj Raport po";
 $vocab["sort_rep_time"]      = "Start Data/Czas";
-$vocab["rep_dsp"]            = "Wyświetl w raporcie";
-$vocab["rep_dsp_dur"]        = "Trwanie";
-$vocab["rep_dsp_end"]        = "Czas Zakończenia";
 
 // Uzyte w week.php
 $vocab["weekbefore"]         = "Przejdź do Poprzedniego Tygodnia";

Modified: mrbs/branches/datatables/web/lang.pt
===================================================================
--- mrbs/branches/datatables/web/lang.pt        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.pt        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -269,9 +269,6 @@
 $vocab["submitquery"]        = "Executar relatório";
 $vocab["sort_rep"]           = "Ordenar relatório por";
 $vocab["sort_rep_time"]      = "Início Data/Horas";
-$vocab["rep_dsp"]            = "Mostrar no relatório";
-$vocab["rep_dsp_dur"]        = "Duração";
-$vocab["rep_dsp_end"]        = "Termo";
 $vocab["fulldescription_short"] = "Descrição";
 $vocab["both"]                  = "Todos";
 $vocab["privacy_status"]        = "Estado da privacidade";

Modified: mrbs/branches/datatables/web/lang.sl
===================================================================
--- mrbs/branches/datatables/web/lang.sl        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.sl        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -187,9 +187,6 @@
 $vocab["submitquery"]        = "Naredi poročilo";
 $vocab["sort_rep"]           = "Uredi poročilo po";
 $vocab["sort_rep_time"]      = "Začetni datum/ura";
-$vocab["rep_dsp"]            = "V poročilu prikaži";
-$vocab["rep_dsp_dur"]        = "Trajanje";
-$vocab["rep_dsp_end"]        = "Začetni - končni čas";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Prejšni teden";

Modified: mrbs/branches/datatables/web/lang.sv
===================================================================
--- mrbs/branches/datatables/web/lang.sv        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.sv        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -249,9 +249,6 @@
 $vocab["submitquery"]        = "Skapa rapport";
 $vocab["sort_rep"]           = "Sortera rapport efter";
 $vocab["sort_rep_time"]      = "Startdatum/starttid";
-$vocab["rep_dsp"]            = "Visa i rapport";
-$vocab["rep_dsp_dur"]        = "Längd";
-$vocab["rep_dsp_end"]        = "Sluttid";
 $vocab["fulldescription_short"] = "Fullständig beskrivning";
 
 // Used in week.php

Modified: mrbs/branches/datatables/web/lang.tr
===================================================================
--- mrbs/branches/datatables/web/lang.tr        2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.tr        2011-08-24 09:28:52 UTC (rev 
1881)
@@ -188,9 +188,6 @@
 $vocab["submitquery"]        = "Raporu Çalıştır";
 $vocab["sort_rep"]           = "Rapora göre sırala";
 $vocab["sort_rep_time"]      = "Başlama Zamanı";
-$vocab["rep_dsp"]            = "Raporda Görüntüle";
-$vocab["rep_dsp_dur"]        = "Devam Süresi";
-$vocab["rep_dsp_end"]        = "Bitiş Zamanı";
 
 // Used in week.php
 $vocab["weekbefore"]         = "Önceki Haftaya Git";

Modified: mrbs/branches/datatables/web/lang.zh-cn
===================================================================
--- mrbs/branches/datatables/web/lang.zh-cn     2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.zh-cn     2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "产生报表";
 $vocab["sort_rep"]           = "排序";
 $vocab["sort_rep_time"]      = "起始日/时";
-$vocab["rep_dsp"]            = "显示在报表";
-$vocab["rep_dsp_dur"]        = "持续时间";
-$vocab["rep_dsp_end"]        = "结束时间";
 
 // Used in week.php
 $vocab["weekbefore"]         = "前一周";

Modified: mrbs/branches/datatables/web/lang.zh-tw
===================================================================
--- mrbs/branches/datatables/web/lang.zh-tw     2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/lang.zh-tw     2011-08-24 09:28:52 UTC (rev 
1881)
@@ -175,9 +175,6 @@
 $vocab["submitquery"]        = "產生報表";
 $vocab["sort_rep"]           = "排序";
 $vocab["sort_rep_time"]      = "起始日/時";
-$vocab["rep_dsp"]            = "顯示在報表";
-$vocab["rep_dsp_dur"]        = "持續時間";
-$vocab["rep_dsp_end"]        = "結束時間";
 
 // Used in week.php
 $vocab["weekbefore"]         = "前一週";

Modified: mrbs/branches/datatables/web/mrbs.css.php
===================================================================
--- mrbs/branches/datatables/web/mrbs.css.php   2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/mrbs.css.php   2011-08-24 09:28:52 UTC (rev 
1881)
@@ -734,18 +734,6 @@
 #pending_list table th.header_start_time {text-transform: uppercase}
 
 /* ------------ REPORT.PHP ----------------------*/
-.div_report h2, #div_summary h1 {border-top: 2px solid <?php echo 
$report_h2_border_color ?>;
-    padding-top: 0.5em; margin-top: 2.0em}
-.div_report h3 {border-top: 1px solid <?php echo $report_h3_border_color ?>;
-    padding-top: 0.5em; margin-bottom: 0}
-.div_report table {clear: both; width: 100%; margin-top: 0.5em}
-.div_report col.col1 {width: 11em}
-.div_report td:first-child {text-align: right; font-weight: bold}
-.div_report .createdby td, .div_report .lastupdate td {font-size: x-small}
-div.report_entry_title {width: 100%; float: left;
-    border-top: 1px solid <?php echo $report_entry_border_color ?>; 
margin-top: 0.8em}
-div.report_entry_name  {width: 40%;  float: left; font-weight: bold}
-div.report_entry_when  {width: 60%;  float: right; text-align: right}
 #div_summary table {border-spacing: 1px; border-collapse: collapse;
     border-color: <?php echo $report_table_border_color ?>; border-style: 
solid;
     border-top-width: 1px; border-right-width: 0px; border-bottom-width: 0px; 
border-left-width: 1px}

Modified: mrbs/branches/datatables/web/report.php
===================================================================
--- mrbs/branches/datatables/web/report.php     2011-08-23 10:39:00 UTC (rev 
1880)
+++ mrbs/branches/datatables/web/report.php     2011-08-24 09:28:52 UTC (rev 
1881)
@@ -38,58 +38,6 @@
 define('FORMAT_PERIODS', "%d");
 
 
-// Convert a start time and end time to a plain language description.
-// This is similar but different from the way it is done in view_entry.
-function describe_span($starts, $ends)
-{
-  global $twentyfourhour_format, $strftime_format;
-  
-  $start_date = utf8_strftime($strftime_format['date'], $starts);
-  $start_time = utf8_strftime(hour_min_format(), $starts);
-  $duration = $ends - $starts;
-  if ($start_time == "00:00:00" && $duration == 60*60*24)
-  {
-    return $start_date . " - " . get_vocab("all_day");
-  }
-  toTimeString($duration, $dur_units);
-  return $start_date . " " . $start_time . " - " . $duration . " " . 
$dur_units;
-}
-
-// Convert a start period and end period to a plain language description.
-// This is similar but different from the way it is done in view_entry.
-function describe_period_span($starts, $ends)
-{
-  list( $start_period, $start_date) =  period_date_string($starts);
-  list( , $end_date) =  period_date_string($ends, -1);
-  $duration = $ends - $starts;
-  toPeriodString($start_period, $duration, $dur_units);
-  return $start_date . " - " . $duration . " " . $dur_units;
-}
-
-// this is based on describe_span but it displays the start and end
-// date/time of an entry
-function start_to_end($starts, $ends)
-{
-  global $twentyfourhour_format, $strftime_format;
-  
-  $start_date = utf8_strftime($strftime_format['date'], $starts);
-  $start_time = utf8_strftime(hour_min_format(), $starts);
-
-  $end_date = utf8_strftime($strftime_format['date'], $ends);
-  $end_time = utf8_strftime(hour_min_format(), $ends);
-  return $start_date . " " . $start_time . " - " . $end_date . " " . $end_time;
-}
-
-
-// this is based on describe_period_span but it displays the start and end
-// date/period of an entry
-function start_to_end_period($starts, $ends)
-{
-  list( , $start_date) =  period_date_string($starts);
-  list( , $end_date) =  period_date_string($ends, -1);
-  return $start_date . " - " . $end_date;
-}
-
 // Escape a string for either HTML or CSV output
 function escape($string)
 {
@@ -122,9 +70,11 @@
   return $row;
 }
 
+
 // Output the first row (header row) for CSV reports
-function csv_report_header($display)
+function report_header()
 {
+  global $output_as_csv, $output_as_html;
   global $csv_row_sep;
   global $custom_fields, $tbl_entry;
   global $approval_somewhere, $confirmation_somewhere;
@@ -132,15 +82,10 @@
   // Build an array of values to go into the header row
   $values = array();
   $values[] = get_vocab("area") . ' - ' . get_vocab("room");
-  $values[] = get_vocab("namebooker"); 
-  if ($display == "d")
-  {
-    $values[] = get_vocab("start_date") . ' - ' . get_vocab("duration");
-  }
-  else
-  {
-    $values[] = get_vocab("start_date") . ' - ' . get_vocab("end_date");
-  }
+  $values[] = get_vocab("namebooker");
+  $values[] = get_vocab("start_date");
+  $values[] = get_vocab("duration");
+  $values[] = get_vocab("end_date");
   $values[] = get_vocab("fulldescription_short");
   $values[] = get_vocab("type"); 
   $values[] = get_vocab("createdby");
@@ -159,181 +104,125 @@
   }
   $values[] = get_vocab("lastupdate");
   
-  // Remove any HTML entities from the values
-  $n_values = count($values);
-  $charset = get_charset();
-  // Find out what the non-breaking space is in this character set
-  $nbsp = mrbs_entity_decode('&nbsp;', ENT_NOQUOTES, $charset);
-  for ($i=0; $i < $n_values; $i++)
+  if ($output_as_csv)
   {
-    $values[$i] = mrbs_entity_decode($values[$i], ENT_NOQUOTES, $charset);
-    // Trim non-breaking spaces from the string
-    $values[$i] = trim($values[$i], $nbsp);
-    // And do an ordinary trim
-    $values[$i] = trim($values[$i]);
+    // Remove any HTML entities from the values
+    $n_values = count($values);
+    $charset = get_charset();
+    // Find out what the non-breaking space is in this character set
+    $nbsp = mrbs_entity_decode('&nbsp;', ENT_NOQUOTES, $charset);
+    for ($i=0; $i < $n_values; $i++)
+    {
+      $values[$i] = mrbs_entity_decode($values[$i], ENT_NOQUOTES, $charset);
+      // Trim non-breaking spaces from the string
+      $values[$i] = trim($values[$i], $nbsp);
+      // And do an ordinary trim
+      $values[$i] = trim($values[$i]);
+    }
+  
+    // Now turn the array of values into a CSV row
+    $line = "";  // initialise the row
+    foreach ($values as $v)
+    {
+      $line = csv_row_add_value($line, $v);
+    }
+    $line .= $csv_row_sep;  // terminate the row
+  
+    // Output the row
+    echo $line;
   }
+  elseif ($output_as_html)
+  {
+    $html = "<thead>\n";
+    $html .= "<tr>\n";
+    foreach ($values as $value)
+    {
+      $html .= "<th>" . htmlspecialchars($value) . "</th>\n";
+    }
+    $html .= "</tr>\n";
+    $html .= "</thead>\n<tbody>\n";
+    echo $html;
+  }
+}
+
+
+function open_report()
+{
+  global $output_as_html;
   
-  // Now turn the array of values into a CSV row
-  $line = "";  // initialise the row
-  foreach ($values as $v)
+  if ($output_as_html)
   {
-    $line = csv_row_add_value($line, $v);
+    echo "<table class=\"admin_general display\" id=\"report_table\">\n";
   }
-  $line .= $csv_row_sep;  // terminate the row
+  report_header();
+}
+
+
+function close_report()
+{
+  global $output_as_html;
   
-  // Output the row
-  echo $line;
+  if ($output_as_html)
+  {
+    echo "</tbody>\n</table>\n";
+  }
 }
 
-// Report on one entry. See below for columns in $row[].
-// $last_area_room remembers the current area/room.
-// $last_date remembers the current date.
-function reporton(&$row, &$last_area_room, &$last_date, $sortby, $display)
+
+function report_row(&$row, $sortby)
 {
   global $typel;
   global $output_as_csv;
-  global $csv_row_sep;
+  global $csv_row_sep, $csv_col_sep;
   global $custom_fields, $field_natures, $field_lengths, $tbl_entry;
   global $approval_somewhere, $confirmation_somewhere;
   global $strftime_format;
-  global $select_options;
+  global $select_options, $enable_periods;
   
-  // Initialise the line for CSV reports
-  $line = "";
+  $values = array();
   
-  // Display Area/Room, but only when it changes:
+  // Area-room
   $area_room = $row['area_name'] . " - " . $row['room_name'];
-  $date = utf8_strftime($strftime_format['date'], $row['start_time']);
+  $values[] = escape($area_room);
   
-  // entries to be sorted on area/room
-  echo $output_as_csv ? '' : "<div class=\"div_report\">\n";
-  if( $sortby == "r" )
+  // Booking name
+  $values[] = ($output_as_csv) ? escape($row['name']) : "<a 
href=\"view_entry.php?id=".$row['id']."\">" . htmlspecialchars($row['name']) . 
"</a>";
+  
+  // Start date
+  if ($enable_periods)
   {
-    if ($area_room != $last_area_room)
-    {
-      echo $output_as_csv ? '' : "<h2>". get_vocab("room") . ": " . 
escape($area_room) . "</h2>\n";
-    }
-    if ($date != $last_date || $area_room != $last_area_room)
-    {
-      echo $output_as_csv ? '' : "<h3>". get_vocab("date") . ": " . $date . 
"</h3>\n";
-      $last_date = $date;
-    }
-    // remember current area/room that is being processed.
-    // this is done here as the if statement above needs the old
-    // values
-    if ($area_room != $last_area_room)
-    {
-      $last_area_room = $area_room;
-    }
+    list($start_period, $start_date) =  period_date_string($row['start_time']);
   }
   else
-    // entries to be sorted on start date
   {
-    if ($date != $last_date)
-    {
-      echo $output_as_csv ? '' : "<h2>". get_vocab("date") . ": " . $date . 
"</h2>\n";
-    }
-    if ($area_room != $last_area_room  || $date != $last_date)
-    {
-      echo $output_as_csv ? '' : "<h3>". get_vocab("room") . ": " . 
escape($area_room) . "</h3>\n";
-      $last_area_room = $area_room;
-    }
-    // remember current date that is being processed.
-    // this is done here as the if statement above needs the old
-    // values
-    if ($date != $last_date)
-    {
-      $last_date = $date;
-    }
+    $start_date = time_date_string($row['start_time']);
   }
+  $values[] = escape($start_date);
   
-  if ($output_as_csv)
+  // End date
+  if ($enable_periods)
   {
-    $line = csv_row_add_value($line, $area_room); // for the CSV report put 
the area-room name on every line
-    $line = csv_row_add_value($line, $row['name']);
+    list( , $end_date) =  period_date_string($row['end_time'], -1);
   }
   else
   {
-    echo "<div class=\"report_entry_title\">\n";
-  
-    echo "<div class=\"report_entry_name\">\n";
-    // Brief Description (title), linked to view_entry:
-    echo "<a href=\"view_entry.php?id=".$row['id']."\">" . 
htmlspecialchars($row['name']) . "</a>\n";
-    echo "</div>\n";
+    $end_date = time_date_string($row['end_time']);
   }
-  echo $output_as_csv ? '' : "<div class=\"report_entry_when\">\n";
+  $values[] = escape($end_date);
+  
+  // Duration
+  $d = get_duration($row['start_time'], $row['end_time']);
+  $values[] = escape($d['duration'] . ' ' . $d['dur_units']);
 
-  // what do you want to display duration or end date/time
-  if( $display == "d" )
-  {
-    // Start date/time and duration:
-    $when = (empty($row['enable_periods']) ? 
-             describe_span($row['start_time'], $row['end_time']) : 
-             describe_period_span($row['start_time'], $row['end_time']));
-  }
-  else
-  {
-    // Start date/time and End date/time:
-    $when = (empty($row['enable_periods']) ? 
-             start_to_end($row['start_time'], $row['end_time']) :
-             start_to_end_period($row['start_time'], $row['end_time']));
-  }
-  if ($output_as_csv)
-  {
-    $line = csv_row_add_value($line, $when);
-  }
-  else
-  {
-    echo "$when\n";
-    echo "</div>\n";
-    echo "</div>\n";
-    
-    echo "<table>\n";
-    echo "<colgroup>\n";
-    echo "<col class=\"col1\">\n";
-    echo "<col class=\"col2\">\n";
-    echo "</colgroup>\n";
-  }
-
   // Description:
-  if ($output_as_csv)
-  {
-    $line = csv_row_add_value($line, $row['description']);
-  }
-  else
-  {
-    echo "<tr>\n";
-    echo "<td>" . get_vocab("description") . ":</td>\n";
-    echo "<td>" . escape($row['description']) . "</td>\n";
-    echo "</tr>\n";
-  }
+  $values[] = escape($row['description']);
 
   // Entry Type:
   $et = empty($typel[$row['type']]) ? "?".$row['type']."?" : 
$typel[$row['type']];
-  if ($output_as_csv)
-  {
-    $line = csv_row_add_value($line, $et);
-  }
-  else
-  {
-    echo "<tr>\n";
-    echo "<td>" . get_vocab("type") . ":</td>\n";
-    echo "<td>" . escape($et) . "</td>\n";
-    echo "</tr>\n";
-  }
+  $values[] = escape($et);
 
   // Created by:
-  if ($output_as_csv)
-  {
-    $line = csv_row_add_value($line, $row['create_by']);
-  }
-  else
-  {
-    echo "<tr>\n";
-    echo "<td>" . get_vocab("createdby") . ":</td>\n";
-    echo "<td>" . escape($row['create_by']) . "</td>\n";
-    echo "</tr>\n";
-  }
+  $values[] = escape($row['create_by']);
   
   // Confirmation status
   if ($confirmation_somewhere)
@@ -347,18 +236,7 @@
     {
       $confirmation_status = '';
     }
-    // Now output the text
-    if ($output_as_csv)
-    {
-      $line = csv_row_add_value($line, $confirmation_status);
-    }
-    else
-    {
-      echo "<tr>\n";
-      echo "<td>" . get_vocab("confirmation_status") . ":</td>\n";
-      echo "<td>" . escape($confirmation_status) . "</td>\n";
-      echo "</tr>\n";
-    }
+    $values[] = escape($confirmation_status);
   }
   
   // Approval status
@@ -373,18 +251,7 @@
     {
       $approval_status = '';
     }
-    // Now output the text
-    if ($output_as_csv)
-    {
-      $line = csv_row_add_value($line, $approval_status);
-    }
-    else
-    {
-      echo "<tr>\n";
-      echo "<td>" . get_vocab("approval_status") . ":</td>\n";
-      echo "<td>" . escape($approval_status) . "</td>\n";
-      echo "</tr>\n";
-    }
+    $values[] = escape($approval_status);
   }
   
   // Now do any custom fields
@@ -416,44 +283,26 @@
     {
       $output = '';
     }
-    
-    if ($output_as_csv)
-    {
-      $line = csv_row_add_value($line, $output);
-    }
-    else
-    {
-      echo "<tr>\n";
-      echo "<td>" . get_loc_field_name($tbl_entry, $key) . ":</td>\n";
-      echo "<td>" . escape($output) . "</td>\n";
-      echo "</tr>\n";
-    }
+    $values[] = escape($output);
   }
 
   // Last updated:
-  if ($output_as_csv)
-  {
-    $line = csv_row_add_value($line, time_date_string($row['last_updated']));
-  }
-  else
-  {
-    echo "<tr>\n";
-    echo "<td>" . get_vocab("lastupdate") . ":</td>\n";
-    echo "<td>" . time_date_string($row['last_updated']) . "</td>\n";
-    echo "</tr>\n";
-  }
+  $values[] = time_date_string($row['last_updated']);
 
   if ($output_as_csv)
   {
-    // terminate and output the line
+    $line = '"';
+    $line .= implode("\"$csv_col_sep\"", $values);
     $line .= $csv_row_sep;
-    echo $line;
   }
   else
   {
-    echo "</table>\n";
-    echo "</div>\n\n";
+    $line = "<tr>\n<td>";
+    $line .= implode("</td>\n<td>", $values);
+    $line .= "</td>\n</tr>\n";
   }
+  
+  echo $line;
 }
 
 
@@ -820,7 +669,6 @@
 $summarize = get_form_var('summarize', 'int');
 $typematch = get_form_var('typematch', 'array');
 $sortby = get_form_var('sortby', 'string');
-$display = get_form_var('display', 'string');
 $sumby = get_form_var('sumby', 'string');
 $match_approved = get_form_var('match_approved', 'string');
 $match_confirmed = get_form_var('match_confirmed', 'string');
@@ -1161,11 +1009,6 @@
 {
   $sortby = "r";
 }
-// $display: d=duration, e=start date/time and end date/time.
-if (empty($display))
-{
-  $display = "d";
-}
 
 $private_somewhere = some_area('private_enabled') || 
some_area('private_mandatory');
 $approval_somewhere = some_area('approval_enabled');
@@ -1395,24 +1238,6 @@
           </div>
         </div>
       
-        <div id="div_display">
-          <label><?php echo get_vocab("rep_dsp");?>:</label>
-          <div class="group">
-            <label>
-              <input class="radio" type="radio" name="display" value="d"
-              <?php 
-              if ($display=="d") echo " checked=\"checked\"";
-              echo ">". get_vocab("rep_dsp_dur");?>
-            </label>
-            <label>
-              <input class="radio" type="radio" name="display" value="e"
-              <?php 
-              if ($display=="e") echo " checked=\"checked\"";
-              echo ">". get_vocab("rep_dsp_end");?>
-            </label>
-          </div>
-        </div>
-      
         <div id="div_sumby">
           <label><?php echo get_vocab("summarize_by");?>:</label>
           <div class="group">
@@ -1462,8 +1287,14 @@
   }
   else
   {
-    $last_area_room = "";
-    $last_date = "";
+    if ($output_as_ical)
+    {
+      // We set $keep_private to FALSE here because we excluded all private
+      // events in the SQL query
+      export_icalendar($res, FALSE, $report_end);
+      exit;
+    }
+    
     if ($output_as_html)
     {
       echo "<p class=\"report_entries\">" . $nmatch . " "
@@ -1471,25 +1302,16 @@
       .  "</p>\n";
     }
     
-    // Output the header row for CSV reports
-    if ($output_as_csv && ($summarize & REPORT))
+    if ($summarize & REPORT)
     {
-      csv_report_header($display);
+      open_report();
     }
-    
-    if ($output_as_ical)
-    {
-      // We set $keep_private to FALSE here because we excluded all private
-      // events in the SQL query
-      export_icalendar($res, FALSE, $report_end);
-      exit;
-    }
 
     for ($i = 0; ($row = sql_row_keyed($res, $i)); $i++)
     {
       if ($summarize & REPORT)
       {
-        reporton($row, $last_area_room, $last_date, $sortby, $display);
+        report_row($row, $sortby);
       }
 
       if ($summarize & SUMMARY)
@@ -1503,6 +1325,11 @@
       }
     }
     
+    if ($summarize & REPORT)
+    {
+      close_report();
+    }
+    
     if ($summarize & SUMMARY)
     {
       do_summary($count, $hours, $room_hash, $name_hash);

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


------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to