diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index c3cc5fbb7cb..e15f22220f1 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -54,6 +54,7 @@ $search_refcustomer=GETPOST('search_refcustomer','alpha'); $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_author=GETPOST('search_author','alpha'); +$search_ville=GETPOST('search_ville','alpha'); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -101,6 +102,7 @@ if (GETPOST("button_removefilter_x")) $search_societe=''; $search_montant_ht=''; $search_author=''; + $search_ville=''; $year=''; $month=''; } @@ -137,7 +139,7 @@ if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom, s.client, '; +$sql = 'SELECT s.rowid, s.nom, s.town, s.client, '; $sql.= 'p.rowid as propalid, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; @@ -157,6 +159,10 @@ if (! $user->rights->societe->client->voir && ! $socid) //restriction { $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; } +if ($search_ville) //restriction +{ + $sql.= " AND s.town LIKE '%".$db->escape(trim($search_ville))."%'"; +} if ($search_ref) { $sql.= " AND p.ref LIKE '%".$db->escape(trim($search_ref))."%'"; @@ -229,6 +235,7 @@ if ($result) if ($search_sale > 0) $param.='&search_sale='.$search_sale; if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; if ($search_author) $param.='&search_author='.$search_author; + if ($search_ville) $param.='&search_ville='.$search_ville; print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); // Lignes des champs de filtre @@ -264,6 +271,7 @@ if ($result) print ''; print_liste_field_titre($langs->trans('Ref'),$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Company'),$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Town'),$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('RefCustomer'),$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Date'),$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans('DateEndPropalShort'),$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder); @@ -280,6 +288,7 @@ if ($result) print ''; print ''; print ''; + print ''; print ''; print ''; print ''; @@ -344,9 +353,12 @@ if ($result) print ''; print $companystatic->getNomUrl(1,'customer'); print ''; - + + print ''; + print $objp->town; + print ''; // Customer ref - print ''; + print ''; print $objp->ref_client; print ''; @@ -399,14 +411,14 @@ if ($result) if($num<$limit){ $var=!$var; print ''.$langs->trans("Total HT").''; - print ''.price($total).''; + print ''.price($total).''; print ''; } else { $var=!$var; print ''.$langs->trans("Total HT for this page").''; - print ''.price($total).''; + print ''.price($total).''; print ''; }