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


PHP CCanDo::edit方法代码示例

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


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

示例1: CUser

<?php

/**
 * $Id: vw_functional_perms.php 24154 2014-07-24 14:17:58Z kgrisel $
 *
 * @package    Mediboard
 * @subpackage admin
 * @version    $Revision: 24154 $
 * @author     SARL OpenXtrem
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 */
CCanDo::checkEdit();
$user_id = CCanDo::edit() ? CValue::getOrSession("user_id", "default") : null;
$user = CUser::get($user_id);
$prof = $user->profile_id ? CUser::get($user->profile_id) : new CUser();
if ($user_id == "default") {
    $user->_id = null;
}
$prefvalues = array("default" => CPreferences::get(null, true), "template" => $user->profile_id ? CPreferences::get($user->profile_id, true) : array(), "user" => $user->_id !== "" ? CPreferences::get($user->_id, true) : array());
// common sera toujours au debut
$prefs = array("common" => array());
// Classement par module et par permission fonctionnelle
CPreferences::loadModules(true);
foreach (CPreferences::$modules as $modname => $prefnames) {
    $module = CModule::getActive($modname);
    $canRead = $module ? CPermModule::getPermModule($module->_id, PERM_READ, $user_id) : false;
    if ($modname == "common" || $user_id == "default" || $canRead) {
        $prefs[$modname] = array();
        foreach ($prefnames as $prefname) {
            $prefs[$modname][$prefname] = array("default" => CMbArray::extract($prefvalues["default"], $prefname), "template" => CMbArray::extract($prefvalues["template"], $prefname), "user" => CMbArray::extract($prefvalues["user"], $prefname));
        }
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_functional_perms.php

示例2: array

CValue::setSession("elem_concerne", $elem_concerne);
CValue::setSession("evenements", $evenements);
CValue::setSession("filter_item", $filter_item);
$selected_fiche_id = CValue::getOrSession("selected_fiche_id");
$where = array();
if ($elem_concerne) {
    $where["fiches_ei.elem_concerne"] = "= '{$elem_concerne}'";
}
if ($selected_user_id) {
    $where["fiches_ei.user_id"] = "= '{$selected_user_id}'";
}
if ($selected_service_valid_user_id) {
    $where["fiches_ei.service_valid_user_id"] = "= '{$selected_service_valid_user_id}'";
}
$user_id = null;
if ($type == "AUTHOR" || CCanDo::edit() && !CCanDo::admin()) {
    $user_id = $user->_id;
}
if ($evenements) {
    $listeFiches = CFicheEi::loadFichesEtat($type, $user_id, $where, 0, false, null, true);
    $item = new CEiItem();
    $item->ei_categorie_id = $evenements;
    $listTypes = array_keys($item->loadMatchingList());
    foreach ($listeFiches as $id => $fiche) {
        if (count(array_intersect($fiche->_ref_evenement, $listTypes)) == 0) {
            unset($listeFiches[$id]);
        }
        if ($filter_item != "" && strrpos($fiche->evenements, $filter_item) === false) {
            unset($listeFiches[$id]);
        }
    }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:httpreq_vw_allEi.php

示例3: CBloodSalvage

<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage bloodSalvage
 * @author     SARL OpenXtrem <dev@openxtrem.com>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CCanDo::checkRead();
$blood_salvage_id = CValue::getOrSession("blood_salvage_id");
$date = CValue::getOrSession("date", CMbDT::date());
$modif_operation = CCanDo::edit() || $date >= CMbDT::date();
$timing = CValue::getOrSession("timing");
$blood_salvage = new CBloodSalvage();
if ($blood_salvage_id) {
    $blood_salvage->load($blood_salvage_id);
    $timing["_recuperation_start"] = array();
    $max_add_minutes = CAppUI::conf("dPsalleOp max_add_minutes");
    foreach ($timing as $key => $value) {
        for ($i = -CAppUI::conf("dPsalleOp max_sub_minutes"); $i < $max_add_minutes && $blood_salvage->{$key} !== null; $i++) {
            $timing[$key][] = CMbDT::time("{$i} minutes", $blood_salvage->{$key});
        }
    }
}
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("blood_salvage", $blood_salvage);
$smarty->assign("date", $date);
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:httpreq_vw_recuperation_start_timing.php

示例4: foreach

            $planning->addEvent($event);
        }
    }
}
// Ajout des événements (commentaires), OK
foreach ($commentaires_by_salle as $salle_id => $_commentaires) {
    $i = array_search($salle_id, $salles_ids);
    foreach ($_commentaires as $_commentaire) {
        $debut = "{$i} " . CMbDT::time($_commentaire->debut);
        $duree = CMbDT::minutesRelative(CMbDT::time($_commentaire->debut), CMbDT::time($_commentaire->fin));
        $com_comm = CMbString::htmlEntities($_commentaire->commentaire);
        $com_libelle = CMbString::htmlEntities($_commentaire->libelle);
        $libelle = "<span\n    style=\"display: none;\"\n    data-entree_prevue=\"{$_commentaire->debut}\"\n    data-sortie_prevue=\"{$_commentaire->fin}\"\n    data-libelle=\"{$com_libelle}\"\n    data-commentaire=\"{$com_comm}\"\n    data-duree=\"{$duree}\"\n    data-color=\"{$_commentaire->color}\"></span>" . "<span style=\"font-size: 11px; font-weight: bold;\">" . $com_libelle . "</span>" . "\n<span class=\"compact\">" . $com_comm . "</span>";
        $event = new CPlanningEvent($_commentaire->_guid, $debut, $duree, $libelle, "#{$_commentaire->color}", true, null, $_commentaire->_guid, false);
        $event->type = "commentaire_planning";
        $event->draggable = $event->resizable = CCanDo::edit();
        $event->plage["id"] = $_commentaire->_id;
        if ($can_edit) {
            $event->addMenuItem("edit", "Modifier ce commentaire");
            $event->addMenuItem("copy", "Copier ce commentaire");
            $event->addMenuItem("cancel", "Supprimer ce commentaire");
        }
        $planning->addEvent($event);
    }
}
// Ajout des plages, OK
foreach ($plages_by_salle as $salle_id => $_plages) {
    $i = array_search($salle_id, $salles_ids);
    CMbObject::massLoadRefsNotes($_plages);
    CMbObject::massLoadFwdRef($_plages, "chir_id");
    CMbObject::massLoadFwdRef($_plages, "anesth_id");
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_vw_planning.php

示例5: array_merge

    if (!$listPlage->countList($where)) {
        $nbDays--;
    }
}
$bank_holidays = array_merge(CMbDate::getHolidays($debut), CMbDate::getHolidays($fin));
// Planning Week
$planning = new CPlanningWeek($debut, $debut, $fin, $nbDays, false, "auto");
$user = new CMediusers();
$user->load($chirSel);
if ($user->_id) {
    $user->loadRefFunction();
    $planning->title = CMbString::htmlEntities($user->_view);
} else {
    $planning->title = "";
}
$can_edit = CCanDo::edit();
$planning->guid = $user->_guid;
$planning->hour_min = "07";
$planning->hour_max = "20";
$planning->pauses = array("07", "12", "19");
$planning->dragndrop = $planning->resizable = $can_edit ? 1 : 0;
$planning->hour_divider = 60 / CAppUI::conf("dPcabinet CPlageconsult minutes_interval");
$planning->no_dates = 0;
$plage = new CPlageconsult();
$whereHP["plageop_id"] = " IS NULL";
$users = array();
$conges_day = array();
if ($user->_id) {
    $muser = new CMediusers();
    $users = $muser->loadUsers(PERM_READ, $user->function_id);
}
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:31,代码来源:ajax_vw_planning.php

示例6: array

 */
CCanDo::checkRead();
$user = CUser::get();
$fiche_ei_id = CValue::getOrSession("fiche_ei_id", null);
$ficheAnnuleVisible = CValue::getOrSession("ficheAnnuleVisible", 0);
$ficheTermineVisible = CValue::getOrSession("ficheTermineVisible", 0);
$selected_user_id = CValue::getOrSession("selected_user_id");
$selected_service_valid_user_id = CValue::getOrSession("selected_service_valid_user_id");
$elem_concerne = CValue::getOrSession("elem_concerne");
$evenements = CValue::getOrSession("evenements");
$filter_item = CValue::getOrSession("filter_item");
$catFiche = array();
$fiche = new CFicheEi();
$droitFiche = !$fiche->load($fiche_ei_id);
$droitFiche = $droitFiche || !CCanDo::edit() && $fiche->user_id != $user->_id;
$droitFiche = $droitFiche || CCanDo::edit() && !CCanDo::admin() && $fiche->user_id != $user->_id && $fiche->service_valid_user_id != $user->_id;
// Liste des Catégories d'EI
$categorie = new CEiCategorie();
/** @var CEiCategorie[] $listCategories */
$listCategories = $categorie->loadList(null, "nom");
if ($droitFiche) {
    // Cette fiche n'est pas valide
    $fiche_ei_id = null;
    CValue::setSession("fiche_ei_id");
    $fiche = new CFicheEi();
} else {
    $fiche->loadRefsFwd();
    $fiche->loadRefItems();
    foreach ($listCategories as $keyCat => $_categorie) {
        foreach ($fiche->_ref_items as $keyItem => $_item) {
            if ($_item->ei_categorie_id == $keyCat) {
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_incidentvalid.php

示例7: CDiscipline

 * $Id: vw_idx_pathologies.php 20186 2013-08-19 07:47:12Z phenxdesign $
 *
 * @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: 20186 $
 */
CAppUI::requireModuleFile("dPhospi", "inc_vw_affectations");
$affichage_patho = CValue::postOrSession("affichage_patho", "non_complet");
$date = CValue::getOrSession("date", CMbDT::date());
$pathos = new CDiscipline();
$heureLimit = "16:00:00";
// Liste des patients à placer
$groupSejourNonAffectes = array();
if (CCanDo::edit()) {
    // Admissions de la veille
    $dayBefore = CMbDT::date("-1 days", $date);
    $where = array("entree_prevue" => "BETWEEN '{$dayBefore} 00:00:00' AND '{$date} 00:00:00'", "type" => "!= 'exte'", "annule" => "= '0'");
    $groupSejourNonAffectes["veille"] = loadSejourNonAffectes($where);
    // Admissions du matin
    $where = array("entree_prevue" => "BETWEEN '{$date} 00:00:00' AND '{$date} " . CMbDT::time("-1 second", $heureLimit) . "'", "type" => "!= 'exte'", "annule" => "= '0'");
    $groupSejourNonAffectes["matin"] = loadSejourNonAffectes($where);
    // Admissions du soir
    $where = array("entree_prevue" => "BETWEEN '{$date} {$heureLimit}' AND '{$date} 23:59:59'", "type" => "!= 'exte'", "annule" => "= '0'");
    $groupSejourNonAffectes["soir"] = loadSejourNonAffectes($where);
    // Admissions antérieures
    $twoDaysBefore = CMbDT::date("-2 days", $date);
    $where = array("annule" => "= '0'", "'{$twoDaysBefore}' BETWEEN entree_prevue AND sortie_prevue");
    $groupSejourNonAffectes["avant"] = loadSejourNonAffectes($where);
}
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:vw_idx_pathologies.php


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