Subversion Repositories Applications.papyrus

Rev

Rev 1076 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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