* @version    $Revision$
 */
CCanDo::checkRead();
$ds = CSQLDataSource::get("std");
// Initialisation des variables
$plageconsult_id = CValue::get("plageconsult_id");
$consult_id = CValue::get("consult_id");
$slot_id = CValue::get("slot_id");
$heure = CValue::get("heure");
$multiple = CValue::get("multipleMode", false);
$display_nb_consult = CAppUI::conf("dPcabinet display_nb_consult");
$quotas = null;
// Récupération des consultations de la plage séléctionnée
$plage = new CPlageconsult();
if ($plageconsult_id) {
    $plage->load($plageconsult_id);
    $plage->loadRefsNotes();
    $date = $plage->date;
} else {
    $date = CValue::get("date", CMbDT::date());
}
// consultation précise
$consultation_target = new CConsultation();
if ($consult_id) {
    $consultation_target->load($consult_id);
} elseif ($heure) {
    $consultation_target->heure = $heure;
}
$consultation_target->loadRefElementPrescription();
// Chargement des places disponibles
$listPlace = array();
$filter = new CConsultation();
$filter->plageconsult_id = CValue::get("plage_id", null);
$filter->_date_min = CValue::get("_date_min", "{$now}");
$filter->_date_max = CValue::get("_date_max", "{$now}");
$filter->_telephone = CValue::get("_telephone", 1);
$filter->_coordonnees = CValue::get("_coordonnees");
$filter->_plages_vides = CValue::get("_plages_vides", 1);
$filter->_non_pourvues = CValue::get("_non_pourvues", 1);
$filter->_print_ipp = CValue::get("_print_ipp", CAppUI::conf("dPcabinet CConsultation show_IPP_print_consult"));
$chir = CValue::getOrSession("chir");
$show_lit = false;
// On selectionne les plages
$plage = new CPlageconsult();
$where = array();
if ($filter->plageconsult_id) {
    $plage->load($filter->plageconsult_id);
    $filter->_date_min = $filter->_date_max = $plage->date;
    $filter->_ref_plageconsult = $plage;
    $where["plageconsult_id"] = "= '{$filter->plageconsult_id}'";
} else {
    $where["date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
    // Liste des praticiens
    $listPrat = CConsultation::loadPraticiens(PERM_EDIT);
    $where["chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrat), $chir);
}
$order = array();
$order[] = "date";
$order[] = "chir_id";
$order[] = "debut";
/** @var CPlageconsult[] $listPlage */
$listPlage = $plage->loadList($where, $order);
Beispiel #3
0
// Vérification des droits sur les praticiens et les fonctions
$listPraticiens = CConsultation::loadPraticiens(PERM_EDIT);
$function = new CFunctions();
$listFunctions = $function->loadSpecialites(PERM_EDIT);
$correspondantsMedicaux = array();
$medecin_adresse_par = "";
$_function_id = null;
$nb_plages = 0;
$count_next_plage = 0;
// On a fourni l'id du praticien
$chir_id = CAppUI::conf("dPcabinet keepchir") ? CValue::getOrSession("chir_id") : CValue::get("chir_id");
// Nouvelle consultation
if (!$consultation_id) {
    if ($plageconsult_id) {
        // On a fourni une plage de consultation
        $plageConsult->load($plageconsult_id);
    } else {
        if ($chir_id) {
            $chir = new CMediusers();
            $chir->load($chir_id);
        }
    }
    // assign patient if defined in get
    if ($pat_id = CValue::get("pat_id")) {
        // On a fourni l'id du patient
        $pat->load($pat_id);
    }
    if ($date_planning) {
        // On a fourni une date
        $consult->_date = $date_planning;
    }
}
// Praticien selectionné
$chirSel = CValue::getOrSession("chirSel", $chir ? $chir->user_id : null);
// Type de vue
$show_payees = CValue::getOrSession("show_payees", 1);
$show_annulees = CValue::getOrSession("show_annulees", 0);
// Plage de consultation selectionnée
$plageconsult_id = CValue::getOrSession("plageconsult_id", null);
$plageSel = new CPlageconsult();
if ($plageconsult_id === null && $chirSel && $is_in_period) {
    $nowTime = CMbDT::time();
    $where = array("chir_id = '{$chirSel}' OR remplacant_id = '{$chirSel}' OR pour_compte_id = '{$chirSel}'", "date" => "= '{$today}'", "debut" => "<= '{$nowTime}'", "fin" => ">= '{$nowTime}'");
    $plageSel->loadObject($where);
}
if (!$plageSel->plageconsult_id) {
    $plageSel->load($plageconsult_id);
} else {
    $plageconsult_id = $plageSel->plageconsult_id;
}
$plageSel->loadRefChir();
$plageSel->loadRefRemplacant();
$plageSel->loadRefPourCompte();
$plageSel->loadRefsNotes();
$plageSel->loadRefsBack($show_annulees, true, $show_payees);
if ($plageSel->_affected && count($plageSel->_ref_consultations)) {
    $firstconsult = reset($plageSel->_ref_consultations);
    $_firstconsult_time = substr($firstconsult->heure, 0, 5);
    $lastconsult = end($plageSel->_ref_consultations);
    $_lastconsult_time = substr($lastconsult->heure, 0, 5);
}
$consults = $plageSel->_ref_consultations;
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPcabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
// Object binding
$obj = new CPlageconsult();
$obj->bind($_POST);
$del = CValue::post("del", 0);
$repeat = min(CValue::post("_repeat", 0), 100);
if ($del) {
    // Suppression des plages
    $obj->load();
    while ($repeat > 0) {
        if (!$obj->_id) {
            CAppUI::setMsg("Plage non trouvée", UI_MSG_ERROR);
        } else {
            if ($msg = $obj->delete()) {
                CAppUI::setMsg("Plage non supprimée", UI_MSG_ERROR);
                CAppUI::setMsg("Plage du {$obj->date}: {$msg}", UI_MSG_ERROR);
            } else {
                CAppUI::setMsg("Plage supprimée", UI_MSG_OK);
            }
        }
        $repeat -= $obj->becomeNext();
    }
    CValue::setSession("plageconsult_id");
} else {
<?php

/**
 * $Id$
 *  
 * @category Cabinet
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$plage_id = CValue::get("plage_id");
$plage = new CPlageconsult();
$plage->load($plage_id);
$plage->loadRefsNotes();
$plage->loadRefChir()->loadRefFunction();
$plage->loadRefRemplacant()->loadRefFunction();
foreach ($plage->loadRefsConsultations() as $_consult) {
    $_consult->loadRefPatient()->loadRefPhotoIdentite();
}
$plage->loadDisponibilities();
// smarty
$smarty = new CSmartyDP();
$smarty->assign("object", $plage);
$smarty->display("inc_vw_plage_consult.tpl");