Example #1
0
 /**
  * @see parent::getPerm()
  */
 function getPerm($perm)
 {
     if (!isset($this->_ref_object->_id)) {
         $this->loadRefsFwd();
     }
     return $this->public ? $this->_ref_object->getPerm($perm) : $this->_ref_object->getPerm($perm) && $this->_ref_user->getPerm(PERM_EDIT);
 }
/**
 * Récupération des statistiques du nombre de consultations par mois
 * selon plusieurs filtres
 *
 * @param string $debut   Date de début
 * @param string $fin     Date de fin
 * @param int    $prat_id Identifiant du praticien
 *
 * @return array
 */
function graphConsultations($debut = null, $fin = null, $prat_id = 0)
{
    if (!$debut) {
        $debut = CMbDT::date("-1 YEAR");
    }
    if (!$fin) {
        $fin = CMbDT::date();
    }
    $rectif = CMbDT::transform("+0 DAY", $debut, "%d") - 1;
    $debutact = CMbDT::date("-{$rectif} DAYS", $debut);
    $rectif = CMbDT::transform("+0 DAY", $fin, "%d") - 1;
    $finact = CMbDT::date("-{$rectif} DAYS", $fin);
    $finact = CMbDT::date("+ 1 MONTH", $finact);
    $finact = CMbDT::date("-1 DAY", $finact);
    $pratSel = new CMediusers();
    $pratSel->load($prat_id);
    $ticks = array();
    $serie_total = array('label' => 'Total', 'data' => array(), 'markers' => array('show' => true), 'bars' => array('show' => false));
    for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
        $ticks[] = array(count($ticks), CMbDT::transform("+0 DAY", $i, "%m/%Y"));
        $serie_total['data'][] = array(count($serie_total['data']), 0);
    }
    $ds = CSQLDataSource::get("std");
    $total = 0;
    $series = array();
    $query = "SELECT COUNT(consultation.consultation_id) AS total,\r\n    DATE_FORMAT(plageconsult.date, '%m/%Y') AS mois,\r\n    DATE_FORMAT(plageconsult.date, '%Y%m') AS orderitem\r\n    FROM consultation\r\n    INNER JOIN plageconsult\r\n    ON consultation.plageconsult_id = plageconsult.plageconsult_id\r\n    INNER JOIN users_mediboard\r\n    ON plageconsult.chir_id = users_mediboard.user_id\r\n    WHERE plageconsult.date BETWEEN '{$debutact}' AND '{$finact}'\r\n    AND consultation.annule = '0'";
    if ($prat_id) {
        $query .= "\nAND plageconsult.chir_id = '{$prat_id}'";
    }
    $query .= "\nGROUP BY mois ORDER BY orderitem";
    $serie = array('data' => array());
    $result = $ds->loadlist($query);
    foreach ($ticks as $i => $tick) {
        $f = true;
        foreach ($result as $r) {
            if ($tick[1] == $r["mois"]) {
                $serie["data"][] = array($i, $r["total"]);
                $serie_total["data"][$i][1] += $r["total"];
                $total += $r["total"];
                $f = false;
                break;
            }
        }
        if ($f) {
            $serie["data"][] = array(count($serie["data"]), 0);
        }
    }
    $series[] = $serie;
    // Set up the title for the graph
    $title = "Nombre de consultations";
    $subtitle = "- {$total} consultations -";
    if ($prat_id) {
        $subtitle .= " Dr {$pratSel->_view} -";
    }
    $options = CFlotrGraph::merge("bars", array('title' => utf8_encode($title), 'subtitle' => utf8_encode($subtitle), 'xaxis' => array('ticks' => $ticks), 'bars' => array('stacked' => true, 'barWidth' => 0.8)));
    return array('series' => $series, 'options' => $options);
}
Example #3
0
 /**
  * Permission generic check
  * 
  * @param int $permType Type of permission : PERM_READ|PERM_EDIT|PERM_DENY
  * 
  * @return boolean
  */
 function getPerm($permType)
 {
     if (!$this->_ref_user) {
         $this->loadRefsFwd();
     }
     return $this->_ref_user->getPerm($permType);
 }
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_ref_chir || !$this->_ref_function) {
         $this->loadRefsFwd();
     }
     return $this->_ref_chir->getPerm($permType) || $this->_ref_function->getPerm($permType);
 }
 /**
  * @see parent::store()
  */
 function store()
 {
     $this->completeField("handled");
     if (!$this->creation_date) {
         $this->creation_date = CMbDT::dateTime();
         if ($this->_id) {
             $this->creation_date = $this->loadFirstLog()->date;
         }
     }
     if ($this->fieldModified("handled", "1") || $this->handled && !$this->handled_date && !$this->handled_user_id) {
         $this->handled_date = CMbDT::dateTime();
         $this->handled_user_id = CMediusers::get()->_id;
         if ($this->handled) {
             $last_log = $this->loadLastLog();
             $this->handled_date = $last_log->date;
             $this->handled_user_id = $last_log->user_id;
         }
     }
     if ($this->fieldModified("handled", "0")) {
         $this->handled_date = $this->handled_user_id = "";
     }
     if ($msg = parent::store()) {
         return $msg;
     }
 }
 /**
  * logSejourAccess
  *
  * @param CSejour $sejour
  *
  * @return bool has the access been logged
  */
 static function logForSejour($sejour)
 {
     $group = $sejour->loadRefEtablissement();
     if (!CAppUI::conf("admin CLogAccessMedicalData enable_log_access", $group) || !$sejour->_id) {
         return false;
     }
     $user = CMediusers::get();
     $conf = CAppUI::conf("admin CLogAccessMedicalData round_datetime", $group);
     $datetime = CMbDT::dateTime();
     switch ($conf) {
         case '1m':
             // minute
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:%M:00");
             break;
         case '10m':
             // 10 minutes
             $minute = CMbDT::format($datetime, "%M");
             $minute = str_pad(floor($minute / 10) * 10, 2, 0, STR_PAD_RIGHT);
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:{$minute}:00");
             break;
         case '1d':
             // 1 day
             $datetime = CMbDT::format($datetime, "%y-%m-%d 00:00:00");
             break;
         default:
             // 1 hour
             $datetime = CMbDT::format($datetime, "%y-%m-%d %H:00:00");
             break;
     }
     return self::logintoDb($user->_id, $sejour->_class, $sejour->_id, $datetime, $group->_id);
 }
