Пример #1
0
                 }
             }
             foreach ($arr_evt as $row => $evt_data) {
                 $grp_names = array();
                 foreach (evt_get_grps($evt_data['evt_ID']) as $grp_id) {
                     $data = grp_get_data($grp_id);
                     $grp_names[] = $data['grp_name'];
                 }
                 $arr_evt[$row]['groups'] = implode(", ", $grp_names);
             }
             if (count($arr_evt) > 0) {
                 $tpl->assign('arr_evt', $arr_evt);
             } else {
                 $tpl->assign('arr_evt', '0');
             }
             $arr_pct = get_arr_pct($group);
             $tpl->assign('arr_pct', $arr_pct);
             $tpl->assign('selected_evt_filter', $_REQUEST['evt_filter']);
             $tpl->display("evt.tpl");
             break;
     }
     break;
 case "deleteUsr":
     // set the trashflag of a user
     switch ($axValue) {
         case 0:
             // Fire JavaScript confirm when a user is about to be deleted
             echo $kga['lang']['sure'];
             break;
         case 1:
             // If the confirmation is returned the user gets the trash-flag.
Пример #2
0
 * along with Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
// Include Basics
include '../../includes/basics.php';
require "private_func.php";
$usr = checkUser();
// set smarty config
require_once WEBROOT . 'libraries/smarty/Smarty.class.php';
$tpl = new Smarty();
$tpl->template_dir = 'templates/';
$tpl->compile_dir = 'compile/';
// Get all project for the logged in customer or the current user.
if (isset($kga['customer'])) {
    $arr_pct = get_arr_pct_by_knd("all", $kga['customer']['knd_ID']);
} else {
    $arr_pct = get_arr_pct($kga['usr']['usr_grp']);
}
$usedEvents = array();
$xpensesOccured = false;
// If there are any projects create the plot data.
if (count($arr_pct) > 0) {
    $arr_plotdata = budget_plot_data($arr_pct, $usedEvents, $expensesOccured);
    $tpl->assign('arr_plotdata', $arr_plotdata);
    $tpl->assign('arr_pct', $arr_pct);
} else {
    $tpl->assign('arr_pct', 0);
}
$chartColors = array("#efefef", "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc");
$tpl->assign('chartColors', json_encode($chartColors));
// Create the keys which explain to the user which color means what.
$keys = array();
Пример #3
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;
}