* Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2006 Marc Barilley/Ocebo * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2007 Patrick Raguin * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** * \file htdocs/html.formother.class.php * \brief Fichier de la classe des fonctions prédéfinie de composants html autre * \version $Id$ */ /** * \class FormOther * \brief Classe permettant la génération de composants html autre * \remarks Only common components must be here. */ class FormOther { var $db; var $error; /** * \brief Constructeur * \param DB handler d'accès base de donnée */ function FormOther($DB) { $this->db = $DB; return 1; } /** * \brief Retourne la liste des modèles d'export * \param selected Id modèle pré-sélectionné * \param htmlname Nom de la zone select * \param type Type des modèles recherchés * \param useempty Affiche valeur vide dans liste */ function select_export_model($selected='',$htmlname='exportmodelid',$type='',$useempty=0) { $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; $sql.= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) { print '"; } else { dolibarr_print_error($this->db); } } /** * \brief Retourne la liste des ecotaxes avec tooltip sur le libelle * \param selected code ecotaxes pre-selectionne * \param htmlname nom de la liste deroulante */ function select_ecotaxes($selected='',$htmlname='ecotaxe_id') { global $langs; $sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,"; $sql.= " p.libelle as pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_pays as p"; $sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid"; $sql.= " ORDER BY pays, e.organization ASC, e.code ASC"; if ($this->db->query($sql)) { print ''; return 0; } else { dolibarr_print_error($this->db); return 1; } } } ?>