Merge branch 'development' of https://github.com/PrestaShop/PrestaShop into development

This commit is contained in:
Jerome Nadaud
2013-09-02 19:11:17 +02:00
44 changed files with 221 additions and 126 deletions
@@ -256,7 +256,7 @@ class AdminManufacturersControllerCore extends AdminController
'lang' => true,
'cols' => 60,
'rows' => 10,
'class' => 'rte',
'autoload_rte' => 'rte', //Enable TinyMCE editor for short description
'hint' => $this->l('Invalid characters:').' <>;=#{}'
),
array(
@@ -266,7 +266,7 @@ class AdminManufacturersControllerCore extends AdminController
'lang' => true,
'cols' => 60,
'rows' => 10,
'class' => 'rte',
'autoload_rte' => 'rte', //Enable TinyMCE editor for description
'hint' => $this->l('Invalid characters:').' <>;=#{}'
),
array(
@@ -730,4 +730,4 @@ class AdminManufacturersControllerCore extends AdminController
{
return true;
}
}
}
@@ -302,14 +302,13 @@ class AdminModulesPositionsControllerCore extends AdminController
public function getLiveEditUrl($live_edit_params)
{
$lang = '';
$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 = Tools::getCurrentUrlProtocolPrefix().Tools::getHttpHost().$dir.$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
return $url;
}
@@ -863,6 +863,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'))
{
+29 -1
View File
@@ -236,6 +236,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);
}
}
}
@@ -94,7 +94,8 @@ class AdminSuppliersControllerCore extends AdminController
'rows' => 10,
'lang' => true,
'hint' => $this->l('Invalid characters:').' <>;=#{}',
'desc' => $this->l('Will appear in the supplier list')
'desc' => $this->l('Will appear in the supplier list'),
'autoload_rte' => 'rte' //Enable TinyMCE editor for short description
),
array(
'type' => 'text',
@@ -519,35 +519,5 @@ class AdminTaxRulesGroupControllerCore extends AdminController
die(Tools::jsonEncode($output));
}
}
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);
}
}
}