当前位置: 首页>>代码示例>>PHP>>正文


PHP eZWorkflow::removeEvents方法代码示例

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


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

示例1: foreach

    $workflow->store( $event_list ); // store changes.

    // Remove old version 0 first
    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->removeThis( true );
    $workflow->setVersion( 0, $event_list );
    $workflow->adjustEventPlacements( $event_list );
//    $workflow->store( $event_list );
    $workflow->storeDefined( $event_list );
    $workflow->cleanupWorkFlowProcess();

    $db->commit();

    $workflowGroups= eZWorkflowGroupLink::fetchGroupList( $WorkflowID, 0, true );
    $groupID = false;
    if ( count( $workflowGroups ) > 0 )
        $groupID = $workflowGroups[0]->attribute( 'group_id' );
    if ( $groupID )
        return $Module->redirectToView( 'workflowlist', array( $groupID ) );
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:30,代码来源:edit.php

示例2: removeWorkflow

 /**
  * 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'));
 }
开发者ID:nfrp,项目名称:ezpublish,代码行数:16,代码来源:ezworkflowevent_regression.php

示例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;
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:41,代码来源:ezapprovetype_regression.php

示例4: execute


//.........这里部分代码省略.........
                            $workflow = null;
                        }
                    }
                }

                $db->begin();

                if ( $workflow === null )
                {
                    $this->writeMessage( "\tWorkflow '$workflowName' will be created." , 'notice' );
                    $workflow = eZWorkflow::create( $userID );
                    $workflow->setAttribute( "name",  $workflowName );
                    if ( $workflowTypeString )
                    {
                        $workflow->setAttribute( "workflow_type_string",  $workflowTypeString );
                    }
                    $workflow->store();
                    $ingroup = eZWorkflowGroupLink::create( $workflow->attribute( "id" ), $workflow->attribute( "version" ), $WorkflowGroupID, $groupName );
                    $ingroup->store();
                }
                else
                {
                    $hasWorkflowDraft = true;
                    switch ( $workflowExistAction )
                    {
                        case 'extend':
                        {
                            $this->writeMessage( "\tExtending existing workflow '" . $workflow->attribute( 'name' ) . "'." , 'notice' );
                        }
                        break;
                        case 'replace':
                        {
                            $this->writeMessage( "\tReplacing existing workflow '" . $workflow->attribute( 'name' ) . "'." , 'notice' );
                            eZWorkflow::removeEvents( false, $workflow->attribute( "id" ), $workflow->attribute( "version" ) );
                        }
                        break;
                        default:
                        {
                            $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 )
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:67,代码来源:ezcreateworkflow.php


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