editState.smarty
7.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{capture assign=sCSS}{literal}
td.true { background-color: #aaffaa; text-align: centre }
td.false { background-color: #ffaaaa; text-align: centre }
.edit { display: none; }
.view { display: block; }
.tablebutton {
margin: 0em;
margin-right: 1em;
border: 1px solid #cccccc;
}
.activebutton {
background-color: #eeeeff;
}
.inactivebutton {
background-color: #ffeeee;
}
{/literal}{/capture}
{$context->oPage->requireCSSStandalone($sCSS)}
<h2><img src="{if $config->get("ui/morphEnabled") == '1'}{$rootUrl}/skins/kts_{$config->get("ui/morphTo")}/title_bullet.png{else}{$rootUrl}/resources/graphics/title_bullet.png{/if}"/>{i18n}State{/i18n}:<br />{$oState->getName()|sanitize}</h2>
<p class="descriptiveText">{i18n}As documents move through their lifecycle, they
are placed in certain <strong>states</strong>. For example, an invoice
which has been mailed might be in the "Pending" <strong>state</strong> after
the "sent" <strong>transition</strong> has been performed by a user.{/i18n}</p>
<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Edit state properties{/i18n}</legend>
<input type="hidden" name="action" value="saveState" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
{foreach item=oWidget from=$editForm}
{$oWidget->render()}
{/foreach}
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Save{/i18n}" />
</div>
</fieldset>
</form>
<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="action" value="saveInform" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
<fieldset>
<legend>{i18n}Inform Which Users?{/i18n}</legend>
<p class="descriptiveText">{i18n}Please select which roles or groups should be
informed when this state is reached.{/i18n}</p>
{if $aRoles}
<h3>{i18n}Roles{/i18n}</h3>
{entity_checkboxes entities=$aRoles name="fNotification[role]" multiple="true" selected=$aInformed.role assign=aBoxes}
{foreach from=$aBoxes item=sBox}
{$sBox}<br />
{/foreach}
{/if}
{if $aGroups}
<h3>{i18n}Groups{/i18n}</h3>
{entity_checkboxes entities=$aGroups name="fNotification[group]" multiple="true" selected=$aInformed.group assign=aBoxes}
{foreach from=$aBoxes item=sBox}
{$sBox}<br />
{/foreach}
{/if}
{if (empty($aGroups) && empty($aRoles))}
<div class="ktInfoMessage"><span>{i18n}No groups or roles are defined in the DMS.{/i18n}</span></div>
{else}
<div class="form_actions">
<input type="submit" value="{i18n}Update users to inform{/i18n}" />
</div>
{/if}
</fieldset>
</form>
{*
<h3>{i18n}Assigned Permissions{/i18n}</h3>
<p class="descriptiveText">{i18n}While in this workflow state, additional permissions
may be given. This is done either to expose the document to more users
or to allow a particular role to be fulfilled before a workflow
transition can be accomplished.{/i18n}</p>
*}
<fieldset>
<legend>{i18n}Transitions{/i18n}</legend>
<p class="descriptiveText">{i18n}Transitions are how documents move from one
state to another. Typically, most transitions can only be performed by people
with a specific <strong>role</strong> (e.g. Manager) or part of a specific group
(e.g. Marketing Department).{/i18n}</p>
{if $aTransitionsTo}
<h3>{i18n}Transitions to this state{/i18n}</h3>
{if (!empty($aTransitionsTo))}
<ul>
{foreach from=$aTransitionsTo item=oTransition}
<li><a
href="{addQS}action=editTransition&fWorkflowId={$oWorkflow->getId()}&fTransitionId={$oTransition->getId()}{/addQS}"
title="Transition
{$oTransition->getId()}">{$oTransition->getName()}</a></li>
{/foreach}
</ul>
{/if}
{else}
<div class="ktInfoMessage"><span>{i18n}No transitions lead to this state.{/i18n}</span></div>
{/if}
<h3>{i18n}Transitions from this state{/i18n}</h3>
<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="action" value="saveTransitions" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
{if (!empty($aTransitions))}
{entity_checkboxes entities=$aTransitions name="fTransitionIds" multiple="true" selected=$aTransitionsSelected separator="<br />"}
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Save{/i18n}" />
</div>
{else}
<div class="ktInfoMessage"><span>{i18n}No transitions have been defined for this workflow.{/i18n}</span></div>
{/if}
</form>
</fieldset>
{if (!empty($aActions))}
<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Actions allowed{/i18n}</legend>
<input type="hidden" name="action" value="setStateActions" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
<ul>
{entity_checkboxes name="fActions" entities=$aActions idmethod="getName" method="getDisplayName" assign="aCheckboxes" selected="$aActionsSelected"}
{foreach from=$aCheckboxes item=sCheckbox}
<li>{$sCheckbox}</li>
{/foreach}
</ul>
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Set allowed actions{/i18n}" />
</div>
</fieldset>
</form>
{else}
<div class="ktInfoMessage"><span>{i18n}No actions are controlled by this workflow, so all actions are available when
documents are in this state.{/i18n}</span></div>
{/if}
{if (!empty($permissions))}
<form action="{$smarty.server.PHP_SELF}" method="POST">
<fieldset>
<legend>{i18n}Controlled Permissions{/i18n}</legend>
<input type="hidden" name="action" value="setStatePermissions" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
<ul>
{entity_checkboxes name="fPermissions" entities=$permissions idmethod="getName" method="getHumanName" assign="aCheckboxes" selected="$state_permissions"}
{foreach from=$aCheckboxes item=sCheckbox}
<li>{$sCheckbox}</li>
{/foreach}
</ul>
<div class="form_actions">
<input type="submit" name="submit" value="{i18n}Set controlled permissions{/i18n}" />
</div>
</fieldset>
</form>
{if (!empty($state_permissions))}
<form action="{$smarty.server.PHP_SELF}" method="POST">
<input type="hidden" name="action" value="assignStatePermissions" />
<input type="hidden" name="fWorkflowId" value="{$oWorkflow->getId()}" />
<input type="hidden" name="fStateId" value="{$oState->getId()}" />
<table cellspacing="0" class="kt_collection">
<thead>
<tr>
<th>{i18n}Role or Group{/i18n}</th>
{foreach from=$state_permissions item=sPermName}
<th>{$permissions.$sPermName->getHumanName()}</th>
{/foreach}
</tr>
</thead>
<tbody>
{ foreach item=oRole from=$aRoles }
<tr>
<td><span class="descriptiveText">{i18n}Role{/i18n}: </span>{$oRole->getName()}</td>
{ foreach from=$state_permissions item=sPermName }
<td><input type="checkbox" name="fPermissions[{$sPermName}][role][]" value="{$oRole->getId()}" {if ($context->getRoleHasPermissionInState($oRole, $sPermName, $oState))}checked="true"{/if}/></td>
{ /foreach }
</tr>
{ /foreach }
{ foreach item=oGroup from=$aGroups }
<tr>
<td><span class="descriptiveText">{i18n}Group{/i18n}: </span>{$oGroup->getName()}</td>
{ foreach from=$state_permissions item=sPermName }
<td><input type="checkbox" name="fPermissions[{$sPermName}][group][]" value="{$oGroup->getId()}"{if ($context->getGroupHasPermissionInState($oGroup, $sPermName, $oState))}checked="true"{/if}/></td>
{ /foreach }
</tr>
{ /foreach }
</tbody>
</table>
<div class="form_actions">
<input type="submit" value="{i18n}Update Allocated Permissions{/i18n}"/>
</div>
</form>
{/if}
{else}
<div class="ktInfoMessage"><span>{i18n arg_appname="$appname"}No permissions have been created within #appname#.{/i18n}</span></div>
{/if}