• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP eZWorkflowEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中eZWorkflowEvent的典型用法代码示例。如果您正苦于以下问题:PHP eZWorkflowEvent类的具体用法?PHP eZWorkflowEvent怎么用?PHP eZWorkflowEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了eZWorkflowEvent类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: move

 function move($down, $params = null)
 {
     if (is_array($params)) {
         $pos = $params["placement"];
         $wid = $params["workflow_id"];
         $version = $params["version"];
     } else {
         $pos = $this->Placement;
         $wid = $this->WorkflowID;
         $version = $this->Version;
     }
     eZPersistentObject::reorderObject(eZWorkflowEvent::definition(), array("placement" => $pos), array("workflow_id" => $wid, "version" => $version), $down);
 }
开发者ID:netbliss,项目名称:ezpublish,代码行数:13,代码来源:ezworkflowevent.php


示例2: 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 )
{
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:31,代码来源:edit.php


示例3: array

$db = eZDB::instance();

$workflowProcessList = eZWorkflowProcess::fetchForStatus( eZWorkflow::STATUS_DEFERRED_TO_CRON );

$cli->output( "Checking for workflow processes"  );
$removedProcessCount = 0;
$processCount = 0;
$statusMap = array();
foreach( $workflowProcessList as $process )
{
    $db->begin();

    $workflow = eZWorkflow::fetch( $process->attribute( "workflow_id" ) );

    if ( $process->attribute( "event_id" ) != 0 )
        $workflowEvent = eZWorkflowEvent::fetch( $process->attribute( "event_id" ) );
    $process->run( $workflow, $workflowEvent, $eventLog );
// Store changes to process

    ++$processCount;
    $status = $process->attribute( 'status' );
    if ( !isset( $statusMap[$status] ) )
        $statusMap[$status] = 0;
    ++$statusMap[$status];

    if ( $process->attribute( 'status' ) != eZWorkflow::STATUS_DONE )
    {
        if ( $process->attribute( 'status' ) == eZWorkflow::STATUS_RESET ||
             $process->attribute( 'status' ) == eZWorkflow::STATUS_FAILED ||
             $process->attribute( 'status' ) == eZWorkflow::STATUS_NONE ||
             $process->attribute( 'status' ) == eZWorkflow::STATUS_CANCELLED ||
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:workflow.php


示例4: unset

    $workflowEvent = eZWorkflowEvent::fetch($process->attribute("event_id"));
}
$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);
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:process.php


示例5: runWorkflow

 function runWorkflow()
 {
     $workflowProcessList = eZWorkflowProcess::fetchForStatus(eZWorkflow::STATUS_DEFERRED_TO_CRON);
     foreach ($workflowProcessList as $process) {
         $workflow = eZWorkflow::fetch($process->attribute("workflow_id"));
         if ($process->attribute("event_id") != 0) {
             $workflowEvent = eZWorkflowEvent::fetch($process->attribute("event_id"));
         }
         $process->run($workflow, $workflowEvent, $eventLog);
         // Store changes to process
         if ($process->attribute('status') != eZWorkflow::STATUS_DONE) {
             if ($process->attribute('status') == eZWorkflow::STATUS_RESET || $process->attribute('status') == eZWorkflow::STATUS_FAILED || $process->attribute('status') == eZWorkflow::STATUS_NONE || $process->attribute('status') == eZWorkflow::STATUS_CANCELLED || $process->attribute('status') == eZWorkflow::STATUS_BUSY) {
                 $bodyMemento = eZOperationMemento::fetchMain($process->attribute('memento_key'));
                 $mementoList = eZOperationMemento::fetchList($process->attribute('memento_key'));
                 $bodyMemento->remove();
                 foreach ($mementoList as $memento) {
                     $memento->remove();
                 }
             }
             if ($process->attribute('status') == eZWorkflow::STATUS_CANCELLED) {
                 $process->removeThis();
             } else {
                 $process->store();
             }
         } else {
             //restore memento and run it
             $bodyMemento = eZOperationMemento::fetchChild($process->attribute('memento_key'));
             if (is_null($bodyMemento)) {
                 eZDebug::writeError($bodyMemento, "Empty body memento in workflow.php");
                 continue;
             }
             $bodyMementoData = $bodyMemento->data();
             $mainMemento = $bodyMemento->attribute('main_memento');
             if (!$mainMemento) {
                 continue;
             }
             $mementoData = $bodyMemento->data();
             $mainMementoData = $mainMemento->data();
             $mementoData['main_memento'] = $mainMemento;
             $mementoData['skip_trigger'] = true;
             $mementoData['memento_key'] = $process->attribute('memento_key');
             $bodyMemento->remove();
             $operationParameters = array();
             if (isset($mementoData['parameters'])) {
                 $operationParameters = $mementoData['parameters'];
             }
             $operationResult = eZOperationHandler::execute($mementoData['module_name'], $mementoData['operation_name'], $operationParameters, $mementoData);
             $process->removeThis();
         }
     }
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:51,代码来源:ezapprovetype_regression.php


示例6: execute

 function execute($process, $event)
 {
     $parameters = $process->attribute('parameter_list');
     $objectId = $parameters['object_id'];
     $object = eZContentObject::fetch($objectId);
     $subtreeNodeID = $event->attribute('target_subtree');
     $subtreeNode = eZContentObjectTreeNode::fetch($subtreeNodeID);
     eZDebug::writeDebug("Event begins execution for object {$objectId}, subtree {$subtreeNodeID}", __METHOD__);
     if ($object != null && $subtreeNode != null) {
         $is_child = false;
         $locations = $object->assignedNodes();
         if ($locations == null) {
             // pre-creation event: obj has no node on its own, but a putative parent
             //eZDebug::writeDebug( 'Obj node is new!', __METHOD__ );
             $locations = eZNodeAssignment::fetchForObject($objectId, $object->attribute("current_version"));
             foreach ($locations as $key => $location) {
                 $locations[$key] = $location->getParentNode();
             }
         }
         foreach ($locations as $node) {
             $subtreeNodePath = $node->pathArray();
             //eZDebug::writeDebug( 'Testing if obj node '.$node->NodeID.' is child of : ' . $subtreeNodeID, __METHOD__ );
             if (in_array($subtreeNodeID, $subtreeNodePath)) {
                 eZDebug::writeDebug('Found that obj node ' . $node->NodeID . ' is child of node ' . $subtreeNodeID, __METHOD__);
                 $is_child = true;
                 break;
             }
         }
         if ($is_child) {
             $workflowToRun = $event->attribute('target_workflow');
             $user = eZUser::currentUser();
             $userID = $user->id();
             $processParameters = $process->attribute('parameter_list');
             // code copy+pasted from ez multoplexer worflow...
             $childParameters = array_merge($processParameters, array('workflow_id' => $workflowToRun, 'user_id' => $userID, 'parent_process_id' => $process->attribute('id')));
             $childProcessKey = eZWorkflowProcess::createKey($childParameters);
             $childProcessArray = eZWorkflowProcess::fetchListByKey($childProcessKey);
             $childProcess =& $childProcessArray[0];
             if ($childProcess == null) {
                 $childProcess = eZWorkflowProcess::create($childProcessKey, $childParameters);
                 $childProcess->store();
             }
             $workflow = eZWorkflow::fetch($childProcess->attribute("workflow_id"));
             $workflowEvent = null;
             if ($childProcess->attribute("event_id") != 0) {
                 $workflowEvent = eZWorkflowEvent::fetch($childProcess->attribute("event_id"));
             }
             $childStatus = $childProcess->run($workflow, $workflowEvent, $eventLog);
             $childProcess->store();
             if ($childStatus == eZWorkflow::STATUS_DEFERRED_TO_CRON) {
                 $this->setActivationDate($childProcess->attribute('activation_date'));
                 $childProcess->setAttribute("status", eZWorkflow::STATUS_WAITING_PARENT);
                 $childProcess->store();
                 return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
             } else {
                 if ($childStatus == eZWorkflow::STATUS_FETCH_TEMPLATE) {
                     $process->Template =& $childProcess->Template;
                     return eZWorkflowType::STATUS_FETCH_TEMPLATE_REPEAT;
                 } else {
                     if ($childStatus == eZWorkflow::STATUS_REDIRECT) {
                         $process->RedirectUrl =& $childProcess->RedirectUrl;
                         return eZWorkflowType::STATUS_REDIRECT_REPEAT;
                     } else {
                         if ($childStatus == eZWorkflow::STATUS_DONE) {
                             $childProcess->removeThis();
                             return eZWorkflowType::STATUS_ACCEPTED;
                         } else {
                             if ($childStatus == eZWorkflow::STATUS_CANCELLED || $childStatus == eZWorkflow::STATUS_FAILED) {
                                 $childProcess->removeThis();
                                 return eZWorkflowType::STATUS_REJECTED;
                             }
                         }
                     }
                 }
             }
             return $childProcess->attribute('event_status');
         }
         return eZWorkflowType::STATUS_ACCEPTED;
     } else {
         eZDebug::writeError("Event triggered for inexisting object ({$objectId}) or subtree ({$subtreeNodeID})", __METHOD__);
         return eZWorkflowType::STATUS_WORKFLOW_CANCELLED;
     }
 }
开发者ID:gggeek,项目名称:ezworkflowcollection,代码行数:83,代码来源:subtreemultiplexertype.php


示例7: execute

 function execute($process, $event)
 {
     $processParameters = $process->attribute('parameter_list');
     $storeProcessParameters = false;
     $classID = false;
     $object = false;
     $sectionID = false;
     $languageID = 0;
     if (isset($processParameters['object_id'])) {
         $object = eZContentObject::fetch($processParameters['object_id']);
     } else {
         if (isset($processParameters['node_id'])) {
             $object = eZContentObject::fetchByNodeID($processParameters['node_id']);
         }
     }
     if ($object instanceof eZContentObject) {
         // Examine if the published version contains one of the languages we
         // match for.
         if (isset($processParameters['version'])) {
             $versionID = $processParameters['version'];
             $version = $object->version($versionID);
             if (is_object($version)) {
                 $version_option = $event->attribute('version_option');
                 if ($version_option == eZMultiplexerType::VERSION_OPTION_FIRST_ONLY and $processParameters['version'] > 1 or $version_option == eZMultiplexerType::VERSION_OPTION_EXCEPT_FIRST and $processParameters['version'] == 1) {
                     return eZWorkflowType::STATUS_ACCEPTED;
                 }
                 // If the language ID is part of the mask the result is non-zero.
                 $languageID = (int) $version->attribute('initial_language_id');
             }
         }
         $sectionID = $object->attribute('section_id');
         $class = $object->attribute('content_class');
         if ($class) {
             $classID = $class->attribute('id');
         }
     }
     $userArray = explode(',', $event->attribute('data_text2'));
     $classArray = explode(',', $event->attribute('data_text5'));
     $languageMask = $event->attribute('data_int2');
     if (!isset($processParameters['user_id'])) {
         $user = eZUser::currentUser();
         $userID = $user->id();
         $processParameters['user_id'] = $userID;
         $storeProcessParameters = true;
     } else {
         $userID = $processParameters['user_id'];
         $user = eZUser::fetch($userID);
         if (!$user instanceof eZUser) {
             $user = eZUser::currentUser();
             $userID = $user->id();
             $processParameters['user_id'] = $userID;
             $storeProcessParameters = true;
         }
     }
     $userGroups = $user->attribute('groups');
     $inExcludeGroups = count(array_intersect($userGroups, $userArray)) != 0;
     if ($storeProcessParameters) {
         $process->setParameters($processParameters);
         $process->store();
     }
     // All languages match by default
     $hasLanguageMatch = true;
     if ($languageMask != 0) {
         // Match ID with mask.
         $hasLanguageMatch = (bool) ($languageMask & $languageID);
     }
     if ($hasLanguageMatch && !$inExcludeGroups && (in_array(-1, $classArray) || in_array($classID, $classArray))) {
         $sectionArray = explode(',', $event->attribute('data_text1'));
         if (in_array($sectionID, $sectionArray) || in_array(-1, $sectionArray)) {
             $workflowToRun = $event->attribute('data_int1');
             $childParameters = array_merge($processParameters, array('workflow_id' => $workflowToRun, 'user_id' => $userID, 'parent_process_id' => $process->attribute('id')));
             $childProcessKey = eZWorkflowProcess::createKey($childParameters);
             $childProcessArray = eZWorkflowProcess::fetchListByKey($childProcessKey);
             $childProcess =& $childProcessArray[0];
             if ($childProcess == null) {
                 $childProcess = eZWorkflowProcess::create($childProcessKey, $childParameters);
                 $childProcess->store();
             }
             $workflow = eZWorkflow::fetch($childProcess->attribute("workflow_id"));
             $workflowEvent = null;
             if ($childProcess->attribute("event_id") != 0) {
                 $workflowEvent = eZWorkflowEvent::fetch($childProcess->attribute("event_id"));
             }
             $childStatus = $childProcess->run($workflow, $workflowEvent, $eventLog);
             $childProcess->store();
             if ($childStatus == eZWorkflow::STATUS_DEFERRED_TO_CRON) {
                 $this->setActivationDate($childProcess->attribute('activation_date'));
                 $childProcess->setAttribute("status", eZWorkflow::STATUS_WAITING_PARENT);
                 $childProcess->store();
                 return eZWorkflowType::STATUS_DEFERRED_TO_CRON_REPEAT;
             } else {
                 if ($childStatus == eZWorkflow::STATUS_FETCH_TEMPLATE or $childStatus == eZWorkflow::STATUS_FETCH_TEMPLATE_REPEAT) {
                     $process->Template =& $childProcess->Template;
                     return eZWorkflowType::STATUS_FETCH_TEMPLATE_REPEAT;
                 } else {
                     if ($childStatus == eZWorkflow::STATUS_REDIRECT) {
                         $process->RedirectUrl =& $childProcess->RedirectUrl;
                         return eZWorkflowType::STATUS_REDIRECT_REPEAT;
                     } else {
                         if ($childStatus == eZWorkflow::STATUS_DONE) {
//.........这里部分代码省略.........
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:101,代码来源:ezmultiplexertype.php


示例8: removeThis

 function removeThis()
 {
     $workflowParameters = $this->attribute('parameter_list');
     $cleanupList = array();
     $db = eZDB::instance();
     $db->begin();
     if (isset($workflowParameters['cleanup_list']) && is_array($workflowParameters['cleanup_list'])) {
         $cleanupList = $workflowParameters['cleanup_list'];
         foreach ($cleanupList as $workflowEventID) {
             $workflowEvent = eZWorkflowEvent::fetch($workflowEventID);
             $workflowType = $workflowEvent->eventType();
             $workflowType->cleanup($this, eZWorkflowEvent::fetch($workflowEventID));
         }
     }
     eZPersistentObject::removeObject(eZWorkflowProcess::definition(), array('id' => $this->attribute('id')));
     $db->commit();
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:17,代码来源:ezworkflowprocess.php


示例9: ksort

 *
 * @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));
            }
            $workflowEvents[$typeString][$event->attribute('id')] = $event;
        }
    }
}
$title = 'List of available workflow event types';
if ($Params['extensionname'] != '') {
    $title .= ' in extension "' . $Params['extensionname'] . '"';
开发者ID:gggeek,项目名称:ggsysinfo,代码行数:31,代码来源:eventtypelist.php


示例10: 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;
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:46,代码来源:ezworkflowevent_regression.php


示例11: validateHTTPInput

 /**
  * @param eZHTTPTool $http
  * @param $base
  * @param eZWorkflowEvent $workflowEvent
  * @param $validation
  *
  * @return bool|int
  */
 function validateHTTPInput($http, $base, $workflowEvent, &$validation)
 {
     $returnState = eZInputValidator::STATE_ACCEPTED;
     $reason = array();
     if (!$http->hasSessionVariable('BrowseParameters')) {
         // No validation when deleting to avoid blocking deletion of invalid items
         if ($http->hasPostVariable('DeleteApproveUserIDArray_' . $workflowEvent->attribute('id')) || $http->hasPostVariable('DeleteApproveGroupIDArray_' . $workflowEvent->attribute('id'))) {
             return eZInputValidator::STATE_ACCEPTED;
         }
         // check approve-users
         $approversIDs = array_unique($this->attributeDecoder($workflowEvent, 'approve_users'));
         if (is_array($approversIDs) and count($approversIDs) > 0) {
             $returnState = eZApproveType::validateUserIDList($approversIDs, $reason);
         } else {
             $returnState = false;
         }
         if ($returnState != eZInputValidator::STATE_INVALID) {
             // check approve-groups
             $userGroupIDList = array_unique($this->attributeDecoder($workflowEvent, 'approve_groups'));
             if (is_array($userGroupIDList) and count($userGroupIDList) > 0) {
                 $returnState = eZApproveType::validateGroupIDList($userGroupIDList, $reason);
             } else {
                 if ($returnState === false) {
                     // if no one user or user-group was passed as approvers
                     $returnState = eZInputValidator::STATE_INVALID;
                     $reason['text'] = "There must be passed at least one valid user or user group who approves content for the event.";
                 }
             }
             // check excluded-users
             /*
             if ( $returnState != eZInputValidator::STATE_INVALID )
             {
                 // TODO:
                 // ....
             }
             */
             // check excluded-groups
             if ($returnState != eZInputValidator::STATE_INVALID) {
                 $userGroupIDList = array_unique($this->attributeDecoder($workflowEvent, 'selected_usergroups'));
                 if (is_array($userGroupIDList) and count($userGroupIDList) > 0) {
                     $returnState = eZApproveType::validateGroupIDList($userGroupIDList, $reason);
                 }
             }
         }
     } else {
         $browseParameters = $http->sessionVariable('BrowseParameters');
         if (isset($browseParameters['custom_action_data'])) {
             $customData = $browseParameters['custom_action_data'];
             if (isset($customData['event_id']) and $customData['event_id'] == $workflowEvent->attribute('id')) {
                 if (!$http->hasPostVariable('BrowseCancelButton') and $http->hasPostVariable('SelectedObjectIDArray')) {
                     $objectIDArray = $http->postVariable('SelectedObjectIDArray');
                     if (is_array($objectIDArray) and count($objectIDArray) > 0) {
                         switch ($customData['browse_action']) {
                             case "AddApproveUsers":
                                 $returnState = eZApproveType::validateUserIDList($objectIDArray, $reason);
                                 break;
                             case 'AddApproveGroups':
                             case 'AddExcludeUser':
                                 $returnState = eZApproveType::validateGroupIDList($objectIDArray, $reason);
                                 break;
                             case 'AddExcludedGroups':
                                 // TODO:
                                 // .....
                                 break;
                         }
                     }
                 }
             }
         }
     }
     if ($returnState == eZInputValidator::STATE_INVALID) {
         $validation['processed'] = true;
         $validation['events'][] = array('id' => $workflowEvent->attribute('id'), 'placement' => $workflowEvent->attribute('placement'), 'workflow_type' => &$this, 'reason' => $reason);
     }
     return $returnState;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:84,代码来源:ezapprovetype.php


示例12: execute


//.........这里部分代码省略.........
                        {
                            $this->writeMessage( "\tUnknown workflowExistAction '" . $workflowExistAction . "'." , 'notice' );
                        }
                    }
                }

                $WorkflowID      = $workflow->attribute( "id" );
                $WorkflowVersion = $workflow->attribute( "version" );

                $db->commit();

                if ( $referenceID )
                {
                    $refArray[$referenceID] = $WorkflowID;
                }

                $eventList     = $workflow->fetchEvents();
                $eventNodeList = $workflowNode->getElementsByTagName( 'Event' );
                $maxPlacement  = -1;

                foreach ( $eventList as $event )
                {
                    if ( $event->attribute( 'placement' ) > $maxPlacement )
                    {
                        $maxPlacement = $event->attribute( 'placement' );
                    }
                }

                foreach ( $eventNodeList as $eventNode )
                {
                    $description        = $eventNode->getAttribute( 'description' );
                    $workflowTypeString = $eventNode->getAttribute( 'workflowTypeString' );
                    $placement          = $eventNode->getAttribute( 'placement' );
                    $event              = eZWorkflowEvent::create( $WorkflowID, $workflowTypeString );
                    $eventType          = $event->eventType();

                    $db->begin();

                    $workflow->store( $eventList );
                    $eventType->initializeEvent( $event );

                    if ( is_numeric( $placement ) )
                    {
                        $eventType->setAttribute( 'placement', (int)$placement );
                    }
                    else
                    {
                        ++$maxPlacement;
                        $eventType->setAttribute( 'placement', $maxPlacement );
                    }

                    $eventDataNode = $eventNode->getElementsByTagName( 'Data' )->item( 0 );

                    if ( $eventDataNode )
                    {
                        $attributes = $eventDataNode->childNodes;
                        foreach ( $attributes as $attribute )
                        {
                            if ( $event->hasAttribute( $attribute->nodeName ) )
                            {
                                $data = $this->parseAndReplaceStringReferences( $attribute->textContent );
                                $event->setAttribute( $attribute->nodeName, $data );
                            }
                        }
                    }
                    $event->store();
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:67,代码来源:ezcreateworkflow.php



注:本文中的eZWorkflowEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP eZWorkflowEventType类代码示例发布时间:2022-05-23
下一篇:
PHP eZWorkflow类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap