';
+ }
+
+ if ($this->edit OR $this->delete OR ($this->view AND $this->view !== 'noActionColumn'))
+ {
+ echo '
';
+ if ($this->view)
+ $this->_displayViewLink($token, $id);
+ if ($this->edit)
+ $this->_displayEditLink($token, $id);
+ if ($this->delete AND (!isset($this->_listSkipDelete) OR !in_array($id, $this->_listSkipDelete)))
+ $this->_displayDeleteLink($token, $id);
+ if ($this->duplicate)
+ $this->_displayDuplicate($token, $id);
+ echo '
';
+ }
+ echo '
';
+ }
+ }
+ }
- }
+ }
- public function displayList($token = NULL)
- {
- global $currentIndex;
-
- /* Display list header (filtering, pagination and column names) */
- $this->displayListHeader($token);
- if (!sizeof($this->_list))
- echo '
'.$this->l('No items found').'
';
+ public function displayList($token = NULL)
+ {
+ global $currentIndex;
- /* Show the content of the table */
- $this->displayListContent($token);
+ /* Display list header (filtering, pagination and column names) */
+ $this->displayListHeader($token);
+ if (!sizeof($this->_list))
+ echo '
'.$this->l('No items found').'
';
- /* Close list table and submit button */
- $this->displayListFooter($token);
- }
+ /* Show the content of the table */
+ $this->displayListContent($token);
- public function display($token = NULL)
- {
- global $currentIndex, $cookie;
+ /* Close list table and submit button */
+ $this->displayListFooter($token);
+ }
- $this->getList((int)($cookie->id_lang), !$cookie->__get($this->table.'Orderby') ? 'position' : NULL, !$cookie->__get($this->table.'Orderway') ? 'ASC' : NULL);
- echo '
'.(!$this->_listTotal ? ($this->l('There are no subcategories')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('subcategories') : $this->l('subcategory')))).' '.$this->l('in category').' "'.stripslashes($this->_category->getName()).'"
';
+ }
- $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id);
+ public function postProcess($token = NULL)
+ {
+ global $cookie, $currentIndex;
- if (Tools::isSubmit('submitAdd'.$this->table))
- {
- if ($id_category = (int)(Tools::getValue('id_category')))
- {
- if (!Category::checkBeforeMove($id_category, (int)(Tools::getValue('id_parent'))))
- {
- $this->_errors[] = Tools::displayError('Category cannot be moved here');
- return false;
- }
- }
- }
- /* Delete object */
- elseif (isset($_GET['delete'.$this->table]))
- {
- if ($this->tabAccess['delete'] === '1')
- {
- if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings))
- {
- // 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)
- $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.' '.Tools::displayError('You cannot delete all of the items.');
- else
- {
- if ($this->deleted)
- {
- $object->deleteImage();
- $object->deleted = 1;
- if ($object->update())
- Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
- }
- elseif ($object->delete())
- Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
- $this->_errors[] = Tools::displayError('An error occurred during deletion.');
- }
- }
- else
- $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)');
- }
- else
- $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
- }
- elseif (isset($_GET['position']))
- {
- if ($this->tabAccess['edit'] !== '1')
- $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
- elseif (!Validate::isLoadedObject($object = new Category((int)(Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1))))))
- $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)');
- if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
- $this->_errors[] = Tools::displayError('Failed to update the position.');
- else
- Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog'));
- }
- /* Delete multiple objects */
- elseif (Tools::getValue('submitDel'.$this->table))
- {
- if ($this->tabAccess['delete'] === '1')
- {
- if (isset($_POST[$this->table.'Box']))
- {
- $category = new Category();
- $result = true;
- $result = $category->deleteSelection(Tools::getValue($this->table.'Box'));
- if ($result)
- {
- $category->cleanPositions((int)(Tools::getValue('id_category')));
- Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCatalog').'&id_category='.(int)(Tools::getValue('id_category')));
- }
- $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
+ $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id);
- }
- else
- $this->_errors[] = Tools::displayError('You must select at least one element to delete.');
- }
- else
- $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
- return;
- }
- parent::postProcess();
- }
+ if (Tools::isSubmit('submitAdd'.$this->table))
+ {
+ if ($id_category = (int)(Tools::getValue('id_category')))
+ {
+ if (!Category::checkBeforeMove($id_category, (int)(Tools::getValue('id_parent'))))
+ {
+ $this->_errors[] = Tools::displayError('Category cannot be moved here');
+ return false;
+ }
+ }
+ }
- protected function postImage($id)
- {
- $ret = parent::postImage($id);
- if (($id_category = (int)(Tools::getValue('id_category'))) AND isset($_FILES) AND sizeof($_FILES) AND $_FILES['image']['name'] != NULL AND file_exists(_PS_CAT_IMG_DIR_.$id_category.'.jpg'))
- {
- $imagesTypes = ImageType::getImagesTypes('categories');
- foreach ($imagesTypes AS $k => $imageType)
- imageResize(_PS_CAT_IMG_DIR_.$id_category.'.jpg', _PS_CAT_IMG_DIR_.$id_category.'-'.stripslashes($imageType['name']).'.jpg', (int)($imageType['width']), (int)($imageType['height']));
- }
- return $ret;
- }
+ // @Override Antadis
+ /* Delete Image Thumb */
+ elseif (isset($_GET['deleteImageThumb']))
+ {
+ if (Validate::isLoadedObject($object = $this->loadObject())) {
+ $this->deleteImageThumb($object);
+ Tools::redirectAdmin($currentIndex.'&updatecategory&token='.Tools::getValue('token').'&id_category='.(int)($object->id));
+ }
- public function displayForm($token = NULL)
- {
- global $currentIndex, $cookie;
- parent::displayForm();
+ }
+ // @EndOverride Antadis
- if (!($obj = $this->loadObject(true)))
- return;
- $active = $this->getFieldValue($obj, 'active');
- $customer_groups = $obj->getGroups();
+ /* Delete object */
+ elseif (isset($_GET['delete'.$this->table]))
+ {
+ if ($this->tabAccess['delete'] === '1')
+ {
+ if (Validate::isLoadedObject($object = $this->loadObject()) AND isset($this->fieldImageSettings))
+ {
+ // 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)
+ $this->_errors[] = Tools::displayError('You need at least one object.').' '.$this->table.' '.Tools::displayError('You cannot delete all of the items.');
+ else
+ {
+ if ($this->deleted)
+ {
+ // @Override Antadis
+ $this->deleteImageThumb($object);
+ // @End Antadis
+ $object->deleteImage();
+ $object->deleted = 1;
+ if ($object->update())
+ Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
+ }
+ elseif ($object->delete())
+ Tools::redirectAdmin($currentIndex.'&conf=1&token='.Tools::getValue('token').'&id_category='.(int)($object->id_parent));
+ $this->_errors[] = Tools::displayError('An error occurred during deletion.');
+ }
+ }
+ else
+ $this->_errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)');
+ }
+ else
+ $this->_errors[] = Tools::displayError('You do not have permission to delete here.');
+ }
+ elseif (isset($_GET['position']))
+ {
+ if ($this->tabAccess['edit'] !== '1')
+ $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
+ elseif (!Validate::isLoadedObject($object = new Category((int)(Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1))))))
+ $this->_errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)');
+ if (!$object->updatePosition((int)(Tools::getValue('way')), (int)(Tools::getValue('position'))))
+ $this->_errors[] = Tools::displayError('Failed to update the position.');
+ else
+ Tools::redirectAdmin($currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.(($id_category = (int)(Tools::getValue($this->identifier, Tools::getValue('id_category_parent', 1)))) ? ('&'.$this->identifier.'='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCatalog'));
+ }
+ /* Delete multiple objects */
+ elseif (Tools::getValue('submitDel'.$this->table))
+ {
+ if ($this->tabAccess['delete'] === '1')
+ {
+ if (isset($_POST[$this->table.'Box']))
+ {
+ $category = new Category();
+ $result = true;
+ $result = $category->deleteSelection(Tools::getValue($this->table.'Box'));
+ if ($result)
+ {
+ $category->cleanPositions((int)(Tools::getValue('id_category')));
+ Tools::redirectAdmin($currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCatalog').'&id_category='.(int)(Tools::getValue('id_category')));
+ }
+ $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
- echo '
-
- ';
- }
+ // @Adding Antadis
+ public function deleteImageThumb($object)
+ {
+ if(file_exists(_PS_ROOT_DIR_.'/img/c/'.$object->id.'_thumb_vp.jpg')) {
+ unlink(_PS_ROOT_DIR_.'/img/c/'.$object->id.'_thumb_vp.jpg');
+ }
+ }
+ // @End Antadis
+
+ public function displayForm($token = NULL)
+ {
+ global $currentIndex, $cookie;
+ parent::displayForm();
+
+ if (!($obj = $this->loadObject(true)))
+ return;
+ $active = $this->getFieldValue($obj, 'active');
+ $customer_groups = $obj->getGroups();
+
+ echo '
+
+ ';
+ }
}
diff --git a/modules/categoryimg/left_img.tpl b/modules/categoryimg/left_img.tpl
index 18b9f37f..23950bf8 100755
--- a/modules/categoryimg/left_img.tpl
+++ b/modules/categoryimg/left_img.tpl
@@ -3,7 +3,8 @@
-
+ {* *}
+
{if !$consumable}
diff --git a/override/controllers/ProductController.php b/override/controllers/ProductController.php
index dfb9b8c5..47bbc752 100755
--- a/override/controllers/ProductController.php
+++ b/override/controllers/ProductController.php
@@ -12,7 +12,7 @@ class ProductController extends ProductControllerCore {
'HOOK_PRIVATESALES_PRODUCT' => Module::hookExec('privatesales_product', array('sale' => $sale)),
'is_sale_home' => ($sale? $sale->id_category == $id_category: FALSE),
));
-
+
// assign date estimation from sale delay
if (Module::isInstalled('privatesales_delay')) {
if (!class_exists('SaleDelay')) {
diff --git a/themes/site/product.tpl b/themes/site/product.tpl
index 5365460e..f67704e2 100755
--- a/themes/site/product.tpl
+++ b/themes/site/product.tpl
@@ -204,7 +204,7 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
-
+
{if $sale}
@@ -314,14 +314,14 @@ var fieldRequired = '{l s='Please fill in all required fields, then save the cus
{foreach from=$groups key=id_attribute_group item=group}
{if $group.attributes|@count}