Subversion Repositories Applications.bazar

Rev

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

Rev 472 Rev 489
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: bazar.fonct.cal.php,v 1.29 2008-10-29 10:38:51 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.cal.php,v 1.29 2008-10-29 10:38:51 alexandre_tb Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions calendrier du module bazar
25
* Fonctions calendrier du module bazar
26
*
26
*
27
* TODO : ajouter la gestion du multilinguisme
27
* TODO : ajouter la gestion du multilinguisme
28
* 
28
* 
29
*@package bazar
29
*@package bazar
30
//Auteur original :
30
//Auteur original :
31
*@author        David Delon <david.delon@clapas.net>
31
*@author        David Delon <david.delon@clapas.net>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.29 $ $Date: 2008-10-29 10:38:51 $
34
*@version       $Revision: 1.29 $ $Date: 2008-10-29 10:38:51 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php';
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php';
43
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php';
43
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php';
44
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
44
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
45
 
45
 
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
// |                                           LISTE de FONCTIONS                                         |
47
// |                                           LISTE de FONCTIONS                                         |
48
// +------------------------------------------------------------------------------------------------------+
48
// +------------------------------------------------------------------------------------------------------+
49
 
49
 
50
// Classe Utilitaire pour Calendrier
50
// Classe Utilitaire pour Calendrier
51
class DiaryEvent extends Calendar_Decorator {
51
class DiaryEvent extends Calendar_Decorator {
52
	var $entry = array();
52
	var $entry = array();
53
	function DiaryEvent($calendar)
53
	function DiaryEvent($calendar)
54
	{
54
	{
55
		Calendar_Decorator::Calendar_Decorator($calendar);
55
		Calendar_Decorator::Calendar_Decorator($calendar);
56
	}
56
	}
57
	function setEntry($entry)
57
	function setEntry($entry)
58
	{
58
	{
59
		$this->entry[] = $entry;
59
		$this->entry[] = $entry;
60
		
60
		
61
	}
61
	}
62
	function getEntry()
62
	function getEntry()
63
	{
63
	{
64
		return $this->entry;
64
		return $this->entry;
65
	}
65
	}
66
} 
66
} 
67
 
67
 
68
 
68
 
69
// $type : calendrier
69
// $type : calendrier
70
// $type : calendrier_appplette
70
// $type : calendrier_appplette
71
function GestionAffichageCalendrier($arguments = array(), $type = 'calendrier') {
71
function GestionAffichageCalendrier($arguments = array(), $type = 'calendrier') {
72
	$script = '';
72
	$script = '';
73
	// recuperation des arguments de l applette
73
	// recuperation des arguments de l applette
74
	$balise = isset ($arguments[0]) ? $arguments[0] : '';
74
	$balise = isset ($arguments[0]) ? $arguments[0] : '';
75
    $tab_arguments = $arguments;
75
    $tab_arguments = $arguments;
76
	if (is_string ($tab_arguments)) {
76
	if (is_string ($tab_arguments)) {
77
		$tab_arguments = substr($tab_arguments, 1);
77
		$tab_arguments = substr($tab_arguments, 1);
78
	} else {
78
	} else {
79
		unset($tab_arguments[0]);	
79
		unset($tab_arguments[0]);	
80
	}
80
	}
81
	if (is_array($tab_arguments)) {
81
	if (is_array($tab_arguments)) {
82
	    foreach($tab_arguments as $argument) {
82
	    foreach($tab_arguments as $argument) {
83
	    	if ($argument != '') {
83
	    	if ($argument != '') {
84
		    	$tab_parametres = explode('=', $argument, 2);
84
		    	$tab_parametres = explode('=', $argument, 2);
85
		    	if (is_array($tab_parametres)) {
85
		    	if (is_array($tab_parametres)) {
86
		    		$options[$tab_parametres[0]] = 
86
		    		$options[$tab_parametres[0]] = 
87
		    		(isset($tab_parametres[1])? trim($tab_parametres[1], '"') : '') ;		    		
87
		    		(isset($tab_parametres[1])? trim($tab_parametres[1], '"') : '') ;		    		
88
		    	}
88
		    	}
89
	    	}
89
	    	}
90
	    }
90
	    }
91
	}
91
	}
92
    
92
    
93
    if (!isset($options['template'])) {
93
    if (!isset($options['template'])) {
94
		$options['template'] = BAZ_CHEMIN_SQUELETTE.BAZ_SQUELETTE_DEFAUT;
94
		$options['template'] = BAZ_CHEMIN_SQUELETTE.BAZ_SQUELETTE_DEFAUT;
95
	} else {
95
	} else {
96
		if (file_exists(BAZ_CHEMIN_SQUELETTE.$options['template'])) {
96
		if (file_exists(BAZ_CHEMIN_SQUELETTE.$options['template'])) {
97
			$options['template'] = BAZ_CHEMIN_SQUELETTE.$options['template'];
97
			$options['template'] = BAZ_CHEMIN_SQUELETTE.$options['template'];
98
		}
98
		}
99
	}
99
	}
100
    
100
    
101
	$retour = '';
101
	$retour = '';
102
 
102
 
103
	$url = $GLOBALS['_GEN_commun']['url'] ;
103
	$url = $GLOBALS['_GEN_commun']['url'] ;
104
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
104
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
105
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
105
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
106
	
106
	
107
	// Nettoyage de l'url de la query string
107
	// Nettoyage de l'url de la query string
108
	$chaine_url = $url->getQueryString();
108
	$chaine_url = $url->getQueryString();
109
	$tab_params = explode('&amp;', $chaine_url);
109
	$tab_params = explode('&amp;', $chaine_url);
110
	if (count($tab_params) == 0) {
110
	if (count($tab_params) == 0) {
111
		$tab_params = explode('&', $chaine_url);
111
		$tab_params = explode('&', $chaine_url);
112
	}
112
	}
113
	foreach ($tab_params as $param) {
113
	foreach ($tab_params as $param) {
114
		$tab_parametre = explode('=', $param);
114
		$tab_parametre = explode('=', $param);
115
		// note d'Aur�lien, si on nettoie l'URL on perd la vue en cours  
115
		// note d'Aur�lien, si on nettoie l'URL on perd la vue en cours  
116
		//$url->removeQueryString($tab_parametre[0]);
116
		//$url->removeQueryString($tab_parametre[0]);
117
	}
117
	}
118
	
118
	
119
	if (!isset($_GET['y'])) { 
119
	if (!isset($_GET['y'])) { 
120
		$_GET['y'] = date('Y');
120
		$_GET['y'] = date('Y');
121
	}
121
	}
122
	
122
	
123
	if (!isset($_GET['m'])) { 
123
	if (!isset($_GET['m'])) { 
124
		$_GET['m'] = date('m');
124
		$_GET['m'] = date('m');
125
	}
125
	}
126
	
126
	
127
	// 	Construction Mois en Cours 
127
	// 	Construction Mois en Cours 
128
	$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
128
	$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
129
 
129
 
130
	$curStamp = $month->getTimeStamp();
130
	$curStamp = $month->getTimeStamp();
131
	$url->addQueryString('y', date('Y',$curStamp));
131
	$url->addQueryString('y', date('Y',$curStamp));
132
	$url->addQueryString('m', date('n',$curStamp));
132
	$url->addQueryString('m', date('n',$curStamp));
133
	$url->addQueryString('d', date('j',$curStamp));
133
	$url->addQueryString('d', date('j',$curStamp));
134
	$cur = $url->getUrl();
134
	$cur = $url->getUrl();
135
 
135
 
136
	// Gestion de l'affichage du filtre des natures d'�v�nements
136
	// Gestion de l'affichage du filtre des natures d'�v�nements
137
	$cal_num_annonce = BAZ_NUM_ANNONCE_CALENDRIER;
137
	$cal_num_annonce = BAZ_NUM_ANNONCE_CALENDRIER;
138
	$ficnat_id = null;
138
	$ficnat_id = null;
139
	if (isset($_GET['ficnat']) && $_GET['ficnat'] != '*') {
139
	if (isset($_GET['ficnat']) && $_GET['ficnat'] != '*') {
140
		$ficnat_id = $_GET['ficnat'];
140
		$ficnat_id = $_GET['ficnat'];
141
		$url->addQueryString('ficnat', $_GET['ficnat']);
141
		$url->addQueryString('ficnat', $_GET['ficnat']);
142
		$cal_num_annonce = $_GET['ficnat'];
142
		$cal_num_annonce = $_GET['ficnat'];
143
	}
143
	}
144
 
144
 
145
	// Gestion de l'affichage des titres des �v�nements
145
	// Gestion de l'affichage des titres des �v�nements
146
	if (isset($_GET['ctt']) && $_GET['ctt'] == '1') {
146
	if (isset($_GET['ctt']) && $_GET['ctt'] == '1') {
147
		$url->addQueryString('tt', '0');
147
		$url->addQueryString('tt', '0');
148
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
148
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
149
			$url->addQueryString('tt', '1');
149
			$url->addQueryString('tt', '1');
150
		}
150
		}
151
		$tc_lien = $url->getUrl();
151
		$tc_lien = $url->getUrl();
152
	} else {
152
	} else {
153
		$url->addQueryString('tt', '0');
153
		$url->addQueryString('tt', '0');
154
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
154
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
155
			$url->addQueryString('tt', '1');
155
			$url->addQueryString('tt', '1');
156
		}
156
		}
157
		$url->addQueryString('ctt', '1');
157
		$url->addQueryString('ctt', '1');
158
		$tc_lien = $url->getUrl();
158
		$tc_lien = $url->getUrl();
159
	}
159
	}
160
	$url->removeQueryString('ctt');
160
	$url->removeQueryString('ctt');
161
	$url->removeQueryString('tt');
161
	$url->removeQueryString('tt');
162
	$tc_txt = 'Afficher les titres complets des �v�nements';
162
	$tc_txt = 'Afficher les titres complets des événements';
163
	if (isset($_GET['tt']) && $_GET['tt'] == '0') {
163
	if (isset($_GET['tt']) && $_GET['tt'] == '0') {
164
		$tc_txt = 'Tronquer les titres des �v�nements';
164
		$tc_txt = 'Tronquer les titres des �v�nements';
165
		$url->addQueryString('tt', $_GET['tt']);
165
		$url->addQueryString('tt', $_GET['tt']);
166
	}
166
	}
167
 
167
 
168
	//	Gestion des champs cach�s pour le formulaire de filtre
168
	//	Gestion des champs cach�s pour le formulaire de filtre
169
	// Attention  � la position dans le fichier...
169
	// Attention  � la position dans le fichier...
170
	$ficnat_chps_cache = $url->querystring;
170
	$ficnat_chps_cache = $url->querystring;
171
	unset($ficnat_chps_cache['ficnat']); 
171
	unset($ficnat_chps_cache['ficnat']); 
172
	
172
	
173
	// Navigation 
173
	// Navigation 
174
	$prevStamp = $month->prevMonth(true);
174
	$prevStamp = $month->prevMonth(true);
175
	$url->addQueryString('y', date('Y',$prevStamp));
175
	$url->addQueryString('y', date('Y',$prevStamp));
176
	$url->addQueryString('m', date('n',$prevStamp));
176
	$url->addQueryString('m', date('n',$prevStamp));
177
	$url->addQueryString('d', date('j',$prevStamp));
177
	$url->addQueryString('d', date('j',$prevStamp));
178
	$prev = $url->getUrl();
178
	$prev = $url->getUrl();
179
	
179
	
180
	$nextStamp = $month->nextMonth(true);
180
	$nextStamp = $month->nextMonth(true);
181
	$url->addQueryString('y', date('Y',$nextStamp));
181
	$url->addQueryString('y', date('Y',$nextStamp));
182
	$url->addQueryString('m', date('n',$nextStamp));
