当前位置: 首页>>代码示例>>PHP>>正文


PHP Openbiz::getService方法代码示例

本文整理汇总了PHP中Openbiz\Openbiz::getService方法的典型用法代码示例。如果您正苦于以下问题:PHP Openbiz::getService方法的具体用法?PHP Openbiz::getService怎么用?PHP Openbiz::getService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Openbiz\Openbiz的用法示例。


在下文中一共展示了Openbiz::getService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insertToParent

 public function insertToParent()
 {
     $recArr = $this->readInputRecord();
     $this->setActiveRecord($recArr);
     if (count($recArr) == 0) {
         return;
     }
     //generate fast_index
     $svcobj = Openbiz::getService("service.chineseService");
     if ($svcobj->isChinese($recArr['first_name'])) {
         $fast_index = $svcobj->Chinese2Pinyin($recArr['first_name']);
     } else {
         $fast_index = $recArr['first_name'];
     }
     $recArr['fast_index'] = substr($fast_index, 0, 1);
     if (!$recArr['company']) {
         $recArr['company'] = 'N/A';
     }
     try {
         $this->ValidateForm();
     } catch (Openbiz\Validation\Exception $e) {
         $this->processFormObjError($e->errors);
         return;
     }
     $recId = $this->_doInsert($recArr);
     $selIds[] = $recId;
     // if no parent elem or picker map, call AddToParent
     if (!$this->parentFormElemName) {
         $this->addToParent($selIds);
     }
     // if has parent elem and picker map, call JoinToParent
     if ($this->parentFormElemName && $this->pickerMap) {
         $this->joinToParent($selIds);
     }
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:35,代码来源:ContactPickerForm.php

示例2: exportCSV

 public function exportCSV()
 {
     $eventlogSvc = Openbiz::getService(OPENBIZ_EVENTLOG_SERVICE);
     $eventlogSvc->exportCSV();
     $this->runEventLog();
     return true;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:7,代码来源:EventLogForm.php

示例3: render

 public function render()
 {
     $sHTML = "";
     if (Openbiz::getService('system.lib.ModuleService')->isModuleInstalled('oauth')) {
         $do = Openbiz::getObject('oauth.do.OauthProviderDO');
         $recArr = $do->directFetch("[status]=1", 30);
         $recArr = $recArr->toArray();
         if ($this->redirectURL) {
             $this->redirectURL = Expression::evaluateExpression($this->redirectURL, $this);
             $url_append .= "redirect_url=" . urlencode($this->redirectURL) . "&";
         }
         if ($this->assocURL) {
             $this->assocURL = Expression::evaluateExpression($this->assocURL, $this);
             $url_append .= "assoc_url=" . urlencode($this->assocURL) . "&";
         }
         if (count($recArr)) {
             $sHTML .= "<span class=\"oauth_bar\" {$style}>";
             foreach ($recArr as $oauthProvider) {
                 $url = OPENBIZ_APP_URL . "/ws.php/oauth/callback/login/type_" . $oauthProvider['type'] . '/';
                 if ($url_append) {
                     $url .= '?' . $url_append;
                 }
                 $sHTML .= "<a id=\"oauth_" . $oauthProvider['type'] . "\" title=\"" . $oauthProvider['type'] . "\"   href=\"{$url}\" style=\"\"></a>";
             }
             $sHTML .= "</span>";
         }
     }
     return $sHTML;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:29,代码来源:OauthLogin.php

示例4: resetPassword

 /**
  * Reset the password
  *
  * @return void
  */
 public function resetPassword()
 {
     $recArr = $this->readInputs();
     $this->setActiveRecord($recArr);
     if (count($recArr) == 0) {
         return;
     }
     try {
         $this->ValidateForm();
         if ($this->ValidateEmail($recArr['username'], $recArr['email'])) {
             //Init user profile for event logging
             $profile = Openbiz::$app->InituserProfile($recArr['username']);
         } else {
             return;
         }
         //generate pass_token
         $token = $this->GenerateToken($profile);
         if ($token) {
             //event log
             $eventlog = Openbiz::getService(OPENBIZ_EVENTLOG_SERVICE);
             $logComment = array($username, $_SERVER['REMOTE_ADDR']);
             $eventlog->log("USER_MANAGEMENT", "MSG_GET_PASSWORD_TOKEN", $logComment);
             //send user email
             $emailObj = Openbiz::getService(CUBI_USER_EMAIL_SERVICE);
             $emailObj->UserResetPassword($token['Id']);
             Openbiz::$app->getSessionContext()->destroy();
             //goto URL
             $this->processPostAction();
         }
     } catch (Openbiz\Validation\Exception $e) {
         $this->processFormObjError($e->errors);
         return;
     }
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:39,代码来源:ForgetPassForm.php

示例5: fetchData

 public function fetchData()
 {
     $result = Openbiz::getService("payment.lib.PaymentService")->getReturnData($_GET['type']);
     $txn_id = $result['txn_id'];
     $verify = Openbiz::getService("payment.lib.PaymentService")->validateNotification($_GET['type'], $txn_id);
     return $result;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:7,代码来源:FinishedForm.php

示例6: ExportCSV

 public function ExportCSV()
 {
     $excelSvc = Openbiz::getService(EXCEL_SERVICE);
     $excelSvc->renderCSV($this->objectName);
     $this->runEventLog();
     return true;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:7,代码来源:LogForm.php

示例7: parseName

 protected function parseName($name)
 {
     $svcobj = Openbiz::getService("service.chineseService");
     if ($svcobj->isChinese($name)) {
         $fast_index = $svcobj->Chinese2Pinyin($name);
     } else {
         $fast_index = $recArr['display_name'];
     }
     $nameArr['fast_index'] = substr($fast_index, 0, 1);
     $nameArr['display_name'] = $name;
     if ($svcobj->isChinese($name)) {
         //chinese name
         switch (mb_strlen($name, 'UTF-8')) {
             case 5:
             case 4:
                 $nameArr['last_name'] = mb_substr($name, 0, 2, 'UTF-8');
                 $nameArr['first_name'] = mb_substr($name, 2, mb_strlen($name, 'UTF-8') - 1, 'UTF-8');
                 break;
             default:
                 $nameArr['last_name'] = mb_substr($name, 0, 1, 'UTF-8');
                 $nameArr['first_name'] = mb_substr($name, 1, mb_strlen($name, 'UTF-8') - 1, 'UTF-8');
                 break;
         }
     } else {
         //english name
         if (preg_match("/(\\S*?)\\s(\\S*)/si", $name, $match)) {
             $nameArr['last_name'] = $match[1];
             $nameArr['first_name'] = $match[2];
         }
     }
     return $nameArr;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:32,代码来源:InitializeProfileForm.php

示例8: _remoteCall

 protected function _remoteCall($method, $params = null)
 {
     $uri = $this->reportServer;
     $cache_id = md5($this->objectName . $uri . $method . serialize($params));
     $cacheSvc = Openbiz::getService(CACHE_SERVICE, 1);
     $cacheSvc->init($this->objectName, $this->cacheLifeTime);
     if (substr($uri, strlen($uri) - 1, 1) != '/') {
         $uri .= '/';
     }
     $uri .= "ws.php/udc/CollectService";
     if ($cacheSvc->test($cache_id) && (int) $this->cacheLifeTime > 0) {
         $resultSetArray = $cacheSvc->load($cache_id);
     } else {
         try {
             $argsJson = urlencode(json_encode($params));
             $query = array("method={$method}", "format=json", "argsJson={$argsJson}");
             $httpClient = new HttpClient('POST');
             foreach ($query as $q) {
                 $httpClient->addQuery($q);
             }
             $headerList = array();
             $out = $httpClient->fetchContents($uri, $headerList);
             $cats = json_decode($out, true);
             $resultSetArray = $cats['data'];
             $cacheSvc->save($resultSetArray, $cache_id);
         } catch (Exception $e) {
             $resultSetArray = array();
         }
     }
     return $resultSetArray;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:31,代码来源:ErrorReportService.php

示例9: insertRecord

 public function insertRecord()
 {
     $recArr = $this->readInputRecord();
     $this->setActiveRecord($recArr);
     if (count($recArr) == 0) {
         return;
     }
     //generate fast_index
     $svcobj = Openbiz::getService("service.chineseService");
     if ($svcobj->isChinese($recArr['first_name'])) {
         $fast_index = $svcobj->Chinese2Pinyin($recArr['first_name']);
     } else {
         $fast_index = $recArr['first_name'];
     }
     $recArr['fast_index'] = substr($fast_index, 0, 1);
     try {
         $this->ValidateForm();
     } catch (Openbiz\Validation\Exception $e) {
         $this->processFormObjError($e->errors);
         return;
     }
     $this->_doInsert($recArr);
     // in case of popup form, close it, then rerender the parent form
     if ($this->parentFormName) {
         $this->close();
         $this->renderParent();
     }
     $this->processPostAction();
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:29,代码来源:ContactFormGrouping.php

示例10: send

 public function send($mobile, $content, $schedule = null)
 {
     $providerInfo = $this->_getProviderInfo();
     $CorpID = $providerInfo['username'];
     $Pwd = $providerInfo['password'];
     if ($schedule == "0000-00-00 00:00:00") {
         $schedule = '';
     } else {
         $schedule = date('YmdHis', strtotime($schedule));
     }
     $mobile_log = $mobile;
     $content_log = $content;
     $mobile = urlencode($mobile);
     $content = urlencode(iconv("UTF-8", "GBK", $content));
     $url = $this->url . "BatchSend?CorpID={$CorpID}&Pwd={$Pwd}&Mobile={$mobile}&Content={$content}&Cell=&SendTime={$schedule}";
     $result = file_get_contents($url);
     preg_match("/\">(.*?)<\\/int/si", $result, $match);
     $result = (int) $match[1];
     if ($result < 0) {
         Openbiz::getService(LOG_SERVICE)->log(LOG_ERR, "SMS", "sendMessage: " . $content . " TCLK:" . $mobile . ':' . $result['msg']);
         return false;
     } else {
         $this->HitMessageCounter();
         $this->_log($mobile_log, $content_log, $schedule);
         return true;
     }
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:27,代码来源:SPtclk.php

示例11: insertRecord

 public function insertRecord()
 {
     $recArr = $this->readInputRecord();
     $this->setActiveRecord($recArr);
     if (count($recArr) == 0) {
         return;
     }
     try {
         $this->ValidateForm();
     } catch (Openbiz\Validation\Exception $e) {
         $this->processFormObjError($e->errors);
         return;
     }
     $repo_uri = $recArr['repository_uri'];
     $svc = Openbiz::getService("market.lib.PackageService");
     $repoInfo = $svc->discoverRepository($repo_uri);
     $recArr['repository_uid'] = $repoInfo['_repo_uid'];
     $recArr['repository_name'] = $repoInfo['_repo_name'];
     $this->_doInsert($recArr);
     // in case of popup form, close it, then rerender the parent form
     if ($this->parentFormName) {
         $this->close();
         $this->renderParent();
     }
     $this->processPostAction();
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:26,代码来源:RepositoryForm.php

示例12: Report

 public function Report()
 {
     //send an email to admin includes error messages;
     $system_uuid = Openbiz::getService("system.lib.CubiService")->getSystemUUID();
     $report = array("system_uuid" => $system_uuid, "error_info" => $this->errors["system"], "server_info" => $_SERVER, "php_version" => phpversion(), "php_extension" => get_loaded_extensions());
     $reportId = Openbiz::getObject("common.lib.ErrorReportService")->report($report);
     $this->notices = array("status" => "REPORTED", "report_id" => $reportId);
     $this->ReRender();
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:9,代码来源:ErrorForm.php

示例13: checkInstalledVersion

 public function checkInstalledVersion()
 {
     $installedVersion = Openbiz::getService("system.lib.ModuleService")->isModuleInstalled("help");
     if (version_compare($installedVersion, "1.1") >= 0) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:9,代码来源:TutorialService.php

示例14: _doCreateUser

 protected function _doCreateUser()
 {
     $recArr = $this->readInputRecord();
     $this->setActiveRecord($recArr);
     if (count($recArr) == 0) {
         return;
     }
     if ($this->_checkDupUsername()) {
         $errorMessage = $this->GetMessage("USERNAME_USED");
         $errors['fld_username'] = $errorMessage;
         $this->processFormObjError($errors);
         return;
     }
     if ($this->_checkDupEmail()) {
         $errorMessage = $this->GetMessage("EMAIL_USED");
         $errors['fld_email'] = $errorMessage;
         $this->processFormObjError($errors);
         return;
     }
     try {
         $this->ValidateForm();
     } catch (Openbiz\Validation\Exception $e) {
         $this->processFormObjError($e->errors);
         return;
     }
     $recArr['create_by'] = "0";
     $recArr['update_by'] = "0";
     $password = Openbiz::$app->getClientProxy()->GetFormInputs("fld_password");
     $recArr['password'] = hash(HASH_ALG, $password);
     $this->_doInsert($recArr);
     //set default user role to member
     $userinfo = $this->getActiveRecord();
     $userRoleObj = Openbiz::getObject('system.do.UserRoleDO');
     foreach (Openbiz::getObject('system.do.RoleDO')->directfetch("[default]='1'") as $roleRec) {
         $roleId = $roleRec['Id'];
         $uesrRoleArr = array("user_id" => $userinfo['Id'], "role_id" => $roleId);
         $userRoleObj->insertRecord($uesrRoleArr);
     }
     //set default group to member
     $userGroupObj = Openbiz::getObject('system.do.UserGroupDO');
     foreach (Openbiz::getObject('system.do.GroupDO')->directfetch("[default]='1'") as $groupRec) {
         $groupId = $groupRec['Id'];
         $uesrGroupArr = array("user_id" => $userinfo['Id'], "group_id" => $groupId);
         $userGroupObj->insertRecord($uesrGroupArr);
     }
     //record event log
     $eventlog = Openbiz::getService(OPENBIZ_EVENTLOG_SERVICE);
     $logComment = array($userinfo['username'], $_SERVER['REMOTE_ADDR']);
     $eventlog->log("USER_MANAGEMENT", "MSG_USER_REGISTERED", $logComment);
     //send user email
     $emailObj = Openbiz::getService(CUBI_USER_EMAIL_SERVICE);
     $emailObj->UserWelcomeEmail($userinfo['Id']);
     //init profile for future use like redirect to my account view
     $profile = Openbiz::$app->InituserProfile($userinfo['username']);
     return $userinfo;
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:56,代码来源:RegisterForm.php

示例15: observe

 public function observe($event)
 {
     $triggerObj = $event->getTarget();
     $triggerEvent = $event->getName();
     $params = $event->getParams();
     // get eventlog service
     $eventLog = Openbiz::getService(OPENBIZ_EVENTLOG_SERVICE);
     // log message
     $eventLog->Log($triggerEvent, "triggered by " . $triggerObj->objectName);
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:10,代码来源:EventLogger.php


注:本文中的Openbiz\Openbiz::getService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。