[kronolith] Little Patch...

W. Tasin tasin at fhm.edu
Tue Apr 6 10:49:13 PDT 2004


Hi all,

here's another patch.
Problem: Adding an event and changing the calender causes to set the
category "New Category" inside the select box and doesn't reset to
"Unfiled".
Even the same to pressing "Reset" inside the form.
Ciao

Walter



-------------- next part --------------
--- kronolith/templates/edit/edit.inc	Sat Apr  3 05:40:07 2004
+++ kronolith/templates/edit/edit.inc	Tue Apr  6 19:24:16 2004
@@ -30,7 +30,7 @@
  <td align="right" colspan="5">
   <?php echo implode("\n", $buttons); ?>
   <input type="submit" name="cancel" class="button" value="<?php echo _("Cancel") ?>" onclick="self.location = '<?php echo $cancelurl; ?>'; return false;" />
-  <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.event.reset(); updateWday('start_wday'); updateWday('end_wday');" />
+  <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.event.reset(); changeCalendar(); updateWday('start_wday'); updateWday('end_wday');" />
  </td>
 </tr>
 
@@ -423,7 +424,7 @@
  <td align="right" colspan="5">
   <?php echo implode("\n", $buttons); ?>
   <input type="submit" name="cancel" class="button" value="<?php echo _("Cancel") ?>" onclick="self.location = '<?php echo $cancelurl; ?>'; return false;" />
-  <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.event.reset(); updateWday('start_wday'); updateWday('end_wday');" />
+  <input type="button" name="resetButton" class="button" value="<?php echo _("Reset to Defaults") ?>" onclick="document.event.reset(); changeCalendar(); updateWday('start_wday'); updateWday('end_wday');" />
   </td>
  </tr>
 </table>

-------------- next part --------------
--- kronolith/templates/edit/javascript.inc	Sat Feb 14 05:02:15 2004
+++ kronolith/templates/edit/javascript.inc	Tue Apr  6 19:20:26 2004
@@ -36,7 +36,11 @@
 
     for (i = 0; i < categories[calendar].length; i++) {
         f.category.options[i + 2] = new Option(categories[calendar][i][0], categories[calendar][i][1]);
+        if (categories[calendar][i][1]==0) {
+          f.category.selectedIndex=i + 2;
+        }
     }
+        
 }
 
 function setInterval(field)



More information about the kronolith mailing list