/** * Chargement des motifs du chapitre * * @return CMotif[] */ function loadRefsMotifs() { $motif = new CMotif(); $where = array("chapitre_id" => " = '{$this->_id}'"); $order = "code_diag"; return $this->_ref_motifs = $motif->loadList($where, $order); }
$reload = CValue::get("reload", 0); $see_hors_ccmu = CValue::getOrSession("see_hors_ccmu", 0); $rpu = new CRPU(); $rpu->load($rpu_id); $rpu->loadRefMotif(); $rpu->loadRefsReponses(); $rpu->orderCtes(); $where = array(); if ($chapitre_id) { $where["chapitre_id"] = " = '{$chapitre_id}'"; } if ($search) { $where[] = "nom LIKE '%{$search}%' or code_diag LIKE '%{$search}%'"; } $motif = new CMotif(); $motifs = $motif->loadList($where, "chapitre_id", null, "motif_id"); if (!$see_hors_ccmu) { foreach ($motifs as $_motif) { /* @var CMotif $_motif*/ if (!($_motif->degre_min <= $rpu->_estimation_ccmu && $_motif->degre_max >= $rpu->_estimation_ccmu)) { unset($motifs[$_motif->_id]); } } } $chapitre = new CChapitreMotif(); /** @var CChapitreMotif[] $chapitres */ $chapitres = $chapitre->loadList(null, "nom"); $chapitres_search = $chapitres; foreach ($motifs as $_motif) { /* @var CMotif $_motif*/ $chapitres_search[$_motif->chapitre_id]->_ref_motifs[$_motif->_id] = $_motif;
/** * $Id: vw_motifs.php 27936 2015-04-13 12:53:35Z aurelie17 $ * * @package Mediboard * @subpackage Urgences * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 27936 $ */ CCanDo::checkRead(); $motif_id = CValue::getOrSession("motif_id"); $chapitre_id = CValue::getOrSession("chapitre_id"); $liste = CValue::get("liste"); $motif = new CMotif(); $motifs = $motif->loadList(null, "chapitre_id"); $chapitre = new CChapitreMotif(); /** @var CChapitreMotif[] $chapitres */ $chapitres = $chapitre->loadList(null, "nom"); foreach ($chapitres as $chap) { $chap->loadRefsMotifs(); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("motif_id", $motif_id); $smarty->assign("chapitre_id", $chapitre_id); $smarty->assign("chapitres", $chapitres); if ($liste == "motif") { $smarty->display("vw_list_motifs.tpl"); } elseif ($liste == "chapitre") { $smarty->display("vw_list_chapitres.tpl");