예제 #1
0
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
if (count(@$_REQUEST['start']) > 0 && @$_REQUEST['start']['Year'] != 0 && @$_REQUEST['start']['Month'] != 0 && @$_REQUEST['start']['Day'] != 0) {
    $start_date = implode('-', $_REQUEST['start']);
} elseif (!empty($_GET['start_date'])) {
    $start_date = $_GET['start_date'];
}
if (count(@$_REQUEST['end']) > 0 && @$_REQUEST['end']['Year'] != 0 && @$_REQUEST['end']['Month'] != 0 && @$_REQUEST['end']['Day'] != 0) {
    $end_date = implode('-', $_REQUEST['end']);
} elseif (!empty($_GET['end_date'])) {
    $end_date = $_GET['end_date'];
}
$tpl->assign(array('weeks' => Date_Helper::getWeekOptions(3, 0), 'users' => Project::getUserAssocList($prj_id, 'active', User::ROLE_CUSTOMER), 'start_date' => @$start_date, 'end_date' => @$end_date, 'report_type' => @$_REQUEST['report_type']));
if (!empty($_REQUEST['developer'])) {
    //split date up
    if (@$_REQUEST['report_type'] == 'weekly') {
        $dates = explode('_', $_REQUEST['week']);
    } else {
        $dates = array($start_date, $end_date);
    }
    // print out emails
    $developer = $_REQUEST['developer'];
    $prj_id = Auth::getCurrentProject();
    $options = array('separate_closed' => @$_REQUEST['separate_closed'], 'separate_not_assigned_to_user' => @$_REQUEST['separate_not_assigned_to_user'], 'ignore_statuses' => @$_REQUEST['ignore_statuses'], 'show_per_issue' => !empty($_REQUEST['show_per_issue']), 'separate_no_time' => !empty($_REQUEST['separate_no_time']));
    $data = Report::getWeeklyReport($developer, $prj_id, $dates[0], $dates[1], $options);
    // order issues by time spent on them
    if (isset($_REQUEST['show_per_issue'])) {
        $sort_function = function ($a, $b) {
예제 #2
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');
    exit;
}
if (count(@$_POST['start']) > 0 && @$_POST['start']['Year'] != 0 && @$_POST['start']['Month'] != 0 && @$_POST['start']['Day'] != 0) {
    $start_date = implode('-', $_POST['start']);
}
if (count(@$_POST['end']) > 0 && @$_POST['end']['Year'] != 0 && @$_POST['end']['Month'] != 0 && @$_POST['end']['Day'] != 0) {
    $end_date = implode('-', $_POST['end']);
}
$per_user = empty($_POST['time_per_user']) ? false : true;
$tpl->assign(array('custom_fields' => $custom_fields, 'custom_field' => @$_POST['custom_field'], 'options' => $options, 'custom_options' => @$_POST['custom_options'], 'selected_options' => @$_REQUEST['custom_options'], 'start_date' => @$start_date, 'end_date' => @$end_date, 'report_type' => @$_POST['report_type'], 'per_user' => $per_user, 'weeks' => Date_Helper::getWeekOptions(3, 0)));
if (empty($_POST['week'])) {
    $tpl->assign('week', Date_Helper::getCurrentWeek());
} else {
    $tpl->assign('week', $_POST['week']);
}
if (isset($_POST['custom_field'])) {
    $tpl->assign(array('field_info' => Custom_Field::getDetails($_POST['custom_field'])));
}
// split date up
if (@$_POST['report_type'] == 'weekly') {
    $dates = explode('_', $_POST['week']);
} else {
    $dates = array(@$start_date, @$end_date);
}
if (count(@$_POST['custom_field']) > 0) {