/**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!$this->_ref_function) {
         $this->loadRefsFwd();
     }
     return $this->_ref_function->getPerm($permType);
 }
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if (!($this->_ref_user || $this->_ref_function || $this->_ref_group) || !$this->_ref_object) {
         $this->loadRefsFwd();
     }
     $parentPerm = parent::getPerm($permType);
     if (!$this->_id) {
         return $parentPerm;
     }
     if ($this->_id && $this->author_id == CMediusers::get()->_id) {
         return $parentPerm;
     }
     if ($this->_ref_object->_id) {
         $parentPerm = $parentPerm && $this->_ref_object->getPerm($permType);
     } else {
         if ($this->_ref_user->_id) {
             $parentPerm = $parentPerm && $this->_ref_user->getPerm($permType);
         }
         if ($this->_ref_function->_id) {
             $parentPerm = $parentPerm && $this->_ref_function->getPerm($permType);
         }
         if ($this->_ref_group->_id) {
             $parentPerm = $parentPerm && $this->_ref_group->getPerm($permType);
         }
     }
     return $parentPerm;
 }
예제 #3
0
 /**
  * @see parent::getPerm()
  */
 function getPerm($perm_type)
 {
     if ($this->function_id) {
         $this->loadRefFunction();
         return $this->_ref_function->getPerm($perm_type);
     }
     return true;
 }
예제 #4
0
 /**
  * Load postal address object
  *
  * @return CGroups|CFunctions|CBlocOperatoire
  */
 function loadRefAddress()
 {
     $this->_ref_address = $this->loadFwdRef("address_id", true);
     if ($this->address_class == "CFunctions" || $this->address_class == "CBlocOperatoire") {
         $this->_ref_address->loadRefGroup();
     }
     return $this->_ref_address;
 }
 /**
  * @see parent::getPerm()
  */
 function getPerm($perm_type)
 {
     if ($this->function_id && !$this->pere_id) {
         $this->loadRefFunction();
         return $this->_ref_function->getPerm($perm_type);
     } elseif ($this->pere_id) {
         $this->loadParent();
         return $this->_ref_pere->getPerm($perm_type);
     }
     return true;
 }
예제 #6
0
 /**
  * Get import function
  *
  * @return CFunctions
  */
 function getImportFunction()
 {
     static $function;
     if ($function) {
         return $function;
     }
     $function_name = CAppUI::conf($this->_import_function_name_conf);
     $function = new CFunctions();
     $function->text = $function_name;
     $function->loadMatchingObjectEsc();
     if (!$function->_id) {
         $function->group_id = CGroups::loadCurrent()->_id;
         $function->type = "cabinet";
         $function->compta_partagee = 0;
         $function->color = "#CCCCCC";
         if ($msg = $function->store()) {
             CAppUI::setMsg($msg, UI_MSG_WARNING);
         }
     }
     return $function;
 }
