Class: WorkflowService

Source Location: /CORE/system/classes/workflow/WorkflowService.php

Class WorkflowService

Class Overview

The WorkflowService provides methods to receive Future versions within a Workflow.

Located in /CORE/system/classes/workflow/WorkflowService.php [line 45]

MasterItemType
   |
   --Itemtype
      |
      --WorkflowService
Author(s):
  • Kevin Papst
Information Tags:
Version:  $Id: WorkflowService.php,v 1.8 2008/08/14 22:15:16 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Itemtype

Itemtype::Itemtype()
Itemtype::getClass()
Itemtype::getClassName()
Itemtype::getCommand()
Itemtype::getDirectory()
Itemtype::getItemtypeID()
Itemtype::initItemtype()

Inherited From MasterItemType

MasterItemType::MasterItemType()
Empty Constructor.
MasterItemType::countItemtypes()
Returns how many Itemtypes are known by the System.
MasterItemType::getClassForItemType()
Returns a new instance of the Class for the given Itentype ID.
MasterItemType::getClassNameForItemType()
Returns the Classname for the given Itentype ID.
MasterItemType::getCommandForItemType()
Return the Command for the given Itemtype ID.
MasterItemType::getDirectoryForItemType()
Return the Directory for the given Itemtype ID.
MasterItemType::getItemTypeForCommand()
Get the Itemtype ID for the given Command (or null).
MasterItemType::getSelectColumns()
Returns the Select Columns to be used for Item- and Treeselects.

[ Top ]
Method Summary
static void   getAllWorkflowTypes()   Returns all available Workflow types for the Itemtype.
WorkflowService   WorkflowService()  
void   addPermittedUserGroup()   Adds User access rights for all User that are Members of the given User Group.
void   addPermittedUsers()   Adds a bunch of User access rights to the already existing ones.
boolean   assignWorkflow()   Assign a Workflow to a single Person.
array   getAssignedWorkflows()   Get all assigned Jobs for the given User.
void   getPendingWorkflows()   Return all pending Workflow the given User has access rights on.
Workflow   getWorkflowForItem()   Returns a Workflow Instance for the given Item.
boolean   hasRunningWorkflow()   Returns if there is a running Workflow for the given Item.
boolean   isPermittedToEdit()   Returns whether the given User is allowed to edit the given Item Language Version.
void   performActivity()   Performs the given Activity on the Items Workflow, if one is started and within the next Activites List.
void   publishWorkflowContent()   This publishes the Workflow Version.
boolean   setActivity()   Sets the Activity ID for the given Workflow.
void   setPendingWorkflow()   Removes an assigment from the given Future Language Version.
void   setPermittedUsers()   Sets a bunch of User access rights.
void   startWorkflow()   This starts a Workflow by creating a Future Version and calling
  1. assignWorkflow
with the current global User ID.
void   startWorkflowForUser()   This starts a Workflow by creating a Future Version and calling
  1. assignWorkflow
with the given User ID.
boolean   updateItemContent()   Updates the Items Content within the running Workflow.

[ Top ]
Methods
static method getAllWorkflowTypes  [line 89]

  static void getAllWorkflowTypes( )

Returns all available Workflow types for the Itemtype.



[ Top ]
Constructor WorkflowService  [line 56]

  WorkflowService WorkflowService( $itemtype  )

Parameters:
   $itemtype: 


[ Top ]
addPermittedUserGroup  [line 312]

  void addPermittedUserGroup( $itemid, $groupid, $value  )

Adds User access rights for all User that are Members of the given User Group.

Already existing rights will be kept.

Parameters:
   $itemid: 
   $groupid: 
   $value: 


[ Top ]
addPermittedUsers  [line 300]

  void addPermittedUsers( $itemid, $userids, $value  )

Adds a bunch of User access rights to the already existing ones.

Parameters:
   $itemid: 
   $userids: 
   $value: 


[ Top ]
assignWorkflow  [line 252]

  boolean assignWorkflow( $itemid, $languageid, $userid  )

Assign a Workflow to a single Person.

If there is nor Workflow running this returns FALSE. If a Workflow is running, all access rights will be removed and ONLY the assigned User will have the rights to access the Workflow.

Parameters:
   $itemid: 
   $languageid: 
   $userid: 

API Tags:
Return:  whether the assign could be performed or not


[ Top ]
getAssignedWorkflows  [line 378]

  array getAssignedWorkflows( $userid  )

Get all assigned Jobs for the given User.

Parameters:
   $userid: 

API Tags:
Return:  an array with FutureItem instances


[ Top ]
getPendingWorkflows  [line 355]

  void getPendingWorkflows( int $userid  )

Return all pending Workflow the given User has access rights on.

Pending Workflows are all Workflows that are currently not assigned to anyone. Any permitted User may take this Job by calling

  1. assignWorkflow($itemid$languageid$userid)
.

Parameters:
int   $userid:  the UserID to get all Pending Workflows for


[ Top ]
getWorkflowForItem  [line 162]

  Workflow getWorkflowForItem( $itemid, $languageid  )

Returns a Workflow Instance for the given Item.

If this Item exists in a Future Version, it returns the Workflow Name from this Future Version, otherwise it returns the current Workflow Name. If none could be found, it returns NULL.

Parameters:
   $itemid: 
   $languageid: 

API Tags:
Return:  a Workflow instance or NULL


[ Top ]
hasRunningWorkflow  [line 238]

  boolean hasRunningWorkflow( $itemid, $languageid  )

Returns if there is a running Workflow for the given Item.

Parameters:
   $itemid: 
   $languageid: 

API Tags:
Return:  if there is a Workflow started already


[ Top ]
isPermittedToEdit  [line 326]

  boolean isPermittedToEdit( $userid, $itemid, $languageid  )

Returns whether the given User is allowed to edit the given Item Language Version.

This ONLY returns proper values for Workflow Items. If the given Item is NOT in a Workflow, we always return false.

Parameters:
   $userid: 
   $itemid: 
   $languageid: 

API Tags:
Return:  true if Item is in a Workflow and User is allowed to edit


[ Top ]
performActivity  [line 191]

  void performActivity( $itemid, $languageid, $activityID  )

Performs the given Activity on the Items Workflow, if one is started and within the next Activites List.

Parameters:
   $itemid: 
   $languageid: 
   $activityID: 


[ Top ]
publishWorkflowContent  [line 139]

  void publishWorkflowContent( $itemid, $languageid  )

This publishes the Workflow Version.

updates the Future Content, switching assigned User.

Parameters:
   $itemid: 
   $languageid: 


[ Top ]
setActivity  [line 216]

  boolean setActivity( $itemid, $languageid, $activityID  )

Sets the Activity ID for the given Workflow.

Parameters:
   $itemid: 
   $languageid: 
   $activityID: 

API Tags:
Return:  whether the Activity could be set or not


[ Top ]
setPendingWorkflow  [line 275]

  void setPendingWorkflow( int $itemid, int $languageid, array $userids  )

Removes an assigment from the given Future Language Version.

Removing the Assigment brings a Workflow from the "AssignedWorkflow" to the "PendingWorkflow" Status. You have to pass an array with UserIDs that are allowed to assign the Job afterwards.

Parameters:
int   $itemid:  itemid the ItemID
int   $languageid:  languageid the LanguageID
array   $userids:  userids an Array with all UserIDs that might be permitted to assign the job


[ Top ]
setPermittedUsers  [line 290]

  void setPermittedUsers( $itemid, $userids, $value  )

Sets a bunch of User access rights.

All existing right Entrys will be deleted and the new ones created.

Parameters:
   $itemid: 
   $userids: 
   $value: 


[ Top ]
startWorkflow  [line 118]

  void startWorkflow( $itemid, $languageid  )

This starts a Workflow by creating a Future Version and calling

  1. assignWorkflow
with the current global User ID.

Parameters:
   $itemid: 
   $languageid: 


[ Top ]
startWorkflowForUser  [line 127]

  void startWorkflowForUser( $itemid, $languageid, $userid  )

This starts a Workflow by creating a Future Version and calling

  1. assignWorkflow
with the given User ID.

Parameters:
   $itemid: 
   $languageid: 
   $userid: 


[ Top ]
updateItemContent  [line 104]

  boolean updateItemContent( $itemid, $languageid, $content  )

Updates the Items Content within the running Workflow.

If there is no running Workflow for the Item Language Version, a Workflow will be started before.

Parameters:
   $itemid: 
   $languageid: 
   $content: 

API Tags:
Return:  if the update could be performed


[ Top ]