Commit 426767dc authored by mose's avatar mose

(almost) fixed popup extra info for tracker item attachments

parent afed9719
......@@ -569,21 +569,23 @@ class TrackerLib extends TikiLib {
* returns an array with field=>value
*/
function get_moreinfo($attId) {
$query = "select `orderAttachments`, t.`trackerId` from tiki_trackers t ";
$query = "select `orderAttachments`, t.`trackerId` from `tiki_trackers` t ";
$query.= " left join `tiki_tracker_items` i on t.`trackerId`=i.`trackerId` ";
$query.= " left join `tiki_tracker_item_attachments` a on i.`itemId`=a.`itemId` ";
$query.= " where a.`attId`=?";
$resu = $this->query($query,((int)$attId));
if (strstr($resu['orderatt'],'|')) {
$fields = split(',',substr($resu['orderat'],strpos($resu['orderatt'],'|')));
$query.= " where a.`attId`=? ";
$resu = $this->query($query,array((int)$attId));
if (strstr('|',$resu['orderAttachments'])) {
$fields = split(',',substr($resu['orderAttachments'],strpos($resu['orderAttachments'],'|')));
$query = "select `".implode("`,`",$fields)."` from `tiki_tracker_item_attachments` where `attId`=?";
$result = $this->query($query,array((int)$attId));
$res = $result->fetchRow();
$res["trackerId"] = $resu['trackerId'];
return $res;
var_dump($resu);
} else {
return array(tra("Sorry") => tra("No extra information for that attached file."));
$res = array(tra("message") => tra("No extra information for that attached file."));
$res['trackerId'] = 0;
}
return $res;
}
}
......
......@@ -109,7 +109,8 @@
{/foreach}
<td class="{cycle}" align="right" nowrap="nowrap">
{if $attextra eq 'y'}
<a class="tablename" href="#" onclick="javascript:window.open('tiki-view_tracker_more_info.php?attId={$atts[ix].attId}','_blank','menubar=no,toolbar=no,location=no,directories=no,fullscreen=no,titlebar=no,hotkeys=no,status=no,scrollbars=yes,resizable=yes,width=350,height=500');">more</a>
{assign var=link value='tiki-view_tracker_more_info.php?attId='|cat:$atts[ix].attId}
<a class="tablename" href="#" onClick="window.open('http://{$http_domain}{$http_prefix}{$link|escape:"javascript"}','newin','menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=450,height=600');return true;">more</a>
{/if}
<a class="tablename" href="tiki-download_item_attachment.php?attId={$atts[ix].attId}">{$atts[ix].filename|iconify}</a>
{if $tiki_p_wiki_admin_attachments eq 'y' or ($user and ($atts[ix].user eq $user))}
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-view_tracker_more_info.php,v 1.1 2003-12-16 07:26:07 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-view_tracker_more_info.php,v 1.2 2003-12-16 08:59:15 mose Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -22,23 +22,23 @@ if (!isset($_REQUEST["attId"])) {
}
$info = $trklib->get_moreinfo($_REQUEST["attId"]);
$_REQUEST["trackerId"] = $info['trackerId'];
$trackerId = $info['trackerId'];
if (!isset($_REQUEST["trackerId"])) {
$smarty->assign('msg', tra("No tracker indicated"));
$smarty->display("error.tpl");
if (!$trackerId) {
$smarty->assign('msg', tra("That tracker don't use extras."));
$smarty->display("error_simple.tpl");
die;
}
$smarty->assign('trackerId', $_REQUEST["trackerId"]);
$smarty->assign('trackerId', $trackerId);
$smarty->assign('individual', 'n');
if ($userlib->object_has_one_permission($_REQUEST["trackerId"], 'tracker')) {
if ($userlib->object_has_one_permission($trackerId, 'tracker')) {
$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, $_REQUEST["trackerId"], 'tracker', $permName)) {
if ($userlib->object_has_permission($user, $trackerId, 'tracker', $permName)) {
$$permName = 'y';
$smarty->assign("$permName", 'y');
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment