A few fixes to export-import.
[timetracker.git] / WEB-INF / lib / form / Calendar.class.php
index f4a50a8..555b6e1 100644 (file)
@@ -44,22 +44,22 @@ class Calendar extends FormElement {
 
     var $controlName = "";
     var $highlight = "time"; // Determines what type of active days to highlight ("time" or "expenses"). 
-    // var $mAllDays       = true;
-    var $class = "Calendar";
 
     function __construct($name) {
-        $this->controlName = $name;
-        $this->mMonthNames = array('January','February','March','April','May','June','July','August','September','October','November','December');
-        $this->mWeekDayShortNames = array('Su','Mo','Tu','We','Th','Fr','Sa');
+      $this->class = 'Calendar';
+      $this->controlName = $name; // TODO: why controlName? Other classes have "name".
+      $this->mMonthNames = array('January','February','March','April','May','June','July','August','September','October','November','December');
+      $this->mWeekDayShortNames = array('Su','Mo','Tu','We','Th','Fr','Sa');
     }
-    
+
     function setHighlight($highlight) {
        if ($highlight && $highlight != 'time')
          $this->highlight = $highlight;
     }
 
-    function localize($i18n) {
+    function localize() {
       global $user;
+      global $i18n;
       
       $this->mMonthNames = $i18n->monthNames;
       $this->mWeekDayShortNames = $i18n->weekdayShortNames;
@@ -172,7 +172,9 @@ class Calendar extends FormElement {
             }
 
               // holidays
-              if ($this->showHolidays) {
+              //if ($this->showHolidays) {
+              global $user;
+              if ($user->show_holidays) {
               foreach ($this->holidays as $day) {
                 if($day == $date) {
                   $stl_cell = ' class="CalendarDayHoliday"';
@@ -222,7 +224,7 @@ class Calendar extends FormElement {
       return $str;
     }
 
-    function toStringControl() {
+    function getHtml() {
         return $this->toString();
     }