tiki-view_tracker_more_info.php 1.96 KB
Newer Older
1
<?php
2
// $Id: /cvsroot/tikiwiki/tiki/tiki-view_tracker_more_info.php,v 1.9 2007-10-12 07:55:33 nyloth Exp $
3
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
4 5 6 7 8
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// Initialization
require_once ('tiki-setup.php');
include_once ('lib/trackers/trackerlib.php');
9
if ($prefs['feature_trackers'] != 'y') {
changi67's avatar
changi67 committed
10 11 12
    $smarty->assign('msg', tra("This feature is disabled") . ": feature_trackers");
    $smarty->display("error.tpl");
    die;
13 14
}
if (!isset($_REQUEST["attId"])) {
changi67's avatar
changi67 committed
15 16 17
    $smarty->assign('msg', tra("No item indicated"));
    $smarty->display("error.tpl");
    die;
18 19
}
$info = $trklib->get_moreinfo($_REQUEST["attId"]);
20
$trackerId = $info['trackerId'];
mose's avatar
mose committed
21
unset($info['trackerId']);
22
if (!$trackerId) {
changi67's avatar
changi67 committed
23 24 25
    $smarty->assign('msg', tra("That tracker don't use extras."));
    $smarty->display("error_simple.tpl");
    die;
26
}
27
$smarty->assign('trackerId', $trackerId);
28
$smarty->assign('individual', 'n');
29
if ($userlib->object_has_one_permission($trackerId, 'tracker')) {
changi67's avatar
changi67 committed
30 31 32 33 34 35 36 37 38 39 40 41 42 43
    $smarty->assign('individual', 'y');
    if ($tiki_p_admin != 'y') {
        $perms = $userlib->get_permissions(0, -1, 'permName_desc', '', 'trackers');
        foreach($perms["data"] as $perm) {
            $permName = $perm["permName"];
            if ($userlib->object_has_permission($user, $trackerId, 'tracker', $permName)) {
                $$permName = 'y';
                $smarty->assign("$permName", 'y');
            } else {
                $$permName = 'n';
                $smarty->assign("$permName", 'n');
            }
        }
    }
44 45
}
if ($tiki_p_view_trackers != 'y') {
changi67's avatar
changi67 committed
46 47 48 49
    $smarty->assign('errortype', 401);
    $smarty->assign('msg', tra("You do not have permission to use this feature"));
    $smarty->display("error.tpl");
    die;
50
}
changi67's avatar
changi67 committed
51
$smarty->assign("info", $info);
52
$smarty->display("tiki-view_tracker_more_info.tpl");