本文整理汇总了PHP中CStoredObject::filterByPerm方法的典型用法代码示例。如果您正苦于以下问题:PHP CStoredObject::filterByPerm方法的具体用法?PHP CStoredObject::filterByPerm怎么用?PHP CStoredObject::filterByPerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStoredObject
的用法示例。
在下文中一共展示了CStoredObject::filterByPerm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: COperation
*/
CCanDo::checkRead();
$praticien_id = CValue::getOrSession("praticien_id");
$function_id = CValue::getOrSession("function_id");
$filter = new COperation();
$filter->_date_min = CValue::getOrSession("_date_min", CMbDT::date("-7 day"));
$filter->_date_max = CValue::getOrSession("_date_max", CMbDT::date());
$blocs = CGroups::loadCurrent()->loadBlocs(PERM_READ, null, "nom");
$bloc_id = CValue::getOrSession("bloc_id", reset($blocs)->_id);
$bloc = new CBlocOperatoire();
$bloc->load($bloc_id);
// Récupération des opérations
$ljoin = array();
$ljoin["plagesop"] = "operations.plageop_id = plagesop.plageop_id";
$salles = $bloc->loadRefsSalles();
CStoredObject::filterByPerm($salles, PERM_READ);
$in_salles = CSQLDataSource::prepareIn(array_keys($salles));
$where = array();
$where[] = "plagesop.salle_id {$in_salles} OR operations.salle_id {$in_salles}";
$where["materiel"] = "!= ''";
$where["operations.date"] = "BETWEEN '{$filter->_date_min}' AND '{$filter->_date_max}'";
if ($praticien_id) {
$where["operations.chir_id"] = " = '{$praticien_id}'";
} elseif ($function_id) {
$mediuser = new CMediusers();
$users = $mediuser->loadProfessionnelDeSante(PERM_READ, $function_id);
$where["operations.chir_id"] = CSQLDataSource::prepareIn(array_keys($users));
}
$order = "operations.date, rank";
$operation = new COperation();
$ops = $operation->loadList($where, $order, null, null, $ljoin);
示例2: CBlocOperatoire
}
CValue::setSession("date_planning", $date_planning);
//alerts
$nbIntervHorsPlage = 0;
$nbIntervNonPlacees = 0;
$nbAlertesInterv = 0;
$debut = $fin = $date_planning;
$bloc = new CBlocOperatoire();
$where = array();
if ($bloc_id) {
$where["bloc_operatoire_id"] = " = '{$bloc_id}'";
}
$where["group_id"] = " = '{$group->_id}' ";
/** @var CBlocOperatoire[] $blocs */
$blocs = $bloc->loadList($where);
CStoredObject::filterByPerm($blocs, PERM_READ);
if (count($blocs) == 1) {
$current_bloc = reset($blocs);
}
// optimisation du chargement des salles (one shot) + alertes
$salle = new CSalle();
$ds = $salle->getDS();
$where = array();
$where["bloc_id"] = $ds->prepareIn(array_keys($blocs));
$ljoin["bloc_operatoire"] = "bloc_operatoire.bloc_operatoire_id = sallesbloc.bloc_id";
$order = "bloc_operatoire.nom, sallesbloc.nom";
$salles = $salle->loadList($where, $order, null, null, $ljoin);
$salles_ids = array_keys($salles);
$nbAlertesInterv = CBlocOperatoire::countAlertesIntervsForSalles(array_keys($salles));
foreach ($blocs as $_bloc) {
$_bloc->canDo();