本文整理汇总了PHP中eZWorkflowEvent::create方法的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowEvent::create方法的具体用法?PHP eZWorkflowEvent::create怎么用?PHP eZWorkflowEvent::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZWorkflowEvent
的用法示例。
在下文中一共展示了eZWorkflowEvent::create方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$groupID = $workflowGroups[0]->attribute( 'group_id' );
if ( $groupID )
return $Module->redirectToView( 'workflowlist', array( $groupID ) );
else
return $Module->redirectToView( 'grouplist' );
}
// Remove events which are to be deleted
else if ( $http->hasPostVariable( "DeleteButton" ) )
{
if ( $canStore )
$workflow->store( $event_list );
}
// Add new workflow event
else if ( $http->hasPostVariable( "NewButton" ) )
{
$new_event = eZWorkflowEvent::create( $WorkflowID, $cur_type );
$new_event_type = $new_event->eventType();
$db = eZDB::instance();
$db->begin();
if ($canStore)
$workflow->store( $event_list );
$new_event_type->initializeEvent( $new_event );
$new_event->store();
$db->commit();
$event_list[] = $new_event;
}
else if ( $canStore )
{
示例2: createWorkFlow
/**
* Creates the test workflow.
* @todo Currently only handles the fetchtemplaterepeat event. Will have to be
* refactored to handle more events when necessary
*
* @return eZWorkflow
*/
function createWorkFlow($adminUserID)
{
$registerResult = $this->registerCustomWorkflowEvent('fetchtemplaterepeat', 'tests/toolkit/extras/tests-files/workflowevent_regression_fetchtemplaterepeat.php');
if ($registerResult == false) {
$this->markTestSkipped("Unable to register the workflow event");
}
$workflow = eZWorkflow::create($adminUserID);
$workflow->setAttribute("name", "eZWorkflowEventRegression Workflow");
$workflow->store();
$workflowID = $workflow->attribute("id");
$workflowVersion = $workflow->attribute("version");
$groupID = 1;
$groupName = "Standard";
$ingroup = eZWorkflowGroupLink::create($workflowID, $workflowVersion, $groupID, $groupName);
$ingroup->store();
$regressionEvent = eZWorkflowEvent::create($workflowID, "event_fetchtemplaterepeat");
$regressionEventType = $regressionEvent->eventType();
$regressionEventType->initializeEvent($regressionEvent);
$regressionEvent->store();
$eventList = array($regressionEvent);
$workflow->store($eventList);
eZWorkflowGroupLink::removeWorkflowMembers($workflowID, 0);
$workflowgroups = eZWorkflowGroupLink::fetchGroupList($workflowID, 1);
foreach ($workflowgroups as $workflowgroup) {
$workflowgroup->setAttribute("workflow_version", 0);
$workflowgroup->store();
}
// Remove version 1
eZWorkflowGroupLink::removeWorkflowMembers($workflowID, 1);
// eZWorkflow::removeEvents( false, $workflowID, 0 );
eZWorkflow::removeEvents(false, $workflowID, 1);
eZWorkflow::removeWorkflow($workflowID, 1);
$workflow->setVersion(0, $eventList);
$workflow->adjustEventPlacements($eventList);
$workflow->storeDefined($eventList);
$workflow->cleanupWorkFlowProcess();
$workflow->store($eventList);
return $workflow;
}
示例3: createApprovalWorkFlow
function createApprovalWorkFlow($approvalUserID)
{
$workflow = eZWorkflow::create($approvalUserID);
$workflow->setAttribute("name", "eZApproveTypeRegression Workflow");
$workflow->store();
$workflowID = $workflow->attribute("id");
$workflowVersion = $workflow->attribute("version");
$groupID = 1;
$groupName = "Standard";
$ingroup = eZWorkflowGroupLink::create($workflowID, $workflowVersion, $groupID, $groupName);
$ingroup->store();
$approveEvent = eZWorkflowEvent::create($workflowID, "event_ezapprove");
$approveEventType = $approveEvent->eventType();
$approveEventType->initializeEvent($approveEvent);
// Affected sections, -1 == All sections
$approveEvent->setAttribute("data_text1", "-1");
// Affected languages, 0 == All languages
$approveEvent->setAttribute("data_int2", 0);
// Affected versions
$approveEvent->setAttribute("data_int3", eZApproveType::VERSION_OPTION_ALL);
// Editors
$approveEvent->setAttribute("data_text3", $approvalUserID);
$approveEvent->store();
$eventList = array($approveEvent);
$workflow->store($eventList);
eZWorkflowGroupLink::removeWorkflowMembers($workflowID, 0);
$workflowgroups = eZWorkflowGroupLink::fetchGroupList($workflowID, 1);
foreach ($workflowgroups as $workflowgroup) {
$workflowgroup->setAttribute("workflow_version", 0);
$workflowgroup->store();
}
// Remove version 1
eZWorkflowGroupLink::removeWorkflowMembers($workflowID, 1);
eZWorkflow::removeEvents(false, $workflowID, 0);
$workflow->setVersion(0, $eventList);
$workflow->adjustEventPlacements($eventList);
$workflow->storeDefined($eventList);
$workflow->cleanupWorkFlowProcess();
$workflow->store($eventList);
return $workflow;
}
示例4: execute
function execute( $xml )
{
$workflowGroupList = $xml->getElementsByTagName( 'WorkflowGroup' );
$user = eZUser::currentUser();
$userID = $user->attribute( "contentobject_id" );
foreach ( $workflowGroupList as $workflowGroupNode )
{
$groupName = $workflowGroupNode->getAttribute( 'name' );
$referenceID = $workflowGroupNode->getAttribute( 'referenceID' );
$groupExistAction = $workflowGroupNode->getAttribute( 'groupExistAction' );
$workflowGroup = null;
if ( $groupExistAction == 'keep' )
{
$workflowGroupList = eZWorkflowGroup::fetchList();
foreach ( $workflowGroupList as $workflowGroupItem )
{
if ( $workflowGroupItem->attribute( 'name' ) == $groupName )
{
$workflowGroup = $workflowGroupItem;
break;
}
}
}
if ( $workflowGroup !== null )
{
$this->writeMessage( "\tWorkflow Group '$groupName' already exists." , 'notice' );
}
else
{
$this->writeMessage( "\tWorkflow Group '$groupName' will be created." , 'notice' );
$workflowGroup = eZWorkflowGroup::create( $userID );
$workflowGroup->setAttribute( "name", $groupName );
$workflowGroup->store();
}
$WorkflowGroupID = $workflowGroup->attribute( "id" );
$refArray = array();
if ( $referenceID )
{
$refArray[$referenceID] = $WorkflowGroupID;
}
$this->addReference( $refArray );
$workflowList = $workflowGroupNode->getElementsByTagName( 'Workflow' );
foreach ( $workflowList as $workflowNode )
{
$refArray = array();
$workflowName = $workflowNode->getAttribute( 'name' );
$workflowTypeString = $workflowNode->getAttribute( 'workflowTypeString' );
$referenceID = $workflowNode->getAttribute( 'referenceID' );
$workflowExistAction = $workflowNode->getAttribute( 'workflowExistAction' );
$WorkflowID = $workflowNode->getAttribute( 'id' );
$workflow = null;
$hasWorkflowDraft = false;
$db = eZDB::instance();
if ( !$workflowExistAction )
{
$workflowExistAction = 'extend';
}
if ( $WorkflowID )
{
$workflow = eZWorkflow::fetch( $WorkflowID, true, 1 );
if ( !is_object( $workflow ) )
{
$workflow = eZWorkflow::fetch( $WorkflowID, true, 0 );
if ( is_object( $workflow ) )
{
$workflowGroups = eZWorkflowGroupLink::fetchGroupList( $WorkflowID, 0, true );
$db->begin();
foreach ( $workflowGroups as $workflowGroup )
{
$groupID = $workflowGroup->attribute( "group_id" );
$groupName = $workflowGroup->attribute( "group_name" );
$ingroup = eZWorkflowGroupLink::create( $WorkflowID, 1, $groupID, $groupName );
$ingroup->store();
}
$db->commit();
}
else
{
$this->writeMessage( "\tFailed to fetch workflow with ID '$WorkflowID'." , 'notice' );
$workflow = null;
}
}
}
$db->begin();
if ( $workflow === null )
{
$this->writeMessage( "\tWorkflow '$workflowName' will be created." , 'notice' );
//.........这里部分代码省略.........