Gestion des modules
This commit is contained in:
parent
0cafcdcbdc
commit
363ef621ec
135
htdocs/admin/modules.php
Normal file
135
htdocs/admin/modules.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
|
||||
$db = new Db();
|
||||
|
||||
llxHeader();
|
||||
|
||||
$dir = "../includes/modules/facture/";
|
||||
|
||||
if (!$user->admin)
|
||||
{
|
||||
print "Forbidden";
|
||||
llxfooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
//
|
||||
// TODO mettre cette section dans la base de données
|
||||
//
|
||||
|
||||
$modules["MAIN_MODULE_COMMANDE"][0] = "Module commande";
|
||||
$modules["MAIN_MODULE_COMMANDE"][1] = "MAIN_MODULE_COMMANDE";
|
||||
$modules["MAIN_MODULE_COMMANDE"][2] = MAIN_MODULE_COMMANDE;
|
||||
$modules["MAIN_MODULE_COMMANDE"][3] = "Module des gestion des commandes";
|
||||
|
||||
$modules["MAIN_MODULE_FACTURE"][0] = "Module facture";
|
||||
$modules["MAIN_MODULE_FACTURE"][1] = "MAIN_MODULE_FACTURE";
|
||||
$modules["MAIN_MODULE_FACTURE"][2] = MAIN_MODULE_FACTURE;
|
||||
$modules["MAIN_MODULE_FACTURE"][3] = "Module des gestion des factures";
|
||||
|
||||
$modules["MAIN_MODULE_PROPALE"][0] = "Module propale";
|
||||
$modules["MAIN_MODULE_PROPALE"][1] = "MAIN_MODULE_PROPALE";
|
||||
$modules["MAIN_MODULE_PROPALE"][2] = MAIN_MODULE_PROPALE;
|
||||
$modules["MAIN_MODULE_PROPALE"][3] = "Module des gestion des propositions commerciales";
|
||||
|
||||
$modules["MAIN_MODULE_FICHEINTER"][0] = "Module fiche intervention";
|
||||
$modules["MAIN_MODULE_FICHEINTER"][1] = "MAIN_MODULE_FICHEINTER";
|
||||
$modules["MAIN_MODULE_FICHEINTER"][2] = MAIN_MODULE_FICHEINTER;
|
||||
$modules["MAIN_MODULE_FICHEINTER"][3] = "Module des gestion des fiche d'intervention";
|
||||
|
||||
if ($action == 'set')
|
||||
{
|
||||
$sql = "REPLACE INTO llx_const SET name = '".$value."', value='1'";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$modules[$value][2] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'reset')
|
||||
{
|
||||
$sql = "REPLACE INTO llx_const SET name = '".$value."', value='0'";
|
||||
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$modules[$value][2] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
print_titre("Modules");
|
||||
|
||||
print '<table border="1" cellpadding="3" cellspacing="0">';
|
||||
print '<TR class="liste_titre">';
|
||||
print '<td>Nom</td>';
|
||||
print '<td>Info</td>';
|
||||
print '<td align="center">Activé</td>';
|
||||
print '<td> </td>';
|
||||
print "</TR>\n";
|
||||
|
||||
|
||||
foreach ($modules as $key => $value)
|
||||
{
|
||||
|
||||
$titre = $modules[$key][0];
|
||||
$const_name = $modules[$key][1];
|
||||
$const_value = $modules[$key][2];
|
||||
$desc = $modules[$key][3];
|
||||
|
||||
|
||||
print '<tr><td>';
|
||||
echo "$titre";
|
||||
print "</td><td>\n";
|
||||
echo "$desc";
|
||||
print '</td><td align="center">';
|
||||
|
||||
if ($const_value == 1)
|
||||
{
|
||||
print '<img src="/theme/'.$conf->theme.'/img/tick.png" border="0"></a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print " ";
|
||||
}
|
||||
|
||||
print '</td><td align="center">';
|
||||
|
||||
if ($const_value == 1)
|
||||
{
|
||||
print '<a href="modules.php?action=reset&value='.$const_name.'">Désactiver</a>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a href="modules.php?action=set&value='.$const_name.'">Activer</a>';
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
llxFooter();
|
||||
?>
|
||||
@ -32,6 +32,7 @@ function llxHeader($head = "", $urlp = "") {
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add("index.php", "Dolibarr");
|
||||
$menu->add_submenu("modules.php", "Modules");
|
||||
$menu->add_submenu("facture.php", "Factures");
|
||||
|
||||
$menu->add("boxes.php", "Boites");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user