Subversion Repositories eFlore/Applications.bibliobota

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 30
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 library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bbc_moteur_media.fonct.php,v 1.1 2005-11-23 10:22:25 jp_milcent Exp $
22
// CVS : $Id: bbc_moteur_media.fonct.php,v 1.1 2005/11/23 10:22:25 jp_milcent Exp $
23
/**
23
/**
24
* Fonctions de création du moteur de recherche des médias.
24
* Fonctions de création du moteur de recherche des médias.
25
*
25
*
26
* Contient les fonctions permettant de retourner l'affichage du moteur de recherche des média.
26
* Contient les fonctions permettant de retourner l'affichage du moteur de recherche des média.
27
* Valable pour le paramètre "media".
27
* Valable pour le paramètre "media".
28
*
28
*
29
*@package BiblioBota-Consultation
29
*@package BiblioBota-Consultation
30
*@subpackage Fonctions
30
*@subpackage Fonctions
31
//Auteur original :
31
//Auteur original :
32
*@author        Jean-Charles GRANGER <tela@vecteur.org>
32
*@author        Jean-Charles GRANGER <tela@vecteur.org>
33
//Autres auteurs :
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
35
*@copyright     Tela-Botanica 2000-2004
35
*@copyright     Tela-Botanica 2000-2004
36
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:22:25 $
36
*@version       $Revision: 1.1 $ $Date: 2005/11/23 10:22:25 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
 
43
 
44
 
44
 
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                           LISTE de FONCTIONS                                         |
47
// |                                           LISTE de FONCTIONS                                         |
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
 
49
 
50
/** Fonction mkengine() - Créé le moteur de recherche en XHTML pour les médias.
50
/** Fonction mkengine() - Créé le moteur de recherche en XHTML pour les médias.
51
*
51
*
52
* Fonction créant le moteur de recherche en XHTML pour le
52
* Fonction créant le moteur de recherche en XHTML pour le
53
* paramêtre "media".
53
* paramêtre "media".
54
*
54
*
55
* @return  string le XHTML du moteur de recherche permettant de récupérer les média.
55
* @return  string le XHTML du moteur de recherche permettant de récupérer les média.
56
*/
56
*/
57
function mkengine()
57
function mkengine()
58
{
58
{
59
    // Initialisation des variables globales
59
    // Initialisation des variables globales
60
    global $label_bbota, $tbl, $TabFinder, $nbr_total, $query_dom, $var_biblio;
60
    global $label_bbota, $tbl, $TabFinder, $nbr_total, $query_dom, $var_biblio;
61
    global $arg_0,$arg_1,$arg_2,$arg_3,$arg_4,$arg_5;
61
    global $arg_0,$arg_1,$arg_2,$arg_3,$arg_4,$arg_5;
62
    global $plugin_store;
62
    global $plugin_store;
63
    
63
    
64
    // Initialisation des variables
64
    // Initialisation des variables
65
    $url_courante = BB_URL_COURANTE_CONSULTATION;
65
    $url_courante = BB_URL_COURANTE_CONSULTATION;
66
    $retour = '';
66
    $retour = '';
67
    
67
    
68
    $tmp_titre = eregi_replace('_', ' ', BB_ARGUMENT_TITRE);
68
    $tmp_titre = eregi_replace('_', ' ', BB_ARGUMENT_TITRE);
69
    
69
    
70
    // Comptage du nombre total de données dans la table (hors CACHER = 1)
70
    // Comptage du nombre total de données dans la table (hors CACHER = 1)
71
    if ($var_biblio['limit_domain'] == 1) {
71
    if ($var_biblio['limit_domain'] == 1) {
72
        $add_domain_fr = ', '.$tbl['domaine_lk'];
72
        $add_domain_fr = ', '.$tbl['domaine_lk'];
73
        $add_domain_qu = ' AND B_I_IDITEM = B_DL_IDITEM AND B_DL_IDDOM = 1';
73
        $add_domain_qu = ' AND B_I_IDITEM = B_DL_IDITEM AND B_DL_IDDOM = 1';
74
    } else {
74
    } else {
75
        $add_domain_fr = '';
75
        $add_domain_fr = '';
76
        $add_domain_qu = '';
76
        $add_domain_qu = '';
77
    }
77
    }
78
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
78
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
79
        $requete =  'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
79
        $requete =  'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
80
                    'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
80
                    'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
81
                    'WHERE B_I_CACHER = 0 '.
81
                    'WHERE B_I_CACHER = 0 '.
82
                    'AND B_I_TYPLOG = 1 '.
82
                    'AND B_I_TYPLOG = 1 '.
83
                    'AND B_I_TYPPHY = 2 '.
83
                    'AND B_I_TYPPHY = 2 '.
84
                    $add_domain_qu.' '.
84
                    $add_domain_qu.' '.
85
                    $plugin_store['count_add_query'];
85
                    $plugin_store['count_add_query'];
86
    } else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
86
    } else if (BB_ARGUMENT_REGROUPEMENT == 'media') {
87
        $requete =  'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
87
        $requete =  'SELECT DISTINCT COUNT(B_I_IDITEM) AS CPT '.
88
                    'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
88
                    'FROM '.$tbl['item'].$add_domain_fr.$plugin_store['count_add_table'].' '.
89
                    'WHERE B_I_CACHER = 0 '.
89
                    'WHERE B_I_CACHER = 0 '.
90
                    'AND B_I_TYPPHY <> 2 '.
90
                    'AND B_I_TYPPHY <> 2 '.
91
                    $add_domain_qu.' '.
91
                    $add_domain_qu.' '.
92
                    $plugin_store['count_add_query'];
92
                    $plugin_store['count_add_query'];
93
    }
