예제 #1
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
// this patch has been splitted from the other one.
// 8fd8dd050f628900ac035305d0cab140 is:
// modules/Utils/RecordBrowser/patches/20140826_add_id_key_to_tables2.php
$db = new PatchesDB();
if ($db->was_applied('8fd8dd050f628900ac035305d0cab140')) {
    return;
}
$columns = DB::MetaColumnNames('recordbrowser_table_properties');
if (!isset($columns['ID'])) {
    $tab_ids_checkpoint = Patch::checkpoint('tab_ids');
    if (!$tab_ids_checkpoint->is_done()) {
        Patch::require_time(20);
        if (DB::is_postgresql()) {
            DB::Execute('ALTER TABLE recordbrowser_table_properties DROP CONSTRAINT recordbrowser_table_properties_pkey');
            DB::Execute('ALTER TABLE recordbrowser_table_properties ADD COLUMN id SERIAL PRIMARY KEY');
        } else {
            DB::Execute('ALTER TABLE recordbrowser_table_properties DROP PRIMARY KEY');
            DB::Execute('ALTER TABLE recordbrowser_table_properties ADD id SMALLINT NOT NULL AUTO_INCREMENT PRIMARY KEY');
        }
        DB::CreateIndex('recordbrowser_table_properties_tab', 'recordbrowser_table_properties', 'tab', array('UNIQUE' => 1));
        $tab_ids_checkpoint->done();
    }
}
$field_ids_checkpoint = Patch::checkpoint('field_ids');
if (!$field_ids_checkpoint->is_done()) {
    Patch::require_time(20);
    $recordsets = Utils_RecordBrowserCommon::list_installed_recordsets();
    foreach ($recordsets as $tab => $caption) {
예제 #2
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
$pdb = new PatchesDB();
if ($pdb->was_applied(md5('modules/Utils/RecordBrowser/patches/20140827_search_include.php'))) {
    return;
}
PatchUtil::db_add_column('recordbrowser_table_properties', 'search_include', 'I1 DEFAULT 0');
PatchUtil::db_add_column('recordbrowser_table_properties', 'search_priority', 'I1 DEFAULT 0');
Utils_RecordBrowserCommon::set_search('company', 1, 2);
Utils_RecordBrowserCommon::set_search('contact', 1, 2);
Utils_RecordBrowserCommon::set_search('crm_meeting', 2, 0);
Utils_RecordBrowserCommon::set_search('phonecall', 2, 0);
Utils_RecordBrowserCommon::set_search('task', 2, 0);
Utils_RecordBrowserCommon::set_search('crm_assets', 2, 0);
Utils_RecordBrowserCommon::set_search('rc_mail_threads', 2, -1);
Utils_RecordBrowserCommon::set_search('rc_mails', 2, -1);
Utils_RecordBrowserCommon::set_search('rc_multiple_emails', 2, 0);
Utils_RecordBrowserCommon::set_search('custom_projects', 1, 1);
Utils_RecordBrowserCommon::set_search('custom_personalequipment', 2, -2);
Utils_RecordBrowserCommon::set_search('custom_jobsearch', 2, 0);
Utils_RecordBrowserCommon::set_search('custom_jobsearch_history', 2, -1);
Utils_RecordBrowserCommon::set_search('custom_ccn_sales', 2, 0);
Utils_RecordBrowserCommon::set_search('custom_monthlycost', 2, 0);
Utils_RecordBrowserCommon::set_search('custom_merlin_licence', 2, 0);
Utils_RecordBrowserCommon::set_search('custom_merlin_sent', 2, -2);
Utils_RecordBrowserCommon::set_search('utils_attachment', 1, 0);
Utils_RecordBrowserCommon::set_search('premium_listmanager', 2, 0);
Utils_RecordBrowserCommon::set_search('premium_listmanager_element', 2, -1);
Utils_RecordBrowserCommon::set_search('premium_warehouse', 2, 0);
Utils_RecordBrowserCommon::set_search('premium_projects', 2, 0);
예제 #3
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
// this patch has been renamed to make update process right
// 4bb2048388cd0807ac707edeaa67dfa2 is:
// modules/Utils/RecordBrowser/patches/20140814_add_processing_order.php
$db = new PatchesDB();
if ($db->was_applied('4bb2048388cd0807ac707edeaa67dfa2')) {
    return;
}
$recordsets = Utils_RecordBrowserCommon::list_installed_recordsets();
$checkpoint = Patch::checkpoint('recordset');
$processed = $checkpoint->get('processed', array());
foreach ($recordsets as $tab => $caption) {
    if (isset($processed[$tab])) {
        continue;
    }
    $processed[$tab] = true;
    Patch::require_time(3);
    $tab = $tab . "_field";
    $columns = DB::MetaColumnNames($tab);
    if (!isset($columns['PROCESSING_ORDER'])) {
        PatchUtil::db_add_column($tab, 'processing_order', 'I2');
        DB::Execute("UPDATE {$tab} SET processing_order=position");
    }
    $checkpoint->set('processed', $processed);
}
예제 #4
0
<?php

defined("_VALID_ACCESS") || die('Direct access forbidden');
$patches_db = new PatchesDB();
$patches = PatchUtil::list_patches(false);
foreach ($patches as $patch) {
    $needle = 'patches/';
    $filename = $patch->get_file();
    $backslash_pos = strpos($filename, $needle);
    if ($backslash_pos !== false) {
        $filename[$backslash_pos + strlen($needle) - 1] = '\\';
        $id = md5($filename);
        if ($patches_db->was_applied($id) && !$patch->was_applied()) {
            $patch->mark_applied();
        }
    }
}