예제 #7
0
 /**
  * @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);
     }
 }
예제 #8
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;
 }
예제 #9
0
 * @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();
$user_id = CValue::getOrSession("user_id");
// Récupération des fonctions
$group = CGroups::loadCurrent();
if ($group->_id) {
    $functions = $group->loadFunctions();
} else {
    // Cas du admin qui n'a pas de mediuser, et donc pas de group_id
    $function = new CFunctions();
    $where = array("actif" => "='1'");
    $functions = $function->loadListWithPerms(PERM_READ, $where);
}
// Récupération du user à ajouter/editer
$object = new CMediusers();
if (CValue::get("no_association")) {
    $object->user_id = $user_id;
    $object->updateFormFields();
    $object->_user_id = $user_id;
    $object->_id = null;
    $object->actif = CValue::get("ldap_user_actif", 1);
    $object->deb_activite = CValue::get("ldap_user_deb_activite");
    $object->fin_activite = CValue::get("ldap_user_fin_activite");
} else {
    $object->load($user_id);
예제 #10
0
$filterOp->salle_id = CValue::getOrSession("salle_id");
$filterOp->_date_min = CValue::get("_date_min", $now);
$filterOp->_date_max = CValue::get("_date_max", $now);
$filterOp->_prat_id = CValue::getOrSession("_prat_id");
$filterOp->_plage = CValue::getOrSession("_plage");
$filterOp->_ranking = CValue::getOrSession("_ranking");
$filterOp->_cotation = CValue::getOrSession("_cotation");
$filterOp->_specialite = CValue::getOrSession("_specialite");
$filterOp->_codes_ccam = CValue::getOrSession("_codes_ccam");
$filterOp->_ccam_libelle = CValue::getOrSession("_ccam_libelle");
$filterSejour = new CSejour();
$filterSejour->type = CValue::getOrSession("type");
$filterSejour->ald = CValue::getOrSession("ald");
$yesterday = CMbDT::date("-1 day", $now);
$mediuser = new CMediusers();
$listPrat = $mediuser->loadPraticiens(PERM_READ);
$function = new CFunctions();
$listSpec = $function->loadSpecialites(PERM_READ);
// Récupération des salles
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_EDIT);
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("chir", $user->_id);
$smarty->assign("filter", $filterOp);
$smarty->assign("filterSejour", $filterSejour);
$smarty->assign("now", $now);
$smarty->assign("yesterday", $yesterday);
$smarty->assign("listPrat", $listPrat);
$smarty->assign("listSpec", $listSpec);
$smarty->assign("listBlocs", $listBlocs);
$smarty->display("print_plannings/vw_print_planning.tpl");
예제 #11
0
CCanDo::checkRead();
$user = CMediusers::get();
$user->loadRefFunction();
$selCabinet = CValue::getOrSession("selCabinet", $user->function_id);
$droit = true;
// si on affecte a selCabinet le function_id du user, on verifie si le user a le droit de creer des categories
if ($selCabinet == $user->function_id) {
    // Chargement de la liste de tous la cabinets
    $cabinet = new CFunctions();
    $listCabinets = $cabinet->loadSpecialites();
    if (!array_key_exists($selCabinet, $listCabinets)) {
        $droit = false;
    }
}
// Chargement de la liste des cabinets auquel le user a droit
$function = new CFunctions();
$listFunctions = $function->loadSpecialites(PERM_EDIT);
// Creation d'une categorie
$categorie = new CConsultationCategorie();
$categorie_id = CValue::getOrSession("categorie_id");
// Chargement des categories pour le cabinet selectionné ou pour le cabinet auquel appartient le user
if ($selCabinet) {
    $whereCategorie["function_id"] = " = '{$selCabinet}'";
} else {
    $whereCategorie["function_id"] = " = '{$user->function_id}'";
}
$orderCategorie = "nom_categorie ASC";
$categories = $categorie->loadList($whereCategorie, $orderCategorie);
// Chargement de la categorie selectionnee
if ($categorie_id) {
    $categorie = new CConsultationCategorie();
예제 #12
0
<?php

/**
 * $Id: vw_idx_materiel.php 27325 2015-02-26 09:30:02Z aurelie17 $
 *
 * @package    Mediboard
 * @subpackage dPbloc
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 27325 $
 */
