# HG changeset patch # User Thierry Florac # Date 1523546277 -7200 # Node ID be08f81ace62537e273df7adb79ce97f45fe08a6 # Parent d272d5dc4cb70c0e7cd7145683c487bf703e36ca Updated widget name diff -r d272d5dc4cb7 -r be08f81ace62 src/pyams_workflow/zmi/transition.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' diff -r d272d5dc4cb7 -r be08f81ace62 src/pyams_workflow/zmi/viewlet/transitions.py --- 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