Ejemplo n.º 1
0
Archivo: utils.php Proyecto: yunter/crm
function initUpdateVtlibModule($module, $packagepath)
{
    global $log;
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $Vtiger_Utils_Log = true;
    $package = new Vtiger_Package();
    if ($module == null) {
        $log->fatal("Module name is invalid");
    } else {
        $moduleInstance = Vtiger_Module::getInstance($module);
        if ($moduleInstance) {
            $log->debug("{$module} - Module instance found - Init Update starts here");
            $package->initUpdate($moduleInstance, $packagepath, true);
        } else {
            $log->fatal("{$module} doesn't exists!");
        }
    }
}
Ejemplo n.º 2
0
 *********************************************************************************/
//5.1.0 RC to 5.1.0 database changes
//we have to use the current object (stored in PatchApply.php) to execute the queries
$adb = $_SESSION['adodb_current_object'];
$conn = $_SESSION['adodb_current_object'];
$migrationlog->debug("\n\nDB Changes from 5.1.0 RC to 5.1.0 -------- Starts \n\n");
require_once 'vtlib/Vtiger/Package.php';
require_once 'vtlib/Vtiger/Module.php';
$package = new Vtiger_Package();
ExecuteQuery("DELETE vtiger_cvcolumnlist FROM vtiger_cvcolumnlist INNER JOIN vtiger_customview WHERE vtiger_cvcolumnlist.columnname LIKE '%vtiger_notes:filename%' AND vtiger_customview.cvid = vtiger_cvcolumnlist.cvid AND vtiger_customview.entitytype='HelpDesk'");
ExecuteQuery("DELETE vtiger_cvcolumnlist FROM vtiger_cvcolumnlist INNER JOIN vtiger_customview WHERE (vtiger_cvcolumnlist.columnname LIKE '%parent_id%' OR vtiger_cvcolumnlist.columnname LIKE '%vtiger_contactdetails%') AND vtiger_customview.cvid = vtiger_cvcolumnlist.cvid AND vtiger_customview.entitytype='Documents'");
ExecuteQuery("DELETE vtiger_cvadvfilter FROM vtiger_cvadvfilter INNER JOIN vtiger_customview WHERE vtiger_cvadvfilter.columnname LIKE '%vtiger_notes:filename%' AND vtiger_customview.cvid = vtiger_cvadvfilter.cvid AND vtiger_customview.entitytype='HelpDesk'");
ExecuteQuery("DELETE vtiger_cvadvfilter FROM vtiger_cvadvfilter INNER JOIN vtiger_customview WHERE (vtiger_cvadvfilter.columnname LIKE '%parent_id%' OR vtiger_cvadvfilter.columnname LIKE '%vtiger_contactdetails%') AND vtiger_customview.cvid = vtiger_cvadvfilter.cvid AND vtiger_customview.entitytype='Documents'");
// Update PBXManager module files
$moduleInstance = Vtiger_Module::getInstance('PBXManager');
$package->initUpdate($moduleInstance, 'packages/5.1.0/mandatory/PBXManager.zip', true);
// Update ServiceContracts module files
$moduleInstance = Vtiger_Module::getInstance('ServiceContracts');
$package->initUpdate($moduleInstance, 'packages/5.1.0/mandatory/ServiceContracts.zip', true);
// Update Services module files
$moduleInstance = Vtiger_Module::getInstance('Services');
$package->initUpdate($moduleInstance, 'packages/5.1.0/mandatory/Services.zip', true);
// Install/Update Optional modules
require_once 'include/utils/installVtlibSelectedModules.php';
// Fixed issue with Calendar duration calculation
ExecuteQuery("ALTER TABLE vtiger_activity MODIFY duration_hours VARCHAR(200)");
$result = $adb->query("SELECT activityid,date_start,due_date, time_start,time_end FROM vtiger_activity WHERE activitytype NOT IN ('Task','Emails')");
$noofrows = $adb->num_rows($result);
for ($index = 0; $index < $noofrows; $index++) {
    $activityid = $adb->query_result($result, $index, 'activityid');
    $date_start = $adb->query_result($result, $index, 'date_start');