Ejemplo n.º 1
0
 public function process(Vtiger_Request $request)
 {
     $moduleName = $request->getModule();
     $qualifiedModuleName = $request->getModule(false);
     $error_code = '';
     $error_message = '';
     $success_message = '';
     $success = true;
     if (!$request->get("name") && !$request->get("version") && !$request->get("zip")) {
         $error_code = 'error-param';
         $error_message = getTranslatedString("LBL_ERROR_PARAM", $qualifiedModuleName);
         $success = false;
     } else {
         require_once "vtlib/Vtiger/Module.php";
         $module = Vtiger_Module::getInstance($request->get("name"));
         if (empty($module)) {
             require_once "vtlib/Vtiger/PackageImport.php";
             $packageImport = new Vtiger_PackageImport();
             $packageImport->import($request->get("zip"));
             $module = Vtiger_Module::getInstance($request->get("name"));
             if (!empty($module)) {
                 $success_message = getTranslatedString("LBL_INSTALL_SUCCESS", $qualifiedModuleName);
             } else {
                 $error_code = 'error-install';
                 $error_message = getTranslatedString("LBL_INSTALL_ERROR", $qualifiedModuleName);
                 $success = false;
             }
         } else {
             if ($request->get("version") != $module->version) {
                 require_once "vtlib/Vtiger/PackageUpdate.php";
                 $packageUpdate = new Vtiger_PackageUpdate();
                 $packageUpdate->update($module, $request->get("zip"));
                 $success_message = getTranslatedString("LBL_UPDATE_SUCCESS", $qualifiedModuleName);
             } else {
                 $error_code = 'error-version';
                 $error_message = getTranslatedString("LBL_UPDATE_ERROR_VERSION", $qualifiedModuleName);
                 $success = false;
             }
         }
         //Make JSON response
         $response = new Vtiger_Response();
         if (!$success) {
             $response->setError($error_code, $error_message);
         } else {
             $response->setResult(array('message' => $success_message));
         }
         $response->emit();
     }
 }
Ejemplo n.º 2
0
function installAddons()
{
    $packageList = array('module' => array('ConfigEditor', 'Import', 'Integration', 'MailManager', 'Mobile', 'ModTracker', 'PBXManager', 'ServiceContracts', 'Services', 'VtigerBackup', 'WSAPP', 'cbupdater', 'CobroPago' => false, 'Assets' => false, 'CronTasks' => false, 'CustomerPortal' => false, 'FieldFormulas' => false, 'ModComments' => false, 'ProjectMilestone' => false, 'ProjectTask' => false, 'Project' => false, 'RecycleBin' => false, 'SMSNotifier' => false, 'Tooltip' => false, 'Webforms' => false), 'lang' => array('it_it' => true, 'pt_br' => false, 'en_gb' => false, 'de_de' => false, 'nl_nl' => false, 'fr_fr' => false, 'hu_hu' => false, 'es_mx' => false, 'es_es' => false));
    $packageImport = new Vtiger_PackageImport();
    foreach ($packageList as $type => $packages) {
        foreach ($packages as $package => $enabled) {
            if (is_numeric($package)) {
                $package = $enabled;
                $enabled = true;
            }
            switch ($type) {
                case 'module':
                    $packageImport->importManifest('modules/' . $package);
                    vtlib_toggleModuleAccess($package, $enabled, true);
                    break;
                case 'lang':
                    $packageImport->importManifest('include/language/' . $package . '.manifest.xml');
                    vtlib_toggleLanguageAccess($package, $enabled);
                    break;
            }
        }
    }
}
Ejemplo n.º 3
0
 /**
  * Constructor
  */
 function Vtiger_PackageUpdate()
 {
     parent::__construct();
 }
