本文整理汇总了PHP中eZWorkflowType::statusName方法的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowType::statusName方法的具体用法?PHP eZWorkflowType::statusName怎么用?PHP eZWorkflowType::statusName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZWorkflowType
的用法示例。
在下文中一共展示了eZWorkflowType::statusName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
$lastEventStatus = $process->attribute("last_event_status");
if ($http->hasPostVariable("RunProcess")) {
// $Module->redirectTo( $Module->functionURI( "process" ) . "/" . $WorkflowProcessID );
// return;
if ($workflowEvent instanceof eZWorkflowEvent) {
$eventType = $workflowEvent->eventType();
$lastEventStatus = $eventType->execute($process, $workflowEvent);
}
$event_pos = $process->attribute("event_position");
$next_event_pos = $event_pos + 1;
$next_event_id = $workflow->fetchEventIndexed($next_event_pos);
if ($next_event_id !== null) {
$process->advance($next_event_id, $next_event_pos, $lastEventStatus);
$workflowEvent = eZWorkflowEvent::fetch($next_event_id);
} else {
unset($workflowEvent);
$workflowEvent = false;
$process->advance();
}
$process->setAttribute("modified", time());
$process->store();
}
$tpl->setVariable("event_status", eZWorkflowType::statusName($lastEventStatus));
$tpl->setVariable("current_workflow", $workflow);
$tpl->setVariable("current_event", $workflowEvent);
$Module->setTitle("Workflow process");
$tpl->setVariable("process", $process);
$tpl->setVariable("module", $Module);
$tpl->setVariable("http", $http);
$Result = array();
$Result['content'] = $tpl->fetch("design:workflow/process.tpl");
示例2: run
function run(&$workflow, &$workflowEvent, &$eventLog)
{
$eventLog = array();
eZDebugSetting::writeDebug('workflow-process', $workflowEvent, "workflowEvent in process->run beginning");
$runCurrentEvent = true;
$done = false;
$workflowStatus = $this->attribute('status');
eZDebugSetting::writeDebug('workflow-process', $workflowStatus, 'workflowStatus');
$currentEventStatus = $this->attribute('event_status');
// just temporary. needs to be removed from parameters
if ($workflowEvent == null) {
$workflowEvent = eZWorkflowEvent::fetch($this->attribute('event_id'));
}
switch ($currentEventStatus) {
case eZWorkflowType::STATUS_DEFERRED_TO_CRON:
case eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT:
case eZWorkflowType::STATUS_FETCH_TEMPLATE:
case eZWorkflowType::STATUS_FETCH_TEMPLATE_REPEAT:
case eZWorkflowType::STATUS_REDIRECT:
case eZWorkflowType::STATUS_REDIRECT_REPEAT:
case eZWorkflowType::STATUS_WORKFLOW_RESET:
if ($workflowEvent !== null) {
$activationDate = 0;
if ($this->hasAttribute('activation_date')) {
$activationDate = $this->attribute("activation_date");
}
eZDebugSetting::writeDebug('workflow-process', "Checking activation date");
if ($activationDate == 0) {
$eventType = $workflowEvent->eventType();
$eventLog[] = array("status" => $currentEventStatus, "status_text" => eZWorkflowType::statusName($currentEventStatus), "information" => $eventType->attribute("information"), "description" => $workflowEvent->attribute("description"), "type_name" => $eventType->attribute("name"), "type_group" => $eventType->attribute("group_name"));
if ($currentEventStatus == eZWorkflowType::STATUS_DEFERRED_TO_CRON || $currentEventStatus == eZWorkflowType::STATUS_FETCH_TEMPLATE || $currentEventStatus == eZWorkflowType::STATUS_REDIRECT) {
$runCurrentEvent = false;
}
} else {
if (time() < $activationDate) {
eZDebugSetting::writeDebug('workflow-process', "Date failed, not running events");
$eventType = $workflowEvent->eventType();
$eventLog[] = array("status" => $currentEventStatus, "status_text" => eZWorkflowType::statusName($currentEventStatus), "information" => $eventType->attribute("information"), "description" => $workflowEvent->attribute("description"), "type_name" => $eventType->attribute("name"), "type_group" => $eventType->attribute("group_name"));
$done = true;
} else {
eZDebugSetting::writeDebug('workflow-process', "Date ok, running events");
eZDebugSetting::writeDebug('workflow-process', $currentEventStatus, 'WORKFLOW_TYPE_STATUS');
if ($currentEventStatus == eZWorkflowType::STATUS_DEFERRED_TO_CRON || $currentEventStatus == eZWorkflowType::STATUS_FETCH_TEMPLATE || $currentEventStatus == eZWorkflowType::STATUS_REDIRECT) {
$runCurrentEvent = false;
}
}
}
}
break;
default:
break;
}
while (!$done) {
if ($runCurrentEvent) {
eZDebugSetting::writeDebug('workflow-process', "runCurrentEvent is true");
} else {
eZDebugSetting::writeDebug('workflow-process', "runCurrentEvent is false");
}
if ($workflowEvent != null) {
//eZDebugSetting::writeDebug( 'workflow-process', $workflowEvent ,"workflowEvent is not null" );
} else {
//eZDebugSetting::writeDebug( 'workflow-process', $workflowEvent ,"workflowEvent is null" );
}
if ($workflowEvent instanceof eZWorkflowEvent) {
eZDebugSetting::writeDebug('workflow-process', get_class($workflowEvent), "workflowEvent class is ezworkflowevent");
} else {
if ($workflowEvent !== null) {
eZDebugSetting::writeDebug('workflow-process', get_class($workflowEvent), "workflowEvent class is not ezworkflowevent");
}
}
eZDebugSetting::writeDebug('workflow-process', $done, "in while");
if ($runCurrentEvent and $workflowEvent !== null and $workflowEvent instanceof eZWorkflowEvent) {
$eventType = $workflowEvent->eventType();
if ($eventType instanceof eZWorkflowType) {
$currentEventStatus = $eventType->execute($this, $workflowEvent);
$this->setAttribute("event_status", $currentEventStatus);
$workflowParameters = $this->attribute('parameter_list');
if (isset($workflowParameters['cleanup_list'])) {
$cleanupList = $workflowParameters['cleanup_list'];
} else {
unset($cleanupList);
$cleanupList = array();
}
if ($eventType->needCleanup()) {
$cleanupList[] = $workflowEvent->attribute('id');
$workflowParameters['cleanup_list'] = $cleanupList;
$this->setAttribute('parameters', serialize($workflowParameters));
}
eZDebugSetting::writeDebug('workflow-process', $currentEventStatus, "currentEventStatus");
switch ($currentEventStatus) {
case eZWorkflowType::STATUS_ACCEPTED:
$done = false;
$workflowStatus = eZWorkflow::STATUS_DONE;
break;
case eZWorkflowType::STATUS_WORKFLOW_DONE:
$done = true;
$workflowStatus = eZWorkflow::STATUS_DONE;
break;
case eZWorkflowType::STATUS_REJECTED:
$done = true;
//.........这里部分代码省略.........