182
	$url->addQueryString('m', date('n',$nextStamp));
183
	$url->addQueryString('d', date('j',$nextStamp));
183
	$url->addQueryString('d', date('j',$nextStamp));
184
	$next = $url->getUrl();
184
	$next = $url->getUrl();
185
	
185
	
186
	// Suppression du param�tre de troncage des titres
186
	// Suppression du param�tre de troncage des titres
187
	$url->removeQueryString('tt');
187
	$url->removeQueryString('tt');
188
	
188
	
189
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
189
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
190
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
190
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
191
 
191
 
192
	// R�cup�ration des infos sur les natures des fiches pour le filtre
192
	// R�cup�ration des infos sur les natures des fiches pour le filtre
193
	$requete_nature_fiche = 'SELECT DISTINCT bn_id_nature, bn_ce_i18n, bn_label_nature '.
193
	$requete_nature_fiche = 'SELECT DISTINCT bn_id_nature, bn_ce_i18n, bn_label_nature '.
194
							'FROM bazar_nature '.
194
							'FROM bazar_nature '.
195
							'WHERE bn_id_nature IN ('.BAZ_NUM_ANNONCE_CALENDRIER.') ';
195
							'WHERE bn_id_nature IN ('.BAZ_NUM_ANNONCE_CALENDRIER.') ';
196
	$resultat_nature_fiche = $db->query($requete_nature_fiche);
196
	$resultat_nature_fiche = $db->query($requete_nature_fiche);
197
	(DB::isError($resultat_nature_fiche)) ? trigger_error(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_nature_fiche->getMessage(), $requete_nature_fiche), E_USER_WARNING) : '';
197
	(DB::isError($resultat_nature_fiche)) ? trigger_error(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_nature_fiche->getMessage(), $requete_nature_fiche), E_USER_WARNING) : '';
198
	
198
	
199
	// Ajout du javascript et des styles du bazar
199
	// Ajout du javascript et des styles du bazar
200
	if (defined('PAP_VERSION')) { //si on est dans Papyrus
200
	if (defined('PAP_VERSION')) { //si on est dans Papyrus
201
		GEN_stockerStyleExterne( 'bazar_interne', 'reseau/bazar/bazar.interne.css');
201
		GEN_stockerStyleExterne( 'bazar_interne', 'reseau/bazar/bazar.interne.css');
202
		GEN_stockerFichierScript('domLib', '/api/js/domtooltip/domLib.js');
202
		GEN_stockerFichierScript('domLib', '/api/js/domtooltip/domLib.js');
203
		GEN_stockerFichierScript('domTT', '/api/js/domtooltip/domTT.js');
203
		GEN_stockerFichierScript('domTT', '/api/js/domtooltip/domTT.js');
204
		
204
		
205
		// DomToolTip
205
		// DomToolTip
206
		$script = 'var domTT_styleClass = "niceTitle";'."\n";
206
		$script = 'var domTT_styleClass = "niceTitle";'."\n";
207
		$script .= 'function nicetitleDecorator(el) {'."\n";
207
		$script .= 'function nicetitleDecorator(el) {'."\n";
208
		$script .= '	var result = el.title;'."\n";
208
		$script .= '	var result = el.title;'."\n";
209
		$script .= '	result = result.replace(new RegExp("\n", "g"), "<br />");'."\n";
209
		$script .= '	result = result.replace(new RegExp("\n", "g"), "<br />");'."\n";
210
		$script .= '	//if (el.href) {'."\n";
210
		$script .= '	//if (el.href) {'."\n";
211
		$script .= '		//result += "<p>" + el.href + "<\/p>";'."\n";
211
		$script .= '		//result += "<p>" + el.href + "<\/p>";'."\n";
212
		$script .= '	//}'."\n";
212
		$script .= '	//}'."\n";
213
		$script .= '	return result;'."\n";
213
		$script .= '	return result;'."\n";
214
		$script .= '}'."\n";
214
		$script .= '}'."\n";
215
		$script .= 'domTT_replaceTitles(nicetitleDecorator);'."\n";
215
		$script .= 'domTT_replaceTitles(nicetitleDecorator);'."\n";
216
		GEN_stockerCodeScript('var domTT_styleClass = "niceTitle";'."\n");
216
		GEN_stockerCodeScript('var domTT_styleClass = "niceTitle";'."\n");
217
	}
217
	}
218
	
218
	
219
	// Titre
219
	// Titre
