Skip to content

Commit

Permalink
NEW Can now select fields to show in product list. Extrafields are also
Browse files Browse the repository at this point in the history
supported.
  • Loading branch information
eldy committed Oct 29, 2015
1 parent 2b5746a commit 3760f24
Show file tree
Hide file tree
Showing 5 changed files with 440 additions and 154 deletions.
52 changes: 51 additions & 1 deletion htdocs/core/class/extrafields.class.php
Expand Up @@ -1111,7 +1111,7 @@ function showInputField($key,$value,$moreparam='',$keyprefix='',$keysuffix='',$s
*
* @param string $key Key of attribute
* @param string $value Value to show
* @param string $moreparam More param
* @param string $moreparam To add more parametes on html input tag (only checkbox use html input for output rendering)
* @return string Formated value
*/
function showOutputField($key,$value,$moreparam='')
Expand All @@ -1128,6 +1128,8 @@ function showOutputField($key,$value,$moreparam='')
$perms=$this->attribute_perms[$key];
$list=$this->attribute_list[$key];

$showsize=0;

if ($type == 'date')
{
$showsize=10;
Expand Down Expand Up @@ -1357,11 +1359,59 @@ function showOutputField($key,$value,$moreparam='')
$showsize=round($size);
if ($showsize > 48) $showsize=48;
}

//print $type.'-'.$size;
$out=$value;

return $out;
}

/**
* Return tag to describe alignement to use for this extrafield
*
* @param string $key Key of attribute
* @return string Formated value
*/
function getAlignFlag($key)
{
global $conf,$langs;

$type=$this->attribute_type[$key];

$align='';

if ($type == 'date')
{
$align="center";
}
elseif ($type == 'datetime')
{
$align="center";
}
elseif ($type == 'int')
{
$align="right";
}
elseif ($type == 'double')
{
$align="right";
}
elseif ($type == 'boolean')
{
$align="center";
}
elseif ($type == 'radio')
{
$align="center";
}
elseif ($type == 'checkbox')
{
$align="center";
}

return $align;
}

/**
* Return HTML string to print separator extrafield
*
Expand Down

1 comment on commit 3760f24

@BebZ
Copy link

@BebZ BebZ commented on 3760f24 Oct 31, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woah !
and where is it possible to display those fiels in lists ? i don't see any admin or something in the code
is it a checkbox near each field we want to display ?

Please sign in to comment.