Class WorkflowService

Description

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

  • version: $Id: WorkflowService.php,v 1.6 2006/11/26 22:04:00 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • author: Kevin Papst
  • license: GNU Public License
MasterItemType
   |
   --Itemtype
      |
      --WorkflowService
Method Summary
WorkflowService WorkflowService ( $itemtype)
void addPermittedUserGroup ( $itemid,  $groupid,  $value)
void addPermittedUsers ( $itemid,  $userids,  $value)
boolean assignWorkflow ( $itemid,  $languageid,  $userid)
array getAssignedWorkflows ( $userid)
void getPendingWorkflows (int $userid)
Workflow getWorkflowForItem ( $itemid,  $languageid)
boolean hasRunningWorkflow ( $itemid,  $languageid)
boolean isPermittedToEdit ( $userid,  $itemid,  $languageid)
void performActivity ( $itemid,  $languageid,  $activityID)
void publishWorkflowContent ( $itemid,  $languageid)
boolean setActivity ( $itemid,  $languageid,  $activityID)
void setPendingWorkflow (int $itemid, int $languageid, array $userids)
void setPermittedUsers ( $itemid,  $userids,  $value)
void startWorkflow ( $itemid,  $languageid)
void startWorkflowForUser ( $itemid,  $languageid,  $userid)
boolean updateItemContent ( $itemid,  $languageid,  $content)
Methods
Constructor WorkflowService (line 55)
WorkflowService WorkflowService ( $itemtype)
  • $itemtype
addPermittedUserGroup (line 310)

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

Already existing rights will be kept.

void addPermittedUserGroup ( $itemid,  $groupid,  $value)
  • $itemid
  • $groupid
  • $value
addPermittedUsers (line 298)

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

void addPermittedUsers ( $itemid,  $userids,  $value)
  • $itemid
  • $userids
  • $value
assignWorkflow (line 250)

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.

  • return: whether the assign could be performed or not
boolean assignWorkflow ( $itemid,  $languageid,  $userid)
  • $itemid
  • $languageid
  • $userid
getAllWorkflowTypes (line 87)

Returns all available Workflow types for the Itemtype.

void getAllWorkflowTypes ()
getAssignedWorkflows (line 376)

Get all assigned Jobs for the given User.

  • return: an array with FutureItem instances
array getAssignedWorkflows ( $userid)
  • $userid
getPendingWorkflows (line 353)

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)
.

void getPendingWorkflows (int $userid)
  • int $userid: the UserID to get all Pending Workflows for
getWorkflowForItem (line 160)

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.

  • return: a Workflow instance or NULL
Workflow getWorkflowForItem ( $itemid,  $languageid)
  • $itemid
  • $languageid
hasRunningWorkflow (line 236)

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

  • return: if there is a Workflow started already
boolean hasRunningWorkflow ( $itemid,  $languageid)
  • $itemid
  • $languageid
isPermittedToEdit (line 324)

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.

  • return: true if Item is in a Workflow and User is allowed to edit
boolean isPermittedToEdit ( $userid,  $itemid,  $languageid)
  • $userid
  • $itemid
  • $languageid
performActivity (line 189)

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

void performActivity ( $itemid,  $languageid,  $activityID)
  • $itemid
  • $languageid
  • $activityID
publishWorkflowContent (line 137)

This publishes the Workflow Version.

updates the Future Content, switching assigned User.

void publishWorkflowContent ( $itemid,  $languageid)
  • $itemid
  • $languageid
setActivity (line 214)

Sets the Activity ID for the given Workflow.

  • return: whether the Activity could be set or not
boolean setActivity ( $itemid,  $languageid,  $activityID)
  • $itemid
  • $languageid
  • $activityID
setPendingWorkflow (line 273)

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.

void setPendingWorkflow (int $itemid, int $languageid, array $userids)
  • 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
setPermittedUsers (line 288)

Sets a bunch of User access rights.

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

void setPermittedUsers ( $itemid,  $userids,  $value)
  • $itemid
  • $userids
  • $value
startWorkflow (line 116)

This starts a Workflow by creating a Future Version and calling

with the current global User ID.

void startWorkflow ( $itemid,  $languageid)
  • $itemid
  • $languageid
startWorkflowForUser (line 125)

This starts a Workflow by creating a Future Version and calling

with the given User ID.

void startWorkflowForUser ( $itemid,  $languageid,  $userid)
  • $itemid
  • $languageid
  • $userid
updateItemContent (line 102)

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.

  • return: if the update could be performed
boolean updateItemContent ( $itemid,  $languageid,  $content)
  • $itemid
  • $languageid
  • $content

Inherited Methods

Inherited From Itemtype

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

Inherited From MasterItemType

MasterItemType::MasterItemType()
MasterItemType::countItemtypes()
MasterItemType::getClassForItemType()
MasterItemType::getClassNameForItemType()
MasterItemType::getCommandForItemType()
MasterItemType::getDirectoryForItemType()
MasterItemType::getItemTypeForCommand()
MasterItemType::getSelectColumns()

Documentation generated by phpDocumentor 1.3.1