From 6e1e4d9860a501df830ef98b4f2efd99213c5cbb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Aug 2004 18:21:25 +0000 Subject: [PATCH] =?UTF-8?q?La=20fonction=20liste=20des=20type=20d'actions?= =?UTF-8?q?=20accepte=20un=20param=E8tre=20optionnel=20sur=20l'=E9tat=20ac?= =?UTF-8?q?tive=20pour=20n'avoir=20que=20les=20types=20d'actions=20activ?= =?UTF-8?q?=E9=20ou=20non=20dans=20le=20dictionnaire=20de=20donn=E9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/cactioncomm.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/cactioncomm.class.php b/htdocs/cactioncomm.class.php index 6f14421a89a..9efb59859de 100644 --- a/htdocs/cactioncomm.class.php +++ b/htdocs/cactioncomm.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,15 +64,18 @@ class CActioncomm { } } /* - * - * + * \brief Renvoi la liste des type d'actions existant + * \param active 1 ou 0 pour un filtre sur l'etat actif ou non ('' par defaut) * */ - function liste_array() + function liste_array($active='') { $ga = array(); $sql = "SELECT id, libelle FROM ".MAIN_DB_PREFIX."c_actioncomm"; + if ($active != '') { + $sql.=" WHERE active=$active"; + } $sql .= " ORDER BY id"; if ($this->db->query($sql) ) @@ -93,7 +97,7 @@ class CActioncomm { } else { - print $this->db->error(); + dolibarr_print_error($this->db); } }