本文整理汇总了PHP中BizSystem::getObject方法的典型用法代码示例。如果您正苦于以下问题:PHP BizSystem::getObject方法的具体用法?PHP BizSystem::getObject怎么用?PHP BizSystem::getObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizSystem
的用法示例。
在下文中一共展示了BizSystem::getObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postLoadingModule
public function postLoadingModule($moduelLoader)
{
$roleRec = BizSystem::getObject("system.do.RoleDO")->fetchOne("[name]='Collaboration Admin'");
$adminRoleId = $roleRec['Id'];
$roleRec = BizSystem::getObject("system.do.RoleDO")->fetchOne("[name]='Data Manager'");
$managerRoleId = $roleRec['Id'];
$roleRec = BizSystem::getObject("system.do.RoleDO")->fetchOne("[name]='Data Assigner'");
$assignerRoleId = $roleRec['Id'];
//set up acls for Data assigner
$actionList = BizSystem::getObject("system.do.AclActionDO")->directfetch("[module]='common' AND [resource]='data_assign'");
foreach ($actionList as $actionRec) {
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $assignerRoleId, "action_id" => $actionId, "access_level" => 1);
BizSystem::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
$aclRecord = array("role_id" => $managerRoleId, "action_id" => $actionId, "access_level" => 1);
BizSystem::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
//set up acls for Data manager
$actionList = BizSystem::getObject("system.do.AclActionDO")->directfetch("[module]='common' AND [resource]='data_manage'");
foreach ($actionList as $actionRec) {
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $managerRoleId, "action_id" => $actionId, "access_level" => 1);
BizSystem::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
//delete data manage permission from admin
$actionRec = BizSystem::getObject("system.do.AclActionDO")->fetchOne("[module]='common' AND [resource]='data_manage' AND [action]='manage'");
$actionId = $actionRec['Id'];
BizSystem::getObject("system.do.AclRoleActionDO", 1)->deleteRecords("[role_id]='{$adminRoleId}' AND [action_id]='{$actionId}'");
}
示例2: render
/**
* Render the chart output
*
* @param string $objName object name which is the bizform name
* @return void
*/
public function render($objName)
{
// get the value of the control that issues the call
$chartName = BizSystem::clientProxy()->getFormInputs("__this");
// get the current UI bizobj
$formObj = BizSystem::getObject($objName);
// get the existing bizform object
$bizDataObj = $formObj->getDataObj();
// get chart config xml file
$chartXmlFile = BizSystem::GetXmlFileWithPath($objName . "_chart");
$xmlArr = BizSystem::getXmlArray($chartXmlFile);
ob_clean();
// get the chart section from config xml file
foreach ($xmlArr["BIZFORM_CHART"]["CHARTLIST"]["CHART"] as $chart) {
if (count($xmlArr["BIZFORM_CHART"]["CHARTLIST"]["CHART"]) == 1) {
$chart = $xmlArr["BIZFORM_CHART"]["CHARTLIST"]["CHART"];
}
// try to match the chartName, if no chartName given, always draw the first chart defined in xml file
if ($chartName && $chart["ATTRIBUTES"]["NAME"] == $chartName || !$chartName) {
if ($chart["ATTRIBUTES"]["GRAPHTYPE"] == 'XY') {
$this->xyGraphRender($bizDataObj, $chart);
break;
}
if ($chart["ATTRIBUTES"]["GRAPHTYPE"] == 'Pie') {
$this->pieGraphRender($bizDataObj, $chart);
break;
}
}
}
}
示例3: putChildren
public function putChildren($resource, $id, $childresource, $request, $response)
{
$roleId = $id;
$reqArray = json_decode($request->getBody());
$dataObj = BizSystem::getObject("system.do.AclRoleActionDO");
// get actionIds and accessLevels from request
foreach ($reqArray as $reqRecord) {
$actionId = $reqRecord->Id;
$accessLevel = $reqRecord->access_level;
// if find the record, update it, or insert a new one
try {
$rs = $dataObj->directFetch("[role_id]={$roleId} AND [action_id]={$actionId}", 1);
if (count($rs) == 1) {
if ($rs[0]['access_level'] != $accessLevel) {
// update
$recArr = $rs[0];
$recArr['access_level'] = $accessLevel;
$dataObj->updateRecord($recArr, $rs[0]);
}
} else {
// insert
if ($accessLevel !== null && $accessLevel !== "") {
$recArr = array("role_id" => $roleId, "action_id" => $actionId, "access_level" => $accessLevel);
$dataObj->insertRecord($recArr);
}
}
} catch (BDOException $e) {
$response->status(400);
$response->body($e->getMessage());
}
}
$response->body("Successfully update role access levels.");
}
示例4: getSystemUserData
public function getSystemUserData($sendContact = 1)
{
//sendContact = 0 ; don't send contact info
//sendContact = 1 ; send contact info
$contactRec = array();
if ($sendContact) {
$profileId = BizSystem::getUserProfile("profile_Id");
$recArr = BizSystem::getObject("contact.do.ContactDO")->fetchById($profileId);
$contactRec['name'] = $recArr['display_name'];
$contactRec['company'] = $recArr['company'];
$contactRec['email'] = $recArr['email'];
$contactRec['mobile'] = $recArr['mobile'];
$contactRec['phone'] = $recArr['phone'];
}
$system_uuid = $this->getSystemUUID();
$system_name = DEFAULT_SYSTEM_NAME;
$system_language = DEFAULT_LANGUAGE;
$system_url = SITE_URL;
$system_cubi_ver = $this->getVersion();
$system_openbiz_ver = BizSystem::getVersion();
$system_port = $_SERVER['SERVER_PORT'];
$system_admin = $_SERVER['SERVER_ADMIN'];
$internal_ip_address = $_SERVER['SERVER_ADDR'];
if (function_exists("ioncube_server_data")) {
$server_data = ioncube_server_data();
} else {
$server_data = "";
}
$systemRec = array("internal_ipaddr" => $internal_ip_address, "language" => $system_language, "system_name" => $system_name, "system_uuid" => $system_uuid, "system_url" => $system_url, "system_admin" => $system_admin, "system_port" => $system_port, "system_cubi_ver" => $system_cubi_ver, "system_openbiz_ver" => $system_openbiz_ver, "system_server_data" => $server_data);
$params = array("contact_data" => $contactRec, "system_data" => $systemRec);
return $params;
}
示例5: getDefaultLangName
public function getDefaultLangName($lang = null)
{
if ($lang == null) {
$do = BizSystem::getObject("myaccount.do.PreferenceDO", 1);
$rec = $do->fetchOne("[user_id]='0' AND [name]='language'");
if ($rec) {
$lang = $rec['value'];
} else {
$lang = DEFAULT_LANGUAGE;
}
}
$current_locale = I18n::getCurrentLangCode();
require_once 'Zend/Locale.php';
$locale = new Zend_Locale($current_locale);
$display_name = Zend_Locale::getTranslation($lang, 'language', $locale);
if ($display_name) {
return $display_name;
} else {
if ($lang) {
return $lang;
} else {
return DEFAULT_LANGUAGE;
}
}
}
示例6: render
/**
* Draw the element according to the mode
*
* @return string HTML text
*/
public function render()
{
if (!$this->m_FormReference) {
return null;
}
$formObj = $this->getFormObj();
$formElementObj = BizSystem::GetObject($this->m_FormReference);
$formElementObj->m_ParentFormName = $formObj->m_Name;
$formElementObj->m_ParentFormElementMeta = $this->m_XMLMeta;
$formElementObj->m_CanUpdateRecord = $formObj->m_CanUpdateRecord;
if (method_exists($formObj, "SetSubForms")) {
$formObj->setSubForms($this->m_FormReference);
if ($formObj->m_DataObjName) {
$formDataObj = BizSystem::getObject($formObj->m_DataObjName);
$dataObj = $formDataObj->getRefObject($formElementObj->m_DataObjName);
}
if ($dataObj) {
$formObj->setDataObj($dataObj);
}
}
$sHTML = $formElementObj->render();
$formObj->setDataObj($formDataObj);
$this->FormRecordCount();
if (strlen($sHTML)) {
$this->m_Hidden = "N";
} else {
$this->m_Hidden = "Y";
}
return $sHTML;
}
示例7: fetchDataSet
public function fetchDataSet()
{
$roleId = $this->GetRoleId();
// fetch acl_action records
$do = BizSystem::getObject("system.do.AclActionDO");
$do->setLimit($this->m_Range, ($this->m_CurrentPage - 1) * $this->m_Range);
$rs = $do->fetch();
$this->m_TotalRecords = $do->count();
if ($this->m_Range && $this->m_Range > 0) {
$this->m_TotalPages = ceil($this->m_TotalRecords / $this->m_Range);
}
// fetch role and access
$this->getDataObj()->setSearchRule("[role_id]={$roleId}");
$rs1 = $this->getDataObj()->fetch();
foreach ($rs1 as $rec) {
$actionRoleAccess[$rec['action_id']] = $rec;
}
//print_r($actionRoleAccess);
// merge 2 rs
for ($i = 0; $i < count($rs); $i++) {
$actionId = $rs[$i]['Id'];
$rs[$i]['access_level'] = "";
if (isset($actionRoleAccess[$actionId])) {
$rs[$i]['access_level'] = $actionRoleAccess[$actionId]['access_level'];
}
}
return $rs;
}
示例8: searchSipTrace
public function searchSipTrace($id = null)
{
include_once OPENBIZ_BIN . "/easy/SearchHelper.php";
$searchRule = "";
foreach ($this->m_DataPanel as $element) {
if (!$element->m_FieldName) {
continue;
}
$value = BizSystem::clientProxy()->getFormInputs($element->m_Name);
if ($element->m_FuzzySearch == "Y") {
$value = "*{$value}*";
}
if ($value) {
$searchStr = inputValToRule($element->m_FieldName, $value, $this);
if ($searchRule == "") {
$searchRule .= $searchStr;
} else {
$searchRule .= " AND " . $searchStr;
}
}
}
$searchRuleBindValues = QueryStringParam::getBindValues();
$listFormObj = BizSystem::getObject($this->localListForm);
$listFormObj->setSearchRule($searchRule, $searchRuleBindValues);
$listFormObj->rerender();
}
示例9: GetDefaultRoleID
public function GetDefaultRoleID()
{
$roleRec = BizSystem::getObject("system.do.RoleDO")->fetchOne("[default]='1'", "[Id] DESC");
if ($roleRec) {
$Id = $roleRec['Id'];
}
return (int) $Id;
}
示例10: postLoadingModule
public function postLoadingModule($moduelLoader)
{
$roleRec = BizSystem::getObject("system.do.RoleDO")->fetchOne("[name]='Cubi Member'");
$roleId = $roleRec['Id'];
$actionRec = BizSystem::getObject("system.do.AclActionDO")->fetchOne("[module]='user' AND [resource]='UserAccount' AND [action]='Edit_Own_Account'");
$actionId = $actionRec["Id"];
$aclRecord = array("role_id" => $roleId, "action_id" => $actionId, "access_level" => 1);
BizSystem::getObject("system.do.AclRoleActionDO")->insertRecord($aclRecord);
}
示例11: Report
public function Report()
{
//send an email to admin includes error messages;
$system_uuid = BizSystem::getService("system.lib.CubiService")->getSystemUUID();
$report = array("system_uuid" => $system_uuid, "error_info" => $this->m_Errors["system"], "server_info" => $_SERVER, "php_version" => phpversion(), "php_extension" => get_loaded_extensions());
$reportId = BizSystem::getObject("common.lib.ErrorReportService")->report($report);
$this->m_Notices = array("status" => "REPORTED", "report_id" => $reportId);
$this->ReRender();
}
示例12: _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 (ValidationException $e) {
$this->processFormObjError($e->m_Errors);
return;
}
$recArr['create_by'] = "0";
$recArr['update_by'] = "0";
$password = BizSystem::ClientProxy()->GetFormInputs("fld_password");
$recArr['password'] = hash(HASH_ALG, $password);
$this->_doInsert($recArr);
//set default user role to member
$userinfo = $this->getActiveRecord();
$userRoleObj = BizSystem::getObject('system.do.UserRoleDO');
foreach (BizSystem::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 = BizSystem::getObject('system.do.UserGroupDO');
foreach (BizSystem::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
global $g_BizSystem;
$eventlog = BizSystem::getService(EVENTLOG_SERVICE);
$logComment = array($userinfo['username'], $_SERVER['REMOTE_ADDR']);
$eventlog->log("USER_MANAGEMENT", "MSG_USER_REGISTERED", $logComment);
//send user email
$emailObj = BizSystem::getService(USER_EMAIL_SERVICE);
$emailObj->UserWelcomeEmail($userinfo['Id']);
//init profile for future use like redirect to my account view
$profile = $g_BizSystem->InituserProfile($userinfo['username']);
return $userinfo;
}
示例13: isModuleInstalled
public function isModuleInstalled($module)
{
$do = BizSystem::getObject($this->m_ModuleDO);
$modRec = $do->fetchOne("[name]='{$module}'");
if ($modRec) {
return $modRec['version'];
} else {
return false;
}
}
示例14: loadDialog
public function loadDialog($formName = null, $id = null)
{
$formObj1 = BizSystem::getObject($formName);
$formObj1->setRecordId($id);
//$formObj1->setParentForm($this->formObj->m_Name);
$output = $formObj1->render();
if (!empty($output)) {
BizSystem::clientProxy()->redrawForm("DIALOG", $output);
}
}
示例15: renderSmarty
/**
* Render smarty template for view object
*
* @param EasyView $viewObj
* @param string $tplFile
* @return string result of rendering process
*/
protected static function renderSmarty($viewObj, $tplFile)
{
$smarty = BizSystem::getSmartyTemplate();
$newClntObjs = '';
// render the viewobj attributes
$smarty->assign("view", $viewObj->outputAttrs());
$smarty->assign("module", $viewObj->getModuleName($viewObj->m_Name));
if ($viewObj->m_Tiles) {
foreach ($viewObj->m_Tiles as $tname => $tile) {
foreach ($tile as $formRef) {
if ($formRef->m_Display == false) {
continue;
}
$tiles[$tname][$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
$tiletabs[$tname][$formRef->m_Name] = $formRef->m_Description;
}
}
} else {
foreach ($viewObj->m_FormRefs as $formRef) {
if ($formRef->m_Display == false) {
continue;
}
$forms[$formRef->m_Name] = BizSystem::getObject($formRef->m_Name)->render();
$formtabs[$formRef->m_Name] = $formRef->m_Description;
}
}
// add clientProxy scripts
$includedScripts = BizSystem::clientProxy()->getAppendedScripts();
$styles = BizSystem::clientProxy()->getAppendedStyles();
if ($viewObj->m_IsPopup && $bReRender == false) {
$moveToCenter = "moveToCenter(self, " . $viewObj->m_Width . ", " . $viewObj->m_Height . ");";
$scripts = $includedScripts . "\n<script>\n" . $newClntObjs . $moveToCenter . "</script>\n";
} else {
$scripts = $includedScripts . "\n<script>\n" . $newClntObjs . "</script>\n";
}
if ($viewObj->m_Title) {
$title = Expression::evaluateExpression($viewObj->m_Title, $viewObj);
} else {
$title = $viewObj->m_Description;
}
$smarty->assign("scripts", $scripts);
$smarty->assign("style_sheets", $styles);
$smarty->assign("title", $title);
$smarty->assign("description", $viewObj->m_Description);
$smarty->assign("keywords", $viewObj->m_Keywords);
$smarty->assign("forms", $forms);
$smarty->assign("formtabs", $formtabs);
$smarty->assign("tiles", $tiles);
$smarty->assign("tiletabs", $tiletabs);
if ($viewObj->m_ConsoleOutput) {
$smarty->display(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
} else {
return $smarty->fetch(BizSystem::getTplFileWithPath($viewObj->m_TemplateFile, $viewObj->m_Package));
}
}