mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +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 = new TicketComment;
|
||||||
$comment->setUser_id($this->user->id);
|
$comment->setUser_id($this->user->id);
|
||||||
$comment->setUser_type(1);
|
$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->setTicket_id($id);
|
||||||
$comment->setCreated(time());
|
$comment->setCreated(time());
|
||||||
$comment->save();
|
$comment->save();
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<p n:if="!$comments">Комментарии отсутствуют</p>
|
<p n:if="!$comments">Комментарии отсутствуют</p>
|
||||||
|
{var $printedSupportGreeting = false}
|
||||||
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
|
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -82,8 +83,22 @@
|
||||||
{/if}
|
{/if}
|
||||||
<div class="post-content" id="{$comment->getId()}">
|
<div class="post-content" id="{$comment->getId()}">
|
||||||
<div class="text" id="text{$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}
|
{$comment->getText()|noescape}
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
{_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}.
|
||||||
|
{else}
|
||||||
|
{$comment->getText()|noescape}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $comment->getUType() === 0}
|
{if $comment->getUType() === 0}
|
||||||
<div class="post-menu">
|
<div class="post-menu">
|
||||||
<a href="/support/comment/{$comment->getId()}/delete">Удалить</a>
|
<a href="/support/comment/{$comment->getId()}/delete">Удалить</a>
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
{/if}
|
{/if}
|
||||||
</br>
|
</br>
|
||||||
<p n:if="!$comments">Комментарии отсутствуют</p>
|
<p n:if="!$comments">Комментарии отсутствуют</p>
|
||||||
|
{var $printedSupportGreeting = false}
|
||||||
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
|
<table n:foreach="$comments as $comment" border="0" style="font-size: 11px;" class="post">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -74,7 +75,20 @@
|
||||||
{/if}
|
{/if}
|
||||||
<div class="post-content" id="{$comment->getId()}">
|
<div class="post-content" id="{$comment->getId()}">
|
||||||
<div class="text" id="text{$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}
|
{$comment->getText()|noescape}
|
||||||
|
<br/>
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
{_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}.
|
||||||
|
{else}
|
||||||
|
{$comment->getText()|noescape}
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{if $comment->getUType() === 0}
|
{if $comment->getUType() === 0}
|
||||||
<div class="post-menu">
|
<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_many" = "$1 голосов";
|
||||||
"coins_other" = "$1 голосов";
|
"coins_other" = "$1 голосов";
|
||||||
|
|
||||||
|
"support_greeting_hi" = "Здравствуйте";
|
||||||
|
"support_greeting_regargs" = "С уважением,<br/>команда поддержки";
|
||||||
|
|
||||||
"comment" = "Комментарий";
|
"comment" = "Комментарий";
|
||||||
"sender" = "Отправитель";
|
"sender" = "Отправитель";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue