posaune
[timetracker.git] / work.php
1 <?php
2 // +----------------------------------------------------------------------+
3 // | Anuko Time Tracker
4 // +----------------------------------------------------------------------+
5 // | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
6 // +----------------------------------------------------------------------+
7 // | LIBERAL FREEWARE LICENSE: This source code document may be used
8 // | by anyone for any purpose, and freely redistributed alone or in
9 // | combination with other software, provided that the license is obeyed.
10 // |
11 // | There are only two ways to violate the license:
12 // |
13 // | 1. To redistribute this code in source form, with the copyright
14 // |    notice or license removed or altered. (Distributing in compiled
15 // |    forms without embedded copyright notices is permitted).
16 // |
17 // | 2. To redistribute modified versions of this code in *any* form
18 // |    that bears insufficient indications that the modifications are
19 // |    not the work of the original author(s).
20 // |
21 // | This license applies to this document only, not any other software
22 // | that it may be combined with.
23 // |
24 // +----------------------------------------------------------------------+
25 // | Contributors:
26 // | https://www.anuko.com/time_tracker/credits.htm
27 // +----------------------------------------------------------------------+
28
29 require_once('initialize.php');
30 import('ttGroupHelper');
31
32 // Access checks.
33 if (!(ttAccessAllowed('update_work') || ttAccessAllowed('bid_on_work')  || ttAccessAllowed('manage_work'))) {
34   header('Location: access_denied.php');
35   exit();
36 }
37 if (!$user->isPluginEnabled('wk')) {
38   header('Location: feature_disabled.php');
39   exit();
40 }
41 // End of access checks.
42
43 if($user->can('manage_work')) {
44   // $active_work = ttWorkHelper::getActiveWork(); // Active work items this group is outsourcing.
45   // $inactive_work = ttWorkHelper::getInactiveWork(); // Inactive work items this group was outsourcing.
46 }
47 if($user->can('bid_on_work')) {
48   // $available_work = ttWorkHelper::getAvailableWork(); // Currently available work items from other groups.
49 }
50 if($user->can('update_work')) {
51   // $in_progress_work = ttWorkHelper::getInProgressWork(); // Work items in progress for other groups.
52   // $completed_work = ttWorkHelper::getCompletedWork(); // Completed work items for other groups.
53 }
54
55 $smarty->assign('active_work', $active_work);
56 $smarty->assign('inactive_work', $inactive_work);
57 $smarty->assign('available_work', $available_work);
58 $smarty->assign('in_progress_work', $in_progress_work);
59 $smarty->assign('completed_work', $completed_work);
60 $smarty->assign('title', $i18n->get('title.work'));
61 $smarty->assign('content_page_name', 'work.tpl');
62 $smarty->display('index.tpl');