[Vtigercrm-commits] [Vtiger development] #8641: Migration bug in 540_to_600RC file
Vtiger development
vtiger-tickets at trac.vtiger.com
Thu Oct 15 08:44:28 GMT 2015
#8641: Migration bug in 540_to_600RC file
-----------------------+------------------------
Reporter: uma | Owner: developer
Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: vtigercrm | Version: 6.2.0
Severity: Medium | Resolution:
Keywords: |
-----------------------+------------------------
Comment (by uma):
'''Hard coded migration change for block-id in the above code should be
replaced with below mentioned code'''
include_once 'vtlib/Vtiger/Module.php';
include_once 'vtlib/Vtiger/Block.php';
$calendarInstance = Vtiger_Module_Model::getInstance('Calendar');
$blockInstance = Vtiger_Block_Model::getInstance(20, $moduleInstance);
$eventInstance = Vtiger_Module_Model::getInstance('Events');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_blocks SET blocklabel
="LBL_DESCRIPTION_INFORMATION" WHERE blockid =
?',array($blockInstance->get('id')));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET displaytype=1
WHERE fieldname="location" AND tabid = ?',
array($calendarInstance->getId()));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET displaytype=1
WHERE fieldname="visibility" AND tabid = ?',
array($eventInstance->getId()));
$reminderBlock = Vtiger_Block_Model::getInstance(40, $eventInstance);
$descriptionBlock = Vtiger_Block_Model::getInstance(41, $eventInstance);
$eventBlockId = getBlockId($eventTabId, 'LBL_EVENT_INFORMATION');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET block = ?
WHERE block = ?', array($eventBlockId, $descriptionBlock->get('id')));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_blocks SET blocklabel =
"LBL_REMINDER_INFORMATION", show_title = 0 WHERE blockid =
?',array($reminderBlock->get('id')));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_blocks SET blocklabel =
"LBL_DESCRIPTION_INFORMATION", show_title = 0 WHERE blockid =
?',array($descriptionBlock->get('id')));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET block = ?
WHERE fieldname = "description" AND tabid =
?',array($descriptionBlock->get('id'), $eventInstance->getId()));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET block = ?
WHERE fieldname = "contact_id" AND tabid = ?', array($eventBlockId,
$eventInstance->getId()));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET displaytype =
3 WHERE fieldname = ? AND tabid = ?', array('notime',
$eventInstance->getId()));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_field SET displaytype =
3 WHERE fieldname = ? AND tabid = ?', array('duration_hours',
$eventInstance->getId()));
--
Ticket URL: <http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/8641#comment:3>
Vtiger development <http://trac.vtiger.com/>
Vtiger CRM
More information about the vtigercrm-commits
mailing list