Ejemplo n.º 1
0
$where[] = "libelle != 'automatique' OR libelle IS NULL";
$ljoin["users"] = "users.user_id = plageconsult.chir_id OR users.user_id = plageconsult.remplacant_id ";
$order = "date, user_last_name, user_first_name, debut";
// Chargement des plages disponibles
/** @var CPlageconsult[] $listPlage */
$listPlage = $plage->loadList($where, $order, null, "plageconsult_id", $ljoin);
if (!array_key_exists($plageconsult_id, $listPlage)) {
    $plage->_id = $plageconsult_id = null;
}
$currPlage = new CPlageconsult();
foreach ($listPlage as $currPlage) {
    if (!$plageconsult_id && $date == $currPlage->date) {
        $plageconsult_id = $currPlage->_id;
    }
    $currPlage->_ref_chir = $listPrat[$currPlage->chir_id];
    $currPlage->loadCategorieFill();
    $currPlage->loadRefsNotes();
    $currPlage->countPatients();
    $currPlage->loadRefsConsultations(false);
    $currPlage->loadDisponibilities();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("period", $period);
$smarty->assign("periods", $periods);
$smarty->assign("hour", $hour);
$smarty->assign("hours", CPlageconsult::$hours);
$smarty->assign("hide_finished", $hide_finished);
$smarty->assign("date", $date);
$smarty->assign("today", CMbDT::date());
$smarty->assign("refDate", $refDate);