本文整理汇总了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);
}
}
示例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');