mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-22 21:40:08 +00:00
Fix log archive time of -1 and add an info box if protocol is disabled.
This commit is contained in:
parent
1979a901a2
commit
fe11589151
@ -1,6 +1,7 @@
|
|||||||
{include file='header' pageTitle='chat.acp.log.title'}
|
{include file='header' pageTitle='chat.acp.log.title'}
|
||||||
|
|
||||||
<script data-relocate="true" src="{$__wcf->getPath('chat')}acp/js/be.bastelstu.Chat.ACP.Log.js?version={PACKAGE_VERSION|rawurlencode}"></script>
|
{if CHAT_LOG_ARCHIVETIME !== 0}
|
||||||
|
<script data-relocate="true" src="{$__wcf->getPath('chat')}acp/js/be.bastelstu.Chat.ACP.Log{if !ENABLE_DEBUG_MODE}.min{/if}.js?version={PACKAGE_VERSION|rawurlencode}"></script>
|
||||||
|
|
||||||
{if $errorField === ''}
|
{if $errorField === ''}
|
||||||
<script data-relocate="true">
|
<script data-relocate="true">
|
||||||
@ -12,12 +13,14 @@
|
|||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
{/if}
|
{/if}
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
|
||||||
<header class="boxHeadline">
|
<header class="boxHeadline">
|
||||||
<h1>{lang}{@$pageTitle}{/lang}</h1>
|
<h1>{lang}{@$pageTitle}{/lang}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
{if CHAT_LOG_ARCHIVETIME !== 0}
|
||||||
<form method="post" action="{link controller='MessageLog' application='chat'}{/link}">
|
<form method="post" action="{link controller='MessageLog' application='chat'}{/link}">
|
||||||
<div class="container containerPadding marginTop">
|
<div class="container containerPadding marginTop">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
@ -94,15 +97,14 @@
|
|||||||
|
|
||||||
{section name=subTabLoop loop=6}
|
{section name=subTabLoop loop=6}
|
||||||
{assign var=subAnchor value='timeTab-'|concat:$contentLoop|concat:'-subTab-'|concat:$subTabLoop}
|
{assign var=subAnchor value='timeTab-'|concat:$contentLoop|concat:'-subTab-'|concat:$subTabLoop}
|
||||||
<div id="{$subAnchor}" class="hidden subTabMenuContent{if !$messages[$contentLoop * 2 + $subTabLoop]|isset} empty{else} tabularBox{/if}">
|
<div id="{$subAnchor}" class="hidden subTabMenuContent empty"></div>
|
||||||
{if $messages[$contentLoop * 2 + $subTabLoop]|isset}
|
{/section}
|
||||||
{include application='chat' file='__messageLogTable' sandbox='true' messages=$messages[$contentLoop * 2 + $subTabLoop]}
|
</div>
|
||||||
|
{/section}
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
{else}
|
||||||
{/section}
|
<p class="error">{lang}chat.acp.log.error.disabled{/lang}</p>
|
||||||
</div>
|
|
||||||
{/section}
|
|
||||||
</div>
|
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{include file='footer'}
|
{include file='footer'}
|
||||||
|
@ -73,7 +73,7 @@ public function readData() {
|
|||||||
throw new \wcf\system\exception\IllegalLinkException();
|
throw new \wcf\system\exception\IllegalLinkException();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->date < strtotime('today 00:00:00 -'.ceil(CHAT_LOG_ARCHIVETIME / 1440).'day')) {
|
if (CHAT_LOG_ARCHIVETIME !== -1 && $this->date < strtotime('today 00:00:00 -'.ceil(CHAT_LOG_ARCHIVETIME / 1440).'day')) {
|
||||||
throw new \wcf\system\exception\IllegalLinkException();
|
throw new \wcf\system\exception\IllegalLinkException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,13 +36,6 @@ class MessageLogPage extends \wcf\page\AbstractPage {
|
|||||||
*/
|
*/
|
||||||
public $errorType = '';
|
public $errorType = '';
|
||||||
|
|
||||||
/**
|
|
||||||
* messages for the given day
|
|
||||||
*
|
|
||||||
* @var array<\chat\data\message\Message>
|
|
||||||
*/
|
|
||||||
public $messages = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* given roomID
|
* given roomID
|
||||||
*
|
*
|
||||||
@ -81,16 +74,8 @@ public function readData() {
|
|||||||
if ($this->date > TIME_NOW) {
|
if ($this->date > TIME_NOW) {
|
||||||
throw new \wcf\system\exception\UserInputException('date', 'inFuture');
|
throw new \wcf\system\exception\UserInputException('date', 'inFuture');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (\wcf\system\exception\UserInputException $e) {
|
|
||||||
$this->errorField = $e->getField();
|
|
||||||
$this->errorType = $e->getType();
|
|
||||||
|
|
||||||
return;
|
if (CHAT_LOG_ARCHIVETIME !== -1 && $this->date < strtotime('today 00:00:00 -'.ceil(CHAT_LOG_ARCHIVETIME / 1440).'day')) {
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
if ($this->date < strtotime('today 00:00:00 -'.ceil(CHAT_LOG_ARCHIVETIME / 1440).'day')) {
|
|
||||||
throw new \wcf\system\exception\UserInputException('date', 'tooLongAgo');
|
throw new \wcf\system\exception\UserInputException('date', 'tooLongAgo');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -100,19 +85,6 @@ public function readData() {
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$messages = \chat\data\message\ViewableMessageList::getMessagesBetween($this->room, $this->date, $this->date + 1799);
|
|
||||||
|
|
||||||
foreach ($messages as $message) {
|
|
||||||
$hour = ((int) date('H', $message->time)) * 2;
|
|
||||||
$minutes = (int) date('i', $message->time);
|
|
||||||
|
|
||||||
if ($minutes >= 30) {
|
|
||||||
$hour += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->messages[$hour][] = $message;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -148,7 +120,6 @@ public function assignVariables() {
|
|||||||
parent::assignVariables();
|
parent::assignVariables();
|
||||||
|
|
||||||
WCF::getTPL()->assign(array(
|
WCF::getTPL()->assign(array(
|
||||||
'messages' => $this->messages,
|
|
||||||
'rooms' => $this->rooms,
|
'rooms' => $this->rooms,
|
||||||
'room' => $this->room,
|
'room' => $this->room,
|
||||||
'date' => $this->date,
|
'date' => $this->date,
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
<item name="chat.acp.log.title"><![CDATA[Nachrichten-Protokoll]]></item>
|
<item name="chat.acp.log.title"><![CDATA[Nachrichten-Protokoll]]></item>
|
||||||
<item name="chat.acp.log.download"><![CDATA[Tages-Protokoll herunterladen]]></item>
|
<item name="chat.acp.log.download"><![CDATA[Tages-Protokoll herunterladen]]></item>
|
||||||
<item name="chat.acp.log.message"><![CDATA[Nachricht]]></item>
|
<item name="chat.acp.log.message"><![CDATA[Nachricht]]></item>
|
||||||
|
<item name="chat.acp.log.error.disabled"><![CDATA[Das Nachrichten-Protokoll ist deaktiviert. Sie können das Protokoll in den Einstellungen („System » Optionen » Chat » Protokoll“) aktivieren.]]></item>
|
||||||
<item name="chat.acp.log.date.error.inFuture"><![CDATA[Das angegebene Datum befindet sich in der Zukunft.]]></item>
|
<item name="chat.acp.log.date.error.inFuture"><![CDATA[Das angegebene Datum befindet sich in der Zukunft.]]></item>
|
||||||
<item name="chat.acp.log.date.error.tooLongAgo"><![CDATA[Das angegebene Datum befindet sich außerhalb der protokollierten Zeitspanne von {CHAT_LOG_ARCHIVETIME / 1440|ceil} Tagen.]]></item>
|
<item name="chat.acp.log.date.error.tooLongAgo"><![CDATA[Das angegebene Datum befindet sich außerhalb der protokollierten Zeitspanne von {CHAT_LOG_ARCHIVETIME / 1440|ceil} Tagen.]]></item>
|
||||||
</category>
|
</category>
|
||||||
|
Loading…
Reference in New Issue
Block a user