Ejemplo n.º 1
0
                    eZWorkflowFunctions::removeGroup($workflowID, 0, array($groupID));
                }
            } else {
                // just for sure :-)
                eZWorkflow::setIsEnabled(false, $workflowID);
            }
        }
    } else {
        // if there is no CurrentGroupID variable, disable every group in variable Workflow_id_checked:
        eZWorkflow::setIsEnabled(false, $http->postVariable('Workflow_id_checked'));
    }
}
if ($http->hasPostVariable('DeleteButton') and $http->hasPostVariable('Temp_Workflow_id_checked')) {
    $checkedIDs = $http->postVariable('Temp_Workflow_id_checked');
    foreach ($checkedIDs as $checkedID) {
        eZWorkflow::removeWorkflow($checkedID, 1);
        eZWorkflowGroupLink::removeWorkflowMembers($checkedID, 1);
    }
}
/*$workflows = eZWorkflow::fetchList();
$workflowList = array();
foreach( array_keys( $workflows ) as $workflowID )
{
    $workflow = $workflows[$workflowID];
    $workflowList[$workflow->attribute( 'id' )] = $workflow;
}
*/
$user = eZUser::currentUser();
$list_in_group = eZWorkflowGroupLink::fetchWorkflowList(0, $WorkflowGroupID, $asObject = true);
$workflow_list = eZWorkflow::fetchList();
$list = array();
Ejemplo n.º 2
0
 /**
  * Helper function used to remove a workflow.
  * Will remove the workflow, its events, its triggers and its group link.
  *
  * @param eZWorkflow $workflow
  * @return void
  */
 protected function removeWorkflow(eZWorkflow $workflow)
 {
     // Remove trigger
     eZTrigger::removeTriggerForWorkflow($workflow->attribute('id'));
     // remove the workflow, its events and the group link
     eZWorkflow::removeEvents(false, $workflow->attribute('id'), $workflow->attribute('version'));
     eZWorkflow::removeWorkflow($this->workflow->attribute('id'), $workflow->attribute('version'));
     eZWorkflowGroupLink::removeWorkflowMembers($workflow->attribute('id'), $workflow->attribute('version'));
 }