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


PHP DynaformPeer类代码示例

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


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

示例1: get

 /**
  * Implementation for 'GET' method for Rest API
  *
  * @param  mixed $dynUid Primary key
  *
  * @return array $result Returns array within multiple records or a single record depending if
  *                       a single selection was requested passing id(s) as param
  */
 protected function get($dynUid = null)
 {
     $result = array();
     try {
         $noArguments = true;
         $argumentList = func_get_args();
         foreach ($argumentList as $arg) {
             if (!is_null($arg)) {
                 $noArguments = false;
             }
         }
         if ($noArguments) {
             $criteria = new Criteria('workflow');
             $criteria->addSelectColumn(DynaformPeer::DYN_UID);
             $criteria->addSelectColumn(DynaformPeer::PRO_UID);
             $criteria->addSelectColumn(DynaformPeer::DYN_TYPE);
             $criteria->addSelectColumn(DynaformPeer::DYN_FILENAME);
             $dataset = AppEventPeer::doSelectRS($criteria);
             $dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
             while ($dataset->next()) {
                 $result[] = $dataset->getRow();
             }
         } else {
             $record = DynaformPeer::retrieveByPK($dynUid);
             if ($record) {
                 $result = $record->toArray(BasePeer::TYPE_FIELDNAME);
             } else {
                 $paramValues = "";
                 foreach ($argumentList as $arg) {
                     $paramValues .= strlen($paramValues) ? ', ' : '';
                     if (!is_null($arg)) {
                         $paramValues .= "{$arg}";
                     } else {
                         $paramValues .= "NULL";
                     }
                 }
                 throw new RestException(417, "table Dynaform ({$paramValues})");
             }
         }
     } catch (RestException $e) {
         throw new RestException($e->getCode(), $e->getMessage());
     } catch (Exception $e) {
         throw new RestException(412, $e->getMessage());
     }
     return $result;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:54,代码来源:Dynaform.php

示例2: setCaseVariables

    /**
     * Put Set Case Variables
     *
     * @access public
     * @param string $app_uid, Uid for case
     * @param array $app_data, Data for case variables
     * @param string $dyn_uid, Uid for dynaform
     * @param string $usr_uid, Uid for user
     *
     * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
     * @copyright Colosa - Bolivia
     */
    public function setCaseVariables($app_uid, $app_data, $dyn_uid = null, $usr_uid)
    {
        Validator::isString($app_uid, '$app_uid');
        Validator::appUid($app_uid, '$app_uid');
        Validator::isArray($app_data, '$app_data');
        Validator::isString($usr_uid, '$usr_uid');
        Validator::usrUid($usr_uid, '$usr_uid');

        $arrayResult = $this->getStatusInfo($app_uid);

        if ($arrayResult["APP_STATUS"] == "CANCELLED") {
            throw new \Exception(\G::LoadTranslation("ID_CASE_CANCELLED", array($app_uid)));
        }

        if ($arrayResult["APP_STATUS"] == "COMPLETED") {
            throw new \Exception(\G::LoadTranslation("ID_CASE_IS_COMPLETED", array($app_uid)));
        }

        $appCacheView = new \AppCacheView();
        $isProcessSupervisor = $appCacheView->getProUidSupervisor($usr_uid);
        $criteria = new \Criteria("workflow");
        $criteria->addSelectColumn(\AppDelegationPeer::APP_UID);
        $criteria->add(\AppDelegationPeer::APP_UID, $app_uid, \Criteria::EQUAL);
        $criteria->add(\AppDelegationPeer::USR_UID, $usr_uid, \Criteria::EQUAL);
        $criteria->add(
            $criteria->getNewCriterion(\AppDelegationPeer::USR_UID, $usr_uid, \Criteria::EQUAL)->addOr(
            $criteria->getNewCriterion(\AppDelegationPeer::PRO_UID, $isProcessSupervisor, \Criteria::IN))
        );
        $rsCriteria = \AppDelegationPeer::doSelectRS($criteria);

        if (!$rsCriteria->next()) {
            throw (new \Exception(\G::LoadTranslation("ID_NO_PERMISSION_NO_PARTICIPATED", array($usr_uid))));
        }

        $_SESSION['APPLICATION'] = $app_uid;
        $_SESSION['USER_LOGGED'] = $usr_uid;

        $case = new \Cases();
        $fields = $case->loadCase($app_uid);
        $_POST['form'] = $app_data;

        if (!is_null($dyn_uid) && $dyn_uid != '') {
            $oDynaform = \DynaformPeer::retrieveByPK($dyn_uid);

            if ($oDynaform->getDynVersion() < 2) {
                $oForm = new \Form ( $fields['PRO_UID'] . "/" . $dyn_uid, PATH_DYNAFORM );
                $oForm->validatePost();
            }
        }

        $data['APP_DATA'] = array_merge($fields['APP_DATA'], $_POST['form']);
        $case->updateCase($app_uid, $data);
    }
开发者ID:nhenderson,项目名称:processmaker,代码行数:65,代码来源:Cases.php

示例3: verifyExistingName

 public function verifyExistingName($sName, $sProUid)
 {
     $sNameDyanform = urldecode($sName);
     $sProUid = urldecode($sProUid);
     $oCriteria = new Criteria('workflow');
     $oCriteria->addSelectColumn(DynaformPeer::DYN_UID);
     $oCriteria->add(DynaformPeer::PRO_UID, $sProUid);
     $oDataset = DynaformPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $flag = true;
     while ($oDataset->next() && $flag) {
         $aRow = $oDataset->getRow();
         $oCriteria1 = new Criteria('workflow');
         $oCriteria1->addSelectColumn('COUNT(*) AS DYNAFORMS');
         $oCriteria1->add(ContentPeer::CON_CATEGORY, 'DYN_TITLE');
         $oCriteria1->add(ContentPeer::CON_ID, $aRow['DYN_UID']);
         $oCriteria1->add(ContentPeer::CON_VALUE, $sNameDyanform);
         $oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
         $oDataset1 = ContentPeer::doSelectRS($oCriteria1);
         $oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         $oDataset1->next();
         $aRow1 = $oDataset1->getRow();
         if ($aRow1['DYNAFORMS']) {
             $flag = false;
             break;
         }
     }
     return $flag;
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:29,代码来源:Dynaform.php

示例4: Exception

     if ($_REQUEST['DEL_INDEX'] == '') {
         throw new Exception('The parameter DEL_INDEX is empty.');
     }
 
     G::LoadClass('case');
     G::LoadClass('pmDynaform');
 
     $cases = new Cases();
     $caseFields = $cases->loadCase(G::decrypt($_REQUEST['APP_UID'], URL_KEY),G::decrypt($_REQUEST['DEL_INDEX'], URL_KEY));
 
     //
     $criteria = new Criteria();
     $criteria->addSelectColumn(DynaformPeer::DYN_CONTENT);
     $criteria->addSelectColumn(DynaformPeer::PRO_UID);
     $criteria->add(DynaformPeer::DYN_UID, G::decrypt($_REQUEST['DYN_UID'], URL_KEY));
     $result = DynaformPeer::doSelectRS($criteria);
     $result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $result->next();
     $configuration = $result->getRow();
     
     $action = 'ActionsByEmailDataFormPost.php?APP_UID=' . $_REQUEST['APP_UID'] . '&DEL_INDEX=' . $_REQUEST['DEL_INDEX'] . '&ABER=' . $_REQUEST['ABER'];
     $record['DYN_CONTENT'] = $configuration['DYN_CONTENT'];
     $record['PRO_UID']     = $configuration['PRO_UID'];
     $record['CURRENT_DYNAFORM'] = G::decrypt($_REQUEST['DYN_UID'], URL_KEY);
     $record['APP_UID'] = $_REQUEST['APP_UID'];
     $record['DEL_INDEX'] = $_REQUEST['DEL_INDEX'];
     $record['ABER'] = $_REQUEST['ABER'];
     if (is_null($caseFields['DEL_FINISH_DATE'])) {
         $a = new pmDynaform($record);
         $a->printABE($action,$record);
     } else {
开发者ID:nhenderson,项目名称:processmaker,代码行数:31,代码来源:ActionsByEmailDataForm.php

示例5: deleteLanguage

    public function deleteLanguage($dyn_uid, $lang)
    {
        $con = Propel::getConnection(DynaformPeer::DATABASE_NAME);
        $con->begin();
        $oPro = DynaformPeer::retrieveByPk($dyn_uid);

        $dyn_labels = \G::json_decode($oPro->getDynLabel());
        unset($dyn_labels->{$lang});

        $oPro->setDynLabel(G::json_encode($dyn_labels));
        $oPro->save();
        $con->commit();
    }
开发者ID:rrsc,项目名称:processmaker,代码行数:13,代码来源:class.pmDynaform.php

示例6: elseif

}
//G::genericForceLogin( 'WF_MYINFO' , 'login/noViewPage', $urlLogin = 'login/login' );
require_once 'classes/model/Dynaform.php';
require_once 'classes/model/Content.php';
if (isset($_POST['function'])) {
    $sfunction = $_POST['function'];
} elseif (isset($_POST['functions'])) {
    $sfunction = $_POST['functions'];
}
if (isset($sfunction) && $sfunction == 'lookforNameDynaform') {
    $snameDyanform = urldecode($_POST['NAMEDYNAFORM']);
    $sPRO_UID = urldecode($_POST['proUid']);
    $oCriteria = new Criteria('workflow');
    $oCriteria->addSelectColumn(DynaformPeer::DYN_UID);
    $oCriteria->add(DynaformPeer::PRO_UID, $sPRO_UID);
    $oDataset = DynaformPeer::doSelectRS($oCriteria);
    $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
    $flag = true;
    while ($oDataset->next() && $flag) {
        $aRow = $oDataset->getRow();
        $oCriteria1 = new Criteria('workflow');
        $oCriteria1->addSelectColumn('COUNT(*) AS DYNAFORMS');
        $oCriteria1->add(ContentPeer::CON_CATEGORY, 'DYN_TITLE');
        $oCriteria1->add(ContentPeer::CON_ID, $aRow['DYN_UID']);
        $oCriteria1->add(ContentPeer::CON_VALUE, $snameDyanform);
        $oCriteria1->add(ContentPeer::CON_LANG, SYS_LANG);
        $oDataset1 = ContentPeer::doSelectRS($oCriteria1);
        $oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
        $oDataset1->next();
        $aRow1 = $oDataset1->getRow();
        if ($aRow1['DYNAFORMS']) {
开发者ID:rodrigoivan,项目名称:processmaker,代码行数:31,代码来源:dynaforms_Save.php

示例7: DBConnection

G::LoadClass('dynaFormField');
if (!(isset($_GET['A']) && $_GET['A'] !== '')) {
    return;
}
$file = G::decrypt($_GET['A'], URL_KEY);
$dbc = new DBConnection(PATH_DYNAFORM . $file . '.xml', '', '', '', 'myxml');
$ses = new DBSession($dbc);
//TODO: Improve how to obtain the PRO_UID.
$aFile = explode('/', str_replace('\\', '/', $file));
$proUid = $aFile[0];
$dynUid = str_replace("_tmp0", "", $aFile[1]);
require_once 'classes/model/Dynaform.php';
$k = new Criteria('workflow');
$k->addSelectColumn(DynaformPeer::DYN_TYPE);
$k->add(DynaformPeer::DYN_UID, $dynUid);
$ods = DynaformPeer::doSelectRS($k);
$ods->next();
$row = $ods->getRow();
$dynType = $row[0];
$Fields['PME_DYN_TYPE'] = $dynType;
$fields = new DynaFormField($dbc);
$fields->Fields['XMLNODE_NAME'] = isset($_GET['XMLNODE_NAME']) ? urldecode($_GET['XMLNODE_NAME']) : '';
$fields->Load($fields->Fields['XMLNODE_NAME']);
/* Start Comment: Modify the options grid to set dynamically the language
 * label columns.
 */
//  $dbc2 = new DBConnection( PATH_XMLFORM . 'dynaforms/fields/_options.xml' ,'','','','myxml' );
//  $ses2 = new DBSession($dbc2);
//  $ses2->execute("DELETE FROM dynaForm WHERE XMLNODE_NAME like 'LABEL_%' ");
//  $ses2->execute("DELETE FROM dynaForm WHERE XMLNODE_NAME = '' ");
//  $langs=array(SYS_LANG/*,'es','fa'*/);
开发者ID:nshong,项目名称:processmaker,代码行数:31,代码来源:fields_Edit.php

示例8: verifyDynaformAssignDynaform

 /**
  * verify if a dynaform is assigned some dynaform
  *
  * @param string $proUid the uid of the process
  * @param string $dynUid the uid of the dynaform
  *
  * @return array
  */
 public function verifyDynaformAssignDynaform($dynUid, $proUid)
 {
     $res = array();
     $oCriteria = new Criteria();
     $oCriteria->addSelectColumn(DynaformPeer::DYN_UID);
     $oCriteria->add(DynaformPeer::PRO_UID, $proUid);
     $oCriteria->add(DynaformPeer::DYN_UID, $dynUid, Criteria::NOT_EQUAL);
     $oCriteria->add(DynaformPeer::DYN_CONTENT, "%" . $dynUid . "%", Criteria::LIKE);
     $oDataset = DynaformPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     while ($oDataset->next()) {
         $res[] = $oDataset->getRow();
     }
     return $res;
 }
开发者ID:emildev35,项目名称:processmaker,代码行数:23,代码来源:Dynaform.php

示例9: getDynaformVariables

 /**
  * Get all dynaform variables 
  *
  * @param $sProcessUID
  */
 public function getDynaformVariables($sProcessUID,$excludeFieldsList,$allowed = true)
 {
     $dynaformVariables = array();
     $oC = new Criteria( 'workflow' );
     $oC->addSelectColumn( DynaformPeer::DYN_CONTENT );
     $oC->add( DynaformPeer::PRO_UID, $sProcessUID );
     $oData = DynaformPeer::doSelectRS( $oC );
     $oData->setFetchmode( ResultSet::FETCHMODE_ASSOC );
     $oData->next();
     while ($aRowd = $oData->getRow()) {
         $dynaform = G::json_decode($aRowd['DYN_CONTENT'],true);
         if(is_array($dynaform) && sizeof($dynaform)) {
             $items = $dynaform['items'][0]['items'];
             foreach($items as $key => $val){
                 foreach($val as $column) {
                     if($allowed) {
                         if(isset($column['type']) && !in_array( $column['type'], $excludeFieldsList )){
                             if(array_key_exists('variable',$column)) {
                                 if($column['variable'] != "") {
                                     $dynaformVariables[] = $column['variable'];
                                 }
                             }
                         }
                     } else {
                         if(isset($column['type']) && in_array( $column['type'], $excludeFieldsList )){
                             if(array_key_exists('variable',$column)) {
                                 if($column['variable'] != "") {
                                     $dynaformVariables[] = $column['variable']; 
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $oData->next();
     }
     return array_unique($dynaformVariables);    
 }
开发者ID:nhenderson,项目名称:processmaker,代码行数:44,代码来源:pmTablesProxy.php

示例10: addProcessSupervisorDynaform

 /**
  * Assign a dynaform supervisor of a process
  *
  * @param string $sProcessUID
  * @param string $sDynUID
  * @param int $sPudPosition
  * @access public
  */
 public function addProcessSupervisorDynaform($sProcessUID, $sDynUID, $sPudPosition)
 {
     $oTypeDynaform = \DynaformPeer::retrieveByPK($sDynUID);
     if (is_null( $oTypeDynaform )) {
         throw new \Exception(\G::LoadTranslation("ID_DOES NOT_DYNAFORM", array($sDynUID)));
     }
     $aResp = array();
     $sPuUIDT = array();
     $sDelimiter = \DBAdapter::getStringDelimiter();
     $oCriteria = new \Criteria('workflow');
     $oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
     $oCriteria->addAsColumn('DYN_TITLE', 'C.CON_VALUE');
     $oCriteria->addAlias('C', 'CONTENT');
     $aConditions = array();
     $aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \DynaformPeer::DYN_UID );
     $aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'DYNAFORM' . $sDelimiter );
     $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
     $aConditions = array();
     $aConditions[] = array(\DynaformPeer::DYN_UID, 'C.CON_ID' );
     $aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DYN_TITLE' . $sDelimiter );
     $aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
     $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
     $oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
     $oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sDynUID);
     $oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'DYNAFORM');
     $oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
     $oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
     $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     while ($aRow = $oDataset->getRow()) {
         $sPuUIDT = $aRow['STEP_UID'];
         $oDataset->next();
     }
     if (sizeof($sPuUIDT) == 0) {
         $oStepSupervisor = new \StepSupervisor();
         $oStepSupervisor->create(array('PRO_UID' => $sProcessUID,
                                        'STEP_TYPE_OBJ' => "DYNAFORM",
                                        'STEP_UID_OBJ' => $sDynUID,
                                        'STEP_POSITION' => $oStepSupervisor->getNextPosition($sProcessUID, "DYNAFORM")));
         $sDelimiter = \DBAdapter::getStringDelimiter();
         $oCriteria = new \Criteria('workflow');
         $oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID);
         $oCriteria->addSelectColumn(\StepSupervisorPeer::PRO_UID);
         $oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_UID_OBJ);
         $oCriteria->addSelectColumn(\StepSupervisorPeer::STEP_POSITION);
         $oCriteria->addAsColumn('DYN_TITLE', 'C.CON_VALUE');
         $oCriteria->addAlias('C', 'CONTENT');
         $aConditions = array();
         $aConditions[] = array(\StepSupervisorPeer::STEP_UID_OBJ, \DynaformPeer::DYN_UID );
         $aConditions[] = array(\StepSupervisorPeer::STEP_TYPE_OBJ, $sDelimiter . 'DYNAFORM' . $sDelimiter );
         $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
         $aConditions = array();
         $aConditions[] = array(\DynaformPeer::DYN_UID, 'C.CON_ID' );
         $aConditions[] = array('C.CON_CATEGORY', $sDelimiter . 'DYN_TITLE' . $sDelimiter );
         $aConditions[] = array('C.CON_LANG', $sDelimiter . SYS_LANG . $sDelimiter );
         $oCriteria->addJoinMC($aConditions, \Criteria::LEFT_JOIN);
         $oCriteria->add(\StepSupervisorPeer::PRO_UID, $sProcessUID);
         $oCriteria->add(\StepSupervisorPeer::STEP_UID_OBJ, $sDynUID);
         $oCriteria->add(\StepSupervisorPeer::STEP_TYPE_OBJ, 'DYNAFORM');
         $oCriteria->addAscendingOrderByColumn(\StepSupervisorPeer::STEP_POSITION);
         $oDataset = \StepSupervisorPeer::doSelectRS($oCriteria);
         $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         $oDataset->next();
         while ($aRow = $oDataset->getRow()) {
             $aResp = array('pud_uid' => $aRow['STEP_UID'],
                            'pud_position' => $aRow['STEP_POSITION'],
                            'dyn_uid' => $aRow['STEP_UID_OBJ']);
             $oDataset->next();
             $aRespPosition = $this->updateProcessSupervisorDynaform($sProcessUID ,$aRow['STEP_UID'], $sPudPosition);
             $aResp = array_merge(array('dyn_title' => $aRow['DYN_TITLE']), $aRespPosition);
         }
         return $aResp;
     } else {
         throw new \Exception(\G::LoadTranslation("ID_RELATION_EXIST"));
     }
 }
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:84,代码来源:ProcessSupervisor.php

示例11: retrieveByPKs

    /**
     * Retrieve multiple objects by pkey.
     *
     * @param      array $pks List of primary keys
     * @param      Connection $con the connection to use
     * @throws     PropelException Any exceptions caught during processing will be
     *       rethrown wrapped into a PropelException.
     */
    public static function retrieveByPKs($pks, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(self::DATABASE_NAME);
        }

        $objs = null;
        if (empty($pks)) {
            $objs = array();
        } else {
            $criteria = new Criteria();
            $criteria->add(DynaformPeer::DYN_UID, $pks, Criteria::IN);
            $objs = DynaformPeer::doSelect($criteria, $con);
        }
        return $objs;
    }
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:24,代码来源:BaseDynaformPeer.php

示例12: lookingforUidGrids

 /**
  * Get the uids of the grids into a xml form
  *
  * @param      string $sproUid   the uid of the process
  * @param      string $sdbsUid   the uid of the db connection
  * @author krlos <carlos@colosa.com>
  */
 function lookingforUidGrids($sproUid, $sObjUID)
 {
     require_once "classes/model/DynaformPeer.php";
     G::LoadSystem('dynaformhandler');
     $uidsGrids = array();
     $oC = new Criteria('workflow');
     $oC->add(DynaformPeer::DYN_UID, $sObjUID);
     $oC->add(DynaformPeer::PRO_UID, $sproUid);
     $oDataset = DynaformPeer::doSelectRS($oC);
     $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
     $oDataset->next();
     $aRow = $oDataset->getRow();
     if ($aRow['DYN_TYPE'] == 'xmlform') {
         $oC1 = new Criteria('workflow');
         $oC1->add(DynaformPeer::PRO_UID, $sproUid);
         $oC1->add(DynaformPeer::DYN_TYPE, "xmlform");
         $oDataset = DynaformPeer::doSelectRS($oC1);
         $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
         while ($oDataset->next()) {
             $aRow1 = $oDataset->getRow();
             $dynHandler = new dynaFormHandler(PATH_DYNAFORM . $sproUid . "/" . $sObjUID . ".xml");
             $dynFields = $dynHandler->getFields();
             $sxmlgrid = '';
             $sType = '';
             $check = 0;
             foreach ($dynFields as $field) {
                 $sType = $this->getAttribute($field, 'type');
                 if ($sType == 'grid') {
                     $sxmlgrid = $this->getAttribute($field, 'xmlgrid');
                     //print_r($sxmlgrid);print"<hr>";
                     $aGridInfo = explode("/", $sxmlgrid);
                     $uidsGrids[] = $aGridInfo[1];
                 }
             }
         }
         return $uidsGrids;
     }
 }
开发者ID:nshong,项目名称:processmaker,代码行数:45,代码来源:Step.php

示例13: 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

示例14: fromArray

 /**
  * Populates the object using an array.
  *
  * This is particularly useful when populating an object from one of the
  * request arrays (e.g. $_POST).  This method goes through the column
  * names, checking to see whether a matching key exists in populated
  * array. If so the setByName() method is called for that column.
  *
  * You can specify the key type of the array by additionally passing one
  * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  *
  * @param      array  $arr     An array to populate the object from.
  * @param      string $keyType The type of keys the array uses.
  * @return     void
  */
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = DynaformPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setDynUid($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setProUid($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setDynType($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setDynFilename($arr[$keys[3]]);
     }
 }
开发者ID:nshong,项目名称:processmaker,代码行数:32,代码来源:BaseDynaform.php

示例15: getConditionScript

 public function getConditionScript($DYN_UID)
 {
     require_once 'classes/model/Dynaform.php';
     G::LoadSystem('dynaformhandler');
     $oDynaform = DynaformPeer::retrieveByPk($DYN_UID);
     $PRO_UID = $oDynaform->getProUid();
     $this->oDynaformHandler = new dynaFormHandler(PATH_DYNAFORM . "{$PRO_UID}/{$DYN_UID}" . '.xml');
     $aDynaformFields = $this->oDynaformHandler->getFieldNames();
     for ($i = 0; $i < count($aDynaformFields); $i++) {
         $aDynaformFields[$i] = "'{$aDynaformFields[$i]}'";
     }
     $sDynaformFieldsAsStrings = implode(',', $aDynaformFields);
     $aRows = $this->getAllByDynUid($DYN_UID, 'active');
     $sCode = '';
     if (sizeof($aRows) != 0) {
         foreach ($aRows as $aRow) {
             $hashCond = md5($aRow['FCD_UID']);
             $sCondition = $this->parseCondition($aRow['FCD_CONDITION']);
             $sCondition = addslashes($sCondition);
             $sCode .= "function __condition__{$hashCond}() { ";
             $sCode .= "if( eval(\"{$sCondition}\") ) { ";
             $aFields = explode(',', $aRow['FCD_FIELDS']);
             switch ($aRow['FCD_FUNCTION']) {
                 case 'show':
                     foreach ($aFields as $aField) {
                         $sCode .= "showRowById('{$aField}');";
                     }
                     break;
                 case 'showOnly':
                     $sCode .= "hideRowsById(Array({$sDynaformFieldsAsStrings}));";
                     foreach ($aFields as $aField) {
                         $sCode .= "showRowById('{$aField}');";
                     }
                     break;
                 case 'showAll':
                     $sCode .= "showRowsById(Array({$sDynaformFieldsAsStrings}));";
                     break;
                 case 'hide':
                     foreach ($aFields as $aField) {
                         $sCode .= "hideRowById('{$aField}');";
                     }
                     break;
                 case 'hideOnly':
                     $sCode .= "showRowsById(Array({$sDynaformFieldsAsStrings}));";
                     foreach ($aFields as $aField) {
                         $sCode .= "hideRowById('{$aField}');";
                     }
                     break;
                 case 'hideAll':
                     $aDynaFields = array();
                     $aEventOwner = explode(',', $aRow['FCD_EVENT_OWNERS']);
                     foreach ($aDynaformFields as $sDynaformFields) {
                         if (!in_array(str_replace("'", "", $sDynaformFields), $aEventOwner)) {
                             $aDynaFields[] = $sDynaformFields;
                         }
                     }
                     $sDynaformFieldsAsStrings = implode(',', $aDynaFields);
                     $sCode .= "hideRowsById(Array({$sDynaformFieldsAsStrings}));";
                     break;
             }
             $sCode .= "  } ";
             $sCode .= "} ";
             $aFieldOwners = explode(',', $aRow['FCD_EVENT_OWNERS']);
             $aEvents = explode(',', $aRow['FCD_EVENTS']);
             if (in_array('onchange', $aEvents)) {
                 foreach ($aFieldOwners as $aField) {
                     //verify the field type
                     $node = $this->oDynaformHandler->getNode($aField);
                     $nodeType = $node->getAttribute('type');
                     switch ($nodeType) {
                         case 'checkbox':
                             $sJSEvent = 'click';
                             break;
                         case 'text':
                         case 'textarea':
                         case 'currency':
                         case 'percentage':
                             $sJSEvent = 'blur';
                             break;
                         default:
                             $sJSEvent = 'change';
                             break;
                     }
                     $sCode .= "leimnud.event.add(getField('{$aField}'), '{$sJSEvent}', function() {";
                     $sCode .= "  __condition__{$hashCond}(); ";
                     $sCode .= "}.extend(getField('{$aField}')));";
                 }
             }
             if (in_array('onload', $aEvents)) {
                 foreach ($aFieldOwners as $aField) {
                     $sCode .= "  __condition__{$hashCond}(); ";
                 }
             }
         }
         return $sCode;
     } else {
         return null;
     }
 }
开发者ID:bqevin,项目名称:processmaker,代码行数:99,代码来源:FieldCondition.php


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