[-]BO : bug color parameter in List
[-]BO : bug color parameter in List
In field list, if there is another field with 'color' => 'color_field', (and color_field column in the select), the background color is always the value of field list column 'color', never 'color_field'
the lines:
{block name="td_content"}
...
{if isset($params.color) && isset($tr[$params.color])}
<span class="color_field" style="background-color:{$tr.color};...
{/if}
must be:
{block name="td_content"}
...
{if isset($params.color) && isset($tr[$params.color])}
<span class="color_field" style="background-color:{$tr[$params.color])};...
{/if}
In the fields list, for display list, there is :
'osname' => array(
'title' => $this->l('Status'),
'color' => 'color',
...
),
'color parameter gives the name of column in _List to be used as color background.
Currently, it is the same 'color' parameter which is used for one field and the row: (ex:osname)
<span class="color_field" style="background-color:{$tr.color};...
But if there is another field with 'color' => 'color_field', (and color_field in the select), the background color is always 'color', never 'color_field'
That can be fixed with :
<span class="color_field" style="background-color:{$tr[$params.color])};...
So the background color of the row (if colorOnBackground = true) and one row's field will be the value of the column given by 'color'=>'color', and The background color of others fields will be the value of the column given by their parameter 'color'=>'<color_field>'
$this->_select = '..color ..., ... color_field2 ...';
$this->fields_list = array(
'field1' => array(
'title' => $this->l('Status'),
'color' => 'color', // will also be the bg color of the row
...
),
'field2' => array(
'title' => $this->l('Status'),
'color' => 'color_field2',
...
),
'field2' => array(
'title' => $this->l('Status'),
'color' => 'color_field3',
...
),
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
{block name="td_content"}
|
||||
{if isset($params.prefix)}{$params.prefix}{/if}
|
||||
{if isset($params.color) && isset($tr[$params.color])}
|
||||
<span class="color_field" style="background-color:{$tr.color};color:{if Tools::getBrightness($tr.color) < 128}white{else}#383838{/if}">
|
||||
<span class="color_field" style="background-color:{$tr[$params.color]};color:{if Tools::getBrightness($tr[$params.color]) < 128}white{else}#383838{/if}">
|
||||
{/if}
|
||||
{if isset($tr.$key)}
|
||||
{if isset($params.active)}
|
||||
|
||||
Reference in New Issue
Block a user