* @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 22873 $ */ $plageop_id = CValue::getOrSession("plageop_id"); $date = CValue::getOrSession("date", CMbDT::date()); $bloc_id = CValue::get("bloc_id"); // Informations sur la plage demandée $plagesel = new CPlageOp(); $plagesel->load($plageop_id); $plagesel->loadRefSalle(); $listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom"); //curent bloc if $bloc_id $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); $listSalles = $bloc->loadRefsSalles(); $arrKeySalle = array_keys($listSalles); // cleanup listBlocs foreach ($listBlocs as $key => $curr_bloc) { $salles = $curr_bloc->loadRefsSalles(); foreach ($salles as $id => $_salle) { if (count($arrKeySalle) && !in_array($id, $arrKeySalle)) { unset($salles[$id]); continue; } } if (!count($salles)) { unset($listBlocs[$key]); continue; } }
$month_fin = CMbDT::date("-1 day", $month_fin); $next_month_deb = CMbDT::date("+1 day", $month_fin); $next_month_fin = CMbDT::date("+1 month", $month_fin); $next_month_fin = CMbDT::date("-1 day", $next_month_fin); $listPrat = new CMediusers(); $listPrat = $listPrat->loadPraticiens(PERM_READ); $listSpec = new CFunctions(); $listSpec = $listSpec->loadSpecialites(PERM_READ, 1); $bloc = new CBlocOperatoire(); $group = CGroups::loadCurrent(); $where = array(); $where["group_id"] = "= '{$group->_id}'"; /** @var CBlocOperatoire[] $listBlocs */ $listBlocs = $bloc->loadListWithPerms(PERM_READ, $where, "nom"); foreach ($listBlocs as &$bloc) { $bloc->loadRefsSalles(); } $praticien = CMediusers::get(); // Création du template $smarty = new CSmartyDP("modules/dPbloc"); $smarty->assign("praticien", $praticien); $smarty->assign("chir", $praticien->user_id); $smarty->assign("filter", $filter); $smarty->assign("filterSejour", $filterSejour); $smarty->assign("now", $now); $smarty->assign("tomorrow", $tomorrow); $smarty->assign("j2", $j2); $smarty->assign("j3", $j3); $smarty->assign("next_week_deb", $next_week_deb); $smarty->assign("next_week_fin", $next_week_fin); $smarty->assign("week_deb", $week_deb);