Subversion Repositories Applications.bazar

Rev

Rev 183 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 183 Rev 201
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.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
*/
Line 35... Line 35...
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
Line 39... Line 39...
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';
Line 42... Line -...
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
-
 
43
 
42
require_once PAP_CHEMIN_RACINE.'api/pear/Calendar/Decorator.php'; 
44
 
43
 
45
// +------------------------------------------------------------------------------------------------------+
44
// +------------------------------------------------------------------------------------------------------+
Line 46... Line -...
46
// |                                           LISTE de FONCTIONS                                         |
-
 
47
// +------------------------------------------------------------------------------------------------------+
45
// |                                           LISTE de FONCTIONS                                         |
48
 
-
 
49
 
46
// +------------------------------------------------------------------------------------------------------+
50
// Classe Utilitaire pour Calendrier
47
 
51
 
48
// Classe Utilitaire pour Calendrier
-
 
49
class DiaryEvent extends Calendar_Decorator {
52
class DiaryEvent extends Calendar_Decorator {
50
	var $entry = array();
53
	var $entry=array();
51
	function DiaryEvent($calendar)
54
	function DiaryEvent($calendar) {
52
	{
-
 
53
		Calendar_Decorator::Calendar_Decorator($calendar);
55
		Calendar_Decorator::Calendar_Decorator($calendar);
54
	}
Line 56... Line 55...
56
	}
55
	function setEntry($entry)
57
	function setEntry($entry) {
56
	{
-
 
57
		$this->entry[] = $entry;
58
		$this->entry[]=$entry;
58
		
59
		
59
	}
60
	}
60
	function getEntry()
Line 61... Line 61...
61
	function getEntry() {
61
	{
62
		return $this->entry;
62
		return $this->entry;
63
	}
-
 
64
} 
63
	}
65
 
-
 
Line 66... Line 64...
66
 
64
} 
Line 67... Line 65...
67
// $type : calendrier
65
 
68
// $type : calendrier_appplette
66
 
69
 
67
// $type : calendrier
Line 70... Line 68...
70
function GestionAffichageCalendrier($type='calendrier') {
68
// $type : calendrier_appplette
71
	
69
function GestionAffichageCalendrier($type = 'calendrier') {
72
	
70
	
Line 73... Line 71...
73
	$retour='';
71
	$retour = '';
74
 
72
 
75
	$url = $GLOBALS['_GEN_commun']['url'] ;
73
	$url = $GLOBALS['_GEN_commun']['url'] ;
Line 76... Line -...
76
	$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
-
 
77
	$auth = &$GLOBALS['_GEN_commun']['pear_auth'] ;
74
	$db =& $GLOBALS['_GEN_commun']['pear_db'] ;
78
	
75
	$auth =& $GLOBALS['_GEN_commun']['pear_auth'] ;
Line 79... Line 76...
79
	if (!isset($_GET['y'])) { 
76
	
80
		$_GET['y'] = date('Y');
77
	if (!isset($_GET['y'])) { 
81
	}
78
		$_GET['y'] = date('Y');
82
	
79
	}
83
	if (!isset($_GET['m'])) { 
80
	
Line 84... Line 81...
84
		$_GET['m'] = date('m');
81
	if (!isset($_GET['m'])) { 
85
	}
82
		$_GET['m'] = date('m');
86
	
83
	}
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']);
-
 
87
 
90
 
88
	$curStamp = $month->getTimeStamp();
91
	$curStamp=$month->getTimeStamp();
89
	$url->addQueryString('y', date('Y',$curStamp));
92
	$url->addQueryString ('y', date('Y',$curStamp));
90
	$url->addQueryString('m', date('n',$curStamp));
93
	$url->addQueryString ('m', date('n',$curStamp));
91
	$url->addQueryString('d', date('j',$curStamp));
94
	$url->addQueryString ('d', date('j',$curStamp));
92
	$cur = $url->getUrl();
95
	$cur = $url->getUrl();
93
	
-
 
94
	// Navigation 
96
	
95
	$prevStamp = $month->prevMonth(true);
Line 97... Line 96...
97
	// Navigation 
96
	$url->addQueryString('y', date('Y',$prevStamp));
98
	$prevStamp = $month->prevMonth(true);
97
	$url->addQueryString('m', date('n',$prevStamp));
Line 99... Line 98...
99
	$url->addQueryString ('y', date('Y',$prevStamp));
98
	$url->addQueryString('d', date('j',$prevStamp));
Line 302... Line 301...
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');
Line 307... Line 312...
307
			
312
			
308
		return $retour;
-
 
309
		
313
		return $retour;
310
	}
-
 
311
 
314
	}
312
?>
315
?>