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); } }
/* * 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');