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


PHP Access::canAccessReports方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->usr_id = Auth::getUserID();
     if (!Access::canAccessReports($this->usr_id)) {
         throw new LogicException('Invalid role');
     }
     $this->prj_id = Auth::getCurrentProject();
     $this->activity_types = !empty($_REQUEST['activity_types']) ? (array) $_REQUEST['activity_types'] : array();
     $this->report_type = isset($_REQUEST['report_type']) ? (string) $_REQUEST['report_type'] : null;
     $this->unit = $this->getParam('unit', array('hour', 'day'));
     $this->amount = isset($_REQUEST['amount']) ? $_REQUEST['amount'] : null;
     $this->developer = isset($_REQUEST['developer']) ? $_REQUEST['developer'] : null;
     $this->start_date = $this->parseDate(isset($_POST['start']) ? $_POST['start'] : null);
     $this->end_date = $this->parseDate(isset($_POST['end']) ? $_POST['end'] : null);
     $this->sort_order = $this->getParam('sort_order', array('ASC', 'DESC'));
     if (CRM::hasCustomerIntegration($this->prj_id)) {
         $this->crm = CRM::getInstance($this->prj_id);
     }
 }
开发者ID:dabielkabuto,项目名称:eventum,代码行数:19,代码来源:RecentActivity.php

示例2: Template_Helper

/*
 * This file is part of the Eventum (Issue Tracking System) package.
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/custom_fields.tpl.html');
Auth::checkAuthentication();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
// get list of fields and convert info useful arrays
$fields = Custom_Field::getListByProject($prj_id, '');
$custom_fields = array();
$options = array();
if (is_array($fields) && count($fields) > 0) {
    foreach ($fields as $field) {
        $custom_fields[$field['fld_id']] = $field['fld_title'];
        $options[$field['fld_id']] = Custom_Field::getOptions($field['fld_id']);
    }
} else {
    echo ev_gettext('No custom fields for this project');
开发者ID:dabielkabuto,项目名称:eventum,代码行数:30,代码来源:custom_fields.php


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