| Line 17... |
Line 17... |
| 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: annuaire.fonct.php,v 1.5 2007-01-04 16:34:31 alexandre_tb Exp $
|
22 |
// CVS : $Id: annuaire.fonct.php,v 1.6 2007-04-06 08:35:46 neiluj Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
* Fonctions du module annuaire
|
24 |
* Fonctions du module annuaire
|
| 25 |
*
|
25 |
*
|
| 26 |
* Fonctions du module annuaire
|
26 |
* Fonctions du module annuaire
|
| 27 |
*
|
27 |
*
|
| Line 29... |
Line 29... |
| 29 |
//Auteur original :
|
29 |
//Auteur original :
|
| 30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
30 |
*@author Alexandre Granier <alexandre@tela-botanica.org>
|
| 31 |
//Autres auteurs :
|
31 |
//Autres auteurs :
|
| 32 |
*@author Aucun
|
32 |
*@author Aucun
|
| 33 |
*@copyright Tela-Botanica 2000-2004
|
33 |
*@copyright Tela-Botanica 2000-2004
|
| 34 |
*@version $Revision: 1.5 $
|
34 |
*@version $Revision: 1.6 $
|
| 35 |
// +------------------------------------------------------------------------------------------------------+
|
35 |
// +------------------------------------------------------------------------------------------------------+
|
| 36 |
*/
|
36 |
*/
|
| Line 37... |
Line 37... |
| 37 |
|
37 |
|
| 38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
| 39 |
// | ENTETE du PROGRAMME |
|
39 |
// | ENTETE du PROGRAMME |
|
| Line 40... |
Line 40... |
| 40 |
// +------------------------------------------------------------------------------------------------------+
|
40 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 41... |
Line 41... |
| 41 |
|
41 |
|
| 42 |
//include_once "HTML/QuickForm.php" ;
|
42 |
include_once "HTML/QuickForm.php" ;
|
| 43 |
|
43 |
|
| Line 44... |
Line -... |
| 44 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
| 45 |
// | LISTE de FONCTIONS |
|
- |
|
| 46 |
// +------------------------------------------------------------------------------------------------------+
|
- |
|
| 47 |
|
- |
|
| 48 |
/** function inscription_onglets() Affiche les onglets de présentation de la structure
|
- |
|
| 49 |
*
|
- |
|
| 50 |
*
|
- |
|
| 51 |
*
|
- |
|
| 52 |
* @return string HTML
|
- |
|
| 53 |
*/
|
- |
|
| 54 |
function inscription_onglets() {
|
- |
|
| 55 |
$res='<ul id="onglets_inscription">'."\n";
|
- |
|
| 56 |
//partie présentation
|
- |
|
| 57 |
$GLOBALS['ins_url']->addQueryString('voir_fiche', $_GET['voir_fiche']);
|
- |
|
| 58 |
$res .= '<li id="fiche"><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_PRESENTATION.'</a>'."\n".'</li>'."\n";
|
- |
|
| 59 |
$GLOBALS['ins_url']->removeQueryString('voir_fiche');
|
- |
|
| 60 |
//partie abonnement
|
- |
|
| 61 |
$GLOBALS['ins_url']->addQueryString('voir_abonnement', $_GET['voir_fiche']);
|
- |
|
| 62 |
$res .= '<li id="abonnements"><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_ABONNEMENTS.'</a></li>'."\n" ;
|
- |
|
| 63 |
$GLOBALS['ins_url']->removeQueryString('voir_abonnement');
|
- |
|
| 64 |
//partie actualites
|
- |
|
| 65 |
$GLOBALS['ins_url']->addQueryString('voir_actus', $_GET['voir_fiche']);
|
- |
|
| 66 |
$res .= '<li id="actus"><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_ACTUALITES.'</a>'."\n".'</li>'."\n";
|
- |
|
| 67 |
$GLOBALS['ins_url']->removeQueryString('voir_actus');
|
- |
|
| 68 |
//partie ressources
|
- |
|
| 69 |
$GLOBALS['ins_url']->addQueryString('voir_ressources', $_GET['voir_fiche']);
|
- |
|
| 70 |
$res .= '<li id="ressources"><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_RESSOURCES.'</a>'."\n".'</li>'."\n";
|
- |
|
| 71 |
$GLOBALS['ins_url']->removeQueryString('voir_ressources');
|
- |
|
| 72 |
//partie competences
|
- |
|
| 73 |
$GLOBALS['ins_url']->addQueryString('voir_competences', $_GET['voir_fiche']);
|
- |
|
| 74 |
$res .= '<li id="competences"><a href="'.$GLOBALS['ins_url']->getURL().'">'.INS_COMPETENCES.'</a>'."\n".'</li>'."\n";
|
- |
|
| 75 |
$GLOBALS['ins_url']->removeQueryString('voir_competences');
|
- |
|
| 76 |
$res.= '</ul>'."\n";
|
44 |
// +------------------------------------------------------------------------------------------------------+
|
| 77 |
return $res;
|
45 |
// | LISTE de FONCTIONS |
|
| 78 |
}
|
46 |
// +------------------------------------------------------------------------------------------------------+
|
| 79 |
|
47 |
|
| 80 |
/** function Annuaire_recherche () Moteur de recherche dans l'annuaire des inscrits
|
48 |
/** function Annuaire_recherche () Moteur de recherche dans l'annuaire des inscrits
|
| 81 |
*
|
49 |
*
|
| - |
|
50 |
*
|
| 82 |
*
|
51 |
*
|
| 83 |
*
|
52 |
* @return string HTML
|
| 84 |
* @return string HTML
|
53 |
*/
|
| 85 |
*/
|
54 |
|
| 86 |
function Annuaire_recherche() {
|
55 |
function Annuaire_recherche() {
|
| Line 95... |
Line 64... |
| 95 |
' : </td>'."\n".
|
64 |
' : </td>'."\n".
|
| 96 |
'<td style="padding:5px;text-align:left;">{element}</td>'."\n".
|
65 |
'<td style="padding:5px;text-align:left;">{element}</td>'."\n".
|
| 97 |
'</tr>'."\n" );
|
66 |
'</tr>'."\n" );
|
| 98 |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan=2 style="padding:5px;">{label}{element}</td>'."\n".'</tr>'."\n", 'bouton_rechercher');
|
67 |
$squelette->setElementTemplate( '<tr>'."\n".'<td colspan=2 style="padding:5px;">{label}{element}</td>'."\n".'</tr>'."\n", 'bouton_rechercher');
|
| Line 99... |
Line 68... |
| 99 |
|
68 |
|
| - |
|
69 |
//$option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
|
| 100 |
// La liste deroulante pour choisir entre structure et individus
|
70 |
// '1' => INS_PERSONNES,
|
| - |
|
71 |
// '2' => INS_STRUCTURES);
|
| Line 101... |
Line -... |
| 101 |
// uniquement si la constante INS_FORMULAIRE_STRUCTURE vaut 1
|
- |
|
| 102 |
|
- |
|
| 103 |
if (INS_FORMULAIRE_STRUCTURE == 1) {
|
- |
|
| 104 |
$option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
|
- |
|
| 105 |
'1' => INS_PERSONNES,
|
- |
|
| 106 |
'2' => INS_STRUCTURES);
|
- |
|
| 107 |
$form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
|
72 |
$form->addElement('hidden', 'nom_type', 0);
|
| 108 |
}
|
73 |
|
| 109 |
//requete pour recuperer la liste des pays
|
74 |
//requete pour recuperer la liste des pays
|
| 110 |
$requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
|
75 |
$requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
|
| 111 |
$resultat = $GLOBALS['ins_db']->query($requete) ;
|
76 |
$resultat = $GLOBALS['ins_db']->query($requete) ;
|
| Line 139... |
Line 104... |
| 139 |
$form->setDefaults($defauts);
|
104 |
$form->setDefaults($defauts);
|
| Line 140... |
Line 105... |
| 140 |
|
105 |
|
| 141 |
//affichage du formulaire
|
106 |
//affichage du formulaire
|
| Line 142... |
Line -... |
| 142 |
$res .=$form->toHtml();
|
- |
|
| 143 |
|
- |
|
| 144 |
include_once INS_CHEMIN_APPLI.'/bibliotheque/bottin.class.php';
|
- |
|
| 145 |
// On ajoute la liste des lettres cliquables
|
- |
|
| 146 |
$lettre = new lettresAlphabet($GLOBALS['ins_url']) ;
|
- |
|
| 147 |
$res .= $lettre->toHMTL();
|
107 |
$res .=$form->toHtml();
|
| 148 |
|
108 |
|
| 149 |
//on teste si l'on affiche le resultat de la recherche ou
|
109 |
//on teste si l'on affiche le resultat de la recherche ou
|
| 150 |
if (isset($_POST['nom_type'])) {
|
110 |
if (isset($_POST['nom_type'])) {
|
| 151 |
$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
|
111 |
$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
|
| Line 183... |
Line 143... |
| 183 |
$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
143 |
$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
| 184 |
' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
144 |
' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
| 185 |
' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
145 |
' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
|
| 186 |
' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
|
146 |
' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
|
| 187 |
}
|
147 |
}
|
| 188 |
if (isset($_GET['lettre'])) {
|
- |
|
| 189 |
$requete .= 'AND '.INS_CHAMPS_NOM.'like "'.$_GET['lettre'].'%"';
|
- |
|
| 190 |
}
|
- |
|
| 191 |
if (!$req_where) $requete .= '1';
|
148 |
if (!$req_where) $requete .= '1';
|
| 192 |
$requete .=' ORDER BY '.INS_CHAMPS_NOM;
|
149 |
$requete .=' ORDER BY '.INS_CHAMPS_NOM;
|
| 193 |
$resultat = $GLOBALS['ins_db']->query($requete);
|
150 |
$resultat = $GLOBALS['ins_db']->query($requete);
|
| 194 |
if ($resultat->numRows()>0) {
|
151 |
if ($resultat->numRows()>0) {
|
| 195 |
$res .='<h2>'.INS_RESULTATS_RECHERCHE.' ('.$resultat->numRows().' '.INS_ENTREES.')</h2>'."\n";
|
152 |
$res .='<h2>'.INS_RESULTATS_RECHERCHE.' ('.$resultat->numRows().' '.INS_ENTREES.')</h2>'."\n";
|
| Line 303... |
Line 260... |
| 303 |
}
|
260 |
}
|
| Line 304... |
Line 261... |
| 304 |
|
261 |
|
| 305 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
262 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
| 306 |
*
|
263 |
*
|
| 307 |
* $Log: not supported by cvs2svn $
|
- |
|
| 308 |
* Revision 1.4 2006/04/10 14:01:36 florian
|
- |
|
| 309 |
* uniformisation de l'appli bottin: plus qu'un fichier de fonctions
|
- |
|
| 310 |
*
|
- |
|
| 311 |
* Revision 1.3 2006/04/04 12:23:05 florian
|
- |
|
| 312 |
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
|
- |
|
| 313 |
*
|
264 |
* $Log: not supported by cvs2svn $
|
| 314 |
* Revision 1.2 2005/09/29 16:13:54 alexandre_tb
|
265 |
* Revision 1.2 2005/09/29 16:13:54 alexandre_tb
|
| 315 |
* En cours de production.
|
266 |
* En cours de production.
|
| 316 |
*
|
267 |
*
|
| 317 |
* Revision 1.1 2005/09/22 14:02:49 ddelon
|
268 |
* Revision 1.1 2005/09/22 14:02:49 ddelon
|
| Line 334... |
Line 285... |
| 334 |
*
|
285 |
*
|
| 335 |
*
|
286 |
*
|
| 336 |
*
|
287 |
*
|
| 337 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
288 |
* +-- Fin du code ----------------------------------------------------------------------------------------+
|
| 338 |
*/
|
289 |
*/
|
| 339 |
?>
|
- |
|
| 340 |
|
290 |
?>
|
| - |
|
291 |
|