workflows: make criticality levels option always visible (#20254)
This commit is contained in:
parent
54d7f87e41
commit
0b6ed7b305
|
@ -101,7 +101,6 @@ def create_temporary_pub(sql_mode=False):
|
|||
fd.write('[options]\n')
|
||||
fd.write('formdef-captcha-option = true\n')
|
||||
fd.write('workflow-resubmit-action = true\n')
|
||||
fd.write('workflow-criticality-levels = true\n')
|
||||
if sql_mode:
|
||||
fd.write('postgresql = true\n')
|
||||
conn = psycopg2.connect(user=os.environ['USER'])
|
||||
|
|
|
@ -1451,7 +1451,7 @@ class WorkflowPage(Directory):
|
|||
r += htmltext('</ul>')
|
||||
r += htmltext('</div>')
|
||||
|
||||
if not str(self.workflow.id).startswith('_') and get_publisher().has_site_option('workflow-criticality-levels'):
|
||||
if not str(self.workflow.id).startswith('_'):
|
||||
r += htmltext('<div class="bo-block">')
|
||||
r += htmltext('<h3>%s') % _('Criticality Levels')
|
||||
if not str(self.workflow.id).startswith('_'):
|
||||
|
|
|
@ -802,15 +802,11 @@ class ManagementDirectory(Directory):
|
|||
order_by=order_by, limit=limit, offset=offset)
|
||||
include_submission_channel = bool(
|
||||
get_publisher().get_site_option('welco_url', 'variables'))
|
||||
include_criticality_level = get_publisher().has_site_option('workflow-criticality-levels')
|
||||
|
||||
r = TemplateIO(html=True)
|
||||
r += htmltext('<table id="listing" class="main">')
|
||||
r += htmltext('<thead><tr>')
|
||||
if include_criticality_level:
|
||||
r += htmltext('<th data-field-sort-key="criticality_level"><span></span></th>')
|
||||
else:
|
||||
r += htmltext('<th></th>') # lock
|
||||
r += htmltext('<th data-field-sort-key="criticality_level"><span></span></th>')
|
||||
if include_submission_channel:
|
||||
r += htmltext('<th data-field-sort-key="submission_channel"><span>%s</span></th>') % _('Channel')
|
||||
r += htmltext('<th data-field-sort-key="formdef_name"><span>%s</span></th>') % _('Form')
|
||||
|
@ -834,14 +830,13 @@ class ManagementDirectory(Directory):
|
|||
if formdata.backoffice_submission:
|
||||
classes.append('backoffice-submission')
|
||||
style = ''
|
||||
if include_criticality_level:
|
||||
try:
|
||||
level = formdata.get_criticality_level_object()
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
classes.append('criticality-level')
|
||||
style = 'style="border-left-color: #%s;"' % level.colour
|
||||
try:
|
||||
level = formdata.get_criticality_level_object()
|
||||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
classes.append('criticality-level')
|
||||
style = 'style="border-left-color: #%s;"' % level.colour
|
||||
r += htmltext('<tr class="%s" data-link="%s">' % (
|
||||
' '.join(classes),
|
||||
formdata.get_url(backoffice=True)))
|
||||
|
|
|
@ -77,9 +77,8 @@ class FormDefUI(object):
|
|||
|
||||
using_postgresql = get_publisher().is_using_postgresql()
|
||||
|
||||
include_criticality_level = get_publisher().has_site_option('workflow-criticality-levels')
|
||||
r += htmltext('<thead><tr>')
|
||||
if include_criticality_level and self.formdef.workflow.criticality_levels and using_postgresql:
|
||||
if self.formdef.workflow.criticality_levels and using_postgresql:
|
||||
r += htmltext('<th style="width: 4ex;" data-field-sort-key="criticality_level"><span></span></th>')
|
||||
else:
|
||||
r += htmltext('<th></th>') # lock
|
||||
|
@ -199,9 +198,7 @@ class FormDefUI(object):
|
|||
url_action = ''
|
||||
root_url = get_publisher().get_root_url()
|
||||
visited_objects = get_publisher().get_visited_objects(exclude_user=get_session().user)
|
||||
include_criticality_level = get_publisher().has_site_option('workflow-criticality-levels')
|
||||
if include_criticality_level:
|
||||
include_criticality_level = bool(self.formdef.workflow.criticality_levels)
|
||||
include_criticality_level = bool(self.formdef.workflow.criticality_levels)
|
||||
for i, filled in enumerate(items):
|
||||
classes = ['status-%s-%s' % (filled.formdef.workflow.id, filled.status)]
|
||||
if i%2:
|
||||
|
|
|
@ -36,8 +36,6 @@ class ModifyCriticalityWorkflowStatusItem(WorkflowStatusItem):
|
|||
|
||||
@classmethod
|
||||
def is_available(cls, workflow=None):
|
||||
if not get_publisher().has_site_option('workflow-criticality-levels'):
|
||||
return False
|
||||
return workflow and workflow.criticality_levels
|
||||
|
||||
def add_parameters_widgets(self, form, parameters, prefix='', formdef=None):
|
||||
|
|
Loading…
Reference in New Issue