Revision: 1908
          http://mrbs.svn.sourceforge.net/mrbs/?rev=1908&view=rev
Author:   cimorrison
Date:     2011-08-30 10:23:54 +0000 (Tue, 30 Aug 2011)
Log Message:
-----------
Added the list of skipped bookings to ordinary email notifications.

Modified Paths:
--------------
    mrbs/trunk/web/functions_mail.inc
    mrbs/trunk/web/lang.en
    mrbs/trunk/web/mrbs-mail.css

Modified: mrbs/trunk/web/functions_mail.inc
===================================================================
--- mrbs/trunk/web/functions_mail.inc   2011-08-30 09:07:08 UTC (rev 1907)
+++ mrbs/trunk/web/functions_mail.inc   2011-08-30 10:23:54 UTC (rev 1908)
@@ -382,6 +382,27 @@
 }
 
 
+// Generate the list of bookings that could not be made due to conflicts
+function create_body_exceptions($skip_list, $as_html)
+{
+  // The introductory text
+  $result = ($as_html) ? "<p>" : "\n\n";
+  $result .= get_vocab("mail_body_exceptions");
+  $result .= ($as_html) ? "</p>\n" : "\n\n";
+  // Now the list of conflicts
+  $result .= ($as_html) ? "<ul>\n" : "";
+  foreach ($skip_list as $date)
+  {
+    $result .= ($as_html) ? "<li>" : "";
+    $result .= getMailDateString($date);
+    $result .= ($as_html) ? "</li>" : "\n";
+  }
+  $result .= ($as_html) ? "</ul>\n" : "";
+  
+  return $result;
+}
+
+
 function create_body($data, $compare, $series, $action, $as_html=FALSE, 
$note='')
 {
   global $mail_previous, $returl, $mrbs_company;
@@ -661,7 +682,8 @@
       $body .= create_body_table_row (get_mail_vocab("rep_end_date"),
                                       getMailTimeDateString($data['end_date'], 
FALSE),
                                       
getMailTimeDateString($mail_previous['end_date'], FALSE),
-                                      $compare, $as_html);                     
                 
+                                      $compare, $as_html);
+                                                                   
     }
   }
   
@@ -669,6 +691,16 @@
   {
     $body .= "</tbody>\n";
     $body .= "</table>\n";
+  }
+  
+  // Now add in the list of repeat bookings that could not be booked
+  if (!empty($data['skip_list']))
+  {
+    $body .= create_body_exceptions($data['skip_list'], $as_html);
+  }
+  
+  if ($as_html)
+  {
     $body .= "</div>\n";
     $body .= "</body>\n";
     $body .= "</html>\n";

Modified: mrbs/trunk/web/lang.en
===================================================================
--- mrbs/trunk/web/lang.en      2011-08-30 09:07:08 UTC (rev 1907)
+++ mrbs/trunk/web/lang.en      2011-08-30 10:23:54 UTC (rev 1908)
@@ -160,6 +160,7 @@
 $vocab["mail_body_rej_entry"]    = "An entry has been rejected by the 
administrators, here are the details:";
 $vocab["mail_body_more_info"]    = "The administrators require more 
information about an entry; here are the details:";
 $vocab["mail_body_reminder"]     = "Reminder - an entry is awaiting approval; 
here are the details:";
+$vocab["mail_body_exceptions"]   = "The following bookings could not be made 
due to conflicts:";
 $vocab["mail_subject_new_entry"]     = "Entry added for $mrbs_company MRBS";
 $vocab["mail_subject_changed_entry"] = "Entry changed for $mrbs_company MRBS";
 $vocab["mail_subject_delete"]        = "Entry deleted for $mrbs_company MRBS";

Modified: mrbs/trunk/web/mrbs-mail.css
===================================================================
--- mrbs/trunk/web/mrbs-mail.css        2011-08-30 09:07:08 UTC (rev 1907)
+++ mrbs/trunk/web/mrbs-mail.css        2011-08-30 10:23:54 UTC (rev 1908)
@@ -7,9 +7,10 @@
            margin: 0; padding: 0}
 div#header {width: 100%; background-color: #4b667b; color: #ffffff;
             margin: 0; padding: 10px}
-div#contents {padding: 10px}
+div#contents {width: 100%; padding: 10px; margin-bottom: 1em}
 #mrbs a:link    {color: #0B263B; text-decoration: none; font-weight: bold}
 #mrbs a:visited {color: #0B263B; text-decoration: none; font-weight: bold}
 #mrbs a:hover   {color: #ff0066; text-decoration: underline; font-weight: 
bold} 
 #mrbs tr {padding: 0; margin: 0}
 #mrbs th, #mrbs td {text-align: left; padding: 1px 1em; margin 0}
+

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


------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to