Rewrite unholy and annoying support greetings

This commit is contained in:
Celestora 2021-11-25 21:20:52 +02:00
parent d1f0dea73a
commit 131988ddf3
5 changed files with 39 additions and 6 deletions

View file

@ -181,7 +181,7 @@ final class SupportPresenter extends OpenVKPresenter
$comment = new TicketComment;
$comment->setUser_id($this->user->id);
$comment->setUser_type(1);
$comment->setText('Здравствуйте, '.$ticket->getUser()->getFirstName().'!<br></br>'.$this->postParam("text").'<br></br>С уважением,<br/> Команда поддержки OpenVK.');
$comment->setText($this->postParam("text"));
$comment->setTicket_id($id);
$comment->setCreated(time());
$comment->save();

View file

@ -40,6 +40,7 @@
</div>
<br/>
<p n:if="!$comments">Комментарии отсутствуют</p>
{var $printedSupportGreeting = false}
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
<tbody>
<tr>
@ -82,8 +83,22 @@
{/if}
<div class="post-content" id="{$comment->getId()}">
<div class="text" id="text{$comment->getId()}">
{if $comment->getUType() === 1 && !$printedSupportGreeting)
{var $printedSupportGreeting = true}
{_support_greeting_hi}, {$ticket->getUser()->getFullName()}!
<br/>
<br/>
{$comment->getText()|noescape}
<br/>
<br/>
{_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}.
{else}
{$comment->getText()|noescape}
{/if}
</div>
{if $comment->getUType() === 0}
<div class="post-menu">
<a href="/support/comment/{$comment->getId()}/delete">Удалить</a>

View file

@ -39,6 +39,7 @@
{/if}
</br>
<p n:if="!$comments">Комментарии отсутствуют</p>
{var $printedSupportGreeting = false}
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
<tbody>
<tr>
@ -74,7 +75,20 @@
{/if}
<div class="post-content" id="{$comment->getId()}">
<div class="text" id="text{$comment->getId()}">
{if $comment->getUType() === 1 && !$printedSupportGreeting)
{var $printedSupportGreeting = true}
{_support_greeting_hi}, {$ticket->getUser()->getFullName()}!
<br/>
<br/>
{$comment->getText()|noescape}
<br/>
<br/>
{_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}.
{else}
{$comment->getText()|noescape}
{/if}
</div>
{if $comment->getUType() === 0}
<div class="post-menu">

View file

@ -0,0 +1 @@
UPDATE `tickets_comments` SET `text`=REGEXP_REPLACE(`text`, "(?:Здравствуйте, [^!]*!<br><\/br>|<br><\/br>С уважением,<br\/> Команда поддержки OpenVK.)", "") WHERE 1=1;

View file

@ -528,6 +528,9 @@
"coins_many" = "$1 голосов";
"coins_other" = "$1 голосов";
"support_greeting_hi" = "Здравствуйте";
"support_greeting_regargs" = "С уважением,<br/>команда поддержки";
"comment" = "Комментарий";
"sender" = "Отправитель";