From 9ddfbd67218fe73092a9e72ba949d08ec4a63606 Mon Sep 17 00:00:00 2001 From: following Date: Wed, 30 Jan 2013 16:05:55 +0100 Subject: [PATCH] 4499: show all open cache reports --- htdocs/adminreports.php | 13 +++++++++---- htdocs/templates2/ocstyle/adminreports.tpl | 11 +++++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/htdocs/adminreports.php b/htdocs/adminreports.php index 57da6b26..6442278a 100644 --- a/htdocs/adminreports.php +++ b/htdocs/adminreports.php @@ -115,14 +115,19 @@ `c`.`name`, `u2`.`username` AS `ownernick`, `u`.`username`, - `cr`.`lastmodified` + `u3`.`username` AS `adminname`, + `cr`.`lastmodified`, + `cr`.`adminid` IS NOT NULL AND `cr`.`adminid`!=&1 AS otheradmin FROM `cache_reports` `cr` INNER JOIN `caches` `c` ON `c`.`cache_id` = `cr`.`cacheid` INNER JOIN `user` `u` ON `u`.`user_id` = `cr`.`userid` INNER JOIN `user` AS `u2` ON `u2`.`user_id`=`c`.`user_id` - WHERE `cr`.`status` < 3 - AND (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1) - ORDER BY `cr`.`status` ASC, `cr`.`lastmodified` ASC", + LEFT JOIN `user` AS `u3` ON `u3`.`user_id`=`cr`.`adminid` + WHERE `cr`.`status` < 3 " . + // AND (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1) + "ORDER BY (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1) DESC, + `cr`.`status` ASC, + `cr`.`lastmodified` ASC", $login->userid); $tpl->assign_rs('reportedcaches', $rs); diff --git a/htdocs/templates2/ocstyle/adminreports.tpl b/htdocs/templates2/ocstyle/adminreports.tpl index 090251d7..db1d9154 100644 --- a/htdocs/templates2/ocstyle/adminreports.tpl +++ b/htdocs/templates2/ocstyle/adminreports.tpl @@ -28,13 +28,20 @@ {if $list == true} - + + {assign var="otheradmins" value=0} {foreach from=$reportedcaches item=rc} + + {if $rc.otheradmin > $otheradmins} + + {assign var="otheradmins" value=$rc.otheradmin} + {/if} - + + {foreachelse} {/foreach}
{t}ID{/t}{t}Name{/t}{t}Owner{/t}{t}Reporter{/t}{t}Date{/t}
{t}ID{/t}{t}Name{/t}{t}Owner{/t}{t}Reporter{/t}{t}Admin{/t}{t}Date{/t}

{$rc.id} {$rc.new|escape}{$rc.name|escape} {$rc.ownernick|escape} {$rc.username|escape}{$rc.lastmodified|date_format:$opt.format.datelong}
{$rc.adminname|escape}{$rc.lastmodified|date_format:$opt.format.date}
{t}No reported caches{/t}