Subversion Repositories Applications.bazar

Rev

Rev 267 | Rev 290 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 267 Rev 279
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: bazar.fonct.cal.php,v 1.21 2007-06-25 14:46:10 florian Exp $
22
// CVS : $Id: bazar.fonct.cal.php,v 1.22 2007-07-05 10:40:25 alexandre_tb 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.21 $ $Date: 2007-06-25 14:46:10 $
32
*@version       $Revision: 1.22 $ $Date: 2007-07-05 10:40:25 $
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
Line 35... Line 35...
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
Line 96... Line 96...
96
 
96
 
97
	$url = $GLOBALS['_GEN_commun']['url'] ;
97
	$url = $GLOBALS['_GEN_commun']['url'] ;
98
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
98
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
Line -... Line 99...
-
 
99
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
-
 
100
	
-
 
101
	// Nettoyage de l'url de la query string
-
 
102
	$chaine_url = $url->getQueryString();
-
 
103
	$tab_params = explode('&amp;', $chaine_url);
-
 
104
	if (count($tab_params) == 0) {
-
 
105
		$tab_params = explode('&', $chaine_url);
-
 
106
	}
-
 
107
	foreach ($tab_params as $param) {
-
 
108
		$tab_parametre = explode('=', $param);
-
 
109
		$url->removeQueryString($tab_parametre[0]);
99
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
110
	}
100
	
111
	
