示例#1
0
    $field->typeofdata = 'V~O';
    $field->readonly = '0';
    $field->displaytype = '5';
    $field->masseditable = '0';
    $field->quickcreate = '0';
    $field->columntype = 'VARCHAR(5)';
    $field->defaultvalue = 0;
    $usersBlockInstance->addField($field);
    echo '<br> Added isOwner field in Users';
}
//Setting up is_owner for every admin user of CRM
$adb = PearDatabase::getInstance();
$idResult = $adb->pquery('SELECT id FROM vtiger_users WHERE is_admin = ? AND status=?', array('on', 'Active'));
if ($adb->num_rows($idResult) > 0) {
    for ($i = 0; $i <= $adb->num_rows($idResult); $i++) {
        $userid = $adb->query_result($idResult, $i, 'id');
        $adb->pquery('UPDATE vtiger_users SET is_owner=? WHERE id=?', array(1, $userid));
        echo '<br>Account Owner Informnation saved in vtiger';
        //Recreate user prvileges
        createUserPrivilegesfile($userId);
        echo '<br>User previleges file recreated aftter adding is_owner field';
    }
} else {
    echo '<br>Account Owner was not existed in this database';
}
//Reports Chart Supported
Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_reporttype(\n                        reportid INT(10),\n                        data text,\n\t\t\t\t\t\tPRIMARY KEY (`reportid`),\n\t\t\t\t\t\tCONSTRAINT `fk_1_vtiger_reporttype` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE)\n                        ENGINE=InnoDB DEFAULT CHARSET=utf8;", array());
//Configuration Editor fix
$sql = "UPDATE vtiger_settings_field SET name = ? WHERE name = ?";
Migration_Index_View::ExecuteQuery($sql, array('LBL_CONFIG_EDITOR', 'Configuration Editor'));
示例#2
0
        if ($appId) {
            $appIds[] = $appId;
        }
    }
}
//$appIds - list of all Calendarsync appids
if (count($appIds)) {
    $sql = 'SELECT id,clientid FROM vtiger_wsapp_recordmapping WHERE appid IN (' . generateQuestionMarks($appIds) . ')';
    $result = Migration_Index_View::ExecuteQuery($sql, $appIds);
    $num_of_rows = $adb->num_rows($result);
    for ($i = 0; $i < $num_of_rows; $i++) {
        $id = $adb->query_result($result, $i, 'id');
        $clientid = $adb->query_result($result, $i, 'clientid');
        $parts = explode('/', $clientid);
        $newClientId = end($parts);
        Migration_Index_View::ExecuteQuery('UPDATE vtiger_wsapp_recordmapping SET clientid = ? WHERE id = ?', array($newClientId, $id));
    }
    echo '<br> vtiger_wsapp_recordmapping clientid migration completed for CalendarSync';
}
//(end)
//Google Calendar sync changes ends here
//Google migration : Create Sync setting table
$sql = 'CREATE TABLE vtiger_google_sync_settings (user int(11) DEFAULT NULL,
    module varchar(50) DEFAULT NULL , clientgroup varchar(255) DEFAULT NULL,
    direction varchar(50) DEFAULT NULL)';
$db->pquery($sql, array());
$sql = 'CREATE TABLE vtiger_google_sync_fieldmapping ( vtiger_field varchar(255) DEFAULT NULL,
        google_field varchar(255) DEFAULT NULL, google_field_type varchar(255) DEFAULT NULL,
        google_custom_label varchar(255) DEFAULT NULL, user int(11) DEFAULT NULL)';
