Skip to content

Commit b7167fe

Browse files
committed
Add "form" parameter for Date field method
Allow the specification of a "form" parameter for Date fields to make the popup calendar work when the enclosing form has a name different from "itemSynopsis".
1 parent 926b5db commit b7167fe

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ Fixed:
8989
<pidfile> is used without -l <logfile>. Added code to report
9090
the issue. Added issue with relative paths for log file whn
9191
using -L and -d with roundup-server. (John Rouillard)
92+
- Allow the specification of a "form" parameter for Date fields to make
93+
the popup calendar work when the enclosing form has a name different
94+
from "itemSynopsis".
9295

9396
Features:
9497

doc/reference.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,6 +3076,11 @@ There are several methods available on these wrapper objects:
30763076
date and time for Date properties. You can set this to
30773077
False for displaying only the date.
30783078

3079+
form (Date properties only)
3080+
When using a popup calendar (see popcal below) and the
3081+
enclosing form name is different from "itemSynopsis",
3082+
the form name must be specified for the field.
3083+
30793084
format (Date properties only)
30803085
Sets the format of the date in the field - uses the
30813086
same format string argument as supplied to the

roundup/cgi/templating.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,7 +2276,7 @@ def now(self, str_interval=None):
22762276

22772277

22782278
def field(self, size=30, default=None, format=_marker, popcal=None,
2279-
display_time=None, **kwargs):
2279+
display_time=None, form='itemSynopsis', **kwargs):
22802280
"""Render a form edit field for the property
22812281
22822282
If not editable, just display the value via plain().
@@ -2344,7 +2344,7 @@ def field(self, size=30, default=None, format=_marker, popcal=None,
23442344
s = self.input(name=self._formname, value=value, size=size,
23452345
**kwargs)
23462346
if popcal:
2347-
s += self.popcal()
2347+
s += self.popcal(form=form)
23482348
return s
23492349
else:
23502350
raw_value = value
@@ -2368,7 +2368,7 @@ def field(self, size=30, default=None, format=_marker, popcal=None,
23682368
s = self.input(name=self._formname, value=value, size=size,
23692369
**kwargs)
23702370
if popcal:
2371-
s += self.popcal()
2371+
s += self.popcal(form=form)
23722372
return s
23732373

23742374
def reldate(self, pretty=1):

0 commit comments

Comments
 (0)