Subversion Repositories Applications.bazar

Compare Revisions

Ignore whitespace Rev 16 → Rev 17

/trunk/bazar.calendrier.php
32,7 → 32,7
// pris connaissance de la licence CeCILL, et que vous en avez accepté les
// termes.
// ----
// CVS : $Id: bazar.calendrier.php,v 1.2 2005-09-30 14:58:00 ddelon Exp $
// CVS : $Id: bazar.calendrier.php,v 1.3 2005-09-30 23:04:31 ddelon Exp $
/**
* bazar_calendrier : programme affichant les evenements du bazar sous forme de Calendrier
*
40,7 → 40,7
*@package Bazar
//Auteur original :
*@author David DELON <david.delon@clapas.net>
*@version $Revision: 1.2 $ $Date: 2005-09-30 14:58:00 $
*@version $Revision: 1.3 $ $Date: 2005-09-30 23:04:31 $
// +------------------------------------------------------------------------------------------------------+
*/
 
54,16 → 54,22
require_once 'Calendar/Day.php';
require_once 'Calendar/Decorator.php';
 
define ('BAZ_VOIR_FICHE', 8) ;
include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
include_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
 
 
 
// Classe Utilitaire pour Calendrier
 
class DiaryEvent extends Calendar_Decorator {
var $entry;
var $entry=array();
function DiaryEvent($calendar) {
Calendar_Decorator::Calendar_Decorator($calendar);
}
function setEntry($entry) {
$this->entry = $entry;
$this->entry[]=$entry;
}
function getEntry() {
return $this->entry;
72,6 → 78,11
 
 
function afficherContenuCorps() {
// Ajout d'une feuille de style externe
GEN_stockerStyleExterne ('wikini', 'client/bazar/presentations/styles/calendrier.css') ;
$retour='';
 
$url = $GLOBALS['_GEN_commun']['url'] ;
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
85,15 → 96,15
$_GET['m'] = date('m');
}
if (!isset($_GET['d'])) {
$_GET['d'] = date('d');
}
 
 
// Construction Mois en Cours
$month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']);
 
$curStamp=$month->getTimeStamp();
$url->addQueryString ('y', date('Y',$curStamp));
$url->addQueryString ('m', date('n',$curStamp));
$url->addQueryString ('d', date('j',$curStamp));
$cur = $url->getUrl();
// Navigation
$prevStamp = $month->prevMonth(true);
107,129 → 118,146
$url->addQueryString ('d', date('j',$nextStamp));
$next = $url->getUrl();
 
$fr_month=array("1"=>"Janvier","2"=>"Fevrier","3"=>"Mars","4"=>"Avril","5"=>"Mai","6"=>"Juin","7"=>"Juillet","8"=>"Aout","9"=>"Septembre","10"=>"Octobre","11"=>"Novembre","12"=>"Decembre");
$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);
 
$retour.= "<div class=\"navi\">";
$retour.= "<a href=\"".$prev."\"> &lt;&lt; </a>";
 
echo "<div class=\"navi\">";
echo "<a href=\"".$prev."\"> &lt;&lt; </a>";
$retour.= "&nbsp;&nbsp;";
$retour.= "<a href=\"".$cur;
$retour.= "\"> ";
$retour.= $fr_month[(date('n',$curStamp))];
$retour.= "&nbsp;";
$retour.= (date('Y',$curStamp));
$retour.= "</a>";
$retour.= "&nbsp;&nbsp;";
$retour.= "<a href=\"".$next."\"> &gt;&gt; </a>";
 
echo $fr_month[(date('n',$curStamp))];
echo "&nbsp;";
echo (date('Y',$curStamp));
$retour.= "</div>";
 
echo "<a href=\"".$next."\"> &gt;&gt; </a>";
$retour.="<br></br>";
 
echo "</div>";
 
 
// Recherche evenement de la periode selectionnée
 
$EvenementSelection=$this->tag.date('Y',$curStamp).date('m',$curStamp);
 
$selection = array();
// TODO : Selectionner element du mois en cours
$requete_evenements = "SELECT DISTINCT bf_id_fiche, bf_titre, bf_lieu_evenement, bf_date_debut_evenement, bf_date_fin_evenement, bf_description FROM bazar_fiche, bazar_nature where bf_date_debut_evenement=".$EvenementSelection." and bf_ce_nature=bn_id_nature and bn_label_nature='Évènements'";
$resultat_evenement = $db->query($requete_evenements);
(DB::isError($resultat_evenement))
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements))
: '';
 
