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:
Kevin Granger
2013-09-13 11:41:14 +02:00
247 changed files with 7965 additions and 4936 deletions
@@ -27,7 +27,7 @@
class AdminCarrierWizardControllerCore extends AdminController
{
protected $wizard_access;
public function __construct()
{
$this->bootstrap = true;
@@ -39,13 +39,16 @@ class AdminCarrierWizardControllerCore extends AdminController
$this->deleted = true;
$this->step_number = 0;
$this->multishop_context = Shop::CONTEXT_ALL;
$this->context = Context::getContext();
$this->fieldImageSettings = array(
'name' => 'logo',
'dir' => 's'
);
parent::__construct();
$this->tabAccess = Profile::getProfileAccess($this->context->employee->id_profile, Tab::getIdFromClassName('AdminCarriers'));
}
@@ -69,7 +72,7 @@ class AdminCarrierWizardControllerCore extends AdminController
'title' => $this->l('Shipping locations and costs'),
),
array(
'title' => $this->l('Size, weight, and group access'),
'title' => $this->l('Size, weight, and group access'),
),
array(
'title' => $this->l('Summary'),
@@ -82,7 +85,6 @@ class AdminCarrierWizardControllerCore extends AdminController
$multistore_step = array(
array(
'title' => $this->l('MultiStore'),
'desc' => $this->l('MultiStore'),
)
);
array_splice($this->wizard_steps['steps'], 1, 0, $multistore_step);
@@ -97,7 +99,7 @@ class AdminCarrierWizardControllerCore extends AdminController
$carrier = $this->loadObject();
elseif ($this->tabAccess['add'])
$carrier = new Carrier();
if ((!$this->tabAccess['edit'] && Tools::getValue('id_carrier')) || (!$this->tabAccess['add'] && !Tools::getValue('id_carrier')))
{
$this->errors[] = Tools::displayError('You do not have permission to use this wizard.');
@@ -111,6 +113,7 @@ class AdminCarrierWizardControllerCore extends AdminController
'wizard_steps' => $this->wizard_steps,
'validate_url' => $this->context->link->getAdminLink('AdminCarrierWizard'),
'carrierlist_url' => $this->context->link->getAdminLink('AdminCarriers').'&conf='.((int)Validate::isLoadedObject($carrier) ? 4 : 3),
'multistore_enable' => Shop::isFeatureActive(),
'wizard_contents' => array(
'contents' => array(
0 => $this->renderStepOne($carrier),
@@ -120,14 +123,14 @@ class AdminCarrierWizardControllerCore extends AdminController
)),
'labels' => array('next' => $this->l('Next'), 'previous' => $this->l('Previous'), 'finish' => $this->l('Finish'))
);
if (Shop::isFeatureActive())
array_splice($this->tpl_view_vars['wizard_contents']['contents'], 1, 0, array(0 => $this->renderStepTwo($carrier)));
$this->context->smarty->assign(array(
'carrier_logo' => (Validate::isLoadedObject($carrier) && file_exists(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg') ? _THEME_SHIP_DIR_.$carrier->id.'.jpg' : false)
));
'carrier_logo' => (Validate::isLoadedObject($carrier) && file_exists(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg') ? _THEME_SHIP_DIR_.$carrier->id.'.jpg' : false)
));
$this->content .= $this->createTemplate('logo.tpl')->fetch();
$this->addjQueryPlugin(array('ajaxfileupload'));
@@ -137,7 +140,7 @@ class AdminCarrierWizardControllerCore extends AdminController
public function initToolbarTitle()
{
$bread_extended = array_unique($this->breadcrumbs);
if (Tools::getValue('id_carrier'))
$bread_extended[1] = $this->l('Edit');
else
@@ -145,13 +148,13 @@ class AdminCarrierWizardControllerCore extends AdminController
$this->toolbar_title = $bread_extended;
}
public function initToolbar()
{
parent::initToolbar();
$this->toolbar_btn['back']['href'] = $this->context->link->getAdminLink('AdminCarriers');
}
public function renderStepOne($carrier)
{
$this->fields_form = array(
@@ -199,7 +202,7 @@ class AdminCarrierWizardControllerCore extends AdminController
),
)),
);
$tpl_vars = array('max_image_size' => (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE') / 1024 / 1024);
$fields_value = $this->getStepOneFieldsValues($carrier);
return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars);
@@ -327,19 +330,18 @@ class AdminCarrierWizardControllerCore extends AdminController
'type' => 'zone',
'name' => 'zones'
)
),
));
),
));
$tpl_vars = array();
$tpl_vars['PS_WEIGHT_UNIT'] = Configuration::get('PS_WEIGHT_UNIT');
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$tpl_vars['currency_sign'] = $currency->sign;
$fields_value = $this->getStepThreeFieldsValues($carrier);
$this->getTplRangesVarsAndValues($carrier, $tpl_vars, $fields_value);
$this->getTplRangesVarsAndValues($carrier, $tpl_vars, $fields_value);
return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars);
}
@@ -351,31 +353,28 @@ class AdminCarrierWizardControllerCore extends AdminController
'input' => array(
array(
'type' => 'text',
'label' => $this->l('Maximum package height ('.Configuration::get('PS_DIMENSION_UNIT').'):'),
'label' => sprintf($this->l('Maximum package height (%s):'), Configuration::get('PS_DIMENSION_UNIT')),
'name' => 'max_height',
'required' => false,
'hint' => $this->l('Maximum height managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer
.')
'hint' => $this->l('Maximum height managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer.')
),
array(
'type' => 'text',
'label' => $this->l('Maximum package width ('.Configuration::get('PS_DIMENSION_UNIT').'):'),
'label' => sprintf($this->l('Maximum package width (%s):'), Configuration::get('PS_DIMENSION_UNIT')),
'name' => 'max_width',
'required' => false,
'hint' => $this->l('Maximum width managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer
.')
'hint' => $this->l('Maximum width managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer.')
),
array(
'type' => 'text',
'label' => $this->l('Maximum package depth ('.Configuration::get('PS_DIMENSION_UNIT').'):'),
'label' => sprintf($this->l('Maximum package depth (%s):'), Configuration::get('PS_DIMENSION_UNIT')),
'name' => 'max_depth',
'required' => false,
'hint' => $this->l('Maximum depth managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer
.')
'hint' => $this->l('Maximum depth managed by this carrier. Set the value to "0", or leave this field blank to ignore.').' '.$this->l('The value must be an integer.')
),
array(
'type' => 'text',
'label' => $this->l('Maximum package weight ('.Configuration::get('PS_WEIGHT_UNIT').'):'),
'label' => sprintf($this->l('Maximum package weight (%s):'), Configuration::get('PS_WEIGHT_UNIT')),
'name' => 'max_weight',
'required' => false,
'hint' => $this->l('Maximum weight managed by this carrier. Set the value to "0", or leave this field blank to ignore.')
@@ -389,7 +388,7 @@ class AdminCarrierWizardControllerCore extends AdminController
)
)
));
$fields_value = $this->getStepFourFieldsValues($carrier);
// Added values of object Group
@@ -399,14 +398,14 @@ class AdminCarrierWizardControllerCore extends AdminController
foreach ($carrier_groups as $carrier_group)
$carrier_groups_ids[] = $carrier_group['id_group'];
$groups = Group::getGroups($this->context->language->id);
$groups = Group::getGroups($this->context->language->id);
foreach ($groups as $group)
$fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $carrier_groups_ids) || empty($carrier_groups_ids) && !$carrier->id));
return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value);
}
public function renderStepFive($carrier)
{
$this->fields_form = array(
@@ -436,20 +435,20 @@ class AdminCarrierWizardControllerCore extends AdminController
)
)
));
$template = $this->createTemplate('controllers/carrier_wizard/summary.tpl');
$fields_value = $this->getStepFiveFieldsValues($carrier);
$active_form = $this->renderGenericForm(array('form' => $this->fields_form), $fields_value);
$active_form = str_replace(array('<fieldset id="fieldset_form">', '</fieldset>'), '', $active_form);
$template->assign('active_form', $active_form);
return $template->fetch('controllers/carrier_wizard/summary.tpl');
}
protected function getTplRangesVarsAndValues($carrier, &$tpl_vars, &$fields_value)
{
$tpl_vars['zones'] = Zone::getZones(false);
@@ -459,13 +458,13 @@ class AdminCarrierWizardControllerCore extends AdminController
foreach ($carrier_zones as $carrier_zone)
$carrier_zones_ids[] = $carrier_zone['id_zone'];
$range_table = $carrier->getRangeTable();
$range_table = $carrier->getRangeTable();
$shipping_method = $carrier->getShippingMethod();
$zones = Zone::getZones(false);
foreach ($zones as $zone)
$fields_value['zones'][$zone['id_zone']] = Tools::getValue('zone_'.$zone['id_zone'], (in_array($zone['id_zone'], $carrier_zones_ids)));
if ($shipping_method == Carrier::SHIPPING_METHOD_FREE)
{
$range_obj = $carrier->getRangeObject($carrier->shipping_method);
@@ -506,10 +505,10 @@ class AdminCarrierWizardControllerCore extends AdminController
$helper->id = (int)Tools::getValue('id_carrier');
$helper->identifier = $this->identifier;
$helper->tpl_vars = array_merge(array(
'fields_value' => $fields_value,
'languages' => $this->getLanguages(),
'id_language' => $this->context->language->id
), $tpl_vars);
'fields_value' => $fields_value,
'languages' => $this->getLanguages(),
'id_language' => $this->context->language->id
), $tpl_vars);
$helper->override_folder = 'carrier_wizard/';
return $helper->generateForm($fields_form);
@@ -535,9 +534,9 @@ class AdminCarrierWizardControllerCore extends AdminController
public function getStepThreeFieldsValues($carrier)
{
$id_tax_rules_group = (is_object($this->object) && !$this->object->id) ? Carrier::getIdTaxRulesGroupMostUsed() : $this->getFieldValue($carrier, 'id_tax_rules_group');
$shipping_handling = (is_object($this->object) && !$this->object->id) ? 0 : $this->getFieldValue($carrier, 'shipping_handling');
return array(
'is_free' => $this->getFieldValue($carrier, 'is_free'),
'id_tax_rules_group' => (int)$id_tax_rules_group,
@@ -556,15 +555,15 @@ class AdminCarrierWizardControllerCore extends AdminController
'max_width' => $this->getFieldValue($carrier, 'max_width'),
'max_depth' => $this->getFieldValue($carrier, 'max_depth'),
'max_weight' => $this->getFieldValue($carrier, 'max_weight'),
'group' => $this->getFieldValue($carrier, 'group'),
'group' => $this->getFieldValue($carrier, 'group'),
);
}
public function getStepFiveFieldsValues($carrier)
{
return array('active' => $this->getFieldValue($carrier, 'active'));
}
public function ajaxProcessChangeRanges()
{
if ((Validate::isLoadedObject($this->object) && !$this->tabAccess['edit']) || !$this->tabAccess['add'])
@@ -584,17 +583,17 @@ class AdminCarrierWizardControllerCore extends AdminController
$template = $this->createTemplate('controllers/carrier_wizard/helpers/form/form_ranges.tpl');
$template->assign($tpl_vars);
$template->assign('change_ranges', 1);
$template->assign('fields_value', $fields_value);
$template->assign('input', array('type' => 'zone', 'name' => 'zones' ));
$template->assign('input', array('type' => 'zone', 'name' => 'zones' ));
$currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$template->assign('currency_sign', $currency->sign);
$template->assign('PS_WEIGHT_UNIT', Configuration::get('PS_WEIGHT_UNIT'));
die($template->fetch());
}
public function ajaxProcessValidateStep()
{
$step_number = (int)Tools::getValue('step_number');
@@ -623,7 +622,7 @@ class AdminCarrierWizardControllerCore extends AdminController
}
die(Tools::jsonEncode($return));
}
public function processRanges($id_carrier)
{
if (!$this->tabAccess['edit'] || !$this->tabAccess['add'])
@@ -635,13 +634,13 @@ class AdminCarrierWizardControllerCore extends AdminController
$carrier = new Carrier((int)$id_carrier);
if (!Validate::isLoadedObject($carrier))
return false;
$range_inf = Tools::getValue('range_inf');
$range_sup = Tools::getValue('range_sup');
$range_type = Tools::getValue('shipping_method');
$fees = Tools::getValue('fees');
$carrier->deleteDeliveryPrice($carrier->getRangeTable());
if ($range_type != Carrier::SHIPPING_METHOD_FREE)
{
@@ -657,10 +656,10 @@ class AdminCarrierWizardControllerCore extends AdminController
else
{
$range = new RangeWeight((int)$key);
$add_range = false;
$add_range = false;
}
}
if ($range_type == Carrier::SHIPPING_METHOD_PRICE)
{
if (!RangePrice::rangeExist((int)$carrier->id, (float)$delimiter1, (float)$range_sup[$key]))
@@ -678,7 +677,7 @@ class AdminCarrierWizardControllerCore extends AdminController
$range->delimiter2 = (float)$range_sup[$key];
$range->save();
}
if (!Validate::isLoadedObject($range))
return false;
$price_list = array();
@@ -700,19 +699,20 @@ class AdminCarrierWizardControllerCore extends AdminController
}
return true;
}
public function ajaxProcessUploadLogo()
{
if (!$this->tabAccess['edit'])
die('<return result="error" message="'.Tools::displayError('You do not have permission to use this wizard.').'" />');
$allowedExtensions = array('jpeg', 'gif', 'png', 'jpg');
$logo = (isset($_FILES['carrier_logo_input']) ? $_FILES['carrier_logo_input'] : false);
if ($logo && !empty($logo['tmp_name']) && $logo['tmp_name'] != 'none'
&& (!isset($logo['error']) || !$logo['error'])
&& preg_match('/\.(jpe?g|gif|png)$/', $logo['name'])
&& is_uploaded_file($logo['tmp_name']))
&& is_uploaded_file($logo['tmp_name'])
&& ImageManager::isRealImage($logo['tmp_name'], $logo['type']))
{
$file = $logo['tmp_name'];
do $tmp_name = uniqid().'.jpg';
@@ -725,18 +725,18 @@ class AdminCarrierWizardControllerCore extends AdminController
else
die('<return result="error" message="Cannot upload file" />');
}
public function ajaxProcessFinishStep()
{
$return = array('has_error' => false);
if (!$this->tabAccess['edit'])
$return = array(
'has_error' => true,
$return['errors'][] = Tools::displayError('You do not have permission to use this wizard.')
);
else
{
{
if ($id_carrier = Tools::getValue('id_carrier'))
{
$current_carrier = new Carrier((int)$id_carrier);
@@ -758,9 +758,9 @@ class AdminCarrierWizardControllerCore extends AdminController
$this->changeGroups((int)$new_carrier->id);
// Call of hooks
Hook::exec('actionCarrierUpdate', array(
'id_carrier' => (int)$current_carrier->id,
'carrier' => $new_carrier
));
'id_carrier' => (int)$current_carrier->id,
'carrier' => $new_carrier
));
$this->postImage($new_carrier->id);
$this->changeZones($new_carrier->id);
$new_carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group'));
@@ -777,14 +777,14 @@ class AdminCarrierWizardControllerCore extends AdminController
$return['errors'][] = $this->l('An error occurred while saving this carrier.');
}
}
if ($carrier->is_free)
{
//if carrier is free delete shipping cost
$carrier->deleteDeliveryPrice('range_weight');
$carrier->deleteDeliveryPrice('range_price');
}
if (Validate::isLoadedObject($carrier))
{
if (!$this->changeGroups((int)$carrier->id))
@@ -798,7 +798,7 @@ class AdminCarrierWizardControllerCore extends AdminController
$return['has_error'] = true;
$return['errors'][] = $this->l('An error occurred while saving carrier zones.');
}
if (!$carrier->is_free)
if (!$this->processRanges((int)$carrier->id))
{
@@ -837,7 +837,7 @@ class AdminCarrierWizardControllerCore extends AdminController
}
die(Tools::jsonEncode($return));
}
protected function changeGroups($id_carrier, $delete = true)
{
$carrier = new Carrier((int)$id_carrier);
@@ -860,34 +860,31 @@ class AdminCarrierWizardControllerCore extends AdminController
if (!isset($_POST['zone_'.$zone['id_zone']]) || !$_POST['zone_'.$zone['id_zone']])
$return &= $carrier->deleteZone((int)$zone['id_zone']);
}
else
if (isset($_POST['zone_'.$zone['id_zone']]) && $_POST['zone_'.$zone['id_zone']])
$return &= $carrier->addZone((int)$zone['id_zone']);
else
if (isset($_POST['zone_'.$zone['id_zone']]) && $_POST['zone_'.$zone['id_zone']])
$return &= $carrier->addZone((int)$zone['id_zone']);
return $return;
return $return;
}
public static function getValidationRules()
{
$step_number = Tools::getValue('step_number');
if ($step_number == 4 && !Shop::isFeatureActive() || $step_number == 5 && Shop::isFeatureActive())
return array();
$step_fields = array(
1 => array('name', 'delay', 'grade', 'url'),
2 => array('is_free', 'id_tax_rules_group', 'shipping_handling', 'shipping_method', 'range_behavior'),
3 => array('range_behavior', 'max_height', 'max_width', 'max_depth', 'max_weight'),
4 => array(),
);
if (Shop::isFeatureActive())
{
$multistore_field = array(array('shop'));
$tmp = $step_fields;
$step_fields = array(1 => $tmp[1]) + $multistore_field;
array_shift($tmp);
foreach ($tmp as $row)
$step_field[] = $row;
array_splice($step_fields, 1, 0, $multistore_field);
}
$rules = Carrier::getValidationRules('Carrier');
@@ -899,18 +896,18 @@ class AdminCarrierWizardControllerCore extends AdminController
{
if(!in_array($field, $step_fields[$step_number]))
unset($rules[$key_r][$key_f]);
}
}
else if(!in_array($key_f, $step_fields[$step_number]))
unset($rules[$key_r][$key_f]);
unset($rules[$key_r][$key_f]);
}
return $rules;
}
public static function displayFieldName($field)
{
return $field;
}
public function duplicateLogo($new_id, $old_id)
{
$old_logo = _PS_SHIP_IMG_DIR_.'/'.(int)$old_id.'.jpg';
+7 -52
View File
@@ -94,55 +94,6 @@ class AdminCarriersControllerCore extends AdminController
'position' => 'position'
)
);
$carrier_default_sort = array(
array('value' => Carrier::SORT_BY_PRICE, 'name' => $this->l('Price')),
array('value' => Carrier::SORT_BY_POSITION, 'name' => $this->l('Position'))
);
$carrier_default_order = array(
array('value' => Carrier::SORT_BY_ASC, 'name' => $this->l('Ascending')),
array('value' => Carrier::SORT_BY_DESC, 'name' => $this->l('Descending'))
);
$this->fields_options = array(
'general' => array(
'title' => $this->l('Carrier options'),
'fields' => array(
'PS_CARRIER_DEFAULT' => array(
'title' => $this->l('Default carrier:'),
'hint' => $this->l('Your shop\'s default carrier'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'id_carrier',
'list' => array_merge(
array(
-1 => array('id_carrier' => -1, 'name' => $this->l('Best price')),
-2 => array('id_carrier' => -2, 'name' => $this->l('Best grade'))
),
Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true, false, false, null, Carrier::ALL_CARRIERS))
),
'PS_CARRIER_DEFAULT_SORT' => array(
'title' => $this->l('Sort by:'),
'hint' => $this->l('This will only be visible in the Front Office'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'value',
'list' => $carrier_default_sort
),
'PS_CARRIER_DEFAULT_ORDER' => array(
'title' => $this->l('Order by:'),
'hint' => $this->l('This will only be visible in the Front Office'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'value',
'list' => $carrier_default_order
),
),
'submit' => array()
)
);
parent::__construct();
}
@@ -504,7 +455,8 @@ class AdminCarriersControllerCore extends AdminController
}
parent::postProcess();
}
else if ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier))
/*
else if ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier))
{
if ($this->tabAccess['edit'] === '1')
{
@@ -516,17 +468,20 @@ class AdminCarriersControllerCore extends AdminController
else
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
*/
else if (isset($_GET['isFree'.$this->table]))
{
$this->processIsFree();
}
else
{
if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
/*
if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox')))
|| (isset($_GET['delete'.$this->table]) && Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT')))
$this->errors[] = $this->l('Please set another carrier as default before deleting this one.');
else
{
*/
// if deletion : removes the carrier from the warehouse/carrier association
if (Tools::isSubmit('delete'.$this->table))
{
@@ -548,7 +503,7 @@ class AdminCarriersControllerCore extends AdminController
}
parent::postProcess();
Carrier::cleanPositions();
}
//}
}
}
@@ -248,7 +248,7 @@ class AdminCategoriesControllerCore extends AdminController
{
if (empty($this->display))
{
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops()) > 1)
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
$this->toolbar_btn['new-url'] = array(
'href' => self::$currentIndex.'&amp;add'.$this->table.'root&amp;token='.$this->token,
'desc' => $this->l('Add new root category')
@@ -460,7 +460,8 @@ class AdminCategoriesControllerCore extends AdminController
$this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL');
// Display this field only if multistore option is enabled
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'))
if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && Tools::isSubmit('add'.$this->table.'root'))
{
$this->fields_form['input'][] = array(
'type' => 'switch',
'label' => $this->l('Root Category:'),
@@ -480,6 +481,8 @@ class AdminCategoriesControllerCore extends AdminController
)
)
);
unset($this->fields_form['input'][2],$this->fields_form['input'][3]);
}
// Display this field only if multistore option is enabled AND there are several stores configured
if (Shop::isFeatureActive())
$this->fields_form['input'][] = array(
@@ -494,9 +497,6 @@ class AdminCategoriesControllerCore extends AdminController
if (in_array($input['name'], array('id_parent', 'is_root_category')))
unset($this->fields_form['input'][$k]);
if (Tools::isSubmit('add'.$this->table.'root'))
unset($this->fields_form['input'][2],$this->fields_form['input'][3]);
if (!($obj = $this->loadObject(true)))
return;
@@ -520,6 +520,8 @@ class AdminCategoriesControllerCore extends AdminController
foreach ($groups as $group)
$this->fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $category_groups_ids)));
$this->fields_value['is_root_category'] = (bool)Tools::isSubmit('add'.$this->table.'root');
return parent::renderForm();
}
@@ -550,7 +552,7 @@ class AdminCategoriesControllerCore extends AdminController
$id_parent = (int)Tools::getValue('id_parent');
// if true, we are in a root category creation
if (!$id_parent && !Tools::isSubmit('is_root_category'))
if (!$id_parent)
{
$_POST['is_root_category'] = $_POST['level_depth'] = 1;
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
+2 -1
View File
@@ -111,9 +111,10 @@ class AdminCmsControllerCore extends AdminController
'type' => 'text',
'label' => $this->l('Meta title:'),
'name' => 'meta_title',
'id' => 'name', // for copy2friendlyUrl compatibility
'id' => 'name', // for copyMeta2friendlyURL compatibility
'lang' => true,
'required' => true,
'class' => 'copyMeta2friendlyURL',
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
),
array(
@@ -367,7 +367,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
$cm->id_employee = (int)$this->context->employee->id;
$cm->id_customer_thread = $ct->id;
$cm->message = Tools::htmlentitiesutf8(Tools::getValue('reply_message'));
$cm->message = Tools::getValue('reply_message');
$cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']);
if (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0)
$this->errors[] = Tools::displayError('An error occurred during the file upload process.');
@@ -768,7 +768,8 @@ class AdminCustomersControllerCore extends AdminController
if ($customer_email != $this->object->email)
{
$customer = new Customer();
$customer->getByEmail($customer_email);
if (Validate::isEmail($customer_email))
$customer->getByEmail($customer_email);
if ($customer->id)
$this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email;
}
@@ -454,6 +454,24 @@ class AdminEmployeesControllerCore extends AdminController
return parent::initContent();
}
protected function afterUpdate($object)
{
$res = parent::afterUpdate($object);
// Update cookie if needed
if (Tools::getValue('id_employee') == $this->context->employee->id && Tools::getValue('passwd') && $object->passwd != $this->context->employee->passwd)
$this->context->cookie->passwd = $this->context->employee->passwd = $object->passwd;
return $res;
}
protected function ajaxProcessFormLanguage()
{
$this->context->cookie->employee_form_lang = (int)Tools::getValue('form_language_id');
if (!$this->context->cookie->write())
die ('Error while updating cookie.');
die ('Form language updated.');
}
public function ajaxProcessGetTabByIdProfile()
{
$id_profile = Tools::getValue('id_profile');
+12 -3
View File
@@ -53,8 +53,17 @@ class AdminImagesControllerCore extends AdminController
'stores' => array('title' => $this->l('Stores'), 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false)
);
// No need to display the old image system if the install has been made later than 2013-03-26
$this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
// No need to display the old image system migration tool except if product images are in _PS_PROD_IMG_DIR_
$this->display_move = false;
$dir = _PS_PROD_IMG_DIR_;
if (is_dir($dir))
if ($dh = opendir($dir))
{
while (($file = readdir($dh)) !== false && $this->display_move == false)
if (!is_dir($dir.DIRECTORY_SEPARATOR.$file) && $file[0] != '.' && is_numeric($file[0]))
$this->display_move = true;
closedir($dh);
}
$this->fields_options = array(
'images' => array(
@@ -636,7 +645,7 @@ class AdminImagesControllerCore extends AdminController
public function initMoveImages()
{
$this->context->smarty->assign(array(
'safe_mode' => ini_get('safe_mode'),
'safe_mode' => Tools::getSafeModeStatus(),
'link_ppreferences' => 'index.php?tab=AdminPPreferences&token='.Tools::getAdminTokenLite('AdminPPreferences').'#PS_LEGACY_IMAGES_on',
));
}
+17 -10
View File
@@ -2436,17 +2436,12 @@ class AdminImportControllerCore extends AdminController
$discount_rate = (float)$info['discount_rate'];
$tax_rate = (float)$info['tax_rate'];
// checks if one product is there only once
if (isset($product['id_product']))
{
if ($product['id_product'] == $id_product_attribute)
$this->errors[] = sprintf($this->l('Product (%d/%D) cannot be added twice (at line %d).'), $id_product,
$id_product_attribute, $current_line + 1);
else
$product['id_product'] = $id_product_attribute;
}
// checks if one product/attribute is there only once
if (isset($products[$id_product][$id_product_attribute]))
$this->errors[] = sprintf($this->l('Product/Attribute (%d/%d) cannot be added twice (at line %d).'), $id_product,
$id_product_attribute, $current_line + 1);
else
$product['id_product'] = 0;
$products[$id_product][$id_product_attribute] = $quantity_expected;
// checks parameters
if (false === ($supplier_reference = ProductSupplier::getProductSupplierReference($id_product, $id_product_attribute, $supply_order->id_supplier)))
@@ -2659,6 +2654,13 @@ class AdminImportControllerCore extends AdminController
Image::clearTmpDir();
return true;
}
public function clearSmartyCache()
{
Tools::enableCache();
Tools::clearCache($this->context->smarty);
Tools::restoreCacheSettings();
}
public function postProcess()
{
@@ -2716,10 +2718,12 @@ class AdminImportControllerCore extends AdminController
{
case $this->entities[$import_type = $this->l('Categories')]:
$this->categoryImport();
$this->clearSmartyCache();
break;
case $this->entities[$import_type = $this->l('Products')]:
$import_type = $this->l('Categories');
$this->productImport();
$this->clearSmartyCache();
break;
case $this->entities[$import_type = $this->l('Customers')]:
$this->customerImport();
@@ -2729,12 +2733,15 @@ class AdminImportControllerCore extends AdminController
break;
case $this->entities[$import_type = $this->l('Combinations')]:
$this->attributeImport();
$this->clearSmartyCache();
break;
case $this->entities[$import_type = $this->l('Manufacturers')]:
$this->manufacturerImport();
$this->clearSmartyCache();
break;
case $this->entities[$import_type = $this->l('Suppliers')]:
$this->supplierImport();
$this->clearSmartyCache();
break;
// @since 1.5.0
case $this->entities[$import_type = $this->l('Supply Orders')]:
@@ -113,7 +113,8 @@ class AdminLanguagesControllerCore extends AdminController
$this->addRowAction('delete');
$this->displayWarning($this->l('When you delete a language, all related translations in the database will be deleted.'));
$this->displayInformation($this->l('Your .htaccess file must be writable.'));
if (!is_writable(_PS_ROOT_DIR_.'/.htaccess') && Configuration::get('PS_REWRITING_SETTINGS'))
$this->displayInformation($this->l('Your .htaccess file must be writable.'));
return parent::renderList();
}
@@ -384,12 +385,11 @@ class AdminLanguagesControllerCore extends AdminController
if ($_FILES['no-picture']['error'] == UPLOAD_ERR_OK)
$this->copyNoPictureImage(strtolower(Tools::getValue('iso_code')));
unset($_FILES['no-picture']);
return parent::processAdd();
}
else
$this->errors[] = Tools::displayError('Flag and "No picture" image fields are required.');
return false;
return parent::processAdd();
}
public function processUpdate()
@@ -29,9 +29,6 @@ class AdminLocalizationControllerCore extends AdminController
public function __construct()
{
$this->bootstrap = true;
$this->className = 'Configuration';
$this->table = 'configuration';
parent::__construct();
$this->fields_options = array(
+10 -3
View File
@@ -34,9 +34,6 @@ class AdminLogsControllerCore extends AdminController
$this->lang = false;
$this->noLink = true;
$this->addRowAction('delete');
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->fields_list = array(
'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100),
@@ -67,10 +64,20 @@ class AdminLogsControllerCore extends AdminController
$this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)';
parent::__construct();
}
public function processDelete()
{
return Logger::eraseAllLogs();
}
public function initToolbar()
{
parent::initToolbar();
$this->toolbar_btn['delete'] = array(
'short' => 'Erase',
'desc' => $this->l('Erase all'),
'js' => 'if (confirm(\''.$this->l('Are you sure?').'\')) document.location = \''.$this->context->link->getAdminLink('AdminLogs').'&amp;token='.$this->token.'&deletelog=1\';'
);
unset($this->toolbar_btn['new']);
}
@@ -259,27 +259,27 @@ class AdminManufacturersControllerCore extends AdminController
'label' => $this->l('Name:'),
'name' => 'name',
'required' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}'
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'textarea',
'label' => $this->l('Short description:'),
'name' => 'short_description',
'lang' => true,
'class' => 'rte',
'hint' => $this->l('Invalid characters:').' <>;=#{}',
'rows' => 2,
'cols' => 10
'cols' => 60,
'rows' => 10,
'autoload_rte' => 'rte', //Enable TinyMCE editor for short description
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'textarea',
'label' => $this->l('Description:'),
'name' => 'description',
'lang' => true,
'class' => 'rte',
'hint' => $this->l('Invalid characters:').' <>;=#{}',
'rows' => 2,
'cols' => 10
'cols' => 60,
'rows' => 10,
'autoload_rte' => 'rte', //Enable TinyMCE editor for description
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'file',
@@ -293,14 +293,14 @@ class AdminManufacturersControllerCore extends AdminController
'label' => $this->l('Meta title:'),
'name' => 'meta_title',
'lang' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'text',
'label' => $this->l('Meta description:'),
'name' => 'meta_description',
'lang' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'tags',
@@ -308,7 +308,7 @@ class AdminManufacturersControllerCore extends AdminController
'name' => 'meta_keywords',
'lang' => true,
'hint' => array(
$this->l('Forbidden characters:').' <>;=#{}',
$this->l('Forbidden characters:').' &lt;&gt;;=#{}',
$this->l('To add "tags," click inside the field, write something, and then press "Enter."')
)
),
@@ -435,14 +435,14 @@ class AdminManufacturersControllerCore extends AdminController
'label' => $this->l('Last name:'),
'name' => 'lastname',
'required' => true,
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"{}_$%:'
'hint' => $this->l('Invalid characters:').' 0-9!&lt;&gt;,;?=+()@#"{}_$%:'
);
$form['input'][] = array(
'type' => 'text',
'label' => $this->l('First name:'),
'name' => 'firstname',
'required' => true,
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"{}_$%:'
'hint' => $this->l('Invalid characters:').' 0-9!&lt;&gt;,;?=+()@#"{}_$%:'
);
$form['input'][] = array(
'type' => 'text',
@@ -509,7 +509,7 @@ class AdminManufacturersControllerCore extends AdminController
'label' => $this->l('Other:'),
'name' => 'other',
'required' => false,
'hint' => $this->l('Forbidden characters:').' <>;=#{}',
'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}',
'rows' => 2,
'cols' => 10
);
+4 -2
View File
@@ -140,7 +140,7 @@ class AdminMetaControllerCore extends AdminController
$this->url = ShopUrl::getShopUrls($this->context->shop->id)->where('main', '=', 1)->getFirst();
if ($this->url)
{
$shop_url_options['description'] = $this->l('Here you can set the URL for your shop. If you migrate your shop to a new URL, remember to change the values bellow.');
$shop_url_options['description'] = $this->l('Here you can set the URL for your shop. If you migrate your shop to a new URL, remember to change the values below.');
$shop_url_options['fields'] = array(
'domain' => array(
'title' => $this->l('Shop domain'),
@@ -366,6 +366,9 @@ class AdminMetaControllerCore extends AdminController
else if (Tools::isSubmit('submitRobots'))
$this->generateRobotsFile();
if (Tools::isSubmit('PS_ROUTE_product_rule'))
Tools::clearCache($this->context->smarty);
return parent::postProcess();
}
@@ -470,7 +473,6 @@ class AdminMetaControllerCore extends AdminController
else
Configuration::updateValue('PS_ROUTE_'.$route_id, $rule);
}
}
/**
+17 -11
View File
@@ -99,6 +99,8 @@ class AdminModulesControllerCore extends AdminController
$this->list_modules_categories['others']['name'] = $this->l('Other Modules');
$this->list_modules_categories['mobile']['name'] = $this->l('Mobile');
uasort($this->list_modules_categories, array($this, 'checkCategoriesNames'));
// Set Id Employee, Iso Default Country and Filter Configuration
$this->id_employee = (int)$this->context->employee->id;
$this->iso_default_country = $this->context->country->iso_code;
@@ -130,6 +132,14 @@ class AdminModulesControllerCore extends AdminController
$this->logged_on_addons = true;
}
public function checkCategoriesNames($a, $b)
{
if ($a['name'] === $this->l('Other Modules'))
return true;
return (bool)($a['name'] > $b['name']);
}
public function setMedia()
{
parent::setMedia();
@@ -631,9 +641,8 @@ class AdminModulesControllerCore extends AdminController
if (!$download_ok)
$this->errors[] = $this->l('Error on downloading the lastest version');
else
if(!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false))
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name));
elseif (!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false))
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name));
}
}
}
@@ -675,18 +684,18 @@ class AdminModulesControllerCore extends AdminController
// Get the return value of current method
$echo = $module->{$method}();
// After a successful install of a single module that has a configuration method, to the configuration page
if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent'))
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12');
}
// If the method called is "configure" (getContent method), we show the html code of configure page
if ($key == 'configure' && Module::isInstalled($module->name))
{
if (isset($module->multishop_context))
$this->multishop_context = $module->multishop_context;
$backlink = self::$currentIndex.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name;
$hooklink = 'index.php?tab=AdminModulesPositions&token='.Tools::getAdminTokenLite('AdminModulesPositions').'&show_modules='.(int)$module->id;
$tradlink = 'index.php?tab=AdminTranslations&token='.Tools::getAdminTokenLite('AdminTranslations').'&type=modules&lang=';
@@ -768,10 +777,8 @@ class AdminModulesControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&conf='.$return.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
}
if(isset($_GET['update']))
{
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&updated=1tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : '').$params);
}
if (isset($_GET['update']))
Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&updated=1tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).(isset($modules_list_save) ? '&modules_list='.$modules_list_save : ''));
}
public function postProcess()
@@ -779,7 +786,6 @@ class AdminModulesControllerCore extends AdminController
// Parent Post Process
parent::postProcess();
// Get the list of installed module ans prepare it for ajax call.
if (($list = Tools::getValue('installed_modules')))
Context::getContext()->smarty->assign('installed_modules', Tools::jsonEncode(explode('|', $list)));
@@ -276,12 +276,13 @@ class AdminModulesPositionsControllerCore extends AdminController
'href' => self::$currentIndex.'&addToHook'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token,
'desc' => $this->l('Transplant a module')
);
$live_edit_params = array(
'live_edit' => true,
'ad' => $admin_dir,
'liveToken' => $this->token,
'id_employee' => (int)$this->context->employee->id
'id_employee' => (int)$this->context->employee->id,
'id_shop' => (int)$this->context->shop->id
);
$this->context->smarty->assign(array(
@@ -308,10 +309,12 @@ class AdminModulesPositionsControllerCore extends AdminController
public function getLiveEditUrl($live_edit_params)
{
$lang = '';
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$dir = str_replace($admin_dir, '', dirname($_SERVER['SCRIPT_NAME']));
if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1)
$lang = Language::getIsoById($this->context->employee->id_lang).'/';
$url = $this->context->shop->getBaseURL().$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
$url = Tools::getCurrentUrlProtocolPrefix().Tools::getHttpHost().$dir.$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
return $url;
}
+32 -6
View File
@@ -105,7 +105,8 @@ class AdminOrdersControllerCore extends AdminController
'type' => 'select',
'list' => $statuses_array,
'filter_key' => 'os!id_order_state',
'filter_type' => 'int'
'filter_type' => 'int',
'order_key' => 'osname'
),
'date_add' => array(
'title' => $this->l('Date'),
@@ -511,7 +512,7 @@ class AdminOrdersControllerCore extends AdminController
if (Tools::isSubmit('generateDiscountRefund') && !count($this->errors))
{
$cart_rule = new CartRule();
$cart_rule->description = sprintf($this->l('Credit card slip for order #%d'), $order->id);
$cart_rule->description = sprintf($this->l('Credit slip for order #%d'), $order->id);
$languages = Language::getLanguages(false);
foreach ($languages as $language)
// Define a temporary name
@@ -866,7 +867,7 @@ class AdminOrdersControllerCore extends AdminController
$payment_module->validateOrder(
(int)$cart->id, (int)$id_order_state,
$cart->getOrderTotal(true, Cart::BOTH), $payment_module->displayName, $this->l('Manual order -- Employee:').
Tools::safeOutput(substr($employee->firstname, 0, 1).'. '.$employee->lastname), array(), null, false, $cart->secure_key
substr($employee->firstname, 0, 1).'. '.$employee->lastname, array(), null, false, $cart->secure_key
);
if ($payment_module->currentOrder)
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token);
@@ -1337,6 +1338,13 @@ class AdminOrdersControllerCore extends AdminController
// if the current stock requires a warning
if ($product['current_stock'] == 0 && $display_out_of_stock_warning)
$this->displayWarning($this->l('This product is out of stock: ').' '.$product['product_name']);
if ($product['id_warehouse'] != 0)
{
$warehouse = new Warehouse((int)$product['id_warehouse']);
$product['warehouse_name'] = $warehouse->name;
}
else
$product['warehouse_name'] = '--';
}
// Smarty assign
@@ -1379,7 +1387,8 @@ class AdminOrdersControllerCore extends AdminController
'invoices_collection' => $order->getInvoicesCollection(),
'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(),
'payment_methods' => $payment_methods,
'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop)
'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop),
'display_warehouse' => (int)Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
);
return parent::renderView();
@@ -1742,6 +1751,13 @@ class AdminOrdersControllerCore extends AdminController
$product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']);
$product['return_history'] = OrderReturn::getProductReturnDetail((int)$product['id_order_detail']);
$product['refund_history'] = OrderSlip::getProductSlipDetail((int)$product['id_order_detail']);
if ($product['id_warehouse'] != 0)
{
$warehouse = new Warehouse((int)$product['id_warehouse']);
$product['warehouse_name'] = $warehouse->name;
}
else
$product['warehouse_name'] = '--';
// Get invoices collection
$invoice_collection = $order->getInvoicesCollection();
@@ -1762,7 +1778,8 @@ class AdminOrdersControllerCore extends AdminController
'invoices_collection' => $invoice_collection,
'current_id_lang' => Context::getContext()->language->id,
'link' => Context::getContext()->link,
'current_index' => self::$currentIndex
'current_index' => self::$currentIndex,
'display_warehouse' => (int)Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
));
$this->sendChangedNotification($order);
@@ -1957,6 +1974,14 @@ class AdminOrdersControllerCore extends AdminController
$product['amount_refundable'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl'];
$product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']);
$product['refund_history'] = OrderSlip::getProductSlipDetail($order_detail->id);
if ($product['id_warehouse'] != 0)
{
$warehouse = new Warehouse((int)$product['id_warehouse']);
$product['warehouse_name'] = $warehouse->name;
}
else
$product['warehouse_name'] = '--';
// Get invoices collection
$invoice_collection = $order->getInvoicesCollection();
@@ -1976,7 +2001,8 @@ class AdminOrdersControllerCore extends AdminController
'invoices_collection' => $invoice_collection,
'current_id_lang' => Context::getContext()->language->id,
'link' => Context::getContext()->link,
'current_index' => self::$currentIndex
'current_index' => self::$currentIndex,
'display_warehouse' => (int)Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
));
if (!$res)
+2 -1
View File
@@ -176,7 +176,7 @@ class AdminPaymentControllerCore extends AdminController
),
array('items' => Group::getGroups($this->context->language->id),
'title' => $this->l('Group restrictions'),
'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'),
'desc' => $this->l('Please mark each checkbox for the customer group(s), in which you want the payment module(s) to be available.'),
'name_id' => 'group',
'identifier' => 'id_group',
'icon' => 'icon-group',
@@ -214,6 +214,7 @@ class AdminPaymentControllerCore extends AdminController
if ($name_id == 'country'
&& isset($module->limited_countries)
&& !empty($module->limited_countries)
&& is_array($module->limited_countries)
&& !(in_array(strtoupper($item['iso_code']), array_map('strtoupper', $module->limited_countries))))
$list['items'][$key_item]['check_list'][$key_module] = null;
}
@@ -767,6 +767,14 @@ class AdminPerformanceControllerCore extends AdminController
else
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
}
if ((bool)Tools::getValue('empty_smarty_cache'))
{
$redirectAdmin = true;
Tools::clearSmartyCache();
Autoload::getInstance()->generateIndex();
}
if ($redirectAdmin && (!isset($this->errors) || !count($this->errors)))
{
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => ''));
+32 -79
View File
@@ -357,18 +357,17 @@ class AdminProductsControllerCore extends AdminController
$result = parent::loadObject($opt);
if ($result && Validate::isLoadedObject($this->object))
{
if (Shop::getContext() == Shop::CONTEXT_SHOP && !$this->object->isAssociatedToShop())
if (Shop::getContext() == Shop::CONTEXT_SHOP && Shop::isFeatureActive() && !$this->object->isAssociatedToShop())
{
$default_product = new Product((int)$this->object->id, false, null, (int)$this->object->id_shop_default);
$def = ObjectModel::getDefinition($this->object);
foreach ($def['fields'] as $field_name => $row)
{
$fields_array = array();
if(is_array($default_product->$field_name))
foreach ($fields_array as $key => $fields_name)
$this->object->$field_name[$key] = ObjectModel::formatValue($fields_name, $def['fields'][$field_name]['type']);
if (is_array($default_product->$field_name))
foreach ($default_product->$field_name as $key => $value)
$this->object->{$field_name}[$key] = ObjectModel::formatValue($value, $def['fields'][$field_name]['type']);
else
$this->object->$field_name = ObjectModel::formatValue($this->object->$field_name, $def['fields'][$field_name]['type']);
$this->object->$field_name = ObjectModel::formatValue($default_product->$field_name, $def['fields'][$field_name]['type']);
}
}
$this->object->loadStockData();
@@ -629,6 +628,7 @@ class AdminProductsControllerCore extends AdminController
{
$id_category = (int)Tools::getValue('id_category');
$category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category;
Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id);
$this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url;
}
else
@@ -667,7 +667,7 @@ class AdminProductsControllerCore extends AdminController
{
$productId = (int)Tools::getValue('id_product');
@unlink(_PS_TMP_IMG_DIR_.'product_'.$productId.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$productId.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$productId.'_'.$this->context->shop->id.'.jpg');
$this->redirect_after = self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&action=Images&addproduct'.'&token='.$this->token;
}
}
@@ -861,6 +861,12 @@ class AdminProductsControllerCore extends AdminController
{
$combination = new Combination((int)$id_product_attribute);
$combination->setAttributes(Tools::getValue('attribute_combination_list'));
// images could be deleted before
$id_images = Tools::getValue('id_image_attr');
if (!empty($id_images))
$combination->setImages($id_images);
$product->checkDefaultAttributes();
if (Tools::getValue('attribute_default'))
{
@@ -1346,7 +1352,7 @@ class AdminProductsControllerCore extends AdminController
'shops' => $json_shops,
);
@unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$obj->id_product.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$obj->id_product.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$obj->id_product.'_'.$this->context->shop->id.'.jpg');
die(Tools::jsonEncode($json));
}
else
@@ -1518,7 +1524,7 @@ class AdminProductsControllerCore extends AdminController
$img->cover = 1;
@unlink(_PS_TMP_IMG_DIR_.'product_'.(int)$img->id_product.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$img->id_product.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.(int)$img->id_product.'_'.$this->context->shop->id.'.jpg');
if ($img->update())
$this->jsonConfirmation($this->_conf[26]);
@@ -1554,8 +1560,8 @@ class AdminProductsControllerCore extends AdminController
if (file_exists(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg'))
$res &= @unlink(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg');
if (file_exists(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'.jpg'))
$res &= @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'.jpg');
if (file_exists(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'_'.$this->context->shop->id.'.jpg'))
$res &= @unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$image->id_product.'_'.$this->context->shop->id.'.jpg');
if ($res)
$this->jsonConfirmation($this->_conf[7]);
@@ -1644,7 +1650,7 @@ class AdminProductsControllerCore extends AdminController
if (count($this->errors))
return false;
@unlink(_PS_TMP_IMG_DIR_.'product_'.$product->id.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$product->id.'.jpg');
@unlink(_PS_TMP_IMG_DIR_.'product_mini_'.$product->id.'_'.$this->context->shop->id.'.jpg');
return ((isset($id_image) && is_int($id_image) && $id_image) ? $id_image : false);
}
/**
@@ -1728,27 +1734,7 @@ class AdminProductsControllerCore extends AdminController
// Save and preview
if (Tools::isSubmit('submitAddProductAndPreview'))
{
$preview_url = $this->context->link->getProductLink(
$this->getFieldValue($this->object, 'id'),
$this->getFieldValue($this->object, 'link_rewrite', $this->context->language->id),
Category::getLinkRewrite($this->getFieldValue($this->object, 'id_category_default'), $this->context->language->id),
null,
null,
Context::getContext()->shop->id,
0,
(bool)Configuration::get('PS_REWRITING_SETTINGS')
);
if (!$this->object->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$preview_url .= '&adtoken='.$this->token.'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
}
$this->redirect_after = $preview_url;
}
$this->redirect_after = $this->getPreviewUrl($this->object);
// Save and stay on same form
if ($this->display == 'edit')
@@ -1893,30 +1879,7 @@ class AdminProductsControllerCore extends AdminController
// Save and preview
if (Tools::isSubmit('submitAddProductAndPreview'))
{
$preview_url = $this->context->link->getProductLink(
$this->getFieldValue($object, 'id'),
$this->getFieldValue($object, 'link_rewrite', $this->context->language->id),
Category::getLinkRewrite($this->getFieldValue($object, 'id_category_default'), $this->context->language->id),
null,
null,
Context::getContext()->shop->id,
0,
(bool)Configuration::get('PS_REWRITING_SETTINGS')
);
if (!$object->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
if (strpos($preview_url, '?') === false)
$preview_url .= '?';
else
$preview_url .= '&';
$preview_url .= 'adtoken='.$this->token.'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
}
$this->redirect_after = $preview_url;
}
$this->redirect_after = $this->getPreviewUrl($object);
else
{
// Save and stay on same form
@@ -2621,40 +2584,30 @@ class AdminProductsControllerCore extends AdminController
public function getPreviewUrl(Product $product)
{
$id_lang = Configuration::get('PS_LANG_DEFAULT', null, null, Context::getContext()->shop->id);
if (!ShopUrl::getMainShopDomain())
return false;
$is_rewrite_active = (bool)Configuration::get('PS_REWRITING_SETTINGS');
$preview_url = $this->context->link->getProductLink(
$product,
$this->getFieldValue($product, 'link_rewrite', $this->context->language->id),
Category::getLinkRewrite($product->id_category_default, $this->context->language->id),
Category::getLinkRewrite($this->getFieldValue($product, 'id_category_default'), $this->context->language->id),
null,
null,
Context::getContext()->shop->id,
$id_lang,
(int)Context::getContext()->shop->id,
0,
$is_rewrite_active
);
if (!$product->active)
{
$preview_url = $this->context->link->getProductLink(
$product,
$this->getFieldValue($product, 'link_rewrite', $this->default_form_language),
Category::getLinkRewrite($this->getFieldValue($product, 'id_category_default'), $this->context->language->id),
null,
null,
Context::getContext()->shop->id,
0,
$is_rewrite_active
);
if (!$product->active)
{
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$preview_url .= $product->active ? '' : '&adtoken='.$this->token.'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
}
$admin_dir = dirname($_SERVER['PHP_SELF']);
$admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1);
$preview_url .= ((strpos($preview_url, '?') === false) ? '?' : '&').'adtoken='.$this->token.'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id;
}
return $preview_url;
}
@@ -3012,7 +2965,7 @@ class AdminProductsControllerCore extends AdminController
$data->assign(array(
'link' => $this->context->link,
'currency' => $currency = $this->context->currency,
'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true),
'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true),
'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id),
'ecotaxTaxRate' => Tax::getProductEcotaxRate(),
'tax_exclude_taxe_option' => Tax::excludeTaxeOption(),
+46 -3
View File
@@ -38,7 +38,17 @@ class AdminShippingControllerCore extends AdminController
foreach ($carriers as $key => $carrier)
if ($carrier['is_free'])
unset($carriers[$key]);
$carrier_default_sort = array(
array('value' => Carrier::SORT_BY_PRICE, 'name' => $this->l('Price')),
array('value' => Carrier::SORT_BY_POSITION, 'name' => $this->l('Position'))
);
$carrier_default_order = array(
array('value' => Carrier::SORT_BY_ASC, 'name' => $this->l('Ascending')),
array('value' => Carrier::SORT_BY_DESC, 'name' => $this->l('Descending'))
);
$this->fields_options = array(
'handling' => array(
'title' => $this->l('Handling'),
@@ -69,12 +79,45 @@ class AdminShippingControllerCore extends AdminController
<li>'.$this->l('Coupons are not taken into account when calculating free shipping').'</li>
</ul>',
'submit' => array()
),
'general' => array(
'title' => $this->l('Carrier options'),
'fields' => array(
'PS_CARRIER_DEFAULT' => array(
'title' => $this->l('Default carrier:'),
'desc' => $this->l('Your shop\'s default carrier'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'id_carrier',
'list' => array_merge(
array(
-1 => array('id_carrier' => -1, 'name' => $this->l('Best price')),
-2 => array('id_carrier' => -2, 'name' => $this->l('Best grade'))
),
Carrier::getCarriers((int)Configuration::get('PS_LANG_DEFAULT'), true, false, false, null, Carrier::ALL_CARRIERS))
),
'PS_CARRIER_DEFAULT_SORT' => array(
'title' => $this->l('Sort by:'),
'desc' => $this->l('This will only be visible in the Front Office'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'value',
'list' => $carrier_default_sort
),
'PS_CARRIER_DEFAULT_ORDER' => array(
'title' => $this->l('Order by:'),
'desc' => $this->l('This will only be visible in the Front Office'),
'cast' => 'intval',
'type' => 'select',
'identifier' => 'value',
'list' => $carrier_default_order
),
),
'submit' => array()
)
);
);
}
public function postProcess()
{
/* Shipping fees */
+1 -1
View File
@@ -386,7 +386,7 @@ class AdminShopControllerCore extends AdminController
$this->fields_form['input'][] = array(
'type' => 'select',
'label' => $this->l('Category root:'),
'desc' => $this->l('This is the root category of the store that you\'ve created. To define a new root category for your store,').'&nbsp;<a href="'.$this->context->link->getAdminLink('AdminCategories').'&addcategoryroot">'.$this->l('Please click here').'</a>',
'desc' => $this->l('This is the root category of the store that you\'ve created. To define a new root category for your store,').'&nbsp;<a href="'.$this->context->link->getAdminLink('AdminCategories').'&addcategoryroot" target="_blank">'.$this->l('Please click here').'</a>',
'name' => 'id_category',
'options' => array(
'query' => $categories,
+30 -2
View File
@@ -242,6 +242,34 @@ class AdminStatesControllerCore extends AdminController
else
parent::postProcess();
}
protected function displayAjaxStates()
{
if ($this->tabAccess['view'] === '1')
{
$states = Db::getInstance()->executeS('
SELECT s.id_state, s.name
FROM '._DB_PREFIX_.'state s
LEFT JOIN '._DB_PREFIX_.'country c ON (s.`id_country` = c.`id_country`)
WHERE s.id_country = '.(int)(Tools::getValue('id_country')).' AND s.active = 1 AND c.`contains_states` = 1
ORDER BY s.`name` ASC');
if (is_array($states) AND !empty($states))
{
$list = '';
if (Tools::getValue('no_empty') != true)
{
$empty_value = (Tools::isSubmit('empty_value')) ? Tools::getValue('empty_value') : '----------';
$list = '<option value="0">'.Tools::htmlentitiesUTF8($empty_value).'</option>'."\n";
}
foreach ($states AS $state)
$list .= '<option value="'.(int)($state['id_state']).'"'.((isset($_GET['id_state']) AND $_GET['id_state'] == $state['id_state']) ? ' selected="selected"' : '').'>'.$state['name'].'</option>'."\n";
}
else
$list = 'false';
die($list);
}
}
}
+11 -1
View File
@@ -138,8 +138,13 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
$modules = $this->getModules();
$module_instance = array();
foreach ($modules as $module)
foreach ($modules as $m => $module)
{
$module_instance[$module['name']] = Module::getInstanceByName($module['name']);
$modules[$m]['displayName'] = $module_instance[$module['name']]->displayName;
}
uasort($modules, array($this, 'checkModulesNames'));
$tpl->assign(array(
'current' => self::$currentIndex,
@@ -150,6 +155,11 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor
return $tpl->fetch();
}
public function checkModulesNames($a, $b)
{
return (bool)($a['displayName'] > $b['displayName']);
}
protected function getModules()
{
@@ -103,7 +103,7 @@ class AdminSuppliersControllerCore extends AdminController
'label' => $this->l('Name'),
'name' => 'name',
'required' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}',
'hint' => $this->l('Invalid characters:').' &lt;&gt;;=#{}',
),
array(
'type' => 'textarea',
@@ -111,9 +111,10 @@ class AdminSuppliersControllerCore extends AdminController
'name' => 'description',
'lang' => true,
'hint' => array(
$this->l('Invalid characters:').' <>;=#{}',
$this->l('Invalid characters:').' &lt;&gt;;=#{}',
$this->l('Will appear in the supplier list')
)
),
'autoload_rte' => 'rte' //Enable TinyMCE editor for short description
),
array(
'type' => 'text',
@@ -183,14 +184,14 @@ class AdminSuppliersControllerCore extends AdminController
'label' => $this->l('Meta title:'),
'name' => 'meta_title',
'lang' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'text',
'label' => $this->l('Meta description:'),
'name' => 'meta_description',
'lang' => true,
'hint' => $this->l('Forbidden characters:').' <>;=#{}'
'hint' => $this->l('Forbidden characters:').' &lt;&gt;;=#{}'
),
array(
'type' => 'tags',
@@ -199,7 +200,7 @@ class AdminSuppliersControllerCore extends AdminController
'lang' => true,
'hint' => array(
$this->l('To add "tags" click in the field, write something and then press "Enter"'),
$this->l('Forbidden characters:').' <>;=#{}'
$this->l('Forbidden characters:').' &lt;&gt;;=#{}'
)
),
array(
@@ -759,7 +759,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
'orderby' => false,
'filter' => false,
'search' => false,
'hint' => 'Note that you can see details on the receptions - per products',
'hint' => $this->l('Note that you can see details on the receptions - per products'),
),
'quantity_expected' => array(
'title' => $this->l('Quantity expected'),
@@ -1197,7 +1197,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
}
// updates receipt
if (Tools::isSubmit('submitFiltersupply_order_detail') && Tools::isSubmit('submitBulkUpdatesupply_order_detail') && Tools::isSubmit('id_supply_order'))
if (Tools::isSubmit('submitBulkUpdatesupply_order_detail') && Tools::isSubmit('id_supply_order'))
$this->postProcessUpdateReceipt();
// use template to create a supply order
@@ -1342,6 +1342,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
$this->errors[] = sprintf(Tools::displayError($this->l('Quantity (%d) for product #%d is not valid')), (int)$quantity, (int)$id_supply_order_detail);
else // everything is valid : updates
{
// creates the history
$supplier_receipt_history = new SupplyOrderReceiptHistory();
$supplier_receipt_history->id_supply_order_detail = (int)$id_supply_order_detail;
@@ -181,6 +181,15 @@ class AdminTaxRulesGroupControllerCore extends AdminController
'stay' => true
)
);
if (Shop::isFeatureActive())
{
$this->fields_form['input'][] = array(
'type' => 'shop',
'label' => $this->l('Shop association:'),
'name' => 'checkBoxShopAsso',
);
}
if (!($obj = $this->loadObject(true)))
return;
@@ -501,5 +510,18 @@ class AdminTaxRulesGroupControllerCore extends AdminController
// TODO: check if the rule already exists
return $tr->validateController();
}
protected function displayAjaxUpdateTaxRule()
{
if ($this->tabAccess['view'] === '1')
{
$id_tax_rule = Tools::getValue('id_tax_rule');
$tax_rules = new TaxRule((int)$id_tax_rule);
$output = array();
foreach ($tax_rules as $key => $result)
$output[$key] = $result;
die(Tools::jsonEncode($output));
}
}
}
@@ -461,7 +461,9 @@ class AdminTranslationsControllerCore extends AdminController
if (!$default_language || !Validate::isLanguageIsoCode($default_language))
return false;
// 1 - Scan mails files
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
$mails = array();
if (Tools::file_exists_cache(_PS_MAIL_DIR_.$default_language.'/'))
$mails = scandir(_PS_MAIL_DIR_.$default_language.'/');
$mails_new_lang = array();
@@ -580,7 +582,9 @@ class AdminTranslationsControllerCore extends AdminController
if (preg_match('#^translations\/'.$iso_code.'\/tabs.php#Ui', $file['filename'], $matches) && Validate::isLanguageIsoCode($iso_code))
{
// Include array width new translations tabs
$tabs = include _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename'];
$tabs = array();
if (Tools::file_exists_cache(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']))
$tabs = include_once(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$file['filename']);
foreach ($tabs as $class_name => $translations)
{
@@ -1066,7 +1070,7 @@ class AdminTranslationsControllerCore extends AdminController
{
case 'front':
// Parsing file in Front office
$regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?\s*\}/U';
$regex = '/\{l\s*s=(?|\'('._PS_TRANS_PATTERN_.')\'|"('._PS_TRANS_PATTERN_.')")(\s*sprintf=.*)?(\s*js=1)?\s*\}/U';
break;
case 'back':
@@ -1076,7 +1080,7 @@ class AdminTranslationsControllerCore extends AdminController
else if ($type_file == 'specific')
$regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U';
else
$regex = '/\{l\s*s\s*=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
$regex = '/\{l\s*s\s*=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U';
break;
case 'errors':
@@ -1090,7 +1094,7 @@ class AdminTranslationsControllerCore extends AdminController
$regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U';
else
// In tpl file look for something that should contain mod='module_name' according to the documentation
$regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\").*\s+mod=\''.$module_name.'\'.*\}/U';
$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'").*\s+mod=\''.$module_name.'\'.*\}/U';
break;
case 'pdf':
@@ -1098,7 +1102,7 @@ class AdminTranslationsControllerCore extends AdminController
if ($type_file == 'php')
$regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U';
else
$regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
$regex = '/\{l\s*s=(?|\''._PS_TRANS_PATTERN_.'\'|"'._PS_TRANS_PATTERN_.'")(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U';
break;
}