function updateFormFields()
 {
     parent::updateFormFields();
     $this->_hour_deb = CMbDT::transform($this->debut, null, "%H");
     $this->_hour_fin = CMbDT::transform($this->fin, null, "%H");
     // State rules
     if ($this->paye == 1) {
         $this->_state = self::PAYED;
     } elseif ($this->date < CMbDT::date()) {
         $this->_state = self::OUT;
     } elseif ($this->prat_id) {
         if (CMbDT::date("+ 15 DAYS") > $this->date) {
             $this->_state = self::BLOCKED;
         } else {
             $this->_state = self::BUSY;
         }
     } elseif (CMbDT::date("+ 1 MONTH") < $this->date) {
         $this->_state = self::FREEB;
     } else {
         $this->_state = self::FREE;
     }
 }
Exemplo n.º 2
0
 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_total = CMbDT::timeCountIntervals($this->debut, $this->fin, $this->freq);
     if ($this->freq == "1:00:00" || $this->freq == "01:00:00") {
         $this->_freq = "60";
     } else {
         $this->_freq = substr($this->freq, 3, 2);
         $this->_freq_minutes = CMbDT::minutesRelative("00:00:00", $this->freq);
     }
 }
Exemplo n.º 3
0
 /**
  * @see parent::updateFormFields()
  */
 function updateFormFields()
 {
     parent::updateFormFields();
     $this->_duree_prevue = CMbDT::timeRelative($this->debut, $this->fin);
     $this->_view = "Plage du " . $this->getFormattedValue("date");
 }