Commit 6382406eb07fb278fdfbb369c38b83d7e1ad9e4f
1 parent
92059a21
fix for KTS-1199
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5753 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
5 changed files
with
12 additions
and
9 deletions
plugins/ktcore/KTWorkflowTriggers.inc.php
| @@ -71,12 +71,18 @@ class PermissionGuardTrigger extends KTWorkflowTrigger { | @@ -71,12 +71,18 @@ class PermissionGuardTrigger extends KTWorkflowTrigger { | ||
| 71 | $aPermissions = KTPermission::getList(); | 71 | $aPermissions = KTPermission::getList(); |
| 72 | $aKeyPermissions = array(); | 72 | $aKeyPermissions = array(); |
| 73 | foreach ($aPermissions as $oPermission) { $aKeyPermissions[$oPermission->getName()] = $oPermission; } | 73 | foreach ($aPermissions as $oPermission) { $aKeyPermissions[$oPermission->getName()] = $oPermission; } |
| 74 | + | ||
| 75 | + $current_perms = array(); | ||
| 76 | + foreach ($this->aConfig['perms'] as $sPermName) { | ||
| 77 | + $current_perms[$sPermName] = true; | ||
| 78 | + } | ||
| 74 | 79 | ||
| 75 | $oTemplating =& KTTemplating::getSingleton(); | 80 | $oTemplating =& KTTemplating::getSingleton(); |
| 76 | $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/permissions"); | 81 | $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/permissions"); |
| 77 | $aTemplateData = array( | 82 | $aTemplateData = array( |
| 78 | "context" => $this, | 83 | "context" => $this, |
| 79 | "perms" => $aKeyPermissions, | 84 | "perms" => $aKeyPermissions, |
| 85 | + 'current_perms' => $current_perms, | ||
| 80 | 'args' => $args, | 86 | 'args' => $args, |
| 81 | ); | 87 | ); |
| 82 | return $oTemplate->render($aTemplateData); | 88 | return $oTemplate->render($aTemplateData); |
| @@ -369,7 +375,7 @@ class ConditionGuardTrigger extends KTWorkflowTrigger { | @@ -369,7 +375,7 @@ class ConditionGuardTrigger extends KTWorkflowTrigger { | ||
| 369 | $aTemplateData = array( | 375 | $aTemplateData = array( |
| 370 | "context" => $this, | 376 | "context" => $this, |
| 371 | "conditions" => $aKeyedConditions, | 377 | "conditions" => $aKeyedConditions, |
| 372 | - "current_group" => KTUtil::arrayGet($this->aConfig, 'group_id'), | 378 | + "current_condition" => KTUtil::arrayGet($this->aConfig, 'condition_id'), |
| 373 | 'args' => $args, | 379 | 'args' => $args, |
| 374 | ); | 380 | ); |
| 375 | return $oTemplate->render($aTemplateData); | 381 | return $oTemplate->render($aTemplateData); |
templates/ktcore/workflowtriggers/condition.smarty
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | {* FIXME keep old selection *} | 14 | {* FIXME keep old selection *} |
| 15 | 15 | ||
| 16 | {foreach from=$conditions item=sConditionName key=iConditionId} | 16 | {foreach from=$conditions item=sConditionName key=iConditionId} |
| 17 | - <input type="radio" name="condition_id" value="{$iConditionId}" /> {i18n}{$sConditionName}{/i18n} <br /> | 17 | + <input type="radio" name="condition_id" value="{$iConditionId}" {if ($iConditionId == $current_condition)}checked="true"{/if} /> {i18n}{$sConditionName}{/i18n} <br /> |
| 18 | {/foreach} | 18 | {/foreach} |
| 19 | 19 | ||
| 20 | <div class="form_action"> | 20 | <div class="form_action"> |
templates/ktcore/workflowtriggers/group.smarty
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | {* FIXME keep old selection *} | 14 | {* FIXME keep old selection *} |
| 15 | 15 | ||
| 16 | {foreach from=$groups item=sGroupName key=iGroupId} | 16 | {foreach from=$groups item=sGroupName key=iGroupId} |
| 17 | - <input type="radio" name="group_id" value="{$iGroupId}" /> {i18n}{$sGroupName}{/i18n} <br /> | 17 | + <input type="radio" name="group_id" value="{$iGroupId}" {if ($iGroupId == $current_group)}checked="true"{/if} /> {i18n}{$sGroupName}{/i18n} <br /> |
| 18 | {/foreach} | 18 | {/foreach} |
| 19 | 19 | ||
| 20 | <div class="form_action"> | 20 | <div class="form_action"> |
templates/ktcore/workflowtriggers/permissions.smarty
| @@ -12,15 +12,12 @@ | @@ -12,15 +12,12 @@ | ||
| 12 | <p class="descriptiveText">{i18n}Specify which permissions the user will require in order to perform this transition. Note that | 12 | <p class="descriptiveText">{i18n}Specify which permissions the user will require in order to perform this transition. Note that |
| 13 | the user will be required to have <strong>all</strong> these permissions.{/i18n}</p> | 13 | the user will be required to have <strong>all</strong> these permissions.{/i18n}</p> |
| 14 | 14 | ||
| 15 | -{* FIXME keep old selection *} | ||
| 16 | - | ||
| 17 | -{foreach from=$perms item=oPerm} | ||
| 18 | - <input type="checkbox" name="trigger_perms[{$oPerm->getName()}]" /> {i18n}{$oPerm->getHumanName()}{/i18n} <br /> | 15 | +{foreach from=$perms item=oPerm key=sPermName} |
| 16 | + <input type="checkbox" name="trigger_perms[{$sPermName}]" {if ($current_perms.$sPermName)}checked="true"{/if}/> {i18n}{$oPerm->getHumanName()}{/i18n} <br /> | ||
| 19 | {/foreach} | 17 | {/foreach} |
| 20 | 18 | ||
| 21 | <div class="form_action"> | 19 | <div class="form_action"> |
| 22 | <input type="submit" value="{i18n}Save Trigger{/i18n}" /> | 20 | <input type="submit" value="{i18n}Save Trigger{/i18n}" /> |
| 23 | - {* FIXME how do I cancel again? *} | ||
| 24 | </div> | 21 | </div> |
| 25 | </fieldset> | 22 | </fieldset> |
| 26 | </form> | 23 | </form> |
| 27 | \ No newline at end of file | 24 | \ No newline at end of file |
templates/ktcore/workflowtriggers/roles.smarty
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | {* FIXME keep old selection *} | 14 | {* FIXME keep old selection *} |
| 15 | 15 | ||
| 16 | {foreach from=$roles item=sRoleName key=iRoleId} | 16 | {foreach from=$roles item=sRoleName key=iRoleId} |
| 17 | - <input type="radio" name="role_id" value="{$iRoleId}" /> {i18n}{$sRoleName}{/i18n} <br /> | 17 | + <input type="radio" name="role_id" value="{$iRoleId}" {if ($iRoleId == $current_role)}checked="true"{/if} /> {i18n}{$sRoleName}{/i18n} <br /> |
| 18 | {/foreach} | 18 | {/foreach} |
| 19 | 19 | ||
| 20 | <div class="form_action"> | 20 | <div class="form_action"> |