Exemplo n.º 1
0
 function gw_set_incoming_action()
 {
     $kodeord = 'BBB';
     require_once 'SmsService.php';
     $options = array();
     $options['soap_version'] = SOAP_1_1;
     $options['location'] = $this->sms_param['service_url'];
     $options['uri'] = "http://soa01a.srv.bergenkom.no/biz/bk/sms/SmsService-v1";
     $options['trace'] = 1;
     $options['proxy_host'] = $this->sms_param['proxy_host'];
     $options['proxy_port'] = $this->sms_param['proxy_port'];
     $options['encoding'] = 'iso-8859-1';
     //'UTF-8';
     $options['login'] = $this->sms_param['login'];
     $options['password'] = $this->sms_param['password'];
     $service = new SmsService($this->sms_param['wsdl'], $options);
     $UserContext = new UserContext();
     $UserContext->userid = $GLOBALS['phpgw_info']['user']['account_lid'];
     $UserContext->appid = 'Portico';
     $getNyeInnkommendeMeldinger = new getNyeInnkommendeMeldinger();
     $getNyeInnkommendeMeldinger->userContext = $UserContext;
     $getNyeInnkommendeMeldinger->kodeord = $kodeord;
     $ReturnValue = $service->getNyeInnkommendeMeldinger($getNyeInnkommendeMeldinger);
     $response = array();
     if (isset($ReturnValue->return)) {
         $_response = $ReturnValue->return;
         if (is_array($_response)) {
             $response = $_response;
         } else {
             $response[] = $_response;
         }
     }
     $datetime_format = phpgwapi_db::datetime_format();
     foreach ($response as $entry) {
         $sms_datetime = date($datetime_format, time());
         // should not be calculated
         $message = trim(ltrim($entry->tekst, $entry->kodeord));
         $array_target_code = explode(' ', $message);
         $target_code = strtoupper(trim($array_target_code[0]));
         $message = $array_target_code[1];
         for ($i = 2; $i < count($array_target_code); $i++) {
             $message .= " {$array_target_code[$i]}";
         }
         $this->setsmsincomingaction($sms_datetime, $entry->tlfavsender, $target_code, $message);
     }
     return $ReturnValue;
 }
Exemplo n.º 2
0
 public function __construct($session = false)
 {
     $this->acl_location = '.demo_location';
     $this->currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
     $this->so = CreateObject('demo.sodemo', $this->acl_location);
     $this->custom = createObject('phpgwapi.custom_fields');
     if ($session) {
         $this->read_sessiondata();
         $this->use_session = true;
     }
     $this->start = phpgw::get_var('start', 'int', 'REQUEST', 0);
     $this->query = phpgw::get_var('query');
     $this->sort = phpgw::get_var('sort');
     $this->order = phpgw::get_var('order');
     $this->filter = phpgw::get_var('filter');
     $this->cat_id = phpgw::get_var('cat_id', 'int');
     $this->allrows = phpgw::get_var('allrows', 'bool');
     $this->dateformat = phpgwapi_db::date_format();
     $this->datetimeformat = phpgwapi_db::datetime_format();
 }
 /**
  * Constructor
  *
  * @param string $appname the name of the module using the custom fields
  *
  * @return void
  */
 public function __construct($appname = null)
 {
     $this->_appname = $appname;
     if (is_null($this->_appname)) {
         $this->_appname =& $GLOBALS['phpgw_info']['flags']['currentapp'];
     }
     $this->_db =& $GLOBALS['phpgw']->db;
     $this->_join =& $this->_db->join;
     $this->_like =& $this->_db->like;
     $this->_dateformat = phpgwapi_db::date_format();
     $this->_datetimeformat = phpgwapi_db::datetime_format();
     $this->_db->Halt_On_Error = 'yes';
     $this->datatype_text = array('V' => lang('Varchar'), 'I' => lang('Integer'), 'C' => lang('char'), 'N' => lang('Float'), 'D' => lang('Date'), 'DT' => lang('Datetime'), 'T' => lang('Memo'), 'R' => lang('Muliple radio'), 'CH' => lang('Muliple checkbox'), 'LB' => lang('Listbox'), 'AB' => lang('Contact'), 'ABO' => lang('Organisation'), 'VENDOR' => lang('Vendor'), 'email' => lang('Email'), 'link' => lang('Link'), 'pwd' => lang('password'), 'user' => 'phpgw_user', 'event' => lang('event'), 'bolean' => 'Bolean', 'custom1' => lang('Custom listbox'), 'custom2' => lang('Custom lookup'), 'custom3' => lang('Custom autocomplete::integer'));
     $this->_oProc = createObject('phpgwapi.schema_proc', $GLOBALS['phpgw_info']['server']['db_type']);
     $this->_oProc->m_odb =& $this->_db;
 }