CCanDo::checkEdit();
$filter = new COperation();
$filter->_date_min = CValue::getOrSession("_date_min", CMbDT::date("-7 day"));
$filter->_date_max = CValue::getOrSession("_date_max", CMbDT::date());
$listBlocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom");
$bloc_id = CValue::getOrSession("bloc_id", reset($listBlocs)->_id);
$praticien = new CMediusers();
$praticiens = $praticien->loadPraticiens();
$function = new CFunctions();
$functions = $function->loadSpecialites();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("filter", $filter);
$smarty->assign("bloc_id", $bloc_id);
$smarty->assign("listBlocs", $listBlocs);
$smarty->assign("praticiens", $praticiens);
$smarty->assign("functions", $functions);
$smarty->assign("function_id", CValue::getOrSession("function_id"));
$smarty->assign("praticien_id", CValue::getOrSession("praticien_id"));
$smarty->display("vw_idx_materiel.tpl");
예제 #13
0
						  echo utf8_encode($__text);
						  if($user['resp_ent'] != $__text) {
						  ?>
						  <div class="bulle">
							  <?php echo utf8_encode($user['resp_ent']); ?>
						  </div>
              	  <?php 
              }
              ?>			  
			  </td>
			  
              <td class="zinfo"> 
			  
			  <?php
			  //--------------- Owen 01/2011 Limitation de caractère
              $__text = CFunctions::cut_string($user['nom_ent'], $max_input_text+3);
              echo utf8_encode($__text);
              if($user['nom_ent'] != $__text) {
              	?>
              	 <div class="bulle">
			         <?php echo utf8_encode($user['nom_ent']); ?>
			     </div>
              	<?php 
              }
              ?>
			  </td>
			  <td class="zinfo"> 
			  <?php 
				echo $user['id_sec'];
				$sql_nomSec='select nom_sec FROM secteur WHERE id_sec='.$user['id_sec'];
				$nomSec=CBdd::select_one($sql_nomSec, 'nom_sec');
예제 #14
0
<?php

/**
 * $Id: vw_edit_packs.php 19285 2013-05-26 13:10:13Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 19285 $
 */
CCanDo::checkRead();
$user = CMediusers::get();
// Chargement des fontions
$function = new CFunctions();
$listFunctions = $function->loadListWithPerms(PERM_EDIT);
// Chargement du pack demandé
$pack = new CPackExamensLabo();
$pack->load(CValue::getOrSession("pack_examens_labo_id"));
if ($pack->_id && $pack->getPerm(PERM_EDIT)) {
    $pack->loadRefs();
} else {
    $pack = new CPackExamensLabo();
}
//Chargement de tous les packs
$where = array("function_id IS NULL OR function_id " . CSQLDataSource::prepareIn(array_keys($listFunctions)));
$where["obsolete"] = " = '0'";
$order = "libelle";
$listPacks = $pack->loadList($where, $order);
foreach ($listPacks as $key => $curr_pack) {
    $listPacks[$key]->loadRefs();
예제 #15
0
 /**
  * @see parent::getPerm()
  */
 function getPerm($permType)
 {
     if ($this->_id && $this->function_id) {
         $this->loadRefFunction();
         return $this->_ref_function->getPerm($permType) && parent::getPerm($permType);
     }
     return parent::getPerm($permType);
 }
예제 #16
0
}
else if ( $_SERVER['REQUEST_METHOD'] == "POST" ) {	
	$a = @$_POST["a"];
	if(!empty($_POST['order'])) $order = $_POST['order']; else $order = @$_SESSION['order'];
}


// SESSION VARIABLE
if (isset($_GET['alphaA']))	$_SESSION['alphaA']	= $_GET['alphaA'];


// RECUPERATION VALEUR
$zSortField      = 'id' ;
$zSortDirection  = CFunctions::getUserParam('zSortDirection', 'ASC') ;
$pagecourant     = CFunctions::getUserParam('zSortField', '0') ;
$iCurrentPage    = CFunctions::getUserParam('iPage', '1') ;
$iMaxPerPage     = CConfiguration::get_valeur('MAX_ITEM_PER_PAGE', 10) ;
$iStart          = $iCurrentPage - 1  ;


//COMPTEUR D'ENREGISTREMENT
$i = CTableGroupeCommune::get_iNbrContact($_SESSION['groupe']);
$iMaxPerPage1 = $i-1;
// FIN COMPTEUR
$iNbPage    = ceil(($iMaxPerPage1/$iMaxPerPage)) ;

$zListeGetParam  = '' ;



