Skip to content
Permalink
Browse files

added coordinate history to admin cache history; updates #744

  • Loading branch information...
following5 committed Jul 18, 2015
1 parent 00943d2 commit 3692289e7db29010ec2d0cc8f858d68fa8bc12f4
@@ -2661,6 +2661,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2223', 'semi-pu
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2224', 'listing display', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2225', 'without Geokrets', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2226', 'hidden[cachelist]', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2227', 'Coordinate changes', '2013-11-03 10:09:14');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2224', 'DE', 'Listinganzeige', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2225', 'DE', 'ohne Geokrets', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2226', 'DE', 'ausgeblendet', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2227', 'DE', 'Koordinatenänderungen', '2013-11-03 10:09:14');

INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
@@ -551,6 +551,28 @@ function setTplHistoryData($exclude_report_id)
$tpl->assign_rs('status_changes',$rs);
sql_free_result($rs);
// coordinate changes
$rs = sql("SELECT `cc`.`date_created`, `cc`.`longitude`, `cc`.`latitude`,
IFNULL(`admin`.`user_id`, `owner`.`user_id`) AS `user_id`,
IFNULL(`admin`.`username`, `owner`.`username`) AS `username`
FROM `cache_coordinates` `cc`
LEFT JOIN `caches` ON `caches`.`cache_id`=`cc`.`cache_id`
LEFT JOIN `user` `owner` ON `owner`.`user_id`=`caches`.`user_id`
LEFT JOIN `user` `admin` ON `admin`.`user_id`=`cc`.`restored_by`
WHERE `cc`.`cache_id`='&1'
ORDER BY `cc`.`date_created` DESC", $this->getCacheId());
$coords = array();
while ($rCoord = sql_fetch_assoc($rs))
{
$coord = new coordinate($rCoord['latitude'], $rCoord['longitude']);
$coords[] = array('date' => $rCoord['date_created'],
'coord' => $coord->getDecimalMinutes(),
'user_id' => $rCoord['user_id'],
'username' => $rCoord['username']);
}
sql_free_result($rs);
$tpl->assign('coordinates', $coords);
// Adoptions
$rs = sql("SELECT `cache_adoptions`.`date`,
`cache_adoptions`.`from_user_id`,
Binary file not shown.
@@ -83,7 +83,7 @@
{if !$reportdisplay || $status_changes|@count}
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/description/22x22-logs.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/{$opt.template.style}/images/viewcache/16x16-maintenance.png" style="align: left; margin-right: 10px;" width="16" height="16" alt="" />
{t}Status changes{/t} <small>{t}since June 2013{/t}</small>
</p>
</div>
@@ -109,10 +109,43 @@
<p>&nbsp;</p>
{/if}

{if !$reportdisplay || $coordinates|@count > 1}
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/description/20x20-compass.png" style="align: left; margin-right: 10px;" width="20" height="20" alt="" />
{t}Coordinate changes{/t}
</p>
</div>

<table class="table" width="90%">
{if $coordinates|@count > 1}
<tr>
<th>{t}Date{/t}</th>
<th>{t}Coordinates{/t}</th>
<th>{t}Changed by{/t}</th>
</tr>
{assign var=n value=0}
{foreach from=$coordinates item=coord}
<tr>
<td width="20%">{$coord.date|date_format:$opt.format.date}</td>
<td>{$coord.coord.lat|escape} {$coord.coord.lon|escape}</td>
{assign var=n value=$n+1}
{if $n < $coordinates|@count}
<td><a href="viewprofile.php?userid={$coord.user_id}">{$coord.username}</a></td>
{/if}
</tr>
{/foreach}
{else}
<tr><td></td></tr>
{/if}
</table>
<p>&nbsp;</p>
{/if}

{if !$reportdisplay || $adoptions|@count}
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/description/22x22-logs.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/{$opt.template.style}/images/profile/32x32-adopt.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Adoptions_{/t} <small>{t}since September 2012{/t}</small>
</p>
</div>

0 comments on commit 3692289

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