Subversion Repositories Applications.bazar

Rev

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

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