$color = "#BFB"; foreach ($plagesConsult as $_consult) { $_consult->loadFillRate(); $_consult->countPatients(); $_consult->loadRefChir(); $class = null; if ($_consult->pour_tiers) { $class = "pour_tiers"; } if (CModule::getActive("3333tel")) { C3333TelTools::checkPlagesConsult($_consult, $_consult->_ref_chir->function_id); } ajoutEvent($planning, $_consult, $_consult->date, $_consult->libelle, $color, "consultation", $class); } // plages op $plagesOp = $plageOp->loadForDays($chirSel, $debut, CMbDT::date("+7 day", $debut)); foreach ($plagesOp as $_op) { $_op->loadRefSalle(); $_op->multicountOperations(); $color = "#BCE"; //to check if group is present group $g = CGroups::loadCurrent(); $_op->loadRefSalle(); $_op->_ref_salle->loadRefBloc(); if ($_op->_ref_salle->_ref_bloc->group_id != $g->_id) { $color = "#748dee"; } ajoutEvent($planning, $_op, $_op->date, $_op->_ref_salle->nom, $color, "operation"); } // plages conge if (CModule::getActive("dPpersonnel")) {
if ($function_id) { $event->title .= " - " . $_prat->_shortview . ""; } $event->title .= "<br/> Durée cumulée : "; $event->title .= $_plage->_cumulative_minutes ? CMbDT::time("+ {$_plage->_cumulative_minutes} MINUTES", "00:00:00") : "—"; $event->title .= "</small>"; $event->type = $_plage->_class; $event->datas = array("id" => $_plage->_id); $event->css_class = $_plage->_class; $event->setObject($_plage); $calendar->days[$_plage->date][$_plage->_guid] = $event; } // plages op if (CModule::getInstalled('dPbloc')) { $plage = new CPlageOp(); $plages_op = $plage->loadForDays($_prat->_id, $calendar->date_min, $calendar->date_max); /** @var CPlageOp[] $plages_op */ foreach ($plages_op as $_plage) { $_plage->loadRefsOperations(false); $_plage->loadRefSalle(); $event = new CPlanningEvent($_plage->_guid, $_plage->date); $title = CAppUI::tr($_plage->_class); if ($_plage->spec_id) { $event->title .= "<img src=\"images/icons/user-function.png\" style=\" float:right;\" alt=\"\"/>"; } $event->title .= "\n <strong>" . CMbDT::format($_plage->debut, "%H:%M") . " - " . CMbDT::format($_plage->fin, "%H:%M") . "</strong>\n " . count($_plage->_ref_operations) . " " . CAppUI::tr('COperation'); if (count($_plage->_ref_operations) > 1) { $event->title .= "s"; } $event->title .= "<small>"; $event->title .= "<br/>{$_plage->_ref_salle}";