Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SIWECOS
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • Workflow
  • WorkflowAction
  • WorkflowActions
  • WorkflowAllocation
  • WorkflowAllocations
  • WorkflowArtAllocation
  • WorkflowArtAllocations
  • WorkflowItem
  • WorkflowItems
  • Workflows
  • WorkflowTask
  • WorkflowTasks
  • WorkflowUserSequence
  • WorkflowUserSequences

Functions

  • createNewWorkflow
  • doWorkflowAction
  • editWorkflowStep
  • getActionSelect
  • getCatLang
  • getCurrentUserSequence
  • getLastWorkflowStatus
  • getTimeUnitSelector
  • getUsers
  • getWorkflowForCat
  • getWorkflowForUserSequence
  • getWorkflowList
  • getWorkflowUsers
  • isCurrentEditor
  • piworkflowAllowArticleEdit
  • piworkflowCategoryColumns
  • piworkflowCategoryRenderColumn
  • piworkflowCreateTasksFolder
  • piworkflowProcessActions
  • piworkflowProcessArticleColumns
  • piworkflowRenderAction
  • piworkflowRenderColumn
  • prepareWorkflowItems
  • setUserSequence
  • workflowInherit
  • workflowSelect
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains the management of per-workflowitem actions.
  4:  *
  5:  * @package Plugin
  6:  * @subpackage Workflow
  7:  * @author Timo Hummel
  8:  * @copyright four for business AG <www.4fb.de>
  9:  * @license http://www.contenido.org/license/LIZENZ.txt
 10:  * @link http://www.4fb.de
 11:  * @link http://www.contenido.org
 12:  */
 13: 
 14: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 15: 
 16: /**
 17:  * Management of per-workflowitem actions.
 18:  *
 19:  * @package Plugin
 20:  * @subpackage Workflow
 21:  * @method WorkflowAction createNewItem
 22:  * @method WorkflowAction next
 23:  */
 24: class WorkflowActions extends ItemCollection {
 25:     /**
 26:      * Constructor Function
 27:      *
 28:      * @throws cInvalidArgumentException
 29:      */
 30:     public function __construct() {
 31:         global $cfg;
 32:         parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
 33:         $this->_setItemClass("WorkflowAction");
 34:     }
 35: 
 36:     /**
 37:      * @param $idworkflowitem
 38:      * @param $action
 39:      *
 40:      * @return bool
 41:      */
 42:     public function get($idworkflowitem, $action) {
 43:         $this->select("idworkflowitem = " . (int) $idworkflowitem . " AND action = '" . $this->escape($action) . "'");
 44:         if ($this->next()) {
 45:             return true;
 46:         } else {
 47:             return false;
 48:         }
 49:     }
 50: 
 51:     /**
 52:      * @return array
 53:      */
 54:     public function getAvailableWorkflowActions() {
 55:         $availableWorkflowActions = array(
 56:             "publish" => i18n("Publish article", "workflow"),
 57:             "lock" => i18n("Lock article", "workflow"),
 58:             "last" => i18n("Move back to last editor", "workflow"),
 59:             "reject" => i18n("Reject article", "workflow"),
 60:             "articleedit" => i18n("Edit article content", "workflow"),
 61:             "propertyedit" => i18n("Edit article properties", "workflow"),
 62:             "templateedit" => i18n("Edit template", "workflow"),
 63:             "revise" => i18n("Revise article", "workflow")
 64:         );
 65: 
 66:         return ($availableWorkflowActions);
 67:     }
 68: 
 69:     /**
 70:      * @param $idworkflowitem
 71:      * @param $action
 72:      *
 73:      * @throws cDbException
 74:      * @throws cException
 75:      * @throws cInvalidArgumentException
 76:      */
 77:     public function set($idworkflowitem, $action) {
 78:         $this->select("idworkflowitem = " . (int) $idworkflowitem . " AND action = '" . $this->escape($action) . "'");
 79:         if (!$this->next()) {
 80:             $newitem = $this->createNewItem();
 81:             $newitem->setField("idworkflowitem", $idworkflowitem);
 82:             $newitem->setField("action", $action);
 83:             $newitem->store();
 84:         }
 85:     }
 86: 
 87:     /**
 88:      * @param $idworkflowitem
 89:      * @param $action
 90:      *
 91:      * @throws cDbException
 92:      * @throws cException
 93:      * @throws cInvalidArgumentException
 94:      */
 95:     public function remove($idworkflowitem, $action) {
 96:         $this->select("idworkflowitem = " . (int) $idworkflowitem . " AND action = '" . $this->escape($action) . "'");
 97:         if (($item = $this->next()) !== false) {
 98:             $this->delete($item->getField("idworkflowaction"));
 99:         }
100:     }
101: 
102:     /**
103:      * @param string $where
104:      * @param string $group_by
105:      * @param string $order_by
106:      * @param string $limit
107:      *
108:      * @return bool
109:      */
110:     public function select($where = "", $group_by = "", $order_by = "", $limit = "") {
111:         global $client;
112: 
113:         return parent::select($where, $group_by, $order_by, $limit);
114:     }
115: 
116: }
117: 
118: /**
119:  * Class WorkflowAction
120:  * Class for a single workflow action
121:  *
122:  * @package Plugin
123:  * @subpackage Workflow
124:  * @author Timo A. Hummel <Timo.Hummel@4fb.de>
125:  * @version 0.1
126:  * @copyright four for business 2003
127:  */
128: class WorkflowAction extends Item {
129: 
130:     /**
131:      * Constructor Function
132:      */
133:     public function __construct() {
134:         global $cfg;
135: 
136:         parent::__construct($cfg["tab"]["workflow_actions"], "idworkflowaction");
137:     }
138: 
139: }
140: 
CMS CONTENIDO 4.10.1 API documentation generated by ApiGen 2.8.0