Пример #1
0
if ($function_id) {
    $where["function_id"] = " = '{$function_id}'";
} else {
    $where["user_id"] = " = '{$prat_id}'";
}
$prats = $prat->loadList($where);
$function = new CFunctions();
$function->load($function_id);
$ds = $function->getDS();
$calendar = new CPlanningMonth($date);
$calendar->title = htmlentities(CMbDT::format($date, "%B %Y"));
foreach ($prats as $_prat) {
    // plages de congés (si mode prat)
    if (!$function_id && CModule::getActive("dPpersonnel")) {
        $plage_cong = new CPlageConge();
        $plages_cong = $plage_cong->loadListForRange($_prat->_id, $calendar->date_min, $calendar->date_max);
        foreach ($plages_cong as $_conge) {
            $first_day = $_conge->date_debut;
            $last_day = $_conge->date_fin;
            $replaced_by = new CMediusers();
            $replaced_by->load($_conge->replacer_id);
            while ($last_day >= $first_day) {
                $calendar->addClassesForDay("disabled", $first_day);
                if ($replaced_by->_id) {
                    $event = new CPlanningEvent($_conge->_guid, $first_day);
                    $event->title = "<strong>" . ($_conge->_view ? $_conge->_view : "Congés");
                    if ($function_id) {
                        $event->title .= " (" . $_prat->_shortview . ")";
                    }
                    $event->title .= $replaced_by ? " remplacé par " . $replaced_by->_view . "</strong> " : null;
                    $calendar->days[$first_day][$_conge->_guid] = $event;
Пример #2
0
 /**
  * Charge les possibles congés du remplacant pendant le remplacement
  *
  * @return CPlageConge[]
  */
 function checkCongesRemplacer()
 {
     $this->loadDates();
     $conge = new CPlageConge();
     return $this->_ref_replacer_conges = $conge->loadListForRange($this->replacer_id, $this->_min_deb, $this->_max_fin);
 }