<?php
/**************************************************************************\
* phpgwtimetrack - phpGroupWare addon application *
* http://phpgwtimetrack.sourceforge.net *
* Written by Robert Schader <hide@address.com> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/*************************************************************\
* Set the following variables to the groups numbers you want *
* them to work with. *
\*************************************************************/
$phpgw->db->query("select config_value from config where config_name ='ttrack_mangrp'");
$phpgw->db->next_record();
$manager_group = $phpgw->db->f("config_value");
$phpgw->db->query("select config_value from config where config_name ='ttrack_paygrp'");
$phpgw->db->next_record();
$payroll_group = $phpgw->db->f("config_value");
//$manager_group = 4;
//$payroll_group = 5;
$phpgw_info["apps"]["timetrack"]["ismanager"] = 0;
$phpgw_info["apps"]["timetrack"]["ispayroll"] = 0;
$phpgw_info["apps"]["timetrack"]["manager_gid"] = $manager_group;
$phpgw_info["apps"]["timetrack"]["payroll_gid"] = $payroll_group;
$user_groups = $phpgw_info["user"]["groups"];
for ($i=1;$i<count($user_groups)-1; $i++)
{
$gid = intval($user_groups[$i][0]);
if($gid == $manager_group) $phpgw_info["apps"]["timetrack"]["ismanager"] = 1;
if($gid == $payroll_group) $phpgw_info["apps"]["timetrack"]["ispayroll"] = 1;
}
/*********** End of check groups code section ****************/
$t = new Template($phpgw_info["server"]["app_tpl"]);
$t->set_file(array("app_header" => "header.tpl"));
$app_info = lang("Time Tracking");
$t->set_var("app_info", "<td bgcolor=\"" . $phpgw_info["theme"]["th_bg"]
. "\" align=\"left\"><b>" . $app_info);
$t->set_var("link_inout","<a href=\"" . $phpgw->link("index.php") . "\">"
. lang("In/Out") ."</a> |");
$t->set_var("link_newjob","<a href=\"" . $phpgw->link("newjob.php") . "\">"
. lang("New Job") ."</a> |");
$t->set_var("link_jobstatus","<a href=\"" . $phpgw->link("jobslist.php") . "\">"
. lang("Job Status") ."</a> |");
$t->set_var("link_entertime","<a href=\"" . $phpgw->link("addjobdetail.php") . "\">"
. lang("Enter Time") ."</a> |");
$t->set_var("link_timesheets","<a href=\"" . $phpgw->link("timesheets.php") . "\">"
. lang("Time Sheets") ."</a> |");
$t->set_var("link_custlist","<a href=\"" . $phpgw->link("customers.php") . "\">"
. lang("Customer List") ."</a> |");
if($phpgw_info["apps"]["timetrack"]["ismanager"]) {
$t->set_var("link_editprofiles","<a href=\"" . $phpgw->link("profiles.php") . "\">"
. lang("Edit Profiles") ."</a> |");
} else {
$t->set_var("link_editprofiles","");
}
$t->set_var("link_viewprofiles","<a href=\"" . $phpgw->link("hr-profiles.php") . "\">"
. lang("View Profiles") ."</a> |");
$t->set_var("link_yourprofile","<a href=\"" . $phpgw->link("changeprofile.php") . "\">"
. lang("Your Profile") ."</a>");
$t->pparse("out","app_header");
?>