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}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 | +  | +
|---|---|---|---|
| {$oWorkflow->getName()} | +{if $startId===NULL}Disabled{else}Enabled{/if} | +Edit | ++ {if $startId!==NULL}Disable + {else} {/if} + | +