$db->pquery($sql, array());
echo '<br>Google sync setting and mapping table added</br>';
    // New module
    installVtlibModule('SPKladr', 'packages/vtiger/optional/SPKladr.zip');
    // Begin Add new config value
    $file = 'config.inc.php';
    // Delete end php file symbol
    $origContent = file_get_contents($file);
    if (strpos($origContent, 'crm_user_phones') === false) {
        $origContent = str_replace('?>', '', $origContent);
        file_put_contents($file, $origContent);
        // Add new config
        $newContent = "// SalesPlatform.ru begin Additional phones\n\$crm_user_phones = array();\n// SalesPlatform.ru end";
        file_put_contents($file, $newContent, FILE_APPEND | LOCK_EX);
        // End
    }
}
global $adb;
//Unlinking unwanted resources when migrating
$unWanted = array("layouts/vlayout/modules/SPSocialConnector/EnterURL.tpl", "modules/SPSocialConnector/actions/AuthWindow.php", "modules/SPSocialConnector/hybridauth/Hybrid/Providers/MySpace.php", "modules/SPSocialConnector/SPSocialConnectorStatusWidget.php");
for ($i = 0; $i <= count($unWanted); $i++) {
    if (file_exists($unWanted[$i])) {
        unlink($unWanted[$i]);
    }
}
// Begin S002_fix_socialconnector.sql
$query = 'SELECT tabid FROM vtiger_tab where name = ?';
$result = $adb->pquery($query, array('SPSocialConnector'));
$tabid = $adb->query_result($result, 0, 'tabid');
Migration_Index_View::ExecuteQuery('UPDATE vtiger_relatedlists SET actions=? WHERE tabid=? AND label=?', array('', $tabid, 'Accounts'));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_relatedlists SET actions=? WHERE tabid=? AND label=?', array('', $tabid, 'Contacts'));
Migration_Index_View::ExecuteQuery('UPDATE vtiger_relatedlists SET actions=? WHERE tabid=? AND label=?', array('', $tabid, 'Leads'));
// End
    $field->defaultvalue = 0;
    $usersBlockInstance->addField($field);
    echo '<br> Added isOwner field in Users';
}
//Setting up is_owner for every admin user of CRM
$adb = PearDatabase::getInstance();
$idResult = $adb->pquery('SELECT id FROM vtiger_users WHERE is_admin = ? AND status=?', array('on', 'Active'));
if ($adb->num_rows($idResult) > 0) {
    for ($i = 0; $i <= $adb->num_rows($idResult); $i++) {
        $userid = $adb->query_result($idResult, $i, 'id');
        $adb->pquery('UPDATE vtiger_users SET is_owner=? WHERE id=?', array(1, $userid));
        echo '<br>Account Owner Informnation saved in vtiger';
        //Recreate user prvileges
        createUserPrivilegesfile($userId);
        echo '<br>User previleges file recreated aftter adding is_owner field';
    }
} else {
    echo '<br>Account Owner was not existed in this database';
}
//Reports Chart Supported
Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_reporttype(\n                        reportid INT(10),\n                        data text,\n\t\t\t\t\t\tPRIMARY KEY (`reportid`),\n\t\t\t\t\t\tCONSTRAINT `fk_1_vtiger_reporttype` FOREIGN KEY (`reportid`) REFERENCES `vtiger_report` (`reportid`) ON DELETE CASCADE)\n                        ENGINE=InnoDB DEFAULT CHARSET=utf8;", array());
//Configuration Editor fix
$sql = "UPDATE vtiger_settings_field SET name = ? WHERE name = ?";
Migration_Index_View::ExecuteQuery($sql, array('LBL_CONFIG_EDITOR', 'Configuration Editor'));
// SalesPlatform.ru begin
// Add new fields for Webforms
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_webforms\nADD captcha INT(1) NOT NULL DEFAULT '0',\nADD roundrobin INT(1) NOT NULL DEFAULT '0',\nADD roundrobin_userid VARCHAR(256) DEFAULT NULL,\nADD roundrobin_logic INT(11) NOT NULL DEFAULT '0'", array());
Migration_Index_View::ExecuteQuery("ALTER TABLE vtiger_webforms_field\nADD sequence INT(10) DEFAULT NULL,\nADD hidden INT(10) DEFAULT NULL", array());
// Delete SPModulePicklist
Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_tab WHERE tablabel = ?', array('SPModulePicklist'));
// SalesPlatform.ru end
																	AND task LIKE ?', array('Calendar', 'Events', '%$(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname)%'));
