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


PHP Step::getAllCaseSteps方法代码示例

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


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

示例1: getSteps

    public function getSteps ($appUid, $index, $tasUid, $proUid)
    {
        //require_once 'classes/model/Step.php';
        //require_once 'classes/model/Content.php';
        //require_once 'classes/model/AppDocument.php';
        //require_once 'classes/model/InputDocumentPeer.php';
        //require_once 'classes/model/OutputDocument.php';
        //require_once 'classes/model/Dynaform.php';

        //G::LoadClass( 'pmScript' );
        G::LoadClass( 'case' );

        $steps = Array ();
        $case = new Cases();
        $step = new Step();
        $appDocument = new AppDocument();

        $caseSteps = $step->getAllCaseSteps( $proUid, $tasUid, $appUid );

        //getting externals steps
        $oPluginRegistry = &PMPluginRegistry::getSingleton();
        $eSteps = $oPluginRegistry->getSteps();
        $externalSteps = array ();

        foreach ($eSteps as $externalStep) {
            $externalSteps[$externalStep->sStepId] = $externalStep;
        }

        //getting the case record
        if ($appUid) {
            $caseData = $case->loadCase( $appUid );
            $pmScript = new PMScript();
            $pmScript->setFields( $caseData['APP_DATA'] );
        }

        $externalStepCount = 0;

        foreach ($caseSteps as $caseStep) {
            // if it has a condition
            if (trim( $caseStep->getStepCondition() ) != '') {
                $pmScript->setScript( $caseStep->getStepCondition() );

                if (! $pmScript->evaluate()) {
                    //evaluated false, jump & continue with the others steps
                    continue;
                }
            }

            $stepUid = $caseStep->getStepUidObj();
            $stepType = $caseStep->getStepTypeObj();
            $stepPosition = $caseStep->getStepPosition();

            $stepItem = array ();
            $stepItem['id'] = $stepUid;
            $stepItem['type'] = $stepType;

            switch ($stepType) {
                case 'DYNAFORM':
                    $oDocument = DynaformPeer::retrieveByPK( $stepUid );

                    $stepItem['title'] = $oDocument->getDynTitle();
                    $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=EDIT";
                    $stepItem['version'] = $oDocument->getDynVersion();
                    break;
                case 'OUTPUT_DOCUMENT':
                    $oDocument = OutputDocumentPeer::retrieveByPK( $caseStep->getStepUidObj() );
                    $outputDoc = $appDocument->getObject( $appUid, $index, $caseStep->getStepUidObj(), 'OUTPUT' );
                    $stepItem['title'] = $oDocument->getOutDocTitle();

                    if ($outputDoc['APP_DOC_UID']) {
                        $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=VIEW&DOC={$outputDoc['APP_DOC_UID']}";
                    } else {
                        $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=GENERATE";
                    }
                    break;
                case 'INPUT_DOCUMENT':
                    $oDocument = InputDocumentPeer::retrieveByPK( $stepUid );
                    $stepItem['title'] = $oDocument->getInpDocTitle();
                    $stepItem['url'] = "cases/cases_Step?UID=$stepUid&TYPE=$stepType&POSITION=$stepPosition&ACTION=ATTACH";
                    break;
                case 'EXTERNAL':
                    $stepTitle = 'unknown ' . $caseStep->getStepUidObj();
                    $oPluginRegistry = PMPluginRegistry::getSingleton();
                    $externalStep = $externalSteps[$caseStep->getStepUidObj()];
                    $stepItem['id'] = $externalStep->sStepId;
                    $stepItem['title'] = $externalStep->sStepTitle;
                    $stepItem['url'] = "cases/cases_Step?UID={$externalStep->sStepId}&TYPE=EXTERNAL&POSITION=$stepPosition&ACTION=EDIT";
                    break;
            }

            $steps[] = $stepItem;
        }

        //last, assign task
        $stepItem = array ();
        $stepItem['id'] = '-1';
        $stepItem['type'] = '';
        $stepItem['title'] = G::LoadTranslation( 'ID_ASSIGN_TASK' );
        $stepItem['url'] = "cases/cases_Step?TYPE=ASSIGN_TASK&UID=-1&POSITION=10000&ACTION=ASSIGN";

//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:class.applications.php


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