//fix correction norm in AdminProducts

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8830 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre committed 2011-09-28 08:26:46 +00:00
1 parent c97115fd98
commit c304a2c620
3 files changed
+146 -190

No files matched your search

+139 -139
View File
@@ -104,9 +104,9 @@ class AdminProducts extends AdminTab
$_POST['height'] = empty($_POST['height']) ? '0' : str_replace(',', '.', $_POST['height']); $_POST['height'] = empty($_POST['height']) ? '0' : str_replace(',', '.', $_POST['height']);
$_POST['depth'] = empty($_POST['depth']) ? '0' : str_replace(',', '.', $_POST['depth']); $_POST['depth'] = empty($_POST['depth']) ? '0' : str_replace(',', '.', $_POST['depth']);
$_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']); $_POST['weight'] = empty($_POST['weight']) ? '0' : str_replace(',', '.', $_POST['weight']);
if ($_POST['unit_price'] != NULL) if ($_POST['unit_price'] != null)
$object->unit_price = str_replace(',', '.', $_POST['unit_price']); $object->unit_price = str_replace(',', '.', $_POST['unit_price']);
if (array_key_exists('ecotax', $_POST) && $_POST['ecotax'] != NULL) if (array_key_exists('ecotax', $_POST) && $_POST['ecotax'] != null)
$object->ecotax = str_replace(',', '.', $_POST['ecotax']); $object->ecotax = str_replace(',', '.', $_POST['ecotax']);
$object->available_for_order = (int)(Tools::isSubmit('available_for_order')); $object->available_for_order = (int)(Tools::isSubmit('available_for_order'));
$object->show_price = $object->available_for_order ? 1 : (int)(Tools::isSubmit('show_price')); $object->show_price = $object->available_for_order ? 1 : (int)(Tools::isSubmit('show_price'));
@@ -114,7 +114,7 @@ class AdminProducts extends AdminTab
$object->online_only = Tools::isSubmit('online_only'); $object->online_only = Tools::isSubmit('online_only');
} }
public function getList($id_lang, $orderBy = NULL, $orderWay = NULL, $start = 0, $limit = NULL, $id_lang_shop = NULL) public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, $limit = null, $id_lang_shop = null)
{ {
$orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : 'id_'.$this->table) : $orderBy); $orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : 'id_'.$this->table) : $orderBy);
$orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderby') : 'ASC') : $orderWay); $orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderby') : 'ASC') : $orderWay);
@@ -133,7 +133,7 @@ class AdminProducts extends AdminTab
/* update product final price */ /* update product final price */
for ($i = 0; $i < $nb; $i++) for ($i = 0; $i < $nb; $i++)
$this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, NULL, 6, NULL, false, true, 1, true); $this->_list[$i]['price_tmp'] = Product::getPriceStatic($this->_list[$i]['id_product'], true, null, 6, null, false, true, 1, true);
} }
if ($orderByPriceFinal == 'price_final') if ($orderByPriceFinal == 'price_final')
@@ -143,7 +143,7 @@ class AdminProducts extends AdminTab
else else
uasort($this->_list, 'cmpPriceAsc'); uasort($this->_list, 'cmpPriceAsc');
} }
for ($i = 0; $this->_list AND $i < $nb; $i++) for ($i = 0; $this->_list && $i < $nb; $i++)
{ {
$this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp']; $this->_list[$i]['price_final'] = $this->_list[$i]['price_tmp'];
unset($this->_list[$i]['price_tmp']); unset($this->_list[$i]['price_tmp']);
@@ -164,12 +164,12 @@ class AdminProducts extends AdminTab
* @param mixed $token * @param mixed $token
* @return void * @return void
*/ */
public function postProcess($token = NULL) public function postProcess($token = null)
{ {
/* Add a new product */ /* Add a new product */
if (Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitAddProductAndPreview')) if (Tools::isSubmit('submitAddproduct') || Tools::isSubmit('submitAddproductAndStay') || Tools::isSubmit('submitAddProductAndPreview'))
{ {
if ((Tools::getValue('id_product') AND $this->tabAccess['edit'] === '1') OR ($this->tabAccess['add'] === '1' AND !Tools::isSubmit('id_product'))) if ((Tools::getValue('id_product') && $this->tabAccess['edit'] === '1') || ($this->tabAccess['add'] === '1' && !Tools::isSubmit('id_product')))
$this->submitAddproduct($token); $this->submitAddproduct($token);
else else
$this->_errors[] = Tools::displayError('You do not have permission to add here.'); $this->_errors[] = Tools::displayError('You do not have permission to add here.');
@@ -191,7 +191,7 @@ class AdminProducts extends AdminTab
{ {
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
$is_attachment_name_valid = false; $is_attachment_name_valid = false;
foreach ($languages AS $language) foreach ($languages as $language)
{ {
$attachment_name_lang = Tools::getValue('attachment_name_'.(int)($language['id_lang'])); $attachment_name_lang = Tools::getValue('attachment_name_'.(int)($language['id_lang']));
if (strlen($attachment_name_lang ) > 0) if (strlen($attachment_name_lang ) > 0)
@@ -209,7 +209,7 @@ class AdminProducts extends AdminTab
if (empty($this->_errors)) if (empty($this->_errors))
{ {
if (isset($_FILES['attachment_file']) AND is_uploaded_file($_FILES['attachment_file']['tmp_name'])) if (isset($_FILES['attachment_file']) && is_uploaded_file($_FILES['attachment_file']['tmp_name']))
{ {
if ($_FILES['attachment_file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024)) if ($_FILES['attachment_file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024))
$this->_errors[] = $this->l('File too large, maximum size allowed:').' '.(Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024).' '.$this->l('kb').'. '.$this->l('File size you\'re trying to upload is:').number_format(($_FILES['attachment_file']['size']/1024), 2, '.', '').$this->l('kb'); $this->_errors[] = $this->l('File too large, maximum size allowed:').' '.(Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024).' '.$this->l('kb').'. '.$this->l('File size you\'re trying to upload is:').number_format(($_FILES['attachment_file']['size']/1024), 2, '.', '').$this->l('kb');
@@ -232,7 +232,7 @@ class AdminProducts extends AdminTab
if (empty($this->_errors) && isset($uniqid)) if (empty($this->_errors) && isset($uniqid))
{ {
$attachment = new Attachment(); $attachment = new Attachment();
foreach ($languages AS $language) foreach ($languages as $language)
{ {
if (isset($_POST['attachment_name_'.(int)($language['id_lang'])])) if (isset($_POST['attachment_name_'.(int)($language['id_lang'])]))
$attachment->name[(int)($language['id_lang'])] = pSQL($_POST['attachment_name_'.(int)($language['id_lang'])]); $attachment->name[(int)($language['id_lang'])] = pSQL($_POST['attachment_name_'.(int)($language['id_lang'])]);
@@ -242,7 +242,7 @@ class AdminProducts extends AdminTab
$attachment->file = $uniqid; $attachment->file = $uniqid;
$attachment->mime = $_FILES['attachment_file']['type']; $attachment->mime = $_FILES['attachment_file']['type'];
$attachment->file_name = pSQL($_FILES['attachment_file']['name']); $attachment->file_name = pSQL($_FILES['attachment_file']['name']);
if (empty($attachment->mime) OR Tools::strlen($attachment->mime) > 128) if (empty($attachment->mime) || Tools::strlen($attachment->mime) > 128)
$this->_errors[] = Tools::displayError('Invalid file extension'); $this->_errors[] = Tools::displayError('Invalid file extension');
if (!Validate::isGenericName($attachment->file_name)) if (!Validate::isGenericName($attachment->file_name))
$this->_errors[] = Tools::displayError('Invalid file name'); $this->_errors[] = Tools::displayError('Invalid file name');
@@ -282,22 +282,22 @@ class AdminProducts extends AdminTab
$product->indexed = 0; $product->indexed = 0;
$product->active = 0; $product->active = 0;
if ($product->add() if ($product->add()
AND Category::duplicateProductCategories($id_product_old, $product->id) && Category::duplicateProductCategories($id_product_old, $product->id)
AND ($combinationImages = Product::duplicateAttributes($id_product_old, $product->id)) !== false && ($combinationImages = Product::duplicateAttributes($id_product_old, $product->id)) !== false
AND GroupReduction::duplicateReduction($id_product_old, $product->id) && GroupReduction::duplicateReduction($id_product_old, $product->id)
AND Product::duplicateAccessories($id_product_old, $product->id) && Product::duplicateAccessories($id_product_old, $product->id)
AND Product::duplicateFeatures($id_product_old, $product->id) && Product::duplicateFeatures($id_product_old, $product->id)
AND Product::duplicateSpecificPrices($id_product_old, $product->id) && Product::duplicateSpecificPrices($id_product_old, $product->id)
AND Pack::duplicate($id_product_old, $product->id) && Pack::duplicate($id_product_old, $product->id)
AND Product::duplicateCustomizationFields($id_product_old, $product->id) && Product::duplicateCustomizationFields($id_product_old, $product->id)
AND Product::duplicateTags($id_product_old, $product->id) && Product::duplicateTags($id_product_old, $product->id)
AND Product::duplicateDownload($id_product_old, $product->id) && Product::duplicateDownload($id_product_old, $product->id)
AND $product->duplicateShops($id_product_old)) && $product->duplicateShops($id_product_old))
{ {
if ($product->hasAttributes()) if ($product->hasAttributes())
Product::updateDefaultAttribute($product->id); Product::updateDefaultAttribute($product->id);
if (!Tools::getValue('noimage') AND !Image::duplicateProductImages($id_product_old, $product->id, $combinationImages)) if (!Tools::getValue('noimage') && !Image::duplicateProductImages($id_product_old, $product->id, $combinationImages))
$this->_errors[] = Tools::displayError('An error occurred while copying images.'); $this->_errors[] = Tools::displayError('An error occurred while copying images.');
else else
{ {
@@ -314,14 +314,14 @@ class AdminProducts extends AdminTab
$this->_errors[] = Tools::displayError('You do not have permission to add here.'); $this->_errors[] = Tools::displayError('You do not have permission to add here.');
} }
/* Change object statuts (active, inactive) */ /* Change object statuts (active, inactive) */
elseif (isset($_GET['status']) AND Tools::getValue($this->identifier)) else if (isset($_GET['status']) && Tools::getValue($this->identifier))
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
if (Validate::isLoadedObject($object = $this->loadObject())) if (Validate::isLoadedObject($object = $this->loadObject()))
{ {
if ($object->toggleStatus()) if ($object->toggleStatus())
Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) AND Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token); Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = (!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1')) && Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$token);
else else
$this->_errors[] = Tools::displayError('An error occurred while updating status.'); $this->_errors[] = Tools::displayError('An error occurred while updating status.');
} }
@@ -336,10 +336,10 @@ class AdminProducts extends AdminTab
{ {
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
{ {
if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings)) if (Validate::isLoadedObject($object = $this->loadObject()) && isset($this->fieldImageSettings))
{ {
// check if request at least one object with noZeroObject // check if request at least one object with noZeroObject
if (isset($object->noZeroObject) AND sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1) if (isset($object->noZeroObject) && sizeof($taxes = call_user_func(array($this->className, $object->noZeroObject))) <= 1)
$this->_errors[] = Tools::displayError('You need at least one object.').' <b>'.$this->table.'</b><br />'.Tools::displayError('You cannot delete all of the items.'); $this->_errors[] = Tools::displayError('You need at least one object.').' <b>'.$this->table.'</b><br />'.Tools::displayError('You cannot delete all of the items.');
else else
{ {
@@ -374,9 +374,9 @@ class AdminProducts extends AdminTab
{ {
$object = new $this->className(); $object = new $this->className();
if (isset($object->noZeroObject) AND if (isset($object->noZeroObject) &&
// Check if all object will be deleted // Check if all object will be deleted
(sizeof(call_user_func(array($this->className, $object->noZeroObject))) <= 1 OR sizeof($_POST[$this->table.'Box']) == sizeof(call_user_func(array($this->className, $object->noZeroObject))))) (sizeof(call_user_func(array($this->className, $object->noZeroObject))) <= 1 || sizeof($_POST[$this->table.'Box']) == sizeof(call_user_func(array($this->className, $object->noZeroObject)))))
$this->_errors[] = Tools::displayError('You need at least one object.').' <b>'.$this->table.'</b><br />'.Tools::displayError('You cannot delete all of the items.'); $this->_errors[] = Tools::displayError('You need at least one object.').' <b>'.$this->table.'</b><br />'.Tools::displayError('You cannot delete all of the items.');
else else
{ {
@@ -387,7 +387,7 @@ class AdminProducts extends AdminTab
{ {
$toDelete = new $this->className($id); $toDelete = new $this->className($id);
$toDelete->deleted = 1; $toDelete->deleted = 1;
$result = $result AND $toDelete->update(); $result = $result && $toDelete->update();
} }
} }
else else
@@ -411,7 +411,7 @@ class AdminProducts extends AdminTab
} }
/* Product images management */ /* Product images management */
elseif (($id_image = (int)(Tools::getValue('id_image'))) AND Validate::isUnsignedId($id_image) AND Validate::isLoadedObject($image = new Image($id_image))) else if (($id_image = (int)(Tools::getValue('id_image'))) && Validate::isUnsignedId($id_image) && Validate::isLoadedObject($image = new Image($id_image)))
{ {
if ($this->tabAccess['edit'] === '1') if ($this->tabAccess['edit'] === '1')
{ {
@@ -445,7 +445,7 @@ class AdminProducts extends AdminTab
} }
/* Choose product image position */ /* Choose product image position */
elseif (isset($_GET['imgPosition']) AND isset($_GET['imgDirection'])) else if (isset($_GET['imgPosition']) && isset($_GET['imgDirection']))
{ {
$image->updatePosition(Tools::getValue('imgDirection'), Tools::getValue('imgPosition')); $image->updatePosition(Tools::getValue('imgDirection'), Tools::getValue('imgPosition'));
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$image->id_product.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=1&token='.($token ? $token : $this->token));
@@ -462,9 +462,9 @@ class AdminProducts extends AdminTab
return; return;
if (Validate::isLoadedObject($product = new Product((int)(Tools::getValue('id_product'))))) if (Validate::isLoadedObject($product = new Product((int)(Tools::getValue('id_product')))))
{ {
if (!isset($_POST['attribute_price']) OR $_POST['attribute_price'] == NULL) if (!isset($_POST['attribute_price']) || $_POST['attribute_price'] == null)
$this->_errors[] = Tools::displayError('Attribute price required.'); $this->_errors[] = Tools::displayError('Attribute price required.');
if (!isset($_POST['attribute_combinaison_list']) OR !sizeof($_POST['attribute_combinaison_list'])) if (!isset($_POST['attribute_combinaison_list']) || !sizeof($_POST['attribute_combinaison_list']))
$this->_errors[] = Tools::displayError('You must add at least one attribute.'); $this->_errors[] = Tools::displayError('You must add at least one attribute.');
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
@@ -503,9 +503,9 @@ class AdminProducts extends AdminTab
Tools::getValue('minimal_quantity'), Tools::getValue('minimal_quantity'),
Tools::getValue('available_date')); Tools::getValue('available_date'));
if ($id_reason = (int)Tools::getValue('id_mvt_reason') AND (int)Tools::getValue('attribute_mvt_quantity') > 0 AND $id_reason > 0) if ($id_reason = (int)Tools::getValue('id_mvt_reason') && (int)Tools::getValue('attribute_mvt_quantity') > 0 && $id_reason > 0)
{ {
if (!$product->addStockMvt(Tools::getValue('attribute_mvt_quantity'), $id_reason, $id_product_attribute, NULL, $this->context->employee->id)) if (!$product->addStockMvt(Tools::getValue('attribute_mvt_quantity'), $id_reason, $id_product_attribute, null, $this->context->employee->id))
$this->_errors[] = Tools::displayError('An error occurred while updating qty.'); $this->_errors[] = Tools::displayError('An error occurred while updating qty.');
} }
Hook::updateProductAttribute((int)$id_product_attribute); Hook::updateProductAttribute((int)$id_product_attribute);
@@ -565,7 +565,7 @@ class AdminProducts extends AdminTab
return; return;
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
{ {
if (($id_product = (int)(Tools::getValue('id_product'))) AND Validate::isUnsignedId($id_product) AND Validate::isLoadedObject($product = new Product($id_product))) if (($id_product = (int)(Tools::getValue('id_product'))) && Validate::isUnsignedId($id_product) && Validate::isLoadedObject($product = new Product($id_product)))
{ {
$product->deleteAttributeCombinaison(Tools::getValue('id_product_attribute')); $product->deleteAttributeCombinaison(Tools::getValue('id_product_attribute'));
$product->checkDefaultAttributes(); $product->checkDefaultAttributes();
@@ -592,7 +592,7 @@ class AdminProducts extends AdminTab
return; return;
if ($this->tabAccess['delete'] === '1') if ($this->tabAccess['delete'] === '1')
{ {
if (($id_product = (int)(Tools::getValue('id_product'))) AND Validate::isUnsignedId($id_product) AND Validate::isLoadedObject($product = new Product($id_product))) if (($id_product = (int)(Tools::getValue('id_product'))) && Validate::isUnsignedId($id_product) && Validate::isLoadedObject($product = new Product($id_product)))
{ {
$product->deleteProductAttributes(); $product->deleteProductAttributes();
$product->updateQuantityProductWithAttributeQuantity(); $product->updateQuantityProductWithAttributeQuantity();
@@ -637,7 +637,7 @@ class AdminProducts extends AdminTab
// add new objects // add new objects
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
foreach ($_POST AS $key => $val) foreach ($_POST as $key => $val)
{ {
if (preg_match('/^feature_([0-9]+)_value/i', $key, $match)) if (preg_match('/^feature_([0-9]+)_value/i', $key, $match))
{ {
@@ -648,7 +648,7 @@ class AdminProducts extends AdminTab
if ($default_value = $this->checkFeatures($languages, $match[1])) if ($default_value = $this->checkFeatures($languages, $match[1]))
{ {
$id_value = $product->addFeaturesToDB($match[1], 0, 1, (int)$language['id_lang']); $id_value = $product->addFeaturesToDB($match[1], 0, 1, (int)$language['id_lang']);
foreach ($languages AS $language) foreach ($languages as $language)
{ {
if ($cust = Tools::getValue('custom_'.$match[1].'_'.(int)$language['id_lang'])) if ($cust = Tools::getValue('custom_'.$match[1].'_'.(int)$language['id_lang']))
$product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $cust); $product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $cust);
@@ -752,7 +752,7 @@ class AdminProducts extends AdminTab
{ {
if (!($obj = $this->loadObject())) if (!($obj = $this->loadObject()))
return; return;
if (!$id_specific_price = Tools::getValue('id_specific_price') OR !Validate::isUnsignedId($id_specific_price)) if (!$id_specific_price = Tools::getValue('id_specific_price') || !Validate::isUnsignedId($id_specific_price))
$this->_errors[] = Tools::displayError('Invalid specific price ID'); $this->_errors[] = Tools::displayError('Invalid specific price ID');
else else
{ {
@@ -793,12 +793,12 @@ class AdminProducts extends AdminTab
{ {
if (!$product->createLabels((int)($_POST['uploadable_files']) - (int)($product->uploadable_files), (int)($_POST['text_fields']) - (int)($product->text_fields))) if (!$product->createLabels((int)($_POST['uploadable_files']) - (int)($product->uploadable_files), (int)($_POST['text_fields']) - (int)($product->text_fields)))
$this->_errors[] = Tools::displayError('An error occurred while creating customization fields.'); $this->_errors[] = Tools::displayError('An error occurred while creating customization fields.');
if (!sizeof($this->_errors) AND !$product->updateLabels()) if (!sizeof($this->_errors) && !$product->updateLabels())
$this->_errors[] = Tools::displayError('An error occurred while updating customization.'); $this->_errors[] = Tools::displayError('An error occurred while updating customization.');
$product->uploadable_files = (int)($_POST['uploadable_files']); $product->uploadable_files = (int)($_POST['uploadable_files']);
$product->text_fields = (int)($_POST['text_fields']); $product->text_fields = (int)($_POST['text_fields']);
$product->customizable = ((int)($_POST['uploadable_files']) > 0 OR (int)($_POST['text_fields']) > 0) ? 1 : 0; $product->customizable = ((int)($_POST['uploadable_files']) > 0 || (int)($_POST['text_fields']) > 0) ? 1 : 0;
if (!sizeof($this->_errors) AND !$product->update()) if (!sizeof($this->_errors) && !$product->update())
$this->_errors[] = Tools::displayError('An error occurred while updating customization configuration.'); $this->_errors[] = Tools::displayError('An error occurred while updating customization configuration.');
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token));
@@ -815,10 +815,10 @@ class AdminProducts extends AdminTab
{ {
if (Validate::isLoadedObject($product = new Product((int)(Tools::getValue('id_product'))))) if (Validate::isLoadedObject($product = new Product((int)(Tools::getValue('id_product')))))
{ {
foreach ($_POST AS $field => $value) foreach ($_POST as $field => $value)
if (strncmp($field, 'label_', 6) == 0 AND !Validate::isLabel($value)) if (strncmp($field, 'label_', 6) == 0 && !Validate::isLabel($value))
$this->_errors[] = Tools::displayError('Label fields are invalid'); $this->_errors[] = Tools::displayError('Label fields are invalid');
if (!sizeof($this->_errors) AND !$product->updateLabels()) if (!sizeof($this->_errors) && !$product->updateLabels())
$this->_errors[] = Tools::displayError('An error occurred while updating customization.'); $this->_errors[] = Tools::displayError('An error occurred while updating customization.');
if (!sizeof($this->_errors)) if (!sizeof($this->_errors))
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$product->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&add'.$this->table.'&tabs=5&token='.($token ? $token : $this->token));
@@ -872,11 +872,11 @@ class AdminProducts extends AdminTab
if (Tools::getValue('updateProductImageShopAsso')) if (Tools::getValue('updateProductImageShopAsso'))
{ {
if ($id_image = (int)Tools::getValue('id_image') AND $id_shop = (int)Tools::getValue('id_shop')) if ($id_image = (int)Tools::getValue('id_image') && $id_shop = (int)Tools::getValue('id_shop'))
if (Tools::getValue('active') == "true") if (Tools::getValue('active') == "true")
die(Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'image_shop (`id_image`, `id_shop`) VALUES('.(int)$id_image.', '.(int)$id_shop.')')); die(Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'image_shop (`id_image`, `id_shop`) VALUES('.(int)$id_image.', '.(int)$id_shop.')'));
else else
die(Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'image_shop WHERE `id_image`='.(int)$id_image.' AND `id_shop`='.(int)$id_shop)); die(Db::getInstance()->Execute('DELETE FROM '._DB_PREFIX_.'image_shop WHERE `id_image`='.(int)$id_image.' && `id_shop`='.(int)$id_shop));
} }
if (Tools::getValue('deleteImage')) if (Tools::getValue('deleteImage'))
@@ -901,15 +901,15 @@ class AdminProducts extends AdminTab
} }
protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $price, $from_quantity, $reduction, $reduction_type, $from, $to) protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $price, $from_quantity, $reduction, $reduction_type, $from, $to)
{ {
if (!Validate::isUnsignedId($id_shop) OR !Validate::isUnsignedId($id_currency) OR !Validate::isUnsignedId($id_country) OR !Validate::isUnsignedId($id_group)) if (!Validate::isUnsignedId($id_shop) || !Validate::isUnsignedId($id_currency) || !Validate::isUnsignedId($id_country) || !Validate::isUnsignedId($id_group))
$this->_errors[] = Tools::displayError('Wrong ID\'s'); $this->_errors[] = Tools::displayError('Wrong ID\'s');
elseif ((empty($price) AND empty($reduction)) OR (!empty($price) AND !Validate::isPrice($price)) OR (!empty($reduction) AND !Validate::isPrice($reduction))) else if ((empty($price) && empty($reduction)) || (!empty($price) && !Validate::isPrice($price)) || (!empty($reduction) && !Validate::isPrice($reduction)))
$this->_errors[] = Tools::displayError('Invalid price/reduction amount'); $this->_errors[] = Tools::displayError('Invalid price/reduction amount');
else if (!Validate::isUnsignedInt($from_quantity)) else if (!Validate::isUnsignedInt($from_quantity))
$this->_errors[] = Tools::displayError('Invalid quantity'); $this->_errors[] = Tools::displayError('Invalid quantity');
elseif ($reduction AND !Validate::isReductionType($reduction_type)) else if ($reduction && !Validate::isReductionType($reduction_type))
$this->_errors[] = Tools::displayError('Please select a reduction type (amount or percentage)'); $this->_errors[] = Tools::displayError('Please select a reduction type (amount or percentage)');
elseif ($from AND $to AND (!Validate::isDateFormat($from) OR !Validate::isDateFormat($to))) else if ($from && $to && (!Validate::isDateFormat($from) || !Validate::isDateFormat($to)))
$this->_errors[] = Tools::displayError('Wrong from/to date'); $this->_errors[] = Tools::displayError('Wrong from/to date');
else else
return true; return true;
@@ -922,7 +922,7 @@ class AdminProducts extends AdminTab
$rules = call_user_func(array('FeatureValue', 'getValidationRules'), 'FeatureValue'); $rules = call_user_func(array('FeatureValue', 'getValidationRules'), 'FeatureValue');
$feature = Feature::getFeature(Configuration::get('PS_LANG_DEFAULT'), $feature_id); $feature = Feature::getFeature(Configuration::get('PS_LANG_DEFAULT'), $feature_id);
$val = 0; $val = 0;
foreach ($languages AS $language) foreach ($languages as $language)
if ($val = Tools::getValue('custom_'.$feature_id.'_'.$language['id_lang'])) if ($val = Tools::getValue('custom_'.$feature_id.'_'.$language['id_lang']))
{ {
$currentLanguage = new Language($language['id_lang']); $currentLanguage = new Language($language['id_lang']);
@@ -960,19 +960,19 @@ class AdminProducts extends AdminTab
$image->cover = $cover; $image->cover = $cover;
$this->validateRules('Image'); $this->validateRules('Image');
$this->copyFromPost($image, 'image'); $this->copyFromPost($image, 'image');
if (sizeof($this->_errors) OR !$image->update()) if (sizeof($this->_errors) || !$image->update())
$this->_errors[] = Tools::displayError('An error occurred while updating image.'); $this->_errors[] = Tools::displayError('An error occurred while updating image.');
elseif (isset($_FILES['image_product']['tmp_name']) AND $_FILES['image_product']['tmp_name'] != NULL) else if (isset($_FILES['image_product']['tmp_name']) && $_FILES['image_product']['tmp_name'] != null)
$this->copyImage($product->id, $image->id, $method); $this->copyImage($product->id, $image->id, $method);
} }
} }
if (isset($image) AND Validate::isLoadedObject($image) AND !file_exists(_PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format)) if (isset($image) && Validate::isLoadedObject($image) && !file_exists(_PS_PROD_IMG_DIR_.$image->getExistingImgPath().'.'.$image->image_format))
$image->delete(); $image->delete();
if (sizeof($this->_errors)) if (sizeof($this->_errors))
return false; return false;
@unlink(_PS_TMP_IMG_DIR_.'/product_'.$product->id.'.jpg'); @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.'.jpg');
return ((isset($id_image) AND is_int($id_image) AND $id_image) ? $id_image : true); return ((isset($id_image) && is_int($id_image) && $id_image) ? $id_image : true);
} }
/** /**
* Copy a product image * Copy a product image
@@ -992,14 +992,14 @@ class AdminProducts extends AdminTab
if (!$new_path = $image->getPathForCreation()) if (!$new_path = $image->getPathForCreation())
$this->_errors[] = Tools::displayError('An error occurred during new folder creation'); $this->_errors[] = Tools::displayError('An error occurred during new folder creation');
if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') OR !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName)) if (!$tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS') || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName))
$this->_errors[] = Tools::displayError('An error occurred during the image upload'); $this->_errors[] = Tools::displayError('An error occurred during the image upload');
else if (!imageResize($tmpName, $new_path.'.'.$image->image_format)) else if (!imageResize($tmpName, $new_path.'.'.$image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image.'); $this->_errors[] = Tools::displayError('An error occurred while copying image.');
else if ($method == 'auto') else if ($method == 'auto')
{ {
$imagesTypes = ImageType::getImagesTypes('products'); $imagesTypes = ImageType::getImagesTypes('products');
foreach ($imagesTypes AS $k => $imageType) foreach ($imagesTypes as $k => $imageType)
if (!imageResize($tmpName, $new_path.'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format)) if (!imageResize($tmpName, $new_path.'-'.stripslashes($imageType['name']).'.'.$image->image_format, $imageType['width'], $imageType['height'], $image->image_format))
$this->_errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']); $this->_errors[] = Tools::displayError('An error occurred while copying image:').' '.stripslashes($imageType['name']);
} }
@@ -1012,7 +1012,7 @@ class AdminProducts extends AdminTab
/** /**
* Add or update a product * Add or update a product
*/ */
public function submitAddProduct($token = NULL) public function submitAddProduct($token = null)
{ {
$className = 'Product'; $className = 'Product';
$rules = call_user_func(array($this->className, 'getValidationRules'), $this->className); $rules = call_user_func(array($this->className, 'getValidationRules'), $this->className);
@@ -1020,22 +1020,22 @@ class AdminProducts extends AdminTab
$languages = Language::getLanguages(false); $languages = Language::getLanguages(false);
/* Check required fields */ /* Check required fields */
foreach ($rules['required'] AS $field) foreach ($rules['required'] as $field)
if (($value = Tools::getValue($field)) == false AND $value != '0') if (($value = Tools::getValue($field)) == false && $value != '0')
{ {
if (Tools::getValue('id_'.$this->table) AND $field == 'passwd') if (Tools::getValue('id_'.$this->table) && $field == 'passwd')
continue; continue;
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is required'); $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is required');
} }
/* Check multilingual required fields */ /* Check multilingual required fields */
foreach ($rules['requiredLang'] AS $fieldLang) foreach ($rules['requiredLang'] as $fieldLang)
if (!Tools::getValue($fieldLang.'_'.$defaultLanguage->id)) if (!Tools::getValue($fieldLang.'_'.$defaultLanguage->id))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).'</b> '.$this->l('is required at least in').' '.$defaultLanguage->name; $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).'</b> '.$this->l('is required at least in').' '.$defaultLanguage->name;
/* Check fields sizes */ /* Check fields sizes */
foreach ($rules['size'] AS $field => $maxLength) foreach ($rules['size'] as $field => $maxLength)
if ($value = Tools::getValue($field) AND Tools::strlen($value) > $maxLength) if ($value = Tools::getValue($field) && Tools::strlen($value) > $maxLength)
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')';
if (isset($_POST['description_short'])) if (isset($_POST['description_short']))
@@ -1047,41 +1047,41 @@ class AdminProducts extends AdminTab
/* Check description short size without html */ /* Check description short size without html */
$limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT'); $limit = (int)Configuration::get('PS_PRODUCT_SHORT_DESC_LIMIT');
if ($limit <= 0) $limit = 400; if ($limit <= 0) $limit = 400;
foreach ($languages AS $language) foreach ($languages as $language)
if ($value = Tools::getValue('description_short_'.$language['id_lang'])) if ($value = Tools::getValue('description_short_'.$language['id_lang']))
if (Tools::strlen(strip_tags($value)) > $limit) 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)).')'; $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 */ /* Check multilingual fields sizes */
foreach ($rules['sizeLang'] AS $fieldLang => $maxLength) foreach ($rules['sizeLang'] as $fieldLang => $maxLength)
foreach ($languages AS $language) foreach ($languages as $language)
if ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']) AND Tools::strlen($value) > $maxLength) if ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']) && Tools::strlen($value) > $maxLength)
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')'; $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is too long').' ('.$maxLength.' '.$this->l('chars max').')';
if (isset($_POST['description_short'])) if (isset($_POST['description_short']))
$_POST['description_short'] = $saveShort; $_POST['description_short'] = $saveShort;
/* Check fields validity */ /* Check fields validity */
foreach ($rules['validate'] AS $field => $function) foreach ($rules['validate'] as $field => $function)
if ($value = Tools::getValue($field)) if ($value = Tools::getValue($field))
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid'); $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $field, $className).'</b> '.$this->l('is invalid');
/* Check multilingual fields validity */ /* Check multilingual fields validity */
foreach ($rules['validateLang'] AS $fieldLang => $function) foreach ($rules['validateLang'] as $fieldLang => $function)
foreach ($languages AS $language) foreach ($languages as $language)
if ($value = Tools::getValue($fieldLang.'_'.$language['id_lang'])) if ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))
if (!Validate::$function($value)) if (!Validate::$function($value))
$this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is invalid'); $this->_errors[] = $this->l('the field').' <b>'.call_user_func(array($className, 'displayFieldName'), $fieldLang, $className).' ('.$language['name'].')</b> '.$this->l('is invalid');
/* Categories */ /* Categories */
$productCats = ''; $productCats = '';
if (!Tools::isSubmit('categoryBox') OR !sizeof(Tools::getValue('categoryBox'))) if (!Tools::isSubmit('categoryBox') || !sizeof(Tools::getValue('categoryBox')))
$this->_errors[] = $this->l('product must be in at least one Category'); $this->_errors[] = $this->l('product must be in at least one Category');
if (!is_array(Tools::getValue('categoryBox')) OR !in_array(Tools::getValue('id_category_default'), Tools::getValue('categoryBox'))) if (!is_array(Tools::getValue('categoryBox')) || !in_array(Tools::getValue('id_category_default'), Tools::getValue('categoryBox')))
$this->_errors[] = $this->l('product must be in the default category'); $this->_errors[] = $this->l('product must be in the default category');
/* Tags */ /* Tags */
foreach ($languages AS $language) foreach ($languages as $language)
if ($value = Tools::getValue('tags_'.$language['id_lang'])) if ($value = Tools::getValue('tags_'.$language['id_lang']))
if (!Validate::isTagsList($value)) if (!Validate::isTagsList($value))
$this->_errors[] = $this->l('Tags list').' ('.$language['name'].') '.$this->l('is invalid'); $this->_errors[] = $this->l('Tags list').' ('.$language['name'].') '.$this->l('is invalid');
@@ -1092,7 +1092,7 @@ class AdminProducts extends AdminTab
$tagError = true; $tagError = true;
/* Update an existing product */ /* Update an existing product */
if (isset($id) AND !empty($id)) if (isset($id) && !empty($id))
{ {
$object = new $this->className($id); $object = new $this->className($id);
if (Validate::isLoadedObject($object)) if (Validate::isLoadedObject($object))
@@ -1101,9 +1101,9 @@ class AdminProducts extends AdminTab
$this->copyFromPost($object, $this->table); $this->copyFromPost($object, $this->table);
if ($object->update()) if ($object->update())
{ {
if ($id_reason = (int)Tools::getValue('id_mvt_reason') AND Tools::getValue('mvt_quantity') > 0 AND $id_reason > 0) if ($id_reason = (int)Tools::getValue('id_mvt_reason') && Tools::getValue('mvt_quantity') > 0 && $id_reason > 0)
{ {
if (!$object->addStockMvt(Tools::getValue('mvt_quantity'), $id_reason, NULL, NULL, $this->context->employee->id)) if (!$object->addStockMvt(Tools::getValue('mvt_quantity'), $id_reason, null, null, $this->context->employee->id))
$this->_errors[] = Tools::displayError('An error occurred while updating qty.'); $this->_errors[] = Tools::displayError('An error occurred while updating qty.');
} }
$this->updateAccessories($object); $this->updateAccessories($object);
@@ -1121,8 +1121,8 @@ class AdminProducts extends AdminTab
self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image'); self::$currentIndex .= '&image_updated='.(int)Tools::getValue('id_image');
Hook::updateProduct($object); Hook::updateProduct($object);
Search::indexation(false, $object->id); Search::indexation(false, $object->id);
if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image) if (Tools::getValue('resizer') == 'man' && isset($id_image) && is_int($id_image) && $id_image)
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&edit='.strval(Tools::getValue('productCreated')).'&id_image='.$id_image.'&imageresize&toconf=4&submitAddAndStay='.((Tools::isSubmit('submitAdd'.$this->table.'AndStay') || Tools::getValue('productCreated') == 'on') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
// Save and preview // Save and preview
if (Tools::isSubmit('submitAddProductAndPreview')) if (Tools::isSubmit('submitAddProductAndPreview'))
@@ -1140,7 +1140,7 @@ class AdminProducts extends AdminTab
$preview_url .= 'adtoken='.$token.'&ad='.$admin_dir; $preview_url .= 'adtoken='.$token.'&ad='.$admin_dir;
} }
Tools::redirectAdmin($preview_url); Tools::redirectAdmin($preview_url);
} else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') OR ($id_image AND $id_image !== true)) // Save and stay on same form } else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') || ($id_image && $id_image !== true)) // Save and stay on same form
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=4&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token)); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&addproduct&conf=4&tabs='.(int)(Tools::getValue('tabs')).'&token='.($token ? $token : $this->token));
@@ -1195,7 +1195,7 @@ class AdminProducts extends AdminTab
Tools::redirectAdmin($preview_url); Tools::redirectAdmin($preview_url);
} }
if (Tools::getValue('resizer') == 'man' && isset($id_image) AND is_int($id_image) AND $id_image) if (Tools::getValue('resizer') == 'man' && isset($id_image) && is_int($id_image) && $id_image)
Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&id_image='.$id_image.'&imageresize&toconf=3&submitAddAndStay='.(Tools::isSubmit('submitAdd'.$this->table.'AndStay') ? 'on' : 'off').'&token='.(($token ? $token : $this->token))); Tools::redirectAdmin(self::$currentIndex.'&id_product='.$object->id.'&id_category='.(!empty($_REQUEST['id_category'])?$_REQUEST['id_category']:'1').'&id_image='.$id_image.'&imageresize&toconf=3&submitAddAndStay='.(Tools::isSubmit('submitAdd'.$this->table.'AndStay') ? 'on' : 'off').'&token='.(($token ? $token : $this->token)));
// Save and stay on same form // Save and stay on same form
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) if (Tools::isSubmit('submitAdd'.$this->table.'AndStay'))
@@ -1249,7 +1249,7 @@ class AdminProducts extends AdminTab
$this->_errors[] = $this->l('the field').' <b>'.$this->l('number of days').'</b> '.$this->l('is required'); $this->_errors[] = $this->l('the field').' <b>'.$this->l('number of days').'</b> '.$this->l('is required');
return false; return false;
} }
if (Tools::getValue('virtual_product_expiration_date') AND !Validate::isDate(Tools::getValue('virtual_product_expiration_date'))) if (Tools::getValue('virtual_product_expiration_date') && !Validate::isDate(Tools::getValue('virtual_product_expiration_date')))
{ {
$this->_errors[] = $this->l('the field').' <b>'.$this->l('expiration date').'</b> '.$this->l('is not valid'); $this->_errors[] = $this->l('the field').' <b>'.$this->l('expiration date').'</b> '.$this->l('is not valid');
return false; return false;
@@ -1321,17 +1321,17 @@ class AdminProducts extends AdminTab
WHERE `id_product` = '.(int)($product->id))) WHERE `id_product` = '.(int)($product->id)))
return false; return false;
/* Assign tags to this product */ /* Assign tags to this product */
foreach ($languages AS $language) foreach ($languages as $language)
if ($value = Tools::getValue('tags_'.$language['id_lang'])) if ($value = Tools::getValue('tags_'.$language['id_lang']))
$tagError &= Tag::addTags($language['id_lang'], (int)($product->id), $value); $tagError &= Tag::addTags($language['id_lang'], (int)($product->id), $value);
return $tagError; return $tagError;
} }
public function display($token = NULL) public function display($token = null)
{ {
if ($id_category = (int)Tools::getValue('id_category')) if ($id_category = (int)Tools::getValue('id_category'))
AdminTab::$currentIndex .= '&id_category='.$id_category; AdminTab::$currentIndex .= '&id_category='.$id_category;
$this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : NULL, 0, NULL, $this->context->shop->getID(true)); $this->getList($this->context->language->id, !$this->context->cookie->__get($this->table.'Orderby') ? 'position' : null, !$this->context->cookie->__get($this->table.'Orderway') ? 'ASC' : null, 0, null, $this->context->shop->getID(true));
$id_category = Tools::getValue('id_category', 1); $id_category = Tools::getValue('id_category', 1);
if (!$id_category) if (!$id_category)
@@ -1339,7 +1339,7 @@ class AdminProducts extends AdminTab
echo '<h3>'.(!$this->_listTotal ? ($this->l('No products found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('products') : $this->l('product')))).' '. echo '<h3>'.(!$this->_listTotal ? ($this->l('No products found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('products') : $this->l('product')))).' '.
$this->l('in category').' "'.stripslashes($this->_category->getName()).'"</h3>'; $this->l('in category').' "'.stripslashes($this->_category->getName()).'"</h3>';
if ($this->tabAccess['add'] === '1') if ($this->tabAccess['add'] === '1')
echo '<a href="'.self::$currentIndex.'&id_category='.$id_category.'&add'.$this->table.'&token='.($token!=NULL ? $token : $this->token).'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new product').'</a>'; echo '<a href="'.self::$currentIndex.'&id_category='.$id_category.'&add'.$this->table.'&token='.($token != null ? $token : $this->token).'"><img src="../img/admin/add.gif" border="0" /> '.$this->l('Add a new product').'</a>';
echo '<div style="margin:10px;">'; echo '<div style="margin:10px;">';
$this->displayList($token); $this->displayList($token);
echo '</div>'; echo '</div>';
@@ -1351,7 +1351,7 @@ class AdminProducts extends AdminTab
* @param mixed $token * @param mixed $token
* @return void * @return void
*/ */
public function displayList($token = NULL) public function displayList($token = null)
{ {
/* Display list header (filtering, pagination and column names) */ /* Display list header (filtering, pagination and column names) */
$this->displayListHeader($token); $this->displayListHeader($token);
@@ -1373,7 +1373,7 @@ class AdminProducts extends AdminTab
* @param array $current Current category * @param array $current Current category
* @param integer $id_category Current category id * @param integer $id_category Current category id
*/ */
public static function recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $current, $id_category = 1, $id_category_default = NULL, $has_suite = array()) public static function recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $current, $id_category = 1, $id_category_default = null, $has_suite = array())
{ {
global $done; global $done;
static $irow; static $irow;
@@ -1390,7 +1390,7 @@ class AdminProducts extends AdminTab
echo ' echo '
<tr class="'.($irow++ % 2 ? 'alt_row' : '').'"> <tr class="'.($irow++ % 2 ? 'alt_row' : '').'">
<td> <td>
<input type="checkbox" name="categoryBox[]" class="categoryBox'.($id_category_default == $id_category ? ' id_category_default' : '').'" id="categoryBox_'.$id_category.'" value="'.$id_category.'"'.((in_array($id_category, $indexedCategories) OR ((int)(Tools::getValue('id_category')) == $id_category AND !(int)($id_obj))) ? ' checked="checked"' : '').' /> <input type="checkbox" name="categoryBox[]" class="categoryBox'.($id_category_default == $id_category ? ' id_category_default' : '').'" id="categoryBox_'.$id_category.'" value="'.$id_category.'"'.((in_array($id_category, $indexedCategories) || ((int)(Tools::getValue('id_category')) == $id_category && !(int)($id_obj))) ? ' checked="checked"' : '').' />
</td> </td>
<td> <td>
'.$id_category.' '.$id_category.'
@@ -1405,7 +1405,7 @@ class AdminProducts extends AdminTab
if ($level > 1) if ($level > 1)
$has_suite[] = ($todo == $doneC ? 0 : 1); $has_suite[] = ($todo == $doneC ? 0 : 1);
if (isset($categories[$id_category])) if (isset($categories[$id_category]))
foreach ($categories[$id_category] AS $key => $row) foreach ($categories[$id_category] as $key => $row)
if ($key != 'infos') if ($key != 'infos')
self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite); self::recurseCategoryForInclude($id_obj, $indexedCategories, $categories, $categories[$id_category][$key], $key, $id_category_default, $has_suite);
} }
@@ -1420,7 +1420,7 @@ class AdminProducts extends AdminTab
<img src="../img/admin/error2.png" /> <img src="../img/admin/error2.png" />
'.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).' '.$nbErrors.' '.($nbErrors > 1 ? $this->l('errors') : $this->l('error')).'
<ol>'; <ol>';
foreach ($this->_errors AS $error) foreach ($this->_errors as $error)
echo '<li>'.$error.'</li>'; echo '<li>'.$error.'</li>';
echo ' echo '
</ol> </ol>
@@ -1633,7 +1633,7 @@ class AdminProducts extends AdminTab
</tr> </tr>
</thead> </thead>
<tbody>'; <tbody>';
if (!is_array($specificPrices) OR !sizeof($specificPrices)) if (!is_array($specificPrices) || !sizeof($specificPrices))
echo ' echo '
<tr> <tr>
<td colspan="9">'.$this->l('No specific prices').'</td> <td colspan="9">'.$this->l('No specific prices').'</td>
@@ -1649,7 +1649,7 @@ class AdminProducts extends AdminTab
else else
$reduction = Tools::displayPrice(Tools::ps_round($specificPrice['reduction'], 2), $current_specific_currency); $reduction = Tools::displayPrice(Tools::ps_round($specificPrice['reduction'], 2), $current_specific_currency);
if ($specificPrice['from'] == '0000-00-00 00:00:00' AND $specificPrice['to'] == '0000-00-00 00:00:00') if ($specificPrice['from'] == '0000-00-00 00:00:00' && $specificPrice['to'] == '0000-00-00 00:00:00')
$period = $this->l('Unlimited'); $period = $this->l('Unlimited');
else else
$period = $this->l('From').' '.($specificPrice['from'] != '0000-00-00 00:00:00' ? $specificPrice['from'] : '0000-00-00 00:00:00').'<br />'.$this->l('To').' '.($specificPrice['to'] != '0000-00-00 00:00:00' ? $specificPrice['to'] : '0000-00-00 00:00:00'); $period = $this->l('From').' '.($specificPrice['from'] != '0000-00-00 00:00:00' ? $specificPrice['from'] : '0000-00-00 00:00:00').'<br />'.$this->l('To').' '.($specificPrice['to'] != '0000-00-00 00:00:00' ? $specificPrice['to'] : '0000-00-00 00:00:00');
@@ -1830,10 +1830,10 @@ class AdminProducts extends AdminTab
{ {
$customizableFieldIds = array(); $customizableFieldIds = array();
if (isset($labels[Product::CUSTOMIZE_FILE])) if (isset($labels[Product::CUSTOMIZE_FILE]))
foreach ($labels[Product::CUSTOMIZE_FILE] AS $id_customization_field => $label) foreach ($labels[Product::CUSTOMIZE_FILE] as $id_customization_field => $label)
$customizableFieldIds[] = 'label_'.Product::CUSTOMIZE_FILE.'_'.(int)($id_customization_field); $customizableFieldIds[] = 'label_'.Product::CUSTOMIZE_FILE.'_'.(int)($id_customization_field);
if (isset($labels[Product::CUSTOMIZE_TEXTFIELD])) if (isset($labels[Product::CUSTOMIZE_TEXTFIELD]))
foreach ($labels[Product::CUSTOMIZE_TEXTFIELD] AS $id_customization_field => $label) foreach ($labels[Product::CUSTOMIZE_TEXTFIELD] as $id_customization_field => $label)
$customizableFieldIds[] = 'label_'.Product::CUSTOMIZE_TEXTFIELD.'_'.(int)($id_customization_field); $customizableFieldIds[] = 'label_'.Product::CUSTOMIZE_TEXTFIELD.'_'.(int)($id_customization_field);
$j = 0; $j = 0;
for ($i = $alreadyGenerated[Product::CUSTOMIZE_FILE]; $i < (int)($this->getFieldValue($obj, 'uploadable_files')); $i++) for ($i = $alreadyGenerated[Product::CUSTOMIZE_FILE]; $i < (int)($this->getFieldValue($obj, 'uploadable_files')); $i++)
@@ -1872,7 +1872,7 @@ class AdminProducts extends AdminTab
$fieldIds = $this->_getCustomizationFieldIds($labels, $labelGenerated, $obj); $fieldIds = $this->_getCustomizationFieldIds($labels, $labelGenerated, $obj);
if (isset($labels[$type])) if (isset($labels[$type]))
foreach ($labels[$type] AS $id_customization_field => $label) foreach ($labels[$type] as $id_customization_field => $label)
$this->_displayLabelField($label, $languages, $defaultLanguage, $type, $fieldIds, (int)($id_customization_field)); $this->_displayLabelField($label, $languages, $defaultLanguage, $type, $fieldIds, (int)($id_customization_field));
} }
@@ -1942,7 +1942,7 @@ class AdminProducts extends AdminTab
echo ' echo '
<tr> <tr>
<td colspan="2" style="text-align:center;">'; <td colspan="2" style="text-align:center;">';
if ($hasFileLabels OR $hasTextLabels) if ($hasFileLabels || $hasTextLabels)
echo '<input type="submit" name="submitProductCustomization" id="submitProductCustomization" value="'.$this->l('Save labels').'" class="button" onclick="this.form.action += \'&addproduct&tabs=5\';" style="margin-top: 9px" />'; echo '<input type="submit" name="submitProductCustomization" id="submitProductCustomization" value="'.$this->l('Save labels').'" class="button" onclick="this.form.action += \'&addproduct&tabs=5\';" style="margin-top: 9px" />';
echo ' echo '
</td> </td>
@@ -1996,7 +1996,7 @@ class AdminProducts extends AdminTab
<td> <td>
<p>'.$this->l('Attachments for this product:').'</p> <p>'.$this->l('Attachments for this product:').'</p>
<select multiple id="selectAttachment1" name="attachments[]" style="width:300px;height:160px;">'; <select multiple id="selectAttachment1" name="attachments[]" style="width:300px;height:160px;">';
foreach ($attach1 AS $attach) foreach ($attach1 as $attach)
echo '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>'; echo '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>';
echo ' </select><br /><br /> echo ' </select><br /><br />
<a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"> <a href="#" id="addAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
@@ -2006,7 +2006,7 @@ class AdminProducts extends AdminTab
<td style="padding-left:20px;"> <td style="padding-left:20px;">
<p>'.$this->l('Available attachments:').'</p> <p>'.$this->l('Available attachments:').'</p>
<select multiple id="selectAttachment2" style="width:300px;height:160px;">'; <select multiple id="selectAttachment2" style="width:300px;height:160px;">';
foreach ($attach2 AS $attach) foreach ($attach2 as $attach)
echo '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>'; echo '<option value="'.$attach['id_attachment'].'">'.$attach['name'].'</option>';
echo ' </select><br /><br /> echo ' </select><br /><br />
<a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px"> <a href="#" id="removeAttachment" style="text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px">
@@ -2351,9 +2351,9 @@ class AdminProducts extends AdminTab
?> ?>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<p><input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" onclick="toggleVirtualProduct(this);" <?php if(($productDownload->id OR Tools::getValue('is_virtual_good')=='true') AND $productDownload->active) echo 'checked="checked"' ?> /> <p><input type="checkbox" id="is_virtual_good" name="is_virtual_good" value="true" onclick="toggleVirtualProduct(this);" <?php if (($productDownload->id || Tools::getValue('is_virtual_good')=='true') && $productDownload->active) echo 'checked="checked"' ?> />
<label for="is_virtual_good" class="t bold" style="color: black;"><?php echo $this->l('Is this a downloadable product?') ?></label></p> <label for="is_virtual_good" class="t bold" style="color: black;"><?php echo $this->l('Is this a downloadable product?') ?></label></p>
<div id="virtual_good" <?php if(!$productDownload->id OR !$productDownload->active) echo 'style="display:none;"' ?> > <div id="virtual_good" <?php if (!$productDownload->id || !$productDownload->active) echo 'style="display:none;"' ?> >
<?php if (!ProductDownload::checkWritableDir()): ?> <?php if (!ProductDownload::checkWritableDir()): ?>
<p class="alert"> <p class="alert">
<?php echo $this->l('Your download repository is not writable.'); ?><br/> <?php echo $this->l('Your download repository is not writable.'); ?><br/>
@@ -2395,7 +2395,7 @@ class AdminProducts extends AdminTab
</p> </p>
</div> </div>
<div id="virtual_good_more" style="<?php if(!$productDownload->id OR !$productDownload->active) echo 'display:none;' ?>padding:5px;width:40%;float:left;margin-left:10px"> <div id="virtual_good_more" style="<?php if (!$productDownload->id || !$productDownload->active) echo 'display:none;' ?>padding:5px;width:40%;float:left;margin-left:10px">
<p class="block"> <p class="block">
<label for="virtual_product_nb_downloable" class="t"><?php echo $this->l('Number of downloads') ?></label> <label for="virtual_product_nb_downloable" class="t"><?php echo $this->l('Number of downloads') ?></label>
@@ -2404,7 +2404,7 @@ class AdminProducts extends AdminTab
</p> </p>
<p class="block"> <p class="block">
<label for="virtual_product_expiration_date" class="t"><?php echo $this->l('Expiration date') ?></label> <label for="virtual_product_expiration_date" class="t"><?php echo $this->l('Expiration date') ?></label>
<input type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="<?php echo ($productDownload->id > 0) ? ((!empty($productDownload->date_expiration) AND $productDownload->date_expiration != '0000-00-00 00:00:00') ? date('Y-m-d', strtotime($productDownload->date_expiration)) <input type="text" id="virtual_product_expiration_date" name="virtual_product_expiration_date" value="<?php echo ($productDownload->id > 0) ? ((!empty($productDownload->date_expiration) && $productDownload->date_expiration != '0000-00-00 00:00:00') ? date('Y-m-d', strtotime($productDownload->date_expiration))
: '' ) : htmlentities(Tools::getValue('virtual_product_expiration_date'), ENT_COMPAT, 'UTF-8') ?>" size="11" maxlength="10" autocomplete="off" /> <?php echo $this->l('Format: YYYY-MM-DD'); ?> : '' ) : htmlentities(Tools::getValue('virtual_product_expiration_date'), ENT_COMPAT, 'UTF-8') ?>" size="11" maxlength="10" autocomplete="off" /> <?php echo $this->l('Format: YYYY-MM-DD'); ?>
<span class="hint" name="help_box" style="display:none"><?php echo $this->l('No expiration date if you leave this blank'); ?></span> <span class="hint" name="help_box" style="display:none"><?php echo $this->l('No expiration date if you leave this blank'); ?></span>
</p> </p>
@@ -2453,7 +2453,7 @@ class AdminProducts extends AdminTab
echo 'taxesArray = new Array ();'."\n"; echo 'taxesArray = new Array ();'."\n";
echo 'taxesArray[0] = 0', ";\n"; echo 'taxesArray[0] = 0', ";\n";
foreach ($tax_rules_groups AS $tax_rules_group) foreach ($tax_rules_groups as $tax_rules_group)
{ {
$tax_rate = (array_key_exists($tax_rules_group['id_tax_rules_group'], $taxesRatesByGroup) ? $taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']] : 0); $tax_rate = (array_key_exists($tax_rules_group['id_tax_rules_group'], $taxesRatesByGroup) ? $taxesRatesByGroup[$tax_rules_group['id_tax_rules_group']] : 0);
echo 'taxesArray['.$tax_rules_group['id_tax_rules_group'].']='.$tax_rate."\n"; echo 'taxesArray['.$tax_rules_group['id_tax_rules_group'].']='.$tax_rate."\n";
@@ -2469,7 +2469,7 @@ class AdminProducts extends AdminTab
<select onChange="javascript:calcPriceTI(); unitPriceWithTax(\'unit\');" name="id_tax_rules_group" id="id_tax_rules_group" '.(Tax::excludeTaxeOption() ? 'disabled="disabled"' : '' ).'> <select onChange="javascript:calcPriceTI(); unitPriceWithTax(\'unit\');" name="id_tax_rules_group" id="id_tax_rules_group" '.(Tax::excludeTaxeOption() ? 'disabled="disabled"' : '' ).'>
<option value="0">'.$this->l('No Tax').'</option>'; <option value="0">'.$this->l('No Tax').'</option>';
foreach ($tax_rules_groups AS $tax_rules_group) foreach ($tax_rules_groups as $tax_rules_group)
echo '<option value="'.$tax_rules_group['id_tax_rules_group'].'" '.(($this->getFieldValue($obj, 'id_tax_rules_group') == $tax_rules_group['id_tax_rules_group']) ? ' selected="selected"' : '').'>'.Tools::htmlentitiesUTF8($tax_rules_group['name']).'</option>'; echo '<option value="'.$tax_rules_group['id_tax_rules_group'].'" '.(($this->getFieldValue($obj, 'id_tax_rules_group') == $tax_rules_group['id_tax_rules_group']) ? ' selected="selected"' : '').'>'.Tools::htmlentitiesUTF8($tax_rules_group['name']).'</option>';
echo '</select> echo '</select>
@@ -2560,7 +2560,7 @@ class AdminProducts extends AdminTab
<option value="-1">--</option>'; <option value="-1">--</option>';
$reasons = StockMvtReason::getStockMvtReasons($this->context->language->id); $reasons = StockMvtReason::getStockMvtReasons($this->context->language->id);
foreach ($reasons AS $reason) foreach ($reasons as $reason)
echo '<option rel="'.$reason['sign'].'" value="'.$reason['id_stock_mvt_reason'].'" '.(Configuration::get('PS_STOCK_MVT_REASON_DEFAULT') == $reason['id_stock_mvt_reason'] ? 'selected="selected"' : '').'>'.$reason['name'].'</option>'; echo '<option rel="'.$reason['sign'].'" value="'.$reason['id_stock_mvt_reason'].'" '.(Configuration::get('PS_STOCK_MVT_REASON_DEFAULT') == $reason['id_stock_mvt_reason'] ? 'selected="selected"' : '').'>'.$reason['name'].'</option>';
echo '</select> echo '</select>
<input id="mvt_quantity" type="text" name="mvt_quantity" size="3" maxlength="6" value="0"/>&nbsp;&nbsp; <input id="mvt_quantity" type="text" name="mvt_quantity" size="3" maxlength="6" value="0"/>&nbsp;&nbsp;
@@ -2704,7 +2704,7 @@ class AdminProducts extends AdminTab
} }
echo '<select id="id_category_default" name="id_category_default">'; echo '<select id="id_category_default" name="id_category_default">';
foreach($selectedCat AS $cat) foreach ($selectedCat as $cat)
echo '<option value="'.$cat['id_category'].'" '.($obj->id_category_default == $cat['id_category'] ? 'selected' : '').'>'.$cat['name'].'</option>'; echo '<option value="'.$cat['id_category'].'" '.($obj->id_category_default == $cat['id_category'] ? 'selected' : '').'>'.$cat['name'].'</option>';
echo '</select> echo '</select>
</td> </td>
@@ -2732,7 +2732,7 @@ class AdminProducts extends AdminTab
<tr> <tr>
<td class="col-left">'.$this->l('Meta title:').'</td> <td class="col-left">'.$this->l('Meta title:').'</td>
<td class="translatable">'; <td class="translatable">';
foreach ($this->_languages AS $language) foreach ($this->_languages as $language)
echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;"> echo ' <div class="lang_'.$language['id_lang'].'" style="display: '.($language['id_lang'] == $this->_defaultFormLanguage ? 'block' : 'none').'; float: left;">
<input size="55" type="text" id="meta_title_'.$language['id_lang'].'" name="meta_title_'.$language['id_lang'].'" <input size="55" type="text" id="meta_title_'.$language['id_lang'].'" name="meta_title_'.$language['id_lang'].'"
value="'.htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" /> value="'.htmlentities($this->getFieldValue($obj, 'meta_title', $language['id_lang']), ENT_COMPAT, 'UTF-8').'" />
@@ -2812,7 +2812,7 @@ class AdminProducts extends AdminTab
<td class="col-left"></td> <td class="col-left"></td>
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
<div style="display:block;width:620px;" class="hint clear"> <div style="display:block;width:620px;" class="hint clear">
'.$this->l('You want an image associated with the product in your description ?').' '.$this->l('Do you want an image associated with the product in your description?').'
<span class="addImageDescription" style="cursor:pointer">'.$this->l('Click here').'</span>. <span class="addImageDescription" style="cursor:pointer">'.$this->l('Click here').'</span>.
<table id="createImageDescription" style="display:none;"> <table id="createImageDescription" style="display:none;">
<tr> <tr>
@@ -2840,7 +2840,7 @@ class AdminProducts extends AdminTab
</tr>'; </tr>';
echo ' echo '
<tr> <tr>
<td class="col-left">'.$this->l('Where to place ?').'</td> <td class="col-left">'.$this->l('Where to place it?').'</td>
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
<input type="radio" name="leftRight" id="leftRight_1" value="left" checked> <input type="radio" name="leftRight" id="leftRight_1" value="left" checked>
<label for="leftRight_1" class="t">'.$this->l('left').'</label> <label for="leftRight_1" class="t">'.$this->l('left').'</label>
@@ -2869,7 +2869,7 @@ class AdminProducts extends AdminTab
</tr>'; </tr>';
echo ' echo '
<tr> <tr>
<td class="col-left">'.$this->l('Tag of the image to insert:').'</td> <td class="col-left">'.$this->l('Image tag to insert:').'</td>
<td style="padding-bottom:5px;"> <td style="padding-bottom:5px;">
<input type="text" id="resultImage" name="resultImage" /> <input type="text" id="resultImage" name="resultImage" />
<p>'.$this->l('The tag is to copy / paste in the description.').'</p> <p>'.$this->l('The tag is to copy / paste in the description.').'</p>
@@ -2930,8 +2930,8 @@ class AdminProducts extends AdminTab
if ($postAccessories = Tools::getValue('inputAccessories')) if ($postAccessories = Tools::getValue('inputAccessories'))
{ {
$postAccessoriesTab = explode('-', Tools::getValue('inputAccessories')); $postAccessoriesTab = explode('-', Tools::getValue('inputAccessories'));
foreach ($postAccessoriesTab AS $accessoryId) foreach ($postAccessoriesTab as $accessoryId)
if (!$this->haveThisAccessory($accessoryId, $accessories) AND $accessory = Product::getAccessoryById($accessoryId)) if (!$this->haveThisAccessory($accessoryId, $accessories) && $accessory = Product::getAccessoryById($accessoryId))
$accessories[] = $accessory; $accessories[] = $accessory;
} }
@@ -3017,7 +3017,7 @@ class AdminProducts extends AdminTab
} }
function displayFormImages($obj, $token = NULL) function displayFormImages($obj, $token = null)
{ {
if (!Tools::getValue('id_product')) if (!Tools::getValue('id_product'))
return ''; return '';
@@ -3169,7 +3169,7 @@ class AdminProducts extends AdminTab
<td colspan="2"> <td colspan="2">
<script type="text/javascript" src="'._PS_JS_DIR_.'/jquery/jquery.tablednd_0_5.js"></script> <script type="text/javascript" src="'._PS_JS_DIR_.'/jquery/jquery.tablednd_0_5.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var token = \''.($token!=NULL ? $token : $this->token).'\'; var token = \''.($token != null ? $token : $this->token).'\';
var come_from = \''.$this->table.'\'; var come_from = \''.$this->table.'\';
var alternate = \''.($this->_orderWay == 'DESC' ? '1' : '0' ).'\'; var alternate = \''.($this->_orderWay == 'DESC' ? '1' : '0' ).'\';
</script> </script>
@@ -3208,7 +3208,7 @@ class AdminProducts extends AdminTab
<th>'.$this->l('Action').'</th> <th>'.$this->l('Action').'</th>
</tr></thead>'; </tr></thead>';
foreach ($images AS $k => $image) foreach ($images as $k => $image)
echo $this->getLineTableImage($image, $imagesTotal, $token, $shops); echo $this->getLineTableImage($image, $imagesTotal, $token, $shops);
@@ -3228,14 +3228,14 @@ class AdminProducts extends AdminTab
$attributes = Attribute::getAttributes($this->context->language->id, true); $attributes = Attribute::getAttributes($this->context->language->id, true);
$attributeJs = array(); $attributeJs = array();
foreach ($attributes AS $k => $attribute) foreach ($attributes as $k => $attribute)
$attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name']; $attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name'];
foreach ($attributeJs AS $idgrp => $group) foreach ($attributeJs as $idgrp => $group)
{ {
echo ' echo '
attrs['.$idgrp.'] = new Array(0, \'---\' '; attrs['.$idgrp.'] = new Array(0, \'---\' ';
foreach ($group AS $idattr => $attrname) foreach ($group as $idattr => $attrname)
echo ', '.$idattr.', \''.addslashes(($attrname)).'\''; echo ', '.$idattr.', \''.addslashes(($attrname)).'\'';
echo ');'; echo ');';
} }
@@ -3264,7 +3264,7 @@ class AdminProducts extends AdminTab
$html .= ' $html .= '
</td>'; </td>';
if (Shop::isMultiShopActivated()) if (Shop::isMultiShopActivated())
foreach ($shops AS $shop) foreach ($shops as $shop)
$html .= ' $html .= '
<td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>'; <td class="center"><input type="checkbox" class="image_shop" name="'.(int)$image['id_image'].'" value="'.(int)$shop['id_shop'].'" '.($imgObj->isAssociatedToShop($shop['id_shop']) ? 'checked="1"' : '').' /></td>';
$html .= ' $html .= '
@@ -3284,11 +3284,11 @@ class AdminProducts extends AdminTab
$content = 'var combination_images = new Array();'; $content = 'var combination_images = new Array();';
if (!$allCombinationImages = $obj->getCombinationImages($this->context->language->id)) if (!$allCombinationImages = $obj->getCombinationImages($this->context->language->id))
return $content; return $content;
foreach ($allCombinationImages AS $id_product_attribute => $combinationImages) foreach ($allCombinationImages as $id_product_attribute => $combinationImages)
{ {
$i = 0; $i = 0;
$content .= 'combination_images['.(int)($id_product_attribute).'] = new Array();'; $content .= 'combination_images['.(int)($id_product_attribute).'] = new Array();';
foreach ($combinationImages AS $combinationImage) foreach ($combinationImages as $combinationImage)
$content .= 'combination_images['.(int)($id_product_attribute).']['.$i++.'] = '.(int)($combinationImage['id_image']).';'; $content .= 'combination_images['.(int)($id_product_attribute).']['.$i++.'] = '.(int)($combinationImage['id_image']).';';
} }
return $content; return $content;
@@ -3304,7 +3304,7 @@ class AdminProducts extends AdminTab
$attributeJs = array(); $attributeJs = array();
$attributes = Attribute::getAttributes($this->context->language->id, true); $attributes = Attribute::getAttributes($this->context->language->id, true);
foreach ($attributes AS $k => $attribute) foreach ($attributes as $k => $attribute)
$attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name']; $attributeJs[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name'];
$currency = $this->context->currency; $currency = $this->context->currency;
$attributes_groups = AttributeGroup::getAttributesGroups($this->context->language->id); $attributes_groups = AttributeGroup::getAttributesGroups($this->context->language->id);
@@ -3335,7 +3335,7 @@ class AdminProducts extends AdminTab
<td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">'.$this->l('Group:').'</td> <td style="width:150px;vertical-align:top;text-align:right;padding-right:10px;font-weight:bold;" valign="top">'.$this->l('Group:').'</td>
<td style="padding-bottom:5px;"><select name="attribute_group" id="attribute_group" style="width: 200px;" onchange="populate_attrs();">'; <td style="padding-bottom:5px;"><select name="attribute_group" id="attribute_group" style="width: 200px;" onchange="populate_attrs();">';
if (isset($attributes_groups)) if (isset($attributes_groups))
foreach ($attributes_groups AS $k => $attribute_group) foreach ($attributes_groups as $k => $attribute_group)
if (isset($attributeJs[$attribute_group['id_attribute_group']])) if (isset($attributeJs[$attribute_group['id_attribute_group']]))
echo ' echo '
<option value="'.$attribute_group['id_attribute_group'].'"> <option value="'.$attribute_group['id_attribute_group'].'">
@@ -3441,7 +3441,7 @@ class AdminProducts extends AdminTab
<select id="id_mvt_reason" name="id_mvt_reason"> <select id="id_mvt_reason" name="id_mvt_reason">
<option value="-1">--</option>'; <option value="-1">--</option>';
$reasons = StockMvtReason::getStockMvtReasons($this->context->language->id); $reasons = StockMvtReason::getStockMvtReasons($this->context->language->id);
foreach ($reasons AS $reason) foreach ($reasons as $reason)
echo '<option rel="'.$reason['sign'].'" value="'.$reason['id_stock_mvt_reason'].'" '.(Configuration::get('PS_STOCK_MVT_REASON_DEFAULT') == $reason['id_stock_mvt_reason'] ? 'selected="selected"' : '').'>'.$reason['name'].'</option>'; echo '<option rel="'.$reason['sign'].'" value="'.$reason['id_stock_mvt_reason'].'" '.(Configuration::get('PS_STOCK_MVT_REASON_DEFAULT') == $reason['id_stock_mvt_reason'] ? 'selected="selected"' : '').'>'.$reason['name'].'</option>';
echo '</select> echo '</select>
<input type="text" name="attribute_mvt_quantity" size="3" maxlength="6" value="0"/>&nbsp;&nbsp; <input type="text" name="attribute_mvt_quantity" size="3" maxlength="6" value="0"/>&nbsp;&nbsp;
@@ -3479,7 +3479,7 @@ class AdminProducts extends AdminTab
$i = 0; $i = 0;
$imageType = ImageType::getByNameNType('small', 'products'); $imageType = ImageType::getByNameNType('small', 'products');
$imageWidth = (isset($imageType['width']) ? (int)($imageType['width']) : 64) + 25; $imageWidth = (isset($imageType['width']) ? (int)($imageType['width']) : 64) + 25;
foreach ($images AS $image) foreach ($images as $image)
{ {
$imageObj = new Image($image['id_image']); $imageObj = new Image($image['id_image']);
echo '<li style="float: left; width: '.$imageWidth.'px;"><input type="checkbox" name="id_image_attr[]" value="'.(int)($image['id_image']).'" id="id_image_attr_'.(int)($image['id_image']).'" /> echo '<li style="float: left; width: '.$imageWidth.'px;"><input type="checkbox" name="id_image_attr[]" value="'.(int)($image['id_image']).'" id="id_image_attr_'.(int)($image['id_image']).'" />
@@ -3528,7 +3528,7 @@ class AdminProducts extends AdminTab
if (is_array($combinaisons)) if (is_array($combinaisons))
{ {
$combinationImages = $obj->getCombinationImages($this->context->language->id); $combinationImages = $obj->getCombinationImages($this->context->language->id);
foreach ($combinaisons AS $k => $combinaison) foreach ($combinaisons as $k => $combinaison)
{ {
$combArray[$combinaison['id_product_attribute']]['wholesale_price'] = $combinaison['wholesale_price']; $combArray[$combinaison['id_product_attribute']]['wholesale_price'] = $combinaison['wholesale_price'];
$combArray[$combinaison['id_product_attribute']]['price'] = $combinaison['price']; $combArray[$combinaison['id_product_attribute']]['price'] = $combinaison['price'];
@@ -3553,7 +3553,7 @@ class AdminProducts extends AdminTab
$irow = 0; $irow = 0;
if (isset($combArray)) if (isset($combArray))
{ {
foreach ($combArray AS $id_product_attribute => $product_attribute) foreach ($combArray as $id_product_attribute => $product_attribute)
{ {
$list = ''; $list = '';
$jsList = ''; $jsList = '';
@@ -3561,7 +3561,7 @@ class AdminProducts extends AdminTab
/* In order to keep the same attributes order */ /* In order to keep the same attributes order */
asort($product_attribute['attributes']); asort($product_attribute['attributes']);
foreach ($product_attribute['attributes'] AS $attribute) foreach ($product_attribute['attributes'] as $attribute)
{ {
$list .= addslashes(htmlspecialchars($attribute[0])).' - '.addslashes(htmlspecialchars($attribute[1])).', '; $list .= addslashes(htmlspecialchars($attribute[0])).' - '.addslashes(htmlspecialchars($attribute[1])).', ';
$jsList .= '\''.addslashes(htmlspecialchars($attribute[0])).' : '.addslashes(htmlspecialchars($attribute[1])).'\', \''.$attribute[2].'\', '; $jsList .= '\''.addslashes(htmlspecialchars($attribute[0])).' : '.addslashes(htmlspecialchars($attribute[1])).'\', \''.$attribute[2].'\', ';
@@ -3633,7 +3633,7 @@ class AdminProducts extends AdminTab
{ {
$feature = Feature::getFeatures($this->context->language->id); $feature = Feature::getFeatures($this->context->language->id);
$ctab = ''; $ctab = '';
foreach ($feature AS $tab) foreach ($feature as $tab)
$ctab .= 'ccustom_'.$tab['id_feature'].'¤'; $ctab .= 'ccustom_'.$tab['id_feature'].'¤';
$ctab = rtrim($ctab, '¤'); $ctab = rtrim($ctab, '¤');
@@ -3669,7 +3669,7 @@ class AdminProducts extends AdminTab
echo ' echo '
<table cellpadding="5" style="width: 900px; margin-top: 10px">'; <table cellpadding="5" style="width: 900px; margin-top: 10px">';
foreach ($feature AS $tab_features) foreach ($feature as $tab_features)
{ {
$current_item = false; $current_item = false;
$custom = true; $custom = true;
@@ -3691,7 +3691,7 @@ class AdminProducts extends AdminTab
onchange="$(\'.custom_'.$tab_features['id_feature'].'_\').val(\'\');"> onchange="$(\'.custom_'.$tab_features['id_feature'].'_\').val(\'\');">
<option value="0">---&nbsp;</option>'; <option value="0">---&nbsp;</option>';
foreach ($featureValues AS $value) foreach ($featureValues as $value)
{ {
if ($current_item == $value['id_feature_value']) if ($current_item == $value['id_feature_value'])
$custom = false; $custom = false;
@@ -3734,7 +3734,7 @@ class AdminProducts extends AdminTab
public function haveThisAccessory($accessoryId, $accessories) public function haveThisAccessory($accessoryId, $accessories)
{ {
foreach ($accessories AS $accessory) foreach ($accessories as $accessory)
if ((int)($accessory['id_product']) == (int)($accessoryId)) if ((int)($accessory['id_product']) == (int)($accessoryId))
return true; return true;
return false; return false;
@@ -3742,7 +3742,7 @@ class AdminProducts extends AdminTab
private function displayPack(Product $obj) private function displayPack(Product $obj)
{ {
$boolPack = (($obj->id AND Pack::isPack($obj->id)) OR Tools::getValue('ppack')) ? true : false; $boolPack = (($obj->id && Pack::isPack($obj->id)) || Tools::getValue('ppack')) ? true : false;
$packItems = $boolPack ? Pack::getItems($obj->id, $this->context->language->id) : array(); $packItems = $boolPack ? Pack::getItems($obj->id, $this->context->language->id) : array();
echo ' echo '
@@ -3923,7 +3923,7 @@ class AdminProducts extends AdminTab
Pack::deleteItems($product->id); Pack::deleteItems($product->id);
// lines format: QTY x ID-QTY x ID // lines format: QTY x ID-QTY x ID
if (Tools::getValue('ppack') AND $items = Tools::getValue('inputPackItems') AND sizeof($lines = array_unique(explode('-', $items)))) if (Tools::getValue('ppack') && $items = Tools::getValue('inputPackItems') && sizeof($lines = array_unique(explode('-', $items))))
{ {
foreach ($lines as $line) foreach ($lines as $line)
{ {
+3 -3
View File
@@ -359,10 +359,10 @@ class ProductControllerCore extends FrontController
$reg = '/{img-([0-9]+)-(left|right)-([a-z]+)}/'; $reg = '/{img-([0-9]+)-(left|right)-([a-z]+)}/';
while (preg_match($reg, $desc, $matches)) while (preg_match($reg, $desc, $matches))
{ {
$linkImg = $this->context->link->getImageLink($this->product->link_rewrite, $this->product->id.'-'.$matches[1], $matches[3]); $link_lmg = $this->context->link->getImageLink($this->product->link_rewrite, $this->product->id.'-'.$matches[1], $matches[3]);
$class = $matches[2] == 'left' ? 'class="imageFloatLeft"' : 'class="imageFloatRight"'; $class = $matches[2] == 'left' ? 'class="imageFloatLeft"' : 'class="imageFloatRight"';
$htmlImg = '<img src="'.$linkImg.'" alt="" '.$class.'/>'; $html_img = '<img src="'.$link_lmg.'" alt="" '.$class.'/>';
$desc = str_replace($matches[0], $htmlImg, $desc); $desc = str_replace($matches[0], $html_img, $desc);
} }
return $desc; return $desc;
} }
+4 -48
View File
@@ -1080,51 +1080,6 @@ $_LANGADM['AdminGroups424b1a913da3df93e2366d28f29e1893'] = 'Modifier ce client';
$_LANGADM['AdminGroups729a51874fe901b092899e9e8b31c97a'] = 'Etes-vous sûr ?'; $_LANGADM['AdminGroups729a51874fe901b092899e9e8b31c97a'] = 'Etes-vous sûr ?';
$_LANGADM['AdminGroupsc3b0525bb0516119f4233bc8f78ec05e'] = 'Supprimer ce client'; $_LANGADM['AdminGroupsc3b0525bb0516119f4233bc8f78ec05e'] = 'Supprimer ce client';
$_LANGADM['AdminGroups3987833f7cb48f6bd0cf402d6994d346'] = 'Aucun utilisateur dans ce groupe.'; $_LANGADM['AdminGroups3987833f7cb48f6bd0cf402d6994d346'] = 'Aucun utilisateur dans ce groupe.';
$_LANGADM['AdminHomeafd87eb38820c73315688a7cab2571d4'] = 'Pour bien commencer...';
$_LANGADM['AdminHomeecd188c0a9e0913f062d22331411158a'] = 'URLs simplifiées';
$_LANGADM['AdminHome4d92a8b44ec205ea708bd3f3a8926b2d'] = 'Cache & compression navigateur';
$_LANGADM['AdminHome5ad483f10dec94a21c78d89edc1fef94'] = 'Optimisation smarty';
$_LANGADM['AdminHome202460d68b46910927f17628291fdd61'] = 'Concaténation, Compression & Cache';
$_LANGADM['AdminHome73a910e532bbbc17742ac1ad88189026'] = 'Boutique activée';
$_LANGADM['AdminHomeaff26d06b54b6d6acb2ed185a5477f49'] = 'Index reconstruit après mise à jour';
$_LANGADM['AdminHome6cf148afcc6acae611cf5f65ddf074f9'] = '.htaccess mis à jour';
$_LANGADM['AdminHome2938c7f7e560ed972f8a4f68e80ff834'] = 'Tableau de bord';
$_LANGADM['AdminHome486389453cfc7006870efa54fb7f6df9'] = 'Nouvelle version de PrestaShop disponible';
$_LANGADM['AdminHome801ab24683a4a8c433c6eb40c48bcd9d'] = 'Téléchargement';
$_LANGADM['AdminHome095939fea07d985d07ababe2c18f5b9c'] = 'Alerte de mise-à-jour indisponible';
$_LANGADM['AdminHome8ea6ef7812005ab540c9406c35fa4bb3'] = 'Pour recevoir les alertes de mise-à-jour, vous devez activer la commande <b>allow_url_fopen</b> dans le fichier de configuration <b>php.ini</b>.';
$_LANGADM['AdminHome5d3ee00c373c5c4ed47a761939e94b76'] = 'Plus d\'infos';
$_LANGADM['AdminHomeba96d5954aa6db09c9004b6dc12b6014'] = 'Si vous ne savez pas comment le faire, merci de contacter l\'administrateur de votre hébergement.';
$_LANGADM['AdminHome385500f9c4d131f38c706dbc9d3a77c4'] = 'Voir plus de vidéos explicatives';
$_LANGADM['AdminHome57747250ec23a658f7a227ac9241aeef'] = 'Ne plus me remontrer';
$_LANGADM['AdminHome52015afb6ec8b940ef903ff73f4c4058'] = 'Nouvelle catégorie';
$_LANGADM['AdminHome830faa39d4dffcb14f4f514c9342e5d1'] = 'Créez une nouvelle catégorie et organisez vos produits sur votre boutique.';
$_LANGADM['AdminHome656c3be690ee43df4b845bd2a2ebe587'] = 'Nouveau produit';
$_LANGADM['AdminHome2c3b06b32caf673175832aeb3833f32a'] = 'Remplissez votre catalogue avec de nouveaux produits.';
$_LANGADM['AdminHomec33e404a441c6ba9648f88af3c68a1ca'] = 'Statistiques';
$_LANGADM['AdminHomec0eef64157eb4bb621577e628f595beb'] = 'Pilotez votre activité grâce à une analyse complète de votre boutique.';
$_LANGADM['AdminHome4b08baa69304b6f4cd7ee5453beeea5e'] = 'Nouvel employé';
$_LANGADM['AdminHome54361fc9e712ed173d019c3d4a6e2ca0'] = 'Ajoutez un compte employé pour déléguer une partie de la gestion de votre boutique.';
$_LANGADM['AdminHomeb24344b6a2c4a94c9b0d0ebd4602aeca'] = 'Voir plus';
$_LANGADM['AdminHomeb98263dfd493178c43eca9b08a2ce4dc'] = 'Statistiques du mois';
$_LANGADM['AdminHome11ff9f68afb6b8b5b8eda218d7c83a65'] = 'Ventes';
$_LANGADM['AdminHome145091c4a142b35c98a860e2df97ef26'] = 'Inscriptions';
$_LANGADM['AdminHomebb5ebac63dc37bfae478c91bdf575e03'] = 'Commandes';
$_LANGADM['AdminHomedcd13f267cf781b25dd8826080425464'] = 'Pages produits vues';
$_LANGADM['AdminHomebcd454728d21fd1b7adcb2bb02af7316'] = 'Service client';
$_LANGADM['AdminHomea340073fa87f8783e926b7865a8d9fe0'] = 'Fils de discussion non lus';
$_LANGADM['AdminHome3a1c9b4de5495314cf4e6ce5baaf1001'] = 'Fils de discussion en cours';
$_LANGADM['AdminHome490244040ff9e9a9084ac9347fb38b97'] = 'Fils de discussion fermés';
$_LANGADM['AdminHomecab723c421c5278820b5020b6f360d54'] = 'Total de fils';
$_LANGADM['AdminHome0b7902adbdb6335dacf47d249fad05f1'] = 'Ventes de la semaine';
$_LANGADM['AdminHomec89b149018866032dd690b0983f1ac78'] = 'Ventes + Tx';
$_LANGADM['AdminHomeb718adec73e04ce3ec720dd11a06a308'] = 'ID';
$_LANGADM['AdminHome2ea989f83006e233627987293f4bde0a'] = 'Client';
$_LANGADM['AdminHomeec53a8c4f07baed5d8825072c89799be'] = 'Statut';
$_LANGADM['AdminHome96b0141273eabab320119c467cdcaf17'] = 'Total';
$_LANGADM['AdminHome004bf6c9a40003140292e97330236c53'] = 'Action';
$_LANGADM['AdminHome3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails';
$_LANGADM['AdminHome4ff2e716a7d06ce5274b4090b39abad3'] = 'Voir';
$_LANGADM['AdminImagesb718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_LANGADM['AdminImagesb718adec73e04ce3ec720dd11a06a308'] = 'ID';
$_LANGADM['AdminImages49ee3087348e8d44e1feda1917443987'] = 'Nom'; $_LANGADM['AdminImages49ee3087348e8d44e1feda1917443987'] = 'Nom';
$_LANGADM['AdminImages32954654ac8fe66a1d09be19001de2d4'] = 'Largeur'; $_LANGADM['AdminImages32954654ac8fe66a1d09be19001de2d4'] = 'Largeur';
@@ -2279,14 +2234,14 @@ $_LANGADM['AdminProducts92ab5edf4194cb5a84d6808cb8d8b696'] = 'Le lien vers la fi
$_LANGADM['AdminProducts234078adec0a64008b6ae77653776cfa'] = 'Résumé :'; $_LANGADM['AdminProducts234078adec0a64008b6ae77653776cfa'] = 'Résumé :';
$_LANGADM['AdminProducts38d301f7ef549a79620e99fd8b51fa34'] = 'apparaît dans les listings produits et au haut des fiches produits'; $_LANGADM['AdminProducts38d301f7ef549a79620e99fd8b51fa34'] = 'apparaît dans les listings produits et au haut des fiches produits';
$_LANGADM['AdminProducts9be976b8052c984a95997e4a4f8eef96'] = 'apparaît sur les pages produits'; $_LANGADM['AdminProducts9be976b8052c984a95997e4a4f8eef96'] = 'apparaît sur les pages produits';
$_LANGADM['AdminProductsab9a907ec2b0b624d4506713ab5507df'] = 'Vous souhaitez mettre une image associé à ce produit dans votre description ?'; $_LANGADM['AdminProductsc39ddd7f7c2983a075a10bff9ff14ae5'] = 'Vous souhaitez mettre une image associé à ce produit dans votre description ?';
$_LANGADM['AdminProducts936ccdb97115e9f35a11d35e3d5b5cad'] = 'Cliquez ici'; $_LANGADM['AdminProducts936ccdb97115e9f35a11d35e3d5b5cad'] = 'Cliquez ici';
$_LANGADM['AdminProducts8300b58d12ed9de055d7a727c72ef55a'] = 'Sélectionner votre image :'; $_LANGADM['AdminProducts8300b58d12ed9de055d7a727c72ef55a'] = 'Sélectionner votre image :';
$_LANGADM['AdminProductscba45f08ce11e3ed5624f853e3cb6f08'] = 'Où la placer ?'; $_LANGADM['AdminProductscd896fb215aeb877827b7e9df7d042cb'] = 'Où la placer ?';
$_LANGADM['AdminProducts811882fecd5c7618d7099ebbd39ea254'] = 'Gauche'; $_LANGADM['AdminProducts811882fecd5c7618d7099ebbd39ea254'] = 'Gauche';
$_LANGADM['AdminProducts7c4f29407893c334a6cb7a87bf045c0d'] = 'Droite'; $_LANGADM['AdminProducts7c4f29407893c334a6cb7a87bf045c0d'] = 'Droite';
$_LANGADM['AdminProducts03e895d6310cdab805586fce4123ed08'] = 'Sélectionner le type d\'image :'; $_LANGADM['AdminProducts03e895d6310cdab805586fce4123ed08'] = 'Sélectionner le type d\'image :';
$_LANGADM['AdminProductsd5b6a6e5d16e7061897360b9ef925b28'] = 'Code à insérer dans la description :'; $_LANGADM['AdminProducts883cb219650dc3aa23733c0aa59a2ef7'] = 'Code à insérer dans votre description';
$_LANGADM['AdminProducts29e6c2eef6a0b578f4c0395c1b8f5b88'] = 'Ce code est à copier/coller dans la description.'; $_LANGADM['AdminProducts29e6c2eef6a0b578f4c0395c1b8f5b88'] = 'Ce code est à copier/coller dans la description.';
$_LANGADM['AdminProducts32b502f33a535f75dcbf63f6753c631e'] = 'Tags :'; $_LANGADM['AdminProducts32b502f33a535f75dcbf63f6753c631e'] = 'Tags :';
$_LANGADM['AdminProducts8fca858b27c5837dcb22c398aca5e0fc'] = 'Tags séparés par des virgules (ex : dvd, lecteur dvd, hifi)'; $_LANGADM['AdminProducts8fca858b27c5837dcb22c398aca5e0fc'] = 'Tags séparés par des virgules (ex : dvd, lecteur dvd, hifi)';
@@ -2300,6 +2255,7 @@ $_LANGADM['AdminProductsfff0d600f8a0b5e19e88bfb821dd1157'] = 'Images';
$_LANGADM['AdminProductsfee1ad396cfeab246802224002123f39'] = 'Editer cette image de produit'; $_LANGADM['AdminProductsfee1ad396cfeab246802224002123f39'] = 'Editer cette image de produit';
$_LANGADM['AdminProducts8bf615c78d82dede20bca75a5c73615c'] = 'Ajouter une nouvelle image pour ce produit'; $_LANGADM['AdminProducts8bf615c78d82dede20bca75a5c73615c'] = 'Ajouter une nouvelle image pour ce produit';
$_LANGADM['AdminProductsae21d822d879539a75c3d6fd91c2acb3'] = 'Fichier :'; $_LANGADM['AdminProductsae21d822d879539a75c3d6fd91c2acb3'] = 'Fichier :';
$_LANGADM['AdminProductsd4303d4b75580309626e8f496e3b072b'] = 'S\'il vous plaît activer JavaScript pour utiliser uploader le fichier:';
$_LANGADM['AdminProductsfb2ea703b13d059f6b7ea5da806021df'] = 'Format :'; $_LANGADM['AdminProductsfb2ea703b13d059f6b7ea5da806021df'] = 'Format :';
$_LANGADM['AdminProductsb908c2f34052b5276e0bf50f0e042211'] = 'Taille du fichier :'; $_LANGADM['AdminProductsb908c2f34052b5276e0bf50f0e042211'] = 'Taille du fichier :';
$_LANGADM['AdminProductsc820e0c1d4ae16db218626f49e7916b1'] = 'Ko max.'; $_LANGADM['AdminProductsc820e0c1d4ae16db218626f49e7916b1'] = 'Ko max.';