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