/*--------------------------------------------------------------------
 /**
  * Create the mediuser
  *
  * @param CMediusers $mediuser mediuser
  *
  * @return int
  */
 function createDoctor(CMediusers $mediuser)
 {
     $sender = $this->_ref_sender;
     $function = new CFunctions();
     $function->text = CAppUI::conf("hl7 importFunctionName");
     $function->group_id = $sender->group_id;
     $function->loadMatchingObjectEsc();
     if (!$function->_id) {
         $function->type = "cabinet";
         $function->compta_partagee = 0;
         $function->color = "ffffff";
         $function->store();
     }
     $mediuser->function_id = $function->_id;
     $mediuser->makeUsernamePassword($mediuser->_user_first_name, $mediuser->_user_last_name, null, true);
     $mediuser->_user_type = 13;
     // Medecin
     $mediuser->actif = CAppUI::conf("hl7 doctorActif") ? 1 : 0;
     $user = new CUser();
     $user->user_last_name = $mediuser->_user_last_name;
     $user->user_first_name = $mediuser->_user_first_name;
     // On recherche par le seek
     $users = $user->seek("{$user->user_last_name} {$user->user_first_name}");
     if (count($users) == 1) {
         $user = reset($users);
         $user->loadRefMediuser();
         $mediuser = $user->_ref_mediuser;
     } else {
         // Dernière recherche si le login est déjà existant
         $user = new CUser();
         $user->user_username = $mediuser->_user_username;
         if ($user->loadMatchingObject()) {
             // On affecte un username aléatoire
             $mediuser->_user_username .= rand(1, 10);
         }
         $mediuser->store();
     }
     return $mediuser->_id;
 }
예제 #18
0
파일: user.php 프로젝트: rakotobe/Rakotobe
 <h2>Informations personnelles</h2>
 <p>
   <label>Civilit&eacute;</label>
   <input type="radio" value="3" <?php echo CForm::get_checked($civilite, 3) ?> name="civilite"/>
   M.
   <input type="radio" value="1" <?php echo CForm::get_checked($civilite, 1) ?> name="civilite"/>
   Mme
   <input type="radio" value="2" <?php echo CForm::get_checked($civilite,2) ?> name="civilite"/>
   Mlle</p>
 <p>
   <label>Nom </label>
   <input name="nom" type="text" value="<?php echo  $nom?>" />
 </p>
 <p>
   <label>Pr&eacute;nom </label>
   <input name="prenom" type="text" value="<?php echo  CFunctions::clean($prenom)?>" />
 </p>
 <p>
   <label>Soci&eacute;t&eacute;</label>
   <input name="societe" type="text" value="<?php echo $societe?>" />
 </p>
 <p>
   <label>Adresse</label>
   <input name="adresse" type="text" value="<?php echo  $adresse?>" />
 </p>
 <p>
   <label>Code postal</label>
   <input name="cp" type="text" value="<?php echo  $cp?>" />
 </p>
 <p>
   <label>Ville </label>
예제 #19
0
<?php

/**
 * $Id$
 *  
 * @category ihe
 * @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::checkAdmin();
$function = new CFunctions();
$functions = $function->loadList();
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("functions", $functions);
$smarty->display("configure.tpl");
예제 #20
0
     $unfound["user"][$mediuser->_user_last_name] = true;
 }
 // Profil
 if ($profil_name = $results[$i]["profil_name"]) {
     $profil = new CUser();
     $profil->user_username = $profil_name;
     $profil->loadMatchingObject();
     if ($profil->_id) {
         $mediuser->_profile_id = $profil->_id;
     } else {
         $unfound["profil_name"][$profil_name] = true;
     }
 }
 $group_id = CGroups::loadCurrent()->_id;
 // Fonction
 $function = new CFunctions();
 $function->group_id = $group_id;
 $function->text = $results[$i]["function_name"];
 $function->loadMatchingObject();
 if (!$function->_id) {
     if (in_array($results[$i]["type"], array("3", "4", "13"))) {
         $function->type = "cabinet";
     } else {
         $function->type = "administratif";
     }
     $function->color = "ffffff";
     $function->compta_partagee = 0;
     $function->consults_partagees = 1;
     $function->unescapeValues();
     $msg = $function->store();
     if ($msg) {
예제 #21
0
/*--------------------------------------------------------------------
		INITIALISATIONS
----------------------------------------------------------------------*/					
//$a 		= 0;
$fic 	= '';