220
	if ($type == 'calendrier') {
220
	if ($type == 'calendrier') {
221
		$retour .= '<div id="cal_entete">'."\n";
221
		$retour .= '<div id="cal_entete">'."\n";
222
		$retour .= '<span class="cal_navigation">'."\n";	
222
		$retour .= '<span class="cal_navigation">'."\n";	
223
		$retour .= '<a id="cal_precedent_lien" href="'.$prev.'" title="Allez au mois pr�c�dent"><img id="cal_precedent_img" src="reseau/bazar/images/cal_precedent.png" alt="&lt;&lt;"/></a>'."\n"; 
223
		$retour .= '<a id="cal_precedent_lien" href="'.$prev.'" title="Allez au mois pr�c�dent"><img id="cal_precedent_img" src="reseau/bazar/images/cal_precedent.png" alt="&lt;&lt;"/></a>'."\n"; 
224
		$retour .= '&nbsp;&nbsp;'."\n";
224
		$retour .= '&nbsp;&nbsp;'."\n";
225
		$retour .= '<span id="cal_encadre_mois_courrant"><a id="cal_mois_courrant" href="'.$cur.'">';
225
		$retour .= '<span id="cal_encadre_mois_courrant"><a id="cal_mois_courrant" href="'.$cur.'">';
226
		$retour .= $fr_month[(date('n',$curStamp))]; 
226
		$retour .= $fr_month[(date('n',$curStamp))]; 
227
		$retour .= '&nbsp;';
227
		$retour .= '&nbsp;';
228
		$retour .= (date('Y',$curStamp));
228
		$retour .= (date('Y',$curStamp));
229
		$retour .= '</a></span>'."\n";
229
		$retour .= '</a></span>'."\n";
230
		$retour .= '&nbsp;&nbsp;'."\n";
230
		$retour .= '&nbsp;&nbsp;'."\n";
231
		$retour .= '<a id="cal_suivant_lien" href="'.$next.'" title="Allez au mois suivant"><img id="cal_suivant_img" src="reseau/bazar/images/cal_suivant.png" alt="&gt;&gt;"/></a>'."\n";
231
		$retour .= '<a id="cal_suivant_lien" href="'.$next.'" title="Allez au mois suivant"><img id="cal_suivant_img" src="reseau/bazar/images/cal_suivant.png" alt="&gt;&gt;"/></a>'."\n";
232
		$retour .= '</span>'."\n";
232
		$retour .= '</span>'."\n";
233
		$retour .= '<h1 id="cal_titre"><img id="cal_titre_img" src="reseau/bazar/images/cal_titre.png" alt="Calendrier"/></h1>'."\n";
233
		$retour .= '<h1 id="cal_titre"><img id="cal_titre_img" src="reseau/bazar/images/cal_titre.png" alt="Calendrier"/></h1>'."\n";
234
		$retour .= '</div>'."\n";
234
		$retour .= '</div>'."\n";
235
		
235
		
236
		$retour .= '<form action="'.$tc_lien.'" method="get">'."\n";
236
		$retour .= '<form action="'.$tc_lien.'" method="get">'."\n";
237
		$retour .= '<a href="'.$tc_lien.'">'.$tc_txt.'</a>'."\n";
237
		$retour .= '<a href="'.$tc_lien.'">'.$tc_txt.'</a>'."\n";
238
		$retour .= '<fieldset>'."\n";
238
		$retour .= '<fieldset>'."\n";
239
		$retour .= '<legend>'.'Filtrer : '.'</legend>'."\n";
239
		$retour .= '<legend>'.'Filtrer : '.'</legend>'."\n";
240
		$retour .= '<select id="ficnat" name="ficnat" class="filtre_'.((!is_null($ficnat_id)) ? $ficnat_id: 'tous').'"  onchange="javascript:this.form.submit();">'."\n";
240
		$retour .= '<select id="ficnat" name="ficnat" class="filtre_'.((!is_null($ficnat_id)) ? $ficnat_id: 'tous').'"  onchange="javascript:this.form.submit();">'."\n";
241
		
241
		
242
		$retour .= '<option id="filtre_tous" value="*" ';
242
		$retour .= '<option id="filtre_tous" value="*" ';
243
		if (isset($_GET['ficnat']) && '*' == $_GET['ficnat']) {
243
		if (isset($_GET['ficnat']) && '*' == $_GET['ficnat']) {
244
			$retour .= 'selected="selected" ';
244
			$retour .= 'selected="selected" ';
245
		}
245
		}
246
		$retour .= '>'.'Tout afficher'.'</option>';
246
		$retour .= '>'.'Tout afficher'.'</option>';
247
		
247
		
248
		while ($ligne_nature_fiche = $resultat_nature_fiche->fetchRow(DB_FETCHMODE_OBJECT)) {
248
		while ($ligne_nature_fiche = $resultat_nature_fiche->fetchRow(DB_FETCHMODE_OBJECT)) {
249
			$opt = '<option class="filtre_'.$ligne_nature_fiche->bn_id_nature.'" value="'.$ligne_nature_fiche->bn_id_nature.'" ';
249
			$opt = '<option class="filtre_'.$ligne_nature_fiche->bn_id_nature.'" value="'.$ligne_nature_fiche->bn_id_nature.'" ';
250
			if (isset($_GET['ficnat']) && $ligne_nature_fiche->bn_id_nature == $_GET['ficnat']) {
250
			if (isset($_GET['ficnat']) && $ligne_nature_fiche->bn_id_nature == $_GET['ficnat']) {
251
				$opt .= 'selected="selected" ';
251
				$opt .= 'selected="selected" ';
252
			}
252
			}
253
			$opt .= '>';
253
			$opt .= '>';
254
			
254
			
255
			$retour .= $opt.$ligne_nature_fiche->bn_label_nature.'</option>'."\n";
255
			$retour .= $opt.$ligne_nature_fiche->bn_label_nature.'</option>'."\n";
256
		}
256
		}
257
		
257
		
258
		$retour .= '</select>'."\n";
258
		$retour .= '</select>'."\n";
259
		$retour .= '<input id="ficnat_ok" type="submit" value="'.'OK'.'" onload="javascript:this.setAttribute(\'style\', \'display:none;\')"/>'."\n";
259
		$retour .= '<input id="ficnat_ok" type="submit" value="'.'OK'.'" onload="javascript:this.setAttribute(\'style\', \'display:none;\')"/>'."\n";
260
		$script_ok = 	'if (document.getElementById(\'ficnat_ok\')) {'.
260
		$script_ok = 	'if (document.getElementById(\'ficnat_ok\')) {'.
261
						'	document.getElementById(\'ficnat_ok\').style.display = \'none\';'.
261
						'	document.getElementById(\'ficnat_ok\').style.display = \'none\';'.
262
						'}';
262
						'}';
263
		$retour.= '<script type="text/javascript">//<![CDATA['."\n".$script_ok.'//]]></script>'."\n";
263
		$retour.= '<script type="text/javascript">//<![CDATA['."\n".$script_ok.'//]]></script>'."\n";
264
		foreach ($ficnat_chps_cache as $cle => $val) {
264
		foreach ($ficnat_chps_cache as $cle => $val) {
265
			$retour .= '<input id="'.$cle.'" name="'.$cle.'" type="hidden" value="'.$val.'" />'."\n";
265
			$retour .= '<input id="'.$cle.'" name="'.$cle.'" type="hidden" value="'.$val.'" />'."\n";
266
		}
266
		}
267
		$retour .= '</fieldset>'."\n";
267
		$retour .= '</fieldset>'."\n";
268
		$retour .= '</form>'."\n";
268
		$retour .= '</form>'."\n";
269
		
269
		
270
	} else {
270
	} else {
271
		// Appel du template
271
		// Appel du template
272
		ob_start();
272
		ob_start();
273
		include $options['template'];
273
		include $options['template'];
274
		$retour .= ob_get_contents();
274
		$retour .= ob_get_contents();
275
		ob_end_clean();
275
		ob_end_clean();
276
	}
276
	}
277
	// Vue Mois calendrier ou vue applette
277
	// Vue Mois calendrier ou vue applette
278
		
278
		
279
	if ((!isset($_GET['id_fiche']) && $type == 'calendrier') || ($type == 'calendrier_applette')){
279
	if ((!isset($_GET['id_fiche']) && $type == 'calendrier') || ($type == 'calendrier_applette')){
280
//		trigger_error('ICI', E_USER_NOTICE);
280
//		trigger_error('ICI', E_USER_NOTICE);
281
		// Recherche evenement de la periode selectionn�e 
281
		// Recherche evenement de la periode selectionn�e 
282
		$ts_jour_fin_mois = $month->nextMonth('timestamp');
282
		$ts_jour_fin_mois = $month->nextMonth('timestamp');
283
		$ts_jour_debut_mois = $month->thisMonth('timestamp');; 
283
		$ts_jour_debut_mois = $month->thisMonth('timestamp');; 
284
	    $requete_evenements = 	"SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, ".
284
	    $requete_evenements = 	"SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, ".
285
	    						"	DAY(bf_date_debut_evenement) AS bf_jour_debut_evenement, bf_date_debut_evenement, ".
285
	    						"	DAY(bf_date_debut_evenement) AS bf_jour_debut_evenement, bf_date_debut_evenement, ".
286
	    						"	bf_date_fin_evenement, bf_description, bn_id_nature ".
286
	    						"	bf_date_fin_evenement, bf_description, bn_id_nature ".
287
								"FROM bazar_fiche, bazar_nature ".
287
								"FROM bazar_fiche, bazar_nature ".
288
								"WHERE bf_date_debut_evenement < '".date('Y-m-d', $ts_jour_fin_mois)."' ".
288
								"WHERE bf_date_debut_evenement < '".date('Y-m-d', $ts_jour_fin_mois)."' ".
289
								"AND bf_date_fin_evenement >= '".date('Y-m-d', $ts_jour_debut_mois)."' ".
289
								"AND bf_date_fin_evenement >= '".date('Y-m-d', $ts_jour_debut_mois)."' ".
290
								"AND bf_ce_nature = bn_id_nature ".
290
								"AND bf_ce_nature = bn_id_nature ".
291
								"AND bn_id_nature IN (".$cal_num_annonce.") ".
291
								"AND bn_id_nature IN (".$cal_num_annonce.") ".
292
								"AND bf_statut_fiche = 1 ".
292
								"AND bf_statut_fiche = 1 ".
293
								"ORDER BY bf_jour_debut_evenement";
293
								"ORDER BY bf_jour_debut_evenement";
294
		
294
		
295
	   	$resultat_evenement = $db->query($requete_evenements);
295
	   	$resultat_evenement = $db->query($requete_evenements);
296
	   	
296
	   	
297
	    (DB::isError($resultat_evenement)) ? trigger_error(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements), E_USER_WARNING) : '';
297
	    (DB::isError($resultat_evenement)) ? trigger_error(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements), E_USER_WARNING) : '';
298
 
298
 
299
		$selection = array();
299
		$selection = array();
300
		$evenements = array();
300
		$evenements = array();
301
		$annee = date('Y', $curStamp);
301
		$annee = date('Y', $curStamp);
302
		$mois = date('m', $curStamp);
302
		$mois = date('m', $curStamp);
303
		$tablo_jours = array();
303
		$tablo_jours = array();
304
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
304
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
305
			list($annee_debut, $mois_debut, $jour_debut) = explode('-', $ligne_evenements->bf_date_debut_evenement);
305
			list($annee_debut, $mois_debut, $jour_debut) = explode('-', $ligne_evenements->bf_date_debut_evenement);
306
			list($annee_fin, $mois_fin, $jour_fin) = explode('-', $ligne_evenements->bf_date_fin_evenement);
306
			list($annee_fin, $mois_fin, $jour_fin) = explode('-', $ligne_evenements->bf_date_fin_evenement);
307
			
307
			
308
			$Calendrier = new Calendar($annee_debut, $mois_debut, $jour_debut);
308
			$Calendrier = new Calendar($annee_debut, $mois_debut, $jour_debut);
309
			$ts_jour_suivant = $Calendrier->thisDay('timestamp');
309
			$ts_jour_suivant = $Calendrier->thisDay('timestamp');
310
			$ts_jour_fin = mktime(0,0,0,$mois_fin, $jour_fin, $annee_fin);
310
			$ts_jour_fin = mktime(0,0,0,$mois_fin, $jour_fin, $annee_fin);
311
			
311
			
312
			$naviguer = true;
312
			$naviguer = true;
313
			while ($naviguer && ($ts_jour_suivant <= $ts_jour_fin)) {								
313
			while ($naviguer && ($ts_jour_suivant <= $ts_jour_fin)) {								
314
							// Si le jours suivant est inferieur a la date de fin du mois courrant, on continue...
314
							// Si le jours suivant est inferieur a la date de fin du mois courrant, on continue...
315
							if ($ts_jour_suivant < $ts_jour_fin_mois) {
315
							if ($ts_jour_suivant < $ts_jour_fin_mois) {
316
								$cle_j = date('Y-m-d', $ts_jour_suivant);
316
								$cle_j = date('Y-m-d', $ts_jour_suivant);
317
								if (!isset($tablo_jours[$cle_j])) {
317
								if (!isset($tablo_jours[$cle_j])) {
318
									$tablo_jours[$cle_j]['Calendar_Day'] = new Calendar_Day(date('Y', $ts_jour_suivant),date('m', $ts_jour_suivant), date('d', $ts_jour_suivant));
318
									$tablo_jours[$cle_j]['Calendar_Day'] = new Calendar_Day(date('Y', $ts_jour_suivant),date('m', $ts_jour_suivant), date('d', $ts_jour_suivant));
319
									$tablo_jours[$cle_j]['Diary_Event'] = new DiaryEvent($tablo_jours[$cle_j]['Calendar_Day']);
319
									$tablo_jours[$cle_j]['Diary_Event'] = new DiaryEvent($tablo_jours[$cle_j]['Calendar_Day']);
320
								}
320
								}
321
								$tablo_jours[$cle_j]['Diary_Event']->setEntry($ligne_evenements);
321
								$tablo_jours[$cle_j]['Diary_Event']->setEntry($ligne_evenements);
322
								
322
								
323
								$ts_jour_suivant = $Calendrier->nextDay('timestamp');
323
								$ts_jour_suivant = $Calendrier->nextDay('timestamp');
324
								//echo "ici$ts_jour_suivant-";
324
								//echo "ici$ts_jour_suivant-";
325
								$Calendrier->setTimestamp($ts_jour_suivant);
325
								$Calendrier->setTimestamp($ts_jour_suivant);
326
								//echo "la".$Calendrier->thisDay('timestamp')."-";
326
								//echo "la".$Calendrier->thisDay('timestamp')."-";
327
							} else {
327
							} else {
328
								$naviguer = false;
328
								$naviguer = false;
329
							}				
329
							}				
330
			}
330
			}
331
		}
331
		}
332
		// Add the decorator to the selection
332
		// Add the decorator to the selection
333
		foreach ($tablo_jours as $jour) {
333
		foreach ($tablo_jours as $jour) {
334
			$selection[] = $jour['Diary_Event'];				
334
			$selection[] = $jour['Diary_Event'];				
335
		}
335
		}
336
	
336
	
337
		// Affichage Calendrier
337
		// Affichage Calendrier
338
		$month->build($selection);
338
		$month->build($selection);
339
		if ($type == 'calendrier') {
339
		if ($type == 'calendrier') {
340
			$retour.= '<table class="calendrier">'.
340
			$retour.= '<table class="calendrier">'.
341
				'<colgroup>'.
341
				'<colgroup>'.
342
					'<col class="cal_lundi"/>'.
342
					'<col class="cal_lundi"/>'.
343
					'<col class="cal_mardi"/>'.
343
					'<col class="cal_mardi"/>'.
344
					'<col class="cal_mercredi"/>'.
344
					'<col class="cal_mercredi"/>'.
345
					'<col class="cal_jeudi"/>'.
345
					'<col class="cal_jeudi"/>'.
346
					'<col class="cal_vendredi"/>'.
346
					'<col class="cal_vendredi"/>'.
347
					'<col class="cal_samedi"/>'.
347
					'<col class="cal_samedi"/>'.
348
					'<col class="cal_dimanche"/>'.
348
					'<col class="cal_dimanche"/>'.
349
				'</colgroup>'.
349
				'</colgroup>'.
350
				'<thead>'.
350
				'<thead>'.
351
			 	"<tr>
351
			 	"<tr>
352
			
352
			
353
			  <th> ". BAZ_LUNDI ."</th>
353
			  <th> ". BAZ_LUNDI ."</th>
354
			  <th> ". BAZ_MARDI ."</th>
354
			  <th> ". BAZ_MARDI ."</th>
355
			  <th> ". BAZ_MERCREDI ."</th>
355
			  <th> ". BAZ_MERCREDI ."</th>
356
			  <th> ". BAZ_JEUDI ."</th>
356
			  <th> ". BAZ_JEUDI ."</th>
357
			  <th> ". BAZ_VENDREDI ."</th>
357
			  <th> ". BAZ_VENDREDI ."</th>
358
			  <th> ". BAZ_SAMEDI ."</th>
358
			  <th> ". BAZ_SAMEDI ."</th>
359
			  <th> ". BAZ_DIMANCHE ."</th>
359
			  <th> ". BAZ_DIMANCHE ."</th>
360
			 </tr>
360
			 </tr>
361
			 ".'</thead>'.'<tbody>';
361
			 ".'</thead>'.'<tbody>';
362
		} else {
362
		} else {
363
			$retour.= '<table class="calendrier_applette">'.
363
			$retour.= '<table class="calendrier_applette">'.
364
				'<colgroup>'.
364
				'<colgroup>'.
365
					'<col class="cal_lundi"/>'.
365
					'<col class="cal_lundi"/>'.
366
					'<col class="cal_mardi"/>'.
366
					'<col class="cal_mardi"/>'.
367
					'<col class="cal_mercredi"/>'.
367
					'<col class="cal_mercredi"/>'.
368
					'<col class="cal_jeudi"/>'.
368
					'<col class="cal_jeudi"/>'.
369
					'<col class="cal_vendredi"/>'.
369
					'<col class="cal_vendredi"/>'.
370
					'<col class="cal_samedi"/>'.
370
					'<col class="cal_samedi"/>'.
371
					'<col class="cal_dimanche"/>'.
371
					'<col class="cal_dimanche"/>'.
372
				'</colgroup>'.
372
				'</colgroup>'.
373
				'<thead>'.
373
				'<thead>'.
374
			 "<tr>
374
			 "<tr>
375
			
375
			
376
			  <th> ". BAZ_LUNDI_COURT ."</th>
376
			  <th> ". BAZ_LUNDI_COURT ."</th>
377
			  <th> ". BAZ_MARDI_COURT ."</th>
377
			  <th> ". BAZ_MARDI_COURT ."</th>
378
			  <th> ". BAZ_MERCREDI_COURT ."</th>
378
			  <th> ". BAZ_MERCREDI_COURT ."</th>
379
			  <th> ". BAZ_JEUDI_COURT ."</th>
379
			  <th> ". BAZ_JEUDI_COURT ."</th>
380
			  <th> ". BAZ_VENDREDI_COURT ."</th>
380
			  <th> ". BAZ_VENDREDI_COURT ."</th>
381
			  <th> ". BAZ_SAMEDI_COURT ."</th>
381
			  <th> ". BAZ_SAMEDI_COURT ."</th>
382
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
382
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
383
			 </tr>
383
			 </tr>
384
			 ".'</thead>'.'<tbody>';
384
			 ".'</thead>'.'<tbody>';
385
		}
385
		}
386
		
386
		
387
		$todayStamp=time();
387
		$todayStamp=time();
388
		$today_ymd=date('Ymd',$todayStamp);
388
		$today_ymd=date('Ymd',$todayStamp);
389
 
389
 
390
		// Other month : mois 
390
		// Other month : mois 
391
		while ($day = $month->fetch() ) {
391
		while ($day = $month->fetch() ) {
392
			$dayStamp = $day->thisDay(true);
392
			$dayStamp = $day->thisDay(true);
393
			$day_ymd = date('Ymd',$dayStamp);
393
			$day_ymd = date('Ymd',$dayStamp);
394
			if ( $day->isEmpty() ) {
394
			if ( $day->isEmpty() ) {
395
				$class = "cal_ma other_month";
395
				$class = "cal_ma other_month";
396
			} else {
396
			} else {
397
				if (($day_ymd < $today_ymd)) {
397
				if (($day_ymd < $today_ymd)) {
398
					$class= "cal_mp previous_month";
398
					$class= "cal_mp previous_month";
399
				} else {
399
				} else {
400
					 if ($day_ymd == $today_ymd) {
400
					 if ($day_ymd == $today_ymd) {
401
					 	$class= "cal_jc current_day";
401
					 	$class= "cal_jc current_day";
402
					 } else {
402
					 } else {
403
						$class="cal_mc current_month";
403
						$class="cal_mc current_month";
404
					 }
404
					 }
405
				}
405
				}
406
			}
406
			}
407
			
407
			
408
			$url->addQueryString ('y', date('Y',$dayStamp));
408
			$url->addQueryString ('y', date('Y',$dayStamp));
409
			$url->addQueryString ('m', date('n',$dayStamp));
409
			$url->addQueryString ('m', date('n',$dayStamp));
410
			$url->addQueryString ('d', date('j',$dayStamp));
410
			$url->addQueryString ('d', date('j',$dayStamp));
411
			$link = $url->getUrl();
411
			$link = $url->getUrl();
412
		
412
		
413
			// isFirst() to find start of week
413
			// isFirst() to find start of week
414
			if ($day->isFirst()) {
414
			if ($day->isFirst()) {
415
				$retour.= ( "<tr>\n" );
415
				$retour.= ( "<tr>\n" );
416
			}
416
			}
417
			if ($type == 'calendrier') {
417
			if ($type == 'calendrier') {
418
				$retour.= "<td class=\"".$class."\">".'<span class="cal_j">'.$day->thisDay().'</span>'."\n";
418
				$retour.= "<td class=\"".$class."\">".'<span class="cal_j">'.$day->thisDay().'</span>'."\n";
419
				if ($day->isSelected() ) {
419
				if ($day->isSelected() ) {
420
					$evenements = $day->getEntry();
420
					$evenements = $day->getEntry();
421
					$evenements_nbre = count($evenements);
421
					$evenements_nbre = count($evenements);
422
					$evenemt_xhtml = '';
422
					$evenemt_xhtml = '';
423
					while ($ligne_evenement = array_pop($evenements)) {
423
					while ($ligne_evenement = array_pop($evenements)) {
424
 
424
 
425
						$id_fiches = array();
425
						$id_fiches = array();
426
						$id_fiches[] = $ligne_evenement->bf_id_fiche;
426
						$id_fiches[] = $ligne_evenement->bf_id_fiche;
427
						$url->addQueryString ('id_fiches',$id_fiches);
427
						$url->addQueryString ('id_fiches',$id_fiches);
428
 
428
 
429
						$lien_voir = new Net_Url(BAZ_URL_BASE_APPLI);
429
						$lien_voir = new Net_Url(BAZ_URL_BASE_APPLI);
430
						$lien_voir->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
430
						$lien_voir->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
431
						$lien_voir->addQueryString('id_fiche', $ligne_evenement->bf_id_fiche);
431
						$lien_voir->addQueryString('id_fiche', $ligne_evenement->bf_id_fiche);
432
						$lien_voir->addQueryString('typeannonce', $ligne_evenement->bn_id_nature);
432
						$lien_voir->addQueryString('typeannonce', $ligne_evenement->bn_id_nature);
433
						$link=$lien_voir->getURL();
433
						$link=$lien_voir->getURL();
434
						
434
						
435
						if (!isset($_GET['tt']) || (isset($_GET['tt']) && $_GET['tt'] == '1')) {
435
						if (!isset($_GET['tt']) || (isset($_GET['tt']) && $_GET['tt'] == '1')) {
436
							$titre_taille = strlen($ligne_evenement->bf_titre);
436
							$titre_taille = strlen($ligne_evenement->bf_titre);
437
							$titre = ($titre_taille > 20)?substr($ligne_evenement->bf_titre, 0, 20).'...':$ligne_evenement->bf_titre;
437
							$titre = ($titre_taille > 20)?substr($ligne_evenement->bf_titre, 0, 20).'...':$ligne_evenement->bf_titre;
438
						} else {
438
						} else {
439
							$titre = $ligne_evenement->bf_titre;
439
							$titre = $ligne_evenement->bf_titre;
440
						}
440
						}
441
						$evenemt_xhtml .= '<li class="tooltip nature_'.$ligne_evenement->bn_id_nature.'" title="'.str_replace('"', '\'', $ligne_evenement->bf_titre).'"><a class="cal_evenemt" href="'.$link.'">'.$titre.'</a></li>'."\n";
441
						$evenemt_xhtml .= '<li class="tooltip nature_'.$ligne_evenement->bn_id_nature.'" title="'.str_replace('"', '\'', $ligne_evenement->bf_titre).'"><a class="cal_evenemt" href="'.$link.'">'.$titre.'</a></li>'."\n";
442
						$url->removeQueryString ('id_fiches');
442
						$url->removeQueryString ('id_fiches');
443
					}
443
					}
444
					if ($evenements_nbre > 0) {
444
					if ($evenements_nbre > 0) {
445
						$retour .= '<ul class="cal_evenemt_liste">';
445
						$retour .= '<ul class="cal_evenemt_liste">';
446
						$retour .= $evenemt_xhtml;
446
						$retour .= $evenemt_xhtml;
447
						$retour .= '</ul>';
447
						$retour .= '</ul>';
448
					}
448
					}
449
				}
449
				}
450
			} else {
450
			} else {
451
				$lien_date= "<td class=\"".$class."\">".$day->thisDay();
451
				$lien_date= "<td class=\"".$class."\">".$day->thisDay();
452
				if ($day->isSelected() ) {
452
				if ($day->isSelected() ) {
453
					$evenements = $day->getEntry();
453
					$evenements = $day->getEntry();
454
					$id_fiches = array();
454
					$id_fiches = array();
455
					$info_fiches = null;
455
					$info_fiches = null;
456
					while ($ligne_evenement = array_pop($evenements)) {
456
					while ($ligne_evenement = array_pop($evenements)) {
457
						$id_fiches[] = $ligne_evenement->bf_id_fiche;
457
						$id_fiches[] = $ligne_evenement->bf_id_fiche;
458
						$info_fiches .= '&rArr; '.str_replace('"', '\'', $ligne_evenement->bf_titre)."\n";
458
						$info_fiches .= '&rArr; '.str_replace('"', '\'', $ligne_evenement->bf_titre)."\n";
459
					}
459
					}
460
					$url->addQueryString('id_fiches', $id_fiches);
460
					$url->addQueryString('id_fiches', $id_fiches);
461
					$link = $url->getUrl();
461
					$link = $url->getUrl();
462
					$lien_date = '<td class="'.$class.'"><a href="'.$link.'" class="tooltip" title="'.$info_fiches.'">'.$day->thisDay()."</a>\n";
462
					$lien_date = '<td class="'.$class.'"><a href="'.$link.'" class="tooltip" title="'.$info_fiches.'">'.$day->thisDay()."</a>\n";
463
					$url->removeQueryString('id_fiches');
463
					$url->removeQueryString('id_fiches');
464
				}
464
				}
465
				$retour .= $lien_date;
465
				$retour .= $lien_date;
466
			}
466
			}
467
			$retour.= ( "</td>\n" );
467
			$retour.= ( "</td>\n" );
468
			
468
			
469
			// isLast() to find end of week
469
			// isLast() to find end of week
470
			if ( $day->isLast() ) {
470
			if ( $day->isLast() ) {
471
				$retour.= ( "</tr>\n" );
471
				$retour.= ( "</tr>\n" );
472
			}
472
			}
473
		}
473
		}
