/** * Unpause case * * @param string caseUid : ID of the case. * @param int delIndex : Delegation index of the case. * @param string userUid : The unique ID of the user who will unpause the case. * @return $result will return an object */ public function unpauseCase ($caseUid, $delIndex, $userUid) { $g = new G(); try { $g->sessionVarSave(); $_SESSION["APPLICATION"] = $caseUid; $_SESSION["INDEX"] = $delIndex; $_SESSION["USER_LOGGED"] = $userUid; if (empty( $caseUid )) { $result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " caseUid" ); $g->sessionVarRestore(); return $result; } if (empty( $delIndex )) { $result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " delIndex" ); $g->sessionVarRestore(); return $result; } if (empty( $userUid )) { $result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " userUid" ); $g->sessionVarRestore(); return $result; } $case = new Cases(); $case->unpauseCase( $caseUid, $delIndex, $userUid ); //Response $res = new wsResponse( 0, G::LoadTranslation( "ID_COMMAND_EXECUTED_SUCCESSFULLY" ) ); $result = array ("status_code" => $res->status_code,"message" => $res->message,"timestamp" => $res->timestamp ); $g->sessionVarRestore(); return $result; } catch (Exception $e) { $result = new wsResponse(100, $e->getMessage()); $g->sessionVarRestore(); return $result; } }
$APP_UID = $_POST['APP_UID']; $DEL_INDEX = $_POST['DEL_INDEX']; } elseif (isset($_POST['sApplicationUID']) && isset($_POST['iIndex'])) { $APP_UID = $_POST['sApplicationUID']; $DEL_INDEX = $_POST['iIndex']; } else { $APP_UID = $_SESSION['APPLICATION']; $DEL_INDEX = $_SESSION['INDEX']; } $oCase->pauseCase($APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'], $unpauseDate); break; case 'unpauseCase': $sApplicationUID = isset($_POST['sApplicationUID']) ? $_POST['sApplicationUID'] : $_SESSION['APPLICATION']; $iIndex = isset($_POST['sApplicationUID']) ? $_POST['iIndex'] : $_SESSION['INDEX']; $oCase = new Cases(); $oCase->unpauseCase($sApplicationUID, $iIndex, $_SESSION['USER_LOGGED']); break; case 'deleteCase': $oCase = new Cases(); $sApplicationUID = isset($_POST['sApplicationUID']) ? $_POST['sApplicationUID'] : $_SESSION['APPLICATION']; $oCase->removeCase($sApplicationUID); break; case 'view_reassignCase': G::LoadClass('groups'); G::LoadClass('tasks'); $oTasks = new Tasks(); $aAux = $oTasks->getGroupsOfTask($_SESSION['TASK'], 1); $row = array(); $groups = new Groups(); foreach ($aAux as $aGroup) { $aUsers = $groups->getUsersOfGroup($aGroup['GRP_UID']);
public function unpauseCase() { try { $applicationUID = isset($_POST['APP_UID']) ? $_POST['APP_UID'] : $_SESSION['APPLICATION']; $delIndex = isset($_POST['DEL_INDEX']) ? $_POST['DEL_INDEX'] : $_SESSION['INDEX']; $oCase = new Cases(); $oCase->unpauseCase($applicationUID, $delIndex, $_SESSION['USER_LOGGED']); $app = new Application(); $caseData = $app->load($applicationUID); $data['APP_NUMBER'] = $caseData['APP_NUMBER']; $result->success = true; $result->msg = G::LoadTranslation('ID_CASE_UNPAUSED_SUCCESSFULLY', SYS_LANG, $data); } catch (Exception $e) { $result->success = false; $result->msg = $e->getMessage(); } print G::json_encode($result); }