From 0e494ed7db88cb9f3d64b534fcc7cd4f2a4861a4 Mon Sep 17 00:00:00 2001 From: mMarinetti Date: Fri, 7 Oct 2011 12:27:01 +0000 Subject: [PATCH] // revert git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9129 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/tabs/AdminProducts.php | 422 ++++++++++++++++--------------- 1 file changed, 224 insertions(+), 198 deletions(-) diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php index b42f21b3a..daff09871 100644 --- a/admin-dev/tabs/AdminProducts.php +++ b/admin-dev/tabs/AdminProducts.php @@ -56,11 +56,7 @@ class AdminProducts extends AdminTab 'a!active' => array('title' => $this->l('Displayed'), 'active' => 'status', 'filter_key' => 'a!active', 'align' => 'center', 'type' => 'bool', 'orderby' => false)); /* Join categories table */ - if ($id_category = Tools::getvalue('id_category')) - $this->_category = new Category($id_category); - else - $this->_category = new Category(1); - + $this->_category = AdminCatalog::getCurrentCategory(); $this->_join = Product::sqlStock('a').' LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` AND i.`cover` = 1) LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product`) @@ -183,7 +179,6 @@ class AdminProducts extends AdminTab else $this->_errors[] = Tools::displayError('You do not have permission to add here.'); } - else /* Delete a product in the download folder */ if (Tools::getValue('deleteVirtualProduct')) @@ -193,7 +188,7 @@ class AdminProducts extends AdminTab else $this->_errors[] = Tools::displayError('You do not have permission to delete here.'); } - else + /* Delete a product in the download folder */ if (Tools::getValue('deleteVirtualProductAttribute')) { @@ -1467,57 +1462,20 @@ class AdminProducts extends AdminTab public function display($token = null) { - if (((Tools::isSubmit('submitAddproduct') OR Tools::isSubmit('submitAddproductAndPreview') OR Tools::isSubmit('submitAddproductAndStay') OR Tools::isSubmit('submitSpecificPricePriorities') OR Tools::isSubmit('submitPriceAddition') OR Tools::isSubmit('submitPricesModification')) AND sizeof($this->_errors)) OR Tools::isSubmit('updateproduct') OR Tools::isSubmit('addproduct')) - { - $this->displayForm($this->token); - if (Tools::getValue('id_category') > 1) - echo '

'.$this->l('Back to home').'
'; - else - echo '

'.$this->l('Back to catalog').'
'; - } - else - { - if ($id_category = (int)Tools::getValue('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)); + if ($id_category = (int)Tools::getValue('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)); - $id_category = Tools::getValue('id_category', 1); - if (!$id_category) - $id_category = 1; - echo '

'.(!$this->_listTotal ? ($this->l('No products found')) : ($this->_listTotal.' '.($this->_listTotal > 1 ? $this->l('products') : $this->l('product')))).'

'; - //////////////////////// - // @todo lot of ergonomy works around here - echo '

'.$this->l('Go to category'); - $select_child = ' '; - echo $select_child; - echo '

- '; - //////////////////////// - $this->l('in category').' "'.stripslashes($this->_category->getName()).'"'; - if ($this->tabAccess['add'] === '1') - echo ' '.$this->l('Add a new product').''; - echo '
'; - $this->displayList($token); - echo '
'; - } + $id_category = Tools::getValue('id_category', 1); + if (!$id_category) + $id_category = 1; + echo '

'.(!$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()).'"

'; + if ($this->tabAccess['add'] === '1') + echo ' '.$this->l('Add a new product').''; + echo '
'; + $this->displayList($token); + echo '
'; } /** @@ -1654,11 +1612,9 @@ class AdminProducts extends AdminTab $(\'#mvt_sign\').html(\' '.$this->l('Increase your stock').'\'); $(\'#mvt_sign\').show(); } - '; - $tabpane = Media::getJqueryPluginPath('tabpane'); - $tabpane['css'] = key($tabpane['css']); - echo ' - + + +
'.$this->_displayDraftWarning($obj->active).' @@ -2213,7 +2169,125 @@ class AdminProducts extends AdminTab $productDownload = new ProductDownload($id_product_download); $hidden = $display_filename = $check = ''; - $this->displayInitInformationAndAttachment(); + ?> + + + + + + + + id OR !$productDownload->active) $hidden = 'style="display:none;"'; @@ -2452,8 +2526,91 @@ class AdminProducts extends AdminTab $productDownload = new ProductDownload(); if ($id_product_download = $productDownload->getIdFromIdProduct($this->getFieldValue($obj, 'id'))) $productDownload = new ProductDownload($id_product_download); - $this->displayInitInformationAndAttachment(); +?> + + + + + + + '; + - $autocomplete = Media::getJqueryPluginPath('autocomplete'); - - echo ' - + +

'.$this->l('Begin typing the first letters of the product name, then select the product from the drop-down list:').'

@@ -4343,133 +4498,4 @@ class AdminProducts extends AdminTab $this->displayErrors(); } - public function displayInitInformationAndAttachment() - { - ?> - -'; - if (empty ($tmp_js['css'])) - continue; - $tmp_js['css'] = key($tmp_js['css']); - echo ''; -} -?> - -