Exemplo n.º 1
0
} else {
    // customer logged in
    $arr_exp = get_arr_exp($in, $out, null, array($kga['customer']['knd_ID']), null, 1);
}
if (count($arr_exp) > 0) {
    $tpl->assign('arr_exp', $arr_exp);
} else {
    $tpl->assign('arr_exp', 0);
}
$tpl->assign('total', "");
if (isset($kga['usr'])) {
    // user logged in
    $ann = get_arr_exp_usr($in, $out, array($kga['usr']['usr_ID']));
} else {
    // customer logged in
    $ann = get_arr_exp_usr($in, $out, null, array($kga['customer']['knd_ID']));
}
$ann = formatCurrency($ann);
$tpl->assign('usr_ann', $ann);
// TODO: function for loops or convert it in template with new function
if (isset($kga['usr'])) {
    // user logged in
    $ann = get_arr_exp_knd($in, $out, array($kga['usr']['usr_ID']));
} else {
    // customer logged in
    $ann = get_arr_exp_knd($in, $out, null, array($kga['customer']['knd_ID']));
}
$ann = formatCurrency($ann);
$tpl->assign('knd_ann', $ann);
if (isset($kga['usr'])) {
    // user logged in
Exemplo n.º 2
0
/**
 * Get annotations for the user 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 user (via his ID) the data to show.
 */
function xp_get_arr_usr($start, $end, $users = null, $customers = null, $projects = null, $events = null)
{
    global $expense_ext_available;
    $arr = get_arr_time_usr($start, $end, $users, $customers, $projects, $events);
    if ($expense_ext_available) {
        $exp_arr = get_arr_exp_usr($start, $end, $users, $customers, $projects);
        merge_annotations($arr, $exp_arr);
    }
    return $arr;
}
Exemplo n.º 3
0
 }
 // if no userfilter is set, set it to current user
 if (isset($kga['usr']) && count($filterUsr) == 0) {
     array_push($filterUsr, $kga['usr']['usr_ID']);
 }
 if (isset($kga['customer'])) {
     $filterKnd = array($kga['customer']['knd_ID']);
 }
 $arr_exp = get_arr_exp($in, $out, $filterUsr, $filterKnd, $filterPct, 1);
 if (count($arr_exp) > 0) {
     $tpl->assign('arr_exp', $arr_exp);
 } else {
     $tpl->assign('arr_exp', 0);
 }
 $tpl->assign('total', "");
 $ann = get_arr_exp_usr($in, $out, $filterUsr, $filterKnd, $filterPct);
 $ann = formatCurrency($ann);
 $tpl->assign('usr_ann', $ann);
 // TODO: function for loops or convert it in template with new function
 $ann = get_arr_exp_knd($in, $out, $filterUsr, $filterKnd, $filterPct);
 $ann = formatCurrency($ann);
 $tpl->assign('knd_ann', $ann);
 $ann = get_arr_exp_pct($in, $out, $filterUsr, $filterKnd, $filterPct);
 $ann = formatCurrency($ann);
 $tpl->assign('pct_ann', $ann);
 $tpl->assign('evt_ann', array());
 $tpl->display("exp.tpl");
 break;
 // =======================================
 // = Erase expense entry via quickdelete =
 // =======================================