474
			$retour.= "</tbody></table>";
474
			$retour.= "</tbody></table>";
475
	}
475
	}
476
	$retour.= '<script type="text/javascript">//<![CDATA['."\n".$script.'//]]></script>'."\n";
476
	$retour.= '<script type="text/javascript">//<![CDATA['."\n".$script.'//]]></script>'."\n";
477
	// Vue detail
477
	// Vue detail
478
	
478
	
479
	if ((isset($_GET['id_fiches']))) {
479
	if ((isset($_GET['id_fiches']))) {
480
		// Ajout d'un titre pour la page avec la date
480
		// Ajout d'un titre pour la page avec la date
481
		$jours = array ('dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi') ;
481
		$jours = array ('dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi') ;
482
		$mois = array ('janvier', 'f�vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', 'ao�t', 'septembre',
482
		$mois = array ('janvier', 'f�vrier', 'mars', 'avril', 'mai', 'juin', 'juillet', 'ao�t', 'septembre',
483
						'octobre', 'novembre', 'd�cembre') ;
483
						'octobre', 'novembre', 'd�cembre') ;
484
		$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
484
		$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
485
		
485
		
486
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
486
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
487
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
487
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
488
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
488
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
489
						' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
489
						' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
490
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(1,$_GET['id_fiches'] );
490
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(1,$_GET['id_fiches'] );
491
 
491
 
492
		$GLOBALS['_GEN_commun']['info_menu'] = '';
492
		$GLOBALS['_GEN_commun']['info_menu'] = '';
493
		
493
		
494
		// Un lien pour retourner au calendrier
494
		// Un lien pour retourner au calendrier
495
		$url->removeQueryString('id_fiches');
495
		$url->removeQueryString('id_fiches');
496
		$url->removeQueryString('y');
496
		$url->removeQueryString('y');
497
		$url->removeQueryString('m');
497
		$url->removeQueryString('m');
498
		$url->removeQueryString('d');
498
		$url->removeQueryString('d');
499
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '<div class="retour"><a href="'.$url->getURL().'">Retour au calendrier</a></div>';
499
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '<div class="retour"><a href="'.$url->getURL().'">Retour au calendrier</a></div>';
500
	}
500
	}
501
 
501
 
502
	// Nettoyage de l'url
502
	// Nettoyage de l'url
503
	$url->removeQueryString('id_fiches');
503
	$url->removeQueryString('id_fiches');
504
	$url->removeQueryString('y');
504
	$url->removeQueryString('y');
505
	$url->removeQueryString('m');
505
	$url->removeQueryString('m');
506
	$url->removeQueryString('d');
506
	$url->removeQueryString('d');
507
	
507
	
508
	
508
	
509
	return $retour;
509
	return $retour;
510
}
510
}
511
?>
511
?>