From 8654433702e825de4a0e8bebe984eb665ba960a9 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Date: Wed, 14 Nov 2018 22:53:46 -0300 Subject: [PATCH] Add email template image header edition --- .../settings/admin-panel-email-templates.js | 54 +++++++++++++++---- .../settings/admin-panel-email-templates.scss | 11 ++++ client/src/data/languages/br.js | 3 ++ client/src/data/languages/cn.js | 3 ++ client/src/data/languages/de.js | 3 ++ client/src/data/languages/en.js | 3 ++ client/src/data/languages/es.js | 5 +- client/src/data/languages/fr.js | 3 ++ client/src/data/languages/gr.js | 3 ++ client/src/data/languages/in.js | 3 ++ client/src/data/languages/it.js | 3 ++ client/src/data/languages/jp.js | 3 ++ client/src/data/languages/nl.js | 3 ++ client/src/data/languages/pt.js | 3 ++ client/src/data/languages/ru.js | 3 ++ client/src/data/languages/tr.js | 3 ++ server/controllers/system/edit-settings.php | 3 +- server/controllers/system/get-settings.php | 5 +- server/controllers/system/init-settings.php | 3 +- server/data/mail-templates/ticket-closed.html | 4 +- .../mail-templates/ticket-created-staff.html | 4 +- .../data/mail-templates/ticket-created.html | 4 +- .../data/mail-templates/ticket-responded.html | 4 +- .../data/mail-templates/user-edit-email.html | 4 +- .../mail-templates/user-edit-password.html | 4 +- .../mail-templates/user-password-forgot.html | 4 +- server/data/mail-templates/user-signup.html | 4 +- .../mail-templates/user-system-disabled.html | 4 +- .../mail-templates/user-system-enabled.html | 4 +- server/models/MailTemplate.php | 3 ++ 30 files changed, 129 insertions(+), 34 deletions(-) diff --git a/client/src/app/admin/panel/settings/admin-panel-email-templates.js b/client/src/app/admin/panel/settings/admin-panel-email-templates.js index ce3e9372..b659510b 100644 --- a/client/src/app/admin/panel/settings/admin-panel-email-templates.js +++ b/client/src/app/admin/panel/settings/admin-panel-email-templates.js @@ -1,5 +1,6 @@ import React from 'react'; import _ from 'lodash'; +import {connect} from 'react-redux'; import i18n from 'lib-app/i18n'; import API from 'lib-app/api-call'; @@ -18,6 +19,8 @@ import SubmitButton from 'core-components/submit-button'; class AdminPanelEmailTemplates extends React.Component { state = { + headerImage: '', + loadingHeaderImage: false, loadingList: true, loadingTemplate: false, templates: [], @@ -36,6 +39,7 @@ class AdminPanelEmailTemplates extends React.Component { componentDidMount() { this.retrieveMailTemplateList(); + this.retrieveHeaderImage(); } render() { @@ -49,11 +53,19 @@ class AdminPanelEmailTemplates extends React.Component { renderContent() { return ( -
-
- +
+
+
+ +
+ {(this.state.selectedIndex != -1) ? this.renderForm() : null}
- {(this.state.selectedIndex != -1) ? this.renderForm() : null} +
this.setState({headerImage: form.headerImage})} onSubmit={this.onHeaderImageSubmit.bind(this)}> +
+ + {i18n('SAVE')} +
+
); } @@ -148,6 +160,21 @@ class AdminPanelEmailTemplates extends React.Component { } } + onHeaderImageSubmit(form) { + this.setState({ + loadingHeaderImage: true, + }); + + API.call({ + path: '/system/edit-settings', + data: { + 'mail-template-header-image': form['headerImage'] + } + }).then(() => this.setState({ + loadingHeaderImage: false, + })) + } + onFormSubmit(form) { const {selectedIndex, language, templates} = this.state; @@ -169,26 +196,26 @@ class AdminPanelEmailTemplates extends React.Component { this.setState({ loadingForm: false, }); - + switch(response.message) { case 'INVALID_SUBJECT': this.setState({ - errors: {subject: 'Invalid syntax'} + errors: {subject: i18n('INVALID_SYNTAX')} }); break; case 'INVALID_TEXT_1': this.setState({ - errors: {text1: 'Invalid syntax'} + errors: {text1: i18n('INVALID_SYNTAX')} }); break; case 'INVALID_TEXT_2': this.setState({ - errors: {text2: 'Invalid syntax'} + errors: {text2: i18n('INVALID_SYNTAX')} }); break; case 'INVALID_TEXT_3': this.setState({ - errors: {text3: 'Invalid syntax'} + errors: {text3: i18n('INVALID_SYNTAX')} }); break; } @@ -246,6 +273,15 @@ class AdminPanelEmailTemplates extends React.Component { templates: result.data })); } + + retrieveHeaderImage() { + API.call({ + path: '/system/get-settings', + data: {allSettings: 1} + }).then(result => this.setState({ + headerImage: result.data['mail-template-header-image'] + })); + } } export default AdminPanelEmailTemplates; diff --git a/client/src/app/admin/panel/settings/admin-panel-email-templates.scss b/client/src/app/admin/panel/settings/admin-panel-email-templates.scss index 2b7ade6b..3ee1bd2f 100644 --- a/client/src/app/admin/panel/settings/admin-panel-email-templates.scss +++ b/client/src/app/admin/panel/settings/admin-panel-email-templates.scss @@ -1,3 +1,5 @@ +@import "../../../../scss/vars"; + .admin-panel-email-templates { &__text-area { @@ -23,4 +25,13 @@ display: inline-block; margin-left: 10px; } + + &__image-container { + background-color: $very-light-grey; + display: flex; + justify-content: space-between; + align-items: center; + padding: 5px 20px; + margin-top: 20px; + } } diff --git a/client/src/data/languages/br.js b/client/src/data/languages/br.js index dd90c3cb..d5679841 100644 --- a/client/src/data/languages/br.js +++ b/client/src/data/languages/br.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Inicio', 'TICKET_NUMBER': 'Número do chamado', 'NEXT': 'Próximo', + 'SUBJECT': 'Sujeito', 'SEND_EMAIL_ON_NEW_TICKET': 'Enviar email para cada novo ticket', 'STAFF_UPDATED': 'Membro da equipe atualizado', 'UPDATE': 'Atualizar', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privado', 'ENABLE_USER': 'Ativar usuário', 'DISABLE_USER': 'Desativar usuário', + 'IMAGE_HEADER_URL': 'URL do cabeçalho da imagem', 'CHART_CREATE_TICKET': 'Chamados criados', 'CHART_CLOSE': 'Chamados fechados', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Erros encontrados', 'ERROR_IMAGE_SIZE': 'Nenhuma imagem pode ter um tamanho maior que {size} MB', 'USER_DISABLED': 'Esta conta está desativada.', + 'INVALID_SYNTAX': 'Sintaxe inválida.', //MESSAGES 'SIGNUP_SUCCESS': 'Você se registrou com sucesso em nosso sistema de suporte.', diff --git a/client/src/data/languages/cn.js b/client/src/data/languages/cn.js index 1927a8f4..b2158680 100644 --- a/client/src/data/languages/cn.js +++ b/client/src/data/languages/cn.js @@ -177,6 +177,7 @@ export default { 'HOME': '家', 'TICKET_NUMBER': '票號', 'NEXT': '下一個', + 'SUBJECT': '学科', 'SEND_EMAIL_ON_NEW_TICKET': '电子邮件为每个新票', 'STAFF_UPDATED': '工作人员已更新', 'UPDATE': '更新', @@ -187,6 +188,7 @@ export default { 'PRIVATE': '私人的', 'ENABLE_USER': '启用用户', 'DISABLE_USER': '禁用用户', + 'IMAGE_HEADER_URL': '图片标题网址', 'CHART_CREATE_TICKET': '已創建門票', 'CHART_CLOSE': '門票已關閉', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': '發現錯誤', 'ERROR_IMAGE_SIZE': '没有图像的大小可以超过{size}MB', 'USER_DISABLED': '此帐户已被停用。', + 'INVALID_SYNTAX': '无效的语法。', //MESSAGES 'SIGNUP_SUCCESS': '您已在我們的支持系統中成功註冊', diff --git a/client/src/data/languages/de.js b/client/src/data/languages/de.js index bc04b41a..b291d9af 100644 --- a/client/src/data/languages/de.js +++ b/client/src/data/languages/de.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Home', 'TICKET_NUMBER': 'Ticketnummer', 'NEXT': 'Nächstes', + 'SUBJECT': 'Gegenstand', 'SEND_EMAIL_ON_NEW_TICKET': 'E-Mail für jedes neues Ticket', 'STAFF_UPDATED': 'Mitarbeiter wurde aktualisiert', 'UPDATE': 'Aktualisierung', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'Privatgelände', 'ENABLE_USER': 'Benutzer aktivieren', 'DISABLE_USER': 'Benutzer deaktivieren', + 'IMAGE_HEADER_URL': 'URL des Image-Headers', 'CHART_CREATE_TICKET': 'Tickets erstellt', 'CHART_CLOSE': 'Tickets geschlossen', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Fehler gefunden!', 'ERROR_IMAGE_SIZE': 'Kein Bild darf größer als {size} MB sein', 'USER_DISABLED': 'Dieser Account ist deaktiviert.', + 'INVALID_SYNTAX': 'Ungültiger Satzbau.', //MESSAGES 'SIGNUP_SUCCESS': 'Sie haben sich erfolgreich in unserem Support-System registriert.', diff --git a/client/src/data/languages/en.js b/client/src/data/languages/en.js index fa7cbaef..39ca0115 100644 --- a/client/src/data/languages/en.js +++ b/client/src/data/languages/en.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Home', 'TICKET_NUMBER': 'Ticket number', 'NEXT': 'Next', + 'SUBJECT': 'Subject', 'SEND_EMAIL_ON_NEW_TICKET': 'Send email on new ticket', 'STAFF_UPDATED': 'Staff member has been updated', 'UPDATE': 'Update', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'Private', 'ENABLE_USER': 'Enable User', 'DISABLE_USER': 'Disable User', + 'IMAGE_HEADER_URL': 'Image header URL', 'CHART_CREATE_TICKET': 'Tickets created', 'CHART_CLOSE': 'Tickets closed', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Errors found', 'ERROR_IMAGE_SIZE': 'No image can have a size greater than {size} MB', 'USER_DISABLED': 'This account is disabled.', + 'INVALID_SYNTAX': 'Invalid syntax.', //MESSAGES 'SIGNUP_SUCCESS': 'You have registered successfully in our support system.', diff --git a/client/src/data/languages/es.js b/client/src/data/languages/es.js index 957f536f..aaf71692 100644 --- a/client/src/data/languages/es.js +++ b/client/src/data/languages/es.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Inicio', 'TICKET_NUMBER': 'Número de Ticket', 'NEXT': 'Siguiente', + 'SUBJECT': 'Asunto', 'SEND_EMAIL_ON_NEW_TICKET': 'Enviar email por cada nuevo ticket', 'STAFF_UPDATED': 'Miembro de Staff actualizado', 'UPDATE': 'Actualizar', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privado', 'ENABLE_USER': 'Habilitar usuario', 'DISABLE_USER': 'Deshabilitar usuario', + 'IMAGE_HEADER_URL': 'URL del encabezado de la imagen', 'CHART_CREATE_TICKET': 'Tickets creados', 'CHART_CLOSE': 'Tickets cerrados', @@ -330,6 +332,8 @@ export default { 'INVALID_EMAIL_OR_TICKET_NUMBER': 'Email o numero de ticket inválido', 'INVALID_FILE': 'Archivo inválido', 'ERRORS_FOUND': 'Se encontraron errores', + 'USER_DISABLED': 'Esta cuenta está deshabilitada.', + 'INVALID_SYNTAX': 'Sintaxis inválida.', //MESSAGES 'SIGNUP_SUCCESS': 'Se ha registrado con éxito en nuestro sistema de soporte.', @@ -356,7 +360,6 @@ export default { 'SUCCESS_IMPORTING_CSV_DESCRIPTION': 'El archivo CSV se ha importado correctamente', 'SUCCESS_DELETING_ALL_USERS': 'Los usuarios se han eliminado correctamente', 'ERROR_IMAGE_SIZE': 'Ninguna imagen puede tener un tamaño superior a {size} MB', - 'USER_DISABLED': 'Esta cuenta está deshabilitada.', 'LAST_7_DAYS': 'Últimos 7 dias', 'LAST_30_DAYS': 'Últimos 30 dias', diff --git a/client/src/data/languages/fr.js b/client/src/data/languages/fr.js index bfe97276..480c5979 100644 --- a/client/src/data/languages/fr.js +++ b/client/src/data/languages/fr.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Accueil', 'TICKET_NUMBER': 'Numéro de ticket', 'NEXT': 'Suivant', + 'SUBJECT': 'Assujettir', 'SEND_EMAIL_ON_NEW_TICKET': 'Envoyer un e-mail pour chaque nouveau ticket', 'STAFF_UPDATED': 'Le membre du personnel a été mis à jour', 'UPDATE': 'Mettre à jour', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privé', 'ENABLE_USER': 'Activer l\'utilisateur', 'DISABLE_USER': 'Désactiver l\'utilisateur', + 'IMAGE_HEADER_URL': 'URL de l\'en-tête de l\'image', 'CHART_CREATE_TICKET': 'Tickets créés', 'CHART_CLOSE': 'Tickets fermés', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Des erreurs sont survenues', 'ERROR_IMAGE_SIZE': 'Aucune image ne peut avoir une taille supérieure à {size} MB', 'USER_DISABLED': 'Ce compte est désactivé.', + 'INVALID_SYNTAX': 'Syntaxe invalide.', //MESSAGES 'SIGNUP_SUCCESS': 'Vous êtes inscrit avec succès dans notre système de support.', diff --git a/client/src/data/languages/gr.js b/client/src/data/languages/gr.js index 4c3e89ba..e5b97abb 100644 --- a/client/src/data/languages/gr.js +++ b/client/src/data/languages/gr.js @@ -177,6 +177,7 @@ 'HOME': 'Σπίτι', 'TICKET_NUMBER': 'Αριθμός εισιτηρίου', 'NEXT': 'Επόμενο', + 'SUBJECT': 'Θέμα', 'SEND_EMAIL_ON_NEW_TICKET': 'Στείλτε μήνυμα ηλκετορνικού ταχυδρομείου στο νέο εισιτήριο', 'STAFF_UPDATED': 'Το μέλος προσωπικού έχει ενημερωθεί', 'UPDATE': 'Ενημέρωση', @@ -187,6 +188,7 @@ 'PRIVATE': 'ιδιωτικός', 'ENABLE_USER': 'Ενεργοποίηση χρήστη', 'DISABLE_USER': 'Απενεργοποίηση χρήστη', + 'IMAGE_HEADER_URL': 'Διεύθυνση URL κεφαλίδας εικόνας', 'CHART_CREATE_TICKET': 'Τα εισιτήρια δημιουργήθηκαν', 'CHART_CLOSE': 'Τα εισιτήρια κλείσανε', @@ -332,6 +334,7 @@ 'ERRORS_FOUND': 'Βρέθηκαν Σφάλματα', 'ERROR_IMAGE_SIZE': 'Καμία εικόνα δεν μπορεί να έχει μέγεθος μεγαλύτερο από {size} MB', 'USER_DISABLED': 'Αυτός ο λογαριασμός είναι απενεργοποιημένος.', + 'INVALID_SYNTAX': 'Μη έγκυρη σύνταξη.', //MESSAGES 'SIGNUP_SUCCESS': 'Έχετε εγγραφεί με επιτυχία στο σύστημα υποστήριξης μας.', diff --git a/client/src/data/languages/in.js b/client/src/data/languages/in.js index bf38b957..a5fe8524 100644 --- a/client/src/data/languages/in.js +++ b/client/src/data/languages/in.js @@ -177,6 +177,7 @@ export default { 'HOME': 'घर', 'TICKET_NUMBER': 'टिकट नंबर', 'NEXT': 'आगामी', + 'SUBJECT': 'विषय', 'SEND_EMAIL_ON_NEW_TICKET': 'एक ईमेल भेजने के लिए प्रत्येक नए टिकट', 'STAFF_UPDATED': 'स्टाफ सदस्य को अद्यतन किया गया है', 'UPDATE': 'अद्यतन', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'निजी', 'ENABLE_USER': 'उपयोगकर्ता सक्षम करें', 'DISABLE_USER': 'उपयोगकर्ता को अक्षम करें', + 'IMAGE_HEADER_URL': 'छवि शीर्षलेख यूआरएल', 'CHART_CREATE_TICKET': 'टिकट बनाया', 'CHART_CLOSE': 'टिकट बंद कर दिया', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'त्रुटियां मिलीं', 'ERROR_IMAGE_SIZE': 'कोई छवि {size} एमबी से अधिक आकार नहीं हो सकती है', 'USER_DISABLED': 'यह खाता अक्षम है।', + 'INVALID_SYNTAX': 'अवैध वाक्य रचना।', //MESSAGES 'SIGNUP_SUCCESS': 'आप हमारे समर्थन प्रणाली में सफलतापूर्वक दर्ज कर लिया है।', diff --git a/client/src/data/languages/it.js b/client/src/data/languages/it.js index 001867b2..86c9efb3 100644 --- a/client/src/data/languages/it.js +++ b/client/src/data/languages/it.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Home', 'TICKET_NUMBER': 'Ticket numero', 'NEXT': 'Prossimo', + 'SUBJECT': 'Soggetto', 'SEND_EMAIL_ON_NEW_TICKET': 'Invia e-mail al nuovo ticket', 'STAFF_UPDATED': 'Il membro del personale è stato aggiornato', 'UPDATE': 'Aggiornare', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privato', 'ENABLE_USER': 'Abilita utente', 'DISABLE_USER': 'Disabilita utente', + 'IMAGE_HEADER_URL': 'URL dell\'intestazione dell\'immagine', 'CHART_CREATE_TICKET': 'Tickets creato', 'CHART_CLOSE': 'Tickets chiuso', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Trovati errori', 'ERROR_IMAGE_SIZE': 'Nessuna immagine può avere una dimensione superiore a {size} MB', 'USER_DISABLED': 'Questo account è disabilitato.', + 'INVALID_SYNTAX': 'Sintassi non valida.', //MESSAGES 'SIGNUP_SUCCESS': 'È stato registrato con successo nel nostro sistema di supporto.', diff --git a/client/src/data/languages/jp.js b/client/src/data/languages/jp.js index 77f35216..9cc7489e 100644 --- a/client/src/data/languages/jp.js +++ b/client/src/data/languages/jp.js @@ -177,6 +177,7 @@ export default { 'HOME': 'ホーム', 'TICKET_NUMBER': 'チケット番号', 'NEXT': '次', + 'SUBJECT': '件名', 'SEND_EMAIL_ON_NEW_TICKET': 'メールを送信毎に新しいチケット', 'STAFF_UPDATED': 'スタッフメンバーが更新されました', 'UPDATE': '更新', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'プライベート', 'ENABLE_USER': 'ユーザーを有効にする', 'DISABLE_USER': 'ユーザーを無効にする', + 'IMAGE_HEADER_URL': '画像のヘッダーURL', 'CHART_CREATE_TICKET': '作成されたチケット', 'CHART_CLOSE': 'チケットが閉じられました', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'エラーが見つかりました', 'ERROR_IMAGE_SIZE': 'イメージのサイズが{size} MBを超えることはできません', 'USER_DISABLED': 'このアカウントは無効です。', + 'INVALID_SYNTAX': '無効な構文。', //MESSAGES 'SIGNUP_SUCCESS': 'あなたは私たちのサポートシステムに正常に登録しました。', diff --git a/client/src/data/languages/nl.js b/client/src/data/languages/nl.js index df5daa20..72cea7e1 100644 --- a/client/src/data/languages/nl.js +++ b/client/src/data/languages/nl.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Home', 'TICKET_NUMBER': 'Incidentnummer', 'NEXT': 'Volgende', + 'SUBJECT': 'Bedrijf', 'SEND_EMAIL_ON_NEW_TICKET': 'Stuur e-mail bij nieuw incident', 'STAFF_UPDATED': 'Medewerker is gewijzigd', 'UPDATE': 'Update', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privaat', 'ENABLE_USER': 'Schakel gebruiker in', 'DISABLE_USER': 'Gebruiker uitschakelen', + 'IMAGE_HEADER_URL': 'Image header URL', 'CHART_CREATE_TICKET': 'Aangemaakte incidenten', 'CHART_CLOSE': 'Gesloten incidenten', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Er is een fout opgetreden', 'ERROR_IMAGE_SIZE': 'Geen enkele afbeelding kan groter zijn dan {size} MB', 'USER_DISABLED': 'Dit account is uitgeschakeld.', + 'INVALID_SYNTAX': 'Ongeldige syntaxis.', //MESSAGES 'SIGNUP_SUCCESS': 'U hebt zich succesvol geregistreerd in ons ondersteuningssysteem.', diff --git a/client/src/data/languages/pt.js b/client/src/data/languages/pt.js index f7c338d8..7e323c17 100644 --- a/client/src/data/languages/pt.js +++ b/client/src/data/languages/pt.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Casa', 'TICKET_NUMBER': 'Número do bilhete', 'NEXT': 'Próximo', + 'SUBJECT': 'Sujeito', 'SEND_EMAIL_ON_NEW_TICKET': 'Enviar email para cada novo ticket', 'STAFF_UPDATED': 'Membro da equipe foi atualizado', 'UPDATE': 'Actualizar', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'privado', 'ENABLE_USER': 'Ativar usuário', 'DISABLE_USER': 'Desativar usuário', + 'IMAGE_HEADER_URL': 'URL do cabeçalho da imagem', 'CHART_CREATE_TICKET': 'Ingressos criados', 'CHART_CLOSE': 'Ingressos fechados', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Erros encontrados', 'ERROR_IMAGE_SIZE': 'Nenhuma imagem pode ter um tamanho maior que {size} MB', 'USER_DISABLED': 'Esta conta está desativada.', + 'INVALID_SYNTAX': 'Sintaxe inválida.', //MESSAGES 'SIGNUP_SUCCESS': 'Você se registrou com sucesso em nosso sistema de suporte.', diff --git a/client/src/data/languages/ru.js b/client/src/data/languages/ru.js index 1da1eb24..a4eb3f83 100644 --- a/client/src/data/languages/ru.js +++ b/client/src/data/languages/ru.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Главная', 'TICKET_NUMBER': 'Номер билета', 'NEXT': 'следующий', + 'SUBJECT': 'Предмет', 'SEND_EMAIL_ON_NEW_TICKET': 'Отправить письмо на новый билет', 'STAFF_UPDATED': 'Сотрудник обновлен', 'UPDATE': 'Обновить', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'частный', 'ENABLE_USER': 'Включить пользователя', 'DISABLE_USER': 'Отключить пользователя', + 'IMAGE_HEADER_URL': 'URL заголовка изображения', 'CHART_CREATE_TICKET': 'Билеты создано', 'CHART_CLOSE': ' Билеты закрыты', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Ошибки найдены', 'ERROR_IMAGE_SIZE': 'Изображение не может иметь размер больше {size} МБ', 'USER_DISABLED': 'Эта учетная запись отключена.', + 'INVALID_SYNTAX': 'Недопустимый синтаксис.', //MESSAGES 'SIGNUP_SUCCESS': 'Вы успешно зарегистрировались в нашей системе поддержки.', diff --git a/client/src/data/languages/tr.js b/client/src/data/languages/tr.js index 404ff4b4..47fbe9eb 100644 --- a/client/src/data/languages/tr.js +++ b/client/src/data/languages/tr.js @@ -177,6 +177,7 @@ export default { 'HOME': 'Ev', 'TICKET_NUMBER': 'Bilet numarası', 'NEXT': 'Sonraki', + 'SUBJECT': 'konu', 'SEND_EMAIL_ON_NEW_TICKET': 'Yeni biletle e-posta gönder', 'STAFF_UPDATED': 'Çalışanlar güncellendi', 'UPDATE': 'Güncelleştirme', @@ -187,6 +188,7 @@ export default { 'PRIVATE': 'gizli', 'ENABLE_USER': 'Kullanıcıyı Etkinleştir', 'DISABLE_USER': 'Kullanıcıyı Devre Dışı Bırak', + 'IMAGE_HEADER_URL': 'Resim başlığı URL\'si', 'CHART_CREATE_TICKET': 'Biletler oluşturuldu', 'CHART_CLOSE': 'Biletler kapandı', @@ -332,6 +334,7 @@ export default { 'ERRORS_FOUND': 'Hatalar bulundu', 'ERROR_IMAGE_SIZE': 'Hiçbir resmin boyutu {size} MB\'den büyük olabilir', 'USER_DISABLED': 'Bu hesap devre dışı.', + 'INVALID_SYNTAX': 'Geçersiz sözdizimi.', //MESSAGES 'SIGNUP_SUCCESS': 'Destek sistemimize başarılı bir şekilde kayıt oldunuz.', diff --git a/server/controllers/system/edit-settings.php b/server/controllers/system/edit-settings.php index 3a47a027..51157fa7 100755 --- a/server/controllers/system/edit-settings.php +++ b/server/controllers/system/edit-settings.php @@ -49,7 +49,8 @@ class EditSettingsController extends Controller { 'allow-attachments', 'max-size', 'title', - 'url' + 'url', + 'mail-template-header-image' ]; foreach($settings as $setting) { diff --git a/server/controllers/system/get-settings.php b/server/controllers/system/get-settings.php index 5dcd636b..3dcf7ca8 100755 --- a/server/controllers/system/get-settings.php +++ b/server/controllers/system/get-settings.php @@ -53,7 +53,8 @@ class GetSettingsController extends Controller { 'departments' => Department::getDepartmentNames(), 'supportedLanguages' => Language::getSupportedLanguages(), 'allowedLanguages' => Language::getAllowedLanguages(), - 'session-prefix' => Setting::getSetting('session-prefix') + 'session-prefix' => Setting::getSetting('session-prefix')->getValue(), + 'mail-template-header-image' => Setting::getSetting('mail-template-header-image')->getValue() ]; } else { $settingsList = [ @@ -70,7 +71,7 @@ class GetSettingsController extends Controller { 'supportedLanguages' => Language::getSupportedLanguages(), 'allowedLanguages' => Language::getAllowedLanguages(), 'user-system-enabled' => intval(Setting::getSetting('user-system-enabled')->getValue()), - 'session-prefix' => Setting::getSetting('session-prefix') + 'session-prefix' => Setting::getSetting('session-prefix')->getValue() ]; } } diff --git a/server/controllers/system/init-settings.php b/server/controllers/system/init-settings.php index 4233d8a8..831e3751 100755 --- a/server/controllers/system/init-settings.php +++ b/server/controllers/system/init-settings.php @@ -88,7 +88,8 @@ class InitSettingsController extends Controller { 'file-gap' => Hashing::generateRandomPrime(100000, 999999), 'file-first-number' => Hashing::generateRandomNumber(100000, 999999), 'file-quantity' => 0, - 'session-prefix' => 'opensupports-'.Hashing::generateRandomToken().'_' + 'session-prefix' => 'opensupports-'.Hashing::generateRandomToken().'_', + 'mail-template-header-image' => 'http://opensupports.com/logo.png' ]); } diff --git a/server/data/mail-templates/ticket-closed.html b/server/data/mail-templates/ticket-closed.html index bdecca82..6bfe8dac 100755 --- a/server/data/mail-templates/ticket-closed.html +++ b/server/data/mail-templates/ticket-closed.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/ticket-created-staff.html b/server/data/mail-templates/ticket-created-staff.html index ce54e633..f6eb6a3d 100644 --- a/server/data/mail-templates/ticket-created-staff.html +++ b/server/data/mail-templates/ticket-created-staff.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/ticket-created.html b/server/data/mail-templates/ticket-created.html index 48c6b952..360c8db2 100755 --- a/server/data/mail-templates/ticket-created.html +++ b/server/data/mail-templates/ticket-created.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/ticket-responded.html b/server/data/mail-templates/ticket-responded.html index 3b3e014f..1507c06e 100755 --- a/server/data/mail-templates/ticket-responded.html +++ b/server/data/mail-templates/ticket-responded.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/user-edit-email.html b/server/data/mail-templates/user-edit-email.html index 5e275154..d50139c4 100755 --- a/server/data/mail-templates/user-edit-email.html +++ b/server/data/mail-templates/user-edit-email.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/user-edit-password.html b/server/data/mail-templates/user-edit-password.html index d96c5985..af8097c6 100755 --- a/server/data/mail-templates/user-edit-password.html +++ b/server/data/mail-templates/user-edit-password.html @@ -302,9 +302,9 @@
- - logo
+ + logo
diff --git a/server/data/mail-templates/user-password-forgot.html b/server/data/mail-templates/user-password-forgot.html index 2aa238e9..eec0f4d1 100755 --- a/server/data/mail-templates/user-password-forgot.html +++ b/server/data/mail-templates/user-password-forgot.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/user-signup.html b/server/data/mail-templates/user-signup.html index 97d3b48f..a85896cf 100755 --- a/server/data/mail-templates/user-signup.html +++ b/server/data/mail-templates/user-signup.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/user-system-disabled.html b/server/data/mail-templates/user-system-disabled.html index 2ed326a5..9abf4350 100644 --- a/server/data/mail-templates/user-system-disabled.html +++ b/server/data/mail-templates/user-system-disabled.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/data/mail-templates/user-system-enabled.html b/server/data/mail-templates/user-system-enabled.html index bb326785..3789128d 100755 --- a/server/data/mail-templates/user-system-enabled.html +++ b/server/data/mail-templates/user-system-enabled.html @@ -302,8 +302,8 @@
-
- logo + + logo
diff --git a/server/models/MailTemplate.php b/server/models/MailTemplate.php index a9f6c74f..bb9eb0b3 100755 --- a/server/models/MailTemplate.php +++ b/server/models/MailTemplate.php @@ -78,6 +78,9 @@ class MailTemplate extends DataStore { $matches[] = '{{' . $this->template . '_MATCH_' . ($key + 1) . '}}'; } + $matches[] = '{{IMAGE_HEADER_URL}}'; + $texts[] = Setting::getSetting('mail-template-header-image')->value; + $body = str_replace($matches, $texts, file_get_contents($templateFilePaths[$this->template])); return $this->compileString($body, $config);