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


PHP ApplicationPeer::doSelectRS方法代码示例

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


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

示例1: populateReportTable

    /**
     * Populate the report table with all case data
     * @param string $sType
     * @param string $sProcessUid
     * @param string $sGrid
     * @return number
     */
    public function populateReportTable($tableName, $sConnection = 'rp', $type = 'NORMAL', $processUid = '', $gridKey = '', $addTabUid = '')
    {
        require_once "classes/model/Application.php";

        $this->className = $this->getPHPName($tableName);
        $this->classPeerName = $this->className . 'Peer';

        if (!file_exists(PATH_WORKSPACE . 'classes/' . $this->className . '.php')) {
            throw new Exception( "ERROR: " . PATH_WORKSPACE . 'classes/' . $this->className . '.php'
                                . " class file doesn't exit!");
        }

        require_once PATH_WORKSPACE . 'classes/' . $this->className . '.php';

        //select cases for this Process, ordered by APP_NUMBER
        $con = Propel::getConnection($sConnection);
        $stmt = $con->createStatement();
        $criteria = new Criteria('workflow');
        $criteria->add(ApplicationPeer::PRO_UID, $processUid);
        $criteria->addAscendingOrderByColumn(ApplicationPeer::APP_NUMBER);
        $dataset = ApplicationPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);

        while ($dataset->next()) {
            $row = $dataset->getRow();
            //remove old applications references
            $deleteSql = "DELETE FROM $tableName WHERE APP_UID = '" . $row['APP_UID'] . "'";
            $rs = $stmt->executeQuery($deleteSql);
            // getting the case data
            $caseData = unserialize($row['APP_DATA']);

            $fieldTypes = array();

            if ($addTabUid != '') {
                require_once 'classes/model/Fields.php';
                $criteriaField = new Criteria('workflow');
                $criteriaField->add(FieldsPeer::ADD_TAB_UID, $addTabUid);
                $datasetField = FieldsPeer::doSelectRS($criteriaField);
                $datasetField->setFetchmode(ResultSet::FETCHMODE_ASSOC);
                while ($datasetField->next()) {
                    $rowfield = $datasetField->getRow();
                    switch ($rowfield['FLD_TYPE']) {
                        case 'FLOAT':
                        case 'DOUBLE':
                        case 'INTEGER':
                            $fieldTypes[] = array($rowfield['FLD_NAME']=>$rowfield['FLD_TYPE']);
                            break;
                        default:
                            break;
                    }
                }
            }

            // quick fix
            // map all empty values as NULL for Database
            foreach ($caseData as $dKey => $dValue) {
                if (!is_array($dValue)) {
                    foreach ($fieldTypes as $key => $fieldType) {
                        foreach ($fieldType as $name => $theType) {
                            if (strtoupper($dKey) == $name) {
                                $caseData[$dKey] = validateType ($dValue, $theType);
                                unset($name);
                            }
                        }
                    }
                    // normal fields
                    if (trim($dValue) === '') {
                        $caseData[$dKey] = null;
                    }
                } else {
                    // grids
                    foreach ($caseData[$dKey] as $dIndex => $dRow) {
                        if (!is_array($dRow)) {
                            foreach ($dRow as $k => $v) {
                                if (trim($v) === '') {
                                    $caseData[$dKey][$dIndex][$k] = null;
                                }
                            }
                        }
                    }
                }
            }

            if ($type == 'GRID') {
                list($gridName, $gridUid) = explode('-', $gridKey);
                $gridData = isset($caseData[$gridName]) ? $caseData[$gridName] : array();

                foreach ($gridData as $i => $gridRow) {
                    eval('$obj = new ' . $this->className . '();');
                    $obj->fromArray($caseData, BasePeer::TYPE_FIELDNAME);
                    $obj->setAppUid($row['APP_UID']);
                    $obj->setAppNumber($row['APP_NUMBER']);
                    if (method_exists($obj, 'setAppStatus')) {
//.........这里部分代码省略.........
开发者ID:rrsc,项目名称:processmaker,代码行数:101,代码来源:AdditionalTables.php

示例2: reportTableDeleteRecord

    public function reportTableDeleteRecord($applicationUid)

    {

        $criteria1 = new Criteria("workflow");



        //SELECT

        $criteria1->addSelectColumn(ApplicationPeer::PRO_UID);



        //FROM



        //WHERE

        $criteria1->add(ApplicationPeer::APP_UID, $applicationUid);



        //QUERY

        $rsCriteria1 = ApplicationPeer::doSelectRS($criteria1);

        $rsCriteria1->setFetchmode(ResultSet::FETCHMODE_ASSOC);



        $rsCriteria1->next();

        $row1 = $rsCriteria1->getRow();



        $processUid = $row1["PRO_UID"];



        $criteria2 = new Criteria("workflow");



        //SELECT

        $criteria2->addSelectColumn(AdditionalTablesPeer::ADD_TAB_NAME);



        //FROM



        //WHERE



        $criteria2->add(AdditionalTablesPeer::PRO_UID, $processUid);



        //QUERY

        $rsCriteria2 = AdditionalTablesPeer::doSelectRS($criteria2);

        $rsCriteria2->setFetchmode(ResultSet::FETCHMODE_ASSOC);



        G::LoadClass("pmTable");

        $pmTable = new PmTable();



        while ($rsCriteria2->next()) {

            try {

                $row2 = $rsCriteria2->getRow();

                $tableName = $row2["ADD_TAB_NAME"];

                $pmTableName = $pmTable->toCamelCase($tableName);



                //DELETE

                require_once (PATH_WORKSPACE . "classes" . PATH_SEP . "$pmTableName.php");



                $criteria3 = new Criteria("workflow");



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

示例3: doSelect

 /**
  * Method to do selects.
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      Connection $con
  * @return     array Array of selected Objects
  * @throws     PropelException Any exceptions caught during processing will be
  *       rethrown wrapped into a PropelException.
  */
 public static function doSelect(Criteria $criteria, $con = null)
 {
     return ApplicationPeer::populateObjects(ApplicationPeer::doSelectRS($criteria, $con));
 }
开发者ID:rrsc,项目名称:processmaker,代码行数:13,代码来源:BaseApplicationPeer.php

示例4: getSequeceNumber

 /**
  * Get new sequece number
  *
  * @param type $seqName
  * @return type
  * @throws type
  */
 public function getSequeceNumber($seqName)
 {
     $c = new Criteria();
     $c->clearSelectColumns();
     try {
         if ($this->nameExists("APP_NUMBER")) {
             $aSequence = $this->load($seqName);
             $nSeqValue = $aSequence['SEQ_VALUE'] + 1;
         } else {
             $c->addSelectColumn('MAX(' . ApplicationPeer::APP_NUMBER . ')');
             //the appnumber is based in all processes
             //active, not only in the specified
             //process guid
             $result = ApplicationPeer::doSelectRS($c);
             $result->next();
             $row = $result->getRow();
             $nSeqValue = $row[0] + 1;
         }
         return $nSeqValue;
     } catch (Exception $e) {
         throw $e;
     }
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:30,代码来源:Sequences.php

示例5: deleteProcess

 public function deleteProcess($sProcessUID)
 {
     try {
         G::LoadClass('case');
         G::LoadClass('reportTables');
         //Instance all classes necesaries
         $oProcess = new Process();
         $oDynaform = new Dynaform();
         $oInputDocument = new InputDocument();
         $oOutputDocument = new OutputDocument();
         $oTrigger = new Triggers();
         $oRoute = new Route();
         $oGateway = new Gateway();
         $oEvent = new Event();
         $oSwimlaneElement = new SwimlanesElements();
         $oConfiguration = new Configuration();
         $oDbSource = new DbSource();
         $oReportTable = new ReportTables();
         $oCaseTracker = new CaseTracker();
         $oCaseTrackerObject = new CaseTrackerObject();
         //Delete the applications of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(ApplicationPeer::PRO_UID, $sProcessUID);
         $oDataset = ApplicationPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         $oCase = new Cases();
         while ($aRow = $oDataset->getRow()) {
             $oCase->removeCase($aRow['APP_UID']);
             $oDataset->next();
         }
         //Delete the tasks of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(TaskPeer::PRO_UID, $sProcessUID);
         $oDataset = TaskPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $this->deleteTask($aRow['TAS_UID']);
             $oDataset->next();
         }
         //Delete the dynaforms of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(DynaformPeer::PRO_UID, $sProcessUID);
         $oDataset = DynaformPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oDynaform->remove($aRow['DYN_UID']);
             $oDataset->next();
         }
         //Delete the input documents of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(InputDocumentPeer::PRO_UID, $sProcessUID);
         $oDataset = InputDocumentPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oInputDocument->remove($aRow['INP_DOC_UID']);
             $oDataset->next();
         }
         //Delete the output documents of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(OutputDocumentPeer::PRO_UID, $sProcessUID);
         $oDataset = OutputDocumentPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oOutputDocument->remove($aRow['OUT_DOC_UID']);
             $oDataset->next();
         }
         //Delete the triggers of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(TriggersPeer::PRO_UID, $sProcessUID);
         $oDataset = TriggersPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oTrigger->remove($aRow['TRI_UID']);
             $oDataset->next();
         }
         //Delete the routes of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(RoutePeer::PRO_UID, $sProcessUID);
         $oDataset = RoutePeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oRoute->remove($aRow['ROU_UID']);
             $oDataset->next();
         }
         //Delete the gateways of process
         $oCriteria = new Criteria('workflow');
         $oCriteria->add(GatewayPeer::PRO_UID, $sProcessUID);
         $oDataset = GatewayPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $oGateway->remove($aRow['GAT_UID']);
             $oDataset->next();
//.........这里部分代码省略.........
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:101,代码来源:class.processMap.php

示例6: getDatasetCasesByProcess

 function getDatasetCasesByProcess()
 {
     $dataSet = new XYDataSet();
     $processObj = new Process();
     $c = new Criteria('workflow');
     $c->clearSelectColumns();
     $c->addSelectColumn(ApplicationPeer::PRO_UID);
     $c->addSelectColumn('COUNT(*) AS CANT');
     //$c->addJoin( ProcessPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
     $c->addGroupByColumn(ApplicationPeer::PRO_UID);
     $rs = ApplicationPeer::doSelectRS($c);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $rs->next();
     $row = $rs->getRow();
     while (is_array($row)) {
         $processObj->load($row['PRO_UID']);
         $label = $processObj->getProTitle();
         $value = $row['CANT'];
         $dataSet->addPoint(new Point($label, (int) $value));
         $rs->next();
         $row = $rs->getRow();
     }
     return $dataSet;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:24,代码来源:class.charts.php

示例7: array

        $aTypes = array('to_do', 'draft', 'cancelled', 'sent', 'paused', 'completed', 'selfservice', 'to_revise', 'to_reassign');
        $aTypesID = array('to_do' => 'CASES_INBOX', 'draft' => 'CASES_DRAFT', 'cancelled' => 'CASES_CANCELLED', 'sent' => 'CASES_SENT', 'paused' => 'CASES_PAUSED', 'completed' => 'CASES_COMPLETED', 'selfservice' => 'CASES_SELFSERVICE', 'to_revise' => 'CASES_TO_REVISE', 'to_reassign' => 'CASES_TO_REASSIGN');
        if (!isset($_POST['A'])) {
            $oCases = new Cases();
            $aCount = $oCases->getAllConditionCasesCount($aTypes, true);
            echo Bootstrap::json_encode($aCount);
        } else {
            echo Bootstrap::json_encode($aTypesID);
        }
        break;
    case "previusJump":
        //require_once 'classes/model/Application.php';
        $oCriteria = new Criteria('workflow');
        $response = array("success" => true);
        $oCriteria->add(ApplicationPeer::APP_NUMBER, $_POST['appNumber']);
        $oDataset = ApplicationPeer::doSelectRS($oCriteria);
        $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $oDataset->next();
        $aApplication = $oDataset->getRow();
        if (is_array($aApplication)) {
            $response['exists'] = true;
        } else {
            $response['exists'] = false;
        }
        echo Bootstrap::json_encode($response);
        break;
    default:
        echo 'default';
}
function getCasesTypeIds()
{
开发者ID:bqevin,项目名称:processmaker,代码行数:31,代码来源:cases_Ajax.php

示例8: createApplication

 public function createApplication($aData)
 {
     $c = new Criteria();
     $c->clearSelectColumns();
     $c->addSelectColumn('MAX(' . ApplicationPeer::APP_NUMBER . ')');
     $c->add(ApplicationPeer::PRO_UID, $aData['PRO_UID']);
     $result = ApplicationPeer::doSelectRS($c);
     $result->next();
     $row = $result->getRow();
     $maxNumber = $row[0] + 1;
     $this->setAppUid(G::generateUniqueID());
     $this->setAppNumber($maxNumber);
     $this->setAppParent(isset($aData['APP_PARENT']) ? $aData['APP_PARENT'] : 0);
     $this->setAppStatus(isset($aData['APP_STATUS']) ? $aData['APP_STATUS'] : 'DRAFT');
     $this->setProUid($aData['PRO_UID']);
     $this->setAppProcStatus(isset($aData['APP_PROC_STATUS']) ? $aData['APP_PROC_STATUS'] : '');
     $this->setAppProcCode(isset($aData['APP_PROC_CODE']) ? $aData['APP_PROC_CODE'] : '');
     $this->setAppParallel(isset($aData['APP_PARALLEL']) ? $aData['APP_PARALLEL'] : 'N');
     $this->setAppInitUser($aData['USR_UID']);
     $this->setAppCurUser($aData['USR_UID']);
     $this->setAppCreateDate(isset($aData['APP_CREATE_DATE']) ? $aData['APP_CREATE_DATE'] : 'now');
     $this->setAppInitDate(isset($aData['APP_INIT_DATE']) ? $aData['APP_INIT_DATE'] : 'now');
     $this->setAppUpdateDate(isset($aData['APP_UPDATE_DATE']) ? $aData['APP_UPDATE_DATE'] : 'now');
     //$this->setAppData(serialize(array()));
     /** Start Comment : Sets the $this->Fields['APP_DATA']
         Merge between stored APP_DATA with new APP_DATA. **/
     if (!$this->getAppData()) {
         //        if (!$this->is_new)
         //        {
         //          $this->load($fields['APP_UID']);
         //        }
     }
     $this->Fields['APP_DATA'] = isset($this->Fields['APP_DATA']) ? $this->Fields['APP_DATA'] : array();
     if (isset($fields['APP_DATA']) && is_array($fields['APP_DATA'])) {
         foreach ($fields['APP_DATA'] as $k => $v) {
             $this->Fields['APP_DATA'][$k] = $v;
         }
     }
     /** End Comment **/
     /*
     Begin Comment : Replace APP_DATA in APP_TITLE (before to serialize)
       $pro = new process( $this->_dbc );
       $pro->load((isset($fields['PRO_UID']) ? $fields['PRO_UID'] : $this->Fields['PRO_UID']));
       $fields['APP_TITLE'] = G::replaceDataField( $pro->Fields['PRO_TITLE'], $this->Fields['APP_DATA']);
     End Comment
     */
     //    parent::save();
     //    $this->Fields['APP_DATA'] = unserialize($this->Fields['APP_DATA']);
     //    /** Start Comment: Save in the table CONTENT */
     //      $this->content->saveContent('APP_TITLE',$fields);
     //    /** End Comment */
     if ($this->validate()) {
         $res = $this->save();
         $this->setAppTitle('');
         $this->setAppDescription('');
         $this->setAppProcCode('');
     } else {
         // Something went wrong. We can now get the validationFailures and handle them.
         $msg = '';
         $validationFailuresArray = $this->getValidationFailures();
         foreach ($validationFailuresArray as $objValidationFailure) {
             $msg .= $objValidationFailure->getMessage() . "<br/>";
         }
         //return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
     }
     return $this->getAppUid();
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:67,代码来源:Application.php

示例9: Publisher

        */
        case 'emptyFileOptions':
            global $G_PUBLISH;
            $G_PUBLISH = new Publisher();
            $G_PUBLISH->AddContent('xmlform', 'xmlform', 'processes/processes_FileEditCreateEmpty', '');
            G::RenderPage('publish', 'raw');
            break;
        case "taskCases":
            require_once "classes/model/Application.php";
            require_once "classes/model/AppDelegation.php";
            require_once "classes/model/AppDelay.php";
            $criteria = new Criteria("workflow");
            $criteria->addSelectColumn("COUNT(DISTINCT APPLICATION.APP_UID)");
            $criteria->addJoin(ApplicationPeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::LEFT_JOIN);
            $criteria->addJoin(ApplicationPeer::APP_UID, AppDelayPeer::APP_UID, Criteria::LEFT_JOIN);
            $criteria->add(AppDelegationPeer::TAS_UID, $oData->task_uid);
            $criteria->add($criteria->getNewCriterion(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL)->addOr($criteria->getNewCriterion(AppDelayPeer::APP_DELAY_UID, null, Criteria::ISNOTNULL)->addAnd($criteria->getNewCriterion(AppDelayPeer::APP_TYPE, array("REASSIGN", "ADHOC", "CANCEL"), Criteria::NOT_IN))->addAnd($criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, null, Criteria::ISNULL)->addOr($criteria->getNewCriterion(AppDelayPeer::APP_DISABLE_ACTION_USER, 0)))));
            $rs = ApplicationPeer::doSelectRS($criteria);
            $rs->next();
            $row = $rs->getRow();
            $response->casesNumRec = intval($row[0]);
            $json = new Services_JSON();
            $sOutput = $json->encode($response);
            break;
    }
    if (isset($sOutput)) {
        die($sOutput);
    }
} catch (Exception $oException) {
    die($oException->getMessage() . "\n" . $oException->getTraceAsString());
}
开发者ID:rodriquelca,项目名称:processmaker,代码行数:31,代码来源:processes_Ajax.php

示例10: refreshTotal

    public function refreshTotal ($userId, $type = 'add', $list = "inbox", $total = 1)
    {
        if ($userId == "") {
            return;
        }

        $nameList = self::getNameTotal($list);
        $criteria = new Criteria();
        $criteria->addSelectColumn( $nameList );
        $criteria->add( UsersPeer::USR_UID, $userId, Criteria::EQUAL );
        $dataset = ApplicationPeer::doSelectRS($criteria);
        $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $dataset->next();
        $aRow = $dataset->getRow();

        $num = $aRow[$nameList];
        if ($type == 'add') {
            $num++;
        } else {
            $num--;
        }

        $data = array(
            'USR_UID' => $userId,
            $nameList => $num
        );
        self::update($data);
    }
开发者ID:nhenderson,项目名称:processmaker,代码行数:28,代码来源:Users.php

示例11: caseList

 /**
  * Get case list
  *
  * @param string $userId
  * @return $result will return an object
  */
 public function caseList($userId)
 {
     try {
         $result = array();
         $oCriteria = new Criteria('workflow');
         $del = DBAdapter::getStringDelimiter();
         $oCriteria->addSelectColumn(ApplicationPeer::APP_UID);
         $oCriteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
         $oCriteria->addSelectColumn(ApplicationPeer::APP_STATUS);
         $oCriteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
         $oCriteria->addSelectColumn(ApplicationPeer::PRO_UID);
         $oCriteria->addAsColumn('CASE_TITLE', 'C1.CON_VALUE');
         $oCriteria->addAlias("C1", 'CONTENT');
         $caseTitleConds = array();
         $caseTitleConds[] = array(ApplicationPeer::APP_UID, 'C1.CON_ID');
         $caseTitleConds[] = array('C1.CON_CATEGORY', $del . 'APP_TITLE' . $del);
         $caseTitleConds[] = array('C1.CON_LANG', $del . SYS_LANG . $del);
         $oCriteria->addJoinMC($caseTitleConds, Criteria::LEFT_JOIN);
         $oCriteria->addJoin(ApplicationPeer::APP_UID, AppDelegationPeer::APP_UID, Criteria::LEFT_JOIN);
         $oCriteria->add(ApplicationPeer::APP_STATUS, array('TO_DO', 'DRAFT'), Criteria::IN);
         $oCriteria->add(AppDelegationPeer::USR_UID, $userId);
         $oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL);
         $oCriteria->addDescendingOrderByColumn(ApplicationPeer::APP_NUMBER);
         $oDataset = ApplicationPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             /*
             $result[] = array(
                 'guid'     => $aRow['APP_UID'],
                 'name'     => $aRow['CASE_TITLE'],
                 'status'   => $aRow['APP_STATUS'],
                 'delIndex' => $aRow['DEL_INDEX']
             );
             */
             $result[] = array('guid' => $aRow['APP_UID'], 'name' => $aRow['APP_NUMBER'], 'status' => $aRow['APP_STATUS'], 'delIndex' => $aRow['DEL_INDEX'], 'processId' => $aRow['PRO_UID']);
             $oDataset->next();
         }
         return $result;
     } catch (Exception $e) {
         $result[] = array('guid' => $e->getMessage(), 'name' => $e->getMessage(), 'status' => $e->getMessage(), 'status' => $e->getMessage(), 'processId' => $e->getMessage());
         return $result;
     }
 }
开发者ID:ralpheav,项目名称:processmaker,代码行数:50,代码来源:class.wsBase.php

示例12: getStatusInfo

    /**
     * Get status info Case
     *
     * @param string $applicationUid Unique id of Case
     * @param int    $del_index      {@min 1}
     * @param string $userUid        Unique id of User
     *
     * return array Return an array with status info Case, array empty otherwise
     */
    public function getStatusInfo($applicationUid, $delIndex = 0, $userUid = "")
    {
        try {
            //Verify data
            $this->throwExceptionIfNotExistsCase($applicationUid, $delIndex, $this->getFieldNameByFormatFieldName("APP_UID"));

            //Get data
            //Status is PAUSED
            $delimiter = \DBAdapter::getStringDelimiter();

            $criteria = new \Criteria("workflow");

            $criteria->addSelectColumn($delimiter . "PAUSED" . $delimiter . " AS APP_STATUS");
            $criteria->addSelectColumn(\AppDelayPeer::APP_DEL_INDEX . " AS DEL_INDEX");

            $criteria->add(\AppDelayPeer::APP_UID, $applicationUid, \Criteria::EQUAL);
            $criteria->add(\AppDelayPeer::APP_TYPE, "PAUSE", \Criteria::EQUAL);
            $criteria->add(
                $criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, null, \Criteria::ISNULL)->addOr(
                $criteria->getNewCriterion(\AppDelayPeer::APP_DISABLE_ACTION_USER, 0, \Criteria::EQUAL))
            );

            if ($delIndex != 0) {
                $criteria->add(\AppDelayPeer::APP_DEL_INDEX, $delIndex, \Criteria::EQUAL);
            }

            if ($userUid != "") {
                $criteria->add(\AppDelayPeer::APP_DELEGATION_USER, $userUid, \Criteria::EQUAL);
            }

            $rsCriteria = \AppDelayPeer::doSelectRS($criteria);
            $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);

            if ($rsCriteria->next()) {
                $row = $rsCriteria->getRow();

                //Return
                return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
            }

            //Status is TO_DO, DRAFT
            $criteria = new \Criteria("workflow");

            $criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
            $criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);

            $arrayCondition = array();
            $arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
            $arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppThreadPeer::APP_UID, \Criteria::EQUAL);
            $arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
            $criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);

            $criteria->add(
                $criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "TO_DO", \Criteria::EQUAL)->addAnd(
                $criteria->getNewCriterion(\AppDelegationPeer::DEL_FINISH_DATE, null, \Criteria::ISNULL))->addAnd(
                $criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
                $criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
            )->addOr(
                $criteria->getNewCriterion(\ApplicationPeer::APP_STATUS, "DRAFT", \Criteria::EQUAL)->addAnd(
                $criteria->getNewCriterion(\AppDelegationPeer::DEL_THREAD_STATUS, "OPEN"))->addAnd(
                $criteria->getNewCriterion(\AppThreadPeer::APP_THREAD_STATUS, "OPEN"))
            );

            if ($delIndex != 0) {
                $criteria->add(\AppDelegationPeer::DEL_INDEX, $delIndex, \Criteria::EQUAL);
            }

            if ($userUid != "") {
                $criteria->add(\AppDelegationPeer::USR_UID, $userUid, \Criteria::EQUAL);
            }

            $rsCriteria = \ApplicationPeer::doSelectRS($criteria);
            $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);

            if ($rsCriteria->next()) {
                $row = $rsCriteria->getRow();

                //Return
                return array("APP_STATUS" => $row["APP_STATUS"], "DEL_INDEX" => $row["DEL_INDEX"]);
            }

            //Status is CANCELLED, COMPLETED
            $criteria = new \Criteria("workflow");

            $criteria->addSelectColumn(\ApplicationPeer::APP_STATUS);
            $criteria->addSelectColumn(\AppDelegationPeer::DEL_INDEX);

            $arrayCondition = array();
            $arrayCondition[] = array(\ApplicationPeer::APP_UID, \AppDelegationPeer::APP_UID, \Criteria::EQUAL);
            $arrayCondition[] = array(\ApplicationPeer::APP_UID, $delimiter . $applicationUid . $delimiter, \Criteria::EQUAL);
            $criteria->addJoinMC($arrayCondition, \Criteria::LEFT_JOIN);
