[CMF-checkins] CVS: CMF/CMFWorkspaces/skins/workspaces - workspace_add_references.py:1.1 workspace_add.py:1.2 workspace_search_results.pt:1.3
Shane Hathaway
shane@cvs.zope.org
Fri, 24 May 2002 13:48:38 -0400
Update of /cvs-repository/CMF/CMFWorkspaces/skins/workspaces
In directory cvs.zope.org:/tmp/cvs-serv27973/skins/workspaces
Modified Files:
workspace_add.py workspace_search_results.pt
Added Files:
workspace_add_references.py
Log Message:
Linked in the organization tool.
=== Added File CMF/CMFWorkspaces/skins/workspaces/workspace_add_references.py ===
##parameters=selected_items=(), RESPONSE=None
##title=Add listed paths to a workspace.
count = 0
for path in selected_items:
object = context.restrictedTraverse(path)
context.addReference(object)
count += 1
if count == 1:
message = "Added+1+reference."
else:
message = "Added+%d+references." % count
if RESPONSE is not None:
RESPONSE.redirect("%s/%s?portal_status_message=%s" %
(context.absolute_url(),
'workspace_view',
message))
=== CMF/CMFWorkspaces/skins/workspaces/workspace_add.py 1.1 => 1.2 ===
-##title=Add listed paths to a workspace.
+##parameters=type_name, RESPONSE
+##title=Redirect to the form for adding the given type.
-count = 0
-for path in selected_items:
- object = context.restrictedTraverse(path)
- context.addReference(object)
- count += 1
-
-if count == 1:
- message = "Added+1+reference."
+if not type_name:
+ url = context.absolute_url() + '/workspace_view'
else:
- message = "Added+%d+references." % count
+ url = context.portal_organization.getAddFormURL(type_name)
-if RESPONSE is not None:
- RESPONSE.redirect("%s/%s?portal_status_message=%s" %
- (context.absolute_url(),
- 'workspace_view',
- message))
+RESPONSE.redirect(url)
=== CMF/CMFWorkspaces/skins/workspaces/workspace_search_results.pt 1.2 => 1.3 ===
</div>
-<input type="submit" name="workspace_add:action" value="Add to workspace"
+<input type="submit" name="workspace_add_references:action"
+ value="Add to workspace"
tal:condition="batch_info/total" />
<input type="submit" name="workspace_view:action" value="Search again" />