Example #1
0
 /**
  * Access granted for administrator in case tracker
  *
  * @param $pro_uid
  * @param $status
  * @return bool
  */
 public function permissions($pro_uid, $status)
 {
     $cases = new \Cases();
     $caseTracker = $cases->caseTrackerPermissions($pro_uid);
     switch ($status) {
         case "map":
             $return = $caseTracker['CT_MAP_TYPE'];
             break;
         case "messages":
             $return = $caseTracker['CT_MESSAGE_HISTORY'];
             break;
         case "history":
             $return = $caseTracker['CT_DERIVATION_HISTORY'];
             break;
         case "objects":
             $return = $caseTracker['DYNADOC'];
             break;
         default:
             $return = false;
             break;
     }
     return $return;
 }
Example #2
0
 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");
                 G::SendTemporalMessage('ID_ACCOUNT_DISABLED_CONTACT_ADMIN', "error");
             }