Example #1
0
        break;
}
$calendar->guid = "CPlanning-{$mode}-{$date}";
$calendar->title = "Astreintes-{$mode}-{$date}";
$astreintes = $astreinte->loadList($where, $order);
/** @var $astreintes CPlageAstreinte[] */
foreach ($astreintes as $_astreinte) {
    $length = CMbDT::minutesRelative($_astreinte->start, $_astreinte->end);
    //not in the current group
    $_astreinte->loadRefUser();
    $_astreinte->loadRefColor();
    $libelle = "<span style=\"text-align:center;\">";
    $libelle .= $_astreinte->libelle ? "<strong>{$_astreinte->libelle}</strong><br/>" : null;
    $libelle .= $_astreinte->_ref_user . '<br/>' . $_astreinte->phone_astreinte . "</span>";
    $libelle = CMbString::purifyHTML($libelle);
    $plage = new CPlanningEvent($_astreinte->_guid, $_astreinte->start, $length, $libelle, "#" . $_astreinte->_color, true, 'astreinte', false, false);
    $plage->setObject($_astreinte);
    $plage->plage["id"] = $_astreinte->_id;
    $plage->type = $_astreinte->type;
    $plage->end = $_astreinte->end;
    $plage->display_hours = true;
    if ($_astreinte->getPerm(PERM_EDIT)) {
        $plage->addMenuItem("edit", utf8_encode("Modifier l'astreinte"));
    }
    //add the event to the planning
    $calendar->addEvent($plage);
}
$calendar->hour_min = "00";
$calendar->rearrange();
//smarty
$smarty = new CSmartyDP();
    CMbObject::massLoadFwdRef($_plages, "chir_id");
    CMbObject::massLoadFwdRef($_plages, "anesth_id");
    CMbObject::massLoadFwdRef($_plages, "spec_id");
    foreach ($_plages as $_plage) {
        $_plage->loadRefsNotes();
        $_plage->loadRefChir()->loadRefFunction();
        $_plage->loadRefSpec();
        $_plage->loadRefAnesth()->loadRefFunction();
        $debut = "{$i} " . CMbDT::time($_plage->debut);
        $duree = CMbDT::minutesRelative(CMbDT::time($_plage->debut), CMbDT::time($_plage->fin));
        //fetch
        $smarty = new CSmartyDP("modules/reservation");
        $smarty->assign("plageop", $_plage);
        $smarty_plageop = $smarty->fetch("inc_planning/libelle_plageop.tpl");
        $smarty_plageop = htmlspecialchars_decode(CMbString::htmlEntities($smarty_plageop, ENT_NOQUOTES), ENT_NOQUOTES);
        $event = new CPlanningEvent($_plage->_guid, $debut, $duree, $smarty_plageop, "#efbf99", true, null, $_plage->_guid, false);
        $event->below = true;
        $event->type = "plage_planning";
        $event->plage["id"] = $_plage->_id;
        if ($can_edit) {
            $event->addMenuItem("edit", CMbString::htmlEntities("Modifier cette plage"));
            $event->addMenuItem("list", CMbString::htmlEntities("Gestion des interventions"));
        }
        $planning->addEvent($event);
    }
}
$m = $save_m;
$planning->rearrange(true);
//ReArrange the planning
$bank_holidays = CMbDate::getHolidays($date_planning);
$smarty = new CSmartyDP();
Example #3
0
         $color = "#CCC";
     } elseif ($_plage->remplacant_id && $_plage->remplacant_id != $chirSel) {
         $color = "#FAA";
     } elseif ($_plage->remplacant_id && !$_plage->remplacant_ok) {
         $color = "#FDA";
     } elseif ($_plage->remplacant_id && $_plage->remplacant_ok) {
         $color = "#BFB";
     }
 } elseif ($_plage->pour_compte_id) {
     $color = "#EDC";
 }
 $class = null;
 if ($_plage->pour_tiers) {
     $class = "pour_tiers";
 }
 $event = new CPlanningEvent($_plage->_guid, $debute, CMbDT::minutesRelative($_plage->debut, $_plage->fin), $libelle, $color, true, $class, null);
 $event->useHeight = true;
 //Menu des évènements
 $event->addMenuItem("list", "Voir le contenu de la plage");
 $nonRemplace = !$_plage->remplacant_id || $_plage->remplacant_id != $chirSel || $_plage->remplacant_id == $chirSel && $_plage->chir_id == $chirSel;
 $nonDelegue = !$_plage->pour_compte_id || $_plage->pour_compte_id != $chirSel || $_plage->pour_compte_id == $chirSel && $_plage->chir_id == $chirSel;
 if ($nonRemplace && $nonDelegue && $_plage->getPerm(PERM_EDIT)) {
     $event->addMenuItem("edit", "Modifier cette plage");
 }
 $event->addMenuItem("clock", "Planifier une consultation dans cette plage");
 //Paramètres de la plage de consultation
 $event->type = "consultation";
 $event->plage["id"] = $_plage->plageconsult_id;
 $pct = $_plage->_fill_rate;
 if ($pct > "100") {
     $pct = "100";
     if ($_consult->annule) {
         $style .= "text-decoration:line-through;";
     }
     $title = "";
     if ($_consult->_consult_sejour_out_of_nb) {
         $nb = $_consult->_consult_sejour_nb;
         $of = $_consult->_consult_sejour_out_of_nb;
         $title .= "<span style=\"float:right;\">{$nb} / {$of}</span>";
     }
     $title .= "<span style=\"{$style}\">";
     $title .= CMbString::htmlEntities($_consult->_ref_patient->_view) . "\n" . $motif;
     $title .= "</span>";
     $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $title, $color, true, "droppable {$debute}", $_consult->_guid, false);
 } else {
     $color = "#faa";
     $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $motif ? $motif : "[PAUSE]", $color, true, "droppable {$debute}", $_consult->_guid, false);
 }
 $event->type = "rdvfull";
 $event->plage["id"] = $_plage->_id;
 $event->plage["consult_id"] = $_consult->_id;
 if ($_plage->locked == 1) {
     $event->disabled = true;
 }
 $_consult->loadRefCategorie();
 if ($_consult->categorie_id) {
     $event->icon = "./modules/dPcabinet/images/categories/" . $_consult->_ref_categorie->nom_icone;
     $event->icon_desc = CMbString::htmlEntities($_consult->_ref_categorie->nom_categorie);
 }
 if ($_consult->_id) {
     $event->draggable = $can_edit;
     $freq = $_plage->freq ? CMbDT::transform($_plage->freq, null, "%M") : 1;
Example #5
0
     $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}";
         if ($function_id && !$_plage->spec_id) {
             $event->title .= " - " . $_prat->_shortview . "";
         }
         $event->title .= "<br/>Durée cumulée : ";
         $event->title .= $_plage->_cumulative_minutes ? CMbDT::transform("+ {$_plage->_cumulative_minutes} MINUTES", "00:00:00", "%Hh%M") : " &mdash;";
