4499: show all open cache reports

This commit is contained in:
following 2013-01-30 16:05:55 +01:00
parent daa748f023
commit 9ddfbd6721
2 changed files with 18 additions and 6 deletions

View File

@ -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);

View File

@ -28,13 +28,20 @@
{if $list == true}
<table class="table">
<tr><th>{t}ID{/t}</th><th>{t}Name{/t}</th><th>{t}Owner{/t}</th><th>{t}Reporter{/t}</th><th>{t}Date{/t}</th></tr>
<tr><th>{t}ID{/t}</th><th>{t}Name{/t}</th><th>{t}Owner{/t}</th><th>{t}Reporter{/t}</th><th>{t}Admin{/t}</th><th>{t}Date{/t}</th></tr>
{assign var="otheradmins" value=0}
{foreach from=$reportedcaches item=rc}
<tr>
{if $rc.otheradmin > $otheradmins}
<td colspan="6"><hr /></td></tr><tr>
{assign var="otheradmins" value=$rc.otheradmin}
{/if}
<td><a href="adminreports.php?id={$rc.id}">{$rc.id}</td>
<td><a href="adminreports.php?id={$rc.id}">{$rc.new|escape}{$rc.name|escape}</a></td>
<td>{$rc.ownernick|escape}</td>
<td>{$rc.username|escape}</td>
<td style="white-space: nowrap;">{$rc.lastmodified|date_format:$opt.format.datelong}</td></tr>
<td>{$rc.adminname|escape}</td>
<td style="white-space: nowrap;">{$rc.lastmodified|date_format:$opt.format.date}</td></tr>
{foreachelse}
<tr><td colspan=5>{t}No reported caches{/t}</td></tr>
{/foreach}