* Copyright (C) 2004-2009 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; } } /** * \brief Retourn list of project and tasks * \param selected Pre-selected value * \param modeproject 1 to restrict on projects owned by user * \param modetask 1 to restrict on tasks associated to user * \param htmlname Name of html select */ function selectProjectTasks($selected='',$htmlname='task_parent', $modeproject=0, $modetask=0) { global $user; require_once(DOL_DOCUMENT_ROOT."/project.class.php"); //print $modeproject.'-'.$modetask; $project=new Project($this->db); $tasksarray=$project->getTasksArray($modetask?$user:0, $modeproject?$user:0); if ($tasksarray) { print ''; } } } /** * Enter description here... * * @param unknown_type $inc * @param unknown_type $parent * @param unknown_type $lines * @param unknown_type $level */ function PLineSelect(&$inc, $parent, $lines, &$level) { global $langs; $lastprojectid=0; for ($i = 0 ; $i < sizeof($lines) ; $i++) { if ($parent == 0) $level = 0; if ($lines[$i]->fk_parent == $parent) { $var = !$var; // Break on a new project if ($parent == 0 && $lines[$i]->projectid != $lastprojectid) { print '\n"; $lastprojectid=$lines[$i]->projectid; $inc++; } print '\n"; $inc++; $level++; if ($lines[$i]->id) PLineSelect($inc, $lines[$i]->id, $lines, $level); $level--; } } } ?>