diff --git a/Web/Presenters/SupportPresenter.php b/Web/Presenters/SupportPresenter.php index 5ed04efc..ac680ff7 100644 --- a/Web/Presenters/SupportPresenter.php +++ b/Web/Presenters/SupportPresenter.php @@ -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().'!

'.$this->postParam("text").'

С уважением,
Команда поддержки OpenVK.'); + $comment->setText($this->postParam("text")); $comment->setTicket_id($id); $comment->setCreated(time()); $comment->save(); diff --git a/Web/Presenters/templates/Support/AnswerTicket.xml b/Web/Presenters/templates/Support/AnswerTicket.xml index 200b8ca2..2e063f4a 100644 --- a/Web/Presenters/templates/Support/AnswerTicket.xml +++ b/Web/Presenters/templates/Support/AnswerTicket.xml @@ -40,6 +40,7 @@

Комментарии отсутствуют

+{var $printedSupportGreeting = false} @@ -82,12 +83,26 @@ {/if}
- {$comment->getText()|noescape} + {if $comment->getUType() === 1 && !$printedSupportGreeting) + {var $printedSupportGreeting = true} + {_support_greeting_hi}, {$ticket->getUser()->getFullName()}! +
+
+ + {$comment->getText()|noescape} +
+
+ + {_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}. + {else} + {$comment->getText()|noescape} + {/if}
+ {if $comment->getUType() === 0} -
- Удалить -
+
+ Удалить +
{/if}
diff --git a/Web/Presenters/templates/Support/View.xml b/Web/Presenters/templates/Support/View.xml index 8031378c..a9fcaf29 100644 --- a/Web/Presenters/templates/Support/View.xml +++ b/Web/Presenters/templates/Support/View.xml @@ -39,6 +39,7 @@ {/if}

Комментарии отсутствуют

+{var $printedSupportGreeting = false}
@@ -74,7 +75,20 @@ {/if}
- {$comment->getText()|noescape} + {if $comment->getUType() === 1 && !$printedSupportGreeting) + {var $printedSupportGreeting = true} + {_support_greeting_hi}, {$ticket->getUser()->getFullName()}! +
+
+ + {$comment->getText()|noescape} +
+
+ + {_support_greeting_regargs} {=OPENVK_ROOT_CONF["openvk"]["appearance"]["name"]}. + {else} + {$comment->getText()|noescape} + {/if}
{if $comment->getUType() === 0}
diff --git a/install/sqls/00012-support-better-greetings.sql b/install/sqls/00012-support-better-greetings.sql new file mode 100644 index 00000000..db41733f --- /dev/null +++ b/install/sqls/00012-support-better-greetings.sql @@ -0,0 +1 @@ +UPDATE `tickets_comments` SET `text`=REGEXP_REPLACE(`text`, "(?:Здравствуйте, [^!]*!
<\/br>|
<\/br>С уважением, Команда поддержки OpenVK.)", "") WHERE 1=1; diff --git a/locales/ru.strings b/locales/ru.strings index 1dc14563..7e175268 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -528,6 +528,9 @@ "coins_many" = "$1 голосов"; "coins_other" = "$1 голосов"; +"support_greeting_hi" = "Здравствуйте"; +"support_greeting_regargs" = "С уважением,
команда поддержки"; + "comment" = "Комментарий"; "sender" = "Отправитель";