Skip to content
Permalink
Browse files

allow reopening cache reports; updates #1003

  • Loading branch information...
following5 committed Sep 5, 2017
1 parent ffce1e2 commit 76e62f631322904d65ac2aa59c7eb82255d1518a
Showing with 16 additions and 6 deletions.
  1. +13 −4 htdocs/adminreports.php
  2. +3 −2 htdocs/templates2/ocstyle/adminreports.tpl
@@ -38,7 +38,7 @@
$comment
);
} elseif (isset($_REQUEST['assign']) && $rid > 0 &&
($adminid == 0 || ($adminid != $login->userid && $age >= 14))
($adminid == 0 || $adminid == $login->userid || ($adminid != $login->userid && $age >= 14))
) {
sql("UPDATE `cache_reports` SET `status`=2, `adminid`=&2 WHERE `id`=&1", $rid, $login->userid);
$tpl->redirect('adminreports.php?id=' . $rid);
@@ -112,21 +112,24 @@
`cr`.`note`,
IFNULL(tt.text, crs.name) AS `status`,
`cr`.`status`='&2' AS `inprogress`,
`cr`.`status`='&3' AS `closed`,
`cr`.`date_created`, `cr`.`lastmodified`,
`c`.`name` AS `cachename`,
`c`.`user_id` AS `ownerid`,
`cr`.`comment`
`cr`.`comment`,
TIMESTAMPDIFF(MINUTE, `lastmodified`, NOW()) AS `minutes_since_change`
FROM `cache_reports` AS `cr`
LEFT JOIN `cache_report_reasons` AS `crr` ON `cr`.`reason`=`crr`.`id`
LEFT JOIN `caches` AS `c` ON `c`.`cache_id`=`cr`.`cacheid`
LEFT JOIN `user` AS `u1` ON `u1`.`user_id`=`cr`.`userid`
LEFT JOIN `user` AS `u2` ON `u2`.`user_id`=`cr`.`adminid`
LEFT JOIN `cache_report_status` AS `crs` ON `cr`.`status`=`crs`.`id`
LEFT JOIN `sys_trans_text` AS `tt` ON `crs`.`trans_id`=`tt`.`trans_id` AND `tt`.`lang`='&3'
LEFT JOIN `sys_trans_text` AS `tt2` ON `crr`.`trans_id`=`tt2`.`trans_id` AND `tt2`.`lang`='&3'
LEFT JOIN `sys_trans_text` AS `tt` ON `crs`.`trans_id`=`tt`.`trans_id` AND `tt`.`lang`='&4'
LEFT JOIN `sys_trans_text` AS `tt2` ON `crr`.`trans_id`=`tt2`.`trans_id` AND `tt2`.`lang`='&4'
WHERE `cr`.`id`= &1",
$id,
CACHE_REPORT_INPROGRESS,
CACHE_REPORT_DONE,
$opt['template']['locale']
);
@@ -155,6 +158,12 @@
$tpl->assign('status', $record['status']);
$tpl->assign('created', $record['date_created']);
$tpl->assign('lastmodified', $record['lastmodified']);
$tpl->assign(
'reopenable',
$record['adminid'] == $login->userid &&
$record['closed'] == 1 &&
$record['minutes_since_change'] <= 10
);
$tpl->assign('cachename', $record['cachename']);
$tpl->assign('ownerid', $record['ownerid']);
$tpl->assign('admin_comment', $record['comment']);
@@ -160,9 +160,10 @@ function editcomment(edit)
</div>
<p style="line-height: 1.6em; margin-bottom:24px">
{if !$ownreport}
{if !$ownreport || $reopenable}
<input type="submit" name="assign" value="{t}Assign to me{/t}" class="formbutton" onclick="submitbutton('assign')" />
{else}
{/if}
{if $ownreport}
&nbsp;<input type="submit" name="contact" value="{t}Contact owner{/t}" class="formbutton" onclick="submitbutton('contact')" />&nbsp;&nbsp;<input type="submit" name="contact_reporter" value="{t}Contact reporter{/t}" class="formbutton" onclick="submitbutton('contact_reporter')" />{if $inprogress}&nbsp;&nbsp;<input type="submit" name="done" value="{t}Mark as finished{/t}" class="formbutton" onclick="submitbutton('done')" />{/if}
</p>

0 comments on commit 76e62f6

Please sign in to comment.
You can’t perform that action at this time.