diff --git a/admin-dev/index.php b/admin-dev/index.php index 8622c1334..9af8d30a1 100644 --- a/admin-dev/index.php +++ b/admin-dev/index.php @@ -68,7 +68,6 @@ if (empty($tab) and !sizeof($_POST)) }); });'; - echo '
diff --git a/admin-dev/tabs/AdminCounty.php b/admin-dev/tabs/AdminCounty.php index d97d0eca0..418f7b0ff 100644 --- a/admin-dev/tabs/AdminCounty.php +++ b/admin-dev/tabs/AdminCounty.php @@ -38,7 +38,7 @@ class AdminCounty extends AdminTab $this->fieldsDisplay = array( 'id_county' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'name' => array('title' => $this->l('County'), 'width' => 130, 'filter_key' => 'b!name'), + 'name' => array('title' => $this->l('County'), 'width' => 130, 'filter_key' => 'a!name'), 'state' => array('title' => $this->l('State'), 'width' => 70, 'filter_key' => 's!name'), 'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active')); diff --git a/admin-dev/tabs/AdminImport.php b/admin-dev/tabs/AdminImport.php index 4caaaf2ae..37f7276d2 100644 --- a/admin-dev/tabs/AdminImport.php +++ b/admin-dev/tabs/AdminImport.php @@ -610,7 +610,7 @@ class AdminImport extends AdminTab $product = new Product((int)($info['id'])); $categoryData = Product::getProductCategories((int)($product->id)); foreach ($categoryData as $tmp) - $product->category[] = $tmp['id_category']; + $product->category[] = $tmp; } else $product = new Product(); diff --git a/admin-dev/tabs/AdminUpgrade.php b/admin-dev/tabs/AdminUpgrade.php index 2faf89ff8..d50bdad94 100755 --- a/admin-dev/tabs/AdminUpgrade.php +++ b/admin-dev/tabs/AdminUpgrade.php @@ -25,13 +25,14 @@ * International Registered Trademark & Property of PrestaShop SA */ -include_once(_PS_ADMIN_DIR_.'/tabs/AdminPreferences.php'); +require_once(_PS_ADMIN_DIR_.'/tabs/AdminPreferences.php'); class AdminUpgrade extends AdminPreferences { public $ajax = false; public $nextResponseType = 'json'; // json, xml public $next = 'N/A'; + public $isModule = false; /** * set to false if the current step is a loop @@ -39,12 +40,31 @@ class AdminUpgrade extends AdminPreferences * @var boolean */ public $stepDone = true; + public $status = true; public $error ='0'; public $nextDesc = '.'; public $nextParams = array(); public $nextQuickInfo = array(); public $currentParams = array(); - public $autoupgradePath = ''; + /** + * @var array theses values will be automatically added in "nextParams" + * if their properties exists + */ + public $ajaxParams = array( + // autoupgrade options + 'dontBackupImages', + 'keepDefaultTheme', + 'keepTrad', + 'manualMode', + 'desactivateCustomModule', + + // + 'backupDbFilename', + 'backupFilesFilename', + + + ); + public $autoupgradePath = null; /** * autoupgradeDir * @@ -53,6 +73,7 @@ class AdminUpgrade extends AdminPreferences public $autoupgradeDir = 'autoupgrade'; public $latestRootDir = ''; public $prodRootDir = ''; + public $adminDir = ''; public $rootWritable = false; public $svnDir = 'svn'; public $destDownloadFilename = 'prestashop.zip'; @@ -64,6 +85,9 @@ class AdminUpgrade extends AdminPreferences private $excludeFilesFromUpgrade = array(); private $excludeAbsoluteFilesFromUpgrade = array(); + private $backupFilesFilename = ''; + private $backupDbFilename = ''; + /** * int loopBackupFiles : if your server has a low memory size, lower this value * @TODO remove the static, add a const, and use it like this : min(AdminUpgrade::DEFAULT_LOOP_ADD_FILE_TO_ZIP,Configuration::get('LOOP_ADD_FILE_TO_ZIP'); @@ -84,13 +108,75 @@ class AdminUpgrade extends AdminPreferences protected $_includeContainer = false; + public function encrypt($string) + { + return md5(_COOKIE_KEY_.$string); + } + public function checkToken() + { + // simple checkToken in ajax-mode, to be free of Cookie class (and no Tools::encrypt() too ) + if ($this->ajax) + return ($_COOKIE['autoupgrade'] == $this->encrypt($_COOKIE['id_employee'])); + else + return parent::checkToken(); + } + + /** + * create cookies id_employee, id_tab and autoupgrade (token) + */ + public function createCustomToken() + { + // ajax-mode for autoupgrade, we can't use the classic authentication + // so, we'll create a cookie in admin dir, based on cookie key + global $cookie; + $id_employee = $cookie->id_employee; + + $cookiePath = __PS_BASE_URI__.str_replace($this->prodRootDir,'',trim($this->adminDir,'/')); + setcookie('id_employee', $id_employee, time()+3600, $cookiePath); + setcookie('id_tab', $this->id, time()+3600, $cookiePath); + setcookie('autoupgrade', $this->encrypt($id_employee), time()+3600, $cookiePath); + return false; + } + + + + public function viewAccess($disable = false){ + if ($this->ajax) + return true; + else + { + // simple access : we'll allow only admin + global $cookie; + if ($cookie->profile == 1) + return true; + } + return false; + } + public function __construct() { @set_time_limit(0); @ini_set('max_execution_time', '0'); $this->init(); + // retrocompatibility when used in module : Tab can't work, + // but we saved the tab id in a cookie. + if(class_exists('Tab',false)) parent::__construct(); + else + $this->id = $_COOKIE['id_tab']; + } + + protected function l($string, $class = 'AdminTab', $addslashes = FALSE, $htmlentities = TRUE) + { + if($this->isModule) + { + $currentClass = get_class($this); + // need to be called in order to populate $classInModule + return SelfModule::findTranslation('autoupgrade', $string, 'AdminSelfUpgrade'); + } + else + return parent::l($string, $class, $addslashes, $htmlentities); } /** @@ -114,6 +200,11 @@ class AdminUpgrade extends AdminPreferences 'title' => $this->l('Keep translations'), 'cast' => 'intval', 'validation' => 'isBool', 'type' => 'bool', 'desc'=>$this->l('If set too yes, you will keep all your translations'), ); + + $this->_fieldsAutoUpgrade['PS_AUTOUP_CUSTOM_MOD_DESACT'] = array( + 'title' => $this->l('Desactivate custom modules'), 'cast' => 'intval', 'validation' => 'isBool', + 'type' => 'bool', 'desc'=>$this->l('If you don\'t desactivate your modules, you can have some compatibility problem and the Modules page might not load correctly.'), + ); // allow manual mode only for dev if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_) $this->_fieldsAutoUpgrade['PS_AUTOUP_MANUAL_MODE'] = array( @@ -130,6 +221,13 @@ class AdminUpgrade extends AdminPreferences } } + public function configOk() + { + $allowed = (ConfigurationTest::test_fopen() && $this->rootWritable); + $allowed &= !Configuration::get('PS_SHOP_ENABLE'); + + return $allowed; + } /** * isUpgradeAllowed checks if all server configuration is valid for upgrade * @@ -158,6 +256,12 @@ class AdminUpgrade extends AdminPreferences $this->adminDir = _PS_ADMIN_DIR_; // test writable recursively + if ($this->isModule) + { + require_once('ConfigurationTest.php'); + if(!class_exists('ConfigurationTest', false) AND class_exists('ConfigurationTestCore')) + eval('class ConfigurationTest extends ConfigurationTestCore{}'); + } if (ConfigurationTest::test_dir($this->prodRootDir,true)) $this->rootWritable = true; @@ -167,14 +271,15 @@ class AdminUpgrade extends AdminPreferences // If you have defined this somewhere, you know what you do if (defined('_PS_ALLOW_UPGRADE_UNSTABLE_') AND _PS_ALLOW_UPGRADE_UNSTABLE_ AND function_exists('svn_checkout')) { + if (!$this->isModule OR class_exists('Configuration',false)) $this->useSvn = Configuration::get('PS_AUTOUP_USE_SVN'); } else $this->useSvn = false; // from $_POST or $_GET - $this->action = Tools::getValue('action'); - $this->currentParams = Tools::getValue('params'); + $this->action = empty($_REQUEST['action'])?null:$_REQUEST['action']; + $this->currentParams = empty($_REQUEST['params'])?null:$_REQUEST['params']; // If not exists in this sessions, "create" // session handling : from current to next params @@ -184,20 +289,30 @@ class AdminUpgrade extends AdminPreferences if (isset($this->currentParams['filesToUpgrade'])) $this->nextParams['filesToUpgrade'] = $this->currentParams['filesToUpgrade']; + if (class_exists('Configuration',false)) + { + $time = time(); $this->backupDbFilename = Configuration::get('UPGRADER_BACKUPDB_FILENAME'); if(!file_exists($this->backupDbFilename)) { + // If not exists, the filename is generated by Backup.php $this->backupDbFilename = ''; - Configuration::updateValue('UPGRADER_BACKUPDB_FILENAME',''); + Configuration::updateValue('UPGRADER_BACKUPDB_FILENAME', $this->backupDbFilename); } + $this->backupFilesFilename = Configuration::get('UPGRADER_BACKUPFILES_FILENAME'); if(!file_exists($this->backupFilesFilename)) { - $this->backupFilesFilename = ''; - Configuration::updateValue('UPGRADER_BACKUPFILES_FILENAME',''); + $this->backupFilesFilename = $this->autoupgradePath . DIRECTORY_SEPARATOR . 'backupfile-'.date('Y-m-d').'-'.$time.'.zip'; + Configuration::updateValue('UPGRADER_BACKUPFILES_FILENAME', $this->backupFilesFilename); + } + } + else{ + // backupDbFilename should never be empty + $this->backupDbFilename = $this->currentParams['backupDbFilename']; + // backupFilesFilename should never etc. + $this->backupFilesFilename = $this->currentParams['backupFilesFilename']; } - - $this->autoupgradePath = $this->adminDir.DIRECTORY_SEPARATOR.$this->autoupgradeDir; if (!file_exists($this->autoupgradePath)) @@ -214,11 +329,23 @@ class AdminUpgrade extends AdminPreferences // @TODO future option // $this->testRootDir = $this->autoupgradePath.DIRECTORY_SEPARATOR.'test'; - /* optional skips */ + /* option */ + if (class_exists('Configuration',false)) + { $this->dontBackupImages = Configuration::get('PS_AUTOUP_DONT_SAVE_IMAGES'); $this->keepDefaultTheme = Configuration::get('PS_AUTOUP_KEEP_DEFAULT_THEME'); $this->keepTrad = Configuration::get('PS_AUTOUP_KEEP_TRAD'); $this->manualMode = Configuration::get('PS_AUTOUP_MANUAL_MODE'); + $this->desactivateCustomModule = Configuration::get('PS_AUTOUP_CUSTOM_MOD_DESACT'); + } + else + { + $this->dontBackupImages = $this->currentParams['dontBackupImages']; + $this->keepDefaultTheme = $this->currentParams['keepDefaultTheme']; + $this->keepTrad = $this->currentParams['keepTrad']; + $this->manualMode = $this->currentParams['manualMode']; + $this->desactivateCustomModule = $this->current['desactivateCustomModule']; + } // We can add any file or directory in the exclude dir : theses files will be not removed or overwritten // @TODO cache should be ignored recursively, but we have to reconstruct it after upgrade // - compiled from smarty @@ -264,9 +391,11 @@ class AdminUpgrade extends AdminPreferences { $this->_setFields(); - if (!empty($_POST)) + if (sizeof($_POST)>0) + { $this->_postConfig($this->_fieldsAutoUpgrade); } + } public function ajaxProcessUpgradeComplete() { @@ -277,8 +406,19 @@ class AdminUpgrade extends AdminPreferences public function ajaxProcessUpgradeNow() { $this->nextDesc = $this->l('Starting upgrade ...'); - $this->next = 'desactiveShop'; + + if ($this->useSvn) + { + $this->next = 'svnCheckout'; + $this->nextDesc = $this->l('switching to svn checkout (useSvn set to true)'); } + else + { + $this->next = 'download'; + $this->nextDesc = $this->l('Shop desactivated. Now downloading (this can takes some times )...'); + } + } + public function ajaxProcessSvnExport() { if ($this->useSvn) @@ -317,7 +457,9 @@ class AdminUpgrade extends AdminPreferences } public function ajaxProcessUnzip(){ - // @TODO : not require_once like that. + if ($this->isModule AND !class_exists('Tools',false)) + require_once('Tools.php'); + $filepath = $this->getFilePath(); $destExtract = $this->autoupgradePath.DIRECTORY_SEPARATOR.'latest'; if (file_exists($destExtract)) @@ -420,21 +562,6 @@ class AdminUpgrade extends AdminPreferences $this->nextParams['filesToUpgrade'] = $this->toUpgradeFileList; } - public function ajaxProcessDesactiveShop() - { - $this->ShopActiveValue = Configuration::get('PS_SHOP_ENABLE'); - Configuration::updateValue('PS_SHOP_ENABLE',0); - if ($this->useSvn) - { - $this->next = 'svnCheckout'; - $this->nextDesc = $this->l('switching to svn checkout (useSvn set to true)'); - } - else - { - $this->next = 'download'; - $this->nextDesc = $this->l('Shop desactivated. Now downloading (this can takes some times )...'); - } - } public function ajaxProcessUpgradeFiles(){ // @TODO : @@ -488,7 +615,7 @@ class AdminUpgrade extends AdminPreferences } /** - * model_doUpgrade prepare the call to doUpgrade.php file (like model.php) + * _modelDoUpgrade prepare the call to doUpgrade.php file (like model.php) * * @return void */ @@ -528,7 +655,7 @@ class AdminUpgrade extends AdminPreferences // Copy from model.php /////////////////////// $upgrader = $this->upgrader; - $upgrader->checkPSVersion(); + $upgrader->checkPSVersion(true); define('INSTALL_VERSION', $upgrader->version_num); // now the install dir to use is in a subdirectory of the admin dir @@ -573,8 +700,8 @@ class AdminUpgrade extends AdminPreferences // @TODO // 4) upgrade // install/model.php?_=1309193641470&method=doUpgrade&customModule=desactivate - if (isset($this->currentParams['customModule'])) - $_GET['customModule'] = $this->currentParams['customModule']; + if (!empty($this->currentParams['desactivateCustomModule'])) + $_GET['customModule'] = 'desactivate'; if (!$this->_modelDoUpgrade()) { @@ -655,7 +782,7 @@ class AdminUpgrade extends AdminPreferences // 1st, need to analyse what was wrong. $this->nextParams = $this->currentParams; - if (!empty($this->backupFilesFilename)) + if (!empty($this->backupFilesFilename) AND file_exists($this->backupFilesFilename)) { $this->next = 'restoreFiles'; $this->status = 'ok'; @@ -663,7 +790,7 @@ class AdminUpgrade extends AdminPreferences } else { - if (!empty($this->backupDbFilename)) + if (!empty($this->backupDbFilename) AND file_exists($this->backupDbFilename)) { $this->next = 'restoreDb'; $this->status = 'ok'; @@ -689,7 +816,7 @@ class AdminUpgrade extends AdminPreferences public function ajaxProcessRestoreFiles() { // @TODO : workaround max_execution_time / ajax batch unzip - if (!empty($this->backupFilesFilename)) + if (!empty($this->backupFilesFilename) AND file_exists($this->backupFilesFilename)) { // cleanup current PS tree $list = $this->_listArchivedFiles(); @@ -805,6 +932,55 @@ class AdminUpgrade extends AdminPreferences public function ajaxProcessBackupDb() { + if(!class_exists('ObjectModel',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/ObjectModel.php'); + if(!class_exists('ObjectModel',false)) + eval('Class ObjectModel extends ObjectModelCore{}'); + } + + if(!class_exists('Language',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/Language.php'); + if(!class_exists('Language',false)) + eval('Class Language extends LanguageCore{}'); + } + if(!class_exists('Validate',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/Validate.php'); + if(!class_exists('Validate',false)) + eval('Class Validate extends ValidateCore{}'); + } + if(!class_exists('Db',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/Db.php'); + if(!class_exists('Db',false)) + eval('abstract Class Db extends DbCore{}'); + } + if(!class_exists('MySQL',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/MySQL.php'); + if(!class_exists('MySQL',false)) + eval('Class MySQL extends MySQLCore{}'); + } + if(!class_exists('Configuration',false)) + { + require_once(_PS_ROOT_DIR_.'/classes/Configuration.php'); + if(!class_exists('Configuration',false)) + eval('Class Configuration extends ConfigurationCore{}'); + } + if(!class_exists('Backup',false)) + { + require_once('Backup.php'); + if(!class_exists('ObjectModel',false)) + eval('Class ObjectModel extends ObjectModelCore{}'); + } + + if(!defined('_PS_MAGIC_QUOTES_GPC_')) + define('_PS_MAGIC_QUOTES_GPC_', get_magic_quotes_gpc()); + if(!defined('_PS_MYSQL_REAL_ESCAPE_STRING_')) + define('_PS_MYSQL_REAL_ESCAPE_STRING_', function_exists('mysql_real_escape_string')); + $backup = new Backup(); // for backup db, use autoupgrade directory // @TODO : autoupgrade must not be static @@ -813,6 +989,9 @@ class AdminUpgrade extends AdminPreferences $res = $backup->add(); if ($res) { + $this->nextParams['backupDbFilename'] = $backup->id; + // We need to load configuration to use it ... + Configuration::loadConfiguration(); Configuration::updateValue('UPGRADER_BACKUPDB_FILENAME', $backup->id); $this->next = 'upgradeFiles'; @@ -837,10 +1016,6 @@ class AdminUpgrade extends AdminPreferences if (file_exists($this->backupFilesFilename)) unlink($this->backupFilesFilename); - $time = time(); - $this->backupFilesFilename = $this->autoupgradePath . DIRECTORY_SEPARATOR . 'backupfile-'.date('Y-m-d').'-'.$time.'.zip'; - - Configuration::updateValue('UPGRADER_BACKUPFILES_FILENAME', $this->backupFilesFilename); $this->nextQuickInfo[] = sprintf($this->l('backup files initialized in %s'), $this->backupFilesFilename); } @@ -1068,10 +1243,12 @@ class AdminUpgrade extends AdminPreferences $return['next'] = $this->next; $return['status'] = $this->next == 'error' ? 'error' : 'ok'; $return['nextDesc'] = $this->nextDesc; - if (!empty($this->nextParams)) + + foreach($this->ajaxParams as $v) + if(property_exists($this,$v)) + $this->nextParams[$v] = $this->$v; + $return['nextParams'] = $this->nextParams; - else - $return['nextParams'] = array(); $return['nextParams']['typeResult'] = $this->nextResponseType; @@ -1086,8 +1263,9 @@ class AdminUpgrade extends AdminPreferences */ public function displayConf() { - if (version_compare(_PS_VERSION_,'1.4.4.0','<') AND false) + if(!$this->isModule) { + if (version_compare(_PS_VERSION_,'1.4.4.0','<') AND false) $this->_errors[] = Tools::displayError('This class depends of several files modified in 1.4.4.0 version and should not be used in an older version'); } parent::displayConf(); @@ -1096,10 +1274,12 @@ class AdminUpgrade extends AdminPreferences public function ajaxPreProcess() { - if (Tools::getValue('responseType') == 'json') + if (!empty($_POST['responseType']) AND $_POST['responseType'] == 'json') header('Content-Type: application/json'); - $action = (Tools::getValue('action')); + if(!empty($_POST['action'])) + { + $action = $_POST['action']; if (isset(self::$skipAction[strtolower($action)])) { $this->next = self::$skipAction[$action]; @@ -1113,6 +1293,7 @@ class AdminUpgrade extends AdminPreferences $this->next = 'error'; $this->error = '1'; } + } if ($this->apacheModExists('mod_evasive')) sleep(1); @@ -1126,16 +1307,29 @@ class AdminUpgrade extends AdminPreferences */ function apacheModExists($name) { + if(function_exists('apache_get_modules')) + { static $apacheModuleList = null; - if (!is_array($apacheModuleList) AND function_exists('apache_get_modules')) - { + if (!is_array($apacheModuleList)) $apacheModuleList = apache_get_modules(); - } + // we need strpos (example can be evasive20 foreach($apacheModuleList as $module) if (strpos($name, $module)!==false) return true; + } + else{ + // If apache_get_modules does not exists, + // one solution should be parsing httpd.conf, + // but we could simple parse phpinfo(INFO_MODULES) return string + ob_start(); + phpinfo(INFO_MODULES); + $phpinfo = ob_get_contents(); + ob_end_clean(); + if (strpos($phpinfo, $module) !== false) + return true; + } return false; } @@ -1215,9 +1409,9 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where { echo '
'.$this->l('rollback').'

'; } - if (!empty($this->backupFilesFilename)) + if (!empty($this->backupFilesFilename) AND file_exists($this->backupFilesFilename)) echo '
restoreFiles '.sprintf($this->l('click to restore %s'),$this->backupFilesFilename).'

'; - if (!empty($this->backupDbFilename)) + if (!empty($this->backupDbFilename) AND file_exists($this->backupDbFilename)) echo '
restoreDb '.sprintf($this->l('click to restore %s'), $this->backupDbFilename).'

'; echo '
'; @@ -1225,6 +1419,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where private function _displayUpgraderForm() { + global $cookie; $pleaseUpdate = $this->upgrader->checkPSVersion(); echo '
'; @@ -1248,15 +1443,15 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where if (Configuration::get('PS_SHOP_ENABLE')) { - $srcShopStatus = '../img/admin/enabled.gif'; - $label = $this->l('Active'); + $srcShopStatus = '../img/admin/disabled.gif'; + $label = $this->l('No'); } else { - $srcShopStatus = '../img/admin/disabled.gif'; - $label = $this->l('Inactive'); + $srcShopStatus = '../img/admin/enabled.gif'; + $label = $this->l('Yes'); } - echo ''.$this->l('Shop status').' : '.''.$label.'

'; + echo ''.$this->l('Shop desactivated').' : '.''.$label.'

'; $max_exec_time = ini_get('max_execution_time'); if ($max_exec_time == 0) @@ -1293,16 +1488,23 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where echo '
'; if ($this->upgrader->needUpgrade) { + if($this->configOk()) echo ''.$this->l('Upgrade PrestaShop now !').''; + else + echo $this->displayWarning('Your current configuration does not allow upgrade.'); } else { - echo '

'.$this->l('Your shop is already up to date').'

'; + echo ''.$this->l('Your shop is already up to date.').' '; } + echo ''.sprintf($this->l('last datetime check : %s '),date('Y-m-d H:i:s',Configuration::get('PS_LAST_VERSION_CHECK'))).' + '.$this->l('Please click to refresh').' + '; echo' -
'; @@ -1315,7 +1517,6 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where echo '
'.$this->l('Step').''; echo '

'.$this->l('Upgrade steps').'

'; echo '
'; - echo 'desactiveShop'; echo 'download'; echo 'unzip'; // unzip in autoupgrade/latest echo 'removeSamples'; // remove samples (iWheel images) @@ -1364,6 +1565,19 @@ echo ''; public function display() { + if(isset($_GET['refreshCurrentVersion'])) + { + $upgrader = new Upgrader(); + $upgrader->checkPSVersion(true); + } + echo ''; $this->displayWarning($this->l('This function is experimental. It\'s highly recommended to make a backup of your files and database before starting the upgrade process.')); // update['name'] = version name @@ -1373,6 +1587,7 @@ echo ''; if ($this->isUpgradeAllowed()) { + $this->createCustomToken(); if ($this->useSvn) echo '