101
	if (!isset($_GET['y'])) { 
112
	if (!isset($_GET['y'])) { 
Line 102... Line 113...
102
		$_GET['y'] = date('Y');
113
		$_GET['y'] = date('Y');
Line 112... Line 123...
112
	$curStamp = $month->getTimeStamp();
123
	$curStamp = $month->getTimeStamp();
113
	$url->addQueryString('y', date('Y',$curStamp));
124
	$url->addQueryString('y', date('Y',$curStamp));
114
	$url->addQueryString('m', date('n',$curStamp));
125
	$url->addQueryString('m', date('n',$curStamp));
115
	$url->addQueryString('d', date('j',$curStamp));
126
	$url->addQueryString('d', date('j',$curStamp));
116
	$cur = $url->getUrl();
127
	$cur = $url->getUrl();
-
 
128
 
-
 
129
	// Gestion de l'affichage des titres des évènements
-
 
130
	if (isset($_GET['ctt']) && $_GET['ctt'] == '1') {
-
 
131
		$url->addQueryString('tt', '0');
-
 
132
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
-
 
133
			$url->addQueryString('tt', '1');
-
 
134
		}
-
 
135
		$tc_lien = $url->getUrl();
-
 
136
	} else {
-
 
137
		$url->addQueryString('tt', '0');
-
 
138
		if (isset($_GET['tt']) && $_GET['tt'] == '0') {
-
 
139
			$url->addQueryString('tt', '1');
-
 
140
		}
-
 
141
		$url->addQueryString('ctt', '1');
-
 
142
		$tc_lien = $url->getUrl();
-
 
143
	}
-
 
144
	$url->removeQueryString('ctt');
-
 
145
	$url->removeQueryString('tt');
-
 
146
	$tc_txt = 'Afficher les titres complets des évènements';
-
 
147
	if (isset($_GET['tt']) && $_GET['tt'] == '0') {
-
 
148
		$tc_txt = 'Tronquer les titres des évènements';
-
 
149
		$url->addQueryString('tt', $_GET['tt']);
-
 
150
	}
Line 117... Line 151...
117
	
151
	
118
	// Navigation 
152
	// Navigation 
119
	$prevStamp = $month->prevMonth(true);
153
	$prevStamp = $month->prevMonth(true);
120
	$url->addQueryString('y', date('Y',$prevStamp));
154
	$url->addQueryString('y', date('Y',$prevStamp));
Line 126... Line 160...
126
	$url->addQueryString('y', date('Y',$nextStamp));
160
	$url->addQueryString('y', date('Y',$nextStamp));
127
	$url->addQueryString('m', date('n',$nextStamp));
161
	$url->addQueryString('m', date('n',$nextStamp));
128
	$url->addQueryString('d', date('j',$nextStamp));
162
	$url->addQueryString('d', date('j',$nextStamp));
129
	$next = $url->getUrl();
163
	$next = $url->getUrl();
Line -... Line 164...
-
 
164
	
-
 
165
	// Suppression du paramêtre de troncage des titres
-
 
166
	$url->removeQueryString('tt');
130
	
167
	
131
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
168
	$fr_month = array(	"1"=>BAZ_JANVIER,"2"=>BAZ_FEVRIER,"3"=>BAZ_MARS,"4"=>BAZ_AVRIL,"5"=>BAZ_MAI,"6"=>BAZ_JUIN,
Line -... Line 169...
-
 
169
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
-
 
170
 
132
						"7"=>BAZ_JUILLET,"8"=>BAZ_AOUT,"9"=>BAZ_SEPTEMBRE,"10"=>BAZ_OCTOBRE,"11"=>BAZ_NOVEMBRE,"12"=>BAZ_DECEMBRE);
171
	// Titre
-
 
172
	if ($type == 'calendrier') {
-
 
173
		// Ajout des styles du bazar
-
 
174
		if (defined('PAP_VERSION')) { //si on est dans Papyrus
-
 
175
			GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
-
 
176
			GEN_stockerFichierScript('domLib', '/api/js/domtooltip/domLib.js');
-
 
177
			GEN_stockerFichierScript('domTT', '/api/js/domtooltip/domTT.js');
-
 
178
			// DomToolTip
-
 
179
			$script = 'var domTT_styleClass = "niceTitle";'."\n";
-
 
180
			$script .= 'function nicetitleDecorator(el) {'."\n";
-
 
181
			$script .= '	var result = el.title;'."\n";
-
 
182
			$script .= '	result = result.replace(new RegExp("\n", "g"), "<br />");'."\n";
-
 
183
			$script .= '	if (el.href) {'."\n";
-
 
184
			$script .= '		result += "<p>" + el.href + "</p>";'."\n";
-
 
185
			$script .= '	}'."\n";
-
 
186
			$script .= '	return result;'."\n";
-
 
187
			$script .= '}'."\n";
-
 
188
			$script .= 'domTT_replaceTitles(nicetitleDecorator);'."\n";
-
 
189
			GEN_stockerCodeScript('var domTT_styleClass = "niceTitle";'."\n");
-
 
190
		}
-
 
191
		$retour .= '<div id="cal_entete">';
-
 
192
		$retour .= '<span class="cal_navigation">';	
-
 
193
		$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>'; 
-
 
194
		$retour .= '&nbsp;&nbsp;';
-
 
195
		$retour .= '<span id="cal_encadre_mois_courrant"><a id="cal_mois_courrant" href="'.$cur.'">';
-
 
196
		$retour .= $fr_month[(date('n',$curStamp))]; 
-
 
197
		$retour .= '&nbsp;';
-
 
198
		$retour .= (date('Y',$curStamp));
-
 
199
		$retour .= '</a></span>';
-
 
200
		$retour .= '&nbsp;&nbsp;';
-
 
201
		$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>';
-
 
202
		$retour .= '</span>';
133
 
203
		$retour .= '<h1 id="cal_titre"><img id="cal_titre_img" src="client/bazar/images/cal_titre.png" alt="Calendrier"/></h1>';
-
 
204
		$retour .= '</div>';
-
 
205
		
-
 
206
		$retour .= '<p>'.'<a href="'.$tc_lien.'">'.$tc_txt.'</a>'.'</p>';
134
	// Appel du template
207
	} else {
135
 
208
		// Appel du template
136
	ob_start();
209
		ob_start();
137
	include ($options['template']);
210
		include $options['template'];
138
	$retour .= ob_get_contents();
-
 
139
	ob_end_clean();
211
		$retour .= ob_get_contents();
140
	
212
		ob_end_clean();
Line 141... Line 213...
141
 
213
	}
142
	// Vue Mois calendrier ou vue applette
-
 
-
 
214
	// Vue Mois calendrier ou vue applette
143
		
215
		
144
	if ((!isset($_GET['id_fiche']) && ($type=='calendrier')) || ($type=='calendrier_applette')){
-
 
-
 
216
	if ((!isset($_GET['id_fiche']) && $type == 'calendrier') || ($type == 'calendrier_applette')){
145
			
217
		trigger_error('ICI', E_USER_NOTICE);
146
		// Recherche evenement de la periode selectionnée 
-
 
147
		
218
		// Recherche evenement de la periode selectionnée 
148
	 	// TODO : Selectionner element du mois en cours 
219
		$ts_jour_fin_mois = $month->nextMonth('timestamp');
149
	 	
220
		$ts_jour_debut_mois = $month->thisMonth('timestamp');; 
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 ".
221
	    $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 ".
151
								"FROM bazar_fiche, bazar_nature ".
222
								"FROM bazar_fiche, bazar_nature ".
152
								"WHERE YEAR(bf_date_debut_evenement) = ".date('Y',$curStamp)." ".
223
								"WHERE bf_date_debut_evenement < '".date('Y-m-d', $ts_jour_fin_mois)."' ".
153
								"AND month(bf_date_debut_evenement) = ".date('m',$curStamp)." ".
224
								"AND bf_date_fin_evenement >= '".date('Y-m-d', $ts_jour_debut_mois)."' ".
154
								"AND bf_ce_nature = bn_id_nature ".
225
								"AND bf_ce_nature = bn_id_nature ".
Line 155... Line 226...
155
								"AND bn_id_nature IN (".BAZ_NUM_ANNONCE_CALENDRIER.") ".
226
								"AND bn_id_nature IN (".BAZ_NUM_ANNONCE_CALENDRIER.") ".
Line 156... Line -...
156
								"AND bf_statut_fiche = 1 ".
-
 
157
								"ORDER BY bf_jour_debut_evenement";
227
								"AND bf_statut_fiche = 1 ".
158
		
-
 
159
	   	$resultat_evenement = $db->query($requete_evenements);
-
 
160
	   	
-
 
161
	    (DB::isError($resultat_evenement))
228
								"ORDER BY bf_jour_debut_evenement";
162
	    ? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements))
229
		
163
	    : '';
230
	   	$resultat_evenement = $db->query($requete_evenements);
164
	
-
 
-
 
231
	   	
-
 
232
	    (DB::isError($resultat_evenement)) ? trigger_error(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements), E_USER_WARNING) : '';