$calcom="";
while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
// Vue Mois
if (!isset($_GET['id_fiche'])) {
// Recherche evenement de la periode selectionnée
$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), substr($page ['tag'], -2));
// TODO : Selectionner element du mois en cours
$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 FROM bazar_fiche, bazar_nature where year(bf_date_debut_evenement) =".date('Y',$curStamp)." and month(bf_date_debut_evenement)=".date('m',$curStamp)." and bf_ce_nature=bn_id_nature and bn_label_nature='Évènements'";
$resultat_evenement = $db->query($requete_evenements);
(DB::isError($resultat_evenement))
? die(BOG_afficherErreurSql(__FILE__, __LINE__, $resultat_evenement->getMessage(), $requete_evenements))
: '';
$DiaryEvent = new DiaryEvent($Day);
$calcom="";
$selection=array();
$evenements=array();
$prev_curday_ymd=0;
while ($ligne_evenements = $resultat_evenement->fetchRow(DB_FETCHMODE_OBJECT)) {
$curday_ymd=date('Ym',$curStamp).$ligne_evenements->bf_jour_debut_evenement;
if ($curday_ymd!=$prev_curday_ymd) {
$Day = new Calendar_Day(date('Y',$curStamp),date('m',$curStamp), $ligne_evenements->bf_jour_debut_evenement);
$DiaryEvent = new DiaryEvent($Day);
$prev_curday_ymd=$curday_ymd;
}
$DiaryEvent->setEntry($ligne_evenements);
// Add the decorator to the selection
$selection[] = $DiaryEvent;
$dayStamp = $Day->thisDay(true);
$url->addQueryString ('y', date('Y',$dayStamp));
$url->addQueryString ('m', date('n',$dayStamp));
$url->addQueryString ('d', date('j',$dayStamp));
$ref = $url->getUrl();
}
// Affichage Calendrier
$calcom="</br>".$ligne_evenements->bf_titre.$calcom;
 
// Attach the payload
$DiaryEvent->setEntry($calcom);
$month->build($selection);
// Add the decorator to the selection
$selection[] = $DiaryEvent;
$retour.= "<table class=\"calendar\">
<tr>
}
 
// Affichage Calendrier
<th> ". BAZ_LUNDI ."</th>
<th> ". BAZ_MARDI ."</th>
<th> ". BAZ_MERCREDI ."</th>
<th> ". BAZ_JEUDI ."</th>
<th> ". BAZ_VENDREDI ."</th>
<th> ". BAZ_SAMEDI ."</th>
<th> ". BAZ_DIMANCHE ."</th>
</tr>
";
$todayStamp=time();
$today_ymd=date('Ymd',$todayStamp);
$month->build($selection);
echo ( "<tr>\n" );
echo ( "<td>\n" );
 
