Updated widget name
authorThierry Florac <thierry.florac@onf.fr>
Thu, 12 Apr 2018 17:17:57 +0200
changeset 66 be08f81ace62
parent 65 d272d5dc4cb7
child 67 ba20d5866fef
Updated widget name
src/pyams_workflow/zmi/transition.py
src/pyams_workflow/zmi/viewlet/transitions.py
--- a/src/pyams_workflow/zmi/transition.py	Wed Apr 11 11:44:21 2018 +0200
+++ b/src/pyams_workflow/zmi/transition.py	Thu Apr 12 17:17:57 2018 +0200
@@ -34,12 +34,13 @@
 class WorkflowContentTransitionForm(AdminDialogAddForm):
     """Workflow content transition form"""
 
+    prefix = 'workflow.'
+
     @reify
     def transition(self):
         parent = get_parent(self.context, IWorkflowManagedContent)
         workflow = query_utility(IWorkflow, name=parent.workflow_name)
-        return workflow.get_transition_by_id(self.request.params.get(
-            '{0}{1}transition_id'.format(self.prefix, self.widgets.prefix)))
+        return workflow.get_transition_by_id(self.request.params.get('workflow.widgets.transition_id'))
 
     @property
     def legend(self):
@@ -60,8 +61,7 @@
         super(WorkflowContentTransitionForm, self).updateWidgets(prefix)
         if 'transition_id' in self.widgets:
             self.widgets['transition_id'].mode = HIDDEN_MODE
-            self.widgets['transition_id'].value = self.request.params.get(
-                '{0}{1}transition_id'.format(self.prefix, self.widgets.prefix))
+            self.widgets['transition_id'].value = self.request.params.get('workflow.widgets.transition_id')
         if 'comment' in self.widgets:
             self.widgets['comment'].widget_css_class = 'textarea'
 
--- a/src/pyams_workflow/zmi/viewlet/transitions.py	Wed Apr 11 11:44:21 2018 +0200
+++ b/src/pyams_workflow/zmi/viewlet/transitions.py	Thu Apr 12 17:17:57 2018 +0200
@@ -38,8 +38,8 @@
         super(WorkflowMenuItem, self).__init__(context, request, view, manager)
         self.label = transition.title
         self.label_css_class = transition.user_data.get('menu_css_class') or 'fa fa-fw'
-        self.url = '{url}?form.widgets.transition_id={transition}'.format(url=transition.user_data.get('view_name'),
-                                                                          transition=transition.transition_id)
+        self.url = '{url}?workflow.widgets.transition_id={transition}'.format(url=transition.user_data.get('view_name'),
+                                                                              transition=transition.transition_id)
         self.weight = transition.order
         self.modal_target = True