예제 #1
0
 public function init()
 {
     $this->setMethod('GET');
     $this->setAction('');
     $this->addElement('text', 'request_id', array('label' => 'Request Id'));
     $this->addElement('text', 'phone', array('label' => 'Phone', 'required' => true, 'validators' => array('Alnum', array('regex', false, '/^[a-z]/i'), 'int'), 'filters' => array('StringTrim')));
     $msgTypeOptions = array('label' => 'Stage', 'required' => true, 'multioptions' => array('All' => 'All', 'Check' => 'Check', 'Request' => 'Request', 'Execute' => 'Execute', 'Publish' => 'Publish'));
     $this->addElement('select', 'stage', $msgTypeOptions);
     $this->addElement('text', 'date', array('label' => 'Date (YYYY-MM-DD)', 'required' => true));
     $this->addElement('text', 'time', array('label' => 'Time (HH:MM:SS)', 'required' => true, 'invalidMessage' => 'Invalid date specified.', 'filters' => array('StringTrim')));
     $providers = Application_Model_General::getProviderArray();
     $currentProvider = Application_Model_General::getSettings('InternalProvider');
     if (($key = array_search($currentProvider, $providers)) !== FALSE) {
         unset($providers[$key]);
     }
     array_unshift($providers, 'None', $currentProvider);
     $toOptions = array('label' => 'From provider', 'multioptions' => array_combine($providers, $providers));
     $this->addElement('select', 'from', $toOptions);
     $toOptions['label'] = 'To provider';
     $this->addElement('select', 'to', $toOptions);
     $statusOptions = array('label' => 'Status', 'multioptions' => array(-1 => "All", 1 => "Active", 0 => "Inactive"));
     $this->addElement('select', 'status', $statusOptions);
     // Add the submit button
     $this->addElement('submit', 'submit', array('ignore' => true, 'label' => 'Search', 'class' => 'request-search-button'));
 }
예제 #2
0
파일: Request.php 프로젝트: carriercomm/NPG
 public function init()
 {
     // Set the method for the display form to POST
     $this->setMethod('POST');
     $this->setAction(Application_Model_General::getBaseUrl() . "/monitor/send/");
     $this->setAttrib('class', 'request-form');
     $msgTypeOptions = array('label' => 'Message', 'required' => true, 'multioptions' => array('Check' => 'Check', 'Request' => 'Request', 'Update' => 'Update', 'Cancel' => 'Cancel', 'Inquire_number' => 'Inquire_number', 'Return' => 'Return'));
     $this->addElement('select', 'MSG_TYPE', $msgTypeOptions);
     $numberOptions = array('label' => 'Phone number', 'required' => true, 'validators' => array('Int', array('StringLength', FALSE, array(10, 10))), 'value' => '');
     $this->addElement('text', 'NUMBER', $numberOptions);
     $d = new Zend_Date(null, null, Application_Model_General::getLocale(null, false));
     $dateOptions = array('label' => 'Port Time', 'id' => 'datetimepicker', 'required' => true, 'value' => $d->toString('YYYY-MM-dd HH:mm:ss', Application_Model_General::getLocale(null, false)));
     $this->addElement('text', 'porttime', $dateOptions);
     $providers = Application_Model_General::getProviderArray();
     $currentProvider = Application_Model_General::getSettings('InternalProvider');
     if (($key = array_search($currentProvider, $providers)) !== FALSE) {
         unset($providers[$key]);
     }
     $toOptions = array('label' => 'To', 'multioptions' => array_combine($providers, $providers));
     $this->addElement('select', 'TO', $toOptions);
     $dateTimeLabelOptions = array('label' => 'Date and Time', 'required' => true, 'value' => date('y/m/d:h/i/s'), 'disabled' => 'true');
     $this->addElement('text', 'Date and Time', $dateTimeLabelOptions);
     $submitOptions = array('ignore' => true, 'label' => 'Send');
     $this->addElement('submit', 'submit', $submitOptions);
 }
예제 #3
0
파일: Publish.php 프로젝트: carriercomm/NPG
 /**
  * overridden from np_method
  * 
  * @return mixed string Reject Reason Code or TRUE 
  */
 public function PostValidate()
 {
     $this->setAck($this->validateParams($this->getHeaders()));
     //HOW TO CHECK Gen05
     if (!$this->ValidateDB()) {
         return "Gen07";
     }
     $providers = Application_Model_General::getProviderArray(true);
     if (!in_array($this->getBodyField('DONOR'), $providers)) {
         return 'Pub05';
     }
     if (($timer_ack = Np_Timers::validate($this)) !== TRUE) {
         return $timer_ack;
     }
     return true;
 }
예제 #4
0
파일: Cron.php 프로젝트: carriercomm/NPG
 /**
  * checks if all providers received publish 
  * if not sends again to the ones who didnt.
  * 
  * @param array $request 
  * @return void
  */
 public function checkPublish($request)
 {
     if (!isset($request['forceAll']) || !$request['forceAll']) {
         $problem_providers = Application_Model_General::getProvidersRequestWithoutPublishResponse($request['request_id'], $request['from_provider'], $request['to_provider']);
     } else {
         // if force all - send to all providers except source & destination
         $problem_providers = array_diff(Application_Model_General::getProviderArray(), array($request['from_provider'], $request['to_provider']));
     }
     if ($problem_providers) {
         //problem! - send providers again
         $ret = array();
         foreach ($problem_providers as $provider) {
             $request['provider'] = $provider;
             Application_Model_General::forkProcess("/cron/publish", $request);
             $ret[] = $request;
         }
         return $ret;
     } else {
         // all providers return response - update publish_response
         $req_tbl = new Application_Model_DbTable_Requests(Np_Db::master());
         $req_tbl->update(array('last_transaction' => 'Publish_response', 'status' => 0), 'id=' . $request['id']);
         // @TODO: send to internal!
     }
     return TRUE;
 }