changeset 2315:5906e6bad32e maint-0.7

merge from HEAD
author Richard Jones <richard@users.sourceforge.net>
date Sat, 15 May 2004 09:40:05 +0000
parents f72d2fb8ef78
children 4fd7a1805544
files CHANGES.txt doc/index.txt roundup/cgi/templating.py
diffstat 3 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Thu May 13 00:26:07 2004 +0000
+++ b/CHANGES.txt	Sat May 15 09:40:05 2004 +0000
@@ -8,6 +8,8 @@
 - HTML templating isset() inverted (sf bug 951779)
 - otks manager missing (sf bug 952931)
 - mention DEFAULT_TIMEZONE requirement in upgrading doc (sf bug 952932)
+- fix DateHTMLProperty so local() can override user timezone (sf bug
+  953678)
 
 
 2004-05-07 0.7.1
--- a/doc/index.txt	Thu May 13 00:26:07 2004 +0000
+++ b/doc/index.txt	Sat May 15 09:40:05 2004 +0000
@@ -115,12 +115,13 @@
 Ollie Rutherfurd,
 Toby Sargeant,
 Florian Schulze,
+Klamer Schutte,
 Dougal Scott,
 Stefan Seefeld,
 Jeffrey P Shell,
-Klamer Schutte,
 Joel Shprentz,
 Terrel Shumway,
+Emil Sit,
 Nathaniel Smith,
 Mike Thompson,
 Darryl VanDorp,
--- a/roundup/cgi/templating.py	Thu May 13 00:26:07 2004 +0000
+++ b/roundup/cgi/templating.py	Sat May 15 09:40:05 2004 +0000
@@ -671,7 +671,7 @@
         Also sneak in the lastactivity and action hidden elements.
         """
         return self.input(type="hidden", name="@lastactivity",
-            value=self.activity) + '\n' + \
+            value=self.activity.local(0)) + '\n' + \
             self.input(type="hidden", name="@action", value="edit") + '\n' + \
             self.input(type="submit", name="submit", value=label)
 
@@ -1269,6 +1269,12 @@
         return s
 
 class DateHTMLProperty(HTMLProperty):
+    def __init__(self, client, classname, nodeid, prop, name, value,
+            anonymous=0, offset=None):
+        HTMLProperty.__init__(self, client, classname, nodeid, prop, name,
+                value, anonymous=anonymous)
+        self._offset = offset
+
     def plain(self):
         ''' Render a "plain" representation of the property
         '''
@@ -1276,7 +1282,11 @@
 
         if self._value is None:
             return ''
-        return str(self._value.local(self._db.getUserTimezone()))
+        if self._offset is None:
+            offset = self._db.getUserTimezone()
+        else:
+            offset = self._offset
+        return str(self._value.local(offset))
 
     def now(self):
         ''' Return the current time.
@@ -1346,7 +1356,7 @@
         self.view_check()
 
         return DateHTMLProperty(self._client, self._classname, self._nodeid,
-            self._prop, self._formname, self._value.local(offset))
+            self._prop, self._formname, self._value, offset=offset)
 
 class IntervalHTMLProperty(HTMLProperty):
     def plain(self):

Roundup Issue Tracker: http://roundup-tracker.org/