From 111b2e83f1e52f25eb34620330b541c226b4ef26 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 3 Nov 2014 06:05:51 +0100 Subject: [PATCH] Contracts list --- htdocs/contrat/list.php | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index dcc1b83e6d8..cf57e97933b 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -40,11 +40,11 @@ if ($page == -1) { $page = 0 ; } $limit = $conf->liste_limit; $offset = $limit * $page ; -$search_nom=GETPOST('search_nom'); +$search_name=GETPOST('search_name'); $search_contract=GETPOST('search_contract'); $search_ref_supplier=GETPOST('search_ref_supplier','alpha'); $sall=GETPOST('sall'); -$statut=GETPOST('statut')?GETPOST('statut'):1; +$search_status=GETPOST('search_status'); $socid=GETPOST('socid'); if (! $sortfield) $sortfield="c.rowid"; @@ -58,6 +58,17 @@ $result = restrictedArea($user, 'contrat', $id); $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); +if (GETPOST("button_removefilter")) +{ + $search_name=""; + $search_contract=""; + $search_ref_supplier=""; + $sall=""; + $search_status=""; +} + +if ($search_status == '') $search_status=1; + /* * View @@ -84,8 +95,8 @@ $sql.= " WHERE c.fk_soc = s.rowid "; $sql.= " AND c.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_name) { + $sql .= natural_search('s.nom', $search_name); } if ($search_contract) { $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract); @@ -106,13 +117,13 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_nom='.$search_nom, $sortfield, $sortorder,'',$num); + print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], '&search_contract='.$search_contract.'&search_name='.$search_name, $sortfield, $sortorder,'',$num); print ''; print ''; $param='&search_contract='.$search_contract; - $param.='&search_nom='.$search_nom; + $param.='&search_name='.$search_name; $param.='&search_ref_supplier='.$search_ref_supplier; print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder); print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_supplier","","$param",'',$sortfield,$sortorder); @@ -136,13 +147,13 @@ if ($resql) print ''; print ''; print ''; print ''; //print ''; - print '"; - print "\n"; + print '\n"; print ''; $var=true;
'; - print ''; + print ''; print '  '; - print "
'; + print ''; + print "