* @subpackage SSR
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
// Plateau du contexte
$plateau = new CPlateauTechnique();
$plateau->load(CValue::get("plateau_id"));
// Détails des techniciens
$date = CMbDT::date();
foreach ($plateau->loadRefsTechniciens(false) as $_technicien) {
    $_technicien->countSejoursDate($date);
}
// Technicien à editer
$technicien = new CTechnicien();
$technicien->load(CValue::get("technicien_id"));
$technicien->plateau_id = $plateau->_id;
$technicien->loadRefsNotes();
$technicien->loadRefPlateau();
$technicien->loadRefKine();
$technicien->countSejoursDate($date);
// Alter egos pour les transferts de séjours
$where["kine_id"] = "= '{$technicien->kine_id}'";
/** @var CTechnicien[] $alteregos */
$alteregos = $technicien->loadList($where);
unset($alteregos[$technicien->_id]);
foreach ($alteregos as $_alterego) {
    $_alterego->loadRefPlateau();
    $_alterego->loadRefKine();
}
/**
 * $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();
// Plateaux disponibles
$show_cancelled_services = CValue::getOrSession("show_cancelled_services");
$technicien_id = CValue::get("technicien_id");
$service_id = CValue::getOrSession("service_id");
$date = CValue::getOrSession("date", CMbDT::date());
$technicien = new CTechnicien();
$technicien->load($technicien_id);
$technicien->loadRefKine();
$kine_id = $technicien->_ref_kine->_id;
$sejours = CBilanSSR::loadSejoursSSRfor($technicien_id, $date, $show_cancelled_services);
$services = array();
$all_sejours = array();
foreach ($sejours as $_sejour) {
    // Filtre sur service
    $service = $_sejour->loadFwdRef("service_id");
    $services[$service->_id] = $service;
    if (!$technicien_id && $service_id && $_sejour->service_id != $service_id) {
        unset($sejours[$_sejour->_id]);
        continue;
    }
    $all_sejours[] = $_sejour;
Exemple #3
0
 /**
  * @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();
 }
foreach ($lines_by_cat as $chap => $_lines_by_chap) {
    foreach ($_lines_by_chap as $cat => $_lines_by_cat) {
        foreach ($_lines_by_cat['element'] as $line_id => $_line) {
            $lines_by_element[$chap][$cat][$_line->element_prescription_id][$_line->_id] = $_line;
        }
    }
}
// Bilan
$bilan = $sejour->loadRefBilanSSR();
$technicien = $bilan->loadRefTechnicien();
$technicien->loadRefKine();
$technicien->loadRefPlateau();
// Au cas où le bilan n'existe pas encore
$bilan->sejour_id = $sejour->_id;
// Technicien et plateau
$technicien = new CTechnicien();
$plateau = new CPlateauTechnique();
if ($technicien->_id = $bilan->technicien_id) {
    $technicien->loadMatchingObject();
    /** @var CPlateauTechnique $plateau */
    $plateau = $technicien->loadRefPlateau();
    $plateau->loadRefsEquipements();
    $plateau->loadRefsTechniciens();
}
// Chargement de tous les plateaux et des equipements et techniciens associés
$plateau_tech = new CPlateauTechnique();
$plateau_tech->group_id = CGroups::loadCurrent()->_id;
/** @var CPlateauTechnique[] $plateaux */
$plateaux = $plateau_tech->loadMatchingList();
CMbObject::massLoadBackRefs($plateaux, "equipements", "nom ASC");
foreach ($plateaux as $_plateau) {