Example #7
0
 /**
  * Load object
  *
  * @return CMbObject|CMediusers
  */
 function loadRefMetaObject()
 {
     $this->_ref_metaobject = CMbMetaObject::loadFromGuid("{$this->object_class}-{$this->object_id}");
     if ($this->object_class == "CMediusers") {
         $this->_ref_mediuser = $this->_ref_metaobject;
         $this->_ref_mediuser->loadRefFunction();
     }
     return $this->_ref_metaobject;
 }
 /**
  * Get field and object corresponding to $field field
  *
  * @param CMbObject $object Object
  * @param string    $field  Field name
  *
  * @return array
  */
 static function getFieldAndObjectStatic(CMbObject $object, $field)
 {
     if (strpos($field, "CONNECTED_USER") === 0) {
         $object = CMediusers::get();
         if ($field != "CONNECTED_USER") {
             $field = substr($field, 15);
         }
     }
     return array($object, $field);
 }
Example #9
0
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_id) {
         return parent::getPerm($permType);
     }
     if (!$this->_ref_chir) {
         $this->loadRefChir();
     }
     return $this->_ref_chir->getPerm($permType) && parent::getPerm($permType);
 }
 /**
  * @see parent::store()
  */
 function store()
 {
     $this->completeField("operation_id");
     if ($this->_id && $this->etat != "a_commander") {
         if (CMediusers::get()->_id == $this->loadRefOperation()->chir_id) {
             $this->etat = "modify";
         }
     }
     // Standard storage
     if ($msg = parent::store()) {
         return $msg;
     }
 }
Example #11
0
 /**
  * @see parent::store()
  */
 function store()
 {
     // Save owner and creation date
     if (!$this->_id) {
         if (!$this->creation_date) {
             $this->creation_date = CMbDT::dateTime();
         }
         if (!$this->owner_id) {
             $this->owner_id = CMediusers::get()->_id;
         }
     }
     return parent::store();
 }
 /**
  * get the permission type
  *
  * @param int $permType permission type
  *
  * @return bool
  */
 function getPerm($permType)
 {
     if (CAppUI::$user->isAdmin()) {
         return true;
     }
     if (CModule::getCanDo('astreintes')->edit && $this->_ref_user->getPerm($permType)) {
         return true;
     }
     /* @todo À quoi sert ce droit ? */
     if (CModule::getCanDo("astreintes")->read && $permType <= PERM_READ) {
         return true;
     }
     return false;
 }
