diff --git a/plugins/ktcore/KTWorkflowTriggers.inc.php b/plugins/ktcore/KTWorkflowTriggers.inc.php index 20b66ec..9edfda1 100644 --- a/plugins/ktcore/KTWorkflowTriggers.inc.php +++ b/plugins/ktcore/KTWorkflowTriggers.inc.php @@ -71,12 +71,18 @@ class PermissionGuardTrigger extends KTWorkflowTrigger { $aPermissions = KTPermission::getList(); $aKeyPermissions = array(); foreach ($aPermissions as $oPermission) { $aKeyPermissions[$oPermission->getName()] = $oPermission; } + + $current_perms = array(); + foreach ($this->aConfig['perms'] as $sPermName) { + $current_perms[$sPermName] = true; + } $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("ktcore/workflowtriggers/permissions"); $aTemplateData = array( "context" => $this, "perms" => $aKeyPermissions, + 'current_perms' => $current_perms, 'args' => $args, ); return $oTemplate->render($aTemplateData); @@ -369,7 +375,7 @@ class ConditionGuardTrigger extends KTWorkflowTrigger { $aTemplateData = array( "context" => $this, "conditions" => $aKeyedConditions, - "current_group" => KTUtil::arrayGet($this->aConfig, 'group_id'), + "current_condition" => KTUtil::arrayGet($this->aConfig, 'condition_id'), 'args' => $args, ); return $oTemplate->render($aTemplateData); diff --git a/templates/ktcore/workflowtriggers/condition.smarty b/templates/ktcore/workflowtriggers/condition.smarty index d6c5e8e..2c074af 100644 --- a/templates/ktcore/workflowtriggers/condition.smarty +++ b/templates/ktcore/workflowtriggers/condition.smarty @@ -14,7 +14,7 @@ {* FIXME keep old selection *} {foreach from=$conditions item=sConditionName key=iConditionId} - {i18n}{$sConditionName}{/i18n}
+ {i18n}{$sConditionName}{/i18n}
{/foreach}
diff --git a/templates/ktcore/workflowtriggers/group.smarty b/templates/ktcore/workflowtriggers/group.smarty index 4ce9b0f..d2c497d 100644 --- a/templates/ktcore/workflowtriggers/group.smarty +++ b/templates/ktcore/workflowtriggers/group.smarty @@ -14,7 +14,7 @@ {* FIXME keep old selection *} {foreach from=$groups item=sGroupName key=iGroupId} - {i18n}{$sGroupName}{/i18n}
+ {i18n}{$sGroupName}{/i18n}
{/foreach}
diff --git a/templates/ktcore/workflowtriggers/permissions.smarty b/templates/ktcore/workflowtriggers/permissions.smarty index 6259952..d54a0b0 100644 --- a/templates/ktcore/workflowtriggers/permissions.smarty +++ b/templates/ktcore/workflowtriggers/permissions.smarty @@ -12,15 +12,12 @@

{i18n}Specify which permissions the user will require in order to perform this transition. Note that the user will be required to have all these permissions.{/i18n}

-{* FIXME keep old selection *} - -{foreach from=$perms item=oPerm} - {i18n}{$oPerm->getHumanName()}{/i18n}
+{foreach from=$perms item=oPerm key=sPermName} + {i18n}{$oPerm->getHumanName()}{/i18n}
{/foreach}
- {* FIXME how do I cancel again? *}
\ No newline at end of file diff --git a/templates/ktcore/workflowtriggers/roles.smarty b/templates/ktcore/workflowtriggers/roles.smarty index 9416525..3631b5f 100644 --- a/templates/ktcore/workflowtriggers/roles.smarty +++ b/templates/ktcore/workflowtriggers/roles.smarty @@ -14,7 +14,7 @@ {* FIXME keep old selection *} {foreach from=$roles item=sRoleName key=iRoleId} - {i18n}{$sRoleName}{/i18n}
+ {i18n}{$sRoleName}{/i18n}
{/foreach}