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 |
// +------------------------------------------------------------------------------------------------------+
|
1076 |
alexandre_ |
24 |
// CVS : $Id: adap_application.fonct.php,v 1.4 2006-12-01 10:39:14 alexandre_tb Exp $
|
301 |
jpm |
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
|
1076 |
alexandre_ |
38 |
*@version $Revision: 1.4 $
|
301 |
jpm |
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) {
|
923 |
jp_milcent |
53 |
$requete = 'DELETE FROM gen_application WHERE gap_id_application='.$id_appl;
|
301 |
jpm |
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 |
|
923 |
jp_milcent |
66 |
$requete = 'SELECT * FROM gen_application WHERE gap_id_application='.$id_appl ;
|
301 |
jpm |
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 |
unset ($requete, $resultat) ;
|
|
|
78 |
return $tableau_retour ;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
/**
|
|
|
82 |
*
|
|
|
83 |
*
|
|
|
84 |
* @return
|
|
|
85 |
*/
|
|
|
86 |
|
|
|
87 |
function insertion ($valeur, &$db) {
|
|
|
88 |
$id_appl_bdd = SQL_obtenirNouveauId ($db, 'gen_application', 'gap_id_application') ;
|
|
|
89 |
$requete = "insert into gen_application set gap_id_application="
|
|
|
90 |
.$id_appl_bdd.","
|
|
|
91 |
.requete_site_appl($valeur) ;
|
|
|
92 |
$resultat = $db->query ($requete) ;
|
|
|
93 |
if (DB::isError ($resultat)) {
|
|
|
94 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
95 |
}
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
/**
|
|
|
99 |
*
|
|
|
100 |
*
|
|
|
101 |
* @return
|
|
|
102 |
*/
|
|
|
103 |
|
|
|
104 |
function mise_a_jour ($valeur, &$db) {
|
|
|
105 |
$requete = "update gen_application set ".requete_site_appl($valeur)
|
923 |
jp_milcent |
106 |
.' WHERE gap_id_application='.$GLOBALS['id_appl'] ;
|
301 |
jpm |
107 |
$resultat = $db->query ($requete) ;
|
|
|
108 |
if (DB::isError ($resultat)) {
|
|
|
109 |
trigger_error("Echec de la requete : $requete<br />".$resultat->getMessage(),E_USER_WARNING) ;
|
|
|
110 |
}
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
/**
|
|
|
114 |
*
|
|
|
115 |
*
|
|
|
116 |
* @return string un morceau de code SQL
|
|
|
117 |
*/
|
|
|
118 |
|
|
|
119 |
function requete_site_appl (&$valeur) {
|
462 |
florian |
120 |
if (!isset($valeur['applette'])) {$valeur['applette']=0;}
|
|
|
121 |
return 'gap_nom="'.$valeur['nom_appl'].'", '
|
|
|
122 |
.'gap_description="'.$valeur['description'].'", '
|
1076 |
alexandre_ |
123 |
.'gap_chemin="'.$valeur['chemin'].'"';
|
301 |
jpm |
124 |
}
|
|
|
125 |
|
|
|
126 |
|
|
|
127 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
128 |
// | PIED du PROGRAMME |
|
|
|
129 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
130 |
|
|
|
131 |
|
|
|
132 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
|
|
133 |
*
|
|
|
134 |
* $Log: not supported by cvs2svn $
|
1076 |
alexandre_ |
135 |
* Revision 1.3 2006/09/07 13:28:39 jp_milcent
|
|
|
136 |
* Mise en majuscule des termes SQL et trie des application par ordre alphabétique.
|
|
|
137 |
*
|
923 |
jp_milcent |
138 |
* Revision 1.2 2005/09/23 15:02:38 florian
|
|
|
139 |
* correction de bugs
|
|
|
140 |
*
|
462 |
florian |
141 |
* Revision 1.1 2005/03/09 10:44:04 jpm
|
|
|
142 |
* Mise au norme du nom du fichier.
|
|
|
143 |
*
|
301 |
jpm |
144 |
* Revision 1.2 2005/03/09 10:40:33 alex
|
|
|
145 |
* version initiale
|
|
|
146 |
*
|
|
|
147 |
* Revision 1.1 2004/12/13 18:07:28 alex
|
|
|
148 |
* version initiale
|
|
|
149 |
*
|
|
|
150 |
*
|
|
|
151 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
|
|
152 |
*/
|
|
|
153 |
?>
|