165
		$calcom="";
233
 
166
		
-
 
167
		$selection=array();
234
		$selection = array();
168
		$evenements=array();
-
 
169
		 
235
		$evenements = array();
170
		$prev_curday_ymd=0;
-
 
171
		
236
		$annee = date('Y', $curStamp);
172
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
173
	    	
-
 
174
			$curday_ymd=date('Ym',$curStamp).$ligne_evenements->bf_jour_debut_evenement;
-
 
175
			if ($curday_ymd!=$prev_curday_ymd) {
-
 
176
				$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), $ligne_evenements->bf_jour_debut_evenement);
-
 
Line -... Line 237...
-
 
237
		$mois = date('m', $curStamp);
-
 
238
		$tablo_jours = array();
-
 
239
	    while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
-
 
240
			list($annee_debut, $mois_debut, $jour_debut) = explode('-', $ligne_evenements->bf_date_debut_evenement);
-
 
241
			list($annee_fin, $mois_fin, $jour_fin) = explode('-', $ligne_evenements->bf_date_fin_evenement);
177
				$DiaryEvent = new DiaryEvent($Day);
242
			
178
				$prev_curday_ymd=$curday_ymd;
243
			$Calendrier = new Calendar($annee_debut, $mois_debut, $jour_debut);
-
 
244
			$ts_jour_suivant = $Calendrier->thisDay('timestamp');
-
 
245
			$ts_jour_fin = mktime(0,0,0,$mois_fin, $jour_fin, $annee_fin);
