Exemplo n.º 1
0
CCanDo::checkEdit();
$type = CValue::getOrSession("type");
// Week dates
$date = CValue::getOrSession("date", CMbDT::date());
$monday = CMbDT::date("last monday", CMbDT::date("+1 DAY", $date));
$sunday = CMbDT::date("next sunday", CMbDT::date("-1 DAY", $date));
// Chargement des conges
$plage_conge = new CPlageConge();
$where = array();
$where["date_debut"] = "<= '{$sunday}'";
$where["date_fin"] = ">= '{$monday}'";
$order = "date_debut DESC, date_fin DESC";
/** @var CPlageConge[] $plages_conge */
$plages_conge = $plage_conge->loadList($where, $order);
// Début et fin d'activite
foreach (CEvenementSSR::getActiveTherapeutes($monday, $sunday) as $_therapeute) {
    // Pseudo plage de début
    if (($deb = $_therapeute->deb_activite) && $deb >= $monday) {
        $plage = CPlageConge::makePseudoPlage($_therapeute->_id, "deb", $monday);
        $plages_conge[$plage->_id] = $plage;
    }
    // Pseudo plage de fin
    if (($fin = $_therapeute->fin_activite) && $fin <= $sunday) {
        $plage = CPlageConge::makePseudoPlage($_therapeute->_id, "fin", $sunday);
        $plages_conge[$plage->_id] = $plage;
    }
}
/** @var CSejour[] $sejours */
$sejours = array();
$_sejours = array();
$count_evts = array();