//.........这里部分代码省略.........
开发者ID:nhenderson,项目名称:processmaker,代码行数:101,代码来源:Cases.php

示例13: getCasesByProcess

 /** to show the cases grouped by Process */
 function getCasesByProcess()
 {
     $dataSet = array();
     $processObj = new Process();
     $c = new Criteria('workflow');
     $c->clearSelectColumns();
     $c->addSelectColumn(ApplicationPeer::PRO_UID);
     $c->addSelectColumn('COUNT(*) AS CANT');
     //$c->addJoin( ProcessPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN);
     $c->addGroupByColumn(ApplicationPeer::PRO_UID);
     $rs = ApplicationPeer::doSelectRS($c);
     $rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $rs->next();
     $row = $rs->getRow();
     while (is_array($row)) {
         $processObj->load($row['PRO_UID']);
         $label[] = $processObj->getProTitle();
         $labelPie[] = substr($processObj->getProTitle(), 0, 16);
         $data[] = (int) $row['CANT'];
         $rs->next();
         $row = $rs->getRow();
     }
     $dataSet['data'] = $data;
     $dataSet['label'] = $label;
     $dataSet['labelPie'] = $labelPie;
     $max = 1;
     foreach ($dataSet['data'] as $k => $val) {
         if ($val > $max) {
             $max = $val;
         }
     }
     $aux = intval($max / 6) * 6 + 6;
     $dataSet['max'] = $aux;
     return $dataSet;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:36,代码来源:class.openFlash.php

示例14: newRow

 public function newRow($data, $delPreviusUsrUid)
 {
     $data['UNA_UID'] = isset($data['UNA_UID']) ? $data['UNA_UID'] : G::GenerateUniqueId();
     $data['DEL_PREVIOUS_USR_UID'] = $delPreviusUsrUid;
     $data['DEL_DUE_DATE'] = $data['DEL_TASK_DUE_DATE'];
     $criteria = new Criteria();
     $criteria->addSelectColumn(ApplicationPeer::APP_NUMBER);
     $criteria->addSelectColumn(ApplicationPeer::APP_UPDATE_DATE);
     $criteria->add(ApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL);
     $dataset = ApplicationPeer::doSelectRS($criteria);
     $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $dataset->next();
     $aRow = $dataset->getRow();
     $data = array_merge($data, $aRow);
     $criteria = new Criteria();
     $criteria->addSelectColumn(ContentPeer::CON_VALUE);
     $criteria->add(ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_CATEGORY, 'APP_TITLE', Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL);
     $dataset = ContentPeer::doSelectRS($criteria);
     $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $dataset->next();
     $aRow = $dataset->getRow();
     $data['APP_TITLE'] = $aRow['CON_VALUE'];
     $criteria = new Criteria();
     $criteria->addSelectColumn(ContentPeer::CON_VALUE);
     $criteria->add(ContentPeer::CON_ID, $data['PRO_UID'], Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE', Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL);
     $dataset = ContentPeer::doSelectRS($criteria);
     $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $dataset->next();
     $aRow = $dataset->getRow();
     $data['APP_PRO_TITLE'] = $aRow['CON_VALUE'];
     $criteria = new Criteria();
     $criteria->addSelectColumn(ContentPeer::CON_VALUE);
     $criteria->add(ContentPeer::CON_ID, $data['TAS_UID'], Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_CATEGORY, 'TAS_TITLE', Criteria::EQUAL);
     $criteria->add(ContentPeer::CON_LANG, SYS_LANG, Criteria::EQUAL);
     $dataset = ContentPeer::doSelectRS($criteria);
     $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $dataset->next();
     $aRow = $dataset->getRow();
     $data['APP_TAS_TITLE'] = $aRow['CON_VALUE'];
     $data['APP_PREVIOUS_USER'] = '';
     if ($data['DEL_PREVIOUS_USR_UID'] != '') {
         $criteria = new Criteria();
         $criteria->addSelectColumn(UsersPeer::USR_USERNAME);
         $criteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
         $criteria->addSelectColumn(UsersPeer::USR_LASTNAME);
         $criteria->add(UsersPeer::USR_UID, $data['DEL_PREVIOUS_USR_UID'], Criteria::EQUAL);
         $dataset = UsersPeer::doSelectRS($criteria);
         $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $dataset->next();
         $aRow = $dataset->getRow();
         $data['APP_PREVIOUS_USR_USERNAME'] = $aRow['USR_USERNAME'];
         $data['APP_PREVIOUS_USR_FIRSTNAME'] = $aRow['USR_FIRSTNAME'];
         $data['APP_PREVIOUS_USR_LASTNAME'] = $aRow['USR_LASTNAME'];
     }
     self::create($data);
     return $data['UNA_UID'];
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:62,代码来源:ListUnassigned.php

示例15: getCasesCountForProcess

 public function getCasesCountForProcess($pro_uid)
 {
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn('COUNT(*) AS TOTAL_CASES');
     $oCriteria->add(ApplicationPeer::PRO_UID, $pro_uid);
     $oDataset = ApplicationPeer::doSelectRS($oCriteria, Propel::getDbConnection('workflow_ro'));
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $cases = $oDataset->getRow();
     return (int) $cases['TOTAL_CASES'];
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:11,代码来源:Process.php


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