示例#1
0
/**
 * Get annotations for the project sub list. Currently it's just the time, like
 * in the timesheet extension.
 * 
 * @param int $start Time from which to take entries into account.
 * @param int $end Time until which to take entries into account.
 * @param array $users Array of user IDs to filter by.
 * @param array $customers Array of customer IDs to filter by.
 * @param array $projects Array of project IDs to filter by.
 * @param array $events Array of event IDs to filter by.
 * @return array Array which assigns every project (via his ID) the data to show.
 */
function xp_get_arr_pct($start, $end, $users = null, $customers = null, $projects = null, $events = null)
{
    global $expense_ext_available;
    $arr = get_arr_time_pct($start, $end, $users, $customers, $projects, $events);
    if ($expense_ext_available) {
        $exp_arr = get_arr_exp_pct($start, $end, $users, $customers, $projects);
        merge_annotations($arr, $exp_arr);
    }
    return $arr;
}
示例#2
0
         $filterKnd = array($kga['customer']['knd_ID']);
     }
     $arr_zef = get_arr_zef($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt, 1);
     if (count($arr_zef) > 0) {
         $tpl->assign('arr_zef', $arr_zef);
     } else {
         $tpl->assign('arr_zef', 0);
     }
     $tpl->assign('total', formatDuration(get_zef_time($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt)));
     $ann = get_arr_time_usr($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt);
     formatAnnotations($ann);
     $tpl->assign('usr_ann', $ann);
     $ann = get_arr_time_knd($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt);
     formatAnnotations($ann);
     $tpl->assign('knd_ann', $ann);
     $ann = get_arr_time_pct($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt);
     formatAnnotations($ann);
     $tpl->assign('pct_ann', $ann);
     $ann = get_arr_time_evt($in, $out, $filterUsr, $filterKnd, $filterPct, $filterEvt);
     formatAnnotations($ann);
     $tpl->assign('evt_ann', $ann);
     $tpl->display("zef.tpl");
     break;
     // =========================
     // = add / edit zef record =
     // =========================
 // =========================
 // = add / edit zef record =
 // =========================
 case 'add_edit_record':
     if (isset($kga['customer'])) {
示例#3
0
}
formatAnnotations($ann);
$tpl->assign('usr_ann', $ann);
// Get the annotations for the customer sub list.
if (isset($kga['customer'])) {
    $ann = get_arr_time_knd($in, $out, null, array($kga['customer']['knd_ID']));
} else {
    $ann = get_arr_time_knd($in, $out, array($kga['usr']['usr_ID']));
}
formatAnnotations($ann);
$tpl->assign('knd_ann', $ann);
// Get the annotations for the project sub list.
if (isset($kga['customer'])) {
    $ann = get_arr_time_pct($in, $out, null, array($kga['customer']['knd_ID']));
} else {
    $ann = get_arr_time_pct($in, $out, array($kga['usr']['usr_ID']));
}
formatAnnotations($ann);
$tpl->assign('pct_ann', $ann);
// Get the annotations for the task sub list.
if (isset($kga['customer'])) {
    $ann = get_arr_time_evt($in, $out, null, array($kga['customer']['knd_ID']));
} else {
    $ann = get_arr_time_evt($in, $out, array($kga['usr']['usr_ID']));
}
formatAnnotations($ann);
$tpl->assign('evt_ann', $ann);
$tpl->assign('zef_display', $tpl->fetch("zef.tpl"));
$tpl->assign('buzzerAction', "startRecord()");
$tpl->assign('browser', get_agent());
// select for projects
示例#4
0
/**
 * returns list of projects and their time summary within zef_entry timespace as array
 *
 * OLD VERSION THAT MERGES TWO QUERYS - bad bad stuff ...
 * TODO: [tom] revise with join query!
 *
 * @param integer $group ID of group in table grp
 * @param integer $user ID of user in table usr
 * @param integer $in start time in unix seconds
 * @param integer $out end time in unix seconds
 * @global array $kga kimai-global-array
 * @return array
 * @author th
 */
function get_arr_pct_with_time($group, $user, $in, $out)
{
    global $kga;
    //TODO: [tom] Functions results with 1 query
    $arr_pcts = get_arr_pct($group);
    $arr_time = get_arr_time_pct($user, $in, $out);
    //TODO END
    $arr = array();
    $i = 0;
    foreach ($arr_pcts as $pct) {
        $arr[$i]['pct_ID'] = $pct['pct_ID'];
        $arr[$i]['knd_ID'] = $pct['knd_ID'];
        $arr[$i]['pct_name'] = $pct['pct_name'];
        $arr[$i]['pct_comment'] = $pct['pct_comment'];
        $arr[$i]['knd_name'] = $pct['knd_name'];
        $arr[$i]['pct_visible'] = $pct['pct_visible'];
        $arr[$i]['zeit'] = @formatDuration($arr_time[$pct['pct_ID']]);
        $i++;
    }
    return $arr;
}