/*---------------------------------------------------------------------
		VARIABLES HTTP
----------------------------------------------------------------------*/
$a          = CFunctions::getUserParam('a', 0) ;
$nom_grp    = CFunctions::getUserParam('nom_grp', '') ;
$id			= CFunctions::getUserParam('id', 0) ;
$etat		= CFunctions::getUserParam('etat', 0) ;
$fic		= CFunctions::getUserParam('fic', array()) ;
$tab_fic	= CFunctions::getUserParam('tab_fic',array());
$igp		= CFunctions::getUserParam('igp', 0);

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
switch ($a) 
{

	case 0 : // Afficher
		break;
		
	case 2 :
			if(!empty($_GET['id'])) $id = $_GET['id'];
			$gpml = new CTableGrpMl(array('id'=>$id));
			$gpml ->reverse_etat();
		break;
예제 #22
0
			  $zResSQLUser = mysql_query($zSqlInfoUser);
			  $zResUsers = mysql_fetch_assoc($zResSQLUser);

				$civilite = CFunctions::clean($zResUsers["civilite"]);
				$nom = CFunctions::clean($zResUsers["nom"]);
				$prenom = CFunctions::clean($zResUsers["prenom"]);
				$adresse = CFunctions::clean($zResUsers["adresse"]);
				$cp = CFunctions::clean($zResUsers["cp"]);
				$ville = CFunctions::clean($zResUsers["ville"]);
				$pays = CFunctions::clean($zResUsers["pays"]);
				$email = CFunctions::clean($zResUsers["email"]);
				$telephone = trim($zResUsers["telephone"]);
				$mobile = trim($zResUsers["mobile"]);
				$societe = CFunctions::clean($zResUsers["societe"]);
				$web = CFunctions::clean($zResUsers["web"]);
				$commentaire = CFunctions::clean($zResUsers["commentaire"]);

		  //-- Enregistrement des données de la table user dans la table gr_user pour le contact d'id donné
		    $zQuery = "INSERT INTO gr_user (user_id, civilite, nom, prenom, adresse, cp, ville, pays, email, telephone, mobile, societe, web, commentaire) VALUES (
		    	'" . $zUser . "',
		    	'" . $civilite . "',
		    	'" . str_replace ("'", "''", $nom) . "',
		    	'" . str_replace ("'", "''", $prenom) . "',
		    	'" . str_replace ("'", "''", $adresse) . "',
		    	'" . $cp . "',
		    	'" . str_replace ("'", "''", $ville) . "',
		    	'" . str_replace ("'", "''", $pays) . "',
		    	'" . $email . "',
		    	'" . $telephone . "',
		    	'" . $mobile . "',
		    	'" . str_replace ("'", "''", $societe) . "',
예제 #23
0
 /**
  * Charge la liste de plages et opérations pour un jour donné
  * Analogue à CMediusers::loadRefsForDay
  *
  * @param string $date Date to look for
  * @param bool   $second_chir Use chir_2, chir_3 and chir_4
  *
  * @return void
  */
 function loadRefsForDay($date, $second_chir = false)
 {
     // Liste des utilisateurs
     $user = new CMediusers();
     $listPrats = $user->loadPraticiens(PERM_READ);
     // Liste des fonctions
     $function = new CFunctions();
     $listFunctions = $function->loadListWithPerms(PERM_READ);
     // Plages d'opérations
     $plage = new CPlageOp();
     $conf_chambre_operation = $plage->conf("chambre_operation");
     $ljoin = array();
     $add_where = "";
     $add_or_where = "";
     if ($second_chir) {
         $ljoin["operations"] = "plagesop.plageop_id = operations.plageop_id";
         $prepare_prats = CSQLDataSource::prepareIn(array_keys($listPrats));
         $add_where = "operations.chir_id " . $prepare_prats . " OR operations.chir_2_id " . $prepare_prats . " OR operations.chir_3_id " . $prepare_prats . " OR operations.chir_4_id " . $prepare_prats;
         $add_or_where = " OR {$add_where}";
     }
     $where = array();
     $where["plagesop.date"] = "= '{$date}'";
     $where["plagesop.salle_id"] = "= '{$this->_id}'";
     $where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where;
     $order = "debut";
     $this->_ref_plages = $plage->loadList($where, $order, null, "plageop_id", $ljoin);
     // Chargement d'optimisation
     CMbObject::massLoadFwdRef($this->_ref_plages, "chir_id");
     CMbObject::massLoadFwdRef($this->_ref_plages, "anesth_id");
     CMbObject::massLoadFwdRef($this->_ref_plages, "spec_id");
     CMbObject::massLoadFwdRef($this->_ref_plages, "salle_id");
     CMbObject::massCountBackRefs($this->_ref_plages, "notes");
     CMbObject::massCountBackRefs($this->_ref_plages, "affectations_personnel");
     foreach ($this->_ref_plages as $_plage) {
         /** @var CPlageOp $_plage */
         $_plage->loadRefChir();
         $_plage->loadRefAnesth();
         $_plage->loadRefSpec();
         $_plage->loadRefSalle();
         $_plage->makeView();
         $_plage->loadRefsOperations();
         $_plage->loadRefsNotes();
         $_plage->loadAffectationsPersonnel();
         $_plage->_unordered_operations = array();
         // Chargement d'optimisation
         CMbObject::massLoadFwdRef($_plage->_ref_operations, "chir_id");
         $sejours = CMbObject::massLoadFwdRef($_plage->_ref_operations, "sejour_id");
         CMbObject::massLoadFwdRef($sejours, "patient_id");
         foreach ($_plage->_ref_operations as $operation) {
             $operation->loadRefAnesth();
             $operation->loadRefChirs();
             $operation->loadRefPatient();
             $operation->loadExtCodesCCAM();
             $operation->loadRefPlageOp();
             if ($conf_chambre_operation) {
                 $operation->loadRefAffectation();
             }
             // Extraire les interventions non placées
             if ($operation->rank == 0) {
                 $_plage->_unordered_operations[$operation->_id] = $operation;
                 unset($_plage->_ref_operations[$operation->_id]);
             }
         }
     }
     // Interventions déplacés
     $deplacee = new COperation();
     $ljoin = array();
     $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
     $where = array();
     $where["operations.plageop_id"] = "IS NOT NULL";
     $where["plagesop.salle_id"] = "!= operations.salle_id";
     $where["plagesop.date"] = "= '{$date}'";
     $where["operations.salle_id"] = "= '{$this->_id}'";
     $where[] = "`plagesop`.`chir_id` " . CSQLDataSource::prepareIn(array_keys($listPrats)) . " OR `plagesop`.`spec_id` " . CSQLDataSource::prepareIn(array_keys($listFunctions)) . $add_or_where;
     $order = "operations.time_operation";
     $this->_ref_deplacees = $deplacee->loadList($where, $order, null, "operation_id", $ljoin);
     // Chargement d'optimisation
     CMbObject::massLoadFwdRef($this->_ref_deplacees, "chir_id");
     $sejours_deplacees = CMbObject::massLoadFwdRef($this->_ref_deplacees, "sejour_id");
     CMbObject::massLoadFwdRef($sejours_deplacees, "patient_id");
     foreach ($this->_ref_deplacees as $_deplacee) {
         /** @var COperation $_deplacee */
         $_deplacee->loadRefChirs();
         $_deplacee->loadRefPatient();
         $_deplacee->loadExtCodesCCAM();
         $_deplacee->loadRefPlageOp();
     }
     // Hors plage
     $urgence = new COperation();
     $ljoin = array();
     $ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
     $where = array();
     $where["operations.date"] = "= '{$date}'";
     $where["operations.plageop_id"] = "IS NULL";
     $where["operations.salle_id"] = "= '{$this->_id}'";
     if ($second_chir) {
         $where[] = $add_where;
     } else {
         $where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($listPrats));
     }
     $order = "time_operation, chir_id";
     $this->_ref_urgences = $urgence->loadList($where, $order, null, "operation_id");
     // Chargement d'optimisation
     CMbObject::massLoadFwdRef($this->_ref_urgences, "chir_id");
     $sejours_urgences = CMbObject::massLoadFwdRef($this->_ref_urgences, "sejour_id");
     CMbObject::massLoadFwdRef($sejours_urgences, "patient_id");
     foreach ($this->_ref_urgences as $_urgence) {
         /** @var COperation $_urgence */
         $_urgence->loadRefChirs();
         $_urgence->loadRefPatient();
         $_urgence->loadExtCodesCCAM();
         $_urgence->loadRefPlageOp();
         if ($conf_chambre_operation) {
             $_urgence->loadRefAffectation();
         }
     }
 }
        $operation->loadRefsActes();
    }
    // Chargement des affectation
    $_sejour->loadRefsAffectations();
    if ($maternite_active && $_sejour->grossesse_id) {
        $_sejour->_sejours_enfants_ids = CMbArray::pluck($_sejour->loadRefsNaissances(), "sejour_enfant_id");
    }
    // Chargement des modes de sortie
    $_sejour->loadRefEtablissementTransfert();
    $_sejour->loadRefServiceMutation();
    // Chargement des appels
    $_sejour->loadRefsAppel('sortie');
}
// Si la fonction selectionnée n'est pas dans la liste des fonction, on la rajoute
if ($filterFunction && !array_key_exists($filterFunction, $functions)) {
    $_function = new CFunctions();
    $_function->load($filterFunction);
    $functions[$filterFunction] = $_function;
}
$list_mode_sortie = array();
if (CAppUI::conf("dPplanningOp CSejour use_custom_mode_sortie")) {
    $mode_sortie = new CModeSortieSejour();
    $where = array("actif" => "= '1'");
    $list_mode_sortie = $mode_sortie->loadGroupList($where);
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("hier", $hier);
$smarty->assign("demain", $demain);
$smarty->assign("date_min", $date_min);
$smarty->assign("date_max", $date_max);
예제 #25
0
				<?php 
				}
				}
				endwhile; 
				}?>
       </select>

    </p>
  </div>
  <div class="floatleft">
    <p>
      <label>Cat&eacute;gorie</label>
      <select onchange="this.form.submit();" name="filtre_categorie" id="filtre_categorie" style="width:145px;">
        <option value="%%">Tout</option>
		<?php
		$filtre_commune_=CFunctions::remove($filtre_commune);
		$zSql  = " SELECT DISTINCT cat.* FROM cat INNER JOIN entreprise on  cat.id_cat = entreprise.categorie_ent  where id_cat <> 0 ".$filtre_groupe." AND commune_alias LIKE '" . $filtre_commune_ . "' AND secteur_cat LIKE '".$filtre_secteur."' ORDER BY nom_cat"; 
		$oRes_ = CBdd::select($zSql) ;
		while ($oCat = mysql_fetch_assoc($oRes_)): ?>
		<option value="<?php echo $oCat['id_cat'] ?>" <?php if ($filtre_categorie!='%%%') { 
																	if($filtre_categorie == $oCat['id_cat'])  echo "selected"; 
																	}?>><?php echo utf8_encode($oCat['nom_cat']) ?></option>
         <?php endwhile; ?>
       </select>	   

    </p>
  </div>  
  <div class="floatleft">
    <p>
      <label style="width:80px;">Abonnement</label>
      <select onchange="this.form.submit();" name="filtre_vignette" id="filtre_vignette" style="width:145px;">