Example #13
0
 /**
  * Crée les employés du cabinet
  *
  * @return bool
  */
 protected function createEmployes()
 {
     $param = new CParamsPaie();
     $params = $param->loadList();
     if (!is_array($params)) {
         return true;
     }
     foreach ($params as $key => $curr_param) {
         $user = new CMediusers();
         $user->load($params[$key]->employecab_id);
         $employe = new CEmployeCab();
         $employe->function_id = $user->function_id;
         $employe->nom = $user->_user_last_name;
         $employe->prenom = $user->_user_first_name;
         $employe->function = $user->_user_type;
         $employe->adresse = $user->_user_adresse;
         $employe->cp = $user->_user_cp;
         $employe->ville = $user->_user_ville;
         $employe->store();
         $params[$key]->employecab_id = $employe->employecab_id;
         $params[$key]->store();
     }
     return true;
 }
 public function setDestinationActiveParticipant()
 {
     $destination_active_participant = $this->msg_xml->addElement($this->audit_message, 'ActiveParticipant');
     $MSH = $this->hl7_xml->queryNode("MSH", null, $foo, true);
     $receiving_facility = $this->hl7_xml->queryTextNode("MSH.5/HD.1", $MSH);
     $receiving_application = $this->hl7_xml->queryTextNode("MSH.6/HD.1", $MSH);
     $this->msg_xml->addAttribute($destination_active_participant, 'UserID', "{$receiving_facility}|{$receiving_application}");
     $this->msg_xml->addAttribute($destination_active_participant, 'AlternativeUserID', CMediusers::get()->_id);
     $this->msg_xml->addAttribute($destination_active_participant, 'UserName', trim(CMediusers::get()));
     $this->msg_xml->addAttribute($destination_active_participant, 'UserIsRequestor', "false");
     $this->msg_xml->addAttribute($destination_active_participant, 'NetworkAccessPointID', $this->hostname);
     $this->msg_xml->addAttribute($destination_active_participant, 'NetworkAccessPointTypeCode', "2");
     $this->destination_active_participant = $destination_active_participant;
     $this->setDestinationActiveParticipantRoleIDCode();
 }
Example #15
0
 /**
  * Set starting and closing formulas
  *
  * @param integer|null $user_id Given owner id
  *
  * @return null
  */
 function loadSalutations($user_id = null)
 {
     if (!$this->_id) {
         return null;
     }
     $salutation = new CSalutation();
     $salutation->owner_id = $user_id ? $user_id : CMediusers::get()->_id;
     $salutation->object_class = $this->_class;
     $salutation->object_id = $this->_id;
     if ($salutation->loadMatchingObject()) {
         $this->_starting_formula = $salutation->starting_formula;
         $this->_closing_formula = $salutation->closing_formula;
     } else {
         $this->_starting_formula = CAppUI::tr('CSalutation-starting_formula|default');
         $this->_closing_formula = CAppUI::tr('CSalutation-closing_formula|default');
     }
 }
Example #16
0
 /**
  * Merges an array of objects
  * @see parent
  *
  * @param CUser[] $objects An array of CMbObject to merge
  * @param bool    $fast    Tell wether to use SQL (fast) or PHP (slow but checked and logged) algorithm
  *
  * @return CUser
  */
 function merge($objects, $fast = false)
 {
     if (!$this->_id) {
         return "CUser-merge-alternative-mode-required";
     }
     // Fast merging obligatoire
     $fast = true;
     $mediusers = array();
     foreach ($objects as $object) {
         $object->loadRefMediuser();
         $mediusers[] = $object->_ref_mediuser;
         $object->removePerms();
     }
     $this->loadRefMediuser();
     $this->_ref_mediuser->_force_merge = true;
     $this->_ref_mediuser->merge($mediusers, $fast);
     return parent::merge($objects, $fast);
 }
