From 3842c50b48a1ea0002f2149d5ae2615b6bb8635d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 2 Aug 2006 10:03:03 +0000 Subject: [PATCH] =?UTF-8?q?Ajout:=20ajout=20d'une=20option=20dans=20le=20m?= =?UTF-8?q?odule=20propal=20et=20commande=20qui=20permet=20de=20cacher=20l?= =?UTF-8?q?es=20propales=20et=20commandes=20sign=E9s=20et/ou=20factur=E9es?= =?UTF-8?q?=20afin=20d'y=20voir=20plus=20clair=20dans=20les=20listes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/admin/commande.php | 32 ++++++++++++++++++++++++++++++++ htdocs/admin/propale.php | 20 ++++++++++++++++++++ htdocs/comm/propal.php | 5 +++++ htdocs/commande/liste.php | 5 +++++ 4 files changed, 62 insertions(+) diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 5444907fb3c..f12d5a1a77d 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -127,6 +127,11 @@ if ($_GET["action"] == 'setmod') dolibarr_set_const($db, "COMMANDE_ADDON",$_GET["value"]); } +if ($_POST["action"] == 'sethidetreated') +{ + dolibarr_set_const($db, "COMMANDE_HIDE_TREATED",$_POST["hidetreated"]); +} + /* @@ -324,5 +329,32 @@ closedir($handle); print ''; +//Autres Options +print "
"; +print_titre($langs->trans("OtherOptions")); + +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; +$var=true; + +// cacher les commandes classer facturées des listes +$var=! $var; +print ''; +print ''; +print '\n"; +print ''; + +print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'; +print $langs->trans("HideTreadedOrders"); +print ''; +print $html->selectyesno("hidetreated",$conf->global->COMMANDE_HIDE_TREATED,1); +print ''; +print ''; +print "
'; + llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/admin/propale.php b/htdocs/admin/propale.php index 6881c1a03b5..a4f57bae890 100644 --- a/htdocs/admin/propale.php +++ b/htdocs/admin/propale.php @@ -92,6 +92,13 @@ if ($_POST["action"] == 'setclassifiedinvoiced') exit; } +if ($_POST["action"] == 'sethidetreated') +{ + dolibarr_set_const($db, "PROPALE_HIDE_TREATED",$_POST["hidetreated"]); + Header("Location: propale.php"); + exit; +} + if ($_GET["action"] == 'set') { $type='propal'; @@ -395,6 +402,19 @@ if ($conf->commande->enabled) print ''; } +// cacher les propales classer facturées des listes +$var=! $var; +print '
'; +print ''; +print ''; +print $langs->trans("HideTreadedPropal"); +print ''; +print $html->selectyesno("hidetreated",$conf->global->PROPALE_HIDE_TREATED,1); +print ''; +print ''; +print "\n"; +print '
'; + print ''; diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 3cee83c00ee..b552d85d1fe 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1729,6 +1729,11 @@ else { $sql .= " AND p.ref like '%".addslashes($_POST["sf_ref"]) . "%'"; } + // on ne liste pas les propales classer ayant le statut signé, facturé, non signé + if ($conf->global->PROPALE_HIDE_TREATED && (!$sall && empty($_GET['search_ref']) && empty($_GET['search_societe']) && empty($_GET['search_montant_ht']))) + { + $sql .= ' AND p.fk_statut < 2'; + } $sql .= ' ORDER BY '.$sortfield.' '.$sortorder.', p.ref DESC'; $sql .= $db->plimit($limit + 1,$offset); $result=$db->query($sql); diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 71b8f233c7f..3529c1ab54f 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -116,6 +116,11 @@ if (!empty($sref_client)) { $sql .= ' AND c.ref_client like \'%'.addslashes($sref_client).'%\''; } +// on ne liste pas les commandes classer facturées, elles apparaissent tout de même avec la recherche +if ($conf->global->COMMANDE_HIDE_TREATED && (!$sref && !$sref_client && !$snom && !$sall && (!strlen($_POST['sf_ref']) > 0))) +{ + $sql .= ' AND c.facture = 0'; +} $sql .= ' ORDER BY '.$sortfield.' '.$sortorder; $sql .= $db->plimit($limit + 1,$offset);