93
    }
94
    // DEBOGAGE : pour voir la requete de comptage
94
    // DEBOGAGE : pour voir la requete de comptage
95
    //$GLOBALS['_DEBOGAGE_'] .= $requete.'<br>';
95
    //$GLOBALS['_DEBOGAGE_'] .= $requete.'<br>';
96
    $resultat = $GLOBALS['db_bb']->query($requete);
96
    $resultat = $GLOBALS['db_bb']->query($requete);
97
    (DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
97
    (DB::isError($resultat)) ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '';
98
    
98
    
99
    if ($resultat->numRows() == 1) {
99
    if ($resultat->numRows() == 1) {
100
        $tmp_nb = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
100
        $tmp_nb = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
101
        $nbr_total = $tmp_nb->CPT;
101
        $nbr_total = $tmp_nb->CPT;
102
        if ($nbr_total > 0) {
102
        if ($nbr_total > 0) {
103
            $chaine = 'parmi '.$nbr_total;
103
            $chaine = 'parmi '.$nbr_total;
104
        } else {
104
        } else {
105
            $retour .= presa_mk_title('Rechercher '.$tmp_titre, 1);
105
            $retour .= presa_mk_title('Rechercher '.$tmp_titre, 1);
106
            $retour .= '<p class="information">'.'Ce moteur de recherche ne contient aucune donnée...'.'</p>';
106
            $retour .= '<p class="information">'.'Ce moteur de recherche ne contient aucune donnée...'.'</p>';
107
            // Cette variable sert à éviter l'affichage de l'aide
107
            // Cette variable sert à éviter l'affichage de l'aide
108
            global $no_help;
108
            global $no_help;
109
            $no_help = 1;
109
            $no_help = 1;
110
            return $retour;
110
            return $retour;
111
        }
111
        }
112
    }
112
    }
113
    
113
    
114
    // Affichage du titre
114
    // Affichage du titre
115
    $retour .= presa_mk_title('Rechercher '.$chaine.' '.$tmp_titre.' :', 1);
115
    $retour .= presa_mk_title('Rechercher '.$chaine.' '.$tmp_titre.' :', 1);
116
    
116
    
117
    // Affichage du formulaire du moteur de recherche
117
    // Affichage du formulaire du moteur de recherche
118
    $retour .=  '<form id="bb_moteur_media" '.
118
    $retour .=  '<form id="bb_moteur_media" '.
119
                'action="'.$url_courante."&amp;arg_0=$arg_0&amp;arg_1=$arg_1&amp;arg_2=$arg_2&amp;arg_3=$arg_3&amp;arg_4=$arg_4&amp;arg_5=$arg_5".'" '.
119
                'action="'.$url_courante."&amp;arg_0=$arg_0&amp;arg_1=$arg_1&amp;arg_2=$arg_2&amp;arg_3=$arg_3&amp;arg_4=$arg_4&amp;arg_5=$arg_5".'" '.
120
                'method="post">'."\n";
120
                'method="post">'."\n";
121
    $retour .= '<ul>'."\n";
121
    $retour .= '<ul>'."\n";
122
    $resultat->free();// Fin comptage
122
    $resultat->free();// Fin comptage
123
    
123
    
124
    // Construction du moteur
124
    // Construction du moteur
125
    // Ligne de recherche 1
125
    // Ligne de recherche 1
126
    $retour .= '<li id="bb_moteur_media_01">'."\n";
126
    $retour .= '<li id="bb_moteur_media_01">'."\n";
127
    $retour .= form_mk_chaine(stripslashes($TabFinder['chaine'])).' '.form_mk_typque($TabFinder['typque']);
127
    $retour .= form_mk_chaine(stripslashes($TabFinder['chaine'])).' '.form_mk_typque($TabFinder['typque']);
128
    $retour .= '</li>'."\n";
128
    $retour .= '</li>'."\n";
129
    
129
    
130
    // Ligne de recherche 2
130
    // Ligne de recherche 2
131
    $retour .= '<li id="bb_moteur_media_02">'."\n".form_mk_auteur(stripslashes($TabFinder['auteur'])).'</li>'."\n";
131
    $retour .= '<li id="bb_moteur_media_02">'."\n".form_mk_auteur(stripslashes($TabFinder['auteur'])).'</li>'."\n";
132
    
132
    
133
    // Ligne de recherche 3
133
    // Ligne de recherche 3
134
    $retour .= '<li id="bb_moteur_media_03">'."\n".form_mk_categ($TabFinder['categ']).'</li>'."\n";
134
    $retour .= '<li id="bb_moteur_media_03">'."\n".form_mk_categ($TabFinder['categ']).'</li>'."\n";
135
    
135
    
136
    // Ligne de recherche 4
136
    // Ligne de recherche 4
137
    $retour .= '<li id="bb_moteur_media_04">'."\n";
137
    $retour .= '<li id="bb_moteur_media_04">'."\n";
138
    $retour .= form_mk_geo(stripslashes($TabFinder['geo'])).' ';
138
    $retour .= form_mk_geo(stripslashes($TabFinder['geo'])).' ';
139
    if (BB_ARGUMENT_REGROUPEMENT == 'media') {
139
    if (BB_ARGUMENT_REGROUPEMENT == 'media') {
140
        $retour .= form_mk_categ_3($TabFinder['categ_3']).' '.form_mk_categ_2($TabFinder['categ_2']);
140
        $retour .= form_mk_categ_3($TabFinder['categ_3']).' '.form_mk_categ_2($TabFinder['categ_2']);
141
    }
141
    }
142
    $retour .= '</li>'."\n";
142
    $retour .= '</li>'."\n";
143
    
143
    
144
    // Mode avancée
144
    // Mode avancée
145
    if ($TabFinder['finder_mode'] == 'advance') {
145
    if ($TabFinder['finder_mode'] == 'advance') {
146
        $retour .= '<li id="bb_moteur_media_05">'."\n".form_mk_since($TabFinder['since']).'</li>'."\n";
146
        $retour .= '<li id="bb_moteur_media_05">'."\n".form_mk_since($TabFinder['since']).'</li>'."\n";
147
        
147
        
148
        // Lignes de regroupement (frequente)
148
        // Lignes de regroupement (frequente)
149
        $retour .= '<li id="bb_moteur_media_06">'."\n".form_mk_step($TabFinder['step']).'</li>'."\n";
149
        $retour .= '<li id="bb_moteur_media_06">'."\n".form_mk_step($TabFinder['step']).'</li>'."\n";
150
        $retour .= '<li id="bb_moteur_media_07">'."\n".form_mk_sort($TabFinder['sort']).'</li>'."\n";
150
        $retour .= '<li id="bb_moteur_media_07">'."\n".form_mk_sort($TabFinder['sort']).'</li>'."\n";
151
    }
151
    }
152
    
152
    
153
    $retour .= '<li id="bb_moteur_media_08" class="bb_aligner_droite">'."\n";
153
    $retour .= '<li id="bb_moteur_media_08" class="bb_aligner_droite">'."\n";
154
    
154
    
155
    $retour .= form_mk_plugin($TabFinder['plugin']).form_mk_advance().' '.form_mk_submit()."\n";
155
    $retour .= form_mk_plugin($TabFinder['plugin']).form_mk_advance().' '.form_mk_submit()."\n";
156
    $retour .= '</li>'."\n";
156
    $retour .= '</li>'."\n";
157
    
157
    
158
    $retour .= '</ul>'."\n";
158
    $retour .= '</ul>'."\n";
159
    $retour .= '</form>'."\n";
159
    $retour .= '</form>'."\n";
160
    
160
    
161
    // Ajout de liens pour les moteurs de recherche
161
    // Ajout de liens pour les moteurs de recherche
162
    // Premier lien...
162
    // Premier lien...
163
    $retour .= '<p>'."\n";
163
    $retour .= '<p>'."\n";
164
    $link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
164
    $link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
165
    $link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
165
    $link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
166
    $retour .= '   <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
166
    $retour .= '   <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
167
    
167
    
168
    // Second lien...
168
    // Second lien...
169
    $link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
169
    $link = $url_courante.'&amp;TransTab=typque,1!valid,1!finder_mode,normal!sort,B_I_AUTEURS!';
170
    $link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
170
    $link .= 'pstart,0!step,20!pend,231!plugin,!geo,!chaine,!auteur,!categ,!categ_2,!categ_3,!since,!nom,!prenom,!ville,!dept,!pays,!cotisant,!mail,!';
171
    $retour .= '   <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
171
    $retour .= '   <a href="'.$link.'" style="visibility:hidden;">all</a>'."\n";
172
    $retour .= '</p>'."\n";
172
    $retour .= '</p>'."\n";
173
    
173
    
174
    return $retour;
174
    return $retour;
175
}
175
}
176
 