Example #6
0
             $color = "#faf";
         } elseif ($_consult->sejour_id) {
             $color = "#CFFFAD";
         }
     }
     $title = "";
     if ($_consult->_consult_sejour_out_of_nb) {
         $title .= "<span style='float:right;'>{$_consult->_consult_sejour_nb}/ {$_consult->_consult_sejour_out_of_nb}</span>";
     }
     $title .= "<strong>{$heure}</strong> " . CMbString::htmlEntities($_consult->_ref_patient->_view) . "\n" . $motif;
     $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $title, $color, true, null, $_consult->_guid, false);
 } else {
     if ($color = "#cfc") {
         $color = "#faa";
     }
     $event = new CPlanningEvent($_consult->_guid, $debute, $_consult->duree * $_plage->_freq, $motif ? $motif : "[PAUSE]", $color, true, null, null);
 }
 $event->type = "rdvfull";
 $event->plage["id"] = $_plage->_id;
 $event->plage["consult_id"] = $_consult->_id;
 if ($_plage->locked == 1) {
     $event->disabled = true;
 }
 $_consult->loadRefCategorie();
 if ($_consult->categorie_id) {
     $event->icon = "./modules/dPcabinet/images/categories/" . $_consult->_ref_categorie->nom_icone;
     $event->icon_desc = CMbString::htmlEntities($_consult->_ref_categorie->nom_categorie);
 }
 if ($_consult->patient_id) {
     $event->draggable = 1;
     $event->hour_divider = 60 / CMbDT::transform($_plage->freq, null, "%M");