Ejemplo n.º 4
0
$currencyThousandSeparator->helpinfo = "<b>Currency - Grouping Separator</b> <br/><br/>" . "Grouping separator specifies the separator to be used to group " . "the whole number part into hundreds, thousands etc. <br/>" . "<b>Eg:</b> <br/>" . ". => 123.456.789 <br/>" . ", => 123,456,789 <br/>" . "' => 123'456'789 <br/>" . "  => 123 456 789 <br/>" . "\$ => 123\$456\$789 <br/>";
$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);
$packageImport = new Vtiger_PackageImport();
$packageImport->importManifest('modules/ConfigEditor');
vtlib_toggleModuleAccess('ConfigEditor', true, true);
$packageImport->importManifest('modules/WSAPP');
vtlib_toggleModuleAccess('WSAPP', true, true);
$migrationlog->debug("\n\nDB Changes from 5.2.1 to 5.3.0RC  -------- Ends \n\n");
Ejemplo n.º 5
0
 public function addModules()
 {
     $modules = array('QuotesEnquires', 'RequirementCards', 'HolidaysEntitlement', 'PaymentsIn', 'PaymentsOut', 'LettersIn', 'LettersOut', 'NewOrders', 'Reservations');
     foreach ($modules as $module) {
         try {
             if (file_exists('cache/updates/' . $module . '.xml') && !Vtiger_Module::getInstance($module)) {
                 $importInstance = new Vtiger_PackageImport();
                 $importInstance->_modulexml = simplexml_load_file('cache/updates/' . $module . '.xml');
                 $importInstance->import_Module();
                 self::addModuleToMenu($module, (string) $importInstance->_modulexml->parent);
                 unlink('cache/updates/' . $module . '.xml');
             }
         } catch (Exception $e) {
             echo $e->getMessage();
         }
     }
 }
Ejemplo n.º 6
0
 public function addModules()
 {
     try {
         if (file_exists('cache/updates/Ideas.xml') && !Vtiger_Module::getInstance('Ideas')) {
             $importInstance = new Vtiger_PackageImport();
             $importInstance->_modulexml = simplexml_load_file('cache/updates/Ideas.xml');
             $importInstance->import_Module();
             self::addModuleToMenu('Ideas', (string) $importInstance->_modulexml->parent);
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
Ejemplo n.º 7
0
 public function addModule()
 {
     global $log;
     $log->debug("Entering VT620_to_YT::addModule() method ...");
     $modules = array('OSSPdf', 'OSSMail', 'OSSMailTemplates', 'Password', 'OSSTimeControl', 'OSSMailScanner', 'OSSMailView', 'OSSDocumentControl', 'OSSProjectTemplates', 'OSSOutsourcedServices', 'OSSSoldServices', 'OutsourcedProducts', 'OSSPasswords', 'OSSEmployees', 'Calculations', 'OSSCosts', 'AJAXChat', 'ApiAddress', 'CallHistory', 'Ideas', 'QuotesEnquires', 'RequirementCards', 'HolidaysEntitlement', 'PaymentsIn', 'PaymentsOut', 'LettersIn', 'LettersOut', 'NewOrders', 'Reservations');
     foreach ($modules as $module) {
         try {
             if (!self::checkModuleExists($module) && file_exists('install/migrate_schema/VT620_to_YT/' . $module . '.xml')) {
                 $importInstance = new Vtiger_PackageImport();
                 $importInstance->_modulexml = simplexml_load_file('install/migrate_schema/VT620_to_YT/' . $module . '.xml');
                 $importInstance->import_Module();
             }
         } catch (Exception $e) {
             Install_InitSchema_Model::addMigrationLog('addModule ' . $e->getMessage(), 'error');
         }
     }
     Install_InitSchema_Model::addMigrationLog('addModule');
     $log->debug("Exiting VT620_to_YT::addModule() method ...");
 }
Ejemplo n.º 8
0
 public function addModules()
 {
     try {
         if (file_exists('cache/updates/CallHistory.xml') && !Vtiger_Module::getInstance('CallHistory')) {
             $importInstance = new Vtiger_PackageImport();
             $importInstance->_modulexml = simplexml_load_file('cache/updates/CallHistory.xml');
             $importInstance->import_Module();
         }
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }