Revision: 2503
          https://sourceforge.net/p/mrbs/code/2503/
Author:   cimorrison
Date:     2012-10-15 16:44:15 +0000 (Mon, 15 Oct 2012)
Log Message:
-----------
Made email notifications work with newstyle monthly repeats

Modified Paths:
--------------
    mrbs/branches/improved_repeat_interface/web/functions_mail.inc

Modified: mrbs/branches/improved_repeat_interface/web/functions_mail.inc
===================================================================
--- mrbs/branches/improved_repeat_interface/web/functions_mail.inc      
2012-10-15 16:21:29 UTC (rev 2502)
+++ mrbs/branches/improved_repeat_interface/web/functions_mail.inc      
2012-10-15 16:44:15 UTC (rev 2503)
@@ -696,6 +696,50 @@
                                         $opt_previous,
                                         $compare, $as_html);
       }
+      
+      if ($data['rep_type'] == REP_MONTHLY)
+      {
+      
+        if (isset($data['month_absolute']))
+        {
+          $new = $data['month_absolute'];
+        }
+        elseif (isset($data['month_relative']))
+        {
+          // Note: this does not internationalise very well and could do with 
revisiting.
+          // It follows the select box order in edit_entry, which is the more 
difficult one
+          // to sort out.  It assumes all languages have the same order as 
English
+          // eg "the second Wednesday" which is probably not true.
+          list($ord, $dow) = byday_split($data['month_relative']);
+          $new = get_vocab("ord_" . $ord) . " " . 
day_name(RFC_5545_day_to_ord($dow));
+        }
+        else
+        {
+          trigger_error("Unknown monthly repeat type, E_USER_NOTICE");
+        }
+        if (isset($mail_previous['month_absolute']))
+        {
+          $old = $mail_previous['month_absolute'];
+        }
+        elseif (isset($mail_previous['month_relative']))
+        {
+          // Note: this does not internationalise very well and could do with 
revisiting.
+          // It follows the select box order in edit_entry, which is the more 
difficult one
+          // to sort out.  It assumes all languages have the same order as 
English
+          // eg "the second Wednesday" which is probably not true.
+          list($ord, $dow) = byday_split($mail_previous['month_relative']);
+          $old = get_vocab("ord_" . $ord) . " " . 
day_name(RFC_5545_day_to_ord($dow));
+        }
+        else
+        {
+          trigger_error("Unknown monthly repeat type, E_USER_NOTICE");
+        }
+        $body .= create_body_table_row (get_mail_vocab("repeat_on"),
+                                        $new,
+                                        $old,
+                                        $compare, $as_html);
+      
+      }
 
       // Repeat end date
       $end_previous = ($mail_previous['rep_type'] == REP_NONE) ? '' : 
getMailTimeDateString($mail_previous['end_date'], FALSE);
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to