// Merge with revision 7841
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@7844 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+4
-4
@@ -628,7 +628,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
$protocol = (!empty($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) != 'off') ? 'https' : 'http';
|
||||
$isoUser = Language::getIsoById(intval($cookie->id_lang));
|
||||
$isoCountry = Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
$context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
$stream_context = stream_context_create(array('http' => array('method'=>"GET", 'timeout' => 5)));
|
||||
|
||||
// SCREENCAST
|
||||
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
|
||||
@@ -637,7 +637,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
$result['screencast'] = 'NOK';
|
||||
|
||||
// PREACTIVATION
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $context);
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/preactivation/preactivation-block.php?version=1.0&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&protocol='.$protocol.'&url='.urlencode($_SERVER['HTTP_HOST']).'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang.'&email='.urlencode(Configuration::get('PS_SHOP_EMAIL')).'&date_creation='._PS_CREATION_DATE_.'&v='._PS_VERSION_.'&security='.md5(Configuration::get('PS_SHOP_EMAIL')._COOKIE_IV_), false, $stream_context);
|
||||
if (!$content)
|
||||
$result['partner_preactivation'] = 'NOK';
|
||||
else
|
||||
@@ -663,7 +663,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
}
|
||||
|
||||
// DISCOVER PRESTASHOP
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context);
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $stream_context);
|
||||
if (!$content)
|
||||
$result['discover_prestashop'] = 'NOK';
|
||||
else
|
||||
@@ -677,7 +677,7 @@ if (Tools::isSubmit('getAdminHomeElement'))
|
||||
if (@fsockopen('www.prestashop.com', 80, $errno, $errst, 3))
|
||||
$result['discover_prestashop'] .= '<iframe frameborder="no" style="margin: 0px; padding: 0px; width: 315px; height: 290px;" src="'.$protocol.'://www.prestashop.com/rss/news2.php?v='._PS_VERSION_.'&lang='.$isoUser.'"></iframe>';
|
||||
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $context);
|
||||
$content = @file_get_contents($protocol.'://www.prestashop.com/partner/paypal/paypal-tips.php?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)$cookie->id_lang, false, $stream_context);
|
||||
$content = explode('|', $content);
|
||||
if ($content[0] == 'OK')
|
||||
$result['discover_prestashop'] .= $content[1];
|
||||
|
||||
@@ -167,11 +167,11 @@ if ($employee->bo_uimode == 'hover')
|
||||
$(this).addClass("active");
|
||||
}
|
||||
</script>';
|
||||
echo ' <ul id="submenu" '.(strlen($mainsubtablist) ? 'class="withLeftBorder"' : '').'>'.$mainsubtablist.'</ul>
|
||||
echo ' <ul id="submenu" '.(strlen($mainsubtablist) ? 'class="withLeftBorder clearfix"' : '').'>'.$mainsubtablist.'</ul>
|
||||
<div id="main">
|
||||
<div id="content">'
|
||||
.(file_exists(PS_ADMIN_DIR.'/../install') ? '<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">'
|
||||
.translate('For security reasons, you must also:').' '.
|
||||
translate('deleted the /install folder').
|
||||
translate('delete the /install folder').
|
||||
'</div>' : '').'
|
||||
';
|
||||
|
||||
+1
-1
@@ -145,7 +145,7 @@ $randomNb = rand(100, 999);
|
||||
if(file_exists(PS_ADMIN_DIR.'/../install') OR file_exists(PS_ADMIN_DIR.'/../admin'))
|
||||
{
|
||||
echo ' <span>'.translate('For security reasons, you cannot connect to the Back Office until after you have:').'<br /><br />
|
||||
- '.translate('deleted the /install folder').'<br />
|
||||
- '.translate('delete the /install folder').'<br />
|
||||
- '.translate('renamed the /admin folder (eg. ').'/admin'.$randomNb.')<br />
|
||||
<br />'.translate('Please then access this page by the new url (eg. http://www.domain.tld/admin').$randomNb.')</span>';
|
||||
}
|
||||
|
||||
@@ -144,6 +144,14 @@ class AdminAttributes extends AdminTab
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to delete here.');
|
||||
}
|
||||
elseif (Tools::isSubmit('submitAddattribute'))
|
||||
{
|
||||
// clean \n\r characters
|
||||
foreach($_POST as $key => $value)
|
||||
if (preg_match('/^name_/Ui', $key))
|
||||
$_POST[$key] = str_replace ('\n', '', str_replace('\r', '', $value));
|
||||
parent::postProcess();
|
||||
}
|
||||
else
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,11 @@ class AdminCountries extends AdminTab
|
||||
'a!active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false, 'filter_key' => 'a!active'));
|
||||
|
||||
$this->optionTitle = $this->l('Countries options');
|
||||
$this->_fieldsOptions = array('PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries(Context::getContext()->language->id)));
|
||||
$this->_fieldsOptions = array(
|
||||
'PS_COUNTRY_DEFAULT' => array('title' => $this->l('Default country:'), 'desc' => $this->l('The default country used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_country', 'list' => Country::getCountries(Context::getContext()->language->id)),
|
||||
'PS_RESTRICT_DELIVERED_COUNTRIES' => array('title' => $this->l('Restrict countries in FO by those delivered by active carriers'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0')
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
@@ -983,7 +983,7 @@ class AdminImport extends AdminTab
|
||||
{
|
||||
$obj = new Attribute();
|
||||
$obj->id_attribute_group = $groups[$group];
|
||||
$obj->name[$defaultLanguage] = $attribute;
|
||||
$obj->name[$defaultLanguage] = str_replace('\n', '', str_replace('\r', '', $attribute));
|
||||
if (($fieldError = $obj->validateFields(UNFRIENDLY_ERROR, true)) === true AND ($langFieldError = $obj->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true)
|
||||
{
|
||||
$obj->add();
|
||||
|
||||
@@ -58,11 +58,12 @@ class AdminPPreferences extends AdminPreferences
|
||||
array('id' => '3', 'name' => $this->l('Product modified date'))
|
||||
), 'identifier' => 'id'),
|
||||
'PS_PRODUCTS_ORDER_WAY' => array('title' => $this->l('Default order way:'), 'desc' => $this->l('Default order way for product list'), 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('Ascending')), array('id' => '1', 'name' => $this->l('Descending'))), 'identifier' => 'id'),
|
||||
'PS_PRODUCT_SHORT_DESC_LIMIT' => array('title' => $this->l('Short description max size'), 'desc' => $this->l('Set the maximum size of product short description'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text'),
|
||||
'PS_IMAGE_GENERATION_METHOD' => array('title' => $this->l('Image generated by:'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'select', 'list' => array(array('id' => '0', 'name' => $this->l('auto')), array('id' => '1', 'name' => $this->l('width')), array('id' => '2', 'name' => $this->l('height'))), 'identifier' => 'id', 'visibility' => Shop::CONTEXT_ALL),
|
||||
'PS_PRODUCT_PICTURE_MAX_SIZE' => array('title' => $this->l('Maximum size of product pictures:'), 'desc' => $this->l('The maximum size of pictures uploadable by customers (in Bytes)'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL),
|
||||
'PS_PRODUCT_PICTURE_WIDTH' => array('title' => $this->l('Product pictures width:'), 'desc' => $this->l('The maximum width of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL),
|
||||
'PS_PRODUCT_PICTURE_HEIGHT' => array('title' => $this->l('Product pictures height:'), 'desc' => $this->l('The maximum height of pictures uploadable by customers'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'visibility' => Shop::CONTEXT_ALL),
|
||||
'PS_LEGACY_IMAGES' => array('title' => $this->l('Activate legacy images compatibility:'), 'desc' => $this->l('This should be set to yes unless this is a new installation of PrestaShop'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL)
|
||||
'PS_LEGACY_IMAGES' => array('title' => $this->l('Use the legacy image filesystem:'), 'desc' => $this->l('This should be set to yes unless you successfully moved images in Preferences > Images tab'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => true, 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
|
||||
@@ -88,7 +88,7 @@ class AdminPreferences extends AdminTab
|
||||
'PS_GIFT_WRAPPING' => array('title' => $this->l('Offer gift-wrapping'), 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_GIFT_WRAPPING_PRICE' => array('title' => $this->l('Gift-wrapping price'), 'desc' => $this->l('Set a price for gift-wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price'),
|
||||
'PS_GIFT_WRAPPING_TAX' => array('title' => $this->l('Gift-wrapping tax'), 'desc' => $this->l('Set a tax for gift-wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $taxes, 'identifier' => 'id'),
|
||||
'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Attachment maximum size'), 'desc' => $this->l('Set the maximum size of attachment files (in MegaBytes)'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text'),
|
||||
'PS_ATTACHMENT_MAXIMUM_SIZE' => array('title' => $this->l('Attachment maximum size'), 'desc' => $this->l('Set the maximum size of attachment files (in MegaBytes).').' '.$this->l('Maximum:').' '.((int)str_replace('M', '', ini_get('post_max_size')) > (int)str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', 'default' => '2'),
|
||||
'PS_RECYCLABLE_PACK' => array('title' => $this->l('Offer recycled packaging'), 'desc' => $this->l('Suggest recycled packaging to customer'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_CART_FOLLOWING' => array('title' => $this->l('Cart re-display at login'), 'desc' => $this->l('After customer logs in, recall and display contents of his/her last shopping cart'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'),
|
||||
'PS_PRICE_ROUND_MODE' => array('title' => $this->l('Round mode'), 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', 'list' => $round_mode, 'identifier' => 'value'),
|
||||
@@ -117,6 +117,15 @@ class AdminPreferences extends AdminTab
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE'))
|
||||
{
|
||||
$uploadMaxSize = (int)str_replace('M', '',ini_get('upload_max_filesize'));
|
||||
$postMaxSize = (int)str_replace('M', '', ini_get('post_max_size'));
|
||||
$maxSize = $uploadMaxSize < $postMaxSize ? $uploadMaxSize : $postMaxSize;
|
||||
|
||||
$_POST['PS_ATTACHMENT_MAXIMUM_SIZE'] = $maxSize < Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE') ? $maxSize : Tools::getValue('PS_ATTACHMENT_MAXIMUM_SIZE');
|
||||
}
|
||||
|
||||
if (isset($_POST['submitGeneral'.$this->table]))
|
||||
{
|
||||
Module::hookExec('categoryUpdate'); // We call this hook, for regenerate cache of categories
|
||||
@@ -160,6 +169,7 @@ class AdminPreferences extends AdminTab
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
|
||||
}
|
||||
|
||||
parent::postProcess();
|
||||
}
|
||||
|
||||
@@ -336,6 +346,7 @@ class AdminPreferences extends AdminTab
|
||||
else
|
||||
$(\'input[name=PS_MAINTENANCE_IP]\').attr(\'value\',\''.Tools::getRemoteAddr().'\');
|
||||
}
|
||||
|
||||
</script>
|
||||
<form action="'.self::$currentIndex.'&submit'.$name.$this->table.'=1&token='.$this->token.'" method="post" enctype="multipart/form-data">
|
||||
<fieldset><legend><img src="../img/admin/'.strval($icon).'.gif" />'.$tabname.'</legend>';
|
||||
|
||||
@@ -1113,10 +1113,12 @@ class AdminProducts extends AdminTab
|
||||
}
|
||||
|
||||
/* Check description short size without html */
|
||||
$limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT');
|
||||
if ($limit <= 0) $limit = 400;
|
||||
foreach ($languages AS $language)
|
||||
if ($value = Tools::getValue('description_short_'.$language['id_lang']))
|
||||
if (Tools::strlen(strip_tags($value)) > 400)
|
||||
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'description_short').' ('.$language['name'].')</b> '.$this->l('is too long').' : 400 '.$this->l('chars max').' ('.$this->l('count now').' '.Tools::strlen(strip_tags($value)).')';
|
||||
if (Tools::strlen(strip_tags($value)) > $limit)
|
||||
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), 'description_short').' ('.$language['name'].')</b> '.$this->l('is too long').' : '.$limit.' '.$this->l('chars max').' ('.$this->l('count now').' '.Tools::strlen(strip_tags($value)).')';
|
||||
/* Check multilingual fields sizes */
|
||||
foreach ($rules['sizeLang'] AS $fieldLang => $maxLength)
|
||||
foreach ($languages AS $language)
|
||||
@@ -2099,6 +2101,7 @@ class AdminProducts extends AdminTab
|
||||
updateFriendlyURL();
|
||||
$.ajax({
|
||||
url: "'.dirname(self::$currentIndex).'/ajax.php",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: "ajaxProductManufacturers=1",
|
||||
success: function(j) {
|
||||
@@ -2116,6 +2119,7 @@ class AdminProducts extends AdminTab
|
||||
});
|
||||
$.ajax({
|
||||
url: "'.dirname(self::$currentIndex).'/ajax.php",
|
||||
cache: false,
|
||||
dataType: "json",
|
||||
data: "ajaxProductSuppliers=1",
|
||||
success: function(j) {
|
||||
|
||||
@@ -58,7 +58,7 @@ class AdminStores extends AdminTab
|
||||
'state' => array('title' => $this->l('State'), 'width' => 100),
|
||||
'city' => array('title' => $this->l('City'), 'width' => 100),
|
||||
'postcode' => array('title' => $this->l('Zip code'), 'width' => 50),
|
||||
'name' => array('title' => $this->l('Name'), 'width' => 120),
|
||||
'name' => array('title' => $this->l('Name'), 'width' => 120, 'filter_key' => 'a!name'),
|
||||
'phone' => array('title' => $this->l('Phone'), 'width' => 70),
|
||||
'fax' => array('title' => $this->l('Fax'), 'width' => 70),
|
||||
'active' => array('title' => $this->l('Enabled'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
||||
|
||||
@@ -102,16 +102,16 @@ class AdminUpgrade extends AdminPreferences
|
||||
{
|
||||
$this->_fieldsAutoUpgrade['PS_AUTOUP_DONT_SAVE_IMAGES'] = array(
|
||||
'title' => $this->l('Don\'t save images'), 'cast' => 'intval', 'validation' => 'isBool',
|
||||
'type' => 'bool', 'desc'=>$this->l('You can exclude the image directory from backup if you already saved it by an other method. (not recommended)'),
|
||||
'type' => 'bool', 'desc'=>$this->l('You can exclude the image directory from backup if you already saved it by another method (not recommended)'),
|
||||
);
|
||||
|
||||
$this->_fieldsAutoUpgrade['PS_AUTOUP_KEEP_DEFAULT_THEME'] = array(
|
||||
'title' => $this->l('Keep theme "prestashop"'), 'cast' => 'intval', 'validation' => 'isBool',
|
||||
'type' => 'bool', 'desc'=>$this->l('if you have customized prestashop default theme, you can protect it from upgrade (not recommended)'),
|
||||
'type' => 'bool', 'desc'=>$this->l('If you have customized PrestaShop default theme, you can protect it from upgrade (not recommended)'),
|
||||
);
|
||||
|
||||
$this->_fieldsAutoUpgrade['PS_AUTOUP_KEEP_TRAD'] = array(
|
||||
'title' => $this->l('Don\'t keep translations'), 'cast' => 'intval', 'validation' => 'isBool',
|
||||
'title' => $this->l('Keep translations'), 'cast' => 'intval', 'validation' => 'isBool',
|
||||
'type' => 'bool', 'desc'=>$this->l('If set too yes, you will keep all your translations'),
|
||||
);
|
||||
// allow manual mode only for dev
|
||||
@@ -185,7 +185,18 @@ class AdminUpgrade extends AdminPreferences
|
||||
$this->nextParams['filesToUpgrade'] = $this->currentParams['filesToUpgrade'];
|
||||
|
||||
$this->backupDbFilename = Configuration::get('UPGRADER_BACKUPDB_FILENAME');
|
||||
if(!file_exists($this->backupDbFilename))
|
||||
{
|
||||
$this->backupDbFilename = '';
|
||||
Configuration::updateValue('UPGRADER_BACKUPDB_FILENAME','');
|
||||
}
|
||||
$this->backupFilesFilename = Configuration::get('UPGRADER_BACKUPFILES_FILENAME');
|
||||
if(!file_exists($this->backupFilesFilename))
|
||||
{
|
||||
$this->backupFilesFilename = '';
|
||||
Configuration::updateValue('UPGRADER_BACKUPFILES_FILENAME','');
|
||||
}
|
||||
|
||||
|
||||
$this->autoupgradePath = $this->adminDir.DIRECTORY_SEPARATOR.$this->autoupgradeDir;
|
||||
|
||||
@@ -257,9 +268,15 @@ class AdminUpgrade extends AdminPreferences
|
||||
$this->_postConfig($this->_fieldsAutoUpgrade);
|
||||
}
|
||||
|
||||
public function ajaxProcessUpgradeComplete()
|
||||
{
|
||||
$this->nextDesc = $this->l('Upgrade process done. Congratulations ! You can now reactive your shop.');
|
||||
$this->next = '';
|
||||
}
|
||||
|
||||
public function ajaxProcessUpgradeNow()
|
||||
{
|
||||
$this->nextDesc = 'Starting upgrade ...';
|
||||
$this->nextDesc = $this->l('Starting upgrade ...');
|
||||
$this->next = 'desactiveShop';
|
||||
}
|
||||
public function ajaxProcessSvnExport()
|
||||
@@ -1092,7 +1109,7 @@ class AdminUpgrade extends AdminPreferences
|
||||
}
|
||||
else if (!method_exists(get_class($this), 'ajaxProcess'.$action))
|
||||
{
|
||||
$this->nextDesc = sprintf($this->l('action "%1$s" non trouvée '), $action);
|
||||
$this->nextDesc = sprintf($this->l('action "%1$s" not found'), $action);
|
||||
$this->next = 'error';
|
||||
$this->error = '1';
|
||||
}
|
||||
@@ -1190,17 +1207,17 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
private function _displayRollbackForm()
|
||||
{
|
||||
echo '<fieldset><legend>'.$this->l('Rollback').'</legend>
|
||||
<div id="rollbackContainer">';
|
||||
<div id="rollbackForm">';
|
||||
if (empty($this->backupFilesFilename) AND empty($this->backupDbFilename))
|
||||
echo $this->l('No rollback available');
|
||||
else if (!empty($this->backupFilesFilename) OR !empty($this->backupDbFilename))
|
||||
{
|
||||
echo '<div id="rollbackContainer"><a class="upgradestep button" href="" id="rollback">'.$this->l('rollback').'</a></div>';
|
||||
echo '<div id="rollbackContainer"><a class="upgradestep button" href="" id="rollback">'.$this->l('rollback').'</a></div><br/>';
|
||||
}
|
||||
if (!empty($this->backupFilesFilename))
|
||||
echo '<div id="restoreFilesContainer"><a href="" class="upgradestep button" id="restoreFiles">restoreFiles</a> '.sprintf($this->l('click to restore %s'),$this->backupFilesFilename).'</div>';
|
||||
echo '<div id="restoreFilesContainer"><a href="" class="upgradestep button" id="restoreFiles">restoreFiles</a> '.sprintf($this->l('click to restore %s'),$this->backupFilesFilename).'</div><br/>';
|
||||
if (!empty($this->backupDbFilename))
|
||||
echo '<div id="restoreDbContainer"><a href="" class="upgradestep button" id="restoreDb">restoreDb</a> '.sprintf($this->l('click to restore %s'), $this->backupDbFilename).'</div>';
|
||||
echo '<div id="restoreDbContainer"><a href="" class="upgradestep button" id="restoreDb">restoreDb</a> '.sprintf($this->l('click to restore %s'), $this->backupDbFilename).'</div><br/>';
|
||||
|
||||
echo '</div></fieldset>';
|
||||
}
|
||||
@@ -1211,13 +1228,13 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
|
||||
echo '<fieldset class="width autoupgrade " >';
|
||||
echo '<legend>'.$this->l('Your current configuration').'</legend>';
|
||||
echo '<b>'.$this->l('root directory').' : </b>'.$this->prodRootDir.'<br/><br/>';
|
||||
echo '<b>'.$this->l('Root directory').' : </b>'.$this->prodRootDir.'<br/><br/>';
|
||||
|
||||
if ($this->rootWritable)
|
||||
$srcRootWritable = '../img/admin/enabled.gif';
|
||||
else
|
||||
$srcRootWritable = '../img/admin/disabled.gif';
|
||||
echo '<b>'.$this->l('Root directory').' : </b>'.'<img src="'.$srcRootWritable.'" /> '.($this->rootWritable?$this->l('root directory is fully writable'):$this->l('root directory is not writable recursively')).'. <br/><br/>';
|
||||
echo '<b>'.$this->l('Root directory status').' : </b>'.'<img src="'.$srcRootWritable.'" /> '.($this->rootWritable?$this->l('fully writable'):$this->l('not writable recursively')).'<br/><br/>';
|
||||
|
||||
if ($this->upgrader->needUpgrade)
|
||||
{
|
||||
@@ -1245,7 +1262,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
$srcExecTime = '../img/admin/enabled.gif';
|
||||
else
|
||||
$srcExecTime = '../img/admin/warning.gif';
|
||||
echo '<b>'.$this->l('php time limit').' : </b>'.'<img src="'.$srcExecTime.'" />'.($max_exec_time == 0?$this->l('disabled'):$max_exec_time.' '.$this->l('seconds')).' <br/><br/>';
|
||||
echo '<b>'.$this->l('PHP time limit').' : </b>'.'<img src="'.$srcExecTime.'" />'.($max_exec_time == 0?$this->l('disabled'):$max_exec_time.' '.$this->l('seconds')).' <br/><br/>';
|
||||
|
||||
if ($this->rootWritable)
|
||||
$srcRootWritable = '../img/admin/enabled.gif';
|
||||
@@ -1268,7 +1285,7 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
// @TODO : this should be checked when init()
|
||||
if ($this->isUpgradeAllowed()) {
|
||||
if ($pleaseUpdate) {
|
||||
echo '<li><img src="'.$this->prodRootDir.'img/information.png" alt="information"/> '.$this->l('Latest Prestashop version available is:').' <b>'.$pleaseUpdate['name'].'</b></li>';
|
||||
echo '<li><img src="'._PS_ADMIN_IMG_.'information.png" alt="information"/> '.$this->l('Latest Prestashop version available is:').' <b>'.$pleaseUpdate['name'].'</b></li>';
|
||||
}
|
||||
// echo '<input class="button" type="submit" name="sumbitUpdateVersion" value="'.$this->l('Backup Database, backup files and update right now and in one click !').'"/>';
|
||||
// echo '<input class="button" type="submit" id="refreshCurrent" value="'.$this->l("refresh update dir / current").'"/>';
|
||||
@@ -1337,34 +1354,45 @@ txtError[37] = "'.$this->l('The config/defines.inc.php file was not found. Where
|
||||
// temporary infoUpdate will be in #tmpInformation
|
||||
echo '<script type="text/javascript">';
|
||||
// _PS_MODE_DEV_ is available in js
|
||||
if (defined('_PS_MODE_DEV_' AND _PS_MODE_DEV_))
|
||||
if (defined('_PS_MODE_DEV_') AND _PS_MODE_DEV_)
|
||||
echo 'var _PS_MODE_DEV_ = true;';
|
||||
echo $this->_getJsErrorMsgs();
|
||||
|
||||
echo '</script>';
|
||||
}
|
||||
|
||||
public function display()
|
||||
{
|
||||
$this->displayWarning('This function is experimental. It\'s currently recommended to make a backup of your files and database.');
|
||||
$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.'));
|
||||
|
||||
if ($this->apacheModExists('mod_evasive'))
|
||||
sleep(1);
|
||||
// update['name'] = version name
|
||||
// update['num'] = only the version
|
||||
// update['link'] = download link
|
||||
// @TODO
|
||||
if ($this->useSvn AND FALSE)
|
||||
|
||||
if ($this->isUpgradeAllowed())
|
||||
{
|
||||
if ($this->useSvn)
|
||||
echo '<div class="error"><h1>'.$this->l('Unstable upgrade').'</h1>
|
||||
<p class="warning">'.$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').'.</p>
|
||||
</div>';
|
||||
|
||||
$this->_displayUpgraderForm();
|
||||
|
||||
echo '<br/>';
|
||||
$this->_displayRollbackForm();
|
||||
|
||||
echo '<br/>';
|
||||
$this->_displayForm('autoUpgradeOptions',$this->_fieldsAutoUpgrade,'<a href="" name="options" id="options">'.$this->l('Options').'</a>', 'my-autoupgrade-option','');
|
||||
$this->_displayForm('autoUpgradeOptions',$this->_fieldsAutoUpgrade,'<a href="" name="options" id="options">'.$this->l('Options').'</a>', '','prefs');
|
||||
echo '<script type="text/javascript">'.$this->_getJsInit().'</script>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<fieldset>
|
||||
<legend>'.$this->l('Update').'</legend>';
|
||||
echo '<p>'.$this->l('You currently don\'t need to use this feature.').'</p>';
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function _getJsInit()
|
||||
@@ -1456,7 +1484,7 @@ function parseXMLResult(xmlRet)
|
||||
.hide("slow");
|
||||
|
||||
// difference with the original function
|
||||
ret = {next:"upgradeComplete",nextParams:""};
|
||||
ret = {next:"upgradeComplete",nextParams:{typeResult:"json"},status:"ok"};
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1471,7 +1499,7 @@ function parseXMLResult(xmlRet)
|
||||
|
||||
// propose rollback if there is an error
|
||||
if (confirm(txtError[parseInt(ret.getAttribute("error"))]+"\r\n\r\n'.$this->l('Do you want to rollback ?').'"))
|
||||
ret = {next:"rollback","nextParams":nextParams};
|
||||
ret = {next:"rollback",nextParams:{typeResult:"json"},status:"error"};
|
||||
}
|
||||
|
||||
return ret
|
||||
@@ -1519,6 +1547,11 @@ function doAjaxRequest(action, nextParams){
|
||||
},
|
||||
success : function(res,textStatus,jqXHR)
|
||||
{
|
||||
if(eval("typeof nextParams") == "undefined")
|
||||
{
|
||||
nextParams = {typeResult : "json"};
|
||||
}
|
||||
|
||||
if (nextParams.typeResult == "xml")
|
||||
{
|
||||
xmlRes = parseXMLResult(res);
|
||||
@@ -1526,12 +1559,14 @@ function doAjaxRequest(action, nextParams){
|
||||
res.next = xmlRes.next;
|
||||
// if xml, we keep the next params
|
||||
nextParams = myNext;
|
||||
|
||||
// res.status = "ok",
|
||||
res.status = xmlRes.status;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = $.parseJSON(res);
|
||||
nextParams = res.nextParams;
|
||||
}
|
||||
|
||||
if (res.status == "ok")
|
||||
{
|
||||
// a
|
||||
@@ -1557,7 +1592,6 @@ function doAjaxRequest(action, nextParams){
|
||||
$("#"+action).addClass("steperror");
|
||||
handleError(res);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(res,textStatus,jqXHR)
|
||||
{
|
||||
@@ -1607,9 +1641,9 @@ function prepareNextButton(button_selector, nextParams)
|
||||
*/
|
||||
function handleSuccess(res)
|
||||
{
|
||||
updateInfoStep(res.nextDesc);
|
||||
if (res.next != "")
|
||||
{
|
||||
updateInfoStep(res.nextDesc);
|
||||
addQuickInfo(res.nextQuickInfo);
|
||||
|
||||
$("#"+res.next).addClass("nextStep");
|
||||
|
||||
@@ -39,9 +39,9 @@ legend{background:#7AB51D url(thead.png) repeat-x top left;border:1px solid #364
|
||||
#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px}
|
||||
#menu li.active{background-position:0 -70px}
|
||||
#menu li.active a{color:#000}
|
||||
#submenu{clear:both;color:#666;margin:0;height:38px;padding:0}
|
||||
.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:8px;padding-right:8px;margin-top:8px;float:left;height:20px}
|
||||
#submenu{clear:both;color:#666;margin:0;padding:0;border-bottom: #A2A8B2 1px solid}
|
||||
.withLeftBorder{background:url(bg-submenu.png) repeat-x #DADADA;background-position:0 -1px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:8px;padding-right:8px;margin-top:8px;float:left;height:29px}
|
||||
#submenu li a{text-decoration:underline}
|
||||
#menu li{_height:32px;_padding-top:3px}
|
||||
#menu li a{_display:inline;_padding:6px 6px 4px}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 153 B |
@@ -35,9 +35,9 @@ legend{background:#FFF6D3;border:1px solid #DFD5C3;font-weight:700;margin:0;padd
|
||||
#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px}
|
||||
#menu li.active,#menu li:hover{background-position:0 -38px;white-space:nowrap;}
|
||||
#menu li.active a{color:#000}
|
||||
#submenu{background:#ECEADE;clear:both;color:#666;margin:0;height:32px;padding:0;border:1px solid #999999}
|
||||
#submenu{background:#ECEADE;clear:both;color:#666;margin:0;padding:0;border:1px solid #999999}
|
||||
.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:7px;padding-right:7px;margin-top:8px;float:left;height:20px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:7px;padding-right:7px;margin-top:8px;float:left;height:29px}
|
||||
#submenu li a{text-decoration:underline}
|
||||
#menu li{_height:32px;_padding-top:3px}
|
||||
#menu li a{_display:inline;_padding:6px 5px 4px 0}
|
||||
|
||||
@@ -37,9 +37,9 @@ legend{background:#FFF6D3;border:1px solid #DFD5C3;font-weight:700;margin:0;padd
|
||||
#menu img{display:inline;padding:0 3px 0 6px;vertical-align:top;width:16px;height:16px}
|
||||
#menu li.active{background-position:0 -38px;white-space:nowrap;}
|
||||
#menu li.active a{color:#000}
|
||||
#submenu{clear:both;color:#666;margin:0;height:38px;padding:0}
|
||||
.withLeftBorder{background:transparent url(separator_subnav.png) no-repeat 0 5px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:8px;padding-right:8px;margin-top:8px;float:left;height:20px}
|
||||
#submenu{clear:both;color:#666;margin:0;padding:0;border-bottom: #A2A8B2 1px solid}
|
||||
.withLeftBorder{background:url(bg-submenu.png) repeat-x #DADADA;background-position:0 -1px}
|
||||
#submenu li{display:inline;list-style:none;margin:0;background:transparent url(separator_subnav.png) no-repeat right 0;padding-left:8px;padding-right:8px;margin-top:8px;float:left;height:29px}
|
||||
#submenu li a{text-decoration:underline}
|
||||
#menu li{_height:32px;_padding-top:3px}
|
||||
#menu li a{_display:inline;_padding:6px 5px 4px 0}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 190 B |
Reference in New Issue
Block a user