• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Vtiger_Module类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Vtiger_Module的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Module类的具体用法?PHP Vtiger_Module怎么用?PHP Vtiger_Module使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $modname = 'SalesOrder';
         $module = Vtiger_Module::getInstance($modname);
         $field = Vtiger_Field::getInstance('recurring_frequency', $module);
         if ($field) {
             $field->setPicklistValues(array('2years', '3years', '4years', '5years'));
             $this->ExecuteQuery("UPDATE vtiger_recurring_frequency SET sortorderid=7 WHERE recurring_frequency='2years'");
             $this->ExecuteQuery("UPDATE vtiger_recurring_frequency SET sortorderid=8 WHERE recurring_frequency='3years'");
             $this->ExecuteQuery("UPDATE vtiger_recurring_frequency SET sortorderid=9 WHERE recurring_frequency='4years'");
             $this->ExecuteQuery("UPDATE vtiger_recurring_frequency SET sortorderid=10 WHERE recurring_frequency='5years'");
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:kduqi,项目名称:corebos,代码行数:25,代码来源:addRecurringSO.php


示例2: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         $moduleInstance = Vtiger_Module::getInstance('Users');
         $block = Vtiger_Block::getInstance('LBL_MORE_INFORMATION', $moduleInstance);
         $field = Vtiger_Field::getInstance('send_email_to_sender', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
         } else {
             $user_field = new Vtiger_Field();
             $user_field->name = 'send_email_to_sender';
             $user_field->label = 'LBL_SEND_EMAIL_TO_SENDER';
             $user_field->table = 'vtiger_users';
             $user_field->column = 'send_email_to_sender';
             $user_field->columntype = 'varchar(3)';
             $user_field->typeofdata = 'C~O';
             $user_field->uitype = '56';
             $user_field->masseditable = '0';
             $block->addField($user_field);
             $this->ExecuteQuery("update vtiger_users set send_email_to_sender='1'");
             RecalculateSharingRules();
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:33,代码来源:UserSendEmailToSender.php


示例3: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type
  */
 function vtlib_handler($moduleName, $eventType)
 {
     $adb = PearDatabase::getInstance();
     if ($eventType == 'module.postinstall') {
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = CRMEntity::getInstance('HolidaysEntitlement');
         $moduleInstance->setModuleSeqNumber("configure", 'HolidaysEntitlement', 'HE', '1');
         $adb->pquery('UPDATE vtiger_tab SET customized=0 WHERE name=?', array('HolidaysEntitlement'));
         $moduleInstance = Vtiger_Module::getInstance('HolidaysEntitlement');
         $targetModule = Vtiger_Module::getInstance('OSSEmployees');
         $targetModule->setRelatedList($moduleInstance, 'HolidaysEntitlement', array('ADD'), 'get_dependents_list');
     } else {
         if ($eventType == 'module.disabled') {
             // TODO Handle actions before this module is being uninstalled.
         } else {
             if ($eventType == 'module.preuninstall') {
                 // TODO Handle actions when this module is about to be deleted.
             } else {
                 if ($eventType == 'module.preupdate') {
                     // TODO Handle actions before this module is updated.
                 } else {
                     if ($eventType == 'module.postupdate') {
                         // TODO Handle actions after this module is updated.
                     }
                 }
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:34,代码来源:HolidaysEntitlement.php


示例4: vtlib_handler

 function vtlib_handler($modulename, $event_type)
 {
     if ($event_type == 'module.postinstall') {
     } else {
         if ($event_type == 'module.disabled') {
             $moduleInstance = Vtiger_Module::getInstance($modulename);
             $moduleInstance->deleteLink('HEADERSCRIPT', 'Chat', 'layouts/vlayout/modules/AJAXChat/Chat.js');
             // TODO Handle actions when this module is disabled.
             return;
         } else {
             if ($event_type == 'module.enabled') {
                 $moduleInstance = Vtiger_Module::getInstance($modulename);
                 $moduleInstance->addLink('HEADERSCRIPT', 'Chat', 'layouts/vlayout/modules/AJAXChat/Chat.js');
                 // TODO Handle actions when this module is enabled.
                 return;
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                     return;
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                         return;
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:YetiForceCRM,代码行数:32,代码来源:AJAXChat.php


示例5: applyChange

 function applyChange()
 {
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset assignto_mailscanner already applied!');
     } else {
         $mod_hd = Vtiger_Module::getInstance('HelpDesk');
         $block_hd = Vtiger_Block::getInstance('LBL_TICKET_INFORMATION', $mod_hd);
         $field1 = new Vtiger_Field();
         $field1->name = 'from_mailscanner';
         $field1->label = 'From mailscanner';
         $field1->column = 'from_mailscanner';
         $field1->columntype = 'VARCHAR(3)';
         $field1->sequence = 1;
         $field1->uitype = 56;
         $field1->typeofdata = 'C~O';
         $field1->displaytype = 3;
         $field1->presence = 0;
         $field1->readonly = 1;
         $block_hd->addField($field1);
         $this->ExecuteQuery('ALTER TABLE vtiger_mailscanner_rules ADD assign_to INT(11)');
         $this->sendMsg('Changeset assignto_mailscanner applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:28,代码来源:assignto_mailscanner.php


示例6: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         $moduleInstance = Vtiger_Module::getInstance('Users');
         $block = Vtiger_Block::getInstance('LBL_USER_ADV_OPTIONS', $moduleInstance);
         $field = Vtiger_Field::getInstance('failed_login_attempts', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
         } else {
             $user_field = new Vtiger_Field();
             $user_field->name = 'failed_login_attempts';
             $user_field->label = 'LBL_FAILED_LOGIN_ATTEMPTS';
             $user_field->table = 'vtiger_users';
             $user_field->column = 'failed_login_attempts';
             $user_field->columntype = 'int(11)';
             $user_field->typeofdata = 'I~O';
             $user_field->uitype = '7';
             $user_field->masseditable = '0';
             $block->addField($user_field);
             $this->ExecuteQuery('update vtiger_users set failed_login_attempts=0');
             RecalculateSharingRules();
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:kduqi,项目名称:corebos,代码行数:33,代码来源:UserFailedLoginAttempts.php


示例7: process

 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $buttonsReturn = false;
     $mode = $request->get('mode');
     $formodule = $request->get('formodule');
     $recordModel = Vtiger_Module_Model::getCleanInstance('OSSPdf');
     if ($mode == 'create_buttons') {
         $recordModel->add_links($formodule);
         $buttonsReturn = true;
     }
     if ($mode == 'delete_buttons') {
         $modCommentsModule = Vtiger_Module::getInstance($formodule);
         $modCommentsModule->deleteLink('LISTVIEWSIDEBARWIDGET', 'Pdf');
         $modCommentsModule->deleteLink('DETAILVIEWSIDEBARWIDGET', 'Pdf');
         $modCommentsModule->deleteLink('DETAILVIEWBASIC', 'LBL_QUICK_GENERATE_MAIL');
         // do ewentualnej poprawy
         $modCommentsModule->deleteLink('DETAILVIEWBASIC', 'Generate default PDF');
         $buttonsReturn = true;
     }
     if ($buttonsReturn === false) {
         $result = array('success' => false, 'message' => vtranslate('Error', $moduleName));
     } else {
         $result = array('success' => true, 'message' => 'Ok');
     }
     $response = new Vtiger_Response();
     $response->setResult($result);
     $response->emit();
 }
开发者ID:yozhi,项目名称:YetiForceCRM,代码行数:29,代码来源:ButtonsSettings.php


示例8: applyChange

 function applyChange()
 {
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $moduleInstance = Vtiger_Module::getInstance('GlobalVariable');
         // change uitype and label
         $field = Vtiger_Field::getInstance('module_list', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery("update vtiger_field set uitype=3313,fieldlabel='Module List' where fieldid=" . $field->id);
         }
         // convert all existing records to new format
         $gvrs = $adb->pquery('select globalvariableid,module_list from vtiger_globalvariable', array());
         $updsql = 'update vtiger_globalvariable set module_list=? where globalvariableid=?';
         while ($gv = $adb->fetch_array($gvrs)) {
             if (trim($gv['module_list']) != '') {
                 $ml = array_map('trim', explode(',', $gv['module_list']));
                 $ml = implode(' |##| ', $ml);
                 $this->ExecuteQuery($updsql, array($ml, $gv['globalvariableid']));
             }
         }
         // fix incorrect entiyidentifier
         $updsql = "UPDATE `vtiger_entityname` SET \n\t\t\t\t`fieldname`='globalno',\n\t\t\t\t`entityidfield`='globalvariableid',\n\t\t\t\t`entityidcolumn`='globalvariableid'\n\t\t\t\tWHERE `modulename`='GlobalVariable' and `tablename`='vtiger_globalvariable'";
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:32,代码来源:GlobalVarUITypeModuleListFixEntityID.php


示例9: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $moduleInstance = Vtiger_Module::getInstance('Users');
         $block = Vtiger_Block::getInstance('LBL_CALENDAR_SETTINGS', $moduleInstance);
         if (!$block) {
             $block = new Vtiger_Block();
             $block->label = 'LBL_CALENDAR_SETTINGS';
             $block->sequence = 2;
             $moduleInstance->addBlock($block);
         }
         $this->ExecuteQuery("delete from vtiger_picklist where name='hour_format'");
         $this->ExecuteQuery("delete from vtiger_picklist where name='start_hour'");
         $field = Vtiger_Field::getInstance('hour_format', $moduleInstance);
         $this->ExecuteQuery('update vtiger_field set presence=2,uitype=16 where fieldid=' . $field->id);
         $field->setPicklistValues(array('am/pm', '12', '24'));
         $start_hour = Vtiger_Field::getInstance('start_hour', $moduleInstance);
         $this->ExecuteQuery('update vtiger_field set presence=2,uitype=16 where fieldid=' . $start_hour->id);
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:30,代码来源:UserHourStartFieldsPL16.php


示例10: undoChange

 function undoChange()
 {
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         // undo your magic here
         $moduleInstance = Vtiger_Module::getInstance('Potentials');
         $field = Vtiger_Field::getInstance('forecast_amount', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery('update vtiger_field set presence=1 where fieldid=' . $field->id);
         }
         global $adb;
         $wfrs = $adb->query("SELECT workflow_id FROM com_vtiger_workflows WHERE summary='Calculate or Update forecast amount'");
         if ($wfrs and $adb->num_rows($wfrs) == 1) {
             $wfid = $adb->query_result($wfrs, 0, 0);
             $this->deleteWorkflow($wfid);
             $this->sendMsg('Workflow deleted!');
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' undone!');
         $this->markUndone();
     } else {
         $this->sendMsg('Changeset ' . get_class($this) . ' not applied!');
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:26,代码来源:PotentialForecastAmount.php


示例11: updateUserModuleStep3

 public function updateUserModuleStep3(Vtiger_Request $request)
 {
     $importModuleName = $request->get('module_import_name');
     $uploadFile = $request->get('module_import_file');
     $uploadDir = Settings_ModuleManager_Extension_Model::getUploadDirectory();
     $uploadFileName = "{$uploadDir}/{$uploadFile}";
     checkFileAccess($uploadFileName);
     $importType = $request->get('module_import_type');
     if (strtolower($importType) == 'language') {
         $package = new Vtiger_Language();
     } else {
         $package = new Vtiger_Package();
     }
     if (strtolower($importType) == 'language') {
         $package->import($uploadFileName);
     } else {
         $package->update(Vtiger_Module::getInstance($importModuleName), $uploadFileName);
     }
     checkFileAccessForDeletion($uploadFileName);
     unlink($uploadFileName);
     $result = array('success' => true, 'importModuleName' => $importModuleName);
     $response = new Vtiger_Response();
     $response->setResult($result);
     $response->emit();
 }
开发者ID:cin-system,项目名称:cinrepo,代码行数:25,代码来源:Basic.php


示例12: undoChange

 function undoChange()
 {
     if ($this->isBlocked()) {
         return true;
     }
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isSystemUpdate()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' is a system update, it cannot be undone!');
     } else {
         if ($this->isApplied()) {
             // undo your magic here
             $modname = 'Vendors';
             $module = Vtiger_Module::getInstance($modname);
             $ctModule = Vtiger_Module::getInstance('Contacts');
             $module->unsetRelatedList($ctModule, $modname, 'get_vendors');
             $this->sendMsg('Changeset ' . get_class($this) . ' undone!');
             $this->markUndone();
         } else {
             $this->sendMsg('Changeset ' . get_class($this) . ' not applied!');
         }
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:25,代码来源:addvendorrelatedlist2contact.php


示例13: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         $moduleInstance = Vtiger_Module::getInstance('Products');
         $field = Vtiger_Field::getInstance('discontinued', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery("update vtiger_field set defaultvalue='1' where fieldid=" . $field->id);
         }
         $moduleInstance = Vtiger_Module::getInstance('Services');
         $field = Vtiger_Field::getInstance('discontinued', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery("update vtiger_field set defaultvalue='1' where fieldid=" . $field->id);
         }
         $moduleInstance = Vtiger_Module::getInstance('PriceBooks');
         $field = Vtiger_Field::getInstance('active', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery("update vtiger_field set defaultvalue='1' where fieldid=" . $field->id);
         }
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:29,代码来源:PdoSrvPBActiveDefaultValue.php


示例14: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($modulename, $event_type)
 {
     global $adb;
     if ($event_type == 'module.postinstall') {
         $ModuleInstance = CRMEntity::getInstance($modulename);
         $ModuleInstance->setModuleSeqNumber("configure", $modulename, 'UO', '1');
         include_once 'vtlib/Vtiger/Module.php';
         $moduleInstance = Vtiger_Module::getInstance($modulename);
         $docelowy_Module = Vtiger_Module::getInstance('Accounts');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Leads');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
         $docelowy_Module = Vtiger_Module::getInstance('Potentials');
         $docelowy_Module->setRelatedList($moduleInstance, 'OSSOutsourcedServices', array('ADD'), 'get_dependents_list');
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:40,代码来源:OSSOutsourcedServices.php


示例15: applyChange

 function applyChange()
 {
     global $adb;
     if ($this->hasError()) {
         $this->sendError();
     }
     if ($this->isApplied()) {
         $this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
     } else {
         global $adb;
         $moduleInstance = Vtiger_Module::getInstance('Users');
         $block = Vtiger_Block::getInstance('LBL_CALENDAR_SETTINGS', $moduleInstance);
         if (!$block) {
             $block = new Vtiger_Block();
             $block->label = 'LBL_CALENDAR_SETTINGS';
             $block->sequence = 2;
             $moduleInstance->addBlock($block);
         }
         $this->ExecuteQuery('drop table if exists vtiger_hour_format');
         $this->ExecuteQuery('drop table if exists vtiger_start_hour');
         $field = Vtiger_Field::getInstance('hour_format', $moduleInstance);
         if ($field) {
             $this->ExecuteQuery('update vtiger_field set presence=2,uitype=16 where fieldid=' . $field->id);
         } else {
             $field = new Vtiger_Field();
             $field->name = 'hour_format';
             $field->label = 'Calendar Hour Format';
             $field->table = 'vtiger_users';
             $field->column = 'hour_format';
             $field->columntype = 'varchar(4)';
             $field->typeofdata = 'V~O';
             $field->uitype = '16';
             $field->masseditable = '0';
             $block->addField($field);
         }
         $field->setPicklistValues(array('12', '24'));
         $start_hour = Vtiger_Field::getInstance('start_hour', $moduleInstance);
         if ($start_hour) {
             $this->ExecuteQuery('update vtiger_field set presence=2,uitype=16 where fieldid=' . $start_hour->id);
         } else {
             $start_hour = new Vtiger_Field();
             $start_hour->name = 'start_hour';
             $start_hour->label = 'Day starts at';
             $start_hour->table = 'vtiger_users';
             $start_hour->column = 'start_hour';
             $start_hour->columntype = 'varchar(5)';
             $start_hour->typeofdata = 'V~O';
             $start_hour->uitype = '16';
             $start_hour->masseditable = '0';
             $block->addField($start_hour);
         }
         $start_hour->setPicklistValues(array('00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00', '22:00', '23:00'));
         $this->sendMsg('Changeset ' . get_class($this) . ' applied!');
         $this->markApplied();
     }
     $this->finishExecution();
 }
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:57,代码来源:UserHourStartFieldsList.php


示例16: vtlib_handler

 /**
  * Invoked when special actions are performed on the module.
  * @param String Module name
  * @param String Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
  */
 function vtlib_handler($module_name, $event_type)
 {
     //require_once('include/utils/utils.php');
     global $adb;
     $module = Vtiger_Module::getInstance($module_name);
     if ($event_type == 'module.postinstall') {
         //************* Set access right for all profiles ***********************//
         //Don't display module name in menu
         $adb->pquery("UPDATE vtiger_profile2tab SET permissions=? WHERE tabid=?", array(1, $module->id));
         //Don't allow action on the module
         $adb->pquery("UPDATE vtiger_profile2standardpermissions SET permissions=? WHERE tabid=?", array(1, $module->id));
         //Add link to the module in the Setting Panel
         $fieldid = $adb->getUniqueID('vtiger_settings_field');
         $blockid = getSettingsBlockId('LBL_MODULE_MANAGER');
         $seq_res = $adb->query("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid =1");
         $seq = 1;
         if ($adb->num_rows($seq_res) > 0) {
             $cur_seq = $adb->query_result($seq_res, 0, 'max_seq');
             if ($cur_seq != null) {
                 $seq = $cur_seq + 1;
             }
         }
         $adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence,active) VALUES (?,?,?,?,?,?,?,?)', array($fieldid, 3, $module_name, 'layouts/vlayout/modules/Settings/' . $module_name . '/assets/images/' . $module_name . '.png', 'LBL_' . strtoupper($module_name) . '_DESCRIPTION', 'index.php?module=' . $module_name . '&view=Index&parent=Settings', $seq, 0));
     } else {
         if ($event_type == 'module.disabled') {
             // TODO Handle actions when this module is disabled.
         } else {
             if ($event_type == 'module.enabled') {
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($event_type == 'module.preuninstall') {
                     $adb->pquery('DELETE FROM vtiger_settings_field WHERE name = ?', array($module_name));
                 } else {
                     if ($event_type == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($event_type == 'module.postupdate') {
                             $query = "SELECT * FROM vtiger_settings_field WHERE name = ?";
                             $result = $adb->pquery($query, array($module_name));
                             if ($adb->num_rows($result) == 0) {
                                 $seq_res = $adb->query("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid =1");
                                 $seq = 1;
                                 if ($adb->num_rows($seq_res) > 0) {
                                     $cur_seq = $adb->query_result($seq_res, 0, 'max_seq');
                                     if ($cur_seq != null) {
                                         $seq = $cur_seq + 1;
                                     }
                                 }
                                 $adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence,active) VALUES (?,?,?,?,?,?,?,?)', array($fieldid, 3, $module_name, 'layouts/vlayout/modules/Settings/' . $module_name . '/assets/images/' . $module_name . '.png', 'LBL_' . strtoupper($module_name) . '_DESCRIPTION', 'index.php?module=' . $module_name . '&view=Index&parent=Settings', $seq, 0));
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:jmangarret,项目名称:vtigercrm,代码行数:62,代码来源:ModuleDesigner.php


示例17: vtlib_handler

 function vtlib_handler($moduleName, $eventType)
 {
     $registerLink = false;
     $adb = PearDatabase::getInstance();
     if ($eventType == 'module.postinstall') {
         $this->turn_on($moduleName);
         $adb->query("UPDATE vtiger_tab SET customized=0 WHERE name='OSSMailScanner'");
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('folders', 'Received'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('folders', 'Sent'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('folders', 'Spam'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('folders', 'Trash'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('folders', 'All'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter) VALUES (?,?)", array('emailsearch', 'fields'));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('cron', 'email', ''));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('cron', 'time', ''));
         $adb->pquery("INSERT INTO vtiger_ossmailscanner_config (conf_type,parameter,value) VALUES (?,?,?)", array('emailsearch', 'change_ticket_status', 'false'));
         $moduleModel = Settings_Picklist_Module_Model::getInstance('HelpDesk');
         $fieldModel = Settings_Picklist_Field_Model::getInstance('ticketstatus', $moduleModel);
         $id = $moduleModel->addPickListValues($fieldModel, 'Answered');
         $Module = Vtiger_Module::getInstance($moduleName);
         $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
         $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_InstallModule', $moduleName . ' ' . $Module->version, $user_id), false);
     } else {
         if ($eventType == 'module.disabled') {
             $this->turn_off($moduleName);
             $adb->pquery('UPDATE vtiger_cron_task SET status=0 WHERE module=?', array('OSSMailScanner'));
             $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
             $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_DisabledModule', $moduleName, $user_id), false);
             // TODO Handle actions when this module is disabled.
         } else {
             if ($eventType == 'module.enabled') {
                 $adb->pquery('UPDATE vtiger_cron_task SET status=1 WHERE module=?', array('OSSMailScanner'));
                 $this->turn_on($moduleName);
                 $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
                 $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_EnabledModule', $moduleName, $user_id), false);
                 // TODO Handle actions when this module is enabled.
             } else {
                 if ($eventType == 'module.preuninstall') {
                     // TODO Handle actions when this module is about to be deleted.
                 } else {
                     if ($eventType == 'module.preupdate') {
                         // TODO Handle actions before this module is updated.
                     } else {
                         if ($eventType == 'module.postupdate') {
                             $adb = PearDatabase::getInstance();
                             $Module = Vtiger_Module::getInstance($moduleName);
                             if (version_compare($Module->version, '1.21', '>')) {
                                 $user_id = Users_Record_Model::getCurrentUserModel()->get('user_name');
                                 $adb->pquery("INSERT INTO vtiger_ossmails_logs (`action`, `info`, `user`) VALUES (?, ?, ?);", array('Action_UpdateModule', $moduleName . ' ' . $Module->version, $user_id), false);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:57,代码来源:OSSMailScanner.php


示例18: initialize

 /**
  * Initialize this block instance
  * @param Array Map of column name and value
  * @param Vtiger_Module Instance of module to which this block is associated
  * @access private
  */
 function initialize($valuemap, $moduleInstance = false)
 {
     $this->id = $valuemap[blockid];
     $this->label = $valuemap[blocklabel];
     $this->display_status = $valuemap[display_status];
     $this->sequence = $valuemap[sequence];
     $this->iscustom = $valuemap[iscustom];
     $this->module = $moduleInstance ? $moduleInstance : Vtiger_Module::getInstance($valuemap[tabid]);
 }
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:15,代码来源:Block.php


示例19: AddHeaderLink

 public function AddHeaderLink()
 {
     $adb = PearDatabase::getInstance();
     $sql = "DELETE FROM vtiger_links WHERE linktype = 'HEADERSCRIPT' AND (linklabel = 'SwVtTools')";
     $result = $adb->query($sql);
     $moduleModel = Vtiger_Module_Model::getInstance("SwVtTools");
     require_once 'vtlib/Vtiger/Module.php';
     $link_module = Vtiger_Module::getInstance("SwVtTools");
     $link_module->addLink('HEADERSCRIPT', 'SwVtTools', "modules/SwVtTools/resources/frontend.js?v1=" . $moduleModel->version, "", "1");
 }
开发者ID:Neodracir,项目名称:VtigerCRM-Tools,代码行数:10,代码来源:SwVtTools.php


示例20: addHeaderLink

	public function addHeaderLink() {
		$adb = PearDatabase::getInstance();
        $moduleModel = Vtiger_Module_Model::getInstance('SWDuplicateFilter');

		$sql = "DELETE FROM vtiger_links WHERE linktype = 'HEADERSCRIPT' AND linklabel = 'SWDuplicateFilterJS'";
		$result = $adb->pquery($sql);
		
		require_once('vtlib/Vtiger/Module.php');
		$link_module = Vtiger_Module::getInstance("SWDuplicateFilter");
		$link_module->addLink('HEADERSCRIPT','SWDuplicateFilterJS',"modules/SWDuplicateFilter/resources/frontend.js?v=".$moduleModel->version."&", "", "1");
	}
开发者ID:Wasage,项目名称:werpa,代码行数:11,代码来源:SWDuplicateFilter.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Vtiger_Module_Model类代码示例发布时间:2022-05-23
下一篇:
PHP Vtiger_Loader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap