本文整理汇总了PHP中CModule::getCanDo方法的典型用法代码示例。如果您正苦于以下问题:PHP CModule::getCanDo方法的具体用法?PHP CModule::getCanDo怎么用?PHP CModule::getCanDo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CModule
的用法示例。
在下文中一共展示了CModule::getCanDo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<?php
/**
* $Id$
*
* @package Mediboard
* @subpackage Patients
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision$
*/
// Droit sur les consultations
$canCabinet = CModule::getCanDo("dPcabinet");
// Droit sur les interventions et séjours
$canPlanningOp = CModule::getCanDo("dPplanningOp");
$user = CUser::get();
// Récupération des critères de recherche
$antecedent_patient = CValue::getOrSession("antecedent_patient");
$traitement_patient = CValue::getOrSession("traitement_patient");
$diagnostic_patient = CValue::getOrSession("diagnostic_patient");
$motif_consult = CValue::getOrSession("motif_consult");
$remarque_consult = CValue::getOrSession("remarque_consult");
$examen_consult = CValue::getOrSession("examen_consult");
$traitement_consult = CValue::getOrSession("traitement_consult");
$conclusion_consult = CValue::getOrSession("conclusion_consult");
$type = CValue::getOrSession("type");
$convalescence_sejour = CValue::getOrSession("convalescence_sejour");
$remarque_sejour = CValue::getOrSession("remarque_sejour");
$materiel_intervention = CValue::getOrSession("materiel_intervention");
$examen_per_op = CValue::getOrSession("examen_per_op");
$examen_intervention = CValue::getOrSession("examen_intervention");
示例2: canClass
/**
* Load class level can do
*
* @return CCanDo
*/
function canClass()
{
$can = new CCanDo();
// Defined at class level in permissions object for user
global $userPermsObjects;
if (isset($userPermsObjects[$this->_class][0])) {
$perm = $userPermsObjects[$this->_class][0];
$can->read = $perm->permission >= PERM_READ;
$can->edit = $perm->permission >= PERM_EDIT;
return $can;
}
// Otherwise fall back on module definition
$can_module = CModule::getCanDo(CModelObject::$module_name[$this->_class]);
$can->read = $can_module->read;
$can->edit = $can_module->admin || $can_module->edit;
return $can;
}
示例3: getPerm
/**
* 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;
}
示例4: intval
<?php
/* $Id: view_identifiants.php 28748 2015-06-27 09:01:22Z lryo $ */
/**
* @package Mediboard
* @subpackage sante400
* @version $Revision: 28748 $
* @author SARL OpenXtrem
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
*/
CCanDo::checkRead();
$canSante400 = CModule::getCanDo("dPsante400");
$dialog = CValue::get("dialog");
$page = intval(CValue::get('page', 0));
// Chargement du filtre
$filter = new CIdSante400();
$filter->object_id = CValue::get("object_id");
$filter->object_class = CValue::get("object_class");
$filter->tag = CValue::get("tag");
$filter->id400 = CValue::get("id400");
$filter->nullifyEmptyFields();
// Récupération de la liste des classes disponibles
if ($filter->object_class && $filter->object_id) {
$listClasses = array($filter->object_class);
} else {
$listClasses = CApp::getInstalledClasses();
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("page", $page);
$smarty->assign("filter", $filter);
示例5: COperation
/**
* $Id: export_actes_pmsi.php 28465 2015-06-02 08:54:31Z lryo $
*
* @package Mediboard
* @subpackage PMSI
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version $Revision: 28465 $
*/
global $m, $tab;
$module = CValue::get("module");
if (!$module) {
$module = $m;
}
$canUnlockActes = $module == "dPpmsi" || CModule::getCanDo("dPsalleOp")->admin;
if (null == ($object_class = CValue::get("object_class"))) {
CAppUI::stepMessage(UI_MSG_WARNING, "{$tab}-msg-mode-missing");
return;
}
$unlock_dossier = CValue::get("unlock_dossier", 0);
$NDA = "";
$IPP = "";
switch ($object_class) {
case "COperation":
$object = new COperation();
// Chargement de l'opération et génération du document
$operation_id = CValue::post("mb_operation_id", CValue::getOrSession("object_id"));
if ($object->load($operation_id)) {
$object->loadRefs();
$codes = explode("|", $object->codes_ccam);
示例6: str_pad
$op->loadRefChir3();
$op->loadRefChir4();
if (!$op->_id) {
$op->_time_op = $op->temp_operation = "00:00:00";
if ($hour_urgence && $min_urgence) {
$time = "{$hour_urgence}:{$min_urgence}:00";
} else {
$time = str_pad($hours_urgence["deb"], 2, "0", STR_PAD_LEFT) . ":00:00";
}
$op->_time_urgence = $op->time_operation = $time;
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejours_collision", $patient->getSejoursCollisions());
$smarty->assign("isPrescriptionInstalled", CModule::getActive("dPprescription"));
$smarty->assign("canSante400", CModule::getCanDo("dPsante400"));
$smarty->assign("urgInstalled", CModule::getInstalled("dPurgences"));
$smarty->assign("heure_sortie_ambu", $heure_sortie_ambu);
$smarty->assign("heure_sortie_autre", $heure_sortie_autre);
$smarty->assign("heure_entree_veille", $heure_entree_veille);
$smarty->assign("heure_entree_jour", $heure_entree_jour);
$smarty->assign("op", $op);
$smarty->assign("plage", $op->plageop_id ? $op->_ref_plageop : new CPlageOp());
$smarty->assign("sejour", $sejour);
$smarty->assign("chir", $chir);
$smarty->assign("praticien", $prat);
$smarty->assign("patient", $patient);
$smarty->assign("sejours", $sejours);
$smarty->assign("ufs", CUniteFonctionnelle::getUFs());
$smarty->assign("_functions", $_functions);
$smarty->assign("modurgence", 1);
示例7: getPerm
/**
* @see parent::getPerm()
*/
function getPerm($permType)
{
$basePerm = CModule::getCanDo('soins')->edit || CModule::getCanDo('dPurgences')->edit || CModule::getCanDo('dPcabinet')->edit || CModule::getCanDo('dPbloc')->edit || CModule::getCanDo('dPplanningOp')->edit;
return $basePerm && parent::getPerm($permType);
}
示例8: foreach
CSejour::massCountPrestationSouhaitees(array($sejour));
foreach ($operations as $operation) {
$operation->loadRefsActes();
$dossier_anesth = $operation->loadRefsConsultAnesth();
$consultation = $dossier_anesth->loadRefConsultation();
$consultation->loadRefPlageConsult();
$dossier_anesth->_date_consult = $consultation->_date;
}
if (CAppUI::conf("dPadmissions show_deficience")) {
CDossierMedical::massCountAntecedentsByType(array($dossier_medical), "deficience");
}
$list_mode_entree = array();
if (CAppUI::conf("dPplanningOp CSejour use_custom_mode_entree")) {
$mode_entree = new CModeEntreeSejour();
$where = array("actif" => "= '1'");
$list_mode_entree = $mode_entree->loadGroupList($where);
}
$smarty = new CSmartyDP();
$smarty->assign("_sejour", $sejour);
$smarty->assign("date_min", $date_min);
$smarty->assign("date_max", $date_max);
$smarty->assign("date_actuelle", $date_actuelle);
$smarty->assign("date_demain", $date_demain);
$smarty->assign("list_mode_entree", $list_mode_entree);
$smarty->assign("prestations", CPrestation::loadCurrentList());
$smarty->assign("canAdmissions", CModule::getCanDo("dPadmissions"));
$smarty->assign("canPatients", CModule::getCanDo("dPpatients"));
$smarty->assign("canPlanningOp", CModule::getCanDo("dPplanningOp"));
$smarty->assign("single_line", true);
// Indique qu'on charge la ligne seulement (pour les evenements de formulaire)
$smarty->display("inc_vw_admission_line.tpl");
示例9: foreach
$_lines = $line->loadMatchingList("debut ASC");
foreach ($_lines as $_line) {
$lines[$_line->_ref_element_prescription->category_prescription_id][$_line->element_prescription_id][] = $_line;
}
}
// Chargement des categories de prescription
$categories = array();
$category = new CCategoryPrescription();
$where[] = "chapitre = 'kine'";
$group_id = CGroups::loadCurrent()->_id;
$where[] = "group_id = '{$group_id}' OR group_id IS NULL";
$order = "nom";
$categories = $category->loadList($where, $order);
// Dossier médical visibile ?
$user = CMediusers::get();
$can_view_dossier_medical = CModule::getCanDo('dPcabinet')->edit || CModule::getCanDo('dPbloc')->edit || CModule::getCanDo('dPplanningOp')->edit || $user->isFromType(array("Infirmière"));
$can_edit_prescription = $user->isPraticien() || $user->isAdmin();
// Suppression des categories vides
if (!$can_edit_prescription) {
foreach ($categories as $_cat_id => $_category) {
if (!array_key_exists($_cat_id, $lines)) {
unset($categories[$_cat_id]);
}
}
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("sejour", $sejour);
$smarty->assign("bilan", $bilan);
$smarty->assign("categories", $categories);
$smarty->assign("prescription", $prescription);
示例10: CSejour
*
* @category dPadmissions
* @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
*/
$sejour_id = CValue::get("sejour_id");
$module = CValue::get("module");
$callback = CValue::get("callback");
$modify_sortie_prevue = CValue::get("modify_sortie_prevue", true);
$sejour = new CSejour();
$sejour->load($sejour_id);
$can_admission = CModule::getCanDo("dPadmissions");
if (!$sejour->canDo()->edit && !$can_admission->edit && !CModule::getCanDo("dPhospi")->edit && !CModule::getCanDo("dPurgences")->edit && !CModule::getCanDo("soins")->edit) {
$can_admission->redirect();
}
$sejour->loadRefServiceMutation();
$sejour->loadRefEtablissementTransfert();
//Cas des urgences
if (CModule::getActive("dPurgences")) {
$sejour->loadRefRPU()->loadRefSejourMutation();
}
$patient = $sejour->loadRefPatient();
if (CModule::getActive("maternite") && $sejour->grossesse_id) {
$sejour->loadRefsNaissances();
foreach ($sejour->_ref_naissances as $_naissance) {
/** @var CNaissance $_naissance */
$_naissance->loadRefSejourEnfant()->loadRefPatient();
}
示例11: foreach
// Dans le cadre où le dossier pmsi est celui de la maman
if ($sejour->grossesse_id) {
$sejour->canDo();
$sejour->loadRefUFHebergement();
$sejour->loadRefUFMedicale();
$sejour->loadRefUFSoins();
$sejour->loadRefService();
$sejour->loadRefsNotes();
$sejour->loadRefGrossesse();
$sejour->_ref_grossesse->canDo();
$grossesse = $sejour->_ref_grossesse;
$grossesse->loadLastAllaitement();
$grossesse->loadFwdRef("group_id");
foreach ($grossesse->loadRefsNaissances() as $_naissance) {
$_naissance->loadRefSejourEnfant();
$_naissance->_ref_sejour_enfant->loadRelPatient();
}
}
} else {
$sejour = new CSejour();
}
// Création du template
$smarty = new CSmartyDP("modules/dPpmsi");
$smarty->assign("canPatients", CModule::getCanDo("dPpatients"));
$smarty->assign("hprim21installed", CModule::getActive("hprim21"));
$smarty->assign("isImedsInstalled", CModule::getActive("dPImeds") && CImeds::getTagCIDC($group));
$smarty->assign("patient", $patient);
$smarty->assign("sejour", $sejour);
$smarty->assign("sejour_maman", $sejour_maman);
$smarty->assign("naissance", $naissance_enf);
$smarty->display("inc_vw_dossier_sejour.tpl");
示例12: CTransmissionMedicale
<?php
/**
* $Id$
*
* @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$
*/
CModule::getCanDo("soins")->needsEdit();
$transmission_id = CValue::get("transmission_id");
$data_id = CValue::get("data_id");
$action_id = CValue::get("action_id");
$result_id = CValue::get("result_id");
$sejour_id = CValue::get("sejour_id");
$object_id = CValue::get("object_id");
$object_class = CValue::get("object_class");
$libelle_ATC = CValue::get("libelle_ATC");
$refreshTrans = CValue::get("refreshTrans", 0);
$update_plan_soin = CValue::get("update_plan_soin", 0);
$user_id = CUser::get()->_id;
$transmission = new CTransmissionMedicale();
if ($transmission_id) {
$transmission->load($transmission_id);
} else {
if ($data_id || $action_id || $result_id) {
$transmission->sejour_id = $sejour_id;
// Multi-transmissions
if ($data_id) {
示例13: store
/**
* @see parent::store()
*/
function store()
{
$this->completeField("entree_reelle", "entree", "patient_id", "type_pec", "grossesse_id", "mode_sortie");
/** @var CSejour $old */
$old = $this->loadOldObject();
// Vérification de la validité des codes CIM
if ($this->DP != null) {
$dp = CCodeCIM10::get($this->DP);
if (!$dp->exist) {
CAppUI::setMsg("Le code CIM saisi n'est pas valide", UI_MSG_WARNING);
$this->DP = "";
}
}
if ($this->DR != null) {
$dr = CCodeCIM10::get($this->DR);
if (!$dr->exist) {
CAppUI::setMsg("Le code CIM saisi n'est pas valide", UI_MSG_WARNING);
$this->DR = "";
}
}
// Mode de sortie normal par défaut si l'autorisation de sortie est réalisée
if ($this->conf("specified_output_mode") && !$this->mode_sortie && $this->fieldModified("confirme")) {
$this->mode_sortie = "normal";
}
// Annulation de l'établissement de transfert si le mode de sortie n'est pas transfert
if (null !== $this->mode_sortie) {
if ("transfert" != $this->mode_sortie) {
$this->etablissement_sortie_id = "";
}
if ("mutation" != $this->mode_sortie) {
$this->service_sortie_id = "";
}
}
// Mise à jour du type PEC si vide
if (!$this->_id && !$this->type_pec) {
$this->type_pec = $this->grossesse_id ? "O" : "M";
}
// Annulation de la sortie réelle si on annule le mode de sortie
if ($this->mode_sortie === "") {
$this->sortie_reelle = "";
}
// Annulation de l'établissement de provenance si le mode d'entrée n'est pas transfert
if ($this->fieldModified("mode_entree")) {
if ("7" != $this->mode_entree) {
$this->etablissement_entree_id = "";
}
if ("6" != $this->mode_entree) {
$this->service_entree_id = "";
}
}
// Passage au mode transfert si on value un établissement de provenance
if ($this->fieldModified("etablissement_entree_id")) {
if ($this->etablissement_entree_id != null) {
$this->mode_entree = 7;
}
}
// Passage au mode mutation si on value un service de provenance
if ($this->fieldModified("service_entree_id")) {
if ($this->service_entree_id != null) {
$this->mode_entree = 6;
}
}
$patient_modified = $this->fieldModified("patient_id");
// Si le patient est modifié et qu'il y a des consultations, on cascade les consultations
if (!$this->_forwardRefMerging && $this->sejour_id && $patient_modified) {
/** @var CConsultation[] $consultations */
$consultations = $this->loadBackRefs("consultations");
foreach ($consultations as $_consult) {
$_consult->_sync_consults_from_sejour = true;
$_consult->patient_id = $this->patient_id;
if ($msg = $_consult->store()) {
return $msg;
}
}
}
// Pour un séjour non annulé, mise à jour de la date de décès du patient
// suivant le mode de sortie
if (!$this->annule) {
$patient = new CPatient();
$patient->load($this->patient_id);
if ($this->fieldModified("mode_sortie")) {
if ("deces" == $this->mode_sortie) {
$patient->deces = $this->_date_deces;
} else {
if ($this->_old->mode_sortie == "deces") {
$patient->deces = "";
}
}
}
// On verifie que le champ a été modifié pour faire le store (sinon probleme lors de la fusion de patients)
if ($patient->fieldModified("deces")) {
// Ne pas faire de return $msg ici, car ce n'est pas "bloquant"
$patient->store();
}
}
// Si annulation possible que par le chef de bloc
if (CAppUI::conf("dPplanningOp COperation cancel_only_for_resp_bloc") && $this->fieldModified("annule", 1) && $this->entree_reelle && !CModule::getCanDo("dPbloc")->edit) {
//.........这里部分代码省略.........
示例14: unset
<?php
/**
* Mediuser
*
* @category Mediusers
* @package Mediboard
* @author SARL OpenXtrem <dev@openxtrem.com>
* @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version SVN: $Id: do_mediusers_aed.php 19463 2013-06-07 10:36:29Z lryo $
* @link http://www.mediboard.org
*/
// we don't allow anybody to change his user type or profile
if ($_POST["user_id"] && !CAppUI::$user->isAdmin() && !CModule::getCanDo("admin")->admin) {
unset($_POST['_user_type']);
unset($_POST['_profile_id']);
}
/**
* Class CDoMediuserAddEdit
*/
class CDoMediuserAddEdit extends CDoObjectAddEdit
{
/**
* Construct
*
* @return void
*/
function CDoMediuserAddEdit()
{
$this->CDoObjectAddEdit("CMediusers", "user_id");
}
示例15: checkCoded
/**
* @see parent::checkCoded()
*/
function checkCoded()
{
if (CAppUI::conf('dPccam CCodeCCAM use_new_association_rules')) {
$this->loadRefCodageCCAM();
if ($this->_ref_codage_ccam->_id && $this->_ref_codage_ccam->locked && !CModule::getCanDo('dPpmsi')->edit) {
return "Codage CCAM verrouillé, impossible de modifier l'acte";
}
}
return parent::checkCoded();
}