Revision: 2500
          https://sourceforge.net/p/mrbs/code/2500/
Author:   cimorrison
Date:     2012-10-15 15:25:18 +0000 (Mon, 15 Oct 2012)
Log Message:
-----------
Made monthly repeats display properly in view_entry.php

Modified Paths:
--------------
    mrbs/branches/improved_repeat_interface/web/edit_entry.php
    mrbs/branches/improved_repeat_interface/web/functions_view.inc

Modified: mrbs/branches/improved_repeat_interface/web/edit_entry.php
===================================================================
--- mrbs/branches/improved_repeat_interface/web/edit_entry.php  2012-10-15 
15:04:04 UTC (rev 2499)
+++ mrbs/branches/improved_repeat_interface/web/edit_entry.php  2012-10-15 
15:25:18 UTC (rev 2500)
@@ -1391,7 +1391,7 @@
       
       // Note: the select box order does not internationalise very well and 
could
       // do with revisiting.   It assumes all languages have the same order as 
English
-      // eg "the second Wednesday" which is probavly not true.
+      // eg "the second Wednesday" which is probably not true.
       $options = array();
       foreach (array('1', '2', '3', '4', '-1', '-2', '-3', '-4') as $i)
       {

Modified: mrbs/branches/improved_repeat_interface/web/functions_view.inc
===================================================================
--- mrbs/branches/improved_repeat_interface/web/functions_view.inc      
2012-10-15 15:04:04 UTC (rev 2499)
+++ mrbs/branches/improved_repeat_interface/web/functions_view.inc      
2012-10-15 15:25:18 UTC (rev 2500)
@@ -41,6 +41,7 @@
   global $strftime_format;
   global $tbl_entry;
   global $select_options;
+  global $RFC_5545_days;
   
   // Get the duration if we haven't got it already
   if (!isset($data['duration']))
@@ -214,7 +215,24 @@
         $tbody .= create_details_row(get_vocab("rep_rep_day"), 
get_rep_day_list($data['rep_opt']), $as_html);
         break;
       case REP_MONTHLY:
-        $value = $data['month_absolute'];
+        if (isset($data['month_absolute']))
+        {
+          $value = $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']);
+          $tmp = array_keys($RFC_5545_days, $dow);
+          $value = get_vocab("ord_" . $ord) . " " . day_name($tmp[0]);
+        }
+        else
+        {
+          trigger_error("Unknown monthly repeat type, E_USER_NOTICE");
+        }
         $tbody .= create_details_row(get_vocab("repeat_on"), $value, $as_html);
       default:
         break;
------------------------------------------------------------------------------
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