changeset 8301:3ba8078843db

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".
author Ralf Schlatterbeck <rsc@runtux.com>
date Wed, 19 Feb 2025 12:50:07 +0100
parents b99e76e76496
children 82a26ea1afdf
files CHANGES.txt doc/reference.txt roundup/cgi/templating.py
diffstat 3 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Wed Feb 19 12:38:06 2025 +0100
+++ b/CHANGES.txt	Wed Feb 19 12:50:07 2025 +0100
@@ -89,6 +89,9 @@
   <pidfile> is used without -l <logfile>. Added code to report
   the issue. Added issue with relative paths for log file whn
   using -L and -d with roundup-server. (John Rouillard)
+- 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".
 
 Features:
 
--- a/doc/reference.txt	Wed Feb 19 12:38:06 2025 +0100
+++ b/doc/reference.txt	Wed Feb 19 12:50:07 2025 +0100
@@ -3076,6 +3076,11 @@
                 date and time for Date properties. You can set this to
                 False for displaying only the date.
 
+              form (Date properties only)
+                When using a popup calendar (see popcal below) and the
+                enclosing form name is different from "itemSynopsis",
+                the form name must be specified for the field.
+
 	      format (Date properties only)
                 Sets the format of the date in the field - uses the
 		same format string argument as supplied to the
--- a/roundup/cgi/templating.py	Wed Feb 19 12:38:06 2025 +0100
+++ b/roundup/cgi/templating.py	Wed Feb 19 12:50:07 2025 +0100
@@ -2276,7 +2276,7 @@
 
 
     def field(self, size=30, default=None, format=_marker, popcal=None,
-              display_time=None, **kwargs):
+              display_time=None, form='itemSynopsis', **kwargs):
         """Render a form edit field for the property
 
         If not editable, just display the value via plain().
@@ -2344,7 +2344,7 @@
             s = self.input(name=self._formname, value=value, size=size,
                            **kwargs)
             if popcal:
-                s += self.popcal()
+                s += self.popcal(form=form)
             return s
         else:
             raw_value = value
@@ -2368,7 +2368,7 @@
         s = self.input(name=self._formname, value=value, size=size,
                        **kwargs)
         if popcal:
-            s += self.popcal()
+            s += self.popcal(form=form)
         return s
 
     def reldate(self, pretty=1):

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