1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
3 include '../../inc/common.php';
5 mtrack_head("Administration");
8 'tickets' => 'Configure Tickets',
9 'projects' => 'Configure Projects & Notifications',
10 'repo' => 'Configure Repositories',
11 'user' => 'User Administration & Authentication',
12 'logs' => 'Review Logs',
17 function add_cat($url) {
19 $cats = func_get_args();
21 foreach ($cats as $cat) {
22 $by_cat[$cat][] = $url;
26 if (MTrackACL::hasAnyRights('Projects', 'modify')) {
27 add_cat("<a href='{$ABSWEB}admin/project.php'>Projects</a> and their notification settings", 'projects');
30 if (MTrackACL::hasAnyRights('Enumerations', 'modify')) {
31 $eurl = $ABSWEB . 'admin/enum.php';
32 add_cat("<a href='$eurl/Priority'>Priority</a>, <a href='$eurl/TicketState'>TicketState</a>, <a href='$eurl/Severity'>Severity</a>, <a href='$eurl/Resolution'>Resolution</a> and <a href='$eurl/Classification'>Classification</a> fields used in tickets", 'tickets');
33 add_cat("<a href='{$ABSWEB}admin/customfield.php'>Custom Fields</a>", 'tickets');
36 if (MTrackACL::hasAnyRights('Components', 'modify')) {
37 add_cat("<a href='{$ABSWEB}admin/component.php'>Components</a> and their associations with Projects", 'tickets', 'projects');
40 if (MTrackACL::hasAnyRights('Tickets', 'create')) {
41 add_cat("<a href='{$ABSWEB}admin/importcsv.php'>Import Tickets</a> from a CSV file", 'tickets');
44 if (MTrackACL::hasAnyRights('Browser', 'modify')) {
45 add_cat("Configure <a href='{$ABSWEB}admin/repo.php'>Repositories</a> and their links to Projects", 'repo');
48 if (MTrackACL::hasAllRights('User', 'modify')) {
49 add_cat("Administer <a href='{$ABSWEB}admin/auth.php'>Authentication</a>", 'user');
50 add_cat("Administer <a href='{$ABSWEB}admin/user.php'>Users</a>", 'user');
53 if (MTrackACL::hasAllRights('Browser', 'modify')) {
54 add_cat("<a href='{$ABSWEB}admin/logs.php'>Indexer logs</a>", 'logs');
57 foreach ($cat_titles as $cat => $title) {
58 $links = $by_cat[$cat];
59 if (count($links) == 0) {
62 echo "<h2>$title</h2>";
63 foreach ($links as $link) {