* Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * 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/admin/const.php \ingroup setup \brief Page d'administration/configuration des constantes autres \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); $langs->load("admin"); if (!$user->admin) accessforbidden(); $typeconst=array('yesno','texte','chaine'); if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],1,isset($_POST["constnote"])?$_POST["constnote"]:'',$_POST["entity"])); { print $db->error(); } } if ($_GET["action"] == 'delete') { if (! dolibarr_del_const($db, $_GET["rowid"],$_GET["entity"])); { print $db->error(); } } llxHeader(); print_fiche_titre($langs->trans("OtherSetup"),'','setup'); print $langs->trans("ConstDesc")."
\n"; print "
\n"; print ''; print ''; print ''; print ''; print ''; if ($conf->multicompany->enabled) print ''; print ''; print "\n"; $form = new Form($db); # Affiche ligne d'ajout $var=false; print ''; print ''; print ''; print "\n"; print ''; if ($conf->multicompany->enabled) { print ''; } else { print ''; } print '\n"; print ''; print ''; # Affiche lignes des constantes if ($all==1) { $sql = "SELECT rowid, name, value, note, entity "; $sql.= "FROM llx_const "; $sql.= "WHERE entity IN (0,".$conf->entity.") "; $sql.= "ORDER BY name ASC"; } else { $sql = "SELECT rowid, name, value, note, entity "; $sql.= "FROM llx_const "; $sql.= "WHERE visible = 1 "; $sql.= "AND entity IN (0,".$conf->entity.") "; $sql.= "ORDER BY name ASC"; } dol_syslog("Const::listConstant sql=".$sql); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $i = 0; $var=false; while ($i < $num) { $obj = $db->fetch_object($result); $var=!$var; print "\n"; print ''; print ''; print ''; print ''; print ''; print "\n"; // Value print ''; // Entity if ($conf->multicompany->enabled) { print ''; } else { print ''; } print '\n"; print ''; print "\n"; $i++; } } print '
'.$langs->trans("Name").''.$langs->trans("Value").''.$langs->trans("Note").''.$langs->trans("Entity").''.$langs->trans("Action").'
'; print ''; print ''; print ''; print ''; print ''; print ''; print '
'; print "
$obj->name'; print ''; print ''; // Note print ''; print ''; print ''; print ''; print '   '; print ''.img_delete().''; print "
'; $db->close(); llxFooter('$Date$ - $Revision$'); ?>