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

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Sep 14 15:02:51 EDT 2004


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

Modified Files:
	collector_issue_add_issue.py subset_edit.py 
Log Message:
Merged yuppie-post_1_5-cleanup-branch:
- removed a lot of deprecated code
- made CMFCollector work with CMF 1.4 *and* HEAD


=== CMF/CMFCollector/skins/collector/collector_issue_add_issue.py 1.1 => 1.2 ===
--- 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 15:02:20 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.2 ===
--- 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 15:02:20 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