direct logentry links to listing+alllogs-page; updates #272

This commit is contained in:
following
2013-07-24 18:21:56 +02:00
parent c5c1427fa4
commit 388ff3da3b
7 changed files with 23 additions and 15 deletions

View File

@ -441,5 +441,18 @@ class picture
return false;
}
function getPageLink()
{
$pl = 'viewcache.php?cacheid=' . urlencode($this->getCacheId());
if ($this->getObjectType() == OBJECT_CACHELOG)
{
if (!$this->isVisibleOnCachePage())
$pl .= "&log=A";
$pl .= "#log" . urlencode($this->getLogId());
}
return $pl;
}
}
?>

View File

@ -133,7 +133,7 @@
else if ($picture->save())
{
if ($redirect == '')
$redirect = 'viewcache.php?cacheid=' . urlencode($picture->getCacheId());
$redirect = $picture->getPageLink();
$tpl->redirect($redirect);
}
else
@ -153,14 +153,7 @@
$tpl->error(ERROR_PICTURE_NOT_EXISTS);
if ($redirect == '')
{
$redirect = 'viewcache.php?cacheid=' . urlencode($picture->getCacheId());
if ($picture->getObjectType() == OBJECT_CACHELOG)
if ($picture->isVisibleOnCachePage())
$redirect .= "#logentries";
else
$redirect = "viewlogs.php?cacheid=" . urlencode($picture->getCacheId()) . "#log" . $picture->getLogId();
}
$redirect = $picture->getPageLink();
if ($picture->allowEdit() == false)
$tpl->error(ERROR_NO_ACCESS);

View File

@ -73,7 +73,7 @@
<td>
{if $newLog.oc_team_comment}<img src="resource2/{$opt.template.style}/images/oclogo/oc-team-comment.png" alt="OC-Team" title="{t}OC team comment{/t}"/>{/if}
{capture name=cachename}
<a href="viewcache.php?wp={$newLog.wp_oc}" {if $newLog.first}class="links"{/if}>{$newLog.cachename|escape}</a>
<a href="viewcache.php?wp={$newLog.wp_oc}&log=A#log{$newLog.id}" {if $newLog.first}class="links"{/if}>{$newLog.cachename|escape}</a>
{/capture}
{capture name=username}
<a href="viewprofile.php?userid={$newLog.user_id}">{$newLog.username|escape}</a>

View File

@ -3,8 +3,9 @@
*
* Unicode Reminder メモ
***************************************************************************}
<div id="log{$logItem.id}">
<div class="content-txtbox-noshade"> {* Ocprop: <div class="content-txtbox-noshade">(.*?)<\/div> *}
<div class="logs" id="log{$logItem.id}">
<div class="logs">
<p class="content-title-noshade-size1" style="display:inline; margin-right:0">
{if $logItem.oc_team_comment}<img src="resource2/{$opt.template.style}/images/oclogo/oc-team-comment.png" alt="OC-Team" title="{t}OC team comment{/t}"/>{/if}
{include file="res_logtype.tpl" type=$logItem.type}
@ -99,3 +100,4 @@
</div>
</div>
</div>
</div>

View File

@ -16,7 +16,7 @@
{else}
{assign var=dateformat value=$opt.format.dm}
{/if}
{if !$loguser}<a href="viewlogs.php?cacheid={$picture.cache_id}#log{$picture.logid}">{/if}{$picture.picdate|date_format:$dateformat}{if !$loguser}</a>{/if}{/if}&nbsp;{if $loguser}<a href="{if $profilelink}viewprofile.php?userid={$picture.user_id}{else}viewlogs.php?cacheid={$picture.cache_id}#log{$picture.logid}{/if}">{$picture.username|escape}</a>
{if !$loguser}<a href="viewcache.php?cacheid={$picture.cache_id}&log=A#log{$picture.logid}">{/if}{$picture.picdate|date_format:$dateformat}{if !$loguser}</a>{/if}{/if}&nbsp;{if $loguser}<a href="{if $profilelink}viewprofile.php?userid={$picture.user_id}{else}viewcache.php?cacheid={$picture.cache_id}&log=A#log{$picture.logid}{/if}">{$picture.username|escape}</a>
{/if}
</div>
{/if}

View File

@ -10,7 +10,7 @@
<td width="74" class="{$listcolor}" rowspan="2" style="padding: 0px">{if $cache.oconly}<img src="resource2/ocstyle/images/misc/is_oconly.png" alt="OConly" title="OConly" style="margin:0px; padding:0px" width="64" height="35" />{/if}</td>
<td width="110" valign="top" class="{$listcolor}"><nobr>
{if $cache.firstlog}
<a href="viewcache.php?cacheid={$cache.cache_id}#logentries">{include file="res_logtype.tpl" type=$cache.firstlog.type}</a><a href="viewcache.php?cacheid={$cache.cache_id}#logentries">{$cache.firstlog.date|date_format:$opt.format.date}</a>&nbsp;
<a href="viewcache.php?cacheid={$cache.cache_id}&log=A#log{$cache.firstlog.id}">{include file="res_logtype.tpl" type=$cache.firstlog.type}</a><a href="viewcache.php?cacheid={$cache.cache_id}&log=A#log{$cache.firstlog.id}">{$cache.firstlog.date|date_format:$opt.format.date}</a>&nbsp;
{else}
<img src="resource2/{$opt.template.style}/images/log/16x16-none.png" width="16" height="16"> --.--.----&nbsp;
{/if}
@ -30,5 +30,5 @@
<a href="viewcache.php?cacheid={$cache.cache_id}&desclang={$desclang|escape}" style="text-decoration:none"><b><span style="color:blue">{$desclang|escape}</span></b></a>
{/foreach}
{$cache.short_desc} &nbsp;</p></td>
<td width="110" class="{$listcolor}" valign="top">{foreach from=$cache.logs item=log}<a href="viewlogs.php?cacheid={$cache.cache_id}#log{$log.id}">{include file="res_logtype.tpl" type=$log.type}</a>&nbsp;{/foreach}</td>
<td width="110" class="{$listcolor}" valign="top">{foreach from=$cache.logs item=log}<a href="viewcache.php?cacheid={$cache.cache_id}&log=A#log{$log.id}">{include file="res_logtype.tpl" type=$log.type}</a>&nbsp;{/foreach}</td>
</tr>

View File

@ -496,7 +496,7 @@
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/action/16x16-showall.png" style="align: left; margin-right: 10px;" width="16" height="16" alt="{t}Show all logentries{/t}" />
[<a href="viewlogs.php?cacheid={$cache.cacheid}">{t}Show all logentries{/t}</a>]
[<a href="viewcache.php?cacheid={$cache.cacheid}&log=A#logentries">{t}Show all logentries{/t}</a>]
</p>
</div>
{/if}