$numOfRows = $adb->num_rows($result);
for ($i = 0; $i < $numOfRows; $i++) {
    $tm = new VTTaskManager($adb);
    $task = $tm->retrieveTask($adb->query_result($result, $i, 'task_id'));
    $emailTask = new VTEmailTask();
    $properties = get_object_vars($task);
    foreach ($properties as $propertyName => $propertyValue) {
        $propertyValue = str_replace('$date_start  $time_start ( $(general : (__VtigerMeta__) usertimezone) ) ', '$date_start', $propertyValue);
        $propertyValue = str_replace('$due_date  $time_end ( $(general : (__VtigerMeta__) usertimezone) )', '$due_date', $propertyValue);
        $propertyValue = str_replace('$due_date ( $(general : (__VtigerMeta__) usertimezone) )', '$due_date', $propertyValue);
        $propertyValue = str_replace('$(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname)', '$contact_id', $propertyValue);
        $emailTask->{$propertyName} = $propertyValue;
    }
    $tm->saveTask($emailTask);
}
$result = $adb->pquery('SELECT 1 FROM vtiger_currencies WHERE currency_name = ?', array('Ugandan Shilling'));
if (!$adb->num_rows($result)) {
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_currencies (currencyid, currency_name, currency_code, currency_symbol) VALUES(?, ?, ?, ?)', array($adb->getUniqueID('vtiger_currencies'), 'Ugandan Shilling', 'UGX', 'Sh'));
}
$em = new VTEventsManager($adb);
$em->registerHandler('vtiger.picklist.afterrename', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler');
$em->registerHandler('vtiger.picklist.afterdelete', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler');
Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_inventoryproductrel MODIFY comment varchar(500)', array());
$module = Vtiger_Module::getInstance('Accounts');
$module->addLink('DETAILVIEWSIDEBARWIDGET', 'Google Map', 'module=Google&view=Map&mode=showMap&viewtype=detail', '', '', '');
// Changes as on 2013.11.29
Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_settings_field WHERE name=?', array('LBL_BACKUP_SERVER_SETTINGS'));
// Changes ends as on 2013.11.29
Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS vtiger_faqcf ( \r\n                                faqid int(19), \r\n                                PRIMARY KEY (faqid), \r\n                                CONSTRAINT fk_1_vtiger_faqcf FOREIGN KEY (faqid) REFERENCES vtiger_faq(id) ON DELETE CASCADE \r\n                ) ENGINE=InnoDB DEFAULT CHARSET=utf8", array());
Migration_Index_View::ExecuteQuery("alter table `vtiger_organizationdetails` add `okpo` varchar(100) default ''", array());
// 5.2.1-20110824
Migration_Index_View::ExecuteQuery("alter table `vtiger_systems` add `server_tls` varchar(20) default NULL", array());
Migration_Index_View::ExecuteQuery("alter table `vtiger_systems` add `from_name` varchar(200) DEFAULT ''", array());
Migration_Index_View::ExecuteQuery("alter table `vtiger_systems` add `use_sendmail` varchar(5) DEFAULT 'false'", array());
// 5.3.0-201207
// Add units code to Products
$productsModuleInstance = Vtiger_Module::getInstance('Products');
$blockInstance = Vtiger_Block::getInstance('LBL_STOCK_INFORMATION', $productsModuleInstance);
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'unit_code';
$fieldInstance->label = 'Unit Code';
$fieldInstance->table = 'vtiger_products';
$fieldInstance->column = 'unit_code';
$fieldInstance->columntype = 'VARCHAR(100)';
$fieldInstance->uitype = 1;
$blockInstance->addField($fieldInstance);
// Add units code to Services
$servicesModuleInstance = Vtiger_Module::getInstance('Services');
$blockInstance = Vtiger_Block::getInstance('LBL_SERVICE_INFORMATION', $servicesModuleInstance);
$fieldInstance = new Vtiger_Field();
$fieldInstance->name = 'unit_code';
$fieldInstance->label = 'Unit Code';
$fieldInstance->table = 'vtiger_service';
$fieldInstance->column = 'unit_code';
$fieldInstance->columntype = 'VARCHAR(100)';
$fieldInstance->uitype = 1;
$blockInstance->addField($fieldInstance);
// Create sp_custom_reports table
Migration_Index_View::ExecuteQuery("CREATE TABLE IF NOT EXISTS sp_custom_reports (\n    reporttype varchar(50) NOT NULL,\n    datefilter int(1) default 0,\n    ownerfilter int(1) default 0,\n    accountfilter int(1) default 0,\n    functionname varchar(255) NOT NULL,\n    PRIMARY KEY  (reporttype)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci", array());
              <b>Кассир</b>
            </td></tr>
            <tr align="center" style="font-size: 6pt; width: 200">
              <td></td>
              <td></td>
            </tr>
            <tr align="center" style="font-size: 6pt;">
              <td>_____________</td>
              <td>_____________</td>
            </tr>
            <tr align="center" style="font-size: 4pt;">
              <td>подпись</td>
              <td>расшифровка подписи</td>
            </tr>
          </table>

        </td></tr>

      </table>
    </td>

  </tr>
</table>

{/content}';
    Migration_Index_View::ExecuteQuery("UPDATE sp_templates SET template = ? WHERE name = 'Приходный кассовый ордер'", array($order));
}
// End
/* Apply new changes for PBX */
updateVtlibModule('PBXManager', 'packages/vtiger/mandatory/PBXManager.zip');
// SalesPlatform.ru end
示例#8
0
	foreach ($properties as $propertyName => $propertyValue) {
		$propertyValue = str_replace('$date_start  $time_start ( $(general : (__VtigerMeta__) usertimezone) ) ', '$date_start', $propertyValue);
		$propertyValue = str_replace('$due_date  $time_end ( $(general : (__VtigerMeta__) usertimezone) )', '$due_date', $propertyValue);
		$propertyValue = str_replace('$due_date ( $(general : (__VtigerMeta__) usertimezone) )', '$due_date', $propertyValue);
		$propertyValue = str_replace('$(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname)', '$contact_id', $propertyValue);
		$emailTask->$propertyName = $propertyValue;
	}

	$tm->saveTask($emailTask);
}

