Skip to content
Snippets Groups Projects
Commit cd5d1de2 authored by llaffont's avatar llaffont
Browse files

Correction fonctionnement calendrier pour s'appuyer sur TimeSource

parent 85efc9a1
Branches
Tags
No related merge requests found
......@@ -45,7 +45,11 @@ class Class_Calendar {
public function __construct($param_array, $view) {
$this->_view = $view;
$this->param = $param_array;
}
public function initializeParams() {
$this->_translate = Zend_Registry::get('translate');
$this->WEEK_DAYS = array($this->_translate->_("dim"),
$this->_translate->_("lun"),
......@@ -69,20 +73,19 @@ class Class_Calendar {
$this->_translate->_('décembre'));
// Month and year to display (gotten from URL)
if (isset($param_array["DATE"]) && $param_array["DATE"] != "") {
$date_array = explode('-', $param_array["DATE"]);
if (isset($this->param["DATE"]) && $this->param["DATE"] != "") {
$date_array = explode('-', $this->param["DATE"]);
$this->month = (int)$date_array[1];
$this->year = (int)$date_array[0];
}
else {
$this->month = gmdate("n");
$this->year = gmdate("Y");
$this->month = date("n", $this->getTimeSource()->time());
$this->year = date("Y", $this->getTimeSource()->time());
}
$param_array["DATE"] = sprintf('%4d-%02d', $this->year, $this->month);
$this->param["DATE"] = sprintf('%4d-%02d', $this->year, $this->month);
$this->param = $param_array;
$this->today = date("dmY");
$this->id_module = $param_array["ID_MODULE"];
$this->today = date("dmY", $this->getTimeSource()->time());
$this->id_module = $this->param["ID_MODULE"];
}
......@@ -282,6 +285,8 @@ class Class_Calendar {
public function rendHTML() {
$this->initializeParams();
$html = $this->rendSelectionCategories();
$html.="<div><table class=\"calendar_main\">";
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment