當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Vtiger_Block::__create方法代碼示例

本文整理匯總了PHP中Vtiger_Block::__create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Vtiger_Block::__create方法的具體用法?PHP Vtiger_Block::__create怎麽用?PHP Vtiger_Block::__create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Vtiger_Block的用法示例。


在下文中一共展示了Vtiger_Block::__create方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: addSharingToModules

 public function addSharingToModules()
 {
     global $log, $adb;
     $log->debug("Entering VT620_to_YT::addSharingToModules() method ...");
     $restrictedModules = array('Emails', 'Integration', 'Dashboard', 'ModComments', 'SMSNotifier', 'PBXManager', 'CallHistory', 'LettersIn', 'LettersOut', 'NewOrders', 'PaymentsIn', 'PaymentsOut', 'Services', 'Products');
     $sql = 'SELECT * FROM vtiger_tab WHERE isentitytype = ? AND name NOT IN (' . generateQuestionMarks($restrictedModules) . ')';
     $params = array(1, $restrictedModules);
     $tabresult = $adb->pquery($sql, $params, true);
     for ($i = 0; $i < $adb->num_rows($tabresult); $i++) {
         $tabId = $adb->query_result_raw($tabresult, $i, 'tabid');
         $moduleName = $adb->query_result_raw($tabresult, $i, 'name');
         if (!self::checkBlockExists($moduleName, array('blocklabel' => 'LBL_SHARING_INFORMATION'))) {
             $moduleInstance = Vtiger_Module::getInstance($moduleName);
             $blockInstance = new Vtiger_Block();
             $blockInstance->label = 'LBL_SHARING_INFORMATION';
             $blockInstance->showtitle = 0;
             $blockInstance->visible = 0;
             $blockInstance->increateview = 0;
             $blockInstance->ineditview = 0;
             $blockInstance->indetailview = 0;
             if (in_array($moduleName, array('Contacts', 'HelpDesk', 'Project', 'Potentials', 'Campaigns', 'Accounts'))) {
                 $blockInstance->display_status = 0;
             } else {
                 $blockInstance->display_status = 1;
             }
             $blockInstance->iscustom = 1;
             $blockInstance->__create($moduleInstance);
         }
         if (!self::checkFieldExists(array('name' => 'inheritsharing', 'table' => 'vtiger_crmentity'), $moduleName)) {
             $blockInstance = Vtiger_Block::getInstance('LBL_SHARING_INFORMATION', $moduleInstance);
             $fieldInstance = new Vtiger_Field();
             $fieldInstance->name = 'inheritsharing';
             $fieldInstance->table = 'vtiger_crmentity';
             $fieldInstance->label = 'Copy permissions automatically';
             $fieldInstance->column = 'inheritsharing';
             $fieldInstance->columntype = 'tinyint(1) default 0';
             $fieldInstance->uitype = 56;
             $fieldInstance->typeofdata = 'C~O';
             $fieldInstance->displaytype = 1;
             $blockInstance->addField($fieldInstance);
         }
         if (!self::checkFieldExists(array('name' => 'shownerid', 'table' => 'vtiger_crmentity'), $moduleName)) {
             $blockInstance = Vtiger_Block::getInstance('LBL_SHARING_INFORMATION', $moduleInstance);
             $fieldInstance = new Vtiger_Field();
             $fieldInstance->name = 'shownerid';
             $fieldInstance->table = 'vtiger_crmentity';
             $fieldInstance->label = 'Share with users';
             $fieldInstance->column = 'shownerid';
             $fieldInstance->columntype = "set('1')";
             $fieldInstance->uitype = 120;
             $fieldInstance->typeofdata = 'V~O';
             $fieldInstance->displaytype = 1;
             $blockInstance->addField($fieldInstance);
         }
     }
     $log->debug("Exiting VT620_to_YT::addSharingToModules() method ...");
 }
開發者ID:Bergdahls,項目名稱:YetiForceCRM,代碼行數:57,代碼來源:VT620_to_YT.php


注:本文中的Vtiger_Block::__create方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。