diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index f2f7aacbf52..cf98099fb7a 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -249,8 +249,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 9292a378327..92bb80d9655 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -320,8 +320,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index b2d4f5d9a61..8810a1be986 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -546,8 +546,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php
index 39542bf12c8..d716667e7f3 100644
--- a/htdocs/compta/bank/bankentries.php
+++ b/htdocs/compta/bank/bankentries.php
@@ -508,8 +508,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php
index fa880e0597f..177e576b5d7 100644
--- a/htdocs/compta/bank/index.php
+++ b/htdocs/compta/bank/index.php
@@ -165,8 +165,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index a4840dd37be..3ffd0af9cd3 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -474,8 +474,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 80bd079135e..50bb85ace6e 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -320,8 +320,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index e38fa6ceab3..17246751600 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -255,8 +255,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index b1ab8280c66..fff50edd2d3 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6190,7 +6190,7 @@ function dol_getmypid()
* like "keyword1 keyword2" = We want record field like keyword1 AND field like keyword2
* or like "keyword1|keyword2" = We want record field like keyword1 OR field like keyword2
* If param $mode is 1, can contains an operator <, > or = like "<10" or ">=100.5 < 1000"
- * If param $mode is 2, can contains a list of id separated by comma like "1,3,4"
+ * If param $mode is 2, can contains a list of int id separated by comma like "1,3,4"
* @param integer $mode 0=value is list of keyword strings, 1=value is a numeric test (Example ">5.5 <10"), 2=value is a list of id separated with comma (Example '1,3,4')
* @param integer $nofirstand 1=Do not output the first 'AND'
* @return string $res The statement to append to the SQL query
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 3cdb6d5e328..2413ee396cc 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -211,8 +211,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index eeec2c135a2..ab5fa27b13f 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -231,8 +231,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index c0da9e2de3a..28fcdefcf62 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -253,8 +253,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index d3d163da7ac..866d8cab17c 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -223,8 +223,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 8495c1030fd..ee9a6b3e490 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -589,8 +589,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index ba81e6742cd..f2424894c7d 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -372,8 +372,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index dfd6e90929a..2c2fe276146 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -396,7 +396,7 @@ ComputedFormulaDesc=You can enter here a formula using other properties of objec
ExtrafieldParamHelpselect=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
code3,value3
...
In order to have the list depending on another complementary attribute list :
1,value1|options_parent_list_code:parent_key
2,value2|options_parent_list_code:parent_key
In order to have the list depending on another list :
1,value1|parent_list_code:parent_key
2,value2|parent_list_code:parent_key
ExtrafieldParamHelpcheckbox=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
3,value3
...
ExtrafieldParamHelpradio=List of values must be lines with format key,value (where key can't be '0')
for example :
1,value1
2,value2
3,value3
...
-ExtrafieldParamHelpsellist=List of values comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter
+ExtrafieldParamHelpsellist=List of values comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter
- idfilter is necessarly a primary int key
- filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list:
c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelpchkbxlst=List of values comes from a table
Syntax : table_name:label_field:id_field::filter
Example : c_typent:libelle:id::filter
filter can be a simple test (eg active=1) to display only active value
You can also use $ID$ in filter witch is the current id of current object
To do a SELECT in filter use $SEL$
if you want to filter on extrafields use syntax extra.fieldcode=... (where field code is the code of extrafield)
In order to have the list depending on another complementary attribute list :
c_typent:libelle:id:options_parent_list_code|parent_column:filter
In order to have the list depending on another list:
c_typent:libelle:id:parent_list_code|parent_column:filter
ExtrafieldParamHelplink=Parameters must be ObjectName:Classpath
Syntax : ObjectName:Classpath
Example : Societe:societe/class/societe.class.php
LibraryToBuildPDF=Library used for PDF generation
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index f6ccf9b218b..3315773ed31 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -226,8 +226,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
- if ($crit != '' && (! in_array($typ, array('select')) || $crit != '0'))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 2a8d9861e5a..162567878d1 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -226,8 +226,9 @@ foreach ($search_array_options as $key => $val)
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
diff --git a/htdocs/product/list-with-listview.php b/htdocs/product/list-with-listview.php
index 2b967e62ba5..11cefe0bdbf 100644
--- a/htdocs/product/list-with-listview.php
+++ b/htdocs/product/list-with-listview.php
@@ -178,7 +178,7 @@ $arrayfields=array(
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
- foreach($extrafields->attribute_label as $key => $val)
+ foreach($extrafields->attribute_label as $key => $val)
{
$arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>$extrafields->attribute_list[$key], 'position'=>$extrafields->attribute_pos[$key]);
}
@@ -217,16 +217,16 @@ if (empty($reshook))
$search_accountancy_code_buy='';
$search_array_options=array();
}
-
+
// Mass actions
$objectclass='Product';
if ((string) $type == '1') { $objectlabel='Services'; }
if ((string) $type == '0') { $objectlabel='Products'; }
-
+
$permtoread = $user->rights->produit->lire;
$permtodelete = $user->rights->produit->supprimer;
$uploaddir = $conf->product->dir_output;
- include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
+ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -321,8 +321,9 @@ else
$tmpkey=preg_replace('/search_options_/','',$key);
$typ=$extrafields->attribute_type[$tmpkey];
$mode=0;
- if (in_array($typ, array('int','double'))) $mode=1; // Search on a numeric
- if ($val && ( ($crit != '' && ! in_array($typ, array('select'))) || ! empty($crit)))
+ if (in_array($typ, array('int','double','real'))) $mode=1; // Search on a numeric
+ if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') $mode=2; // Search on a foreign key int
+ if ($crit != '' && (! in_array($typ, array('select','sellist')) || $crit != '0'))
{
$sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
}
@@ -353,10 +354,10 @@ else
*/
function list_get_product_sellprice($fk_object) {
global $langs,$conf, $user;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
if($object === false) return '';
-
+
if ($object->status)
{
if ($object->price_base_type == 'TTC') return price($object->price_ttc).' '.$langs->trans("TTC");
@@ -371,23 +372,23 @@ else
* @param int $fk_object rowid of product
* @param string $field concerned field status|status_buy
* @param int $type for libstatus
- * @return string
+ * @return string
*/
function list_get_product_status($fk_object, $field, $type) {
global $conf, $user;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
-
+
if($object === false) return '';
-
+
if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
return ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
} else {
return $object->LibStatut($object->{$field},5,$type);
}
-
+
}
-
+
/**
* Function return formated ref
*
@@ -396,14 +397,14 @@ else
*/
function list_get_product_ref($fk_object) {
global $conf, $user;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
-
+
if($object === false) return '';
-
+
return $object->getNomUrl(1,'',24);
}
-
+
/**
* Function return formated extrafield
*
@@ -413,10 +414,10 @@ else
*/
function list_get_product_extrafield($fk_object, $key) {
global $extrafields;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
if($object === false) return '';
-
+
return $extrafields->showOutputField($key, $object->array_options['options_'.$key], '', 1);
}
@@ -428,12 +429,12 @@ else
*/
function list_get_product_virtual_stock($fk_object) {
global $langs;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
if($object === false) return '';
-
+
$object->load_stock('nobatch');
-
+
$out = '';
if ($object->type != 1)
{
@@ -443,7 +444,7 @@ else
return $out;
}
-
+
/**
* Function return formated stock
*
@@ -452,17 +453,17 @@ else
*/
function list_get_product_stock($fk_object) {
global $langs;
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
if($object === false) return '';
-
+
$out = '';
if ($object->type != 1)
{
if ($object->seuil_stock_alerte != '' && $object->stock_reel< (float) $object->seuil_stock_alerte) $out.= img_warning($langs->trans("StockTooLow")).' ';
$out.= (double) $object->stock_reel;
}
-
+
return $out;
}
/**
@@ -473,12 +474,12 @@ else
*/
function list_get_product_minbuyprice($fk_object) {
global $conf, $user, $langs,$db,$form;
-
+
$out = '';
-
+
$object = Listview::getCachedOjbect('Product', $fk_object);
if($object === false || empty($object->status_buy) ) return '';
-
+
$product_fourn =new ProductFournisseur($db);
if ($product_fourn->find_min_price_product_fournisseur($fk_object) > 0)
{
@@ -494,7 +495,7 @@ else
}
return $out;
}
-
+
// array of customized field function
$arrayeval = array(
'tobuy'=>'list_get_product_status(@rowid@, "status_buy",1)'
@@ -506,7 +507,7 @@ else
,'stock'=>'list_get_product_stock(@rowid@)'
,'minbuyprice'=>'list_get_product_minbuyprice(@rowid@)'
);
-
+
// defined list align for field
$arrayalign = array(
'price'=>'right'
@@ -519,13 +520,13 @@ else
,'datec'=>'center'
,'tms'=>'center'
);
-
+
$parameters=array('arrayfields'=>$arrayfields);
$reshook=$hookmanager->executeHooks('printFieldListMoreFields',$parameters); // Note that $action and $object may have been modified by hook
if($reshook) {
$arrayfields = $hookmanager->resArray;
}
-
+
// init title, hidden field (allowed into selected fields), and position
$arrayhide = $arraytitle = $arrayposition = array();
foreach($arrayfields as $k=>$data) {
@@ -537,7 +538,7 @@ else
$arrayposition[$f] = empty($data['position']) ? 0 : $data['position'];
}
}
-
+
// Extra fields
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
{
@@ -554,7 +555,7 @@ else
);
if ($user->rights->produit->supprimer) $arrayofmassactions['delete']=$langs->trans("Delete");
if ($massaction == 'presend' || $massaction == 'createbills') $arrayofmassactions=array();
-
+
// Filter on categories
$moreforfilter='';
if (! empty($conf->categorie->enabled))
@@ -564,7 +565,7 @@ else
$moreforfilter.=$htmlother->select_categories(Categorie::TYPE_PRODUCT,$search_categ,'search_categ',1);
$moreforfilter.='';
}
-
+
//Show/hide child products. Hidden by default
if (!empty($conf->variants->enabled) && $type === 0) {
$moreforfilter.='