176
 
177
 
177
 
178
// form_mk_sort($actualsort,$class) :
178
// form_mk_sort($actualsort,$class) :
179
// fonction spécifique du moteur MEDIA
179
// fonction spécifique du moteur MEDIA
180
// créé une liste déroulante TabFinder[sort] pour ordonner les pages de résultats
180
// créé une liste déroulante TabFinder[sort] pour ordonner les pages de résultats
181
// Entrée : $actualsort (valeur de TabFinder['sort']), $class (classe CSS) par défaut "insInputForm"
181
// Entrée : $actualsort (valeur de TabFinder['sort']), $class (classe CSS) par défaut "insInputForm"
182
// Sortie (par retour) : string
182
// Sortie (par retour) : string
183
function form_mk_sort($actualsort, $class = 'bb_champ')
183
function form_mk_sort($actualsort, $class = 'bb_champ')
184
{
184
{
185
    global $TabFinder;
185
    global $TabFinder;
186
    $retour = '';
186
    $retour = '';
187
    $id = 'TabFinder[sort]';
187
    $id = 'TabFinder[sort]';
188
    
188
    
189
    $retour .= '<label for="'.$id.'">'.'Trier par : '.'</label>';
189
    $retour .= '<label for="'.$id.'">'.'Trier par : '.'</label>';
190
    $retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
190
    $retour .= '<select id="'.$id.'" name="'.$id.'" class="'.$class.'">'."\n";
191
    
191
    
192
    $retour .= '   <option value="B_I_AUTEURS" ';
192
    $retour .= '   <option value="B_I_AUTEURS" ';
193
    if ($actualsort == 'B_I_AUTEURS') {
193
    if ($actualsort == 'B_I_AUTEURS') {
194
        $retour .= 'selected="selected"';
194
        $retour .= 'selected="selected"';
195
    }
195
    }
196
    $retour .= '>'.'auteur(s)'.'</option>'."\n";
196
    $retour .= '>'.'auteur(s)'.'</option>'."\n";
197
    
197
    
198
    $retour .= '   <option value="B_I_TITRE" ';
198
    $retour .= '   <option value="B_I_TITRE" ';
199
    if ($actualsort == 'B_I_TITRE') {
199
    if ($actualsort == 'B_I_TITRE') {
200
        $retour .= 'selected="selected"';
200
        $retour .= 'selected="selected"';
201
    }
201
    }
202
    $retour .= '>'.'titre'.'</option>'."\n";
202
    $retour .= '>'.'titre'.'</option>'."\n";
203
    
203
    
204
    if (BB_ARGUMENT_REGROUPEMENT == 'media') {
204
    if (BB_ARGUMENT_REGROUPEMENT == 'media') {
205
        $retour .= '   <option value="B_I_TYPLOG" ';
205
        $retour .= '   <option value="B_I_TYPLOG" ';
206
        if ($actualsort == 'B_I_TYPLOG') {
206
        if ($actualsort == 'B_I_TYPLOG') {
207
            $retour .= 'selected="selected"';
207
            $retour .= 'selected="selected"';
208
        }
208
        }
209
        $retour .= '>'.'type de contenu'.'</option>'."\n";
209
        $retour .= '>'.'type de contenu'.'</option>'."\n";
210
        
210
        
211
        $retour .= '   <option value="B_I_TYPPHY" ';
211
        $retour .= '   <option value="B_I_TYPPHY" ';
212
        if ($actualsort == 'B_I_TYPPHY') {
212
        if ($actualsort == 'B_I_TYPPHY') {
213
            $retour .= 'selected="selected"';
213
            $retour .= 'selected="selected"';
214
        }
214
        }
215
        $retour .= '>'.'type de support'.'</option>'."\n";
215
        $retour .= '>'.'type de support'.'</option>'."\n";
216
    }
216
    }
217
    
217
    
218
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
218
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
219
        $le_champ = 'B_F_DATE';
219
        $le_champ = 'B_F_DATE';
220
    } else {
220
    } else {
221
        $le_champ = 'B_M_DATE';
221
        $le_champ = 'B_M_DATE';
222
    }
222
    }