-
 
246
			
-
 
247
	    	if ($ts_jour_suivant < $ts_jour_fin) {
-
 
248
				//echo "$ts_jour_suivant-";
-
 
249
				$naviguer = true;
-
 
250
				while ($naviguer) {
-
 
251
					// Si le jours suivant est inférieur à la date de fin, on continue...
-
 
252
					if ($ts_jour_suivant <= $ts_jour_fin) {
-
 
253
						// Si le jours suivant est inférieur à la date de fin du mois courrant, on continue...
-
 
254
						if ($ts_jour_suivant < $ts_jour_fin_mois) {
179
			}
255
							$cle_j = date('Y-m-d', $ts_jour_suivant);
-
 
256
							if (!isset($tablo_jours[$cle_j])) {
-
 
257
								$tablo_jours[$cle_j]['Calendar_Day'] = new Calendar_Day(date('Y', $ts_jour_suivant),date('m', $ts_jour_suivant), date('d', $ts_jour_suivant));
-
 
258
								$tablo_jours[$cle_j]['Diary_Event'] = new DiaryEvent($tablo_jours[$cle_j]['Calendar_Day']);
-
 
259
							}
-
 
260
							$tablo_jours[$cle_j]['Diary_Event']->setEntry($ligne_evenements);
-
 
261
							
-
 
262
							$ts_jour_suivant = $Calendrier->nextDay('timestamp');
-
 
263
							//echo "ici$ts_jour_suivant-";
-
 
264
							$Calendrier->setTimestamp($ts_jour_suivant);
-
 
265
							//echo "la".$Calendrier->thisDay('timestamp')."-";
-
 
266
						} else {
-
 
267
							$naviguer = false;
-
 
268
						}
-
 
269
					} else {
-
 
270
						$naviguer = false;
-
 
271
					}
-
 
272
				}
-
 
273
	    	} else { 
-
 
274
				$curday_ymd = $annee.$mois.$ligne_evenements->bf_jour_debut_evenement;
-
 
275
				$cle_j = $annee.'-'.$mois.'-'.$ligne_evenements->bf_jour_debut_evenement;
180
			
276
				if (!isset($tablo_jours[$cle_j])) {
-
 
277
					$tablo_jours[$cle_j]['Calendar_Day'] = new Calendar_Day($annee, $mois, $ligne_evenements->bf_jour_debut_evenement);
-
 
278
					$tablo_jours[$cle_j]['Diary_Event'] = new DiaryEvent($tablo_jours[$cle_j]['Calendar_Day']);
-
 
279
				}
-
 
280
				$tablo_jours[$cle_j]['Diary_Event']->setEntry($ligne_evenements);
181
			$DiaryEvent->setEntry($ligne_evenements);
281
	    	}
182
			
282
		}
183
			// Add the decorator to the selection
-
 
184
			$selection[] = $DiaryEvent;
-
 
185
				
283
		// Add the decorator to the selection
186
		}
-
 
187
			
284
		foreach ($tablo_jours as $jour) {
188
		// Affichage Calendrier
285
			$selection[] = $jour['Diary_Event'];				
-
 
286
		}
-
 
287
	
-
 
288
		// Affichage Calendrier
-
 
289
		$month->build($selection);
-
 
