From f634e277b74998822cd7bf90b1bdbd047f2be5a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 1 Jun 2016 09:28:11 +0200 Subject: [PATCH] workflows: allow computed expression as choice button label (#11158) --- wcs/workflows.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wcs/workflows.py b/wcs/workflows.py index fccbcb8..e7d6496 100644 --- a/wcs/workflows.py +++ b/wcs/workflows.py @@ -1760,7 +1760,7 @@ class ChoiceWorkflowStatusItem(WorkflowStatusJumpItem): return _('Change Status (not completed)') def fill_form(self, form, formdata, user): - form.add_submit('button%s' % self.id, self.label) + form.add_submit('button%s' % self.id, self.compute(self.label)) if self.require_confirmation: get_response().add_javascript(['jquery.js', '../../i18n.js', 'qommon.js']) widget = form.get_widget('button%s' % self.id) @@ -1777,7 +1777,8 @@ class ChoiceWorkflowStatusItem(WorkflowStatusJumpItem): def add_parameters_widgets(self, form, parameters, prefix='', formdef=None): if 'label' in parameters: - form.add(StringWidget, '%slabel' % prefix, title = _('Label'), value = self.label) + form.add(ComputedExpressionWidget, '%slabel' % prefix, + title=_('Label'), value=self.label) WorkflowStatusJumpItem.add_parameters_widgets(self, form, parameters, prefix, formdef) if 'by' in parameters: form.add(WidgetList, '%sby' % prefix, title = _('By'), element_type = SingleSelectWidget, -- 2.8.1