Example #17
0
 /**
  * Load all salutation from a given class
  *
  * @param string       $object_class Target object class
  * @param integer|null $object_id    Target object ID
  * @param int          $perm         Permission needed on owners
  * @param integer|null $owner_id     Specific owner ID
  *
  * @return CSalutation[]
  */
 static function loadAllSalutations($object_class, $object_id = null, $perm = PERM_EDIT, $owner_id = null)
 {
     if (!$owner_id) {
         $users = new CMediusers();
         $users = $users->loadListWithPerms($perm, array('actif' => "= '1'"));
         $user_ids = $users ? CMbArray::pluck($users, '_id') : array(CMediusers::get()->_id);
         unset($users);
     } else {
         $user_ids = array($owner_id);
     }
     /** @var CSalutation $salutation */
     $salutation = new self();
     $ds = $salutation->_spec->ds;
     $where = array('owner_id' => $ds->prepareIn($user_ids), 'object_class' => $ds->prepare('= ?', $object_class));
     if ($object_id) {
         $where['object_id'] = $ds->prepare('= ?', $object_id);
     }
     return $salutation->loadList($where);
 }
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if ($this->chir_id) {
         if (!$this->_ref_chir) {
             $this->loadRefChir();
         }
         return $this->_ref_chir->getPerm($permType);
     }
     if ($this->function_id) {
         if (!$this->_ref_function) {
             $this->loadRefFunction();
         }
         return $this->_ref_function->getPerm($permType);
     }
     if ($this->group_id) {
         if (!$this->_ref_group) {
             $this->loadRefGroup();
         }
         return $this->_ref_group->getPerm($permType);
     }
 }
Example #19
0
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_id) {
         return parent::getPerm($permType);
     }
     if (!$this->_ref_salle) {
         $this->loadRefSalle();
     }
     if ($this->chir_id && !$this->_ref_chir) {
         $this->loadRefChir();
     }
     if ($this->spec_id && !$this->_ref_spec) {
         $this->loadRefSpec();
     }
     $pratPerm = false;
     // Test de Permission
     if ($this->chir_id) {
         $pratPerm = $this->_ref_chir->getPerm($permType);
     } elseif ($this->spec_id) {
         $pratPerm = $this->_ref_spec->getPerm($permType);
     }
     return $this->_ref_salle->getPerm($permType) && $pratPerm;
 }
Example #20
0
 /**
  * @see parent::extractData
  */
 function extractData()
 {
     /** @var CCDAFactory $factory */
     $factory = $this->mbObject;
     $this->document = $factory->mbObject;
     $this->targetObject = $factory->targetObject;
     $this->id_classification = 0;
     $this->id_external = 0;
     $mediuser = CMediusers::get();
     $specialty = $mediuser->loadRefOtherSpec();
     $group = $mediuser->loadRefFunction()->loadRefGroup();
     $identifiant = CXDSTools::getIdEtablissement(true, $group) . "/{$mediuser->_id}";
     $this->specialty = $specialty->code . "^" . $specialty->libelle . "^" . $specialty->oid;
     $this->xcn_mediuser = CXDSTools::getXCNMediuser($identifiant, $mediuser->_p_last_name, $mediuser->_p_first_name);
     $this->xon_etablissement = CXDSTools::getXONetablissement($group->text, CXDSTools::getIdEtablissement(false, $group));
     $this->xpath = new CMbXPath($factory->dom_cda);
     $this->xpath->registerNamespace("cda", "urn:hl7-org:v3");
     $this->patient_id = $this->getID($factory->patient, $factory->receiver);
     $this->ins_patient = $this->getIns($factory->patient);
     $uuid = CMbSecurity::generateUUID();
     $this->uuid["registry"] = $uuid . "1";
     $this->uuid["extrinsic"] = $uuid . "2";
     $this->uuid["signature"] = $uuid . "3";
 }