290
		if ($type == 'calendrier') {
-
 
291
			$retour.= '<table class="calendrier">'.
-
 
292
				'<colgroup>'.
-
 
293
					'<col class="cal_lundi"/>'.
-
 
294
					'<col class="cal_mardi"/>'.
-
 
295
					'<col class="cal_mercredi"/>'.
189
		
296
					'<col class="cal_jeudi"/>'.
Line 190... Line 297...
190
		
297
					'<col class="cal_vendredi"/>'.
191
		$month->build($selection);
298
					'<col class="cal_samedi"/>'.
192
	
299
					'<col class="cal_dimanche"/>'.
193
		if ($type=='calendrier') {
300
				'</colgroup>'.
194
			$retour.= "<table class=\"calendar\">
301
				'<thead>'.
195
			 <tr>
302
			 	"<tr>
196
			
303
			
197
			  <th> ". BAZ_LUNDI ."</th>
304
			  <th> ". BAZ_LUNDI ."</th>
198
			  <th> ". BAZ_MARDI ."</th>
305
			  <th> ". BAZ_MARDI ."</th>
199
			  <th> ". BAZ_MERCREDI ."</th>
-
 
200
			  <th> ". BAZ_JEUDI ."</th>
306
			  <th> ". BAZ_MERCREDI ."</th>
201
			  <th> ". BAZ_VENDREDI ."</th>
307
			  <th> ". BAZ_JEUDI ."</th>
-
 
308
			  <th> ". BAZ_VENDREDI ."</th>
-
 
309
			  <th> ". BAZ_SAMEDI ."</th>
-
 
310
			  <th> ". BAZ_DIMANCHE ."</th>
-
 
311
			 </tr>
-
 
312
			 ".'</thead>'.'<tbody>';
-
 
313
		} else {
-
 
314
			$retour.= '<table class="calendrier_applette">'.
-
 
315
				'<colgroup>'.
-
 
316
					'<col class="cal_lundi"/>'.
-
 
317
					'<col class="cal_mardi"/>'.
202
			  <th> ". BAZ_SAMEDI ."</th>
318
					'<col class="cal_mercredi"/>'.
Line 203... Line 319...
203
			  <th> ". BAZ_DIMANCHE ."</th>
319
					'<col class="cal_jeudi"/>'.
204
			 </tr>
320
					'<col class="cal_vendredi"/>'.
205
			 ";
321
					'<col class="cal_samedi"/>'.
206
		}
322
					'<col class="cal_dimanche"/>'.
207
		else {
323
				'</colgroup>'.
208
			$retour.= "<table class=\"calendar\">
324
				'<thead>'.
209
			 <tr>
325
			 "<tr>
210
			
326
			
211
			  <th> ". BAZ_LUNDI_COURT ."</th>
327
			  <th> ". BAZ_LUNDI_COURT ."</th>
212
			  <th> ". BAZ_MARDI_COURT ."</th>
328
			  <th> ". BAZ_MARDI_COURT ."</th>
Line 213... Line -...
213
			  <th> ". BAZ_MERCREDI_COURT ."</th>
-
 
214
			  <th> ". BAZ_JEUDI_COURT ."</th>
329
			  <th> ". BAZ_MERCREDI_COURT ."</th>
215
			  <th> ". BAZ_VENDREDI_COURT ."</th>
-
 
216
			  <th> ". BAZ_SAMEDI_COURT ."</th>
330
			  <th> ". BAZ_JEUDI_COURT ."</th>
217
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
331
			  <th> ". BAZ_VENDREDI_COURT ."</th>
218
			 </tr>
332
			  <th> ". BAZ_SAMEDI_COURT ."</th>
219
			 ";
-
 
220
		}
-
 
221
		
333
			  <th> ". BAZ_DIMANCHE_COURT ."</th>
222
			
-
 
223
		$todayStamp=time();
334
			 </tr>
224
		
335
			 ".'</thead>'.'<tbody>';
225
		$today_ymd=date('Ymd',$todayStamp);
-
 
226
	
336
		}
227
		// Other month : mois 
337
		
-
 
338
		$todayStamp=time();
-
 
339
		$today_ymd=date('Ymd',$todayStamp);
-
 
340
 
-
 
341
		// Other month : mois 
-
 