223
    
223
    
224
    $retour .= '   <option value="'.$le_champ.'" ';
224
    $retour .= '   <option value="'.$le_champ.'" ';
225
    if ($actualsort == $le_champ) {
225
    if ($actualsort == $le_champ) {
226
        $retour .= 'selected';
226
        $retour .= 'selected';
227
    }
227
    }
228
    $retour .= '>'.'date'.'</option>'."\n";
228
    $retour .= '>'.'date'.'</option>'."\n";
229
    
229
    
230
    $retour .= '</select>'."\n\n";
230
    $retour .= '</select>'."\n\n";
231
    
231
    
232
    return $retour;
232
    return $retour;
233
}
233
}
234
 
234
 
235
 
235
 
236
// form_mk_categ($actualsort,$class) :
236
// form_mk_categ($actualsort,$class) :
237
// fonction spécifique du moteur LINK
237
// fonction spécifique du moteur LINK
238
// créé une liste déroulante TabFinder[categ] pour affiner les résultats
238
// créé une liste déroulante TabFinder[categ] pour affiner les résultats
239
// Entrée : $actualcateg (valeur de TabFinder['categ']), $class (classe CSS) par défaut "insInputForm"
239
// Entrée : $actualcateg (valeur de TabFinder['categ']), $class (classe CSS) par défaut "insInputForm"
240
// Sortie (par retour) : string
240
// Sortie (par retour) : string
241
function form_mk_categ($actualcateg, $class = 'bb_champ')
241
function form_mk_categ($actualcateg, $class = 'bb_champ')
242
{
242
{
243
    global $tbl, $TabFinder, $plugin_store;
243
    global $tbl, $TabFinder, $plugin_store;
244
    $retour = '';
244
    $retour = '';
245
    $id = 'TabFinder[categ]';
245
    $id = 'TabFinder[categ]';
246
    
246
    
247
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
247
    if (BB_ARGUMENT_REGROUPEMENT == 'article') {
248
        // Affichage du réducteur - collections
248
        // Affichage du réducteur - collections
249
        $requete =  'SELECT B_C_CRAI, B_C_NOMCOMPLET, B_C_ABREGE '.
249
        $requete =  'SELECT B_C_CRAI, B_C_NOMCOMPLET, B_C_ABREGE '.
250
                    'FROM '.$tbl['collection'].', '.$tbl['serie'].$plugin_store['categ_add_table'].' '.
250
                    'FROM '.$tbl['collection'].', '.$tbl['serie'].$plugin_store['categ_add_table'].' '.
251
                    'WHERE B_C_CRAI = B_SER_CRAICOLL '.
251
                    'WHERE B_C_CRAI = B_SER_CRAICOLL '.
252
                    'AND B_SER_INTOBIBLIO = 1 '.
252
                    'AND B_SER_INTOBIBLIO = 1 '.
253
                    $plugin_store['categ_add_query'].
253
                    $plugin_store['categ_add_query'].
254
                    'GROUP BY B_C_CRAI '.
254
                    'GROUP BY B_C_CRAI '.
255
                    'ORDER BY B_C_NOMCOMPLET';
255
                    'ORDER BY B_C_NOMCOMPLET';
256
        $result_str = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
256
        $result_str = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
257
        $nb_results = mysql_num_rows($result_str);
257
        $nb_results = mysql_num_rows($result_str);
258
        
258
        
259
        $retour .= '<label for="'.$id.'">'.'Dans :'.'</label>';
259
        $retour .= '<label for="'.$id.'">'.'Dans :'.'</label>';
260
        $retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
260
        $retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
261
        
261
        
262
        if ($nb_results > 1) {
262
        if ($nb_results > 1) {
263
            $retour .= '   <option value=""';
263
            $retour .= '   <option value=""';
264
            if ($actualcateg == '') {
264
            if ($actualcateg == '') {
265
                $retour .= ' selected="selected"';
265
                $retour .= ' selected="selected"';
266
            }
266
            }
267
            $retour .= '>Toutes les revues</option>'."\n";
267
            $retour .= '>Toutes les revues</option>'."\n";
268
        }
268
        }
269
        
269
        
270
        while ($row = mysql_fetch_object($result_str)) {
270
        while ($row = mysql_fetch_object($result_str)) {
271
            $collection = $row->B_C_NOMCOMPLET;
271
            $collection = $row->B_C_NOMCOMPLET;
272
            $abrege = $row->B_C_ABREGE;
272
            $abrege = $row->B_C_ABREGE;
273
            $crai = $row->B_C_CRAI;
273
            $crai = $row->B_C_CRAI;
274
            $retour .= '<option value="'.$crai.'"';
274
            $retour .= '<option value="'.$crai.'"';
275
            if ($actualcateg == $crai) {
275
            if ($actualcateg == $crai) {
276
                $retour .= ' selected="selected"';
276
                $retour .= ' selected="selected"';
277
            }
277
            }
278
            $retour .= '>';
278
            $retour .= '>';
279
            
279
            
280
            if ($abrege == '') {
280
            if ($abrege == '') {
281
                $retour .= $collection;
281
                $retour .= $collection;
282
            } else {
282
            } else {
283
                $retour .= $abrege;
283
                $retour .= $abrege;
284
            }
284
            }
285
            $retour .= '</option>'."\n";
285
            $retour .= '</option>'."\n";
286
        }
286
        }
287
        $retour .= '   </select>'."\n\n";
287
        $retour .= '   </select>'."\n\n";
288
        mysql_free_result($result_str);
288
        mysql_free_result($result_str);
289
    } else {
289
    } else {
290
        global $var_biblio;
290
        global $var_biblio;
291
        // on recherche ici les éditeurs de médias
291
        // on recherche ici les éditeurs de médias
292
        // si les médias sont autre chose que des livres, on affine
292
        // si les médias sont autre chose que des livres, on affine
293
        // la liste en ne proposant que les éditeurs publiant des médias.
293
        // la liste en ne proposant que les éditeurs publiant des médias.
294
        $requete =  'SELECT B_M_EDITEUR '.
294
        $requete =  'SELECT B_M_EDITEUR '.
295
                    'FROM '.$tbl['media'].', '.$tbl['item'].$plugin_store['categ_add_table'].' '.
295
                    'FROM '.$tbl['media'].', '.$tbl['item'].$plugin_store['categ_add_table'].' '.
296
                    'WHERE B_I_IDITEM = B_M_IDMEDIA '.
296
                    'WHERE B_I_IDITEM = B_M_IDMEDIA '.
297
                    $plugin_store['categ_add_query'].' '.
297
                    $plugin_store['categ_add_query'].' '.
298
                    'GROUP BY B_M_EDITEUR '.
298
                    'GROUP BY B_M_EDITEUR '.
299
                    'ORDER BY B_M_EDITEUR';
299
                    'ORDER BY B_M_EDITEUR';
300
        $do_editeur_qu = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
300
        $do_editeur_qu = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
301
        $nb_edresults = mysql_num_rows($do_editeur_qu);
301
        $nb_edresults = mysql_num_rows($do_editeur_qu);
302
        
302
        
303
        if ($var_biblio['how_editeurs'] >= $nb_edresults) {
303
        if ($var_biblio['how_editeurs'] >= $nb_edresults) {
304
            // nb de résultats < $how_editeurs
304
            // nb de résultats < $how_editeurs
305
            // on affiche une liste déroulante
305
            // on affiche une liste déroulante
306
            $retour .= '<label for="'.$id.'">'.'Pour :'.'</label>';
306
            $retour .= '<label for="'.$id.'">'.'Pour :'.'</label>';
307
            $retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
307
            $retour .= '<select name="'.$id.'" class="'.$class.'">'."\n";
308
            if ($nb_edresults > 1) {
308
            if ($nb_edresults > 1) {
309
                $retour .= '<option value=""';
309
                $retour .= '<option value=""';
310
                if ($actualcateg == '') {
310
                if ($actualcateg == '') {
311
                    $retour .= ' selected="selected"';
311
                    $retour .= ' selected="selected"';
312
                }
312
                }
313
                $retour .= '>';
313
                $retour .= '>';
314
                $retour .= 'tous éditeurs';
314
                $retour .= 'tous éditeurs';
315
                $retour .= '</option>'."\n";
315
                $retour .= '</option>'."\n";
316
            }
316
            }
317
            while ($row_ed = mysql_fetch_object($do_editeur_qu)) {
317
            while ($row_ed = mysql_fetch_object($do_editeur_qu)) {
318
                $tmp_id = $row_ed->B_M_EDITEUR;
318
                $tmp_id = $row_ed->B_M_EDITEUR;
319
                
319
                
320
                if ($tmp_id != '') {
320
                if ($tmp_id != '') {
321
                    $retour .= '<option value="'.stripslashes($tmp_id).'"';
321
                    $retour .= '<option value="'.stripslashes($tmp_id).'"';
322
                    if (stripslashes(stripslashes($actualcateg)) == $tmp_id) {
322
                    if (stripslashes(stripslashes($actualcateg)) == $tmp_id) {
323
                        $retour .= ' selected="selected"';
323
                        $retour .= ' selected="selected"';
324
                    }
324
                    }
325
                    $retour .= '>';
325
                    $retour .= '>';
326
                    $retour .= stripslashes($tmp_id);
326
                    $retour .= stripslashes($tmp_id);
327
                } else {
327
                } else {
328
                    $retour .= '<option value="VIDE"';
328
                    $retour .= '<option value="VIDE"';
329
                    if (($actualcateg == 'NULL') && ($actualcateg != '')) {
329
                    if (($actualcateg == 'NULL') && ($actualcateg != '')) {
330
                        $retour .= ' selected="selected"';
330
                        $retour .= ' selected="selected"';
331
                    }
331
                    }
332
                    $retour .= '>';
332
                    $retour .= '>';
333
                    $retour .= 'éditeurs inconnus';
333
                    $retour .= 'éditeurs inconnus';
334
                }
334
                }
335
                $retour .= '</option>'."\n";
335
                $retour .= '</option>'."\n";
336
            }
336
            }
337
            $retour .= '   </select>';
337
            $retour .= '   </select>';
338
        } else {
338
        } else {
339
            // nb de résultats > $how_editeurs
339
            // nb de résultats > $how_editeurs
340
            // on affiche une zone de texte
340
            // on affiche une zone de texte
341
            $retour .= '<label for="'.$id.'">'.'Éditeur :'.'</label>';
341
            $retour .= '<label for="'.$id.'">'.'Éditeur :'.'</label>';
342
            $retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$TabFinder['categ'].'" />'."\n";
342
            $retour .= '<input type="text" id="'.$id.'" name="'.$id.'" class="'.$class.'" value="'.$TabFinder['categ'].'" />'."\n";
343
        }
343
        }
344
        mysql_free_result($do_editeur_qu);
344
        mysql_free_result($do_editeur_qu);
345
    }
345
    }
346
    return $retour;
346
    return $retour;
347
}
347
}
348
 
