Uniformisation du code par utilisation de la fonction dolibarr_set_const
This commit is contained in:
parent
780d7cb77b
commit
4e85b65115
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
|
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -16,7 +17,6 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id$
|
||||||
* $Source$
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,39 +33,27 @@ $langs->load("admin");
|
|||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
// Action activation d'un sous module du module adhérent
|
// Action activation d'un sous module du module adhérent
|
||||||
if ($_POST["action"] == 'set')
|
if ($_POST["action"] == 'set')
|
||||||
{
|
{
|
||||||
$name = "EDITEUR_LIVRE_FORMAT_".time();
|
$name = "EDITEUR_LIVRE_FORMAT_".time();
|
||||||
|
dolibarr_set_const($db, $name, $_POST["format"]);
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."const(name,value,visible) values ('".$name."','".addslashes($_POST["format"])."', 0);";
|
|
||||||
|
|
||||||
$result=$db->query($sql);
|
|
||||||
if ($result)
|
|
||||||
{
|
|
||||||
Header("Location: editeur.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Action désactivation d'un sous module du module adhérent
|
// Action désactivation d'un sous module du module adhérent
|
||||||
if ($_GET["action"] == 'unset')
|
if ($_GET["action"] == 'unset')
|
||||||
{
|
{
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%'";
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."const WHERE name LIKE 'EDITEUR_LIVRE_FORMAT_%'";
|
||||||
$sql .= " AND rowid='".$_GET["id"]."';";
|
$sql.= " AND rowid='".$_GET["id"]."';";
|
||||||
|
if ($db->query($sql))
|
||||||
if ($db->query($sql))
|
{
|
||||||
{
|
Header("Location: editeur.php");
|
||||||
Header("Location: editeur.php");
|
exit;
|
||||||
exit;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
llxHeader();
|
llxHeader();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user