Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into bootstrap
Conflicts: admin-dev/themes/default/css/admin.css admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form.tpl admin-dev/themes/default/template/controllers/carrier_wizard/helpers/form/form_ranges.tpl admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl admin-dev/themes/default/template/controllers/home/content.tpl admin-dev/themes/default/template/controllers/localization/content.tpl admin-dev/themes/default/template/controllers/orders/_customized_data.tpl admin-dev/themes/default/template/controllers/orders/_new_product.tpl admin-dev/themes/default/template/controllers/orders/_product_line.tpl admin-dev/themes/default/template/controllers/orders/helpers/view/view.tpl admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl admin-dev/themes/default/template/footer.tpl controllers/admin/AdminCarrierWizardController.php controllers/admin/AdminCarriersController.php controllers/admin/AdminCmsController.php controllers/admin/AdminLocalizationController.php controllers/admin/AdminManufacturersController.php controllers/admin/AdminSuppliersController.php css/admin.css js/admin-products.js js/admin_carrier_wizard.js translations/fr.gzip
This commit is contained in:
@@ -401,13 +401,13 @@ class AdminControllerCore extends Controller
|
||||
if (isset($t['type']) && $t['type'] == 'bool')
|
||||
$filter .= ((bool)$val) ? $this->l('yes') : $this->l('no');
|
||||
elseif(is_string($val))
|
||||
$filter .= $val;
|
||||
$filter .= htmlspecialchars($val, ENT_QUOTES, 'UTF-8');
|
||||
elseif(is_array($val))
|
||||
{
|
||||
$tmp = '';
|
||||
foreach($val as $v)
|
||||
if(is_string($v) && !empty($v))
|
||||
$tmp .= ' - '.$v;
|
||||
$tmp .= ' - '.htmlspecialchars($v, ENT_QUOTES, 'UTF-8');
|
||||
if(Tools::strlen($tmp))
|
||||
{
|
||||
$tmp = ltrim($tmp, ' - ');
|
||||
@@ -732,6 +732,8 @@ class AdminControllerCore extends Controller
|
||||
*/
|
||||
public function processAdd()
|
||||
{
|
||||
if (!isset($this->className) || empty($this->className))
|
||||
return false;
|
||||
/* Checking fields validity */
|
||||
$this->validateRules();
|
||||
if (count($this->errors) <= 0)
|
||||
@@ -1163,6 +1165,8 @@ class AdminControllerCore extends Controller
|
||||
*/
|
||||
protected function loadObject($opt = false)
|
||||
{
|
||||
if (!isset($this->className) || empty($this->className))
|
||||
return true;
|
||||
$id = (int)Tools::getValue($this->identifier);
|
||||
if ($id && Validate::isUnsignedId($id))
|
||||
{
|
||||
@@ -1213,6 +1217,9 @@ class AdminControllerCore extends Controller
|
||||
|
||||
protected function filterToField($key, $filter)
|
||||
{
|
||||
if (!isset($this->fields_list))
|
||||
return false;
|
||||
|
||||
foreach ($this->fields_list as $field)
|
||||
if (array_key_exists('filter_key', $field) && $field['filter_key'] == $key)
|
||||
return $field;
|
||||
@@ -1555,11 +1562,23 @@ class AdminControllerCore extends Controller
|
||||
|
||||
protected function addToolBarModulesListButton()
|
||||
{
|
||||
if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400))
|
||||
file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'));
|
||||
|
||||
$country_module_list = file_get_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST);
|
||||
if (!empty($country_module_list) && $country_module_list_xml = simplexml_load_string($country_module_list))
|
||||
{
|
||||
$country_module_list_array = array();
|
||||
foreach ($country_module_list_xml->module as $k => $m)
|
||||
$country_module_list_array[] = (string)$m->name;
|
||||
$this->tab_modules_list['slider_list'] = array_intersect($this->tab_modules_list['slider_list'], $country_module_list_array);
|
||||
}
|
||||
|
||||
if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list']))
|
||||
$this->toolbar_btn['modules-list'] = array(
|
||||
'href' => '#',
|
||||
'desc' => $this->l('Modules List')
|
||||
);
|
||||
'href' => '#',
|
||||
'desc' => $this->l('Modules List')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1851,7 +1870,11 @@ class AdminControllerCore extends Controller
|
||||
$this->context->employee->logout();
|
||||
|
||||
if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack()))
|
||||
{
|
||||
if (isset($this->context->employee))
|
||||
$this->context->employee->logout();
|
||||
Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : ''));
|
||||
}
|
||||
|
||||
// Set current index
|
||||
$current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : '');
|
||||
@@ -2174,8 +2197,11 @@ class AdminControllerCore extends Controller
|
||||
|| !Validate::isUnsignedId($id_lang))
|
||||
throw new PrestaShopException('get list params is not valid');
|
||||
|
||||
if (isset($this->fields_list[$order_by]) && isset($this->fields_list[$order_by]['filter_key']))
|
||||
$order_by = $this->fields_list[$order_by]['filter_key'];
|
||||
if (!isset($this->fields_list[$order_by]['order_key']) && isset($this->fields_list[$order_by]['filter_key']))
|
||||
$this->fields_list[$order_by]['order_key'] = $this->fields_list[$order_by]['filter_key'];
|
||||
|
||||
if (isset($this->fields_list[$order_by]) && isset($this->fields_list[$order_by]['order_key']))
|
||||
$order_by = $this->fields_list[$order_by]['order_key'];
|
||||
|
||||
/* Determine offset from current page */
|
||||
if ((isset($_POST['submitFilter'.$this->list_id]) ||
|
||||
@@ -2421,7 +2447,7 @@ class AdminControllerCore extends Controller
|
||||
public function getFieldValue($obj, $key, $id_lang = null)
|
||||
{
|
||||
if ($id_lang)
|
||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||
$default_value = (isset($obj->id) && $obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||
else
|
||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
||||
|
||||
@@ -2960,21 +2986,17 @@ class AdminControllerCore extends Controller
|
||||
|
||||
public function isFresh($file, $timeout = 604800000)
|
||||
{
|
||||
if (file_exists(_PS_ROOT_DIR_.$file))
|
||||
{
|
||||
if (filesize(_PS_ROOT_DIR_.$file) < 1)
|
||||
return false;
|
||||
if (file_exists(_PS_ROOT_DIR_.$file) && filesize(_PS_ROOT_DIR_.$file) > 0)
|
||||
return ((time() - filemtime(_PS_ROOT_DIR_.$file)) < $timeout);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static $is_prestashop_up = true;
|
||||
public function refresh($file_to_refresh, $external_file)
|
||||
{
|
||||
$content = Tools::file_get_contents($external_file);
|
||||
if ($content)
|
||||
if (self::$is_prestashop_up && $content = Tools::file_get_contents($external_file))
|
||||
return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content);
|
||||
self::$is_prestashop_up = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user