echo "<table class=\"calendar\">
<tr>
<th> Lundi </th>
<th> Mardi </th>
<th> Mercredi </th>
<th> Jeudi </th>
<th> Vendredi </th>
<th> Samedi </th>
<th> Dimanche </th>
</tr>
";
$todayStamp=time();
while ( $day = $month->fetch() ) {
$dayStamp = $day->thisDay(true);
if ( $day->isEmpty() ) {
$class = "other_month";
}
else {
if ($todayStamp>$dayStamp) {
$class="previous_month";
// Other month : mois
//
while ($day = $month->fetch() ) {
$dayStamp = $day->thisDay(true);
$day_ymd=date('Ymd',$dayStamp);
if ( $day->isEmpty() ) {
$class = "other_month";
}
else {
$class="current_month";
if (($day_ymd < $today_ymd)) {
$class="previous_month";
}
else {
$class="current_month";
}
}
}
$link =
$_SERVER['PHP_SELF'].'?wiki='.$this->tag.date('Y',$dayStamp).date('m',$dayStamp).date('d',$dayStamp);
// isFirst() to find start of week
if ( $day->isFirst() )
echo ( "<tr>\n" );
echo ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" );
$url->addQueryString ('y', date('Y',$dayStamp));
$url->addQueryString ('m', date('n',$dayStamp));
$url->addQueryString ('d', date('j',$dayStamp));
$link = $url->getUrl();
if ( $day->isSelected() ) {
// isFirst() to find start of week
if ($day->isFirst())
$retour.= ( "<tr>\n" );
echo ( "<a href=\"".$link."\">".$day->getEntry()."</a>\n" );
$retour.= ( "<td class=\"".$class."\"><a href=\"".$link."\">".$day->thisDay()."</a>\n" );
if ($day->isSelected() ) {
$evenements=$day->getEntry();
while ($ligne_evenement=array_pop($evenements)) {
$url->addQueryString ('id_fiche',$ligne_evenement->bf_id_fiche);
$link = $url->getUrl();
$retour.= ( "<a href=\"".$link."\">".$ligne_evenement->bf_titre."</a>\n" );
}
}
$retour.= ( "</td>\n" );
// isLast() to find end of week
if ( $day->isLast() )
$retour.= ( "</tr>\n" );
}
echo ( "</td>\n" );
$retour.= "</table>";
// isLast() to find end of week
if ( $day->isLast() )
echo ( "</tr>\n" );
return $retour;
}
echo "</table>";
else {
// Vue jour
if (isset($_GET['id_fiche'])) {
return $retour.baz_voir_fiche(0, $_GET['id_fiche']);
}
}
}
?>
/trunk/langues/baz_langue_fr.inc.php
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: baz_langue_fr.inc.php,v 1.5 2005-09-30 12:22:54 florian Exp $
// CVS : $Id: baz_langue_fr.inc.php,v 1.6 2005-09-30 23:04:31 ddelon Exp $
/**
* Fichier de traduction en français de l'application Bazar
*
30,7 → 30,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.5 $ $Date: 2005-09-30 12:22:54 $
*@version $Revision: 1.6 $ $Date: 2005-09-30 23:04:31 $
// +------------------------------------------------------------------------------------------------------+
*/
define ('BAZ_TITREAPPLI','Gestionnaire d\'annonces et de ressources (Bazar) ');
283,9 → 283,37
define ('BAZ_RADIO_REDACTEUR', 'r&eacute;dacteur &nbsp;');
define ('BAZ_RADIO_ADMINISTRATEUR', 'administrateur &nbsp;');
 
//================ Calendrier Bazar =======================================
 
define ('BAZ_LUNDI','Lundi');
define ('BAZ_MARDI','Mardi');
define ('BAZ_MERCREDI','Mercredi');
define ('BAZ_JEUDI','Jeudi');
define ('BAZ_VENDREDI','Vendredi');
define ('BAZ_SAMEDI','Samedi');
define ('BAZ_DIMANCHE','Dimanche');
 
 
define ('BAZ_JANVIER','Janvier');
define ('BAZ_FEVRIER','Février');
define ('BAZ_MARS','Mars');
define ('BAZ_AVRIL','Avril');
define ('BAZ_MAI','Mai');
define ('BAZ_JUIN','Juin');
define ('BAZ_JUILLET','Juillet');
define ('BAZ_AOUT','Août');
define ('BAZ_SEPTEMBRE','Septembre');
define ('BAZ_OCTOBRE','Octobre');
define ('BAZ_NOVEMBRE','Novembre');
define ('BAZ_DECEMBRE','Décembre');
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/09/30 12:22:54 florian
* Ajouts commentaires pour fiche, modifications graphiques, maj SQL
*
* Revision 1.3 2005/07/21 19:03:12 florian
* nouveautés bazar: templates fiches, correction de bugs, ...
*
/trunk/presentations/styles/calendrier.css
New file
0,0 → 1,72
.nav {
text-align: center;
}
 
table.calendar {
width: 90%;
margin: 0 auto;
}
 
table.calendar td {
height: 6em;
vertical-align: top;
width: 14%;
font-size: 12px;
text-align: left;
color: #444444;
}
 
table.calendar td h1 {
text-align: left;
font-size: 10px;
margin: 1px 1px 1px 1px;
}
 
table.calendar td ul {
padding-left: 15px;
margin: 0;
list-style-type: circle;
}
 
table.calendar td ul li {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
line-height: 1.2em;
}
 
/*
* These attributes apply to the cells that correspond to the days
* already past in the current month.
*/
td.previous_month {
background: #B1BB7E;
}
 
td.previous_month a:hover, td.previous_month a:active {
color: #000000;
}
 
/*
* These attributes apply to the cells that correspond to the future
* days in the current month.
*/
td.current_month {
background: #BFB07E;
}
 
/*
* These attributes apply to the cells that correspond to days in the
* previous or next month of the current month
*/
td.other_month {
background: #eeeeee;
}
 
td.other_month a:link, td.other_month a:visited {
color: #777777;
}
 
td.other_month a:hover, td.other_month a:active {
color: #aaaaaa;
}