348
 
349
 
349
 
350
// form_mk_categ_2($actualcateg_2,$class) :
350
// form_mk_categ_2($actualcateg_2,$class) :
351
// fonction spécifique du moteur MEDIA
351
// fonction spécifique du moteur MEDIA
352
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
352
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
353
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
353
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
354
// Sortie (par retour) : string
354
// Sortie (par retour) : string
355
 
355
 
356
function form_mk_categ_2($actualcateg_2, $class = 'bb_champ')
356
function form_mk_categ_2($actualcateg_2, $class = 'bb_champ')
357
{
357
{
358
    global $tbl;
358
    global $tbl;
359
    $retour = '';
359
    $retour = '';
360
    $requete =  'SELECT * '.
360
    $requete =  'SELECT * '.
361
                'FROM '.$tbl['item_typphy'].' '.
361
                'FROM '.$tbl['item_typphy'].' '.
362
                'WHERE B_IP_ID <> 2 '.
362
                'WHERE B_IP_ID <> 2 '.
363
                'ORDER BY B_IP_LABEL DESC';
363
                'ORDER BY B_IP_LABEL DESC';
364
    $type_phy_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
364
    $type_phy_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
365
    $retour .= '<select name="TabFinder[categ_2]" class="'.$class.'">'."\n";
365
    $retour .= '<select name="TabFinder[categ_2]" class="'.$class.'">'."\n";
366
    
366
    
367
    $retour .= '<option value=""';
367
    $retour .= '<option value=""';
368
    if ($actualcateg_2 == '') {
368
    if ($actualcateg_2 == '') {
369
        $retour .= ' selected="selected"';
369
        $retour .= ' selected="selected"';
370
    }
370
    }
371
    $retour .= '>';
371
    $retour .= '>';
372
    $retour .= 'tous supports';
372
    $retour .= 'tous supports';
373
    $retour .= '</option>'."\n";
373
    $retour .= '</option>'."\n";
374
    
374
    
375
    while ($row_phy = mysql_fetch_object($type_phy_do)) {
375
    while ($row_phy = mysql_fetch_object($type_phy_do)) {
376
        $tmp_label = $row_phy->B_IP_LABEL;
376
        $tmp_label = $row_phy->B_IP_LABEL;
377
        $tmp_id = $row_phy->B_IP_ID;
377
        $tmp_id = $row_phy->B_IP_ID;
378
        
378
        
379
        $this_number = (count_num_of_reductor('B_I_TYPPHY', $tmp_id));
379
        $this_number = (count_num_of_reductor('B_I_TYPPHY', $tmp_id));
380
        
380
        
381
        if ($this_number > 0) {
381
        if ($this_number > 0) {
382
            $retour .= '<option value="'.$tmp_id.'"';
382
            $retour .= '<option value="'.$tmp_id.'"';
383
            if ($actualcateg_2 == $tmp_id) {
383
            if ($actualcateg_2 == $tmp_id) {
384
                $retour .= ' selected="selected"';
384
                $retour .= ' selected="selected"';
385
            }
385
            }
386
            $retour .= '>';
386
            $retour .= '>';
387
            $retour .= $tmp_label.' ('.$this_number.')';
387
            $retour .= $tmp_label.' ('.$this_number.')';
388
            $retour .= '</option>'."\n";
388
            $retour .= '</option>'."\n";
389
        }
389
        }
390
    }
390
    }
391
    $retour .= '   </select>';
391
    $retour .= '   </select>';
392
    mysql_free_result($type_phy_do);
392
    mysql_free_result($type_phy_do);
393
    
393
    
394
    return $retour;
394
    return $retour;
395
}
395
}
396
 
