Esempio n. 1
0
function installOptionalModules($selected_modules)
{
    global $log;
    require_once 'vtlib/Vtiger/Package.php';
    require_once 'vtlib/Vtiger/Module.php';
    $selected_modules = split(":", $selected_modules);
    if ($handle = opendir('packages/5.1.0/optional')) {
        while (false !== ($file = readdir($handle))) {
            $filename_arr = explode(".", $file);
            $packagename = $filename_arr[0];
            if (!empty($packagename)) {
                $packagepath = "packages/5.1.0/optional/{$file}";
                $package = new Vtiger_Package();
                $module = $package->getModuleNameFromZip($packagepath);
                if ($module != null) {
                    $moduleInstance = Vtiger_Module::getInstance($module);
                    if (in_array($packagename, $selected_modules)) {
                        if ($moduleInstance) {
                            initUpdateVtlibModule($module, $packagepath);
                        } else {
                            installVtlibModule($packagename, $packagepath);
                        }
                    } elseif ($moduleInstance) {
                        initUpdateVtlibModule($module, $packagepath);
                        vtlib_toggleModuleAccess((string) $module, false);
                    }
                }
            }
        }
        closedir($handle);
    }
}
Esempio n. 2
0
//97 starts
$adb = PearDatabase::getInstance();
$handlers = array('modules/FieldFormulas/VTFieldFormulasEventHandler.inc');
Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_eventhandlers WHERE handler_path IN (' . generateQuestionMarks($handlers) . ')', $handlers);
//delete modtracker detail view links
Migration_Index_View::ExecuteQuery('DELETE FROM vtiger_links WHERE linktype = ? AND handler_class = ? AND linkurl like "javascript:ModTrackerCommon.showhistory%"', array('DETAILVIEWBASIC', 'ModTracker'));
//Added New field in mailmanager
Migration_Index_View::ExecuteQuery('ALTER TABLE vtiger_mail_accounts ADD COLUMN sent_folder VARCHAR(50)', array());
echo '<br>selected folder field added in mailmanager.<br>';
//97 ends
//Migrating PBXManager 5.4.0 to 6.x
if (!defined('INSTALLATION_MODE')) {
    $moduleInstance = Vtiger_Module_Model::getInstance('PBXManager');
    if (!$moduleInstance) {
        echo '<br>Installing PBX Manager starts<br>';
        installVtlibModule('PBXManager', 'packages/vtiger/mandatory/PBXManager.zip');
    } else {
        $result = $adb->pquery('SELECT server, port FROM vtiger_asterisk', array());
        $server = $adb->query_result($result, 0, 'server');
        $qualifiedModuleName = 'PBXManager';
        $recordModel = Settings_PBXManager_Record_Model::getCleanInstance();
        $recordModel->set('gateway', $qualifiedModuleName);
        $connector = new PBXManager_PBXManager_Connector();
        foreach ($connector->getSettingsParameters() as $field => $type) {
            $fieldValue = "";
            if ($field == "webappurl") {
                $fieldValue = "http://" . $server . ":";
            }
            if ($field == "vtigersecretkey") {
                $fieldValue = uniqid(rand());
            }
Esempio n. 3
0
 public static function installSelectedOptionalModules($selected_modules, $source_directory = '', $destination_directory = '')
 {
     require_once 'vtlib/Vtiger/Package.php';
     require_once 'vtlib/Vtiger/Module.php';
     require_once 'include/utils/utils.php';
     $selected_modules = explode(":", $selected_modules);
     $languagePacks = array();
     if ($handle = opendir('packages/vtiger/optional')) {
         while (false !== ($file = readdir($handle))) {
             $filename_arr = explode(".", $file);
             if ($filename_arr[count($filename_arr) - 1] != 'zip') {
                 continue;
             }
             $packagename = $filename_arr[0];
             $packagepath = "packages/vtiger/optional/{$file}";
             $package = new Vtiger_Package();
             $module = $package->getModuleNameFromZip($packagepath);
             if (!empty($packagename) && in_array($module, $selected_modules)) {
                 if ($package->isLanguageType($packagepath)) {
                     $languagePacks[$module] = $packagepath;
                     continue;
                 }
                 if ($module != null) {
                     if ($package->isModuleBundle()) {
                         $unzip = new Vtiger_Unzip($packagepath);
                         $unzip->unzipAllEx($package->getTemporaryFilePath());
                         $moduleInfoList = $package->getAvailableModuleInfoFromModuleBundle();
                         foreach ($moduleInfoList as $moduleInfo) {
                             $moduleInfo = (array) $moduleInfo;
                             $packagepath = $package->getTemporaryFilePath($moduleInfo['filepath']);
                             $subModule = new Vtiger_Package();
                             $subModuleName = $subModule->getModuleNameFromZip($packagepath);
                             $moduleInstance = Vtiger_Module::getInstance($subModuleName);
                             if ($moduleInstance) {
                                 updateVtlibModule($subModuleName, $packagepath);
                             } else {
                                 installVtlibModule($subModuleName, $packagepath);
                             }
                         }
                     } else {
                         $moduleInstance = Vtiger_Module::getInstance($module);
                         if ($moduleInstance) {
                             updateVtlibModule($module, $packagepath);
                         } else {
                             installVtlibModule($module, $packagepath);
                         }
                     }
                 }
             }
         }
         closedir($handle);
     }
     foreach ($languagePacks as $module => $packagepath) {
         installVtlibModule($module, $packagepath);
         continue;
     }
 }
installVtlibModule('SPPDFTemplates', "packages/vtiger/optional/SPPDFTemplates.zip");
// 5.2.1-20110411
Migration_Index_View::ExecuteQuery("alter table `vtiger_organizationdetails` add `inn` varchar(30) default ''", array());
Migration_Index_View::ExecuteQuery("alter table `vtiger_organizationdetails` add `kpp` varchar(30) default ''", array());
// 5.2.1-20110506
Migration_Index_View::ExecuteQuery('INSERT INTO `sp_templates` VALUES (1,\'Счет\',\'Invoice\',\'{header}\\n\\n<p style="font-weight: bold; text-decoration: underline">{$orgName}</p>\\n\\n<p style="font-weight: bold">Адрес: {$orgBillingAddress}, тел.: {$orgPhone}</p>\\n\\n<div style="font-weight: bold; text-align: center">Образец заполнения платежного поручения</div>\\n\\n<table border="1" cellpadding="2">\\n<tr>\\n  <td width="140">ИНН {$orgInn}</td><td width="140">КПП {$orgKpp}</td><td rowspan="2" width="50"><br/><br/>Сч. №</td><td rowspan="2" width="200"><br/><br/>{$orgBankAccount}</td>\\n</tr>\\n<tr>\\n<td colspan="2" width="280"><span style="font-size: 8pt">Получатель</span><br/>{$orgName}</td>\\n</tr>\\n<tr>\\n<td colspan="2" rowspan="2" width="280"><span style="font-size: 8pt">Банк получателя</span><br/>{$orgBankName}</td>\\n<td width="50">БИК</td>\\n<td rowspan="2" width="200">{$orgBankId}<br/>{$orgCorrAccount}</td>\\n</tr>\\n<tr>\\n<td width="50">Сч. №</td>\\n</tr>\\n</table>\\n<br/>\\n<h1 style="text-align: center">СЧЕТ № {$invoice_no} от {$invoice_invoicedate}</h1>\\n<br/><br/>\\n<table border="0">\\n<tr>\\n<td width="100">Плательщик:</td><td width="450"><span style="font-weight: bold">{$account_accountname}</span></td>\\n</tr>\\n<tr>\\n<td width="100">Грузополучатель:</td><td width="450"><span style="font-weight: bold">{$account_accountname}</span></td>\\n</tr>\\n</table>\\n\\n{/header}\\n\\n{table_head}\\n<table border="1" style="font-size: 8pt" cellpadding="2">\\n    <tr style="text-align: center; font-weight: bold">\\n	<td width="30">№</td>\\n      <td width="260">Наименование<br/>товара</td>\\n      <td width="65">Единица<br/>изме-<br/>рения</td>\\n      <td width="35">Коли-<br/>чество</td>\\n	<td width="70">Цена</td>\\n	<td width="70">Сумма</td>\\n	</tr>\\n{/table_head}\\n\\n{table_row}\\n    <tr>\\n	<td width="30">{$productNumber}</td>\\n      <td width="260">{$productName} {$productComment}</td>\\n	<td width="65" style="text-align: center">{$productUnits}</td>\\n	<td width="35" style="text-align: right">{$productQuantityInt}</td>\\n	<td width="70" style="text-align: right">{$productPrice}</td>\\n	<td width="70" style="text-align: right">{$productNetTotal}</td>\\n    </tr>\\n{/table_row}\\n\\n{summary}\\n</table>\\n<table border="0" style="font-size: 8pt;font-weight: bold">\\n    <tr>\\n      <td width="460">\\n        <table border="0" cellpadding="2">\\n          <tr><td width="460" style="text-align: right">Итого:</td></tr>\\n          <tr><td width="460" style="text-align: right">Сумма НДС:</td></tr>\\n          <tr><td width="460" style="text-align: right">Всего к оплате:</td></tr>\\n        </table>\\n      </td>\\n      <td width="70">\\n        <table border="1" cellpadding="2">\\n          <tr><td width="70" style="text-align: right">{$summaryGrandTotal}</td></tr>\\n          <tr><td width="70" style="text-align: right">{$summaryTax}</td></tr>\\n          <tr><td width="70" style="text-align: right">{$summaryGrandTotal}</td></tr>\\n        </table>\\n      </td>\\n  </tr>\\n</table>\\n\\n<p>\\nВсего наименований {$summaryTotalItems}, на сумму {$summaryGrandTotal} руб.<br/>\\n<span style="font-weight: bold">{$summaryGrandTotalLiteral}</span>\\n</p>\\n\\n{/summary}\\n\\n{ending}\\n<br/>\\n    <p>Руководитель предприятия  __________________ ( {$orgDirector} ) <br/>\\n    <br/>\\n    Главный бухгалтер  __________________ ( {$orgBookkeeper} )\\n    </p>\\n{/ending}\',110,50,\'P\'),(2,\'Накладная\',\'SalesOrder\',\'{header}\\n<h1 style=\\"font-size: 14pt\\">Расходная накладная № {$salesorder_no}</h1>\\n<hr>\\n<table border=\\"0\\" style=\\"font-size: 9pt\\">\\n<tr>\\n<td width=\\"80\\">Поставщик:</td><td width=\\"450\\"><span style=\\"font-weight: bold\\">{$orgName}</span></td>\\n</tr>\\n<tr>\\n<td width=\\"80\\">Покупатель:</td><td width=\\"450\\"><span style=\\"font-weight: bold\\">{$account_accountname}</span></td>\\n</tr>\\n</table>\\n{/header}\\n\\n{table_head}\\n<table border=\\"1\\" style=\\"font-size: 8pt\\" cellpadding=\\"2\\">\\n    <tr style=\\"text-align: center; font-weight: bold\\">\\n	<td width=\\"30\\" rowspan=\\"2\\">№</td>\\n	<td width=\\"200\\" rowspan=\\"2\\">Товар</td>\\n	<td width=\\"50\\" rowspan=\\"2\\" colspan=\\"2\\">Мест</td>\\n	<td width=\\"60\\" rowspan=\\"2\\" colspan=\\"2\\">Количество</td>\\n	<td width=\\"60\\" rowspan=\\"2\\">Цена</td>\\n	<td width=\\"60\\" rowspan=\\"2\\">Сумма</td>\\n	<td width=\\"70\\">Номер ГТД</td>\\n    </tr>\\n    <tr style=\\"text-align: center; font-weight: bold\\">\\n	<td width=\\"70\\">Страна<br/>происхождения</td>\\n    </tr>\\n{/table_head}\\n\\n{table_row}\\n    <tr>\\n	<td width=\\"30\\" rowspan=\\"2\\">{$productNumber}</td>\\n	<td width=\\"200\\" rowspan=\\"2\\">{$productName}</td>\\n	<td width=\\"25\\" rowspan=\\"2\\"></td>\\n	<td width=\\"25\\" rowspan=\\"2\\">шт.</td>\\n	<td width=\\"30\\" rowspan=\\"2\\" style=\\"text-align: right\\">{$productQuantityInt}</td>\\n	<td width=\\"30\\" rowspan=\\"2\\">{$productUnits}</td>\\n	<td width=\\"60\\" rowspan=\\"2\\" style=\\"text-align: right\\">{$productPrice}</td>\\n	<td width=\\"60\\" rowspan=\\"2\\" style=\\"text-align: right\\">{$productNetTotal}</td>\\n	<td width=\\"70\\">{$customsId}</td>\\n    </tr>\\n    <tr>\\n	<td width=\\"70\\">{$manufCountry}</td>\\n    </tr>\\n{/table_row}\\n\\n{summary}\\n</table>\\n<p></p>\\n<table border=\\"0\\" style=\\"font-weight: bold\\">\\n    <tr>\\n	<td width=\\"400\\" style=\\"text-align: right\\">Итого:</td>\\n	<td width=\\"60\\" style=\\"text-align: right\\">{$summaryNetTotal}</td>\\n    </tr>\\n    <tr>\\n	<td width=\\"400\\" style=\\"text-align: right\\">Сумма НДС:</td>\\n	<td width=\\"60\\" style=\\"text-align: right\\">{$summaryTax}</td>\\n    </tr>\\n</table>\\n\\n<p>\\nВсего наименований {$summaryTotalItems}, на сумму {$summaryGrandTotal} руб.<br/>\\n<span style=\\"font-weight: bold\\">{$summaryGrandTotalLiteral}</span>\\n</p>\\n\\n{/summary}\\n\\n{ending}\\n    <hr size=\\"2\\">\\n    <table border=\\"0\\">\\n    <tr>\\n	<td>Отпустил  __________ </td><td>Получил  __________ </td>\\n    </tr>\\n    </table>\\n{/ending}\\n\',50,0,\'P\'),(3,\'Предложение\',\'Quotes\',\'\\n{header}\\n\\n<p style=\\"font-weight: bold\\">\\n{$orgName}<br/>\\nИНН {$orgInn}<br/>\\nКПП {$orgKpp}<br/>\\n{$orgBillingAddress}<br/>\\nТел.: {$orgPhone}<br/>\\nФакс: {$orgFax}<br/>\\n{$orgWebsite}\\n</p>\\n\\n<h1>Коммерческое предложение № {$quote_no}</h1>\\n<p>Действительно до: {$quote_validtill}</p>\\n<hr size=\\"2\\">\\n\\n<p style=\\"font-weight: bold\\">\\n{$account_accountname}<br/>\\n{$billingAddress}\\n</p>\\n{/header}\\n\\n{table_head}\\n<table border=\\"1\\" style=\\"font-size: 8pt\\" cellpadding=\\"2\\">\\n    <tr style=\\"text-align: center; font-weight: bold\\">\\n	<td width=\\"30\\">№</td>\\n	<td width=\\"260\\">Товары (работы, услуги)</td>\\n	<td width=\\"70\\">Ед.</td>\\n	<td width=\\"30\\">Кол-во</td>\\n	<td width=\\"70\\">Цена</td>\\n	<td width=\\"70\\">Сумма</td>\\n	</tr>\\n{/table_head}\\n\\n{table_row}\\n    <tr>\\n	<td width=\\"30\\">{$productNumber}</td>\\n	<td width=\\"260\\">{$productName}</td>\\n	<td width=\\"70\\">{$productUnits}</td>\\n	<td width=\\"30\\" style=\\"text-align: right\\">{$productQuantity}</td>\\n	<td width=\\"70\\" style=\\"text-align: right\\">{$productPrice}</td>\\n	<td width=\\"70\\" style=\\"text-align: right\\">{$productNetTotal}</td>\\n    </tr>\\n{/table_row}\\n\\n{summary}\\n</table>\\n<p></p>\\n<table border=\\"0\\">\\n    <tr>\\n	<td width=\\"460\\" style=\\"text-align: right\\">Итого:</td>\\n	<td width=\\"70\\" style=\\"text-align: right\\">{$summaryNetTotal}</td>\\n    </tr>\\n    <tr>\\n	<td width=\\"460\\" style=\\"text-align: right\\">Сумма НДС:</td>\\n	<td width=\\"70\\" style=\\"text-align: right\\">{$summaryTax}</td>\\n    </tr>\\n</table>\\n\\n<p style=\\"font-weight: bold\\">\\nВсего: {$summaryGrandTotal} руб. ( {$summaryGrandTotalLiteral} )\\n</p>\\n\\n{/summary}\\n\\n{ending}\\n    <hr size=\\"2\\">\\n    <p>Руководитель предприятия  __________ ( {$orgDirector} ) <br/>\\n    </p>\\n{/ending}\\n\',85,0,\'P\')', array());
Migration_Index_View::ExecuteQuery('INSERT INTO `sp_templates` VALUES (4,\'Заказ на закупку\',\'PurchaseOrder\',\'{header}\\n<h1 style=\\"font-size: 14pt\\">Заказ на закупку № {$purchaseorder_no}</h1>\\n<hr>\\n<table border=\\"0\\" style=\\"font-size: 9pt\\">\\n<tr>\\n<td width=\\"80\\">Поставщик:</td><td width=\\"450\\"><span style=\\"font-weight: bold\\">{$vendor_vendorname}</span></td>\\n</tr>\\n<tr>\\n<td width=\\"80\\">Покупатель:</td><td width=\\"450\\"><span style=\\"font-weight: bold\\">{$orgName}</span></td>\\n</tr>\\n</table>\\n{/header}\\n{table_head}\\n<table border=\\"1\\" style=\\"font-size: 8pt\\" cellpadding=\\"2\\">\\n<tr style=\\"text-align: center; font-weight: bold\\">\\n<td width=\\"30\\">№</td>\\n<td width=\\"200\\">Товар</td>\\n<td width=\\"60\\" colspan=\\"2\\">Количество</td>\\n<td width=\\"60\\">Цена</td>\\n<td width=\\"60\\">Сумма</td>\\n</tr>\\n{/table_head}\\n{table_row}\\n<tr>\\n<td width=\\"30\\">{$productNumber}</td>\\n<td width=\\"200\\">{$productName}</td>\\n<td width=\\"30\\" style=\\"text-align: right\\">{$productQuantityInt}</td>\\n<td width=\\"30\\">{$productUnits}</td>\\n<td width=\\"60\\" style=\\"text-align: right\\">{$productPrice}</td>\\n<td width=\\"60\\" style=\\"text-align: right\\">{$productNetTotal}</td>\\n</tr>\\n{/table_row}\\n{summary}\\n</table>\\n<p></p>\\n<table border=\\"0\\" style=\\"font-weight: bold\\">\\n<tr>\\n<td width=\\"350\\" style=\\"text-align: right\\">Итого:</td>\\n<td width=\\"60\\" style=\\"text-align: right\\">{$summaryNetTotal}</td>\\n</tr>\\n<tr>\\n<td width=\\"350\\" style=\\"text-align: right\\">Сумма НДС:</td>\\n<td width=\\"60\\" style=\\"text-align: right\\">{$summaryTax}</td>\\n</tr>\\n</table>\\n<p>\\nВсего наименований {$summaryTotalItems}, на сумму {$summaryGrandTotal} руб.<br/>\\n<span style=\\"font-weight: bold\\">{$summaryGrandTotalLiteral}</span>\\n</p>\\n{/summary}\\n{ending}\\n{/ending}\',50,0,\'P\')', array());
Migration_Index_View::ExecuteQuery("create table if not exists sp_templates_seq (id int(11) not NULL) ENGINE=InnoDB  DEFAULT CHARSET=utf8", array());
Migration_Index_View::ExecuteQuery('INSERT INTO sp_templates_seq (id) VALUES (4)', array());
// Install all SP modules except SPKladr
installVtlibModule('Act', 'packages/vtiger/optional/Act.zip');
installVtlibModule('Consignment', "packages/vtiger/optional/Consignment.zip");
installVtlibModule('SPPayments', "packages/vtiger/optional/SPPayments.zip");
installVtlibModule('SPCMLConnector', "packages/vtiger/optional/SPCMLConnector.zip");
installVtlibModule('SPSocialConnector', "packages/vtiger/optional/SPSocialConnector.zip");
installVtlibModule('SPUnits', "packages/vtiger/optional/SPUnits.zip");
require_once 'vtlib/Vtiger/Module.php';
$module = Vtiger_Module::getInstance('Accounts');
if ($module) {
    $blockInstance = Vtiger_Block::getInstance('LBL_ACCOUNT_INFORMATION', $module);
    if ($blockInstance) {
        $innField = Vtiger_Field::getInstance('inn', $module);
        if (!$innField) {
            $fieldInstance = new Vtiger_Field();
            $fieldInstance->name = 'inn';
            $fieldInstance->table = 'vtiger_account';
            $fieldInstance->label = 'INN';
            $fieldInstance->uitype = 1;
            $fieldInstance->column = $fieldInstance->name;
            $fieldInstance->columntype = 'VARCHAR(30)';
            $fieldInstance->typeofdata = 'V~O';
 * The contents of this file are subject to the vtiger CRM Public License Version 1.1
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is: SalesPlatform Ltd
 * The Initial Developer of the Original Code is SalesPlatform Ltd.
 * All Rights Reserved.
 * If you have any questions or comments, please email: devel@salesplatform.ru
 ************************************************************************************/
if (!defined('VTIGER_UPGRADE')) {
    die('Invalid entry point');
}
chdir(dirname(__FILE__) . '/../../../');
include_once 'modules/com_vtiger_workflow/VTTaskManager.inc';
include_once 'include/utils/utils.php';
if (defined('VTIGER_UPGRADE')) {
    // 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
Esempio n. 6
0
$currencyBlock->addField($currencyThousandSeparator);
$currencyThousandSeparator->setPicklistValues(array(".", ",", "'", " ", "\$"));
$currencySymbolPlacement = new Vtiger_Field();
$currencySymbolPlacement->name = 'currency_symbol_placement';
$currencySymbolPlacement->label = 'Symbol Placement';
$currencySymbolPlacement->table = 'vtiger_users';
$currencySymbolPlacement->column = 'currency_symbol_placement';
$currencySymbolPlacement->columntype = 'varchar(20)';
$currencySymbolPlacement->typeofdata = 'V~O';
$currencySymbolPlacement->uitype = 16;
$currencySymbolPlacement->defaultvalue = ',';
$currencySymbolPlacement->sequence = 5;
$currencySymbolPlacement->helpinfo = "<b>Currency - Symbol Placement</b> <br/><br/>" . "Symbol Placement allows you to configure the position of the " . "currency symbol with respect to the currency value.<br/>" . "<b>Eg:</b> <br/>" . "\$1.0 => \$123,456,789.50 <br/>" . "1.0\$ => 123,456,789.50\$ <br/>";
$currencyBlock->addField($currencySymbolPlacement);
$currencySymbolPlacement->setPicklistValues(array("\$1.0", "1.0\$"));
// Update the block and the sequence for Currency field of Users module - Push it to Currency Configuration block
ExecuteQuery("UPDATE vtiger_field SET block={$currencyBlock->id}, sequence=1 WHERE tablename='vtiger_users' AND fieldname='currency_id'");
ExecuteQuery("UPDATE vtiger_users SET currency_grouping_pattern='123,456,789',\n\t\t\t\t\t\t\t\t\t\tcurrency_decimal_separator='.',\n\t\t\t\t\t\t\t\t\t\tcurrency_grouping_separator=',',\n\t\t\t\t\t\t\t\t\t\tcurrency_symbol_placement='\$1.0'");
ExecuteQuery("UPDATE vtiger_field SET uitype='71' WHERE uitype=1 AND tablename='vtiger_campaign'\n\t\t\t\t\t\t\tAND fieldname IN ('expectedrevenue', 'actualcost', 'expectedroi', 'actualroi', 'budgetcost')");
ExecuteQuery("UPDATE vtiger_field SET uitype='72' WHERE uitype IN ('1','71')\n\t\t\t\t\tAND fieldname IN ('unit_price', 'hdnGrandTotal', 'hdnSubTotal', 'txtAdjustment', 'hdnDiscountAmount', 'hdnS_H_Amount')");
$sql = "INSERT INTO vtiger_ws_fieldtype(uitype,fieldtype) VALUES ('71', 'currency')";
ExecuteQuery($sql);
$sql = "INSERT INTO vtiger_ws_fieldtype(uitype,fieldtype) VALUES ('72', 'currency')";
ExecuteQuery($sql);
installVtlibModule('ConfigEditor', "packages/vtiger/mandatory/ConfigEditor.zip");
installVtlibModule('WSAPP', "packages/vtiger/mandatory/WSAPP.zip");
updateVtlibModule('Mobile', "packages/vtiger/mandatory/Mobile.zip");
updateVtlibModule('Services', 'packages/vtiger/mandatory/Services.zip');
updateVtlibModule('ServiceContracts', 'packages/vtiger/mandatory/ServiceContracts.zip');
updateVtlibModule('PBXManager', 'packages/vtiger/mandatory/PBXManager.zip');
$migrationlog->debug("\n\nDB Changes from 5.2.1 to 5.3.0RC  -------- Ends \n\n");
    installVtlibModule('EmailTemplates', 'packages/vtiger/optional/EmailTemplates.zip');
    // updated language packs.
    updateVtlibModule('PT Brasil', 'packages/vtiger/optional/BrazilianLanguagePack_bz_bz.zip');
    updateVtlibModule('British English', 'packages/vtiger/optional/BritishLanguagePack_br_br.zip');
    updateVtlibModule('Dutch', 'packages/vtiger/optional/Dutch.zip');
    updateVtlibModule('Deutsch', 'packages/vtiger/optional/Deutsch.zip');
    updateVtlibModule('French', 'packages/vtiger/optional/French.zip');
    updateVtlibModule('Hungarian', 'packages/vtiger/optional/Hungarian.zip');
    updateVtlibModule('Mexican Spanish', 'packages/vtiger/optional/MexicanSpanishLanguagePack_es_mx.zip');
    updateVtlibModule('Spanish', 'packages/vtiger/optional/Spanish.zip');
    installVtlibModule('Italian', 'packages/vtiger/optional/ItalianLanguagePack_it_it.zip');
    installVtlibModule('RomanianLanguagePack_rm_rm', 'packages/vtiger/optional/RomanianLanguagePack_rm_rm.zip');
    installVtlibModule('Turkce', 'packages/vtiger/optional/TurkishLanguagePack_tr_tr.zip');
    installVtlibModule('Russian', 'packages/vtiger/optional/Russian.zip');
    installVtlibModule('Polish', 'packages/vtiger/optional/PolishLanguagePack_pl_pl.zip');
    installVtlibModule('Russian', 'packages/vtiger/optional/Russian.zip');
}
if (!defined('INSTALLATION_MODE')) {
    Migration_Index_View::ExecuteQuery('ALTER TABLE com_vtiger_workflows ADD COLUMN filtersavedinnew int(1)', array());
}
Migration_Index_View::ExecuteQuery('UPDATE com_vtiger_workflows SET filtersavedinnew = 5', array());
// Core workflow schema dependecy introduced in 6.1.0
$adb = PearDatabase::getInstance();
$result = $adb->pquery("show columns from com_vtiger_workflows like ?", array('schtypeid'));
if (!$adb->num_rows($result)) {
    $adb->pquery("ALTER TABLE com_vtiger_workflows ADD schtypeid INT(10)", array());
}
$result = $adb->pquery("show columns from com_vtiger_workflows like ?", array('schtime'));
if (!$adb->num_rows($result)) {
    $adb->pquery("ALTER TABLE com_vtiger_workflows ADD schtime TIME", array());
}
function installMandatoryModules()
{
    if ($handle = opendir('packages/5.1.0/mandatory')) {
        while (false !== ($file = readdir($handle))) {
            $filename_arr = explode(".", $file);
            $packagename = $filename_arr[0];
            if (!empty($packagename)) {
                $packagepath = "packages/5.1.0/mandatory/{$file}";
                installVtlibModule($packagename, $packagepath);
            }
        }
        closedir($handle);
    }
}
Esempio n. 9
0
 /**
  * Function installs all the available modules
  */
 public static function installModules()
 {
     require_once 'vtlib/Vtiger/Package.php';
     require_once 'vtlib/Vtiger/Module.php';
     require_once 'include/utils/utils.php';
     $moduleFolders = array('packages/vtiger/mandatory', 'packages/vtiger/optional');
     foreach ($moduleFolders as $moduleFolder) {
         if ($handle = opendir($moduleFolder)) {
             while (false !== ($file = readdir($handle))) {
                 $packageNameParts = explode(".", $file);
                 if ($packageNameParts[count($packageNameParts) - 1] != 'zip') {
                     continue;
                 }
                 array_pop($packageNameParts);
                 $packageName = implode("", $packageNameParts);
                 if (!empty($packageName)) {
                     $packagepath = "{$moduleFolder}/{$file}";
                     $package = new Vtiger_Package();
                     $module = $package->getModuleNameFromZip($packagepath);
                     if ($module != null) {
                         $moduleInstance = Vtiger_Module::getInstance($module);
                         if ($moduleInstance) {
                             updateVtlibModule($module, $packagepath);
                         } else {
                             installVtlibModule($module, $packagepath);
                         }
                     }
                 }
             }
             closedir($handle);
         }
     }
 }
 updateVtlibModule('Import', 'packages/vtiger/mandatory/Import.zip');
 updateVtlibModule('MailManager', 'packages/vtiger/mandatory/MailManager.zip');
 updateVtlibModule('Mobile', 'packages/vtiger/mandatory/Mobile.zip');
 updateVtlibModule('ModTracker', 'packages/vtiger/mandatory/ModTracker.zip');
 updateVtlibModule('Services', "packages/vtiger/mandatory/Services.zip");
 updateVtlibModule('ServiceContracts', "packages/vtiger/mandatory/ServiceContracts.zip");
 updateVtlibModule('WSAPP', 'packages/vtiger/mandatory/WSAPP.zip');
 updateVtlibModule('Assets', 'packages/vtiger/optional/Assets.zip');
 updateVtlibModule('CustomerPortal', 'packages/vtiger/optional/CustomerPortal.zip');
 updateVtlibModule('ModComments', "packages/vtiger/optional/ModComments.zip");
 updateVtlibModule('Projects', "packages/vtiger/optional/Projects.zip");
 updateVtlibModule('RecycleBin', 'packages/vtiger/optional/RecycleBin.zip');
 updateVtlibModule('SMSNotifier', "packages/vtiger/optional/SMSNotifier.zip");
 updateVtlibModule("Webforms", "packages/vtiger/optional/Webforms.zip");
 installVtlibModule('Google', 'packages/vtiger/optional/Google.zip');
 installVtlibModule('EmailTemplates', 'packages/vtiger/optional/EmailTemplates.zip');
 // updated language packs.
 //	updateVtlibModule('PT Brasil', 'packages/vtiger/optional/BrazilianLanguagePack_bz_bz.zip');
 //	updateVtlibModule('British English', 'packages/vtiger/optional/BritishLanguagePack_br_br.zip');
 //	updateVtlibModule('Dutch', 'packages/vtiger/optional/Dutch.zip');
 //	updateVtlibModule('Deutsch', 'packages/vtiger/optional/Deutsch.zip');
 //	updateVtlibModule('French', 'packages/vtiger/optional/French.zip');
 //	updateVtlibModule('Hungarian', 'packages/vtiger/optional/Hungarian.zip');
 //	updateVtlibModule('Mexican Spanish', 'packages/vtiger/optional/MexicanSpanishLanguagePack_es_mx.zip');
 //	updateVtlibModule('Spanish', 'packages/vtiger/optional/Spanish.zip');
 //	installVtlibModule('Italian', 'packages/vtiger/optional/ItalianLanguagePack_it_it.zip');
 //	installVtlibModule('RomanianLanguagePack_rm_rm', 'packages/vtiger/optional/RomanianLanguagePack_rm_rm.zip');
 //	installVtlibModule('Turkce', 'packages/vtiger/optional/TurkishLanguagePack_tr_tr.zip');
 //	installVtlibModule('Russian', 'packages/vtiger/optional/Russian.zip');
 //	installVtlibModule('Polish', 'packages/vtiger/optional/PolishLanguagePack_pl_pl.zip');
 //	installVtlibModule('Russian', 'packages/vtiger/optional/Russian.zip');