From 403db40a7fab6f895b2bc0d6439b445a96cbcbd0 Mon Sep 17 00:00:00 2001 From: tDidierjean Date: Fri, 17 Feb 2012 14:50:01 +0000 Subject: [PATCH] [*] BO : #PSTEST-784 - selected attribute is now visible git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13434 b9a71923-0436-4b27-9f14-aed3839534dd --- admin-dev/themes/default/css/admin.css | 4 ++- .../helpers/list/list_action_edit.tpl | 28 ------------------- .../template/helpers/list/list_header.tpl | 2 +- classes/helper/HelperList.php | 11 -------- controllers/admin/AdminProductsController.php | 4 +-- js/admin-products.js | 26 +++++++++++------ 6 files changed, 23 insertions(+), 52 deletions(-) delete mode 100644 admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_edit.tpl diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index 7e54cea60..d1d21dc1e 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -482,4 +482,6 @@ ul.listForm li {padding-bottom:3px;} .view-modules li.favorites-view {border-bottom-left-radius: 0;border-left: 1px solid #fff; border-top-left-radius: 0;} .view-modules li.normal-view {border-bottom-right-radius: 0;border-right: 1px solid #ccc; border-top-right-radius: 0;} -.margin-form select.chosen{width: 200px;} \ No newline at end of file +.margin-form select.chosen{width: 200px;} + +.selected-line {background:#fff1b5;} diff --git a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_edit.tpl b/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_edit.tpl deleted file mode 100644 index 34f5d5f9f..000000000 --- a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_edit.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2007-2011 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9197 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - {l s='Modify this combination'} - \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index 01277c111..7af4e1ced 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -93,7 +93,7 @@
{/if} - +
{if !$simple_header}
diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 26f60ca73..0b94469b4 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -529,17 +529,6 @@ class HelperListCore extends Helper ); $this->is_dnd_identifier = array_key_exists($this->identifier, $this->identifiersDnd); -/* - if ($is_dnd_identifier) - { - ' id="'. - if(((int)(Tools::getValue($this->identifiersDnd[$this->identifier], 1))) - substr($this->identifier,3,strlen($this->identifier))) - } - .' class="table'.( - if ($is_dnd_identifier AND ($this->orderBy != 'position 'AND $this->orderWay != 'DESC')) - ' tableDnD' - .'" cellpadding="0" cellspacing="0">*/ // Cleaning links if (Tools::getValue($this->table.'Orderby') && Tools::getValue($this->table.'Orderway')) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 9ebeeec89..2bda1952a 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3348,7 +3348,7 @@ class AdminProductsControllerCore extends AdminController $comb_array[$id_product_attribute]['attributes'] = $list; if ($product_attribute['default_on']) { - $this->list_skip_actions['default'][] = $product_attribute['id_combinaison_attribute']; + $this->list_skip_actions['default'][] = $product_attribute['id_product_attribute']; $comb_array[$id_product_attribute]['color'] = $color_by_default; } @@ -3395,7 +3395,7 @@ class AdminProductsControllerCore extends AdminController } $helper = new HelperList(); - $helper->identifier = 'id_combinaison_attribute'; + $helper->identifier = 'id_product_attribute'; $helper->token = $this->token; $helper->currentIndex = self::$currentIndex; $helper->no_link = true; diff --git a/js/admin-products.js b/js/admin-products.js index 526abda16..169f9d27d 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -124,24 +124,24 @@ function defaultProductAttribute(ids, token, parent) }); } -function editProductAttribute(ids, token) +function editProductAttribute(url, parent) { - var id = ids.split('||'); $.ajax({ - url: 'index.php', + url: url, data: { - id_product: id[0], - id_product_attribute: id[1], - controller: 'AdminProducts', - token: token, - action: 'editProductAttribute', - ajax: true + id_product: id_product, + ajax: true, + action: 'editProductAttribute' }, context: document.body, dataType: 'json', context: this, async: false, success: function(data) { + // color the selected line + parent.siblings().removeClass('selected-line'); + parent.addClass('selected-line'); + $('#add_new_combination').show(); $('#attribute_quantity').show(); $('#product_att_list').html(''); @@ -442,4 +442,12 @@ $(document).ready(function() { return false; }) }); + + // Bind action edition on attribute list + onTabLoad('Combinations', function(){ + $('table[name=list_table]').delegate('a.edit', 'click', function(e){ + e.preventDefault(); + editProductAttribute(this.href, $(this).closest('tr')); + }); + }); });