$where[] = "plagesop.chir_id = '{$userSel->_id}'\r\n OR plagesop.anesth_id = '{$userSel->_id}'\r\n OR plagesop.spec_id = '{$userSel->function_id}' {$in}"; $order = "debut, salle_id"; $plageop = new CPlageOp(); /** @var CPlageOp[] $list_plages */ $list_plages = $plageop->loadList($where, $order); // Chargement d'optimisation CMbObject::massLoadFwdRef($list_plages, "chir_id"); CMbObject::massLoadFwdRef($list_plages, "anesth_id"); CMbObject::massLoadFwdRef($list_plages, "spec_id"); CMbObject::massLoadFwdRef($list_plages, "salle_id"); CMbObject::massCountBackRefs($list_plages, "notes"); foreach ($list_plages as $_plage) { $op_canceled = new COperation(); $op_canceled->annulee = 1; $op_canceled->plageop_id = $_plage->_id; $nb_canceled += $op_canceled->countMatchingList(); $_plage->loadRefChir(); $_plage->loadRefAnesth(); $_plage->loadRefSpec(); $_plage->loadRefSalle(); $_plage->makeView(); $_plage->loadRefsNotes(); //compare current group with bloc group $_plage->_ref_salle->loadRefBloc(); if ($_plage->_ref_salle->_ref_bloc->group_id != $current_group->_id) { $_plage->_ref_salle->_ref_bloc->loadRefGroup(); } $where = array(); if ($userSel->_id && !$userSel->isAnesth()) { $where["chir_id"] = "= '{$userSel->_id}'"; }
/** * Récupération le nombre d'intervention annulées pour la plage * * @return int */ function countOperationsAnnulees() { if (!$this->_id) { return $this->_count_operations_annulees = 0; } $operation = new COperation(); $operation->plageop_id = $this->_id; $operation->annulee = '1'; return $this->_count_operations_annulees = $operation->countMatchingList(); }
} $prat = new CMediusers(); $prat->load($chirSel); $function_prat = $prat->loadRefFunction(); $user = new CMediusers(); $nbjours = 7; $listPlageConsult = new CPlageconsult(); $listPlageOp = new CPlageOp(); $where = array(); $where["date"] = "= '{$fin}'"; $where["chir_id"] = " = '{$chirSel}'"; $operation = new COperation(); $operation->chir_id = $chirSel; $operation->date = $fin; // find for day number if (!$listPlageConsult->countList($where) && !$listPlageOp->countList($where) && !$operation->countMatchingList()) { $nbjours--; // Aucune plage le dimanche, on peut donc tester le samedi. $dateArr = CMbDT::date("-1 day", $fin); $where["date"] = "= '{$dateArr}'"; $operation->date = $dateArr; if (!$listPlageConsult->countList($where) && !$listPlageOp->countList($where) && !$operation->countMatchingList()) { $nbjours--; } } // Instanciation du planning $planning = new CPlanningWeek($debut, $debut, $fin, $nbjours, false, null, null, true); if ($user->load($chirSel)) { $planning->title = $user->load($chirSel)->_view; } else { $planning->title = "";
<?php /** * $Id$ * * @package Mediboard * @subpackage PMSI * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ */ CCanDo::checkAdmin(); CAppUI::stepAjax("Fonctionnalité désactivée pour le moment", UI_MSG_ERROR); return; $operation = new COperation(); $operation->facture = "1"; $count = $operation->countMatchingList(); CAppUI::stepAjax("'%s' opérations facturées trouvées", UI_MSG_OK, $count); $operation->facture = "0"; $count = $operation->countMatchingList(); CAppUI::stepAjax("'%s' opérations non facturées trouvées", UI_MSG_OK, $count); $start = 30000; $max = 100; $limit = "{$start}, {$max}"; /** @var COperation $_operation */ foreach ($operation->loadMatchingList(null, $limit) as $_operation) { $_operation->loadHprimFiles(); if ($count = count($_operation->_ref_hprim_files)) { CAppUI::stepAjax("'%s' HPRIM files for operation '%s'", UI_MSG_OK, $count, $_operation->_view); } }