Exemplo n.º 1
0
 /**
  * Disable tools for this module
  * @param mixed String or Array with value ['Import', 'Export', 'Merge']
  */
 function disableTools($tools)
 {
     if (is_string($tools)) {
         $tools = array(0 => $tools);
     }
     foreach ($tools as $tool) {
         Vtiger_Access::updateTool($this, $tool, false);
     }
 }
Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_settings_field WHERE name=?', array('EMAILTEMPLATES'));
$tabIdList = array();
$tabIdList[] = getTabid('Invoice');
$tabIdList[] = getTabid('PurchaseOrder');
$query = 'SELECT fieldid FROM vtiger_field WHERE (fieldname=? or fieldname=? or fieldname=? ) AND tabid IN (' . generateQuestionMarks($tabIdList) . ')';
$result = $adb->pquery($query, array('received', 'paid', 'balance', $tabIdList));
$numrows = $adb->num_rows($result);
for ($i = 0; $i < $numrows; $i++) {
    $fieldid = $adb->query_result($result, $i, 'fieldid');
    $query = 'Update vtiger_profile2field set readonly = 0 where fieldid=?';
    Migration_Index_View::ExecuteQuery($query, array($fieldid));
}
$actions = array('Import', 'Export');
$moduleInstance = Vtiger_Module::getInstance('Calendar');
foreach ($actions as $actionName) {
    Vtiger_Access::updateTool($moduleInstance, $actionName, true, '');
}
//Update leads salutation value of none to empty value
Migration_Index_View::ExecuteQuery("UPDATE vtiger_leaddetails SET salutation='' WHERE salutation = ?", array('--None--'));
//Update contacts salutation value of none to empty value
Migration_Index_View::ExecuteQuery("UPDATE vtiger_contactdetails SET salutation='' WHERE salutation = ?", array('--None--'));
// END 2013-06-25
// Start 2013-09-24
Migration_Index_View::ExecuteQuery('UPDATE vtiger_eventhandlers SET handler_path = ? WHERE handler_class = ?', array('modules/Vtiger/handlers/RecordLabelUpdater.php', 'Vtiger_RecordLabelUpdater_Handler'));
$inventoryModules = array('Invoice', 'Quotes', 'PurchaseOrder', 'SalesOrder');
foreach ($inventoryModules as $key => $moduleName) {
    $moduleInstance = Vtiger_Module::getInstance($moduleName);
    $focus = CRMEntity::getInstance($moduleName);
    $blockInstance = Vtiger_Block::getInstance('LBL_ITEM_DETAILS', $moduleInstance);
    $field = new Vtiger_Field();
    $field->name = 'hdnS_H_Percent';