forked from rogermoka/Timesheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
timesheet_menu.inc
63 lines (54 loc) · 3.37 KB
/
timesheet_menu.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?
//load local vars from superglobals
$year = isset($_REQUEST["year"]) ? $_REQUEST["year"]: (int)date("Y");
$month = isset($_REQUEST["month"]) ? $_REQUEST["month"]: (int)date("m");
$day = isset($_REQUEST["day"]) ? $_REQUEST["day"]: (int)date("j");
$proj_id = isset($_REQUEST["proj_id"]) ? $_REQUEST["proj_id"]: 0;
$task_id = isset($_REQUEST["task_id"]) ? $_REQUEST["task_id"]: 0;
$client_id = isset($_REQUEST["client_id"]) ? $_REQUEST["client_id"]: 0;
//get todays values
$today = time();
$todayYear = date("Y", $today);
$todayMonth = date("n", $today);
$todayDay = date("j", $today);
//default values to today if not set
if (empty($_REQUEST['year']))
$year = $todayYear;
if (empty($_REQUEST['month']))
$month = $todayMonth;
if (empty($_REQUEST['day']))
$day = $todayDay;
// View mode (monthly, weekly, all)
if (isset($_REQUEST['mode']))
$mode = $_REQUEST['mode'];
else
$mode = "all";
if (!($mode == "all" || $mode == "monthly" || $mode == "weekly"))
$mode = "all";
//define the command menu
$commandMenu->add(new IconTextCommand("Dashboard", true, "timesheet-dashboard.php", "images/icon_clients.gif"));
//$popup_href = "javascript:void(0)\" onclick=window.open(\"stopwatch.php?client_id=$client_id&proj_id=$proj_id&task_id=$task_id&destination=$_SERVER[PHP_SELF]\",\"Stopwatch\",\"location=0,directories=no,status=no,menubar=no,resizable=1,width=420,height=220\") dummy=\"";
//$commandMenu->add(new IconTextCommand("Stopwatch", true, $popup_href, "images/icon_stopwatch.gif"));
//$commandMenu->add(new IconTextCommand("Daily Timesheet", true, "daily.php?client_id=$client_id&proj_id=$proj_id&task_id=$task_id&month=$todayMonth&year=$todayYear&day=$todayDay", "images/icon_daily.gif"));
//$commandMenu->add(new IconTextCommand("Weekly Timesheet", true, "weekly.php?month=$todayMonth&year=$todayYear&day=$todayDay", "images/icon_daily.gif"));
//$commandMenu->add(new IconTextCommand("Calendar", true, "calendar.php?month=$month&year=$year&day=$day", "images/icon_calendar.gif"));
$commandMenu->add(new IconTextCommand("Simple Timesheet", true, "simple.php?client_id=$client_id&proj_id=$proj_id&task_id=$task_id&month=$todayMonth&year=$todayYear&day=$todayDay", "images/icon_daily.gif"));
//add administrator menu options?
if ($authenticationManager->hasClearance(CLEARANCE_ADMINISTRATOR)) {
$commandMenu->add(new IconTextCommand("Clients", true, "client_maint.php", "images/icon_clients.gif"));
$commandMenu->add(new IconTextCommand("Users", true, "user_maint.php", "images/icon_users.gif"));
$commandMenu->add(new IconTextCommand("Projects", true, "proj_maint.php", "images/icon_projects.gif"));
$commandMenu->add(new IconTextCommand("Tasks", true, "task_maint.php", "images/icon_tasks.gif"));
$commandMenu->add(new IconTextCommand("Configuration", true, "config.php", "images/icon_configuration.gif"));
}
//if ($authenticationManager->hasClearance(MANAGER)) {
// $commandMenu->add(new IconTextCommand("Reports", true, "reports.php", "images/icon_reports.gif"));
//}else{
// $commandMenu->add(new IconTextCommand("Reports", true, "admin_report_all.php?month=$month&year=$year&mode=monthly", "images/icon_reports.gif"));
//}
if (!$authenticationManager->usingLDAP())
$commandMenu->add(new IconTextCommand("Change Password", true, "changepwd.php", "images/icon_key.gif"));
$commandMenu->add(new IconTextCommand("Logout", true, "logout.php?logout=true", "images/icon_logout.gif"));
//disable yourself
$commandMenu->disableSelf();
?>