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


PHP Vtiger_Module::initTables方法代碼示例

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


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

示例1:

include_once 'vtlib/Vtiger/Module.php';
$Vtiger_Utils_Log = true;
$MODULENAME = 'Tarifas';
$TABLENAME = 'vtiger_tarifas';
// $moduleInstance = Vtiger_Module::getInstance($MODULENAME);
// if ($moduleInstance || file_exists('modules/'.$MODULENAME)) {
//         echo "Module already present - choose a different name.";
// } else {
/////////////////////////INICIO MODULO///////////////////////////
$moduleInstance = new Vtiger_Module();
$moduleInstance->name = $MODULENAME;
$moduleInstance->parent = 'Sales';
$moduleInstance->save();
// Schema Setup
$moduleInstance->initTables();
$menuInstance = Vtiger_Menu::getInstance('Sales');
$menuInstance->addModule($moduleInstance);
/////////////////////////FIN MODULO///////////////////////////
/////////////////////////INICIO BLOQUE///////////////////////////
// Field Setup
$blockInstance = new Vtiger_Block();
$blockInstance->label = 'LBL_TARIFAS_INFORMATION';
$moduleInstance->addBlock($blockInstance);
$blockInstance2 = new Vtiger_Block();
$blockInstance2->label = 'LBL_CUSTOM_INFORMATION';
$moduleInstance->addBlock($blockInstance2);
/////////////////////////FIN BLOQUE///////////////////////////
/////////////////////////INICIO CAMPOS///////////////////////////
$fieldInstance1 = new Vtiger_Field();
$fieldInstance1->name = 'codigo';
開發者ID:jmangarret,項目名稱:triggersMysql,代碼行數:30,代碼來源:addModuleTarifas.php

示例2: create

	protected function create($moduleInformation) {
		$moduleInformation['entityfieldname']  = strtolower($this->toAlphaNumeric($moduleInformation['entityfieldlabel']));

		$module = new Vtiger_Module();
		$module->name = $moduleInformation['name'];
		$module->parent=$moduleInformation['parent'];
		$module->save();

		$module->initTables();

		$block = new Vtiger_Block();
		$block->label = 'LBL_'. strtoupper($module->name) . '_INFORMATION';
		$module->addBlock($block);

		$blockcf = new Vtiger_Block();
		$blockcf->label = 'LBL_CUSTOM_INFORMATION';
		$module->addBlock($blockcf);

		$field1  = new Vtiger_Field();
		$field1->name = $moduleInformation['entityfieldname'];
		$field1->label= $moduleInformation['entityfieldlabel'];
		$field1->uitype= 2;
		$field1->column = $field1->name;
		$field1->columntype = 'VARCHAR(255)';
		$field1->typeofdata = 'V~M';
		$block->addField($field1);

		$module->setEntityIdentifier($field1);

		/** Common fields that should be in every module, linked to vtiger CRM core table */
		$field2 = new Vtiger_Field();
		$field2->name = 'assigned_user_id';
		$field2->label = 'Assigned To';
		$field2->table = 'vtiger_crmentity';
		$field2->column = 'smownerid';
		$field2->uitype = 53;
		$field2->typeofdata = 'V~M';
		$block->addField($field2);

		$field3 = new Vtiger_Field();
		$field3->name = 'createdtime';
		$field3->label= 'Created Time';
		$field3->table = 'vtiger_crmentity';
		$field3->column = 'createdtime';
		$field3->uitype = 70;
		$field3->typeofdata = 'T~O';
		$field3->displaytype= 2;
		$block->addField($field3);

		$field4 = new Vtiger_Field();
		$field4->name = 'modifiedtime';
		$field4->label= 'Modified Time';
		$field4->table = 'vtiger_crmentity';
		$field4->column = 'modifiedtime';
		$field4->uitype = 70;
		$field4->typeofdata = 'T~O';
		$field4->displaytype= 2;
		$block->addField($field4);

		// Create default custom filter (mandatory)
		$filter1 = new Vtiger_Filter();
		$filter1->name = 'All';
		$filter1->isdefault = true;
		$module->addFilter($filter1);
		// Add fields to the filter created
		$filter1->addField($field1)->addField($field2, 1)->addField($field3, 2);

		// Set sharing access of this module
		$module->setDefaultSharing();

		// Enable and Disable available tools
		$module->enableTools(Array('Import', 'Export', 'Merge'));

		// Initialize Webservice support
		$module->initWebservice();

		// Create files
		$this->createFiles($module, $field1);
	}
開發者ID:Wasage,項目名稱:werpa,代碼行數:79,代碼來源:console.php

示例3: url

// Just a bit of HTML formatting
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">';
echo '<html><head><title>vtlib Module Script</title>';
echo '<style type="text/css">@import url("themes/softed/style.css");br { display: block; margin: 2px; }</style>';
echo '</head><body class=small style="font-size: 12px; margin: 2px; padding: 2px;">';
echo '<a href="index.php"><img src="themes/softed/images/vtiger-crm.gif" alt="vtiger CRM" title="vtiger CRM" border=0></a><hr style="height: 1px">';
// Turn on debugging level
$Vtiger_Utils_Log = true;
include_once 'vtlib/Vtiger/Menu.php';
include_once 'vtlib/Vtiger/Module.php';
// Create module instance and save it first
$module = new Vtiger_Module();
$module->name = 'Deliverynote';
$module->save();
// Initialize all the tables required
$module->initTables();
/**
 * Creates the following table:
 * vtiger_deliverynote  (deliverynoteid INTEGER)
 * vtiger_deliverynotecf(deliverynoteid INTEGER PRIMARY KEY)
 * vtiger_deliverynotegrouprel((deliverynoteid INTEGER PRIMARY KEY, groupname VARCHAR(100))
 */
