Subversion Repositories Applications.bazar

Rev

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

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