396
 
397
 
397
 
398
// form_mk_categ_2($actualcateg_2,$class) :
398
// form_mk_categ_2($actualcateg_2,$class) :
399
// fonction spécifique du moteur MEDIA
399
// fonction spécifique du moteur MEDIA
400
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
400
// créé une liste déroulante TabFinder[categ_2] pour affiner les résultats
401
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
401
// Entrée : $actualcateg_2 (valeur de TabFinder['categ_2']), $class (classe CSS) par défaut "insInputForm"
402
// Sortie (par retour) : string
402
// Sortie (par retour) : string
403
function form_mk_categ_3($actualcateg_3, $class = 'bb_champ')
403
function form_mk_categ_3($actualcateg_3, $class = 'bb_champ')
404
{
404
{
405
    global $tbl;
405
    global $tbl;
406
    $retour = '';
406
    $retour = '';
407
    
407
    
408
    $requete =  'SELECT * '.
408
    $requete =  'SELECT * '.
409
                'FROM '.$tbl['item_typlog'].' '.
409
                'FROM '.$tbl['item_typlog'].' '.
410
                'ORDER BY B_IL_LABEL';
410
                'ORDER BY B_IL_LABEL';
411
    $type_log_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
411
    $type_log_do = mysql_query($requete) or die(BOG_afficherErreurSql(__FILE__, __LINE__, mysql_error(), $requete));
412
    
412
    
413
    $retour .= '<select name="TabFinder[categ_3]" class="'.$class.'">'."\n";
413
    $retour .= '<select name="TabFinder[categ_3]" class="'.$class.'">'."\n";
414
    
414
    
415
    $retour .= '<option value=""';
415
    $retour .= '<option value=""';
416
    if ($actualcateg_3 == '') {
416
    if ($actualcateg_3 == '') {
417
        $retour .= ' selected="selected"';
417
        $retour .= ' selected="selected"';
418
    }
418
    }
419
    $retour .= '>';
419
    $retour .= '>';
420
    $retour .= 'tous contenus';
420
    $retour .= 'tous contenus';
421
    $retour .= '</option>'."\n";
421
    $retour .= '</option>'."\n";
422
    
422
    
423
    while ($row_phy = mysql_fetch_object($type_log_do)) {
423
    while ($row_phy = mysql_fetch_object($type_log_do)) {
424
        $tmp_label = $row_phy->B_IL_LABEL;
424
        $tmp_label = $row_phy->B_IL_LABEL;
425
        $tmp_id = $row_phy->B_IL_ID;
425
        $tmp_id = $row_phy->B_IL_ID;
426
        
426
        
427
        $this_number = (count_num_of_reductor('B_I_TYPLOG', $tmp_id));
427
        $this_number = (count_num_of_reductor('B_I_TYPLOG', $tmp_id));
428
        
428
        
429
        if ($this_number > 0) {
429
        if ($this_number > 0) {
430
            $retour .= '<option value="'.$tmp_id.'"';
430
            $retour .= '<option value="'.$tmp_id.'"';
431
            if ($actualcateg_3 == $tmp_id) {
431
            if ($actualcateg_3 == $tmp_id) {
432
                $retour .= ' selected="selected"';
432
                $retour .= ' selected="selected"';
433
            }
433
            }
434
            $retour .= '>';
434
            $retour .= '>';
435
            $retour .= "$tmp_label ($this_number)";
435
            $retour .= "$tmp_label ($this_number)";
436
            $retour .= '</option>'."\n";
436
            $retour .= '</option>'."\n";
437
        }
437
        }
438
    }
438
    }
439
    
439
    
440
    $retour .= '   </select>';
440
    $retour .= '   </select>';
441
    mysql_free_result($type_log_do);
441
    mysql_free_result($type_log_do);
442
    
442
    
443
    return $retour;
443
    return $retour;
444
}
444
}
445
 
