[CMF-checkins] CVS: CMF/CMFCollector/skins/collector - collector_issue_add_issue.py:1.1.54.1 subset_edit.py:1.1.32.1

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Sep 14 12:56:14 EDT 2004


Update of /cvs-repository/CMF/CMFCollector/skins/collector
In directory cvs.zope.org:/tmp/cvs-serv6110/CMFCollector/skins/collector

Modified Files:
      Tag: yuppie-post_1_5-cleanup-branch
	collector_issue_add_issue.py subset_edit.py 
Log Message:
- made some changes for CMF 1.4 *and* HEAD compatibility


=== CMF/CMFCollector/skins/collector/collector_issue_add_issue.py 1.1 => 1.1.54.1 ===
--- CMF/CMFCollector/skins/collector/collector_issue_add_issue.py:1.1	Wed Oct 10 15:14:58 2001
+++ CMF/CMFCollector/skins/collector/collector_issue_add_issue.py	Tue Sep 14 12:56:14 2004
@@ -1,10 +1,12 @@
-## Script (Python) "collector_issue_add_issue.py"
 ##title=Submit a Request
+##
+collector = context.aq_parent
+try:
+    target = collector.getActionInfo('object/addissue')['url']
+except AttributeError:
+    # for usage with CMF < 1.5
+    ti = collector.getTypeInfo()
+    target = "%s/%s" % ( collector.absolute_url(),
+                         ti.getActionById('addissue') )
 
-typeinfo = context.portal_types.getTypeInfo('Collector')
-addissue = typeinfo.getActionById('addissue')
-
-context.REQUEST.RESPONSE.redirect("%s/%s"
-                                  % (context.aq_parent.absolute_url(),
-                                     addissue))
-
+context.REQUEST.RESPONSE.redirect(target)


=== CMF/CMFCollector/skins/collector/subset_edit.py 1.1 => 1.1.32.1 ===
--- CMF/CMFCollector/skins/collector/subset_edit.py:1.1	Mon Jun 17 17:58:28 2002
+++ CMF/CMFCollector/skins/collector/subset_edit.py	Tue Sep 14 12:56:14 2004
@@ -1,9 +1,14 @@
 ##title=Update a Collector Subset
 ##parameters=parameters, REQUEST
+##
 context.clearParameters()
 for parm in parameters:
     context.setParameter( parm.key, parm.value )
-info = context.getTypeInfo()
-action = info.getActionById( 'edit' )
-REQUEST['RESPONSE'].redirect( '%s/%s?portal_status_message=Updated.'
-        % ( context.absolute_url(), action ) )
+try:
+    target = context.getActionInfo('object/edit')['url']
+except AttributeError:
+    # for usage with CMF < 1.5
+    ti = context.getTypeInfo()
+    target = "%s/%s" % ( context.absolute_url(), ti.getActionById('edit') )
+
+REQUEST.RESPONSE.redirect('%s?portal_status_message=Updated.' % target)



More information about the CMF-checkins mailing list