本文整理汇总了PHP中Vtiger_Block类的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Block类的具体用法?PHP Vtiger_Block怎么用?PHP Vtiger_Block使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vtiger_Block类的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;
$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
示例2: 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
示例3: 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
示例4: 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
示例5: 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
示例6: applyChange
function applyChange()
{
global $adb;
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
global $adb;
$chktbl = $adb->query('select 1 from com_vtiger_workflow_tasktypes limit 1');
if ($chktbl) {
$moduleInstance = Vtiger_Module::getInstance('Potentials');
$block = Vtiger_Block::getInstance('LBL_OPPORTUNITY_INFORMATION', $moduleInstance);
$field = Vtiger_Field::getInstance('forecast_amount', $moduleInstance);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$forecast_field = new Vtiger_Field();
$forecast_field->name = 'forecast_amount';
$forecast_field->label = 'Forecast Amount';
$forecast_field->table = 'vtiger_potential';
$forecast_field->column = 'forecast_amount';
$forecast_field->columntype = 'decimal(25,4)';
$forecast_field->typeofdata = 'N~O';
$forecast_field->uitype = '71';
$forecast_field->masseditable = '0';
$block->addField($forecast_field);
}
$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) {
$this->sendMsg('Workfolw already exists!');
} else {
$workflowManager = new VTWorkflowManager($adb);
$taskManager = new VTTaskManager($adb);
$potentailsWorkFlow = $workflowManager->newWorkFlow("Potentials");
$potentailsWorkFlow->test = '';
$potentailsWorkFlow->description = "Calculate or Update forecast amount";
$potentailsWorkFlow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
$potentailsWorkFlow->defaultworkflow = 1;
$workflowManager->save($potentailsWorkFlow);
$task = $taskManager->createTask('VTUpdateFieldsTask', $potentailsWorkFlow->id);
$task->active = true;
$task->summary = 'update forecast amount';
$task->field_value_mapping = '[{"fieldname":"forecast_amount","valuetype":"expression","value":"amount * probability / 100"}]';
$taskManager->saveTask($task);
}
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
} else {
$this->sendMsgError('This changeset could not be applied because it depends on create_workflow_tasktype which probably has not been applied yet. Apply that changeset and try this one again.');
}
}
$this->finishExecution();
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:55,代码来源:PotentialForecastAmount.php
示例7: initialize
/**
* Initialize this instance
* @param Array
* @param Vtiger_Module Instance of module to which this field belongs
* @param Vtiger_Block Instance of block to which this field belongs
* @access private
*/
function initialize($valuemap, $moduleInstance = false, $blockInstance = false)
{
$this->id = $valuemap['fieldid'];
$this->name = $valuemap['fieldname'];
$this->label = $valuemap['fieldlabel'];
$this->column = $valuemap['columnname'];
$this->table = $valuemap['tablename'];
$this->uitype = $valuemap['uitype'];
$this->typeofdata = $valuemap['typeofdata'];
$this->helpinfo = $valuemap['helpinfo'];
$this->masseditable = $valuemap['masseditable'];
$this->block = $blockInstance ? $blockInstance : Vtiger_Block::getInstance($valuemap['block'], $moduleInstance);
}
开发者ID:sacredwebsite,项目名称:vtigercrm,代码行数:20,代码来源:FieldBasic.php
示例8: 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 = 'Products';
$module = Vtiger_Module::getInstance($modname);
$block = Vtiger_Block::getInstance('LBL_PRICING_INFORMATION', $module);
$field = Vtiger_Field::getInstance('cost_price', $module);
if (!$field) {
$field1 = new Vtiger_Field();
$field1->name = 'cost_price';
$field1->label = 'Cost Price';
$field1->column = 'cost_price';
$field1->columntype = 'DECIMAL(28,6)';
$field1->uitype = 71;
$field1->typeofdata = 'N~O';
$field1->displaytype = 1;
$field1->presence = 0;
$block->addField($field1);
}
$modname = 'Services';
$module = Vtiger_Module::getInstance($modname);
$block = Vtiger_Block::getInstance('LBL_PRICING_INFORMATION', $module);
$field = Vtiger_Field::getInstance('cost_price', $module);
if (!$field) {
$field1 = new Vtiger_Field();
$field1->name = 'cost_price';
$field1->label = 'Cost Price';
$field1->column = 'cost_price';
$field1->columntype = 'DECIMAL(28,6)';
$field1->uitype = 71;
$field1->typeofdata = 'N~O';
$field1->displaytype = 1;
$field1->presence = 0;
$block->addField($field1);
}
}
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
$this->finishExecution();
}
开发者ID:kduqi,项目名称:corebos,代码行数:47,代码来源:addCostPrice.php
示例9: initialize
/**
* Initialize this instance
* @param Array
* @param Vtiger_Module Instance of module to which this field belongs
* @param Vtiger_Block Instance of block to which this field belongs
* @access private
*/
function initialize($valuemap, $moduleInstance = false, $blockInstance = false)
{
$this->id = $valuemap['fieldid'];
$this->name = $valuemap['fieldname'];
$this->label = $valuemap['fieldlabel'];
$this->column = $valuemap['columnname'];
$this->table = $valuemap['tablename'];
$this->uitype = $valuemap['uitype'];
$this->typeofdata = $valuemap['typeofdata'];
$this->helpinfo = $valuemap['helpinfo'];
$this->masseditable = $valuemap['masseditable'];
$this->displaytype = $valuemap['displaytype'];
$this->generatedtype = $valuemap['generatedtype'];
$this->readonly = $valuemap['readonly'];
$this->presence = $valuemap['presence'];
$this->defaultvalue = $valuemap['defaultvalue'];
$this->quickcreate = $valuemap['quickcreate'];
$this->sequence = $valuemap['sequence'];
$this->summaryfield = $valuemap['summaryfield'];
$this->block = $blockInstance ? $blockInstance : Vtiger_Block::getInstance($valuemap['block'], $moduleInstance);
}
开发者ID:gitter-badger,项目名称:openshift-salesplatform,代码行数:28,代码来源:FieldBasic.php
示例10: applyChange
function applyChange()
{
global $adb;
if ($this->hasError()) {
$this->sendError();
}
if ($this->isApplied()) {
$this->sendMsg('Changeset ' . get_class($this) . ' already applied!');
} else {
global $adb;
$vendorsInstance = Vtiger_Module::getInstance('Vendors');
$blockInstance = Vtiger_Block::getInstance('LBL_VENDOR_INFORMATION', $vendorsInstance);
$field = Vtiger_Field::getInstance('assigned_user_id', $vendorsInstance);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'assigned_user_id';
$field->label = 'Assigned To';
$field->table = 'vtiger_crmentity';
$field->column = 'smownerid';
$field->columntype = 'INT(11)';
$field->uitype = 53;
$field->displaytype = 1;
$field->typeofdata = 'V~M';
$field->presence = 2;
$field->quickcreate = 0;
$field->quicksequence = 5;
$blockInstance->addField($field);
// Allow Sharing access and role-based security for Vendors
Vtiger_Access::deleteSharing($vendorsInstance);
Vtiger_Access::initSharing($vendorsInstance);
Vtiger_Access::allowSharing($vendorsInstance);
Vtiger_Access::setDefaultSharing($vendorsInstance);
}
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
}
$this->finishExecution();
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:40,代码来源:makeVendorShareable.php
示例11: 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('ModComments');
$block = Vtiger_Block::getInstance('LBL_OTHER_INFORMATION', $moduleInstance);
$field = Vtiger_Field::getInstance('relatedassignedemail', $moduleInstance);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$modfield = new Vtiger_Field();
$modfield->name = 'relatedassignedemail';
$modfield->label = 'Related Assigned Email';
$modfield->table = $moduleInstance->basetable;
$modfield->column = 'relatedassignedemail';
$modfield->columntype = 'varchar(254)';
$modfield->typeofdata = 'E~O';
$modfield->uitype = '13';
$modfield->displaytype = 2;
// read only
$modfield->masseditable = '0';
$block->addField($modfield);
}
$this->ExecuteQuery('UPDATE vtiger_modcomments
INNER JOIN vtiger_crmentity on crmid=related_to
INNER JOIN vtiger_users on id = smownerid
SET relatedassignedemail = email1');
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
}
$this->finishExecution();
}
开发者ID:casati-dolibarr,项目名称:corebos,代码行数:38,代码来源:modcommentsassignedtoemail.php
示例12: 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('cbMap');
$block = Vtiger_Block::getInstance('LBL_MAP_INFORMATION', $moduleInstance);
$field = Vtiger_Field::getInstance('targetname', $moduleInstance);
if ($field) {
$this->ExecuteQuery('update vtiger_field set presence=2 where fieldid=' . $field->id);
} else {
$field = new Vtiger_Field();
$field->name = 'targetname';
$field->label = 'Target Module';
$field->table = 'vtiger_cbmap';
$field->column = 'targetname';
$field->columntype = 'varchar(200)';
$field->typeofdata = 'V~O';
$field->uitype = '1613';
$field->masseditable = '0';
$field->sequence = 4;
$block->addField($field);
}
$field = Vtiger_Field::getInstance('assigned_user_id', $moduleInstance);
$this->ExecuteQuery('update vtiger_field set sequence=6 where fieldid=' . $field->id);
$field = Vtiger_Field::getInstance('createdtime', $moduleInstance);
$this->ExecuteQuery('update vtiger_field set sequence=7 where fieldid=' . $field->id);
$this->sendMsg('Changeset ' . get_class($this) . ' applied!');
$this->markApplied();
}
$this->finishExecution();
}
开发者ID:kduqi,项目名称:corebos,代码行数:36,代码来源:cbMapTargetModuleField.php
示例13: update_Blocks
/**
* Update Blocks of the module
* @access private
*/
function update_Blocks($modulenode, $moduleInstance)
{
if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
return;
}
foreach ($modulenode->blocks->block as $blocknode) {
$blockInstance = Vtiger_Block::getInstance((string) $blocknode->label, $moduleInstance);
if (!$blockInstance) {
$blockInstance = $this->import_Block($modulenode, $moduleInstance, $blocknode);
} else {
$this->update_Block($modulenode, $moduleInstance, $blocknode, $blockInstance);
}
$this->update_Fields($blocknode, $blockInstance, $moduleInstance);
}
}
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:19,代码来源:PackageUpdate.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;
require_once 'include/events/include.inc';
include_once 'vtlib/Vtiger/Module.php';
if ($event_type == 'module.postinstall') {
// TODO Handle post installation actions
$modAccounts = Vtiger_Module::getInstance('Accounts');
$modContacts = Vtiger_Module::getInstance('Contacts');
$modInvD = Vtiger_Module::getInstance('InventoryDetails');
$modIss = Vtiger_Module::getInstance('Issuecards');
if ($modAccounts) {
$modAccounts->setRelatedList($modIss, 'Issuecards', array('ADD'), 'get_dependents_list');
}
if ($modContacts) {
$modContacts->setRelatedList($modIss, 'Issuecards', array('ADD'), 'get_dependents_list');
}
if ($modInvD) {
$field = Vtiger_Field::getInstance('related_to', $modInvD);
$field->setRelatedModules(array('Issuecards'));
$modIss->setRelatedList($modInvD, 'InventoryDetails', array(''), 'get_dependents_list');
}
//Add Gendoc to Issuecards
if (vtlib_isModuleActive("evvtgendoc")) {
$modIss->addLink('LISTVIEWBASIC', 'Generate Document', "javascript:showgendoctemplates('\$MODULE\$');");
$modIss->addLink('DETAILVIEWWIDGET', 'Generate Document', "module=evvtgendoc&action=evvtgendocAjax&file=DetailViewWidget&formodule=\$MODULE\$&forrecord=\$RECORD\$", 'modules/evvtgendoc/evvtgendoc.gif');
}
$emm = new VTEntityMethodManager($adb);
// Adding EntityMethod for Updating Products data after updating PurchaseOrder
$emm->addEntityMethod("Issuecards", "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
// Creating Workflow for Updating Inventory Stock on Issuecards
$vtWorkFlow = new VTWorkflowManager($adb);
$invWorkFlow = $vtWorkFlow->newWorkFlow("Issuecards");
$invWorkFlow->test = '[{"fieldname":"pslip_no","operation":"does not contain","value":"`!`"}]';
$invWorkFlow->description = "UpdateInventoryProducts On Every Save";
$invWorkFlow->defaultworkflow = 1;
$vtWorkFlow->save($invWorkFlow);
$tm = new VTTaskManager($adb);
$task = $tm->createTask('VTEntityMethodTask', $invWorkFlow->id);
$task->active = true;
$task->methodName = "UpdateInventory";
$task->summary = "Update product stock";
$tm->saveTask($task);
$this->setModuleSeqNumber('configure', $modulename, 'pslip-', '0000001');
} 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') {
// TODO Handle actions after this module is updated.
$modInvD = Vtiger_Module::getInstance('InventoryDetails');
$modIss = Vtiger_Module::getInstance('Issuecards');
//Add subject field to can import and export
$block = Vtiger_Block::getInstance('LBL_ISSUECARDS_INFO', $modIss);
$field = Vtiger_Field::getInstance('subject', $modIss);
if (!$field) {
$field1 = new Vtiger_Field();
$field1->name = 'subject';
$field1->label = 'subject';
$field1->table = 'vtiger_issuecards';
$field1->column = 'subject';
$field1->columntype = 'VARCHAR(100)';
$field1->sequence = 3;
$field1->uitype = 1;
$field1->typeofdata = 'V~O';
$field1->displaytype = 1;
$field1->presence = 0;
$block->addField($field1);
}
if ($modInvD) {
$field = Vtiger_Field::getInstance('related_to', $modInvD);
$field->setRelatedModules(array('Issuecards'));
$modIss->setRelatedList($modInvD, 'InventoryDetails', array(''), 'get_dependents_list');
}
//Add Gendoc to Issuecards
if (vtlib_isModuleActive("evvtgendoc")) {
$modIss->addLink('LISTVIEWBASIC', 'Generate Document', "javascript:showgendoctemplates('\$MODULE\$');");
$modIss->addLink('DETAILVIEWWIDGET', 'Generate Document', "module=evvtgendoc&action=evvtgendocAjax&file=DetailViewWidget&formodule=\$MODULE\$&forrecord=\$RECORD\$", 'modules/evvtgendoc/evvtgendoc.gif');
}
$emm = new VTEntityMethodManager($adb);
// Adding EntityMethod for Updating Products data after updating Issuecards
$emm->addEntityMethod("Issuecards", "UpdateInventory", "include/InventoryHandler.php", "handleInventoryProductRel");
// Creating Workflow for Updating Inventory Stock on Issuecards
$vtWorkFlow = new VTWorkflowManager($adb);
$invWorkFlow = $vtWorkFlow->newWorkFlow("Issuecards");
$invWorkFlow->test = '[{"fieldname":"pslip_no","operation":"does not contain","value":"`!`"}]';
//.........这里部分代码省略.........
开发者ID:tsolucio,项目名称:coreBOSPackingSlip,代码行数:101,代码来源:Issuecards.php
示例15: addFields
public function addFields()
{
global $log, $adb;
$log->debug("Entering YetiForceUpdate::addFields() method ...");
include_once 'vtlib/Vtiger/Module.php';
$columnName = array("tabid", "id", "column", "table", "generatedtype", "uitype", "name", "label", "readonly", "presence", "defaultvalue", "maximumlength", "sequence", "block", "displaytype", "typeofdata", "quickcreate", "quicksequence", "info_type", "masseditable", "helpinfo", "summaryfield", "fieldparams", "columntype", "blocklabel", "setpicklistvalues", "setrelatedmodules");
$OSSMailTemplates = array(array('49', '1739', 'ossmailtemplates_type', 'vtiger_ossmailtemplates', '1', '16', 'ossmailtemplates_type', 'LBL_TYPE', '1', '2', '', '100', '8', '126', '1', 'V~M', '1', NULL, 'BAS', '1', '', '0', '', "varchar(255)", "LBL_OSSMAILTEMPLATES_INFORMATION", array('PLL_MODULE', 'PLL_RECORD'), array()));
$Users = array(array('29', '1740', 'emailoptout', 'vtiger_users', '1', '56', 'emailoptout', 'Approval for email', '1', '0', '', '50', '22', '79', '1', 'V~O', '1', NULL, 'BAS', '1', '', '0', '', "varchar(3)", "LBL_MORE_INFORMATION", array(), array()));
$ProjectMilestone = array(array('41', '1741', 'projectmilestone_priority', 'vtiger_projectmilestone', '1', '15', 'projectmilestone_priority', 'LBL_PRIORITY', '1', '2', '', '100', '10', '101', '1', 'V~O', '1', NULL, 'BAS', '1', '', '0', '', "varchar(255)", "LBL_PROJECT_MILESTONE_INFORMATION", array('PLL_LOW', 'PLL_NORMAL', 'PLL_HIGH'), array()), array('41', '1743', 'projectmilestone_progress', 'vtiger_projectmilestone', '1', '1', 'projectmilestone_progress', 'LBL_PROGRESS', '1', '2', '', '100', '11', '101', '10', 'V~O', '1', NULL, 'BAS', '1', '', '0', '', "varchar(10)", "LBL_PROJECT_MILESTONE_INFORMATION", array(), array()));
$ProjectTask = array(array('42', '1742', 'estimated_work_time', 'vtiger_projecttask', '1', '7', 'estimated_work_time', 'LBL_ESTIMATED_WORK_TIME', '1', '2', '', '100', '9', '105', '1', 'NN~M', '1', 3, 'BAS', '1', '', '0', '', "decimal(8,2)", "LBL_CUSTOM_INFORMATION", array(), array()));
$Contacts = array(array('4', '1744', 'jobtitle', 'vtiger_contactdetails', '1', '1', 'jobtitle', 'Job title', '1', '2', '', '100', '31', '4', '1', 'V~O', '1', NULL, 'BAS', '1', '', '0', '', "varchar(100)", "LBL_CONTACT_INFORMATION", array(), array()), array(4, 1746, 'decision_maker', 'vtiger_contactdetails', 1, '56', 'decision_maker', 'Decision maker', 1, 2, '', 100, 9, 5, 1, 'C~O', 1, NULL, 'BAS', 1, '', 0, '', "tinyint(1)", "LBL_CUSTOM_INFORMATION", array(), array()));
$OSSMailView = array(array('54', '1745', 'date', 'vtiger_ossmailview', '1', '70', 'date', 'Date of receipt', '1', '2', '', '100', '24', '134', '2', 'DT~O', '1', NULL, 'BAS', '1', '', '0', '', "datetime", "LBL_INFORMATION", array(), array()));
$setToCRM = array('OSSMailTemplates' => $OSSMailTemplates, 'Users' => $Users, 'ProjectMilestone' => $ProjectMilestone, 'ProjectTask' => $ProjectTask, 'Contacts' => $Contacts, 'OSSMailView' => $OSSMailView);
$setToCRMAfter = array();
foreach ($setToCRM as $nameModule => $module) {
if (!$module) {
continue;
}
foreach ($module as $key => $fieldValues) {
for ($i = 0; $i < count($fieldValues); $i++) {
$setToCRMAfter[$nameModule][$key][$columnName[$i]] = $fieldValues[$i];
}
}
}
foreach ($setToCRMAfter as $moduleName => $fields) {
foreach ($fields as $field) {
if (self::checkFieldExists($field, $moduleName)) {
continue;
}
$moduleInstance = Vtiger_Module::getInstance($moduleName);
$blockInstance = Vtiger_Block::getInstance($field['blocklabel'], $moduleInstance);
$fieldInstance = new Vtiger_Field();
$fieldInstance->column = $field['column'];
$fieldInstance->name = $field['name'];
$fieldInstance->label = $field['label'];
$fieldInstance->table = $field['table'];
$fieldInstance->uitype = $field['uitype'];
$fieldInstance->typeofdata = $field['typeofdata'];
$fieldInstance->readonly = $field['readonly'];
$fieldInstance->displaytype = $field['displaytype'];
$fieldInstance->masseditable = $field['masseditable'];
$fieldInstance->quickcreate = $field['quickcreate'];
$fieldInstance->columntype = $field['columntype'];
$fieldInstance->presence = $field['presence'];
$fieldInstance->maximumlength = $field['maximumlength'];
$fieldInstance->quicksequence = $field['quicksequence'];
$fieldInstance->info_type = $field['info_type'];
$fieldInstance->helpinfo = $field['helpinfo'];
$fieldInstance->summaryfield = $field['summaryfield'];
$fieldInstance->generatedtype = $field['generatedtype'];
$fieldInstance->defaultvalue = $field['defaultvalue'];
$blockInstance->addField($fieldInstance);
if ($field['setpicklistvalues'] && ($field['uitype'] == 15 || $field['uitype'] == 16 || $field['uitype'] == 33)) {
$fieldInstance->setPicklistValues($field['setpicklistvalues']);
}
if ($field['setrelatedmodules'] && $field['uitype'] == 10) {
$fieldInstance->setRelatedModules($field['setrelatedmodules']);
}
}
}
$result = $adb->query("SHOW TABLES LIKE 'vtiger_ossmailtemplates_type';");
if ($adb->num_rows($result) == 1) {
$adb->pquery("UPDATE `vtiger_ossmailtemplates_type` SET `presence` = ? WHERE `ossmailtemplates_type` = ?;", array(0, 'PLL_MODULE'));
}
}
开发者ID:noclav,项目名称:UpdatePackages,代码行数:65,代码来源:init.php
示例16: update_Blocks
/**
* Update Blocks of the module
* @access private
*/
function update_Blocks($modulenode, $moduleInstance)
{
if (empty($modulenode->blocks) || empty($modulenode->blocks->block)) {
return;
}
foreach ($modulenode->blocks->block as $blocknode) {
$this->listBlocks[] = strval($blocknode->label);
$blockInstance = Vtiger_Block::getInstance((string) $blocknode->label, $moduleInstance);
if (!$blockInstance) {
$blockInstance = $this->import_Block($modulenode, $moduleInstance, $blocknode);
} else {
$this->update_Block($modulenode, $moduleInstance, $blocknode, $blockInstance);
}
$this->update_Fields($blocknode, $blockInstance, $moduleInstance);
}
// Deleting removed blocks
$listBlockBeforeUpdate = Vtiger_Block::getAllForModule($moduleInstance);
foreach ($listBlockBeforeUpdate as $blockInstance) {
if (!in_array($blockInstance->label, $this->listBlocks)) {
$blockInstance->delete();
}
}
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:27,代码来源:PackageUpdate.php
示例17: addFields
function addFields()
{
global $log, $adb;
$columnName = array("tabid", "id", "column", "table", "generatedtype", "uitype", "name", "label", "readonly", "presence", "defaultvalue", "maximumlength", "sequence", "block", "displaytype", "typeofdata", "quickcreate", "quicksequence", "info_type", "masseditable", "helpinfo", "summaryfield", "columntype", "blocklabel", "setpicklistvalues", "setrelatedmodules");
$HelpDesk = array(array('13', '1482', 'pssold_id', 'vtiger_troubletickets', '2', '10', 'pssold_id', 'P&S Sold', '1', '2', '', '100', '25', '25', '1', 'V~O', '1', '', 'BAS', '1', '0', '0', "int(19)", "LBL_TICKET_INFORMATION"), array('13', '1483', 'ordertime', 'vtiger_troubletickets', '2', '7', 'ordertime', 'Czas realizacji', '1', '2', '', '100', '26', '25', '1', 'NN~O', '1', '', 'BAS', '1', '0', '0', "decimal(10,2)", "LBL_TICKET_INFORMATION"));
$Assets = array(array('37', '1484', 'ordertime', 'vtiger_assets', '2', '7', 'ordertime', 'Czas realizacji', '1', '2', '', '100', '7', '192', '1', 'NN~O', '1', '', 'BAS', '1', '0', '0', "decimal(10,2)", "BLOCK_INFORMATION_TIME", array()));
$Contacts = array(array('4', '1503', 'contactstatus', 'vtiger_contactdetails', '2', '15', 'contactstatus', 'Status', '1', '2', '', '100', '29', '4', '1', 'V~O', '1', NULL, 'BAS', '1', '0', '0', "varchar(255)", "LBL_CONTACT_INFORMATION", array('Active', 'Inactive')));
$OSSSoldServices = array(array('58', '1483', 'ordertime', 'vtiger_osssoldservices', '2', '7', 'ordertime', 'Czas realizacji', '1', '2', '', '100', '26', '25', '1', 'NN~O', '1', '', 'BAS', '1', '0', '0', "decimal(10,2)", "LBL_CUSTOM_INFORMATION"));
$setToCRM = array('HelpDesk' => $HelpDesk, 'Assets' => $Assets, 'OSSSoldServices' => $OSSSoldServices, 'Contacts' => $Contacts);
$setToCRMAfter = array();
foreach ($setToCRM as $nameModule => $module) {
if (!$module) {
continue;
}
foreach ($module as $key => $fieldValues) {
for ($i = 0; $i < count($fieldValues); $i++) {
$setToCRMAfter[$nameModule][$key][$columnName[$i]] = $fieldValues[$i];
}
}
}
foreach ($setToCRMAfter as $moduleName => $fields) {
foreach ($fields as $field) {
if ($this->checkFieldExists($field, $moduleName)) {
continue;
}
try {
$moduleInstance = Vtiger_Module::getInstance($moduleName);
$blockInstance = Vtiger_Block::getInstance($field['blocklabel'], $moduleInstance);
$fieldInstance = new Vtiger_Field();
$fieldInstance->column = $field['column'];
$fieldInstance->name = $field['name'];
$fieldInstance->label = $field['label'];
$fieldInstance->table = $field['table'];
$fieldInstance->uitype = $field['uitype'];
$fieldInstance->typeofdata = $field['typeofdata'];
$fieldInstance->readonly = $field['readonly'];
$fieldInstance->displaytype = $field['displaytype'];
$fieldInstance->masseditable = $field['masseditable'];
$fieldInstance->quickcreate = $field['quickcreate'];
$fieldInstance->columntype = $field['columntype'];
$fieldInstance->presence = $field['presence'];
$fieldInstance->maximumlength = $field['maximumlength'];
$fieldInstance->info_type = $field['info_type'];
$fieldInstance->helpinfo = $field['helpinfo'];
$fieldInstance->summaryfield = $field['summaryfield'];
$fieldInstance->generatedtype = $field['generatedtype'];
$fieldInstance->defaultvalue = $field['defaultvalue'];
$blockInstance->addField($fieldInstance);
if ($field['setpicklistvalues'] && ($field['uitype'] == 15 || $field['uitype'] == 16 || $field['uitype'] == 33)) {
$fieldInstance->setPicklistValues($field['setpicklistvalues']);
}
} catch (Exception $e) {
//$e->getMessage()
}
}
}
}
开发者ID:rcrrich,项目名称:UpdatePackages,代码行数:57,代码来源:init.php
-
经常有很多初学者问到在delphi中如何调用SQL Server的存储过程?问题其实很好解决,但
阅读:483|2022-07-18
-
PacktPublishing/Python-Machine-Learning-Second-Edition: Python Machine Learning
阅读:929|2022-08-18
-
There are use-after-free vulnerabilities caused by timer handler in net/rose/ros
阅读:678|2022-07-08
-
armancodv/building-energy-model-matlab: It is a small software which is develope
阅读:1112|2022-08-17
-
win7系统电脑使用过程中有不少朋友表示遇到过win7系统USB驱动器RAM的状况,当出现win7
阅读:834|2022-11-06
-
elipapa/markdown-cv: a simple template to write your CV in a readable markdown f
阅读:484|2022-08-17
-
tboronczyk/localization-middleware: PSR-15 middleware to assist primarily with l
阅读:497|2022-08-16
-
再的笔顺是什么?再的笔顺笔画顺序怎么写?还有再的拼音及意思是什么,好多初学练字者
阅读:510|2022-07-30
-
Call Me Maybe 中英字幕 对于加拿大歌手卡莉·蕾·吉普森很多人有些陌生,她隶属于贾
阅读:574|2022-11-06
-
Delphi xe7 android实现透明度可以调整的对话框 要实现对话框透明度可以调
阅读:1551|2022-07-22
|
请发表评论