From 752f0839a415dcba2f132eb4c3b6ffb2cae86342 Mon Sep 17 00:00:00 2001
From: bshuttle
Date: Wed, 1 Feb 2006 11:16:48 +0000
Subject: [PATCH] workflow disabling.
---
plugins/ktcore/admin/workflows.php | 29 +++++++++++++++++++++++++++++
templates/ktcore/workflow/listWorkflows.smarty | 33 +++++++++++++++++++++++++++++----
2 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/plugins/ktcore/admin/workflows.php b/plugins/ktcore/admin/workflows.php
index daa698c..2b898db 100755
--- a/plugins/ktcore/admin/workflows.php
+++ b/plugins/ktcore/admin/workflows.php
@@ -438,6 +438,35 @@ class KTWorkflowDispatcher extends KTAdminDispatcher {
}
// }}}
+
+
+ // {{{ do_disableWorkflow
+ function do_disableWorkflow() {
+ $oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
+
+ $this->startTransaction();
+
+ $oWorkflow->setStartStateId(null);
+ $res = $oWorkflow->update();
+
+ $this->oValidator->notErrorFalse($res, array(
+ 'redirect_to' => array('main'),
+ 'message' => _('Error saving workflow'),
+ ));
+
+ $this->commitTransaction();
+
+ $this->successRedirectToMain(_('Changes saved'));
+ exit(0);
+ }
+ // }}}
+
+
+
+
+
+
+
function do_manageActions() {
$oTemplate =& $this->oValidator->validateTemplate('ktcore/workflow/manageActions');
$oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
diff --git a/templates/ktcore/workflow/listWorkflows.smarty b/templates/ktcore/workflow/listWorkflows.smarty
index b1608d4..d13c731 100644
--- a/templates/ktcore/workflow/listWorkflows.smarty
+++ b/templates/ktcore/workflow/listWorkflows.smarty
@@ -25,12 +25,37 @@ lifecycle of the document.{/i18n}
{if $aWorkflow}
{i18n}Existing workflows{/i18n}
-{i18n}Select a workflow to modify.{/i18n}
-
+{i18n}Select a workflow to modify. To enable a disabled workflow, edit it and set a proper starting state.{/i18n}
+
+
+
+
+
+ | Name |
+ Status |
+ Edit |
+   |
+
+
+
+
+
{foreach from=$aWorkflow item=oWorkflow}
- - {$oWorkflow->getName()}
+{assign var="startId" value=$oWorkflow->getStartStateId()}
+
+
+ | {$oWorkflow->getName()} |
+ {if $startId===NULL}Disabled{else}Enabled{/if} |
+ Edit |
+
+ {if $startId!==NULL}Disable
+ {else} {/if}
+ |
+
{/foreach}
-
+
+
+
{/if}
--
libgit2 0.21.4