本文整理汇总了PHP中eZWorkflowType类的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowType类的具体用法?PHP eZWorkflowType怎么用?PHP eZWorkflowType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了eZWorkflowType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: eventType
function eventType()
{
if (!isset($this->EventType)) {
$this->EventType = eZWorkflowType::createType($this->TypeString);
}
return $this->EventType;
}
开发者ID:netbliss,项目名称:ezpublish,代码行数:7,代码来源:ezworkflowevent.php
示例2: array
eZWorkflowFunctions::addGroup( $WorkflowID, $WorkflowVersion, $selectedGroup );
}
if ( $http->hasPostVariable( "DeleteGroupButton" ) && $http->hasPostVariable( "group_id_checked" ) )
{
$selectedGroup = $http->postVariable( "group_id_checked" );
if ( !eZWorkflowFunctions::removeGroup( $WorkflowID, $WorkflowVersion, $selectedGroup ) )
{
$validation['groups'][] = array( 'text' => ezpI18n::tr( 'kernel/workflow', 'You have to have at least one group that the workflow belongs to!' ) );
$validation['processed'] = true;
}
}
// Fetch events and types
$event_list = $workflow->fetchEvents();
$type_list = eZWorkflowType::fetchRegisteredTypes();
// Validate input
$canStore = true;
$requireFixup = false;
foreach( $event_list as $event )
{
$eventType = $event->eventType();
if ( !$eventType instanceof eZWorkflowEventType )
{
// Can't find eventype. Most likely deactivated while workflow has not been cleant up
eZDebug::writeError( "Couldn't load eventype '{$event->attribute( 'workflow_type_string' )}' for workflow. Is it activated ?", 'eZWorkflow edit' );
continue;
}
$status = $eventType->validateHTTPInput( $http, "WorkflowEvent", $event, $validation );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:edit.php
示例3: fetchWorkflowTypeStatuses
function fetchWorkflowTypeStatuses()
{
return array('result' => eZWorkflowType::statusNameMap());
}
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:4,代码来源:ezworkflowfunctioncollection.php
示例4: purge
//.........这里部分代码省略.........
eZInformationCollection::removeContentObject( $delID );
eZContentObjectTrashNode::purgeForObject( $delID );
$db->query( "DELETE FROM ezcontentobject_tree
WHERE contentobject_id='$delID'" );
$db->query( "DELETE FROM ezcontentobject_attribute
WHERE contentobject_id='$delID'" );
$db->query( "DELETE FROM ezcontentobject_version
WHERE contentobject_id='$delID'" );
$db->query( "DELETE FROM ezcontentobject_name
WHERE contentobject_id='$delID'" );
$db->query( "DELETE FROM ezcobj_state_link WHERE contentobject_id=$delID" );
$db->query( "DELETE FROM ezcontentobject
WHERE id='$delID'" );
$db->query( "DELETE FROM eznode_assignment
WHERE contentobject_id = '$delID'" );
$db->query( "DELETE FROM ezuser_role
WHERE contentobject_id = '$delID'" );
$db->query( "DELETE FROM ezuser_discountrule
WHERE contentobject_id = '$delID'" );
eZContentObject::fixReverseRelations( $delID, 'remove' );
eZSearch::removeObjectById( $delID );
// Check if deleted object is in basket/wishlist
$sql = 'SELECT DISTINCT ezproductcollection_item.productcollection_id
FROM ezbasket, ezwishlist, ezproductcollection_item
WHERE ( ezproductcollection_item.productcollection_id=ezbasket.productcollection_id OR
ezproductcollection_item.productcollection_id=ezwishlist.productcollection_id ) AND
ezproductcollection_item.contentobject_id=' . $delID;
$rows = $db->arrayQuery( $sql );
if ( count( $rows ) > 0 )
{
$countElements = 50;
$deletedArray = array();
// Create array of productCollectionID will be removed from ezwishlist and ezproductcollection_item
foreach ( $rows as $row )
{
$deletedArray[] = $row['productcollection_id'];
}
// Split $deletedArray into several arrays with $countElements values
$splitted = array_chunk( $deletedArray, $countElements );
// Remove eZProductCollectionItem and eZWishList
foreach ( $splitted as $value )
{
eZPersistentObject::removeObject( eZProductCollectionItem::definition(), array( 'productcollection_id' => array( $value, '' ) ) );
eZPersistentObject::removeObject( eZWishList::definition(), array( 'productcollection_id' => array( $value, '' ) ) );
}
}
$db->query( 'UPDATE ezproductcollection_item
SET contentobject_id = 0
WHERE contentobject_id = ' . $delID );
// Cleanup relations in two steps to avoid locking table for to long
$db->query( "DELETE FROM ezcontentobject_link
WHERE from_contentobject_id = '$delID'" );
$db->query( "DELETE FROM ezcontentobject_link
WHERE to_contentobject_id = '$delID'" );
// Cleanup properties: LastVisit, Creator, Owner
$db->query( "DELETE FROM ezuservisit
WHERE user_id = '$delID'" );
$db->query( "UPDATE ezcontentobject_version
SET creator_id = 0
WHERE creator_id = '$delID'" );
$db->query( "UPDATE ezcontentobject
SET owner_id = 0
WHERE owner_id = '$delID'" );
if ( isset( $GLOBALS["eZWorkflowTypeObjects"] ) and is_array( $GLOBALS["eZWorkflowTypeObjects"] ) )
{
$registeredTypes =& $GLOBALS["eZWorkflowTypeObjects"];
}
else
{
$registeredTypes = eZWorkflowType::fetchRegisteredTypes();
}
// Cleanup ezworkflow_event etc...
foreach ( array_keys( $registeredTypes ) as $registeredTypeKey )
{
$registeredType = $registeredTypes[$registeredTypeKey];
$registeredType->cleanupAfterRemoving( array( 'DeleteContentObject' => $delID ) );
}
$db->commit();
}
开发者ID:ezsystemstraining,项目名称:ez54training,代码行数:101,代码来源:ezcontentobject.php
示例5: 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");
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:process.php
示例6: registerEventType
static function registerEventType($typeString, $class_name)
{
eZWorkflowType::registerType("event", $typeString, $class_name);
}
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:4,代码来源:ezworkfloweventtype.php
示例7: registerGroupType
static function registerGroupType($typeString, $class_name)
{
eZWorkflowType::registerType("group", $typeString, $class_name);
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:4,代码来源:ezworkflowgrouptype.php
示例8: loadAndRegisterAllTypes
static function loadAndRegisterAllTypes()
{
$allowedTypes = eZWorkflowType::allowedTypes();
foreach ($allowedTypes as $type) {
eZWorkflowType::loadAndRegisterType($type);
}
}
开发者ID:runelangseid,项目名称:ezpublish,代码行数:7,代码来源:ezworkflowtype.php
示例9: 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;
//.........这里部分代码省略.........
开发者ID:runelangseid,项目名称:ezpublish,代码行数:101,代码来源:ezworkflowprocess.php
示例10: array
<?php
/**
* List all existing workflow event types
*
* @author G. Giunta
* @copyright (C) G. Giunta 2014-2016
* @license Licensed under GNU General Public License v2.0. See file license.txt
*
* @todo allow filtering by extension
* @todo add information: originating extension for each type
*/
$eventTypeList = eZWorkflowType::fetchRegisteredTypes();
ksort($eventTypeList);
$workflows = array();
$extensions = eZModuleLister::getModuleList();
// ...
if ($Params['extensionname'] != '' && !array_key_exists($Params['extensionname'], $extensions)) {
/// @todo
} else {
foreach ($eventTypeList as $typeString => $type) {
$workflows[$typeString] = array();
$filter = array('workflow_type_string' => $typeString);
$events = eZWorkflowEvent::fetchFilteredList($filter);
foreach ($events as $event) {
$workflowId = $event->attribute('workflow_id');
if (isset($workflows[$typeString][$workflowId])) {
$workflows[$typeString][$workflowId]['events'][] = $event;
} else {
$workflow = eZWorkflow::fetch($workflowId);
$workflows[$typeString][$workflowId] = array('workflow' => $workflow, 'events' => array($event));
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:eventtypelist.php
注:本文中的eZWorkflowType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论