Ejemplo n.º 1
0
 protected function getRequestId()
 {
     if (isset($this->params['REQID'])) {
         $this->setReqID($this->params['REQID']);
         return $this->params['REQID'];
     }
     if (isset($this->params['MSG_TYPE']) && $this->params['MSG_TYPE'] == "Request") {
         if ($this->previousCheckExists()) {
             $this->params['AUTO_CHECK'] = 0;
         } else {
             $this->params['MSG_TYPE'] = "Check";
             $this->params['AUTO_CHECK'] = 1;
         }
     }
     if (isset($this->params['MSG_TYPE']) && $this->params['MSG_TYPE'] == "Check" && Application_Model_General::previousCheck($this->params['PHONE_NUMBER']) || $this->params['MSG_TYPE'] == "Inquire_number" || $this->params['MSG_TYPE'] == "Return" || $this->params['MSG_TYPE'] == "Execute" || $this->params['MSG_TYPE'] == "Publish" || $this->params['MSG_TYPE'] == "Cancel_publish" || $this->params['MSG_TYPE'] == "Up_system" || $this->params['MSG_TYPE'] == "Down_system") {
         $this->params['REQUEST_ID'] = $this->createRequestId();
     } elseif ($this->params['MSG_TYPE'] == "Check" && !Application_Model_General::previousCheck($this->params['PHONE_NUMBER'])) {
         $this->setErrorMsg("the phone number you have submitted is already in process");
         return FALSE;
     } elseif ($this->params['MSG_TYPE'] == "Cancel" && Application_Model_General::previousCheck($this->params['PHONE_NUMBER']) || $this->params['MSG_TYPE'] == "Update" && Application_Model_General::previousCheck($this->params['PHONE_NUMBER'])) {
         $this->setErrorMsg("invalid order of transactions .");
         return FALSE;
     }
     return TRUE;
 }