From 0c5877c5508daf1ac0fab510505a432e4382081d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Sat, 25 Nov 2006 11:35:54 +0000 Subject: [PATCH] Folder_modifyWorkflowStatus activate a dummy method on the folder it self after all activities to change workflow state, this way the user can see that there are activiites when viewing the module. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11485 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../erp5_core/Folder_modifyWorkflowStatus.xml | 21 +++++++++++++------ product/ERP5/bootstrap/erp5_core/bt/revision | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_modifyWorkflowStatus.xml b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_modifyWorkflowStatus.xml index a0c73fbcb4..2f1593bc57 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_modifyWorkflowStatus.xml +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Folder_modifyWorkflowStatus.xml @@ -75,10 +75,10 @@ from Products.DCWorkflow.DCWorkflow import ValidationFailed\n from Products.ERP5Type.Message import Message\n \n N_ = lambda msg, **kw: Message(\'erp5_ui\', msg, **kw)\n -request=context.REQUEST\n -getObject = context.getPortalObject().portal_catalog.getObject\n -getActionsFor = context.getPortalObject().portal_workflow.getActionsFor\n -\n +request = context.REQUEST\n +portal = context.getPortalObject()\n +getObject = portal.portal_catalog.getObject\n +getActionsFor = portal.portal_workflow.getActionsFor\n \n form = getattr(context, dialog_id)\n kw = {}\n @@ -107,14 +107,21 @@ len_selection_list = len(selection_list)\n if len_selection_list == context.countFolder():\n value_error = N_("Refusing to process the entire module")\n else:\n + # generate a random tag\n + tag = \'folder_workflow_action_%s\' % portal.portal_ids.generateNewLongId()\n +\n processed_object_count = 0 \n for o in selection_list:\n o = o.getObject()\n if workflow_action in [ai[\'id\'] for ai in getActionsFor(o)\n if ai.has_key(\'id\')]:\n - o.activate().Base_workflowStatusModify(batch = 1, **kw)\n + o.activate(tag=tag).Base_workflowStatusModify(batch=1, **kw)\n processed_object_count += 1\n - \n + # activate something on the folder, this way the folder will be marked to\n + # have activity and the user will be informed when this batch processing is\n + # finished\n + context.activate(after_tag=tag).getTitle()\n +\n value_error = N_("Workflow modification in progress for "\n "${processed_object_count} out of ${selected_object_count}",\n mapping=dict(processed_object_count=processed_object_count,\n @@ -191,6 +198,7 @@ return request.RESPONSE.redirect( redirect_url )\n <string>_getattr_</string> <string>context</string> <string>request</string> + <string>portal</string> <string>getObject</string> <string>getActionsFor</string> <string>getattr</string> @@ -211,6 +219,7 @@ return request.RESPONSE.redirect( redirect_url )\n <string>len</string> <string>len_selection_list</string> <string>value_error</string> + <string>tag</string> <string>processed_object_count</string> <string>o</string> <string>ai</string> diff --git a/product/ERP5/bootstrap/erp5_core/bt/revision b/product/ERP5/bootstrap/erp5_core/bt/revision index 05cf25896d..252b382b33 100644 --- a/product/ERP5/bootstrap/erp5_core/bt/revision +++ b/product/ERP5/bootstrap/erp5_core/bt/revision @@ -1 +1 @@ -201 \ No newline at end of file +202 \ No newline at end of file -- 2.30.9