diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index a7a642c4e85..c8d333f578d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -64,7 +64,7 @@ $search_state=trim(GETPOST("search_state")); $search_country=GETPOST("search_country",'int'); $search_type_thirdparty=GETPOST("search_type_thirdparty",'int'); $search_user=GETPOST('search_user','int'); -$search_request_author=GETPOST('search_request_author','int'); +$search_request_author=GETPOST('search_request_author','alpha'); $search_ht=GETPOST('search_ht'); $search_ttc=GETPOST('search_ttc'); $search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7' @@ -192,7 +192,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_type=''; $search_country=''; $search_type_thirdparty=''; - $search_request_author=-1; + $search_request_author=''; $search_total_ht=''; $search_total_vat=''; $search_total_ttc=''; @@ -205,7 +205,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $deliveryyear=''; $billed=''; $search_array_options=array(); - + } if (empty($reshook)) @@ -248,7 +248,7 @@ if ($socid > 0) $fourn->fetch($socid); $title .= ' - '.$fourn->name; } -if ($status) +if ($status) { if ($status == '1,2,3') $title.=' - '.$langs->trans("StatusOrderToProcessShort"); if ($status == '6,7') $title.=' - '.$langs->trans("StatusOrderCanceled"); @@ -300,7 +300,7 @@ if ($search_ref) $sql .= natural_search('cf.ref', $search_ref); if ($search_refsupp) $sql.= natural_search("cf.ref_supplier", $search_refsupp); if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($search_company) $sql .= natural_search('s.nom', $search_company); -if ($search_request_author > 0) $sql.= " AND u.login LIKE '%".$db->escape($search_request_author)."%'"; +if ($search_request_author) $sql.= " AND u.login LIKE '%".$db->escape($search_request_author)."%'"; if ($billed != '' && $billed >= 0) $sql .= " AND cf.billed = ".$billed; //Required triple check because statut=0 means draft filter @@ -382,7 +382,7 @@ $sql.= $db->plimit($limit+1, $offset); $resql = $db->query($sql); if ($resql) -{ +{ if ($socid > 0) { $soc = new Societe($db); @@ -393,7 +393,7 @@ if ($resql) { $title = $langs->trans('ListOfSupplierOrders'); } - + $num = $db->num_rows($resql); $param=''; @@ -410,13 +410,13 @@ if ($resql) if ($search_ref) $param.='&search_ref='.$search_ref; if ($search_company) $param.='&search_company='.$search_company; if ($search_user > 0) $param.='&search_user='.$search_user; - if ($search_request_author > 0) $param.='&search_request_author='.$search_request_author; + if ($search_request_author) $param.='&search_request_author='.$search_request_author; if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_total_ht != '') $param.='&search_total_ht='.$search_total_ht; if ($search_total_ttc != '') $param.="&search_total_ttc=".$search_total_ttc; if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp; if ($search_status >= 0) $param.="&search_status=".$search_status; - if ($billed != '') $param.="&billed=".$billed; + if ($billed != '') $param.="&billed=".$billed; if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields foreach ($search_array_options as $key => $val) @@ -425,9 +425,9 @@ if ($resql) $tmpkey=preg_replace('/search_options_/','',$key); if ($val != '') $param.='&search_options_'.$tmpkey.'='.urlencode($val); } - + //$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge"))); - + // Lignes des champs de filtre print '