#include "macro_workflows.html" />
<@pageContainer>
<@pageColumn>
<@pageHeader title='#i18n{workflow.modify_action.title} : ${action.name}' class='' />
<@breadcrumbs class='py-3'>
<@breadcrumbItem><@link href='jsp/admin/plugins/workflow/ModifyWorkflow.jsp?id_workflow=${action.workflow.id!}&pane=pane-actions' label='#i18n{portal.util.labelBack} #i18n{workflow.modify_workflow.page_title}'/>@breadcrumbItem>
<@breadcrumbItem class='active'><@link href='jsp/admin/plugins/workflow/ManageStates.jsp' label='#i18n{workflow.modify_action.title}' />@breadcrumbItem>
@breadcrumbs>
<@row>
<@columns sm=12 md=4>
<@box>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.title' />
<@boxBody>
<@tform action='jsp/admin/plugins/workflow/DoModifyAction.jsp?plugin_name=workflow'>
<@input type='hidden' name='id_action' value=action.id />
<@input type="hidden" name="token" value="${token}" />
<@formGroup rows=2 labelFor='name' labelKey='#i18n{workflow.create_action.label_name}' mandatory=true helpKey='#i18n{workflow.create_action.label_name_comment}'>
<@input type='text' name='name' value=action.name maxlength=255 />
@formGroup>
<@formGroup rows=2 labelFor='uid' labelKey='#i18n{workflow.create_action.label_uid}' mandatory=true helpKey='#i18n{workflow.create_action.label_uid_comment}'>
<@input type='text' name='uid' value=action.uid readonly=true />
@formGroup>
<@formGroup rows=2 labelFor='description' labelKey='#i18n{workflow.create_action.label_description}' mandatory=true helpKey='#i18n{workflow.create_action.label_description_comment}' >
<@input type='textarea' name='description' rows=2 cols=80>${action.description}@input>
@formGroup>
<@formGroup rows=2 labelFor='id_state_before' labelKey='#i18n{workflow.create_action.label_state_before}' mandatory=true helpKey='#i18n{workflow.create_action.label_state_before_comment}'>
<#list state_list as state>
<#assign isCheck=false />
<#list action.listIdStateBefore as stateChecked>
<#if state.code == stateChecked?c >
<#assign isCheck=true />
#if>
#list>
<@checkBox orientation='switch' name='id_state_before' id='id_state_before${state.code}' value='${state.code}' labelKey='${state.name}' checked=isCheck />
#list>
@formGroup>
<@formGroup rows=2 labelFor='id_state_after' labelKey='#i18n{workflow.create_action.label_state_after}' mandatory=true helpKey='#i18n{workflow.create_action.label_state_after_comment}'>
<@select name='id_state_after' items=state_list default_value=action.stateAfter.id?string />
@formGroup>
<@formGroup rows=2 labelFor='id_alternative_state_after' labelKey='#i18n{workflow.create_action.label_alternative_state_after}' helpKey='#i18n{workflow.create_action.label_alternative_state_after_comment}'>
<@select name='id_alternative_state_after' items=alternative_state_list default_value=action.alternativeStateAfter.id?string />
@formGroup>
<@formGroup rows=2 labelFor='id_icon' labelKey='#i18n{workflow.create_action.label_icon}' mandatory=true helpKey='#i18n{workflow.create_action.label_icon_comment}'>
<@radioIconList name="id_icon" default_value=action.icon.id icons=icon_list />
@formGroup>
<@formGroup rows=2 labelFor='automatic' helpKey='#i18n{workflow.create_action.label_automatic_comment}'>
<@checkBox orientation='switch' name='automatic' id='automatic' value='1' labelKey='#i18n{workflow.create_action.label_automatic}' checked=action.automaticState />
@formGroup>
<@formGroup rows=2 labelFor='is_mass_action' helpKey='#i18n{workflow.create_action.label_mass_action_comment}'>
<@checkBox orientation='switch' name='is_mass_action' id='is_mass_action' value='1' labelKey='#i18n{workflow.create_action.label_mass_action}' checked=action.massAction/>
@formGroup>
<@formGroup rows=2 >
<@formHelp>#i18n{workflow.create_action.label_link_actions}@formHelp>
<@formHelp>#i18n{workflow.create_action.label_link_actions_comment}@formHelp>
<@formHelp>#i18n{workflow.create_action.label_link_actions_example}@formHelp>
<#if !display_tasks_form>
<@formGroup labelFor='select_linked_actions' labelKey='#i18n{workflow.create_action.label_available_linked_actions}' rows=2 >
<@select name='select_linked_actions' default_value='' multiple=10 items=available_linked_actions />
@formGroup>
<@formGroup labelFor='unselect_linked_actions' labelKey='#i18n{workflow.create_action.label_selected_linked_actions}' rows=2 >
<@select name='unselect_linked_actions' default_value='' multiple=10 items=selected_linked_actions/>
@formGroup>
<@button type='submit' name='apply' title='#i18n{workflow.create_action.label_select_unselect_linked_actions}'/>
<#else>
<@alert color='warning' class='my-3'>
<@icon style='alert-triangle' class='me-2'/> #i18n{workflow.create_action.label_link_actions_comment_display_task_forms}
@alert>
#if>
@formGroup>
<@formGroup rows=2 >
<@button type='submit' name='save' buttonIcon='check' title='#i18n{workflow.create_action.button_save}' />
<@button type='submit' name='apply' buttonIcon='circle-check' title='#i18n{workflow.modify_action.button_apply}' />
<@button type='submit' name='cancel' buttonIcon='x' title='#i18n{workflow.create_action.button_cancel}' cancel=true />
@formGroup>
@tform>
@boxBody>
@box>
@columns>
<@columns sm=12 md=8>
<@box>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.manage_task.title' >
<@tform action='jsp/admin/plugins/workflow/DoInsertTask.jsp?plugin_name=workflow' type='inline'>
<@input type='hidden' name='id_action' value=action.id/>
<@input type="hidden" name="token" value="${token}" />
<@formGroup rows=2 labelFor='task_type_key' formStyle='' labelKey='#i18n{workflow.modify_action.manage_task.insert_new_task}' hideLabel=['all']>
<@inputGroup>
<@select name='task_type_key' default_value='-1' items=task_type_list sort=true />
<@button type='submit' buttonIcon='plus' title='#i18n{workflow.create_action.button_insert_new_task}' />
<@aButton href='jsp/admin/plugins/workflow/DoUpdateTaskOrder.jsp?id_action=${action.id}' hideTitle=['all'] color='secondary' buttonIcon='arrows-sort' title='#i18n{workflow.modify_workflow.init_order}' iconPosition='right' />
@inputGroup>
@formGroup>
@tform>
@boxHeader>
<@boxBody>
<@callOut color='info' callOutIcon='info-triangle' title='#i18n{workflow.modify_action.manage_task.warning_assignment}' />
<@manageFeature>
<#list task_list as task>
<@manageFeatureItem>
<@manageFeatureItemColumn auto=true>
<@tform action='jsp/admin/plugins/workflow/DoChangeOrderTask.jsp'>
<#if (task_list?size > 1)>
<@input type='hidden' name='id_workflow' value=action.workflow.id />
<@input type='hidden' name='id_task' value=task.id/>
<@inputGroup>
<@comboOrders name='order_task_id' default_value=task.order max=number_task />
<@button type='submit' buttonIcon='check' color='secondary' title='#i18n{workflow.modify_workflow.move}' hideTitle=['all'] />
@inputGroup>
<#else>
#i18n{workflow.modify_workflow.order} : <@tag>${task.order}@tag>
#if>
@tform>
@manageFeatureItemColumn>
<@manageFeatureItemColumn auto=true>
<#if task.taskType.title!=""><@span class='d-inline-block text-truncate' params='style="max-width: 450px;"'>${task.taskType.title}@span>
<#elseif task.getTitle(locale)!=""><@span class='d-inline-block text-truncate' params='style="max-width: 450px;"'>${task.getTitle(locale)}@span>#if>
@manageFeatureItemColumn>
<@manageFeatureItemColumn align='end'>
<#if task.taskType.configRequired>
<@offcanvas targetUrl='jsp/admin/plugins/workflow/ModifyTask.jsp?id_task=${task.id}' useIframe=true targetElement='#edit_task_page' id='task${task.id}-edit' title='#i18n{workflow.modify_task.title}' btnTitle='' size='half' btnIcon='pencil' position='end' />
#if>
<@aButton href='jsp/admin/plugins/workflow/ConfirmCopyTask.jsp?id_task=${task.id}' hideTitle=['all'] color='warning' class='me-2' buttonIcon='copy' title='#i18n{workflow.modify_action.manage_task.title_copy}' />
<@aButton href='jsp/admin/plugins/workflow/ConfirmRemoveTask.jsp?id_task=${task.id}' hideTitle=['all'] color='danger' buttonIcon='trash' title='#i18n{workflow.modify_action.manage_task.title_delete}' />
@manageFeatureItemColumn>
@manageFeatureItem>
#list>
@manageFeature>
@boxBody>
@box>
<@box>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.manage_prerequisite.title'>
<@tform action='jsp/admin/plugins/workflow/prerequisite/GetCreatePrerequisite.jsp' type='inline'>
<@input type='hidden' name='id_action' value=action.id/>
<@formGroup rows=2 formStyle='' labelFor='task_type_key' labelKey='#i18n{workflow.modify_action.manage_prerequisite.createPrerequisite}' hideLabel=['all']>
<@inputGroup>
<@select name='prerequisite_type' items=list_prerequisite_type default_value='' />
<@button type='submit' buttonIcon='plus' title='#i18n{workflow.modify_action.manage_prerequisite.createPrerequisite}' />
@inputGroup>
@formGroup>
@tform>
@boxHeader>
<@boxBody>
<#if listPrerequisite?? && listPrerequisite?size gt 0>
<@manageFeature striped=true condensed=true responsive=false hover=false>
<#-- #i18n{workflow.modify_action.manage_prerequisite.columnTitle} / #i18n{workflow.modify_action.manage_task.row_actions} -->
<#list listPrerequisite as prerequisite>
<@manageFeatureItem>
<@manageFeatureItemColumn>#i18n{${prerequisite.title}}@manageFeatureItemColumn>
<@manageFeatureItemColumn align='end'>
<#if prerequisite.hasConfiguration>
<@aButton href='jsp/admin/plugins/workflow/prerequisite/GetModifyPrerequisite.jsp?id_prerequisite=${prerequisite.idPrerequisite}&id_action=${action.id}' title='#i18n{workflow.manage_workflow.title_modify}' hideTitle=['all'] buttonIcon='edit' />
<#-- btnTitle='#i18n{workflow.manage_workflow.title_modify}' -->
<#-- <@offcanvas targetUrl='jsp/admin/plugins/workflow/prerequisite/GetModifyPrerequisite.jsp?id_prerequisite=${prerequisite.idPrerequisite}&id_action=${action.id}' targetElement='#create_edit_prerequisite_page' redirectForm=false id='prerequisite${prerequisite.idPrerequisite}' title='#i18n{workflow.modify_action.manage_prerequisite.createPrerequisite}' btnTitle='' btnIcon='edit' position='end' /> -->
#if>
<@aButton href='jsp/admin/plugins/workflow/prerequisite/ConfirmRemovePrerequisite.jsp?id_prerequisite=${prerequisite.idPrerequisite}&id_action=${action.id}' title='#i18n{workflow.modify_action.manage_task.title_delete}' hideTitle=['all'] buttonIcon='trash' color='danger' />
@manageFeatureItemColumn>
@manageFeatureItem>
#list>
@manageFeature>
<@callOut color='info' callOutIcon='info-triangle' title='#i18n{workflow.modify_action.manage_prerequisite.help}' />
<#else>
<@empty />
#if>
@boxBody>
@box>
@columns>
@row>
@pageColumn>
@pageContainer>