5087: added creation date to cache reports

This commit is contained in:
following
2013-03-25 15:00:51 +01:00
parent 4ae7cab51c
commit 21d92feba0
6 changed files with 21 additions and 3 deletions
+3 -1
View File
@@ -144,7 +144,8 @@
IFNULL(`cr`.`adminid`, 0) AS `adminid`,
IFNULL(`u2`.`username`, '') AS `adminnick`,
IFNULL(`tt2`.`text`, `crr`.`name`) AS `reason`, `cr`.`note`, IFNULL(tt.text, crs.name) AS `status`,
`cr`.`lastmodified`, `c`.`name` AS `cachename`,
`cr`.`date_created`, `cr`.`lastmodified`,
`c`.`name` AS `cachename`,
`c`.`user_id` AS `ownerid`
FROM `cache_reports` AS `cr`
LEFT JOIN `cache_report_reasons` AS `crr` ON `cr`.`reason`=`crr`.`id`
@@ -168,6 +169,7 @@
$tpl->assign('reason', $record['reason']);
$tpl->assign('note', $record['note']);
$tpl->assign('status', $record['status']);
$tpl->assign('created', $record['date_created']);
$tpl->assign('lastmodified', $record['lastmodified']);
$tpl->assign('cachename', $record['cachename']);
$tpl->assign('ownerid', $record['ownerid']);
+1
View File
@@ -58,3 +58,4 @@ date commit ID change
2013-03-20 085c1398 added field caches.listing_last_modified;
must be initialized once via Admin / DB Maintenance / sp_updateall_cache_listingdates
2013-03-24 added table 'pw_dict'
2013-03-25 added field cache_reports.date_created
+9
View File
@@ -1421,4 +1421,13 @@
END IF;
END;");
sql_dropTrigger('cacheReportsBeforeInsert');
sql("CREATE TRIGGER `cacheReportsBeforeInsert` BEFORE INSERT ON `cache_reports`
FOR EACH ROW
BEGIN
/* dont overwrite creation date while XML client is running */
IF ISNULL(@XMLSYNC) OR @XMLSYNC!=1 THEN
SET NEW.`date_created`=NOW();
END IF;
END;");
?>
+1
View File
@@ -2,6 +2,7 @@ SET NAMES 'utf8';
DROP TABLE IF EXISTS `cache_reports`;
CREATE TABLE `cache_reports` (
`id` int(11) unsigned NOT NULL auto_increment,
`date_created` datetime default NULL,
`cacheid` int(11) unsigned NOT NULL,
`userid` int(11) unsigned NOT NULL,
`reason` tinyint(3) unsigned NOT NULL,
+1 -1
View File
@@ -3,4 +3,4 @@ DROP TABLE IF EXISTS `pw_dict`;
CREATE TABLE `pw_dict` (
`pw` varchar(40) NOT NULL,
UNIQUE KEY `pw` (`pw`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
+6 -1
View File
@@ -54,7 +54,12 @@
{/if}
{else}
<p style="line-height: 1.6em;">{t}Details for report of {/t} <a href="viewcache.php?cacheid={$cacheid}" target="_blank">{$cachename|escape}</a> {t} by {/t} <a href="viewprofile.php?userid={$userid}" target="_blank">{$usernick|escape}</a></p>
<p style="line-height: 1.6em;"><b>{t}Last modified{/t}:</b>&nbsp;{$lastmodified|date_format:$opt.format.datelong}</p>
{if $created != null}
<p style="line-height: 1.6em;"><b>{t}Created at{/t}:</b>&nbsp;{$created|date_format:$opt.format.datelong}</p>
{/if}
{if $lastmodified != $created}
<p style="line-height: 1.6em;"><b>{t}Last modified{/t}:</b>&nbsp;{$lastmodified|date_format:$opt.format.datelong}</p>
{/if}
<p style="line-height: 1.6em;"><b>{t}State:{/t}</b>&nbsp;{$status}&nbsp;&nbsp;<b>Admin:</b>&nbsp;{if $adminnick==''}{t}not assigned{/t}{else}{if $otheradmin}<font color="red"><b>{/if}{$adminnick|escape}{if $otheradmin}</b></font>{/if}{/if}</p>
<p style="line-height: 1.6em;"><b>{t}Reason:{/t}</b>&nbsp;{$reason|escape|nl2br}</p>
<p style="line-height: 1.6em;"><b>{t}Comment:{/t}</b>&nbsp;{$note|escape|nl2br}</p>