'.$this->l('Unstable upgrade').'

'.$this->l('Your current configuration indicate you want to upgrade your system from the unstable development branch, with no version number. If you upgrade, you will not be able to follow the official release process anymore').'.

@@ -1384,6 +1599,14 @@ echo ''; echo '
'; $this->_displayForm('autoUpgradeOptions',$this->_fieldsAutoUpgrade,''.$this->l('Options').'', '','prefs'); + + if ($this->isModule) + { + echo ' + '; + } echo ''; } else @@ -1443,6 +1666,8 @@ function addQuickInfo(arrQuickInfo){ $js .= 'var manualMode = false;'; $js .= ' +var firstTimeParams = '.$this->buildAjaxResult().'; +firstTimeParams = firstTimeParams.nextParams; $(document).ready(function(){ $(".upgradestep").click(function(e) @@ -1459,10 +1684,10 @@ $(document).ready(function(){ // prepare available button here, without params ? - prepareNextButton("#upgradeNow",{}); - prepareNextButton("#rollback",{}); - prepareNextButton("#restoreDb",{}); - prepareNextButton("#restoreFiles",{}); + prepareNextButton("#upgradeNow",firstTimeParams); + prepareNextButton("#rollback",firstTimeParams); + prepareNextButton("#restoreDb",firstTimeParams); + prepareNextButton("#restoreFiles",firstTimeParams); }); @@ -1506,6 +1731,11 @@ function parseXMLResult(xmlRet) return ret }; +function afterUpgradeComplete() +{ + $("#pleaseWait").hide(); + $("#infoStep").html("

'.$this->l('Upgrade Complete ! ').'

"); +} /** * afterBackupDb display the button * @@ -1536,13 +1766,13 @@ function afterBackupFiles() function doAjaxRequest(action, nextParams){ req = $.ajax({ type:"POST", - url : "'.str_replace('index', 'ajax-tab', self::$currentIndex).'", + url : "'.($this->isModule? __PS_BASE_URI__ . trim($this->adminDir,'/').'/autoupgrade/ajax-upgradetab.php' : str_replace('index','ajax-tab',self::$currentIndex)).'", async: true, data : { - dir:"'.$this->adminDir.'", + dir:"'.trim($this->adminDir,'/').'", ajaxMode : "1", token : "'.$this->token.'", - tab : "AdminUpgrade", + tab : "'.get_class($this).'", action : action, params : nextParams }, @@ -1564,13 +1794,28 @@ function doAjaxRequest(action, nextParams){ } else { + try{ res = $.parseJSON(res); nextParams = res.nextParams; } + catch(e){ + res = {status : "error"}; + alert("error during "+action); + /* + nextParams = { + error:"0", + next:"cancelUpgrade", + nextDesc:"Error detected during ["+action+"] step, reverting...", + nextQuickInfo:[], + status:"ok", + "stepDone":true + } + */ + } + } if (res.status == "ok") { - // a $("#"+action).addClass("done"); if (res.stepDone) $("#"+action).addClass("stepok"); @@ -1678,8 +1923,9 @@ function handleError(res) // In case the rollback button has been desactivated, just re-enable it prepareNextButton("#rollback",res.nextParams); // ask if you want to rollback - // @TODO !!! - if (confirm(res.NextDesc+"\r\r'.$this->l('Do you want to rollback ?').'")) + // TODO : be sure there is useful infos + addQuickInfo(res); + if (confirm(res+"\r\r'.$this->l('Do you want to rollback ?').'")) { if (manualMode) alert("'.$this->l('Please go manually go to rollback button').'"); @@ -1698,7 +1944,8 @@ function handleError(res) // as we need theses files for restore operation, we can't remove them. // They will be overwritten $skipDirs = array('backups', 'pclzip', 'autoupgrade', '.', '..', '.svn'); - $skipFiles = array('autoload.php', 'init.php', 'settings.inc.php', 'config.inc.php', 'Tools.php', 'AdminUpgrade.php', 'ajax-tab.php'); + $skipFiles = array('autoload.php', 'init.php', 'settings.inc.php', 'config.inc.php', 'Tools.php', 'AdminUpgrade.php'); + $skipFiles[] = $this->isModule?'ajax-upgradetab.php':'ajax-tab.php'; if (is_dir($path)) { $fp = opendir($path); diff --git a/classes/Backup.php b/classes/Backup.php index d6b8ae165..e679a4d70 100644 --- a/classes/Backup.php +++ b/classes/Backup.php @@ -36,6 +36,9 @@ class BackupCore /** @var string custom backup directory. */ public $customBackupDir = NULL; + public $psBackupAll = true; + public $psBackupDropTable = true; + /** * Creates a new backup object * @@ -45,6 +48,11 @@ class BackupCore { if ($filename) $this->id = $this->getRealBackupPath($filename); + + $psBackupAll = Configuration::get('PS_BACKUP_ALL'); + $psBackupDropTable = Configuration::get('PS_BACKUP_DROP_TABLE'); + $this->psBackupAll = $psBackupAll !== false ? $psBackupAll : true; + $this->psBackupDropTable = $psBackupDropTable !== false ? $psBackupDropTable : true; } /** @@ -169,7 +177,7 @@ class BackupCore return false; } - if (!Configuration::get('PS_BACKUP_ALL')) + if (!$this->psBackupAll) $ignore_insert_table = array(_DB_PREFIX_.'connections', _DB_PREFIX_.'connections_page', _DB_PREFIX_.'connections_source', _DB_PREFIX_.'guest', _DB_PREFIX_.'statssearch'); else $ignore_insert_table = array(); @@ -228,7 +236,7 @@ class BackupCore fwrite($fp, '/* Scheme for table ' . $schema[0]['Table'] . " */\n"); - if (Configuration::get('PS_BACKUP_DROP_TABLE')) + if ($this->psBackupDropTable) fwrite($fp, 'DROP TABLE IF EXISTS `'.$schema[0]['Table'].'`;'."\n"); fwrite($fp, $schema[0]['Create Table'] . ";\n\n"); diff --git a/classes/PDF.php b/classes/PDF.php index ca968dae0..0d9535574 100644 --- a/classes/PDF.php +++ b/classes/PDF.php @@ -897,6 +897,8 @@ class PDFCore extends PDF_PageGroupCore $priceBreakDown['totalsWithTax'][$product['tax_rate']] = 0; if (!isset($priceBreakDown['totalsEcotax'][$product['tax_rate']])) $priceBreakDown['totalsEcotax'][$product['tax_rate']] = 0; + if (!isset($priceBreakDown['totalsEcotaxWithTax'][$product['tax_rate']])) + $priceBreakDown['totalsEcotaxWithTax'][$product['tax_rate']] = 0; if (!isset($priceBreakDown['totalsWithoutTax'][$product['tax_rate']])) $priceBreakDown['totalsWithoutTax'][$product['tax_rate']] = 0; if (!isset($taxes[$product['tax_rate']])) @@ -950,6 +952,7 @@ class PDFCore extends PDF_PageGroupCore } $priceBreakDown['totalsEcotax'][$product['tax_rate']] += ($product['priceEcotax'] * $product['product_quantity']); + $priceBreakDown['totalsEcotaxWithTax'][$product['tax_rate']] += ($product['priceEcotax'] * (1 + ($product['ecotax_tax_rate'] / 100)) * $product['product_quantity']); if ($priceBreakDown['totalsEcotax'][$product['tax_rate']]) $priceBreakDown['hasEcotax'] = 1; $taxes[$product['tax_rate']] += $vat; @@ -965,9 +968,9 @@ class PDFCore extends PDF_PageGroupCore { $priceBreakDown['totalsWithoutTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate], 2); $priceBreakDown['totalsProductsWithoutTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate], 2); - $priceBreakDown['totalsWithTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsWithoutTax'][$tax_rate] * (1 + $tax_rate / 100), 2); - $priceBreakDown['totalsProductsWithTax'][$tax_rate] = Tools::ps_round($priceBreakDown['totalsProductsWithoutTax'][$tax_rate] * (1 + $tax_rate / 100), 2); - $priceBreakDown['totalsProductsWithTaxAndReduction'][$product['tax_rate']] += Tools::ps_round($priceBreakDown['totalsProductsWithoutTaxAndReduction'][$product['tax_rate']] * (1 + $tax_rate / 100), 2); + $priceBreakDown['totalsWithTax'][$tax_rate] = Tools::ps_round(($priceBreakDown['totalsWithoutTax'][$tax_rate]- $priceBreakDown['totalsEcotax'][$tax_rate]) * (1 + $tax_rate / 100) + $priceBreakDown['totalsEcotaxWithTax'][$tax_rate], 2); + $priceBreakDown['totalsProductsWithTax'][$tax_rate] = Tools::ps_round(($priceBreakDown['totalsProductsWithoutTax'][$tax_rate] - $priceBreakDown['totalsEcotax'][$tax_rate]) * (1 + $tax_rate / 100) + $priceBreakDown['totalsEcotaxWithTax'][$tax_rate], 2); + $priceBreakDown['totalsProductsWithTaxAndReduction'][$tax_rate] += Tools::ps_round(($priceBreakDown['totalsProductsWithoutTaxAndReduction'][$tax_rate] - $priceBreakDown['totalsEcotax'][$tax_rate]) * (1 + $tax_rate / 100) + $priceBreakDown['totalsEcotaxWithTax'][$tax_rate], 2); } else { @@ -1043,7 +1046,7 @@ class PDFCore extends PDF_PageGroupCore $this->SetXY($this->GetX(), $this->GetY() - $lineSize + 3); $this->Cell($w[0], $lineSize, self::l('Products'), 0, 0, 'R'); $this->Cell($w[1], $lineSize, number_format($tax_rate, 3, ',', ' ').' %', 0, 0, 'R'); - $this->Cell($w[2], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithoutTaxAndReduction'][$tax_rate], self::$currency, true)), 0, 0, 'R'); + $this->Cell($w[2], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithoutTaxAndReduction'][$tax_rate] - $priceBreakDown['totalsEcotax'][$tax_rate], self::$currency, true)), 0, 0, 'R'); $this->Cell($w[3], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsProductsWithTaxAndReduction'][$tax_rate] - $priceBreakDown['totalsProductsWithoutTaxAndReduction'][$tax_rate], self::$currency, true)), 0, 0, 'R'); if ($priceBreakDown['hasEcotax']) $this->Cell($w[4], $lineSize, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalsEcotax'][$tax_rate], self::$currency, true)), 0, 0, 'R'); diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index a77370db2..b16738edc 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -222,7 +222,7 @@ abstract class PaymentModuleCore extends Module if (!empty($product['ecotax'])) $ecotaxTaxRate = Tax::getProductEcotaxRate($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); - $product_price = (float)Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), (Product::getTaxCalculationMethod((int)($order->id_customer)) == PS_TAX_EXC ? 2 : 6), NULL, false, false, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}), $specificPrice, true, false); + $product_price = (float)Product::getPriceStatic((int)($product['id_product']), false, ($product['id_product_attribute'] ? (int)($product['id_product_attribute']) : NULL), (Product::getTaxCalculationMethod((int)($order->id_customer)) == PS_TAX_EXC ? 2 : 6), NULL, false, false, $product['cart_quantity'], false, (int)($order->id_customer), (int)($order->id_cart), (int)($order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}), $specificPrice, false, false); $quantityDiscount = SpecificPrice::getQuantityDiscount((int)$product['id_product'], $this->context->shop->getID(), (int)$cart->id_currency, (int)$vat_address->id_country, (int)$customer->id_default_group, (int)$product['cart_quantity']); $unitPrice = Product::getPriceStatic((int)$product['id_product'], true, ($product['id_product_attribute'] ? intval($product['id_product_attribute']) : NULL), 2, NULL, false, true, 1, false, (int)$order->id_customer, NULL, (int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $quantityDiscountValue = $quantityDiscount ? ((Product::getTaxCalculationMethod((int)$order->id_customer) == PS_TAX_EXC ? Tools::ps_round($unitPrice, 2) : $unitPrice) - $quantityDiscount['price'] * (1 + $tax_rate / 100)) : 0.00; diff --git a/classes/Tools.php b/classes/Tools.php index d7df1741a..595f6494a 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1934,14 +1934,28 @@ FileETag INode MTime Size * @param string $type by|way * @param string $value If no index given, use default order from admin -> pref -> products */ - public static function getProductsOrder($type, $value = null) + public static function getProductsOrder($type, $value = null, $prefix = false) { switch ($type) { case 'by' : + $orderByPrefix = ''; + if($prefix) { + if ($value == 'id_product' OR $value == 'date_add') + $orderByPrefix = 'p.'; + elseif ($value == 'name') + $orderByPrefix = 'pl.'; + elseif ($value == 'manufacturer') + { + $orderByPrefix = 'm.'; + } + elseif ($value == 'position') + $orderByPrefix = 'cp.'; + } + $value = (is_null($value) || $value === false || $value === '') ? (int)Configuration::get('PS_PRODUCTS_ORDER_BY') : $value; $list = array(0 => 'name', 1 => 'price', 2 => 'date_add', 3 => 'date_upd', 4 => 'position', 5 => 'manufacturer_name', 6 => 'quantity'); - return ((isset($list[$value])) ? $list[$value] : ((in_array($value, $list)) ? $value : 'position')); + return $orderByPrefix.((isset($list[$value])) ? $list[$value] : ((in_array($value, $list)) ? $value : 'position')); break; case 'way' : diff --git a/classes/Upgrader.php b/classes/Upgrader.php index e4a5012b8..aa1e07877 100644 --- a/classes/Upgrader.php +++ b/classes/Upgrader.php @@ -27,6 +27,7 @@ class UpgraderCore{ const DEFAULT_CHECK_VERSION_DELAY_HOURS = 24; + private static $rss_version_link = 'http://www.prestashop.com/xml/version.xml'; /** * link contains hte url where to download the file * @@ -98,7 +99,7 @@ class UpgraderCore{ if (!($this->autoUpgrade AND $lastCheck) AND ($force OR ($lastCheck < time() - (3600 * Upgrader::DEFAULT_CHECK_VERSION_DELAY_HOURS))) ) { libxml_set_streams_context(stream_context_create(array('http' => array('timeout' => 3)))); - if ($feed = @simplexml_load_file('http://www.prestashop.com/xml/version.xml')) + if ($feed = @simplexml_load_file(self::$rss_version_link)) { $this->version_name = (string)$feed->version->name; $this->version_num = (string)$feed->version->num; diff --git a/controllers/GuestTrackingController.php b/controllers/GuestTrackingController.php index 5ce2ee483..e4c5a13e5 100644 --- a/controllers/GuestTrackingController.php +++ b/controllers/GuestTrackingController.php @@ -39,6 +39,8 @@ class GuestTrackingControllerCore extends FrontController public function process() { + global $link; + parent::process(); if ($id_order = Tools::getValue('id_order') AND $email = Tools::getValue('email')) @@ -116,7 +118,7 @@ class GuestTrackingControllerCore extends FrontController } $this->context->smarty->assign(array( - 'action' => 'guest-tracking.php', + 'action' => $link->getPageLink('guest-tracking.php'), 'errors' => $this->errors )); } diff --git a/install-dev/classes/LanguagesManager.php b/install-dev/classes/LanguagesManager.php index da8c4f431..4beda9429 100644 --- a/install-dev/classes/LanguagesManager.php +++ b/install-dev/classes/LanguagesManager.php @@ -95,9 +95,9 @@ class LanguageManager */ private function setLanguage() { - if ( !empty($_GET['language'])) + if (isset($_GET['language'])) $id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0; - if (empty($id_lang)) + if (!isset($id_lang)) $id_lang = ($this->getIdByHAL()); $this->lang = $this->xml_file->lang[(int)($id_lang)]; } @@ -107,3 +107,4 @@ class LanguageManager return ($this->lang == NULL) ? false : dirname(__FILE__).$this->lang['trad_file']; } } + diff --git a/install-dev/controller.js b/install-dev/controller.js index a5bf754c6..1e03a2da2 100644 --- a/install-dev/controller.js +++ b/install-dev/controller.js @@ -258,7 +258,7 @@ function verifyThisStep() function setInstallerLanguage () { - $("#formSetInstallerLanguage").submit(); + $('#formSetInstallerLanguage').submit(); } function verifyAndSetRequire(firsttime) @@ -446,20 +446,36 @@ function createDB() for (i = 0; countries_ret[i]; i=i+1) { html = html + ''; + else if (id_lang == 2 && countries_ret[i].getAttribute('value') == 6) /* Spain */ + html = html + ' selected="selected" '; + else if (id_lang == 3 && countries_ret[i].getAttribute('value') == 1) /* Germany */ + html = html + ' selected="selected" '; + else if (id_lang == 4 && countries_ret[i].getAttribute('value') == 10) /* Italy */ + html = html + ' selected="selected" '; + html = html + ' >'+countries_ret[i].getAttribute('name')+''; } - $('#infosCountry').html(html); + $('#infosCountry').append(html); html = ''; for (i = 0; timezone_ret[i]; i=i+1) { html = html + ''; } - $('#infosTimezone').html(html); + $('#infosTimezone').append(html); showStep(step+1, 'next'); } else @@ -628,25 +644,25 @@ function moveLanguage(direction) } } -function ajaxRefreshField(nthField, idResultField, fieldsList, inputId) +function ajaxRefreshField(ret, idResultField, fieldMsg) { - var result = fieldsList[nthField].getAttribute("result"); - if (result != "ok") + var pattern = 'field[id='+idResultField+']'; + var result = $(ret).children().find(pattern).attr('result'); + var error = $(ret).children().find(pattern).attr('error'); + + if (error === undefined || result === undefined) + return true; + + if (result != 'ok') { - $("#"+idResultField) - .html( txtError[parseInt(fieldsList[nthField].getAttribute("error"))] ) - .addClass("errorBlock") - .show("slow"); + $('#'+fieldMsg).html(txtError[parseInt(error)]).addClass('errorBlock').show('slow'); if (validShopInfos) - $("#"+inputId).focus(); + $('#'+idResultField).focus(); return false; } else { - $("#"+idResultField) - .html("") - .removeClass("errorBlock") - .show("slow"); + $('#'+fieldMsg).html('').removeClass('errorBlock').show('slow'); return true; } } @@ -664,7 +680,7 @@ function verifyShopInfos() $.ajax( { - url: "model.php", + url: 'model.php', async: true, cache: false, data: @@ -693,21 +709,22 @@ function verifyShopInfos() "&isoCodeLocalLanguage="+isoCodeLocalLanguage, success: function(ret) { - fieldsList = ret.getElementsByTagName('shopConfig')[0].getElementsByTagName('field'); validShopInfos = true; - if (!ajaxRefreshField(0, "resultInfosShop", fieldsList, "infosShop")) validShopInfos = false; - else if (!ajaxRefreshField(4, "resultInfosShop", fieldsList, "validateShop")) validShopInfos = false; - else if (!ajaxRefreshField(1, "resultInfosFirstname", fieldsList, "infosFirstname")) validShopInfos = false; - else if (!ajaxRefreshField(2, "resultInfosName", fieldsList, "infosName")) validShopInfos = false; - else if (!ajaxRefreshField(3, "resultInfosEmail", fieldsList, "infosEmail")) validShopInfos = false; - else if (!ajaxRefreshField(7, "resultInfosPassword", fieldsList, "infosPassword")) validShopInfos = false; - else if (!ajaxRefreshField(8, "resultInfosPasswordRepeat", fieldsList, "infosPasswordRepeat")) validShopInfos = false; - else if (!ajaxRefreshField(9, "resultInfosLanguages", fieldsList, "infosLanguages")) validShopInfos = false; - else if (!ajaxRefreshField(11, "resultInfosSQL", fieldsList, "infosSQL")) validShopInfos = false; - else if (!ajaxRefreshField(10, "resultInfosNotification", fieldsList, "infosNotification")) validShopInfos = false; - else if (!ajaxRefreshField(5, "resultInfosFirstname", fieldsList, "validateFirstname")) validShopInfos = false; - else if (!ajaxRefreshField(6, "resultInfosName", fieldsList, "validateName")) validShopInfos = false; - else if (!ajaxRefreshField(12, "resultCatalogMode", fieldsList, "validateCatalogMode")) validCatalogMode = false; + if (!ajaxRefreshField(ret, 'infosShop', 'resultInfosShop')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosCountry', 'resultInfosCountry')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosTimezone', 'resultInfosTimezone')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'validateShop', 'resultInfosShop')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosFirstname', 'resultInfosFirstname')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosName', 'resultInfosName')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosEmail', 'resultInfosEmail')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosPassword', 'resultInfosPassword')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosPasswordRepeat', 'resultInfosPasswordRepeat')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosLanguages', 'resultInfosLanguages')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosSQL', 'resultInfosSQL')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'infosNotification', 'resultInfosNotification')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'validateFirstname', 'resultInfosFirstname')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'validateName', 'resultInfosName')) validShopInfos = false; + else if (!ajaxRefreshField(ret, 'validateCatalogMode', 'resultCatalogMode')) validCatalogMode = false; else { $('#endShopName').html($('input#infosShop').val()); @@ -721,15 +738,10 @@ function verifyShopInfos() ); } -function autoCheckField(idField, idResultSpan, typeVerif) +function checkRequired(idResultSpan, resValue) { - switch (typeVerif) + if(resValue == "") { - case "required" : - $(idField).blur(function() - { - if($(this).val() == "") - { $(idResultSpan) .show("slow") .addClass("errorBlock") @@ -743,7 +755,15 @@ function autoCheckField(idField, idResultSpan, typeVerif) .html(""); } } - ); + +function autoCheckField(idField, idResultSpan, typeVerif) +{ + switch (typeVerif) + { + case "required" : + $(idField).blur(function() { checkRequired(idResultSpan, $(this).val()); }); + if (idField == '#infosCountry' || idField == '#infosTimezone') + $(idField).change(function() { checkRequired(idResultSpan, $(this).val()); }); break; case "mailFormat" : @@ -998,6 +1018,8 @@ $(document).ready( //autocheck fields autoCheckField("#infosShop", "#resultInfosShop", "required"); autoCheckField("#infosFirstname", "#resultInfosFirstname", "firstnameFormat"); + autoCheckField("#infosCountry", "#resultInfosCountry", "required"); + autoCheckField("#infosTimezone", "#resultInfosTimezone", "required"); autoCheckField("#infosName", "#resultInfosName", "nameFormat"); autoCheckField("#infosEmail", "#resultInfosEmail", "mailFormat"); autoCheckField("#infosPassword", "#resultInfosPassword", "required"); diff --git a/install-dev/index.php b/install-dev/index.php index db6363f03..f2e855564 100644 --- a/install-dev/index.php +++ b/install-dev/index.php @@ -124,10 +124,10 @@ if ($lm->getIncludeTradFilename()) //php to js vars var isoCodeLocalLanguage = "getIsoCodeSelectedLang(); ?>"; var ps_base_uri = ""; - var id_lang = ""; + var id_lang = ; //localWords - var Step1Title = ""; + var Step1Title = ""; var step2title = ""; var step3title = ""; var step4title = ""; @@ -268,6 +268,11 @@ if ($lm->getIncludeTradFilename())
'.lang('Contact us!').'
'.lang('+33 (0)1.40.18.30.04'); ?>
+ getIsoCodeSelectedLang() == 'en'): ?> +
  • +
    '.lang('Contact us!').'
    '.lang('+1 (888) 947-6543'); ?>
    +
  • + @@ -311,7 +316,8 @@ if ($lm->getIncludeTradFilename())
    -

    +

    +