mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
Rewrite unholy and annoying support greetings
This commit is contained in:
parent
d1f0dea73a
commit
131988ddf3
5 changed files with 39 additions and 6 deletions
|
@ -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();
|
||||
|
|
|
@ -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,12 +83,26 @@
|
|||
{/if}
|
||||
<div class="post-content" id="{$comment->getId()}">
|
||||
<div class="text" id="text{$comment->getId()}">
|
||||
{$comment->getText()|noescape}
|
||||
{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>
|
||||
</div>
|
||||
<div class="post-menu">
|
||||
<a href="/support/comment/{$comment->getId()}/delete">Удалить</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
@ -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()}">
|
||||
{$comment->getText()|noescape}
|
||||
{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">
|
||||
|
|
1
install/sqls/00012-support-better-greetings.sql
Normal file
1
install/sqls/00012-support-better-greetings.sql
Normal file
|
@ -0,0 +1 @@
|
|||
UPDATE `tickets_comments` SET `text`=REGEXP_REPLACE(`text`, "(?:Здравствуйте, [^!]*!<br><\/br>|<br><\/br>С уважением,<br\/> Команда поддержки OpenVK.)", "") WHERE 1=1;
|
|
@ -528,6 +528,9 @@
|
|||
"coins_many" = "$1 голосов";
|
||||
"coins_other" = "$1 голосов";
|
||||
|
||||
"support_greeting_hi" = "Здравствуйте";
|
||||
"support_greeting_regargs" = "С уважением,<br/>команда поддержки";
|
||||
|
||||
"comment" = "Комментарий";
|
||||
"sender" = "Отправитель";
|
||||
|
||||
|
|
Loading…
Reference in a new issue