当前位置: 首页>>代码示例>>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;未经允许,请勿转载。