Example #21
0
    $plagesel->loadAffectationsPersonnel();
}
if (!$plagesel->_id) {
    $plagesel->date = $date;
    $plagesel->debut = CPlageOp::$hours_start . ":00:00";
    $plagesel->fin = CPlageOp::$hours_start . ":00:00";
}
// On charge le praticien et ses fonctions secondaires
$chir = $plagesel->loadRefChir();
$chir->loadRefFunction();
$_functions = $chir->loadBackRefs("secondary_functions");
// Liste des Specialités
$function = new CFunctions();
$specs = $function->loadSpecialites(PERM_READ, 1);
// Liste des Anesthésistes
$mediuser = new CMediusers();
$anesths = $mediuser->loadAnesthesistes();
CMbObject::massLoadFwdRef($anesths, "function_id");
foreach ($anesths as $_anesth) {
    $_anesth->loadRefFunction();
}
// Liste des praticiens
$chirs = $mediuser->loadChirurgiens();
CMbObject::massLoadFwdRef($chirs, "function_id");
foreach ($chirs as $_chir) {
    $_chir->loadRefFunction();
}
// Chargement du personnel
$listPers = array("iade" => CPersonnel::loadListPers("iade"), "op" => CPersonnel::loadListPers("op"), "op_panseuse" => CPersonnel::loadListPers("op_panseuse"), "sagefemme" => CPersonnel::loadListPers("sagefemme"), "manipulateur" => CPersonnel::loadListPers("manipulateur"));
if ($plagesel->_id) {
    $plagesel->multicountOperations();
Example #22
0
<?php

/**
 * $Id: vw_rapport.php 20186 2013-08-19 07:47:12Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 20186 $
 */
$date = CValue::getOrSession("date");
// Chargement des praticiens
$med = new CMediusers();
$listPrat = $med->loadPraticiens(PERM_READ);
$dateEntree = CMbDT::dateTime("23:59:00", $date);
$dateSortie = CMbDT::dateTime("00:01:00", $date);
$hierEntree = CMbDT::date("- 1 day", $dateEntree);
$hierEntree = CMbDT::dateTime("23:59:00", $hierEntree);
// Chargement des services
$service = new CService();
$whereServices = array();
$whereServices["group_id"] = "= '" . CGroups::loadCurrent()->_id . "'";
$whereServices["cancelled"] = "= '0'";
$services = $service->loadListWithPerms(PERM_READ, $whereServices, "nom");
// Initialisations
$totalHospi = 0;
$totalAmbulatoire = 0;
$totalMedecin = 0;
$total_prat = array();
foreach ($listPrat as $key => $prat) {
/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPstats
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_bar");
$debut = CValue::get("debut", CMbDT::date("-1 YEAR"));
$fin = CValue::get("fin", CMbDT::date());
$prat_id = CValue::get("prat_id", 0);
$service_id = CValue::get("service_id", 0);
$pratSel = new CMediusers();
$pratSel->load($prat_id);
$service = new CSalle();
$service->load($service_id);
$datax = array();
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
    $datax[] = CMbDT::transform("+0 DAY", $i, "%m/%Y");
}
$sql = "SELECT * FROM service WHERE";
if ($service_id) {
    $sql .= "\nAND id = '{$service_id}'";
}
$ds = CSQLDataSource::get("std");
$services = $ds->loadlist($sql);
$opbysalle = array();
foreach ($services as $service) {
 * $Id$
 *
 * @category Soins
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 */
CCanDo::checkEdit();
$consult_id = CValue::get("consult_id", 0);
$sejour_id = CValue::get("sejour_id", 0);
$chir_id = CValue::get("chir_id", 0);
$sejour = new CSejour();
$sejour->load($sejour_id);
if ($sejour->_id) {
    $chir = new CMediusers();
    if ($chir_id) {
        $chir->load($chir_id);
    } else {
        $chir->load($sejour->praticien_id);
    }
    $sejour->loadRefPraticien();
    $sejour->loadRefsActes();
    $sejour->updateFormFields();
    $sejour->_datetime = CMbDT::dateTime();
    // Récupération des tarifs
    /** @var CTarif $tarif */
    $tarif = new CTarif();
    $tarifs = array();
    $order = "description";
    $where = array();
        $plages_func = $plage->loadList($where);
        $utilisation_func = utilisation_rdv($plages_func, $listPlace, $plage);
    }
    if ($display_nb_consult == "etab") {
        $where["chir_id"] = CSQLDataSource::prepareIn(array_keys($listAllPrat));
        /** @var CPlageconsult[] $plages_etab */
        $plages_etab = $plage->loadList($where);
        $utilisation_etab = utilisation_rdv($plages_etab, $listPlace, $plage);
    }
    // next consult
    $next_plage = $plage->getNextPlage();
    // previous consult
    $previous_plage = $plage->getPreviousPlage();
}
// user's function available
$mediuser = new CMediusers();
$mediusers = $mediuser->loadProfessionnelDeSanteByPref(PERM_READ, $function_id);
// Vérifier le droit d'écriture sur la plage sélectionnée
$plage->canDo();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("plageconsult_id", $plageconsult_id);
$smarty->assign("plage", $plage);
$smarty->assign("listPlace", $listPlace);
$smarty->assign("next_plage", $next_plage);
$smarty->assign("list_users", $mediusers);
$smarty->assign("previous_plage", $previous_plage);
$smarty->assign("listBefore", $listBefore);
$smarty->assign("listAfter", $listAfter);
$smarty->assign("quotas", $quotas);
$smarty->assign("multiple", $multiple);
Example #26
0
 * @category CompteRendu
 * @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();
$nom = CValue::post("nom");
$email = CValue::post("email");
$subject = CValue::post("subject");
$body = CValue::post("body");
$object_guid = CValue::post("object_guid");
$object = CMbObject::loadFromGuid($object_guid);
/** @var $exchange_source CSourceSMTP */
$exchange_source = CExchangeSource::get("mediuser-" . CMediusers::get()->_id, "smtp");
$exchange_source->init();
if (CAppUI::pref('hprim_med_header')) {
    $body = $object->makeHprimHeader($exchange_source->email, $email) . "\n" . $body;
}
try {
    $exchange_source->setRecipient($email, $nom);
    $exchange_source->setSubject($subject);
    $exchange_source->setBody(nl2br($body));
    switch ($object->_class) {
        case "CCompteRendu":
            /** @var $object CCompteRendu */
            $object->makePDFpreview(true);
            $file = $object->_ref_file;
            $exchange_source->addAttachment($file->_file_path, $file->file_name);
            break;
Example #27
0
 * $Id: object_merger.php 22331 2014-03-06 11:13:46Z charlyecho $
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 22331 $
 */
$objects_class = CValue::getOrSession('objects_class');
$readonly_class = CValue::get('readonly_class');
$objects_id = CValue::get('objects_id');
$mode = CValue::get('mode');
if (!is_array($objects_id)) {
    $objects_id = explode("-", $objects_id);
}
$user = CMediusers::get();
CMbArray::removeValue("", $objects_id);
$objects = array();
$result = null;
$checkMerge = null;
$statuses = array();
$merge_type = null;
if (class_exists($objects_class) && count($objects_id)) {
    foreach ($objects_id as $object_id) {
        /** @var CMbObject $object */
        $object = new $objects_class();
        $merge_type = $object->_spec->merge_type;
        if ($merge_type == 'none') {
            CAppUI::stepAjax("Merging_%sclass_is_forbidden_by_spec", UI_MSG_ERROR, CAppUI::tr($object->_class));
        }
        // the CMbObject is loaded
    CCanDo::checkEdit();
}
// L'utilisateur est-il chirurgien?
$chir_id = CValue::getOrSession("chir_id");
$mediuser = CMediusers::get($chir_id);
if (!$mediuser->isPraticien()) {
    $mediuser = new CMediusers();
}
$function_id = CValue::getOrSession("function_id");
$type = CValue::getOrSession("type", "interv");
$page = CValue::get("page");
$sejour_type = CValue::get("sejour_type");
$step = 30;
$protocole = new CProtocole();
$where = array();
$chir = new CMediusers();
$chir->load($chir_id);
if ($chir->_id) {
    $chir->loadRefFunction();
    $functions = array($chir->function_id);
    $chir->loadBackRefs("secondary_functions");
    foreach ($chir->_back["secondary_functions"] as $curr_sec_func) {
        $functions[] = $curr_sec_func->function_id;
    }
    $list_functions = implode(",", $functions);
    $where[] = "protocole.chir_id = '{$chir->_id}' OR protocole.function_id IN ({$list_functions})";
} else {
    $where["function_id"] = " = '{$function_id}'";
}
$where["for_sejour"] = $type == 'interv' ? "= '0'" : "= '1'";
if ($sejour_type) {
<?php

/**
 * $Id: ajax_edit_source_mediuser.php 27587 2015-03-18 09:31:32Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage mediusers
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27587 $
 */
CCanDo::checkRead();
$user_id = CValue::getOrSession("user_id");
$mediuser = CMediusers::get($user_id);
// Source File system d'envoi
$fs_source_envoi = CExchangeSource::get("envoi-tarmed-{$mediuser->_guid}", "file_system", true, null, false);
// Source File system d'envoi
$fs_source_reception = CExchangeSource::get("reception-tarmed-{$mediuser->_guid}", "file_system", true, null, false);
$fs_sources_tarmed = array("fs_source_envoi" => array($fs_source_envoi), "fs_source_reception" => array($fs_source_reception));
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("fs_sources_tarmed", $fs_sources_tarmed);
$smarty->display("sources_archive.tpl");
Example #30
0
<?php

/**
 * $Id$
 *  
 * @category SalleOp
 * @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();
$curr_user = CMediusers::get();
$anesths = $curr_user->loadAnesthesistes();
$smarty = new CSmartyDP();
$smarty->assign("anesths", $anesths);
$smarty->display("inc_lock_sortie.tpl");