301 |
jpm |
1 |
<?php
|
|
|
2 |
/*vim: set expandtab tabstop=4 shiftwidth=4: */
|
|
|
3 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
4 |
// | PHP version 4.1 |
|
|
|
5 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
6 |
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
|
|
|
7 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
8 |
// | This file is part of Papyrus. |
|
|
|
9 |
// | |
|
|
|
10 |
// | Foobar is free software; you can redistribute it and/or modify |
|
|
|
11 |
// | it under the terms of the GNU General Public License as published by |
|
|
|
12 |
// | the Free Software Foundation; either version 2 of the License, or |
|
|
|
13 |
// | (at your option) any later version. |
|
|
|
14 |
// | |
|
|
|
15 |
// | Foobar is distributed in the hope that it will be useful, |
|
|
|
16 |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
17 |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
18 |
// | GNU General Public License for more details. |
|
|
|
19 |
// | |
|
|
|
20 |
// | You should have received a copy of the GNU General Public License |
|
|
|
21 |
// | along with Foobar; if not, write to the Free Software |
|
|
|
22 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
|
|
23 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
24 |
// CVS : $Id: adap_application.fonct.php,v 1.1 2005-03-09 10:44:04 jpm Exp $
|
|
|
25 |
/**
|
|
|
26 |
* Contient les fonctions de l'appli admin_auth
|
|
|
27 |
*
|
|
|
28 |
*
|
|
|
29 |
*
|
|
|
30 |
*
|
|
|
31 |
*@package Admin_auth
|
|
|
32 |
*@subpackage Fonctions
|
|
|
33 |
//Auteur original :
|
|
|
34 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
|
|
35 |
//Autres auteurs :
|
|
|
36 |
*@author Aucun
|
|
|
37 |
*@copyright Tela-Botanica 2000-2004
|
|
|
38 |
*@version $Revision: 1.1 $
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
*/
|
|
|
41 |
|
|
|
42 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
43 |
// | LISTE de FONCTIONS |
|
|
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
45 |
|
|
|
46 |
/**
|
|
|
47 |
*
|
|
|
48 |
*
|
|
|
49 |
* @return
|
|
|
50 |
*/
|
|
|
51 |
|
|
|
52 |
function adap_supprimer_application($id_appl, &$db) {
|
|
|
53 |
$requete = "delete from gen_application where gap_id_application=$id_appl" ;
|
|
|
54 |
$resultat = $db->query ($requete) ;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
/**
|
|
|
58 |
*
|
|
|
59 |
*
|
|
|
60 |
* @return
|
|
|
61 |
*/
|
|
|
62 |
|
|
|
63 |
function adap_valeurs_par_defaut ($id_appl, &$db) {
|
|
|
64 |
// requete sur gen_site_auth
|
|
|
65 |
|
|
|
66 |
$requete = "select * from gen_application where gap_id_application=$id_appl" ;
|
|
|
67 |
$resultat = $db->query ($requete) ;
|
|
|
68 |
if (DB::isError ($resultat)) {
|
|
|
69 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(), E_USER_WARNING) ;
|
|
|
70 |
return ;
|
|
|
71 |
}
|
|
|
72 |
$tableau_retour = array () ;
|
|
|
73 |
$ligne = $resultat->fetchRow (DB_FETCHMODE_OBJECT) ;
|
|
|
74 |
$tableau_retour['nom_appl'] = $ligne->gap_nom ;
|
|
|
75 |
$tableau_retour['description'] = $ligne->gap_description ;
|
|
|
76 |
$tableau_retour['chemin'] = $ligne->gap_chemin ;
|
|
|
77 |
$tableau_retour['applette'] = $ligne->gap_bool_applette ;
|
|
|
78 |
unset ($requete, $resultat) ;
|
|
|
79 |
return $tableau_retour ;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
/**
|
|
|
83 |
*
|
|
|
84 |
*
|
|
|
85 |
* @return
|
|
|
86 |
*/
|
|
|
87 |
|
|
|
88 |
function insertion ($valeur, &$db) {
|
|
|
89 |
$id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ;
|
|
|
90 |
$requete = "insert into gen_application set gap_id_application="
|
|
|
91 |
.$id_appl_bdd.","
|
|
|
92 |
.requete_site_appl($valeur) ;
|
|
|
93 |
$resultat = $db->query ($requete) ;
|
|
|
94 |
if (DB::isError ($resultat)) {
|
|
|
95 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
96 |
}
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
/**
|
|
|
100 |
*
|
|
|
101 |
*
|
|
|
102 |
* @return
|
|
|
103 |
*/
|
|
|
104 |
|
|
|
105 |
function mise_a_jour ($valeur, &$db) {
|
|
|
106 |
$requete = "update gen_application set ".requete_site_appl($valeur)
|
|
|
107 |
.' where gap_id_application='.$GLOBALS['id_appl'] ;
|
|
|
108 |
$resultat = $db->query ($requete) ;
|
|
|
109 |
if (DB::isError ($resultat)) {
|
|
|
110 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
111 |
}
|
|
|
112 |
}
|
|
|
113 |
|
|
|
114 |
/**
|
|
|
115 |
*
|
|
|
116 |
*
|
|
|
117 |
* @return string un morceau de code SQL
|
|
|
118 |
*/
|
|
|
119 |
|
|
|
120 |
function requete_site_appl (&$valeur) {
|
|
|
121 |
return 'gap_nom="'.$valeur['nom_appl'].'", '
|
|
|
122 |
.'gap_description="'.$valeur['description'].'", '
|
|
|
123 |
.'gap_chemin="'.$valeur['chemin'].'", '
|
|
|
124 |
.'gap_bool_applette="'.$valeur['applette'].'"';
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
|
|
|
128 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
129 |
// | PIED du PROGRAMME |
|
|
|
130 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
131 |
|
|
|
132 |
|
|
|
133 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
134 |
*
|
|
|
135 |
* $Log: not supported by cvs2svn $
|
|
|
136 |
* Revision 1.2 2005/03/09 10:40:33 alex
|
|
|
137 |
* version initiale
|
|
|
138 |
*
|
|
|
139 |
* Revision 1.1 2004/12/13 18:07:28 alex
|
|
|
140 |
* version initiale
|
|
|
141 |
*
|
|
|
142 |
*
|
|
|
143 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
144 |
*/
|
|
|
145 |
?>
|