// Add the module to the Menu (entry point from UI)
$menu = Vtiger_Menu::getInstance('Inventory');
$menu->addModule($module);
// Add the basic module block
$block1 = new Vtiger_Block();
$block1->label = 'LBL_DELIVERY_INFORMATION';
$module->addBlock($block1);
// Add custom block (required to support Custom Fields)
$block2 = new Vtiger_Block();
開發者ID:semdinsp,項目名稱:vtiger-delivery-notes,代碼行數:31,代碼來源:vtlib.Test.Create.Module1.php

示例4:

chdir('..');
$Vtiger_Utils_Log = true;
include_once 'vtlib/Vtiger/Menu.php';
include_once 'vtlib/Vtiger/Module.php';
include_once 'modules/PickList/DependentPickListUtils.php';
include_once 'include/utils/CommonUtils.php';
$module_name = 'Sample';
$table_name = 'vtiger_sample';
$main_name = "titlename";
$main_id = "sampleid";
//module作成
$module = new Vtiger_Module();
$module->name = $module_name;
$module->save();
$module->initTables($table_name, $main_id);
$menu = Vtiger_Menu::getInstance('Tools');
$menu->addModule($module);
// block作成
$blockInstance = new Vtiger_Block();
$blockInstance->label = 'LBL_SAMPLE_INFORMATION';
$module->addBlock($blockInstance);
// field作成
$field = new Vtiger_Field();
$field->name = 'TitleName';
$field->table = 'vtiger_sample';
$field->column = 'titlename';
$field->columntype = 'VARCHAR(255)';
$field->uitype = 1;
$field->typeofdata = 'V~M';
$blockInstance->addField($field);
開發者ID:cin-system,項目名稱:vtigercrm,代碼行數:30,代碼來源:MakeSampleModule.php

示例5: createModule

 public static function createModule($moduleInformation)
 {
     $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));
     $module = new Vtiger_Module();
     $module->name = ucfirst($moduleInformation['module_name']);
     $module->label = $moduleInformation['module_label'];
     $module->type = $moduleInformation['entitytype'];
     $module->save();
     $module->initTables();
     $block = new Vtiger_Block();
     $block->label = 'LBL_' . $module->name . '_INFORMATION';
     $module->addBlock($block);
     $blockcf = new Vtiger_Block();
     $blockcf->label = 'LBL_CUSTOM_INFORMATION';
     $module->addBlock($blockcf);
     $field1 = new Vtiger_Field();
     $field1->name = $moduleInformation['entityfieldname'];
     $field1->label = $moduleInformation['entityfieldlabel'];
     $field1->uitype = 2;
     $field1->column = $field1->name;
     $field1->columntype = 'VARCHAR(255)';
     $field1->typeofdata = 'V~M';
     $block->addField($field1);
     $module->setEntityIdentifier($field1);
     /** Common fields that should be in every module, linked to vtiger CRM core table */
     $field2 = new Vtiger_Field();
     $field2->name = 'number';
     $field2->label = 'Numer';
     $field2->column = 'number';
     $field2->table = $module->basetable;
     $field2->uitype = 4;
     $field2->typeofdata = 'V~O';
     $field2->columntype = 'varchar(32)';
     $block->addField($field2);
     $field3 = new Vtiger_Field();
     $field3->name = 'assigned_user_id';
     $field3->label = 'Assigned To';
     $field3->table = 'vtiger_crmentity';
     $field3->column = 'smownerid';
     $field3->uitype = 53;
     $field3->typeofdata = 'V~M';
     $block->addField($field3);
     $field4 = new Vtiger_Field();
     $field4->name = 'createdtime';
     $field4->label = 'Created Time';
     $field4->table = 'vtiger_crmentity';
     $field4->column = 'createdtime';
     $field4->uitype = 70;
     $field4->typeofdata = 'DT~O';
     $field4->displaytype = 2;
     $block->addField($field4);
     $field5 = new Vtiger_Field();
     $field5->name = 'modifiedtime';
     $field5->label = 'Modified Time';
     $field5->table = 'vtiger_crmentity';
     $field5->column = 'modifiedtime';
     $field5->uitype = 70;
     $field5->typeofdata = 'DT~O';
     $field5->displaytype = 2;
     $block->addField($field5);
     // Create default custom filter (mandatory)
     $filter1 = new Vtiger_Filter();
     $filter1->name = 'All';
     $filter1->isdefault = true;
     $module->addFilter($filter1);
     // Add fields to the filter created
     $filter1->addField($field1)->addField($field2, 1)->addField($field3, 2)->addField($field4, 2);
     // Set sharing access of this module
     $module->setDefaultSharing();
     // Enable and Disable available tools
     $module->enableTools(array('Import', 'Export', 'Merge'));
     // Initialize Webservice support
     $module->initWebservice();
     // Create files
     $module->createFiles($field1);
     $ModuleInstance = CRMEntity::getInstance($module->name);
     $ModuleInstance->setModuleSeqNumber('configure', $module->name, 'N', '1');
 }
開發者ID:rcrrich,項目名稱:YetiForceCRM,代碼行數:78,代碼來源:Module.php


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