Skip to content

Commit c415ce6

Browse files
author
Richard Jones
committed
allow listing popup to be used in query forms (thanks Marcus Priesch)
1 parent f46f3b7 commit c415ce6

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Feature:
2828
- multiple selection Link/Multilink search field (thanks Marlon van den Berg)
2929
- relaxed hyperlinking in web interface (accept "issue123" or "Issue 123")
3030
- record journaltag lookup ("fixes" sf bug 998140)
31+
- allow listing popup to be used in query forms (thanks Marcus Priesch)
3132

3233
Fixed:
3334
- postgres backend open doesn't hide corruption in schema (sf bug 956375)

doc/index.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ Luke Opperman,
116116
Eddie Parker,
117117
Will Partain,
118118
Ewout Prangsma,
119+
Marcus Priesch,
119120
Bernhard Reiter,
120121
Roy Rapoport,
121122
John P. Rouillard,

roundup/cgi/templating.py

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -596,31 +596,37 @@ def filter(self, request=None, filterspec={}, sort=(None,None),
596596
return l
597597

598598
def classhelp(self, properties=None, label=''"(list)", width='500',
599-
height='400', property=''):
600-
''' Pop up a javascript window with class help
599+
height='400', property='', form='itemSynopsis'):
600+
'''Pop up a javascript window with class help
601601
602-
This generates a link to a popup window which displays the
603-
properties indicated by "properties" of the class named by
604-
"classname". The "properties" should be a comma-separated list
605-
(eg. 'id,name,description'). Properties defaults to all the
606-
properties of a class (excluding id, creator, created and
607-
activity).
602+
This generates a link to a popup window which displays the
603+
properties indicated by "properties" of the class named by
604+
"classname". The "properties" should be a comma-separated list
605+
(eg. 'id,name,description'). Properties defaults to all the
606+
properties of a class (excluding id, creator, created and
607+
activity).
608608
609-
You may optionally override the label displayed, the width and
610-
height. The popup window will be resizable and scrollable.
609+
You may optionally override the label displayed, the width and
610+
height. The popup window will be resizable and scrollable.
611611
612-
If the "property" arg is given, it's passed through to the
613-
javascript help_window function.
612+
If the "property" arg is given, it's passed through to the
613+
javascript help_window function.
614+
615+
If the "form" arg is given, it's passed through to the
616+
javascript help_window function. - it's the name of the form
617+
the "property" belongs to.
614618
'''
615619
if properties is None:
616620
properties = self._klass.getprops(protected=0).keys()
617621
properties.sort()
618622
properties = ','.join(properties)
619623
if property:
620624
property = '&property=%s'%property
625+
if form:
626+
form = '&form=%s'%form
621627
return '<a class="classhelp" href="javascript:help_window(\'%s?'\
622-
'@startwith=0&amp;@template=help&amp;properties=%s%s\', \'%s\', \
623-
\'%s\')">%s</a>'%(self.classname, properties, property, width,
628+
'@startwith=0&amp;@template=help&amp;properties=%s%s%s\', \'%s\', \
629+
\'%s\')">%s</a>'%(self.classname, properties, property, form, width,
624630
height, self._(label))
625631

626632
def submit(self, label=''"Submit New Entry"):

templates/classic/html/_generic.help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script language="Javascript" type="text/javascript"
99
tal:content="structure string:
1010
// this is the name of the field in the original form that we're working on
11-
field = '${request/form/property/value}';" >
11+
form = window.opener.document.${request/form/form/value};">
1212
</script>
1313
<script src="@@file/help_controls.js" type="text/javascript"><!--
1414
//--></script>

templates/classic/html/help_controls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// initial values for either Nosy, Superseder, Topic and Waiting On,
22
// depending on which has called
3-
original_field = window.opener.document.itemSynopsis[field].value;
3+
original_field = form[field].value;
44

55
// Some browsers (ok, IE) don't define the "undefined" variable.
66
undefined = document.geez_IE_is_really_friggin_annoying;
@@ -35,7 +35,7 @@ function determineList() {
3535
function updateList() {
3636
// write back to opener window
3737
if (document.frm_help.check==undefined) { return; }
38-
window.opener.document.itemSynopsis[field].value = determineList();
38+
form[field].value = determineList();
3939
}
4040

4141
function updatePreview() {

templates/minimal/html/_generic.help.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<script language="Javascript" type="text/javascript"
99
tal:content="structure string:
1010
// this is the name of the field in the original form that we're working on
11-
field = '${request/form/property/value}';" >
11+
form = window.opener.document.${request/form/form/value};">
1212
</script>
1313
<script src="@@file/help_controls.js" type="text/javascript"><!--
1414
//--></script>

0 commit comments

Comments
 (0)