Пример #1
0
            foreach ($affectations_personnel as $_aff_by_type) {
                foreach ($_aff_by_type as $_aff) {
                    if (!$_aff->debut && !$_aff->fin) {
                        $personnel_ids[] = $_aff->personnel_id;
                    }
                }
            }
            // Suppression de la liste des personnels deja presents
            foreach ($listPers as $key => $persByType) {
                foreach ($persByType as $_key => $pers) {
                    if (in_array($pers->_id, $personnel_ids)) {
                        unset($listPers[$key][$_key]);
                    }
                }
            }
        }
        return $listPers;
    }
}
$pcConfig = CAppUI::conf("dPbloc CPlageOp");
CPlageOp::$hours_start = str_pad(CValue::first($pcConfig["hours_start"], "08"), 2, "0", STR_PAD_LEFT);
CPlageOp::$hours_stop = str_pad(CValue::first($pcConfig["hours_stop"], "20"), 2, "0", STR_PAD_LEFT);
CPlageOp::$minutes_interval = CValue::first($pcConfig["minutes_interval"], "15");
$listHours = range($pcConfig["hours_start"], $pcConfig["hours_stop"]);
$listMins = range(0, 59, CPlageOp::$minutes_interval);
foreach ($listHours as $key => $hour) {
    CPlageOp::$hours[$hour] = str_pad($hour, 2, "0", STR_PAD_LEFT);
}
foreach ($listMins as $key => $min) {
    CPlageOp::$minutes[] = str_pad($min, 2, "0", STR_PAD_LEFT);
}