} 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(); } $_SESSION["dPbloc"]["id"] = null; } else { //Modification des plages if ($obj->_id != 0) { $oldObj = new CPlageOp(); $oldObj->load($obj->_id); $salle_id = $oldObj->salle_id; $chir_id = $oldObj->chir_id; $spec_id = $oldObj->spec_id; $secondary_function_id = $oldObj->secondary_function_id; while ($repeat > 0) { if ($obj->_id) { if ($msg = $obj->store()) { CAppUI::setMsg("Plage non mise à jour", UI_MSG_ERROR); CAppUI::setMsg("Plage du {$obj->date}: {$msg}", UI_MSG_ERROR); } else { CAppUI::setMsg("Plage mise à jour", UI_MSG_OK); } managePersonnel($obj); } $repeat -= $obj->becomeNext($salle_id, $chir_id, $spec_id, $secondary_function_id);
/** * $Id: inc_edit_planning.php 22873 2014-04-22 07:51:07Z mytto $ * * @package Mediboard * @subpackage dPbloc * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 22873 $ */ $plageop_id = CValue::getOrSession("plageop_id"); $date = CValue::getOrSession("date", CMbDT::date()); $bloc_id = CValue::get("bloc_id"); // Informations sur la plage demandée $plagesel = new CPlageOp(); $plagesel->load($plageop_id); $plagesel->loadRefSalle(); $listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom"); //curent bloc if $bloc_id $bloc = new CBlocOperatoire(); $bloc->load($bloc_id); $listSalles = $bloc->loadRefsSalles(); $arrKeySalle = array_keys($listSalles); // cleanup listBlocs foreach ($listBlocs as $key => $curr_bloc) { $salles = $curr_bloc->loadRefsSalles(); foreach ($salles as $id => $_salle) { if (count($arrKeySalle) && !in_array($id, $arrKeySalle)) { unset($salles[$id]); continue; }
* $Id:$ * * @package Mediboard * @subpackage dPbloc * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision:$ */ CCanDo::checkEdit(); $plageop_id = CValue::get("plageop_id"); $list_type = CValue::get("list_type", "left"); $anesth = new CTypeAnesth(); $anesth = $anesth->loadGroupList(); // Infos sur la plage opératoire $plage = new CPlageOp(); $plage->load($plageop_id); $plage->loadRefsFwd(); $intervs = $plage->loadRefsOperations(true, "rank, rank_voulu, horaire_voulu", true, $list_type != "left"); $chirs = CMbObject::massLoadFwdRef($intervs, "chir_id"); CMbObject::massLoadFwdRef($chirs, "function_id"); $sejours = CMbObject::massLoadFwdRef($intervs, "sejour_id"); CMbObject::massLoadFwdRef($sejours, "patient_id"); foreach ($intervs as $_interv) { $_interv->loadRefsFwd(); $_interv->_ref_chir->loadRefFunction(); $_interv->_ref_sejour->loadRefsFwd(); $_interv->_count_affectations_personnel = $_interv->countBackRefs("affectations_personnel"); $patient = $_interv->_ref_sejour->_ref_patient; $patient->loadRefDossierMedical(); $patient->_ref_dossier_medical->countAllergies(); }
* @version $Revision: 26995 $ */ global $m; $do = new CDoObjectAddEdit("COperation"); $do->doBind(); if (intval(CValue::post("del", null))) { CValue::setSession("operation_id"); $do->redirectDelete = "m={$m}&tab=vw_edit_planning&operation_id=0"; $do->doDelete(); } else { if ($do->_obj->plageop_id && $do->_old->plageop_id != $do->_obj->plageop_id) { $do->_obj->rank = 0; } $do->doStore(); if (CModule::getActive("forms") && CValue::post("_set_fin_op") && CValue::post("fin_op") == "current") { $ex_class_events = CExClassEvent::getForObject($do->_obj, "fin_intervention", "required"); echo CExClassEvent::getJStrigger($ex_class_events); } if ($do->_obj->plageop_id && $do->_old->plageop_id && $do->_old->plageop_id != $do->_obj->plageop_id) { $plageop = new CPlageOp(); $plageop->load($do->_old->plageop_id); $plageop->spec_id = ""; $plageop->store(); } $m = CValue::post("otherm", $m); if ($m == "dPhospi") { $do->redirectStore = "m={$m}#operation" . $do->_obj->operation_id; } $do->redirectStore = "m={$m}&operation_id=" . $do->_obj->operation_id; } $do->doRedirect();
/** * @see parent::store() */ function store() { $this->updatePlainFields(); $this->completeField("chir_id", "spec_id"); $old = new CPlageOp(); if ($this->_id) { $old->load($this->_id); $old->loadRefsOperations(); } // Pas de changement de date si on a déjà des interventions if ($this->fieldModified("date") && count($old->_ref_operations)) { return CAppUI::tr("CPlageOp-failed-change_date", count($old->_ref_operations)); } // Erreur si on est en multi-praticiens, qu'il y a des interventions et qu'on veut mettre un praticien if ($this->fieldValued("chir_id") && !$this->unique_chir && $old->spec_id && count($old->_ref_operations)) { mbTrace("all the same to me"); } if (null !== $this->chir_id && $this->_id && !$this->unique_chir) { if (count($old->_ref_operations) && $old->spec_id && $this->chir_id) { return CAppUI::tr("CPlageOp-failed-multi_chir", count($old->_ref_operations)); } } // Si on change de praticien alors qu'il y a déjà des interventions if ($this->fieldAltered("chir_id") && count($old->_ref_operations)) { // Si certaines ne sont pas annulées, on sort if ($this->countOperationsAnnulees() != count($old->_ref_operations)) { return CAppUI::tr("CPlageOp-failed-change_chir", count($old->_ref_operations)); } // Si toutes les interventions sont annulées, on les met hors plage $this->completeField("salle_id", "date"); foreach ($old->_ref_operations as $_op) { $_op->plageop_id = ""; $_op->date = $this->date; $_op->salle_id = $this->salle_id; $_op->store(); } } // Erreur si on créé-modifie une plage sur une salle bloquée $salle = $this->loadRefSalle(); if (count($salle->loadRefsBlocages($this->date))) { return CAppUI::tr("CPlageOp-failed-use_locked_room", $salle->_view); } // Modification du salle_id de la plage -> repercussion sur les interventions if ($this->fieldModified("salle_id")) { foreach ($old->_ref_operations as $_operation) { if ($_operation->salle_id == $old->salle_id) { $_operation->salle_id = $this->salle_id; $_operation->store(false); } } } // Modification du début de la plage ou des minutes entre les interventions $this->completeField("debut", "temps_inter_op"); if ($this->fieldModified("debut") || $this->fieldModified("temps_inter_op")) { if ($this->fieldModified("temps_inter_op")) { $with_cancelled = CAppUI::conf("dPplanningOp COperation save_rank_annulee_validee"); $this->loadRefsOperations($with_cancelled, "rank, rank_voulu, horaire_voulu", true); } $this->reorderOp(); } if (!$this->_id || !$this->original_owner_id && !$this->original_function_id) { $this->original_owner_id = $this->chir_id; $this->original_function_id = $this->spec_id; } return parent::store(); }
<?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"); $object = new CPlageOp(); $object->load($plage_id); $object->loadRefsNotes(); $object->loadRefChir()->loadRefFunction(); $object->loadRefAnesth()->loadRefFunction(); $object->loadRefSpec(); $object->loadRefsOperations(); $object->loadRefSalle(); foreach ($object->_ref_operations as $_op) { $_op->loadRefPatient()->loadRefPhotoIdentite(); } // smarty $smarty = new CSmartyDP(); $smarty->assign("object", $object); $smarty->display("inc_vw_plageop.tpl");
<?php /** * $Id$ * * @package Mediboard * @subpackage PlanningOp * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkRead(); $chir_id = CValue::get("chir_id"); $plageop = new CPlageOp(); $plageop->load(CValue::get("plageop_id")); $plageop->loadRefSalle(); $where = array("chir_id" => "= '{$chir_id}'"); $plageop->loadRefsOperations(false, null, true, null, $where); $plageop->guessHoraireVoulu(); $rank_validated = array(); $rank_not_validated = array(); $_op = new COperation(); $_last_op = null; foreach ($plageop->_ref_operations as $_op) { $_op->loadRefChir()->loadRefFunction(); $_op->loadRefSejour()->loadRefPatient()->loadRefDossierMedical()->countAllergies(); $_op->loadExtCodesCCAM(); if ($_op->_horaire_voulu) { $_last_op = $_op; } }