#include "macro_workflows.html" />
<@row>
<@columns sm=12 md=4>
<@box style='primary'>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.title' />
<@boxBody>
<@tform action='jsp/admin/plugins/workflow/DoModifyAction.jsp?plugin_name=workflow'>
<@fieldSet>
<@input type='hidden' name='id_action' value=action.id />
<@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 inputSize=80 />
@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}'>
<@select name='id_state_before' items=state_list default_value=action.stateBefore.id?string />
@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_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 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 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>
<@table striped=true condensed=true responsive=false hover=false>
<@tr>
<@th>#i18n{workflow.create_action.label_available_linked_actions}@th>
<@th> @th>
<@th>#i18n{workflow.create_action.label_selected_linked_actions}@th>
@tr>
<@tr>
<@td>
<@select name="select_linked_actions" default_value="" multiple=10 items=available_linked_actions />
@td>
<@td>
<@button type='submit' name='apply' title='#i18n{workflow.create_action.label_select_unselect_linked_actions}'/>
@td>
<@td>
<@select name="unselect_linked_actions" default_value="" multiple=10 items=selected_linked_actions/>
@td>
@tr>
@table>
<#else>
<@callOut color='warning'>
<@icon style='exclamation-triangle'/>
#i18n{workflow.create_action.label_link_actions_comment_display_task_forms}
@callOut>
#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='check-circle' title='#i18n{workflow.modify_action.button_apply}' />
<@button type='submit' name='cancel' buttonIcon='times-circle' title='#i18n{workflow.create_action.button_cancel}' cancel=true />
@formGroup>
@fieldSet>
@tform>
@boxBody>
@box>
@columns>
<@columns sm=12 md=8 lg=8>
<@box style='primary'>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.manage_task.title' />
<@boxBody>
<@fieldSet>
<@tform action='jsp/admin/plugins/workflow/DoInsertTask.jsp?plugin_name=workflow'>
<@input type='hidden' name='id_action' value=action.id/>
<@formGroup rows=2 labelFor='task_type_key' labelKey='#i18n{workflow.modify_action.manage_task.insert_new_task}'>
<@inputGroup>
<@select name='task_type_key' default_value='-1' items=task_type_list sort=true />
<@inputGroupItem>
<@button hideTitle=['all'] type='submit' buttonIcon='plus' title='#i18n{workflow.create_action.button_insert_new_task}' size='sm' />
@inputGroupItem>
@inputGroup>
@formGroup>
@tform>
<@tag color='info' tagIcon='exclamation-triangle'> #i18n{workflow.modify_action.manage_task.warning_assignment}@tag>
<@div align='right'>
<@aButton href='jsp/admin/plugins/workflow/DoUpdateTaskOrder.jsp?id_action=${action.id}' hideTitle=['all'] buttonIcon='arrows-v' title='#i18n{workflow.modify_workflow.init_order}' iconPosition='right' size='sm' />
@div>
<@table striped=true condensed=true responsive=false hover=false>
<@tr>
<@th> #i18n{workflow.modify_workflow.order} @th>
<@th> #i18n{workflow.modify_action.manage_task.title}@th>
<@th> #i18n{workflow.modify_action.manage_task.row_actions} @th>
@tr>
<#list task_list as task>
<@tr>
<@td>
<@tform action='jsp/admin/plugins/workflow/DoChangeOrderTask.jsp'>
<#if (task_list?size > 1)>
<@inputGroup>
<@comboOrders name="order_task_id" default_value=task.order max=number_task />
<@input type='hidden' name='id_workflow' value=action.workflow.id />
<@input type='hidden' name='id_task' value=task.id/>
<@inputGroupItem>
<@button hideTitle=['all'] type='submit' buttonIcon='check' title='#i18n{workflow.modify_workflow.move}' size='sm' />
@inputGroupItem>
@inputGroup>
<#else>
${task.order}
#if>
@tform>
@td>
<@td>
<#if task.taskType.title!="">${task.taskType.title}#if>
<#if task.getTitle(locale)!="">
${task.getTitle(locale)} #if>
@td>
<@td>
<#if task.taskType.configRequired>
<@aButton href='jsp/admin/plugins/workflow/ModifyTask.jsp?id_task=${task.id}' hideTitle=['all'] buttonIcon='edit' title='#i18n{workflow.manage_workflow.title_modify}' size='sm' />
#if>
<@aButton href='jsp/admin/plugins/workflow/DoCopyTask.jsp?id_task=${task.id}' hideTitle=['all'] buttonIcon='copy' title='#i18n{workflow.modify_action.manage_task.title_copy}' size='sm' />
<@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}' size='sm' />
@td>
@tr>
#list>
@table>
@fieldSet>
@boxBody>
@box>
<@box style='primary'>
<@boxHeader titleLevel='h3' i18nTitleKey='workflow.modify_action.manage_prerequisite.title'>
<@tform action='jsp/admin/plugins/workflow/prerequisite/GetCreatePrerequisite.jsp' type='inline'>
<@inputGroup>
<@select name='prerequisite_type' items=list_prerequisite_type default_value='' />
<@input type='hidden' name='id_action' value=action.id/>
<@inputGroupItem>
<@button hideTitle=['all'] type='submit' buttonIcon='plus' title='#i18n{workflow.modify_action.manage_prerequisite.createPrerequisite}' size='sm' />
@inputGroupItem>
@inputGroup>
@tform>
@boxHeader>
<@boxBody>
<@fieldSet>
<#if listPrerequisite?? && listPrerequisite?size > 0>
<@table striped=true condensed=true responsive=false hover=false>
<@tr>
<@th>#i18n{workflow.modify_action.manage_prerequisite.columnTitle}@th>
<@th>#i18n{workflow.modify_action.manage_task.row_actions}@th>
@tr>
<#list listPrerequisite as prerequisite>
<@tr>
<@td>#i18n{${prerequisite.title}}@td>
<@td><#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' size='sm' />
#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' size='sm' />
@td>
@tr>
#list>
@table>
<#else>
#i18n{workflow.modify_action.manage_prerequisite.noItem}
#if>
<@formHelp>#i18n{workflow.modify_action.manage_prerequisite.help}@formHelp>
@fieldSet>
@boxBody>
@box>
@columns>
@row>