<?php /** * Edit discipline * * @category Mediusers * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:$ * @link http://www.mediboard.org */ CCanDo::checkRead(); $discipline_id = CValue::getOrSession("discipline_id"); // Récupération des groups $groups = CGroups::loadGroups(PERM_EDIT); // Récupération de la fonction selectionnée $discipline = new CDiscipline(); $discipline->load($discipline_id); $discipline->loadGroupRefsBack(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("discipline", $discipline); $smarty->assign("groups", $groups); $smarty->display("inc_edit_discipline.tpl");
<?php /** * Refresh incrementer/actor EAI * * @category EAI * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version SVN: $Id:$ * @link http://www.mediboard.org */ CCanDo::checkAdmin(); $domain_id = CValue::get("domain_id"); // Liste des domaines $domain = new CDomain(); $domain->load($domain_id); $domain->loadRefsGroupDomains(); $domain->loadRefActor(); $domain->loadRefIncrementer()->loadView(); $domain->isMaster(); // Liste des acteurs $actor = new CInteropActor(); $actors = $actor->getObjects(); $groups = CGroups::loadGroups(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("domain", $domain); $smarty->assign("actors", $actors); $smarty->assign("groups", $groups); $smarty->display("inc_vw_incrementer_actor.tpl");
/** * @see parent::onBeforeMerge */ function onBeforeMerge(CMbObject $mbObject) { if (!parent::onBeforeMerge($mbObject)) { return; } // Si pas en mode alternatif if (!CAppUI::conf("alternative_mode")) { throw new CMbException("no_alternative_mode"); } $patient = $mbObject; $patient_elimine = new CPatient(); $patient_elimine->load(reset($mbObject->_merging)); // Si Client if (!CAppUI::conf('sip server')) { $mbObject->_fusion = array(); foreach (CGroups::loadGroups() as $_group) { /** @var CInteropSender $sender */ $sender = $mbObject->_eai_sender_guid ? CMbObject::loadFromGuid($mbObject->_eai_sender_guid) : null; if ($sender && $sender->group_id == $_group->_id) { continue; } $patient->_IPP = null; $patient->loadIPP($_group->_id); $patient1_ipp = $patient->_IPP; $patient_elimine->_IPP = null; $patient_elimine->loadIPP($_group->_id); $patient2_ipp = $patient_elimine->_IPP; // Passage en trash des IPP des patients $tap_IPP = CPatient::getTagIPP($_group->_id); if (!$tap_IPP) { continue; } $idexPatient = new CIdSante400(); $idexPatient->tag = $tap_IPP; $idexPatient->object_class = "CPatient"; $idexPatient->object_id = $patient->_id; $idexsPatient = $idexPatient->loadMatchingList(); $idexPatientElimine = new CIdSante400(); $idexPatientElimine->tag = $tap_IPP; $idexPatientElimine->object_class = "CPatient"; $idexPatientElimine->object_id = $patient_elimine->_id; $idexsPatientElimine = $idexPatientElimine->loadMatchingList(); $idexs = array_merge($idexsPatient, $idexsPatientElimine); $idexs_changed = array(); if (count($idexs) > 1) { foreach ($idexs as $_idex) { // On continue pour ne pas mettre en trash l'IPP du patient que l'on garde if ($_idex->id400 == $patient1_ipp) { continue; } $old_tag = $_idex->tag; $_idex->tag = CAppUI::conf('dPpatients CPatient tag_ipp_trash') . $tap_IPP; $_idex->last_update = CMbDT::dateTime(); if (!($msg = $_idex->store())) { if ($_idex->object_id == $patient_elimine->_id) { $idexs_changed[$_idex->_id] = $old_tag; } } } } if (!$patient1_ipp && !$patient2_ipp) { continue; } $mbObject->_fusion[$_group->_id] = array("patientElimine" => $patient_elimine, "patient1_ipp" => $patient1_ipp, "patient2_ipp" => $patient2_ipp, "idexs_changed" => $idexs_changed); } } $this->sendFormatAction("onBeforeMerge", $mbObject); }
/** * Liste de Tous les établissements * * @param int $permType Type de permission à valider * * @return CGroups[] */ static function loadEtablissements($permType = PERM_READ) { return CGroups::loadGroups($permType); }
* * @category Etablissements * @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 */ $field = CValue::get('field'); $view_field = CValue::get('view_field', $field); $input_field = CValue::get('input_field', $view_field); $show_view = CValue::get('show_view', 'false') == 'true'; $keywords = CValue::get($input_field); $edit = CValue::get('edit', 0); CSessionHandler::writeClose(); $groups = CGroups::loadGroups($edit ? PERM_EDIT : PERM_READ); if ($keywords) { foreach ($groups as $_group) { if (!preg_match("/^{$keywords}/i", $_group->text)) { unset($groups[$_group->_id]); } } } $group = new CGroups(); $template = $group->getTypedTemplate("autocomplete"); $smarty = new CSmartyDP(); $smarty->assign("matches", $groups); $smarty->assign("field", $field); $smarty->assign('view_field', $view_field); $smarty->assign('show_view', $show_view); $smarty->assign("template", $template);
<?php /** * $Id$ * * @package Mediboard * @subpackage forms * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkEdit(); $date_min = CValue::getOrSession("date_min", CMbDT::date("-1 MONTH")); $date_max = CValue::getOrSession("date_max", CMbDT::date()); $groups = CGroups::loadGroups(PERM_READ); $field = new CExClassField(); // Création du template $smarty = new CSmartyDP(); $smarty->assign("date_min", $date_min); $smarty->assign("date_max", $date_max); $smarty->assign("groups", $groups); $smarty->assign("field", $field); $smarty->display("view_ex_object_explorer.tpl");
/** * @see parent::loadEditView() */ function loadEditView() { parent::loadEditView(); CExObject::initLocales(); CExObject::$_locales_cache_enabled = false; if ($this->pixel_positionning) { $grid = null; $out_of_grid = null; $this->getPixelGrid(); foreach ($this->_ref_groups as $_ex_group) { $_ex_group->loadRefsSubgroups(true); $_ex_group->loadRefsPictures(true); $_subgroups = $_ex_group->loadRefsSubgroups(true); foreach ($_subgroups as $_subgroup) { $_subgroup->countBackRefs("children_groups"); $_subgroup->countBackRefs("children_fields"); $_subgroup->countBackRefs("children_messages"); } } } else { list($grid, $out_of_grid) = $this->getGrid(4, 40, false); } $events = $this->loadRefsEvents(); foreach ($events as $_event) { $_event->countBackRefs("constraints"); } $this->_groups = CGroups::loadGroups(); $this->_ex_object = $this->getExObjectInstance(); $this->_grid = $grid; $this->_out_of_grid = $out_of_grid; if (!$this->_id) { $this->group_id = CGroups::loadCurrent()->_id; } $classes = CExClassEvent::getReportableClasses(); $instances = array(); foreach ($classes as $_class) { $instances[$_class] = new $_class(); } $this->_host_objects = $instances; $category = new CExClassCategory(); $this->_categories = $category->loadList(null, "title"); }
$class = CValue::get("class"); $field = CValue::get("field"); $text = CValue::get("text", CValue::post("text", "")); $depend_value_1 = CValue::get("depend_value_1"); $depend_value_2 = CValue::get("depend_value_2"); $class_depend_value_1 = CValue::get("class_depend_value_1"); $class_depend_value_2 = CValue::get("class_depend_value_2"); $depend_value_1 = stripslashes(utf8_decode($depend_value_1)); $depend_value_2 = stripslashes(utf8_decode($depend_value_2)); // Liste des users accessibles $listPrat = new CMediusers(); $listFct = $listPrat->loadFonctions(PERM_EDIT); $listPrat = $listPrat->loadUsers(PERM_EDIT); $listFunc = new CFunctions(); $listFunc = $listFunc->loadSpecialites(PERM_EDIT); $listEtab = CGroups::loadGroups(PERM_EDIT); // Objet ciblé $object = new $class(); $dependValues = array(); // To set the depend values always as an array (empty or not) $helped = array(); if ($object->_specs[$field]->helped && !is_bool($object->_specs[$field]->helped)) { if (!is_array($object->_specs[$field]->helped)) { $helped = array($object->_specs[$field]->helped); } else { $helped = $object->_specs[$field]->helped; } } foreach ($helped as $i => $depend_field) { $key = "depend_value_" . ($i + 1); $spec = $object->_specs[$depend_field];
/** * Trigger before event merge * * @param CMbObject $mbObject Object * * @throws CMbException * * @return bool */ function onBeforeMerge(CMbObject $mbObject) { if (!parent::onBeforeMerge($mbObject)) { return false; } // Si pas en mode alternatif if (!CAppUI::conf("alternative_mode")) { throw new CMbException("no_alternative_mode"); } $sejour = $mbObject; $sejour_elimine = new CSejour(); $sejour_elimine->load(reset($mbObject->_merging)); // Si Client if (!CAppUI::conf('smp server')) { $mbObject->_fusion = array(); foreach (CGroups::loadGroups() as $_group) { $sender = CMbObject::loadFromGuid($mbObject->_eai_sender_guid); if ($sender && $sender->group_id == $_group->_id) { continue; } $sejour->_NDA = null; $sejour->loadNDA($_group->_id); $sejour1_nda = $sejour->_NDA; $sejour_elimine->_NDA = null; $sejour_elimine->loadNDA($_group->_id); $sejour2_nda = $sejour_elimine->_NDA; // Passage en trash des NDA des séjours $tag_NDA = CSejour::getTagNDA($_group->_id); if (!$tag_NDA) { continue; } $idexSejour = new CIdSante400(); $idexSejour->tag = $tag_NDA; $idexSejour->object_class = "CSejour"; $idexSejour->object_id = $sejour->_id; $idexsSejour = $idexSejour->loadMatchingList(); $idexSejourElimine = new CIdSante400(); $idexSejourElimine->tag = $tag_NDA; $idexSejourElimine->object_class = "CSejour"; $idexSejourElimine->object_id = $sejour_elimine->_id; $idexsSejourElimine = $idexSejourElimine->loadMatchingList(); /** @var CIdSante400[] $idexs */ $idexs = array_merge($idexsSejour, $idexsSejourElimine); $idexs_changed = array(); if (count($idexs) > 1) { foreach ($idexs as $_idex) { // On continue pour ne pas mettre en trash le NDA du séjour que l'on garde if ($_idex->id400 == $sejour1_nda) { continue; } $old_tag = $_idex->tag; $_idex->tag = CAppUI::conf('dPplanningOp CSejour tag_dossier_trash') . $tag_NDA; $_idex->last_update = CMbDT::dateTime(); if (!($msg = $_idex->store())) { if ($_idex->object_id == $sejour_elimine->_id) { $idexs_changed[$_idex->_id] = $old_tag; } } } } if (!$sejour1_nda && !$sejour2_nda) { continue; } $mbObject->_fusion[$_group->_id] = array("sejourElimine" => $sejour_elimine, "sejour1_nda" => $sejour1_nda, "sejour2_nda" => $sejour2_nda, "idexs_changed" => $idexs_changed); } } $this->sendFormatAction("onBeforeMerge", $mbObject); return true; }