Properly fix passing the date parameter to the attendees page
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 9 Sep 2009 17:29:51 +0000 (13:29 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 9 Sep 2009 17:30:25 +0000 (13:30 -0400)
kronolith/attendees.php
kronolith/templates/edit/edit.inc

index 5113a46..02cacf9 100644 (file)
@@ -158,9 +158,10 @@ case 'dismiss':
     if (!empty($url)) {
         $location = Horde::applicationUrl($url, true);
     } else {
-        $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php',
-                                  'month', Horde_Util::getFormData('month'));
-        $url = Horde_Util::addParameter($url, 'year', Horde_Util::getFormData('year'));
+        $date = Horde_Util::getFormData('date');
+        $date = new Horde_Date($date);
+        $url = Horde_Util::addParameter($prefs->getValue('defaultview') . '.php', 'month', $date->month);
+        $url = Horde_Util::addParameter($url, 'year', $date->year);
         $location = Horde::applicationUrl($url, true);
     }
 
index 5e701e6..712f961 100644 (file)
@@ -232,7 +232,7 @@ if ($event->alarm) {
 <tr>
  <td></td>
  <td colspan="4">
-  <?php echo Horde::link(Horde::applicationUrl('attendees.php'), '', 'button', '_blank', 'date = $H({ year: $F(\'start_year\'), month: $F(\'start_month\'), mday: $F(\'start_day\') }); this.href += (this.href.indexOf(\'?\') == -1 ? \'?\' : \'&\') + date.toQueryString();Horde.popup({ url: this.href });return false;') . _("Edit Attendees") . '</a>' ?>
+  <?php echo Horde::link(Horde::applicationUrl('attendees.php'), '', 'button', '_blank', 'date = $F(\'start_year\') + (\'000\' + $F(\'start_month\')).slice(-2) + (\'000\' + $F(\'start_day\')).slice(-2); this.href += (this.href.indexOf(\'?\') == -1 ? \'?\' : \'&\') + \'date=\' + date;Horde.popup({ url: this.href });return false;') . _("Edit Attendees") . '</a>' ?>
  </td>
 </tr>
 </tbody>