当前位置: 首页>>代码示例>>PHP>>正文


PHP CFunctions::loadListWithPerms方法代码示例

本文整理汇总了PHP中CFunctions::loadListWithPerms方法的典型用法代码示例。如果您正苦于以下问题:PHP CFunctions::loadListWithPerms方法的具体用法?PHP CFunctions::loadListWithPerms怎么用?PHP CFunctions::loadListWithPerms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CFunctions的用法示例。


在下文中一共展示了CFunctions::loadListWithPerms方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: loadRefsForDay

 /**
  * 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";
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:CSalle.class.php

示例2: CFunctions

<?php

/**
 * $Id: vw_edit_packs.php 19285 2013-05-26 13:10:13Z phenxdesign $
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @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();
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_edit_packs.php

示例3: CFunctions

 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @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);
    $object->loadRefFunction();
    $object->loadRefProfile();
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_edit_mediuser.php

示例4: foreach

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);
$debut = CMbDT::date("last sunday", $debut);
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_planning_new.php

示例5: CMediusers

$user = CMediusers::get();
$praticien = new CMediusers();
$praticien->load($filter->_prat_id);
// dans le cas d'un anesthesiste, vider le prat_id si l'anesthesiste veut voir tous
// les plannings sinon laisser son prat_id pour afficher son planning perso
if ($praticien->isFromType(array("Anesthésiste")) && !$filter->_planning_perso) {
    $filter->_prat_id = null;
}
// Filtre sur les praticiens ou les spécialités
$function = new CFunctions();
$functions = array();
$praticiens = array();
// Aucun filtre de séléctionné : tous les éléments auxquels on a le droit
if (!$filter->_specialite && !$filter->_prat_id) {
    if (!$user->isFromType(array("Anesthésiste")) && !$praticien->isFromType(array("Anesthésiste"))) {
        $functions = $function->loadListWithPerms(PERM_READ);
        $praticiens = $user->loadPraticiens();
    } else {
        $functions = $function->loadList();
        $praticiens = $praticien->loadList();
    }
} elseif ($filter->_specialite) {
    // Filtre sur la specialité : la spec et ses chirs primaires et secondaires
    $function->load($filter->_specialite);
    $function->loadBackRefs("users");
    $function->loadBackRefs("secondary_functions");
    $functions[$function->_id] = $function;
    $praticiens = $function->_back["users"];
    /** @var CSecondaryFunction $sec_func */
    foreach ($function->_back["secondary_functions"] as $sec_func) {
        if (!isset($praticiens[$sec_func->user_id])) {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:view_planning.php

示例6: CFunctions

<?php

/**
 * $Id$
 *  
 * @category Cabinet
 * @package  Mediboard
 * @author   SARL OpenXtrem <dev@openxtrem.com>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CCanDo::checkRead();
$group = CGroups::loadCurrent();
$today = CMbDT::date();
$date = CValue::getOrSession("date", $today);
$function_id = CValue::getOrSession("function_id");
$function = new CFunctions();
$functions = $function->loadListWithPerms(PERM_READ, array("group_id" => " = '{$group->_id}' "), "text");
// smarty
$smarty = new CSmartyDP();
$smarty->assign("date", $date);
$smarty->assign("function_id", $function_id);
$smarty->assign("functions", $functions);
$smarty->display("vw_journee_new.tpl");
开发者ID:fbone,项目名称:mediboard4,代码行数:25,代码来源:vw_journee_new.php

示例7: CPrinter

 *
 * @package    Mediboard
 * @subpackage Hospi
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
$printer_id = CValue::getOrSession("printer_id", 0);
$printer = new CPrinter();
$printer->load($printer_id);
if ($printer->_id) {
    $printer->loadTargetObject();
}
$source = new CSourceLPR();
$sources = $source->loadlist();
if (!$sources) {
    $sources = array();
}
$source = new CSourceSMB();
$sources_smb = $source->loadlist();
if ($sources_smb) {
    $sources = array_merge($sources, $sources_smb);
}
$function = new CFunctions();
$order_by = "text";
$functions = $function->loadListWithPerms(PERM_READ, null, $order_by);
$smarty = new CSmartyDP();
$smarty->assign("printer", $printer);
$smarty->assign("sources", $sources);
$smarty->assign("functions", $functions);
$smarty->display("inc_edit_printer.tpl");
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_edit_printer.php


注:本文中的CFunctions::loadListWithPerms方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。