445
 
446
/* +--Fin du code ----------------------------------------------------------------------------------------+
446
/* +--Fin du code ----------------------------------------------------------------------------------------+
447
*
447
*
448
* $Log: not supported by cvs2svn $
448
* $Log: bbc_moteur_media.fonct.php,v $
-
 
449
* Revision 1.1  2005/11/23 10:22:25  jp_milcent
-
 
450
* Ajout au dépot de l'application BiblioBota.
-
 
451
* Elle doit à terme migrer dans eFlore.
-
 
452
*
449
* Revision 1.5  2005/05/17 10:10:08  jpm
453
* Revision 1.5  2005/05/17 10:10:08  jpm
450
* Correction des bogues avant mise en ligne du site v4.
454
* Correction des bogues avant mise en ligne du site v4.
451
*
455
*
452
* Revision 1.4  2005/03/03 08:32:26  jpm
456
* Revision 1.4  2005/03/03 08:32:26  jpm
453
* Suppression de li vide.
457
* Suppression de li vide.
454
*
458
*
455
* Revision 1.3  2004/09/14 11:49:28  jpm
459
* Revision 1.3  2004/09/14 11:49:28  jpm
456
* Ajout de l'info sur les logs cvs en bas de fichier.
460
* Ajout de l'info sur les logs cvs en bas de fichier.
457
*
461
*
458
*
462
*
459
* +-- Fin du code ----------------------------------------------------------------------------------------+
463
* +-- Fin du code ----------------------------------------------------------------------------------------+
460
*/
464
*/
461
?>
465
?>