Exemplo n.º 1
0
 /**
  * Get Case Tracker data of a Process
  *
  * @param string $processUid Unique id of Process
  *
  * return array Return an array with data of Case Tracker of a Process
  */
 public function getCaseTracker($processUid)
 {
     try {
         $arrayCaseTracker = array();
         //Verify data
         $process = new \ProcessMaker\BusinessModel\Process();
         $process->throwExceptionIfNotExistsProcess($processUid, "prj_uid");
         //Get data
         $criteria = new \Criteria();
         $criteria->add(\CaseTrackerPeer::PRO_UID, $processUid, \Criteria::EQUAL);
         $rsCriteria = \CaseTrackerPeer::doSelectRS($criteria);
         $rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
         if ($rsCriteria->next()) {
             $row = $rsCriteria->getRow();
             $arrayCaseTracker = $row;
         } else {
             $caseTracker = new \CaseTracker();
             $arrayCaseTracker = array("PRO_UID" => $processUid, "CT_MAP_TYPE" => "PROCESSMAP", "CT_DERIVATION_HISTORY" => 1, "CT_MESSAGE_HISTORY" => 1);
             $caseTracker->create($arrayCaseTracker);
         }
         return array("map_type" => $arrayCaseTracker["CT_MAP_TYPE"], "routing_history" => (int) $arrayCaseTracker["CT_DERIVATION_HISTORY"], "message_history" => (int) $arrayCaseTracker["CT_MESSAGE_HISTORY"]);
     } catch (\Exception $e) {
         throw $e;
     }
 }
Exemplo n.º 2
0
    /**

     * Create Case Tracker rows from an array, removing those Trackers with

     * the same UID.

     *

     * @param $CaseTracker array.

     * @return void

     */

    public function createCaseTrackerRows ($CaseTracker)

    {

        if (is_array( $CaseTracker )) {

            foreach ($CaseTracker as $key => $row) {

                $oCaseTracker = new CaseTracker();

                if ($oCaseTracker->caseTrackerExists( $row['PRO_UID'] )) {

                    $oCaseTracker->remove( $row['PRO_UID'] );

                }

                $res = $oCaseTracker->create( $row );

            }

        }

        return;

    }
Exemplo n.º 3
0
 public function ExtcaseTracker($sProcessUID)
 {
     $oCriteria = new Criteria();
     $oCriteria->add(CaseTrackerPeer::PRO_UID, $sProcessUID);
     $oCaseTracker = new CaseTracker();
     if (CaseTrackerPeer::doCount($oCriteria) === 0) {
         $aCaseTracker = array('PRO_UID' => $sProcessUID, 'CT_MAP_TYPE' => 'PROCESSMAP', 'CT_DERIVATION_HISTORY' => 1, 'CT_MESSAGE_HISTORY' => 1);
         $oCaseTracker->create($aCaseTracker);
     } else {
         $aCaseTracker = $oCaseTracker->load($sProcessUID);
     }
     return $aCaseTracker;
     /*global $G_PUBLISH;
       $G_PUBLISH = new Publisher ( );
       $G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_Configuration', '', $aCaseTracker, '../tracker/tracker_Save');
       G::RenderPage('publish', 'raw');
       return true;*/
 }
Exemplo n.º 4
0
 }
 if (is_array($uid)) {
     require_once "classes/model/CaseTracker.php";
     require_once "classes/model/CaseTrackerObject.php";
     $_SESSION['CASE'] = $case;
     $_SESSION['PIN'] = $pin;
     $_SESSION['PROCESS'] = $uid['PRO_UID'];
     $_SESSION['APPLICATION'] = $uid['APP_UID'];
     $_SESSION['TASK'] = -1;
     $_SESSION['INDEX'] = -1;
     $criteria = new Criteria();
     $criteria->add(CaseTrackerPeer::PRO_UID, $_SESSION['PROCESS']);
     $caseTracker = new CaseTracker();
     if (CaseTrackerPeer::doCount($criteria) === 0) {
         $permissionsCaseTracker = array('PRO_UID' => $_SESSION['PROCESS'], 'CT_MAP_TYPE' => 'PROCESSMAP', 'CT_DERIVATION_HISTORY' => 1, 'CT_MESSAGE_HISTORY' => 1);
         $caseTracker->create($permissionsCaseTracker);
     }
     $caseTracker = $cases->caseTrackerPermissions($_SESSION['PROCESS']);
     if ($caseTracker['CT_MAP_TYPE']) {
         G::header('location: tracker_ViewMap');
     } else {
         if ($caseTracker['DYNADOC']) {
             G::header("location: tracker_DynaDocs");
         } else {
             if ($caseTracker['CT_DERIVATION_HISTORY']) {
                 G::header("location: tracker_History");
             } else {
                 if ($caseTracker['CT_MESSAGE_HISTORY']) {
                     G::header("location: tracker_No");
                 } else {
                     G::header("location: login.php");