342
		while ($day = $month->fetch() ) {
-
 
343
			$dayStamp = $day->thisDay(true);
-
 
344
			$day_ymd = date('Ymd',$dayStamp);
-
 
345
			if ( $day->isEmpty() ) {
-
 
346
				$class = "cal_ma other_month";
228
		//
347
			} else {
229
		
-
 
230
		while ($day = $month->fetch() ) {
-
 
231
				
-
 
232
				$dayStamp = $day->thisDay(true);
-
 
233
				$day_ymd=date('Ymd',$dayStamp);
-
 
234
				
-
 
235
				if ( $day->isEmpty() ) {
-
 
236
						$class = "other_month";
-
 
237
				}
-
 
238
				else {
-
 
239
					if (($day_ymd < $today_ymd)) {
-
 
240
						$class= "previous_month";
-
 
241
					}
348
				if (($day_ymd < $today_ymd)) {
242
					else {
-
 
243
						 if ($day_ymd == $today_ymd) {
-
 
244
						 	$class= "current_day";
-
 
245
						 }
-
 
246
						 else {
-
 
247
							$class="current_month";
-
 
Line 248... Line 349...
248
						 }
349
					$class= "cal_mp previous_month";
249
					}
350
				} else {
250
				}
351
					 if ($day_ymd == $today_ymd) {
251
				
-
 
252
				$url->addQueryString ('y', date('Y',$dayStamp));
352
					 	$class= "cal_jc current_day";
253
				$url->addQueryString ('m', date('n',$dayStamp));
353
					 } else {
254
				$url->addQueryString ('d', date('j',$dayStamp));
354
						$class="cal_mc current_month";
255
				
-
 
256
				$link = $url->getUrl();
355
					 }
257
			
-
 
258
				// isFirst() to find start of week
-
 
259
				if ($day->isFirst())
356
				}
260
					$retour.= ( "<tr>\n" );
-
 
261
				
-
 
262
				//$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" );
-
 
263
				
-
 
264
				if ($type=='calendrier') {
-
 
265
					$retour.= "<td class=\"".$class."\">".$day->thisDay()."\n";
-
 
266
					if ($day->isSelected() ) {
-
 
267
						$evenements=$day->getEntry();
357
			}
268
						while ($ligne_evenement=array_pop($evenements)) {
358
			
269
							$id_fiches=array();
-
 
270
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
359
			$url->addQueryString ('y', date('Y',$dayStamp));
271
							$url->addQueryString ('id_fiches',$id_fiches);
360
			$url->addQueryString ('m', date('n',$dayStamp));
272
							$link = $url->getUrl();
361
			$url->addQueryString ('d', date('j',$dayStamp));
-
 
362
			$link = $url->getUrl();
273
							$retour.= "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n";
363
		
274
							$url->removeQueryString ('id_fiches');
364
			// isFirst() to find start of week
-
 
365
			if ($day->isFirst()) {
275
						}
366
				$retour.= ( "<tr>\n" );
276
					}
-
 
277
				}
367
			}
278
				else {
368
			if ($type == 'calendrier') {
-
 
369
				$retour.= "<td class=\"".$class."\">".'<span class="cal_j">'.$day->thisDay().'</span>'."\n";
-
 
370
				if ($day->isSelected() ) {
-
 
371
					$evenements = $day->getEntry();
-
 
372
					$evenements_nbre = count($evenements);
-
 
373
					$evenemt_xhtml = '';
-
 
374
					while ($ligne_evenement = array_pop($evenements)) {
-
 
375
						$id_fiches = array();
279
				
376
						$id_fiches[] = $ligne_evenement->bf_id_fiche;
280
					$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n";
377
						$url->addQueryString ('id_fiches',$id_fiches);
281
					if ($day->isSelected() ) {
378
						$link = $url->getUrl();
-
 
379
						
-
 
380
						if (!isset($_GET['tt']) || (isset($_GET['tt']) && $_GET['tt'] == '1')) {
282
						$evenements=$day->getEntry();
381
							$titre_taille = strlen($ligne_evenement->bf_titre);
-
 
382
							$titre = ($titre_taille > 20)?substr($ligne_evenement->bf_titre, 0, 20).'...':$ligne_evenement->bf_titre;
-
 
383
						} else {
283
						$id_fiches=array();
384
							$titre = $ligne_evenement->bf_titre;
284
						while ($ligne_evenement=array_pop($evenements)) {
-
 
285
							$id_fiches[]=$ligne_evenement->bf_id_fiche;
385
						}
286
						}
-
 
287
						$url->addQueryString ('id_fiches',$id_fiches);
386
						$evenemt_xhtml .= '<li class="tooltip" title="'.$ligne_evenement->bf_titre.'"><a class="cal_evenemt" href="'.$link.'">'.$titre.'</a></li>'."\n";
288
						$link = $url->getUrl();
387
						$url->removeQueryString ('id_fiches');
289
						$lien_date= "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n";
388
					}
290
						$url->removeQueryString ('id_fiches');
-
 
291
					}
-
 
292
					$retour.=$lien_date;
389
					if ($evenements_nbre > 0) {
293
				}
-
 
294
				
-
 
-
 
390
						$retour .= '<ul class="cal_evenemt_liste">';
-
 
391
						$retour .= $evenemt_xhtml;
295
				$retour.= ( "</td>\n" );
392
						$retour .= '</ul>';
296
				
-
 
297
				// isLast() to find end of week
-
 
298
				if ( $day->isLast() )
-
 
299
					$retour.= ( "</tr>\n" );
393
					}
300
			}
394
				}
301
		
395
			} else {
302
			$retour.= "</table>";
396
				$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n";
303
			
397
				if ($day->isSelected() ) {
-
 
398
					$evenements=$day->getEntry();
-
 
399
					$id_fiches=array();
-
 
400
					while ($ligne_evenement=array_pop($evenements)) {
Line 304... Line 401...
304
			
401
						$id_fiches[]=$ligne_evenement->bf_id_fiche;
305
		}
-
 
306
		
-
 
307
		// Vue detail
402
					}
308
		
403
					$url->addQueryString ('id_fiches',$id_fiches);
309
		if ((isset($_GET['id_fiches']))) {
-
 
310
				// Ajout des styles du bazar
-
 
311
				if (defined('PAP_VERSION')) { //si on est dans Papyrus
-
 
-
 
404
					$link = $url->getUrl();
312
					GEN_stockerStyleExterne( 'bazar_interne2', 'client/bazar/bazar.interne.css');
405
					$lien_date= "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n";
313
				}
-
 
314
			
-
 
315
				// Ajout d'un titre pour la page avec la date
-
 
316
				$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ;
-
 
317
				$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
-
 
318
								'octobre', 'novembre', 'décembre') ;
-
 
319
				$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
-
 
320
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
406
					$url->removeQueryString ('id_fiches');
321
								' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
407
				}
-
 
408
				$retour.=$lien_date;
-
 
409
			}