$result = $adb->pquery('SELECT 1 FROM vtiger_currencies WHERE currency_name = ?', array('Ugandan Shilling'));
if(!$adb->num_rows($result)) {
	Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_currencies (currencyid, currency_name, currency_code, currency_symbol) VALUES(?, ?, ?, ?)',
			array($adb->getUniqueID('vtiger_currencies'), 'Ugandan Shilling', 'UGX', 'Sh'));
}
$em = new VTEventsManager($adb);
$em->registerHandler('vtiger.picklist.afterrename', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler');
$em->registerHandler('vtiger.picklist.afterdelete', 'modules/Settings/Picklist/handlers/PickListHandler.php', 'PickListHandler');

Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_inventoryproductrel MODIFY comment varchar(500)', array());

$module = Vtiger_Module::getInstance('Accounts');
$module->addLink('DETAILVIEWSIDEBARWIDGET', 'Google Map', 'module=Google&view=Map&mode=showMap&viewtype=detail', '', '', '');

// Changes as on 2013.11.29

Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_settings_field WHERE name=?', array('LBL_BACKUP_SERVER_SETTINGS'));

// Changes ends as on 2013.11.29
示例#9
0
    global $adb;
    $query = 'SELECT DISTINCT profileid FROM vtiger_profile2utility';
    $result = $adb->pquery($query, array());
    $profileId = $adb->query_result($result, 0, 'profileid');
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,5,0)', array());
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,6,0)', array());
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,10,0)', array());
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,5,0)', array());
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,6,0)', array());
    Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,10,0)', array());
    for ($i = 1; $i < $adb->num_rows($result); $i++) {
        $profileId = $adb->query_result($result, $i, 'profileid');
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,5,1)', array());
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,6,1)', array());
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',40,10,0)', array());
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,5,1)', array());
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,6,1)', array());
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_profile2utility(profileid,tabid,activityid,permission) VALUES (' . $profileId . ',19,10,0)', array());
    }
}
chdir(dirname(__FILE__) . '/../../../');
require_once 'includes/main/WebUI.php';
$pickListFieldName = 'no_of_currency_decimals';
$moduleModel = Settings_Picklist_Module_Model::getInstance('Users');
$fieldModel = Vtiger_Field_Model::getInstance($pickListFieldName, $moduleModel);
if ($fieldModel) {
    $moduleModel->addPickListValues($fieldModel, 0);
    $moduleModel->addPickListValues($fieldModel, 1);
    $pickListValues = Vtiger_Util_Helper::getPickListValues($pickListFieldName);
    $moduleModel->updateSequence($pickListFieldName, $pickListValues);
}
$eventsWorkflow->defaultworkflow = 1;
$workflowManager->save($eventsWorkflow);
$task = $taskManager->createTask('VTEmailTask', $eventsWorkflow->id);
$task->active = true;
$task->summary = 'Отправляет письмо с уведомлением приглашенным пользователям';
$task->recepient = "\$(assigned_user_id : (Users) email1)";
$task->subject = "Событие :  \$subject";
$task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Детали события:</b><br/>' . 'Название события       : $subject<br/>' . 'Дата и Время Начала    : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Дата и Время Окончания : $due_date  $time_end ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Статус                 : $eventstatus <br/>' . 'Приоритет              : $taskpriority <br/>' . 'Относится к            : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id            : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Контакты               : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Место проведения       : $location <br/>' . 'Описание               : $description';
$taskManager->saveTask($task);
/* Calendar workflow when Send Notification is checked */
$calendarWorkflow = $workflowManager->newWorkFlow("Calendar");
$calendarWorkflow->test = '[{"fieldname":"sendnotification","operation":"is","value":"true:boolean"}]';
$calendarWorkflow->description = "Автоматические обработчики для задач Календаря при выбранной опции Отправить уведомление";
$calendarWorkflow->executionCondition = VTWorkflowManager::$ON_EVERY_SAVE;
$calendarWorkflow->defaultworkflow = 1;
$workflowManager->save($calendarWorkflow);
$task = $taskManager->createTask('VTEmailTask', $calendarWorkflow->id);
$task->active = true;
$task->summary = 'Отправляет письмо с уведомлением ответственному за задачу';
$task->recepient = "\$(assigned_user_id : (Users) email1)";
$task->subject = "Задача :  \$subject";
$task->content = '$(assigned_user_id : (Users) first_name) $(assigned_user_id : (Users) last_name) ,<br/>' . '<b>Детали задачи:</b><br/>' . 'Название задачи        : $subject<br/>' . 'Дата и Время Начала    : $date_start  $time_start ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Дата и Время Окончания : $due_date ( $(general : (__VtigerMeta__) dbtimezone) ) <br/>' . 'Статус                 : $taskstatus <br/>' . 'Приоритет              : $taskpriority <br/>' . 'Относится к            : $(parent_id : (Leads) lastname) $(parent_id : (Leads) firstname) $(parent_id : (Accounts) accountname) ' . '$(parent_id : (Potentials) potentialname) $(parent_id : (HelpDesk) ticket_title) <br/>' . 'Контакты               : $(contact_id : (Contacts) lastname) $(contact_id : (Contacts) firstname) <br/>' . 'Место проведения       : $location <br/>' . 'Описание               : $description';
$taskManager->saveTask($task);
// Begin Fix Webforms tables
if (defined('VTIGER_UPGRADE')) {
    Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_webforms COLLATE utf8_unicode_ci', array());
    Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_webforms_field COLLATE utf8_unicode_ci', array());
    Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_webforms_field DROP FOREIGN KEY fk_3_vtiger_webforms_field', array());
    Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_webforms_field ADD CONSTRAINT fk_2_vtiger_webforms_field FOREIGN KEY (fieldname) REFERENCES vtiger_field (fieldname) ON DELETE CASCADE', array());
}
// End
示例#11
0
if (defined('VTIGER_UPGRADE')) {
    //Start add new currency - 'CFP Franc or Pacific Franc'
    global $adb;
    $query = 'UPDATE vtiger_currencies_seq SET id = (SELECT currencyid FROM vtiger_currencies ORDER BY currencyid DESC LIMIT 1)';
    $adb->pquery($query, array());
    $uniqId = $adb->getUniqueID('vtiger_currencies');
    $result = $adb->pquery('SELECT 1 FROM vtiger_currencies WHERE currency_name = ?', array('CFP Franc'));
    if ($adb->num_rows($result) <= 0) {
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_currencies VALUES (?,?,?,?)', array($uniqId, 'CFP Franc', 'XPF', 'F'));
    }
    //Adding new timezone (GMT+11:00) New Caledonia
    $sortOrderResult = $adb->pquery("SELECT sortorderid FROM vtiger_time_zone WHERE time_zone = ?", array('Asia/Yakutsk'));
    if ($adb->num_rows($sortOrderResult)) {
        $sortOrderId = $adb->query_result($sortOrderResult, 0, 'sortorderid');
        $adb->pquery("UPDATE vtiger_time_zone SET sortorderid = (sortorderid + 1) WHERE sortorderid > ?", array($sortOrderId));
        Migration_Index_View::ExecuteQuery('INSERT INTO vtiger_time_zone (time_zone, sortorderid, presence) VALUES (?, ?, ?)', array('Etc/GMT-11', $sortOrderId + 1, 1));
        echo "New timezone (GMT+11:00) New Caledonia added.<br>";
    }
    //updating the config file to support multiple layout
    $filename = 'config.inc.php';
    if (file_exists($filename)) {
        $contents = file_get_contents($filename);
        if (empty($contents)) {
            echo '<tr><td width="80%"><span>Your Configuration file couldnot able to edit, Please asdd it manually</span></td><td style="color:red">Unsuccess</td></tr>';
        } else {
            $config_content = explode('?>', $contents);
            if (strpos($config_content[0], '$default_layout') == false) {
                $config_code = "// Set the default layout \n\$default_layout = 'vlayout';\n\ninclude_once 'config.security.php';\n?>";
                $contents = $config_content[0] . $config_code;
            }
            file_put_contents($filename, $contents);