Subversion Repositories Applications.bazar

Rev

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

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