* @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;
    $_sejour->checkDaysRelative($date);
    $_sejour->loadRefPatient(1);
    $_sejour->loadRefBilanSSR()->getDateEnCours($date);
}
示例#2
0
$sejours = array();
/** @var CReplacement[][] $replacements */
$replacements = array();
/** @var CSejour[] $all_sejours */
$all_sejours = array();
$plateau = new CPlateauTechnique();
$plateau->group_id = $group->_id;
/** @var CPlateauTechnique[] $plateaux */
$plateaux = $plateau->loadMatchingList();
foreach ($plateaux as $_plateau) {
    foreach ($_plateau->loadRefsTechniciens() as $_technicien) {
        $_technicien->loadRefCongeDate($date);
        $_technicien->loadRefKine();
        $kine_id = $_technicien->_ref_kine->_id;
        // Chargement des sejours du technicien
        $sejours[$_technicien->_id] = CBilanSSR::loadSejoursSSRfor($_technicien->_id, $date);
        /** @var CSejour $_sejour */
        foreach ($sejours[$_technicien->_id] as $_sejour) {
            $_sejour->checkDaysRelative($date);
            $_sejour->loadRefPatient(1);
            $_sejour->loadRefBilanSSR();
            $all_sejours[] = $_sejour;
        }
        // Chargement de ses remplacements
        $replacement = new CReplacement();
        $replacements[$_technicien->_id] = $replacement->loadListFor($kine_id, $date);
        /** @var CReplacement $_replacement */
        foreach ($replacements[$_technicien->_id] as $_replacement) {
            // Détail sur le congé
            $_replacement->loadRefConge();
            $_replacement->_ref_conge->loadRefUser();