if (!$conge->_id) { $evenement->therapeute_id = $referent->_id; } } // Si l'evenement n'est pas une seance collective if ($type_seance != "collective") { $evenement->prescription_line_element_id = $line_id; $evenement->sejour_id = $sejour_id; } // Store de l'evenement ou de la nouvelle seance $msg = $evenement->store(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-create"); $evenement_actes_id = $evenement->_id; // Si une seance a ete créée, on crée l'evenement lié a la seance, et on crée les code cdarr sur l'evenement if ($type_seance == "collective") { $evt_ssr = new CEvenementSSR(); $evt_ssr->sejour_id = $sejour_id; $evt_ssr->prescription_line_element_id = $line_id; $evt_ssr->seance_collective_id = $evenement->_id; $evt_ssr->type_seance = $type_seance; $msg = $evt_ssr->store(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-create"); // Si une seance a ete créée, les codes cdarrs seront créés sur l'evenement de la seance $evenement_actes_id = $evt_ssr->_id; } // Actes CdARR foreach ($codes_cdarrs as $_code) { $acte = new CActeCdARR(); $acte->code = $_code; $acte->evenement_ssr_id = $evenement_actes_id; $msg = $acte->store();
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 26916 $ */ CCanDo::checkRead(); $date = CValue::getOrSession("date", CMbDT::date()); $therapeute_id = CValue::get("therapeute_id"); $equipement_id = CValue::get("equipement_id"); $prescription_line_element_id = CValue::get("prescription_line_element_id"); $monday = CMbDT::date("last monday", CMbDT::date("+1 day", $date)); $sunday = CMbDT::date("next sunday", CMbDT::date("-1 DAY", $date)); // Chargement de la ligne $line_element = new CPrescriptionLineElement(); $line_element->load($prescription_line_element_id); $element_prescription_id = $line_element->element_prescription_id; // Chargement des seances en fonction des parametres selectionnés $seance = new CEvenementSSR(); $ljoin = array(); $ljoin[] = "evenement_ssr AS evt_seance ON (evt_seance.seance_collective_id = evenement_ssr.evenement_ssr_id)"; $ljoin["prescription_line_element"] = "evt_seance.prescription_line_element_id = prescription_line_element.prescription_line_element_id"; $where = array(); $where["evenement_ssr.sejour_id"] = " IS NULL"; $where["evenement_ssr.debut"] = "BETWEEN '{$monday} 00:00:00' AND '{$sunday} 23:59:59'"; $where["evenement_ssr.therapeute_id"] = " = '{$therapeute_id}'"; if ($equipement_id) { $where["evenement_ssr.equipement_id"] = " = '{$equipement_id}'"; } else { $where["evenement_ssr.equipement_id"] = " IS NULL"; } $where["prescription_line_element.element_prescription_id"] = " = '{$element_prescription_id}'"; $seances = $seance->loadList($where, null, null, "evenement_ssr_id", $ljoin); // Création du template
$other_codes = CValue::post("_codes"); $codes = array(); if ($added_codes) { $codes["add"] = $added_codes; } if ($remed_codes) { $codes["rem"] = $remed_codes; } // Ajout des codes rajoutés depuis l'autocomplete if (count($other_codes)) { foreach ($other_codes as $_other_cdarr) { $codes["add"][] = $_other_cdarr; } } foreach ($evenement_ids as $_evenement_id) { $evenement = new CEvenementSSR(); $evenement->load($_evenement_id); // Autres rééducateurs global $can; $therapeute_id = $evenement->therapeute_id; if ($evenement->seance_collective_id) { $therapeute_id = $evenement->loadRefSeanceCollective()->therapeute_id; } if ($therapeute_id && $therapeute_id != CAppUI::$instance->user_id && !$can->admin) { CAppUI::displayMsg("Impossible de modifier les événements d'un autre rééducateur", "CEvenementSSR-msg-modify"); continue; } // Actes par code pour chaque événement $actes_by_code = array(); foreach ($evenement->loadRefsActes() as $type => $_actes) { foreach ($_actes as $_acte) {
$date = CValue::getOrSession("date", CMbDT::date()); $sejour_id = CValue::get("sejour_id"); $sejour = new CSejour(); $sejour->load($sejour_id); $equipement = new CEquipement(); $equipement->load(CValue::get("equipement_id")); if (!$equipement->visualisable) { echo "<div class='small-info'>L'équipement <strong>{$equipement->_view}</strong> n'est pas visualisable</div>"; CApp::rip(); } $nb_days_planning = $sejour->getNbJourPlanning($date); $planning = new CPlanningWeek($date, null, null, $nb_days_planning, false, "auto", false, true); $planning->title = "Equipement '{$equipement->_view}'"; $planning->guid = $equipement->_guid; // Chargement des evenement SSR $evenement = new CEvenementSSR(); $where["debut"] = "BETWEEN '{$planning->_date_min_planning} 00:00:00' AND '{$planning->_date_max_planning} 23:59:59'"; $where["equipement_id"] = " = '{$equipement->_id}'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement->loadList($where); foreach ($evenements as $_evenement) { $important = !$sejour_id || $_evenement->sejour_id == $sejour_id; $sejour = $_evenement->loadRefSejour(); $patient = $sejour->loadRefPatient(); // Title $therapeute = $_evenement->loadRefTherapeute(); $title = ucfirst(strtolower($patient->nom)) . " {$therapeute->_shortview}"; // Color $function = $therapeute->loadRefFunction(); $color = "#{$function->color}"; // Classes
* @version $Revision$ */ CCanDo::checkRead(); $date = CValue::getOrSession("date", CMbDT::date()); $sejour_id = CValue::getOrSession("sejour_id"); $sejour = new CSejour(); $sejour->load($sejour_id); $sejour->loadRefPatient(); $sejour->loadRefPraticien(); $bilan = $sejour->loadRefBilanSSR(); $technicien = $bilan->loadRefTechnicien(); $technicien->loadRefKine(); // Chargement des evenement SSR $monday = CMbDT::date("last monday", CMbDT::date("+1 day", $date)); $sunday = CMbDT::date("next sunday", CMbDT::date("-1 DAY", $date)); $evenement_ssr = new CEvenementSSR(); $where = array(); $where["sejour_id"] = " = '{$sejour_id}'"; $where["debut"] = "BETWEEN '{$monday} 00:00:00' AND '{$sunday} 23:59:59'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement_ssr->loadList($where); $elements = array(); $intervenants = array(); foreach ($evenements as $_evenement) { $line = $_evenement->loadRefPrescriptionLineElement(); $element = $line->_ref_element_prescription; $_evenement->loadRefTherapeute(); $elements[$element->_id] = $element; $intervenants[$element->_id][$_evenement->therapeute_id] = $_evenement->_ref_therapeute; } // Création du template
$sejour_id = CValue::get("sejour_id"); $height = CValue::get("height"); $selectable = CValue::get("selectable"); $large = CValue::get("large"); $print = CValue::get("print"); $kine = new CMediusers(); $kine->load($kine_id); $sejour = new CSejour(); $sejour->load($sejour_id); $nb_days_planning = $sejour->_id ? $sejour->getNbJourPlanning($date) : CEvenementSSR::getNbJoursPlanning($kine_id, $date); $planning = new CPlanningWeek($date, null, null, $nb_days_planning, $selectable, $height, $large, !$print); $planning->title = $surveillance ? "Surveillance '{$kine->_view}'" : "Rééducateur '{$kine->_view}'"; $planning->guid = $kine->_guid; $planning->guid .= $surveillance ? "-surv" : "-tech"; // Chargement des evenement SSR $evenement = new CEvenementSSR(); $where = array(); $where["debut"] = "BETWEEN '{$planning->_date_min_planning} 00:00:00' AND '{$planning->_date_max_planning} 23:59:59'"; $where["therapeute_id"] = " = '{$kine->_id}'"; $where["type_seance"] = $surveillance ? " = 'non_dediee'" : " <> 'non_dediee'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement->loadList($where); // Chargement des evenements SSR de "charge" $where["type_seance"] = $surveillance ? " <> 'non_dediee'" : " = 'non_dediee'"; /** @var CEvenementSSR[] $evenements_charge */ $evenements_charge = $evenement->loadList($where); foreach ($evenements_charge as $_evenement) { $planning->addLoad($_evenement->debut, $_evenement->duree); } CMbObject::massLoadFwdRef($evenements, "prescription_line_element_id"); CMbObject::massLoadFwdRef($evenements, "equipement_id");
<?php /** * $Id$ * * @package Mediboard * @subpackage SSR * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $kine_id = CValue::getOrSession("kine_id"); $date = CValue::getOrSession("date"); $monday = CMbDT::date("last monday", CMbDT::date("+1 day -1 week", $date)); $sunday = CMbDT::date("next sunday", CMbDT::date("-1 DAY -1 week", $date)); // Chargement des evenements de la semaine precedente qui n'ont pas encore ete validés $evenement = new CEvenementSSR(); $where = array(); $where["therapeute_id"] = " = '{$kine_id}'"; $where["debut"] = " BETWEEN '{$monday} 00:00:00' AND '{$sunday} 23:59:59'"; $where["realise"] = " = '0'"; $where["annule"] = " = '0'"; $count_evts = $evenement->countList($where); // Création du template $smarty = new CSmartyDP(); $smarty->assign("kine_id", $kine_id); $smarty->assign("count_evts", $count_evts); $smarty->display("inc_vw_planning_kine_board.tpl");
$therapeute_id = $evenement->therapeute_id; if ($evenement->seance_collective_id) { $therapeute_id = $evenement->loadRefSeanceCollective()->therapeute_id; } if ($therapeute_id && $therapeute_id != CAppUI::$instance->user_id && !$can->admin) { CAppUI::displayMsg("Impossible de modifier les événements d'un autre rééducateur", "CEvenementSSR-msg-modify"); continue; } // Suppression des evenements SSR if ($del) { $seance_collective_id = $evenement->seance_collective_id; // Suppression de l'evenement $msg = $evenement->delete(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-delete"); if ($seance_collective_id) { $seance = new CEvenementSSR(); $seance->load($seance_collective_id); // Suppression de la seance si plus aucune backref if ($seance->countBackRefs("evenements_ssr") == 0) { $msg = $seance->delete(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-delete"); } } } else { if ($_traitement || $_nb_decalage_min_debut || $_nb_decalage_heure_debut || $_nb_decalage_jour_debut || $_nb_decalage_duree || $equipement_id || $kine_id) { if ($evenement->_traitement = $_traitement) { $evenement->realise = CValue::post("realise"); $evenement->annule = CValue::post("annule"); } if ($evenement->seance_collective_id) { $evenement->loadRefSeanceCollective();
$planning = new CPlanningWeek($date, $sejour->entree, $sejour->sortie, $nb_days_planning, $selectable, $height, $large, !$print); $planning->title = "Patient '{$patient->_view}'"; $planning->guid = $sejour->_guid; // Chargement des evenement SSR (ainsi que les seances collectives) $evenement = new CEvenementSSR(); $ljoin = array(); $ljoin[] = "evenement_ssr AS evt_seance ON (evt_seance.seance_collective_id = evenement_ssr.evenement_ssr_id)"; $where = array(); $where[] = "(evenement_ssr.sejour_id = '{$sejour->_id}') OR (evenement_ssr.sejour_id IS NULL AND evt_seance.sejour_id = '{$sejour->_id}')"; $where["evenement_ssr.debut"] = "BETWEEN '{$planning->_date_min_planning} 00:00:00' AND '{$planning->_date_max_planning} 23:59:59'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement->loadList($where, null, null, null, $ljoin); foreach ($evenements as $_evenement) { if (!$_evenement->sejour_id) { // Chargement de l'evenement pour ce sejour $evt = new CEvenementSSR(); $evt->sejour_id = $sejour->_id; $evt->seance_collective_id = $_evenement->_id; $evt->loadMatchingObject(); // On reaffecte les valeurs indispensables a l'affichage $evt->debut = $_evenement->debut; $evt->duree = $_evenement->duree; $draggable_guid = $_evenement->_guid; // Remplacement de la seance collective par le bon evenement $_evenement = $evt; } else { $draggable_guid = $_evenement->_guid; } // CSS Classes $class = $_evenement->equipement_id ? "equipement" : "kine"; if ($_evenement->seance_collective_id) {
$users = $user->loadUsers(PERM_READ, $user->function_id); // Séjours des patients $therapeutes = array(); $all_sejours = array(); foreach ($sejours as $_sejour) { $patient = $_sejour->loadRefPatient(); foreach ($patient->loadRefsSejours() as $_other_sejour) { $_other_sejour->loadRefPatient(); $all_sejours[$_other_sejour->_id] = $_other_sejour; $_other_sejour->loadRefBilanSSR()->loadRefTechnicien(); $therapeutes += CEvenementSSR::getAllTherapeutes($_other_sejour->patient_id, $user->function_id); } } // Chargement des comptes d'événements $evenements_counts = array(); $evenement = new CEvenementSSR(); $where["sejour_id"] = CSQLDataSource::prepareIn(array_keys($all_sejours)); $where["therapeute_id"] = CSQLDataSource::prepareIn(array_keys($therapeutes)); /** @var CEvenementSSR $_evenement */ foreach ($evenement->loadList($where) as $_evenement) { @$evenements_counts[$_evenement->sejour_id][$_evenement->therapeute_id]++; } if (!$replacement->_id) { $replacement->conge_id = $conge_id; $replacement->sejour_id = $sejour_id; } $transfer_count = 0; $transfer_counts = array(); // Transfer event count if ($type == 'kine') { $date_min = $conge->date_debut;
$event_ids = CValue::post("event_ids"); $period = CValue::post("period"); $days = array(""); // Propagation aux autres jours if (CValue::post("propagate")) { $days = array(); $date = CValue::getOrSession("date", CMbDT::date()); $monday = CMbDT::date("last monday", CMbDT::date("+1 day", $date)); foreach (CValue::post("_days") as $_number) { $days[] = CMbDT::date("+{$_number} DAYS", $monday); } } $elts_id = explode("|", $event_ids); foreach ($days as $day) { foreach ($elts_id as $_elt_id) { $evenement = new CEvenementSSR(); $evenement->load($_elt_id); $evenement->loadRefsActesCdARR(); $evenement->loadRefsActesCsARR(); // Duplication de l'événement $evenement->_id = ""; $evenement->realise = 0; $evenement->annule = 0; $evenement->debut = $day ? "{$day} " . CMbDT::time($evenement->debut) : CMbDT::dateTime($period, $evenement->debut); // Cas des séances collectives if ($evenement->seance_collective_id) { CAppUI::displayMsg("Impossible de dupliquer des événements qui sont dans des seances collectives", "CEvenementSSR-msg-create"); continue; } // Autres rééducateurs global $can;
/** * Détermine le nombre de jours du planning pour la semaine * * @param date $date Date de référence * * @return int 5, 6 ou 7 jours */ function getNbJourPlanning($date) { $sunday = CMbDT::date("next sunday", CMbDT::date("- 1 DAY", $date)); $saturday = CMbDT::date("-1 DAY", $sunday); $_evt = new CEvenementSSR(); $ljoin = array(); $ljoin[] = "evenement_ssr AS evt_seance ON (evt_seance.seance_collective_id = evenement_ssr.evenement_ssr_id)"; $where = array(); $where["evenement_ssr.debut"] = "BETWEEN '{$sunday} 00:00:00' AND '{$sunday} 23:59:59'"; $where[] = "(evenement_ssr.sejour_id = '{$this->_id}') OR (evenement_ssr.sejour_id IS NULL AND evt_seance.sejour_id = '{$this->_id}')"; $count_event_sunday = $_evt->countList($where, null, $ljoin); $nb_days = 7; // Si aucun evenement le dimanche if (!$count_event_sunday) { $nb_days = 6; $where["evenement_ssr.debut"] = "BETWEEN '{$saturday} 00:00:00' AND '{$saturday} 23:59:59'"; $count_event_saturday = $_evt->countList($where, null, $ljoin); // Aucun evenement le samedi et aucun le dimanche if (!$count_event_saturday) { $nb_days = 5; } } return $nb_days; }
$msg = $collectif->store(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-modify"); } // Nombre d'intervenant pour les séances collectives $nb_intervs = CValue::post("nb_interv"); $nb_inter_by_evnt = array(); if ($nb_intervs) { foreach (explode("|", $nb_intervs) as $_nb_interv) { list($evenement_id, $nb_interv) = explode("-", $_nb_interv); $nb_inter_by_evnt[$evenement_id] = $nb_interv; } } // Nombre de patient pour les séances collectives $nb_patients = CValue::post("nb_patient"); $nb_patients = $nb_patients ? explode("|", $nb_patients) : array(); foreach ($nb_patients as $_nb_patients) { list($evenement_id, $nb_patient) = explode("-", $_nb_patients); $evenement = new CEvenementSSR(); $evenement->load($evenement_id); if ($evenement->annule) { continue; } // Ajout du nombre de patient présent aux evenements SSR $evenement->nb_patient_seance = $nb_patient; $evenement->nb_intervenant_seance = $nb_inter_by_evnt[$evenement_id]; $evenement->_traitement = "1"; $msg = $evenement->store(); CAppUI::displayMsg($msg, "CEvenementSSR-msg-modify"); } echo CAppUI::getMsg(); CApp::rip();
/** * Recalcul le RHS à partir des événements validés * * @return void */ function recalculate() { // Suppression des lignes d'activités du RHS /** @var CLigneActivitesRHS $_line */ foreach ($this->loadBackRefs("lines") as $_line) { if ($_line->auto) { $_line->delete(); } } $this->loadBackRefs("lines"); // Chargement du séjour $sejour = $this->loadRefSejour(); // Ajout des lignes d'activités $evenementSSR = new CEvenementSSR(); $evenementSSR->sejour_id = $sejour->_id; $evenementSSR->realise = 1; /** @var CEvenementSSR[] $evenements */ $evenements = $evenementSSR->loadMatchingList(); foreach ($evenements as $_evenement) { $evenementRhs = $_evenement->getRHS(); if ($evenementRhs->_id != $this->_id) { continue; } $therapeute = $_evenement->loadRefTherapeute(); $intervenant = $therapeute->loadRefIntervenantCdARR(); $code_intervenant_cdarr = $intervenant->code; // Actes CdARRs $actes_cdarr = $_evenement->loadRefsActesCdARR(); foreach ($actes_cdarr as $_acte_cdarr) { $ligne = new CLigneActivitesRHS(); $ligne->rhs_id = $this->_id; $ligne->executant_id = $therapeute->_id; $ligne->code_activite_cdarr = $_acte_cdarr->code; $ligne->code_intervenant_cdarr = $code_intervenant_cdarr; $ligne->loadMatchingObject(); $ligne->crementDay($_evenement->debut, "inc"); $ligne->auto = "1"; $ligne->store(); } // Actes CsARRs $actes_csarr = $_evenement->loadRefsActesCsARR(); foreach ($actes_csarr as $_acte_csarr) { $ligne = new CLigneActivitesRHS(); $ligne->rhs_id = $this->_id; $ligne->executant_id = $therapeute->_id; $ligne->code_activite_csarr = $_acte_csarr->code; $ligne->code_intervenant_cdarr = $code_intervenant_cdarr; $ligne->loadMatchingObject(); $ligne->crementDay($_evenement->debut, "inc"); $ligne->auto = "1"; $ligne->store(); } } // Gestion des administrations /** @var CActeCdARR $_acte_cdarr_adm */ foreach ($sejour->loadBackRefs("actes_cdarr") as $_acte_cdarr_adm) { $administration = $_acte_cdarr_adm->loadRefAdministration(); $therapeute = $administration->loadRefAdministrateur(); $intervenant = $therapeute->loadRefIntervenantCdARR(); $code_intervenant_cdarr = $intervenant->code; $ligne = new CLigneActivitesRHS(); $ligne->rhs_id = $this->_id; $ligne->executant_id = $therapeute->_id; $ligne->code_activite_cdarr = $_acte_cdarr_adm->code; $ligne->code_intervenant_cdarr = $code_intervenant_cdarr; $ligne->loadMatchingObject(); $ligne->crementDay($administration->dateTime, "inc"); $ligne->auto = "1"; $ligne->store(); } }
* * @package Mediboard * @subpackage SSR * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ */ CCanDo::checkRead(); $token_field_evts = CValue::getOrSession("token_field_evts"); /** @var CSejour[] $sejours */ $sejours = array(); /** @var CEvenementSSR[] $events */ $events = array(); $_evenements = $token_field_evts ? explode("|", $token_field_evts) : array(); foreach ($_evenements as $_evenement_id) { $evenement = new CEvenementSSR(); $evenement->load($_evenement_id); if ($evenement->sejour_id) { $events[$evenement->_id] = $evenement; } else { $evenement->loadRefsEvenementsSeance(); foreach ($evenement->_ref_evenements_seance as $_evt_seance) { $_evt_seance->debut = $evenement->debut; $_evt_seance->duree = $evenement->duree; $events[$_evt_seance->_id] = $_evt_seance; } } } $count_zero_actes = 0; $evenements = array(); foreach ($events as $_event) {
/** * @see parent::store() */ function store() { // Transférer les événéments de l'ancien référent vers le nouveau if ($this->technicien_id && $this->fieldAltered("technicien_id")) { $technicien = $this->loadRefTechnicien(); $old_technicien = new CTechnicien(); $old_technicien->load($this->_old->_id); $evenement = new CEvenementSSR(); $evenement->therapeute_id = $old_technicien->kine_id; $evenement->sejour_id = $this->sejour_id; foreach ($evenement->loadMatchingList() as $_evenement) { /** @var CEvenementSSR $_evenement */ if (!$_evenement->_traite) { $_evenement->therapeute_id = $technicien->kine_id; $_evenement->store(); CAppUI::setMsg("{$_evenement->_class}-msg-modify", UI_MSG_OK); } } } return parent::store(); }
$evenement = new CEvenementSSR(); $where = array(); $where["debut"] = " BETWEEN '{$date_min}' AND '{$date_max}'"; $where["therapeute_id"] = " = '{$_plage_conge->user_id}'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement->loadList($where); foreach ($evenements as $_evenement) { $sejour = $_evenement->loadRefSejour(); $bilan = $sejour->loadRefBilanSSR(); $bilan->loadRefTechnicien(); $_sejours[$sejour->_id] = $sejour; } } foreach ($_sejours as $_sejour) { // On compte le nombre d'evenements SSR à transferer $evenement_ssr = new CEvenementSSR(); $where = array(); $where["sejour_id"] = " = '{$_sejour->_id}'"; $where["therapeute_id"] = " = '{$_plage_conge->user_id}'"; $where["debut"] = " BETWEEN '{$date_min}' AND '{$date_max}'"; $count_evts["{$_plage_conge->_id}-{$_sejour->_id}"] = $evenement_ssr->countList($where); $_sejour->checkDaysRelative($date); $replacement = $_sejour->loadRefReplacement($_plage_conge->_id); if (!$replacement->_id || $type == "reeducateur") { $sejours_count++; } if ($replacement->_id || $type == "kine") { $replacement->loadRefReplacer()->loadRefFunction(); } if (!$replacement->_id && $type == "kine") { $replacement->_ref_guessed_replacers = CEvenementSSR::getAllTherapeutes($_sejour->patient_id, $kine->function_id);
function getNbJoursPlanningSSR($date) { $sunday = CMbDT::date("next sunday", CMbDT::date("- 1 DAY", $date)); $saturday = CMbDT::date("-1 DAY", $sunday); $_evt = new CEvenementSSR(); $where = array(); $where["debut"] = "BETWEEN '{$sunday} 00:00:00' AND '{$sunday} 23:59:59'"; $where["sejour_id"] = " = '{$this->_id}'"; $count_event_sunday = $_evt->countList($where); $nb_days = 7; // Si aucun evenement le dimanche if (!$count_event_sunday) { $nb_days = 6; $where["debut"] = "BETWEEN '{$saturday} 00:00:00' AND '{$saturday} 23:59:59'"; $count_event_saturday = $_evt->countList($where); // Aucun evenement le samedi et aucun le dimanche if (!$count_event_saturday) { $nb_days = 5; } } return $nb_days; }
* @package Mediboard * @subpackage SSR * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ */ CCanDo::checkRead(); $token_evts = CValue::getOrSession("token_evts"); $_evenements = array(); if ($token_evts) { $_evenements = explode("|", $token_evts); } $count_actes = $actes = array("cdarr" => array(), "csarr" => array()); $evenements = array(); foreach ($_evenements as $_evenement_id) { $evenement = new CEvenementSSR(); $evenement->load($_evenement_id); if ($evenement->seance_collective_id) { // Recuperation des informations de la seance collective $evenement->loadRefSeanceCollective(); $evenement->debut = $evenement->_ref_seance_collective->debut; $evenement->duree = $evenement->_ref_seance_collective->duree; } $evenement->loadRefSejour()->loadRefPatient(); // Chargement et comptage des codes de tous les actes foreach ($evenement->loadRefsActes() as $_type => $_actes) { foreach ($_actes as $_acte) { $actes[$_type][$_acte->code] = $_acte->code; if (!isset($count_actes[$_type][$_acte->code])) { $count_actes[$_type][$_acte->code] = 0; }
/** * @see parent::delete() */ function delete() { // Lors de la suppression du remplacant, on reaffecte les evenements au kine principal $this->completeField("sejour_id", "conge_id", "replacer_id"); $conge = $this->loadRefConge(); $sejour = $this->loadRefSejour(); $bilan = $sejour->loadRefBilanSSR(); $bilan->loadRefTechnicien(); $date_debut = $conge->date_debut; $date_fin = CMbDT::date("+1 DAY", $conge->date_fin); $evenement_ssr = new CEvenementSSR(); $where = array(); $where["therapeute_id"] = " = '{$this->replacer_id}'"; $where["sejour_id"] = " = '{$this->sejour_id}'"; $where["debut"] = "BETWEEN '{$date_debut}' AND '{$date_fin}'"; /** @var CEvenementSSR[] $evenements */ $evenements = $evenement_ssr->loadList($where); foreach ($evenements as $_evenement) { $_evenement->therapeute_id = $sejour->_ref_bilan_ssr->_ref_technicien->kine_id; if ($msg = $_evenement->store()) { CAppUI::setMsg($msg, UI_MSG_WARNING); } } return parent::delete(); }