-
 
410
			$retour.= ( "</td>\n" );
-
 
411
			
-
 
412
			// isLast() to find end of week
-
 
413
			if ( $day->isLast() ) {
-
 
414
				$retour.= ( "</tr>\n" );
-
 
415
			}
-
 
416
		}
-
 
417
			$retour.= "</tbody></table>";
-
 
418
	}
-
 
419
	$retour.= '<script type="text/javascript">//<![CDATA['."\n".$script.'//]]></script>'."\n";
-
 
420
	// Vue detail
-
 
421
	
-
 
422
	if ((isset($_GET['id_fiches']))) {
-
 
423
		// Ajout d'un titre pour la page avec la date
-
 
424
		$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ;
-
 
425
		$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre',
-
 
426
						'octobre', 'novembre', 'décembre') ;
-
 
427
		$timestamp = strtotime ($_GET['y'].'/'.$_GET['m'].'/'.$_GET['d']) ;
-
 
428
		
-
 
429
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_NAVIGATION'] = '';
-
 
430
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_TETE'] = '';
-
 
431
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] = '<h1>'.$jours[date('w', $timestamp)].
-
 
432
						' '.$_GET['d'].' '.$mois[$_GET['m']-1].' '.$_GET['y'].'</h1>' ;
-
 
433
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(0,$_GET['id_fiches'] );
-
 
434
		$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_PIED'] = '';
322
				$GLOBALS['_PAPYRUS_']['rendu']['CONTENU_CORPS'] .= baz_voir_fiches(0,$_GET['id_fiches'] );
435
		$GLOBALS['_GEN_commun']['info_menu'] = '';
323
		}
436
	}