[*] 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
This commit is contained in:
tDidierjean
2012-02-17 14:50:01 +00:00
parent 07e1787cdd
commit 403db40a7f
6 changed files with 23 additions and 52 deletions

View File

@@ -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;}
.margin-form select.chosen{width: 200px;}
.selected-line {background:#fff1b5;}

View File

@@ -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 <contact@prestashop.com>
* @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
*}
<a class="pointer edit" onclick="javascript:editProductAttribute('{$id}', '{getAdminToken tab='AdminProducts'}');" title="{l s='Modify this combination'}" ids="{$id}" token="{getAdminToken tab='AdminProducts'}">
<img src="../img/admin/edit.gif" alt="{l s='Modify this combination'}" />
</a>

View File

@@ -93,7 +93,7 @@
<form method="post" action="{$action}" class="form">
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
{/if}
<table class="table_grid">
<table class="table_grid" name="list_table">
{if !$simple_header}
<tr>
<td style="vertical-align: bottom;">

View File

@@ -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'))

View File

@@ -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;

View File

@@ -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'));
});
});
});