예제 #26
0
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
global $date, $chir_id, $print;
$print = 1;
$function_id = CValue::get("function_id");
$date = CValue::get("date");
$start = CMbDT::date("this monday", $date);
if ($start > $date) {
    $start = CMbDT::date("last monday", $date);
}
$end = CMbDT::date("next sunday", $start);
$muser = new CMediusers();
$musers = $muser->loadProfessionnelDeSanteByPref(PERM_READ, $function_id);
$function = new CFunctions();
$function->load($function_id);
echo "<h1>" . $function->_view . " (" . CMbDT::format($start, CAppUI::conf('longdate')) . " - " . CMbDT::format($end, CAppUI::conf('longdate')) . ")</h1>";
$pconsult = new CPlageconsult();
$ds = $pconsult->getDS();
$where = array();
$where[] = "chir_id " . $ds->prepareIn(array_keys($musers)) . " OR remplacant_id " . $ds->prepareIn(array_keys($musers));
$where["date"] = " BETWEEN '{$start}' AND '{$end}' ";
/** @var CPlageconsult[] $pconsults */
$pconsults = $pconsult->loadList($where, "date", null, "chir_id");
$pconsults_by_date_and_prat = array();
if (!count($pconsults)) {
    echo "<div class='small-info'>Les praticiens de ce cabinet n'ont pas de plages de consultations sur cette période</div>";
    CApp::rip();
}
foreach ($pconsults as $_pc) {
예제 #27
0
$error_signe = array('nom'=>"", 'rang'=>"", 'etat'=>"");

/*---------------------------------------------------------------------
		VARIABLES HTTP
----------------------------------------------------------------------*/
if ( $_SERVER['REQUEST_METHOD'] == "GET" ) {	
	$a = @$_GET["a"];
	if(!empty($_GET['order'])) $order = $_GET['order'];
}
else if ( $_SERVER['REQUEST_METHOD'] == "POST" ) {	
	$a = @$_POST["a"];
	if(!empty($_POST['order'])) $order = $_POST['order'];
}
$pieId  = CFunctions::getUserParam('pieId', 0) ;
$texId  = CFunctions::getUserParam('texId', 0) ;

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
switch ($a) {

case 0 : // Afficher
	break;	
		
case 1 : // Diminuer rang
	if(!empty($_GET['id'])) $id = $_GET['id'];
	$cat = new CTableOpportunite(array('id'=>$id));
	$cat->down_rang();
	break;
예제 #28
0
$listFnc = array();
if ($function_id) {
    $listChir = CConsultation::loadPraticiens(PERM_EDIT, $function_id, null, true);
    foreach ($listChir as $_chir) {
        $_chir->loadRefFunction();
    }
} else {
    $listChir = CConsultation::loadPraticiens(PERM_EDIT);
}
// Liste des consultations a avancer si desistement
$ds = $plage->getDS();
$now = CMbDT::date();
// get desistements
$count_si_desistement = CConsultation::countDesistementsForDay($function_id ? array_keys($listChir) : array($chirSel), $now);
// Liste des praticiens
$fnc = new CFunctions();
$listFnc = $fnc->loadListWithPerms(PERM_READ, array("group_id" => " = '{$group->_id}' "), 'text');
$mediuser = new CMediusers();
foreach ($listFnc as $id => $_fnc) {
    $users = $mediuser->loadProfessionnelDeSanteByPref(PERM_READ, $_fnc->_id, null, true);
    if (!count($users)) {
        unset($listFnc[$id]);
    }
}
// if only one function and function_id
if (count($listFnc) == 1 && !$chirSel) {
    $function_id = reset($listFnc)->_id;
}
// Période
$today = CMbDT::date();
$debut = CValue::getOrSession("debut", $today);
예제 #29
0
        $plageop_id = 0;
        $plagesel = new CPlageOp();
    }
    $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
예제 #30
0
<!-- InstanceBeginEditable name="php" -->
<?php
/*---------------------------------------------------------------------
		PROTECTION : permet de proteger la page avec session
----------------------------------------------------------------------*/
CLogin::page_protect();


/*--------------------------------------------------------------------
		INITIALISATIONS
----------------------------------------------------------------------*/					
$a 			= CFunctions::getUserParam('a', 0) ;
$fic 		= '';
$tab_fic	= CFunctions::getUserParam('tab_fic', array()) ;
$igrp    	= CFunctions::getUserParam('igrp', '') ;
$order      = CFunctions::getUserParam('order', 'mlt_iListId') ;

$msginfo 	= 	"";

/*--------------------------------------------------------------------
		TRAITEMENTS
----------------------------------------------------------------------*/
switch ($a) {

case 0 : // Afficher
	break;
	
case 3 : // Suppr
		if(!empty($_GET['fic'])) $fic = $_GET['fic'];
	break;