diff --git a/htdocs/admin/energie.php b/htdocs/admin/energie.php index 95ba7a832d2..00c69ef3c63 100644 --- a/htdocs/admin/energie.php +++ b/htdocs/admin/energie.php @@ -1,5 +1,6 @@ + * Copyright (C) 2007 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 @@ -35,30 +36,16 @@ if (!$user->admin) if ($_POST["action"] == 'setvalue' && $user->admin) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'JPGRAPH_DIR'"; - - $db->query($sql); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."const (name,value,visible)"; - $sql .= " VALUES ('JPGRAPH_DIR','".$_POST["url"]."',0)"; - - if ($db->query($sql)) - { - Header("Location: energie.php"); - } - else - { - dolibarr_print_error($db); - } + dolibarr_set_const($db, "JPGRAPH_DIR",$_POST["url"]); } -llxHeader(); /* - * * */ + llxHeader(); + print_fiche_titre($langs->trans("Energy"),'','setup'); print '
'; @@ -71,9 +58,9 @@ print ''.$langs->trans("NewValue").''.$langs->trans("CurrentValue") print "\n"; print ''; print $langs->trans("Emplacement de la librairie JpGraph").''; -print ''; +print ''; print ''; -print JPGRAPH_DIR; +print $conf->global->JPGRAPH_DIR; print ''; print '';