示例#1
0
// set smarty config
require_once '../../libraries/smarty/Smarty.class.php';
$tpl = new Smarty();
$tpl->template_dir = 'templates/';
$tpl->compile_dir = 'compile/';
$tpl->assign('kga', $kga);
// prevent IE from caching the response
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// Get the total time displayed in the table.
if (isset($kga['customer'])) {
    $total = formatDuration(get_zef_time($in, $out, null, array($kga['customer']['knd_ID']), null));
} else {
    $total = formatDuration(get_zef_time($in, $out, array($kga['usr']['usr_ID']), null, null));
}
$tpl->assign('total', $total);
// Get the array of timesheet entries.
if (isset($kga['customer'])) {
    $arr_zef = get_arr_zef($in, $out, null, array($kga['customer']['knd_ID']), null, 1);
} else {
    $arr_zef = get_arr_zef($in, $out, array($kga['usr']['usr_ID']), null, null, 1);
}
if (count($arr_zef) > 0) {
    $tpl->assign('arr_zef', $arr_zef);
} else {
    $tpl->assign('arr_zef', 0);
}
// Get the annotations for the user sub list.
if (isset($kga['customer'])) {
示例#2
0
$wd = $kga['lang']['weekdays_short'][date("w", time())];
$dp_start = 0;
if ($kga['calender_start'] != "") {
    $dp_start = $kga['calender_start'];
} else {
    if (isset($kga['usr'])) {
        $dp_start = date("d/m/Y", getjointime($kga['usr']['usr_ID']));
    }
}
$dp_today = date("d/m/Y", time());
$tpl->assign('dp_start', $dp_start);
$tpl->assign('dp_today', $dp_today);
if (isset($kga['customer'])) {
    $tpl->assign('total', formatDuration(get_zef_time($in, $out, null, array($kga['customer']['knd_ID']))));
} else {
    $tpl->assign('total', formatDuration(get_zef_time($in, $out, $kga['usr']['usr_ID'])));
}
// ===========================
// = DatePicker localization =
// ===========================
$localized_DatePicker = "";
$tpl->assign('weekdays_array', sprintf("['%s','%s','%s','%s','%s','%s','%s']\n", $kga['lang']['weekdays'][0], $kga['lang']['weekdays'][1], $kga['lang']['weekdays'][2], $kga['lang']['weekdays'][3], $kga['lang']['weekdays'][4], $kga['lang']['weekdays'][5], $kga['lang']['weekdays'][6]));
$tpl->assign('weekdays_short_array', sprintf("['%s','%s','%s','%s','%s','%s','%s']\n", $kga['lang']['weekdays_short'][0], $kga['lang']['weekdays_short'][1], $kga['lang']['weekdays_short'][2], $kga['lang']['weekdays_short'][3], $kga['lang']['weekdays_short'][4], $kga['lang']['weekdays_short'][5], $kga['lang']['weekdays_short'][6]));
$tpl->assign('months_array', sprintf("['%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s']\n", $kga['lang']['months'][0], $kga['lang']['months'][1], $kga['lang']['months'][2], $kga['lang']['months'][3], $kga['lang']['months'][4], $kga['lang']['months'][5], $kga['lang']['months'][6], $kga['lang']['months'][7], $kga['lang']['months'][8], $kga['lang']['months'][9], $kga['lang']['months'][10], $kga['lang']['months'][11]));
$tpl->assign('months_short_array', sprintf("['%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s']", $kga['lang']['months_short'][0], $kga['lang']['months_short'][1], $kga['lang']['months_short'][2], $kga['lang']['months_short'][3], $kga['lang']['months_short'][4], $kga['lang']['months_short'][5], $kga['lang']['months_short'][6], $kga['lang']['months_short'][7], $kga['lang']['months_short'][8], $kga['lang']['months_short'][9], $kga['lang']['months_short'][10], $kga['lang']['months_short'][11]));
// ==============================
// = assign smarty placeholders =
// ==============================
$tpl->assign('current_timer_hour', $current_timer['hour']);
$tpl->assign('current_timer_min', $current_timer['min']);
$tpl->assign('current_timer_sec', $current_timer['sec']);
示例#3
0
     $filterEvt = explode(':', $filters[3]);
 }
 // 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_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;
 // =========================