Subversion Repositories Applications.bazar

Rev

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

Rev 263 Rev 267
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.20 2007-06-25 12:15:06 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.cal.php,v 1.21 2007-06-25 14:46:10 florian Exp $
23
/**
23
/**
24
*
24
*
25
* Fonctions calendrier du module bazar
25
* Fonctions calendrier du module bazar
26
*
26
*
27
*@package bazar
27
*@package bazar
28
//Auteur original :
28
//Auteur original :
29
*@author        David Delon <david.delon@clapas.net>
29
*@author        David Delon <david.delon@clapas.net>
30
//Autres auteurs :
30
//Autres auteurs :
31
*@copyright     Tela-Botanica 2000-2004
31
*@copyright     Tela-Botanica 2000-2004
32
*@version       $Revision: 1.20 $ $Date: 2007-06-25 12:15:06 $
32
*@version       $Revision: 1.21 $ $Date: 2007-06-25 14:46:10 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
// |                                            ENTETE du PROGRAMME                                       |
37
// |                                            ENTETE du PROGRAMME                                       |
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
 
39
 
40
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php';
40
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Month/Weekdays.php';
41
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php';
41
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Day.php';
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
43
 
43
 
44
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
45
// |                                           LISTE de FONCTIONS                                         |
45
// |                                           LISTE de FONCTIONS                                         |
46
// +------------------------------------------------------------------------------------------------------+
46
// +------------------------------------------------------------------------------------------------------+
47
 
47
 
48
// Classe Utilitaire pour Calendrier
48
// Classe Utilitaire pour Calendrier
49
class DiaryEvent extends Calendar_Decorator {
49
class DiaryEvent extends Calendar_Decorator {
50
	var $entry = array();
50
	var $entry = array();
51
	function DiaryEvent($calendar)
51
	function DiaryEvent($calendar)
52
	{
52
	{
53
		Calendar_Decorator::Calendar_Decorator($calendar);
53
		Calendar_Decorator::Calendar_Decorator($calendar);
54
	}
54
	}
55
	function setEntry($entry)
55
	function setEntry($entry)
56
	{
56
	{
57
		$this->entry[] = $entry;
57
		$this->entry[] = $entry;
58
		
58
		
59
	}
59
	}
60
	function getEntry()
60
	function getEntry()
61
	{
61
	{
62
		return $this->entry;
62
		return $this->entry;
63
	}
63
	}
64
} 
64
} 
65
 
65
 
66
 
66
 
67
// $type : calendrier
67
// $type : calendrier
68
// $type : calendrier_appplette
68
// $type : calendrier_appplette
69
function GestionAffichageCalendrier($arguments = array(), $type = 'calendrier') {
69
function GestionAffichageCalendrier($arguments = array(), $type = 'calendrier') {
70
	
70
	
71
	// recuperation des arguments de l applette
71
	// recuperation des arguments de l applette
72
	$balise = isset ($arguments[0]) ? $arguments[0] : '';
72
	$balise = isset ($arguments[0]) ? $arguments[0] : '';
73
    $tab_arguments = $arguments;
73
    $tab_arguments = $arguments;
74
	unset($tab_arguments[0]);
74
	unset($tab_arguments[0]);
75
	if (is_array($tab_arguments)) {
75
	if (is_array($tab_arguments)) {
76
	    foreach($tab_arguments as $argument) {
76
	    foreach($tab_arguments as $argument) {
77
	    	if ($argument != '') {
77
	    	if ($argument != '') {
78
		    	$tab_parametres = explode('=', $argument, 2);
78
		    	$tab_parametres = explode('=', $argument, 2);
-
 
79
		    	if (is_array($tab_parametres)) {
-
 
80
		    		$options[$tab_parametres[0]] = 
79
		    	$options[$tab_parametres[0]] = trim($tab_parametres[1], '"');
81
		    		(isset($tab_parametres[1])? trim($tab_parametres[1], '"') : '') ;		    		
-
 
82
		    	}
80
	    	}
83
	    	}
81
	    }
84
	    }
82
	}
85
	}
83
    
86
    
84
    if (!isset($options['template'])) {
87
    if (!isset($options['template'])) {
85
		$options['template'] = BAZ_CHEMIN_SQUELETTE.BAZ_SQUELETTE_DEFAUT;
88
		$options['template'] = BAZ_CHEMIN_SQUELETTE.BAZ_SQUELETTE_DEFAUT;
86
	} else {
89
	} else {
87
		if (file_exists(BAZ_CHEMIN_SQUELETTE.$options['template'])) {
90
		if (file_exists(BAZ_CHEMIN_SQUELETTE.$options['template'])) {
88
			$options['template'] = BAZ_CHEMIN_SQUELETTE.$options['template'];
91
			$options['template'] = BAZ_CHEMIN_SQUELETTE.$options['template'];
89
		}
92
		}
90
	}
93
	}
91
    
94
    
92
	$retour = '';
95
	$retour = '';
93
 
96
 
94
	$url = $GLOBALS['_GEN_commun']['url'] ;
97
	$url = $GLOBALS['_GEN_commun']['url'] ;
95
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
98
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
96
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
99
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
97
	
100
	
98
	if (!isset($_GET['y'])) { 
101
	if (!isset($_GET['y'])) { 
99
		$_GET['y'] = date('Y');
102
		$_GET['y'] = date('Y');
100
	}
103
	}
101
	
104
	
102
	if (!isset($_GET['m'])) { 
105
	if (!isset($_GET['m'])) { 
103
		$_GET['m'] = date('m');
106
		$_GET['m'] = date('m');
104
	}
107
	}
105
	
108
	
106
	// 	Construction Mois en Cours 
109
	// 	Construction Mois en Cours 
107
	$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
110
	$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
108
 
111
 
109
	$curStamp = $month->getTimeStamp();
112
	$curStamp = $month->getTimeStamp();
110
	$url->addQueryString('y', date('Y',$curStamp));
113
	$url->addQueryString('y', date('Y',$curStamp));
111
	$url->addQueryString('m', date('n',$curStamp));
114
	$url->addQueryString('m', date('n',$curStamp));
112
	$url->addQueryString('d', date('j',$curStamp));
115
	$url->addQueryString('d', date('j',$curStamp));
113
	$cur = $url->getUrl();
116
	$cur = $url->getUrl();
114
	
117
	
115
	// Navigation 
118
	// Navigation 
116
	$prevStamp = $month->prevMonth(true);
119
	$prevStamp = $month->prevMonth(true);
117
	$url->addQueryString('y', date('Y',$prevStamp));
120
	$url->addQueryString('y', date('Y',$prevStamp));
118
	$url->addQueryString('m', date('n',$prevStamp));
121
	$url->addQueryString('m', date('n',$prevStamp));
119
	$url->addQueryString('d', date('j',$prevStamp));
122
	$url->addQueryString('d', date('j',$prevStamp));
120
	$prev = $url->getUrl();
123
	$prev = $url->getUrl();
121
	
124
	
122
	$nextStamp = $month->nextMonth(true);
125
	$nextStamp = $month->nextMonth(true);
123
	$url->addQueryString('y', date('Y',$nextStamp));
126
	$url->addQueryString('y', date('Y',$nextStamp));
124
	$url->addQueryString('m', date('n',$nextStamp));
127
	$url->addQueryString('m', date('n',$nextStamp));
125
	$url->addQueryString('d', date('j',$nextStamp));
128
	$url->addQueryString('d', date('j',$nextStamp));
126
	$next = $url->getUrl();
129
	$next = $url->getUrl();
127
	
130
	
128
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
131
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
129
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
132
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
130
 
133
 
131
	// Appel du template
134
	// Appel du template
132
 
135
 
133
	ob_start();
136
	ob_start();
134
	include ($options['template']);
137
	include ($options['template']);
135
	$retour .= ob_get_contents();
138
	$retour .= ob_get_contents();
136
	ob_end_clean();
139
	ob_end_clean();
137
	
140
	
138
 
141
 
139
	// Vue Mois calendrier ou vue applette
142
	// Vue Mois calendrier ou vue applette
140
		
143
		
141
	if ((!isset($_GET['id_fiche']) && ($type=='calendrier')) || ($type=='calendrier_applette')){
144
	if ((!isset($_GET['id_fiche']) && ($type=='calendrier')) || ($type=='calendrier_applette')){
142
			
145
			
143
		// Recherche evenement de la periode selectionnée 
146
		// Recherche evenement de la periode selectionnée 
144
		
147
		
145
	 	// TODO : Selectionner element du mois en cours 
148
	 	// TODO : Selectionner element du mois en cours 
146
	 	
149
	 	
147
	    $requete_evenements = 	"SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, DAY(bf_date_debut_evenement) AS bf_jour_debut_evenement , bf_date_fin_evenement, bf_description ".
150
	    $requete_evenements = 	"SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, DAY(bf_date_debut_evenement) AS bf_jour_debut_evenement , bf_date_fin_evenement, bf_description ".
148
								"FROM bazar_fiche, bazar_nature ".
151
								"FROM bazar_fiche, bazar_nature ".
149
								"WHERE YEAR(bf_date_debut_evenement) = ".date('Y',$curStamp)." ".
152
								"WHERE YEAR(bf_date_debut_evenement) = ".date('Y',$curStamp)." ".
150
								"AND month(bf_date_debut_evenement) = ".date('m',$curStamp)." ".
153
								"AND month(bf_date_debut_evenement) = ".date('m',$curStamp)." ".
151
								"AND bf_ce_nature = bn_id_nature ".
154
								"AND bf_ce_nature = bn_id_nature ".
152
								"AND bn_id_nature IN (".BAZ_NUM_ANNONCE_CALENDRIER.") ".
155
								"AND bn_id_nature IN (".BAZ_NUM_ANNONCE_CALENDRIER.") ".
153
								"AND bf_statut_fiche = 1 ".
156
								"AND bf_statut_fiche = 1 ".
154
								"ORDER BY bf_jour_debut_evenement";
157
								"ORDER BY bf_jour_debut_evenement";
155
		
158
		
156
	   	$resultat_evenement = $db->query($requete_evenements);
159
	   	$resultat_evenement = $db->query($requete_evenements);
157
	   	
160
	   	
158
	    (DB::isError($resultat_evenement))
161
	    (DB::isError($resultat_evenement))
159
	    ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements))
162
	    ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements))
160
	    : '';
163
	    : '';
161
	
164
	
162
		$calcom="";
165
		$calcom="";
163
		
166
		
164
		$selection=array();
167
		$selection=array();
165
		$evenements=array();
168
		$evenements=array();
166
		 
169
		 
167
		$prev_curday_ymd=0;
170
		$prev_curday_ymd=0;
168
		
171
		
169
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
172
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
170
	    	
173
	    	
171
			$curday_ymd=date('Ym',$curStamp).$ligne_evenements->bf_jour_debut_evenement;
174
			$curday_ymd=date('Ym',$curStamp).$ligne_evenements->bf_jour_debut_evenement;
172
			if ($curday_ymd!=$prev_curday_ymd) {
175
			if ($curday_ymd!=$prev_curday_ymd) {
173
				$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), $ligne_evenements->bf_jour_debut_evenement);
176
				$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), $ligne_evenements->bf_jour_debut_evenement);
174
				$DiaryEvent = new DiaryEvent($Day);
177
				$DiaryEvent = new DiaryEvent($Day);
175
				$prev_curday_ymd=$curday_ymd;
178
				$prev_curday_ymd=$curday_ymd;
176
			}
179
			}
177
			
180
			
178
			$DiaryEvent->setEntry($ligne_evenements);
181
			$DiaryEvent->setEntry($ligne_evenements);
179
			
182
			
180
			// Add the decorator to the selection
183
			// Add the decorator to the selection
181
			$selection[] = $DiaryEvent;
184
			$selection[] = $DiaryEvent;
182
				
185
				
183
		}
186
		}
184
			
187
			
185
		// Affichage Calendrier
188
		// Affichage Calendrier
186
		
189
		
187
		
190
		
188
		$month->build($selection);
191
		$month->build($selection);
189
	
192
	
190
		if ($type=='calendrier') {
193
		if ($type=='calendrier') {
191
			$retour.= "<table class=\"calendar\">
194
			$retour.= "<table class=\"calendar\">
192
			 <tr>
195
			 <tr>
193
			
196
			
194
			  <th> ". BAZ_LUNDI ."</th>
197
			  <th> ". BAZ_LUNDI ."</th>
195
			  <th> ". BAZ_MARDI ."</th>
198
			  <th> ". BAZ_MARDI ."</th>
196
			  <th> ". BAZ_MERCREDI ."</th>
199
			  <th> ". BAZ_MERCREDI ."</th>
197
			  <th> ". BAZ_JEUDI ."</th>
200
			  <th> ". BAZ_JEUDI ."</th>
198
			  <th> ". BAZ_VENDREDI ."</th>
201
			  <th> ". BAZ_VENDREDI ."</th>
199
			  <th> ". BAZ_SAMEDI ."</th>
202
			  <th> ". BAZ_SAMEDI ."</th>
200
			  <th> ". BAZ_DIMANCHE ."</th>
203
			  <th> ". BAZ_DIMANCHE ."</th>
201
			 </tr>
204
			 </tr>
202
			 ";
205
			 ";
203
		}
206
		}
204
		else {
207
		else {
205
			$retour.= "<table class=\"calendar\">
208
			$retour.= "<table class=\"calendar\">
206
			 <tr>
209
			 <tr>
207
			
210
			
208
			  <th> ". BAZ_LUNDI_COURT ."</th>
211
			  <th> ". BAZ_LUNDI_COURT ."</th>
209
			  <th> ". BAZ_MARDI_COURT ."</th>
212
			  <th> ". BAZ_MARDI_COURT ."</th>
210
			  <th> ". BAZ_MERCREDI_COURT ."</th>
213
			  <th> ". BAZ_MERCREDI_COURT ."</th>
211
			  <th> ". BAZ_JEUDI_COURT ."</th>
214
			  <th> ". BAZ_JEUDI_COURT ."</th>
212
			  <th> ". BAZ_VENDREDI_COURT ."</th>
215
			  <th> ". BAZ_VENDREDI_COURT ."</th>
213
			  <th> ". BAZ_SAMEDI_COURT ."</th>
216
			  <th> ". BAZ_SAMEDI_COURT ."</th>
214
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
217
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
215
			 </tr>
218
			 </tr>
216
			 ";
219
			 ";
217
		}
220
		}
218
		
221
		
219
			
222
			
220
		$todayStamp=time();
223
		$todayStamp=time();
221
		
224
		
222
		$today_ymd=date('Ymd',$todayStamp);
225
		$today_ymd=date('Ymd',$todayStamp);
223
	
226
	
224
		// Other month : mois 
227
		// Other month : mois 
225
		//
228
		//
226
		
229
		
227
		while ($day = $month->fetch() ) {
230
		while ($day = $month->fetch() ) {
228
				
231
				
229
				$dayStamp = $day->thisDay(true);
232
				$dayStamp = $day->thisDay(true);
230
				$day_ymd=date('Ymd',$dayStamp);
233
				$day_ymd=date('Ymd',$dayStamp);
231
				
234
				
232
				if ( $day->isEmpty() ) {
235
				if ( $day->isEmpty() ) {
233
						$class = "other_month";
236
						$class = "other_month";
234
				}
237
				}
235
				else {
238
				else {
236
					if (($day_ymd < $today_ymd)) {
239
					if (($day_ymd < $today_ymd)) {
237
						$class= "previous_month";
240
						$class= "previous_month";
238
					}
241
					}
239
					else {
242
					else {
240
						 if ($day_ymd == $today_ymd) {
243
						 if ($day_ymd == $today_ymd) {
241
						 	$class= "current_day";
244
						 	$class= "current_day";
242
						 }
245
						 }
243
						 else {
246
						 else {
244
							$class="current_month";
247
							$class="current_month";
245
						 }
248
						 }
246
					}
249
					}
247
				}
250
				}
248
				
251
				
249
				$url->addQueryString ('y', date('Y',$dayStamp));
252
				$url->addQueryString ('y', date('Y',$dayStamp));
250
				$url->addQueryString ('m', date('n',$dayStamp));
253
				$url->addQueryString ('m', date('n',$dayStamp));
251
				$url->addQueryString ('d', date('j',$dayStamp));
254
				$url->addQueryString ('d', date('j',$dayStamp));
252
				
255
				
253
				$link = $url->getUrl();
256
				$link = $url->getUrl();
254
			
257
			
255
				// isFirst() to find start of week
258
				// isFirst() to find start of week
256
				if ($day->isFirst())
259
				if ($day->isFirst())
257
					$retour.= ( "<tr>\n" );
260
					$retour.= ( "<tr>\n" );
258
				
261
				
259
				//$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" );
262
				//$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" );
260
				
263
				
261
				if ($type=='calendrier') {
264
				if ($type=='calendrier') {
262
					$retour.= "<td class=\"".$class."\">".$day->thisDay()."\n";
265
					$retour.= "<td class=\"".$class."\">".$day->thisDay()."\n";
263
					if ($day->isSelected() ) {
266
					if ($day->isSelected() ) {
264
						$evenements=$day->getEntry();
267
						$evenements=$day->getEntry();
265
						while ($ligne_evenement=array_pop($evenements)) {
268
						while ($ligne_evenement=array_pop($evenements)) {
266
							$id_fiches=array();
269
							$id_fiches=array();
267
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
270
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
268
							$url->addQueryString ('id_fiches',$id_fiches);
271
							$url->addQueryString ('id_fiches',$id_fiches);
269
							$link = $url->getUrl();
272
							$link = $url->getUrl();
270
							$retour.= "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n";
273
							$retour.= "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n";
271
							$url->removeQueryString ('id_fiches');
274
							$url->removeQueryString ('id_fiches');
272
						}
275
						}
273
					}
276
					}
274
				}
277
				}
275
				else {
278
				else {
276
				
279
				
277
					$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n";
280
					$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n";
278
					if ($day->isSelected() ) {
281
					if ($day->isSelected() ) {
279
						$evenements=$day->getEntry();
282
						$evenements=$day->getEntry();
280
						$id_fiches=array();
283
						$id_fiches=array();
281
						while ($ligne_evenement=array_pop($evenements)) {
284
						while ($ligne_evenement=array_pop($evenements)) {
282
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
285
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
283
						}
286
						}
284
						$url->addQueryString ('id_fiches',$id_fiches);
287
						$url->addQueryString ('id_fiches',$id_fiches);
285
						$link = $url->getUrl();
288
						$link = $url->getUrl();
286
						$lien_date= "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n";
289
						$lien_date= "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n";
287
						$url->removeQueryString ('id_fiches');
290
						$url->removeQueryString ('id_fiches');
288
					}
291
					}
289
					$retour.=$lien_date;
292
					$retour.=$lien_date;
290
				}
293
				}
291
				
294
				
292
				$retour.= ( "</td>\n" );
295
				$retour.= ( "</td>\n" );
293
				
296
				
294
				// isLast() to find end of week
297
				// isLast() to find end of week
295
				if ( $day->isLast() )
298
				if ( $day->isLast() )
296
					$retour.= ( "</tr>\n" );
299
					$retour.= ( "</tr>\n" );
297
			}
300
			}
298
		
301
		
299
			$retour.= "</table>";
302
			$retour.= "</table>";
300
			
303
			
301
			
304
			
302
		}
305
		}
303
		
306
		
304
		// Vue detail
307
		// Vue detail
305
		
308
		
306
		if ((isset($_GET['id_fiches']))) {
309
		if ((isset($_GET['id_fiches']))) {
307
				// Ajout des styles du bazar
310
				// Ajout des styles du bazar
308
				if (defined('PAP_VERSION')) { //si on est dans Papyrus
311
				if (defined('PAP_VERSION')) { //si on est dans Papyrus
309
					GEN_stockerStyleExterne( 'bazar_interne2', 'client/bazar/bazar.interne.css');
312
					GEN_stockerStyleExterne( 'bazar_interne2', 'client/bazar/bazar.interne.css');
310
				}
313
				}
311
			
314
			
312
				// Ajout d'un titre pour la page avec la date
315
				// Ajout d'un titre pour la page avec la date
313
				$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ;
316
				$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ;
314
				$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
317
				$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
315
								'octobre', 'novembre', 'décembre') ;
318
								'octobre', 'novembre', 'décembre') ;
316
				$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
319
				$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
317
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
320
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
318
								' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
321
								' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
319
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(0,$_GET['id_fiches'] );
322
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(0,$_GET['id_fiches'] );
320
		}
323
		}
321
 
324
 
322
		// Nettoyage de l'url
325
		// Nettoyage de l'url
323
		$url->removeQueryString('id_fiches');
326
		$url->removeQueryString('id_fiches');
324
		$url->removeQueryString('y');
327
		$url->removeQueryString('y');
325
		$url->removeQueryString('m');
328
		$url->removeQueryString('m');
326
		$url->removeQueryString('d');
329
		$url->removeQueryString('d');
327
			
330
			
328
		return $retour;
331
		return $retour;
329
	}
332
	}
330
?>
333
?>