19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: bazar.fonct.cal.php,v 1.13 2007-03-08 15:12:13 jp_milcent Exp $ |
// CVS : $Id: bazar.fonct.cal.php,v 1.14 2007-03-14 18:14:42 jp_milcent Exp $ |
/** |
* |
* Fonctions calendrier du module bazar |
29,7 → 29,7 |
*@author David Delon <david.delon@clapas.net> |
//Autres auteurs : |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.13 $ $Date: 2007-03-08 15:12:13 $ |
*@version $Revision: 1.14 $ $Date: 2007-03-14 18:14:42 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
117,9 → 117,29 |
$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); |
|
// Titre |
if ($type=='calendrier') { |
// Ajout des styles du bazar |
if (defined('PAP_VERSION')) { //si on est dans Papyrus |
GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css'); |
} |
$retour .= '<div id="cal_entete">'; |
$retour .= '<span class="cal_navigation">'; |
$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>'; |
$retour .= ' '; |
$retour .= '<span id="cal_encadre_mois_courrant"><a id="cal_mois_courrant" href="'.$cur.'">'; |
$retour .= $fr_month[(date('n',$curStamp))]; |
$retour .= ' '; |
$retour .= (date('Y',$curStamp)); |
$retour .= '</a></span>'; |
$retour .= ' '; |
$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>'; |
$retour .= '</span>'; |
$retour .= '<h1 id="cal_titre"><img id="cal_titre_img" src="client/bazar/images/cal_titre.png" alt="Calendrier"/></h1>'; |
$retour .= '</div>'; |
} else { |
$retour.= "<div class=\"navi\">"; |
$retour.= "<a href=\"".$prev."\"> << </a>"; |
|
$retour.= " "; |
$retour.= "<a href=\"".$cur; |
$retour.= "\"> "; |
129,11 → 149,8 |
$retour.= "</a>"; |
$retour.= " "; |
$retour.= "<a href=\"".$next."\"> >> </a>"; |
|
$retour.= "</div>"; |
|
$retour.="<br></br>"; |
|
} |
// Vue Mois calendrier ou vue applette |
|
if ((!isset($_GET['id_fiche']) && ($type=='calendrier')) || ($type=='calendrier_applette')){ |
227,8 → 244,9 |
// Affichage Calendrier |
$month->build($selection); |
if ($type=='calendrier') { |
$retour.= "<table class=\"calendar\"> |
<tr> |
$retour.= '<table class="calendrier">'. |
'<thead>'. |
"<tr> |
|
<th> ". BAZ_LUNDI ."</th> |
<th> ". BAZ_MARDI ."</th> |
238,10 → 256,11 |
<th> ". BAZ_SAMEDI ."</th> |
<th> ". BAZ_DIMANCHE ."</th> |
</tr> |
"; |
".'</thead>'; |
} |
else { |
$retour.= "<table class=\"calendar\"> |
$retour.= '<table class="calendrier_applette">'. |
'<thead>'." |
<tr> |
|
<th> ". BAZ_LUNDI_COURT ."</th> |
252,7 → 271,7 |
<th> ". BAZ_SAMEDI_COURT ."</th> |
<th> ". BAZ_DIMANCHE_COURT ."</th> |
</tr> |
"; |
".'</thead>'.'<tbody>'; |
} |
|
|
269,18 → 288,18 |
$day_ymd=date('Ymd',$dayStamp); |
|
if ( $day->isEmpty() ) { |
$class = "other_month"; |
$class = "cal_ma"; |
} |
else { |
if (($day_ymd < $today_ymd)) { |
$class= "previous_month"; |
$class= "cal_mp"; |
} |
else { |
if ($day_ymd == $today_ymd) { |
$class= "current_day"; |
$class= "cal_jc"; |
} |
else { |
$class="current_month"; |
$class="cal_mc"; |
} |
} |
} |
288,30 → 307,33 |
$url->addQueryString ('y', date('Y',$dayStamp)); |
$url->addQueryString ('m', date('n',$dayStamp)); |
$url->addQueryString ('d', date('j',$dayStamp)); |
|
$link = $url->getUrl(); |
|
// isFirst() to find start of week |
if ($day->isFirst()) |
if ($day->isFirst()) { |
$retour.= ( "<tr>\n" ); |
|
//$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" ); |
|
} |
if ($type=='calendrier') { |
$retour.= "<td class=\"".$class."\">".$day->thisDay()."\n"; |
$retour.= "<td class=\"".$class."\">".'<span class="cal_j">'.$day->thisDay().'</span>'."\n"; |
if ($day->isSelected() ) { |
$evenements=$day->getEntry(); |
$evenements_nbre = count($evenements); |
$evenemt_xhtml = ''; |
while ($ligne_evenement=array_pop($evenements)) { |
$id_fiches=array(); |
$id_fiches[]=$ligne_evenement->bf_id_fiche; |
$url->addQueryString ('id_fiches',$id_fiches); |
$link = $url->getUrl(); |
$retour.= "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n"; |
$evenemt_xhtml .= '<li><a class="cal_evenemt" href="'.$link.'" title="'.$ligne_evenement->bf_titre.'">'.substr($ligne_evenement->bf_titre, 0, 20).'...</a></li>'."\n"; |
$url->removeQueryString ('id_fiches'); |
} |
if ($evenements_nbre > 0) { |
$retour .= '<ul class="cal_evenemt_liste">'; |
$retour .= $evenemt_xhtml; |
$retour .= '</ul>'; |
} |
} |
else { |
} else { |
$lien_date= "<td class=\"".$class."\">".$day->thisDay()."\n"; |
if ($day->isSelected() ) { |
$evenements=$day->getEntry(); |
334,7 → 356,7 |
$retour.= ( "</tr>\n" ); |
} |
|
$retour.= "</table>"; |
$retour.= "</tbody></table>"; |
|
|
} |
342,11 → 364,6 |
// Vue detail |
|
if ((isset($_GET['id_fiches']))) { |
// Ajout des styles du bazar |
if (defined('PAP_VERSION')) { //si on est dans Papyrus |
//GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css'); |
} |
|
// Ajout d'un titre pour la page avec la date |
$jours = array ('lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi', 'dimanche') ; |
$mois = array ('janvier', 'février', 'mars', 'avril', 'mai', 'juin', 'juillet', 'août', 'septembre', |