├── .gitignore ├── CONTRIBUTING.md ├── FOSMessageBundle.php ├── Tests ├── Functional │ ├── Entity │ │ ├── Thread.php │ │ ├── Message.php │ │ ├── UserProvider.php │ │ └── User.php │ ├── WebTestCase.php │ ├── FunctionalTest.php │ ├── Form │ │ └── UserToUsernameTransformer.php │ ├── EntityManager │ │ ├── MessageManager.php │ │ └── ThreadManager.php │ └── TestKernel.php └── Model │ └── ThreadTest.php ├── Document ├── ThreadMetadata.php ├── MessageMetadata.php └── Message.php ├── Resources ├── views │ ├── Message │ │ ├── sent.html.twig │ │ ├── deleted.html.twig │ │ ├── newThread.html.twig │ │ ├── inbox.html.twig │ │ ├── search.html.twig │ │ ├── thread.html.twig │ │ └── threads_list.html.twig │ └── layout.html.twig ├── doc │ ├── 05-permissions.md │ ├── 04-spam-detection.md │ ├── 03-templating.md │ ├── 90-multiple-recipients.md │ ├── 00-index.md │ ├── 90-sending-a-message-programatically.md │ ├── 06-events.md │ ├── 99-config-reference.md │ ├── 01-installation.md │ ├── 02-basic-usage.md │ ├── 01b-odm-models.md │ └── 01a-orm-models.md ├── translations │ ├── validators.ar.yml │ ├── validators.ru.yml │ ├── validators.en.yml │ ├── validators.pl.yml │ ├── validators.pt_BR.yml │ ├── FOSMessageBundle.sv.yml │ ├── validators.fr.yml │ ├── FOSMessageBundle.it.yml │ ├── FOSMessageBundle.fa.yml │ ├── FOSMessageBundle.nl.yml │ ├── FOSMessageBundle.sk.yml │ ├── FOSMessageBundle.sl.yml │ ├── FOSMessageBundle.en.yml │ ├── FOSMessageBundle.ar.yml │ ├── FOSMessageBundle.es.yml │ ├── FOSMessageBundle.pt_BR.yml │ ├── FOSMessageBundle.cs.yml │ ├── FOSMessageBundle.fr.yml │ ├── FOSMessageBundle.pl.yml │ ├── FOSMessageBundle.de.yml │ └── FOSMessageBundle.ru.yml ├── config │ ├── doctrine │ │ ├── MessageMetadata.mongodb.xml │ │ ├── MessageMetadata.orm.xml │ │ ├── ThreadMetadata.mongodb.xml │ │ ├── ThreadMetadata.orm.xml │ │ ├── Thread.orm.xml │ │ ├── Message.orm.xml │ │ ├── Message.mongodb.xml │ │ └── Thread.mongodb.xml │ ├── spam_detection.xml │ ├── orm.xml │ ├── mongodb.xml │ ├── validator.xml │ ├── routing.xml │ ├── form.xml │ ├── validation.xml │ └── config.xml └── meta │ └── LICENSE ├── MessageBuilder ├── ReplyMessageBuilder.php ├── NewThreadMessageBuilder.php └── AbstractMessageBuilder.php ├── Search ├── QueryFactoryInterface.php ├── FinderInterface.php ├── Query.php ├── Finder.php └── QueryFactory.php ├── .php_cs.dist ├── SpamDetection ├── NoopSpamDetector.php ├── SpamDetectorInterface.php └── AkismetSpamDetector.php ├── Sender ├── SenderInterface.php └── Sender.php ├── phpunit ├── Validator ├── Spam.php ├── Authorization.php ├── SelfRecipient.php ├── ReplyAuthorization.php ├── SpamValidator.php ├── AuthorizationValidator.php ├── SelfRecipientValidator.php └── ReplyAuthorizationValidator.php ├── FormModel ├── AbstractMessage.php ├── ReplyMessage.php ├── NewThreadMessage.php └── NewThreadMultipleMessage.php ├── Security ├── ParticipantProviderInterface.php ├── AuthorizerInterface.php ├── Authorizer.php └── ParticipantProvider.php ├── Model ├── ParticipantInterface.php ├── ReadableInterface.php ├── MessageMetadata.php ├── MessageInterface.php ├── ThreadMetadata.php ├── ThreadInterface.php └── Message.php ├── Event ├── ThreadEvent.php ├── ReadableEvent.php ├── MessageEvent.php └── FOSMessageEvents.php ├── Deleter ├── DeleterInterface.php └── Deleter.php ├── FormFactory ├── NewThreadMessageFormFactory.php ├── ReplyMessageFormFactory.php └── AbstractMessageFormFactory.php ├── Reader ├── ReaderInterface.php └── Reader.php ├── ModelManager ├── MessageManager.php ├── ThreadManager.php ├── ReadableManagerInterface.php └── MessageManagerInterface.php ├── Entity ├── Message.php ├── MessageMetadata.php ├── ThreadMetadata.php └── Thread.php ├── Composer ├── ComposerInterface.php └── Composer.php ├── phpunit.xml.dist ├── .travis.yml ├── .github └── workflows │ └── ci.yml ├── FormHandler ├── ReplyMessageFormHandler.php ├── NewThreadMessageFormHandler.php ├── NewThreadMultipleMessageFormHandler.php └── AbstractMessageFormHandler.php ├── Provider ├── ProviderInterface.php └── Provider.php ├── UPGRADING.md ├── Util └── LegacyFormHelper.php ├── FormType ├── NewThreadMultipleMessageFormType.php ├── ReplyMessageFormType.php ├── RecipientsType.php └── NewThreadMessageFormType.php ├── README.md ├── composer.json ├── DataTransformer └── RecipientsDataTransformer.php ├── Twig └── Extension │ └── MessageExtension.php └── DependencyInjection └── Configuration.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | phpunit.xml 3 | .phpunit 4 | vendor 5 | .php_cs.cache 6 | .php_cs 7 | Tests/Functional/cache 8 | Tests/Functional/logs 9 | var 10 | .phpunit.result.cache -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | FOSMessageBundle is an open source project. When contributing please follow the Symfony2 coding standards and provide 5 | test cases where possible. 6 | -------------------------------------------------------------------------------- /FOSMessageBundle.php: -------------------------------------------------------------------------------- 1 | {% trans from 'FOSMessageBundle' %}sent{% endtrans %} 6 | 7 | {% include '@FOSMessage/Message/threads_list.html.twig' with {'threads': threads} %} 8 | 9 | {% endblock %} 10 | -------------------------------------------------------------------------------- /Resources/views/Message/deleted.html.twig: -------------------------------------------------------------------------------- 1 | {% extends '@FOSMessage/layout.html.twig' %} 2 | 3 | {% block fos_message_content %} 4 | 5 |
{% transchoice threads|length with {'%num%': threads|length } from 'FOSMessageBundle' %} 8 | threads_found 9 | {% endtranschoice %}
10 | 11 | {% include '@FOSMessage/Message/threads_list.html.twig' with {'threads': threads} %} 12 | 13 | {% endblock %} 14 | -------------------------------------------------------------------------------- /Validator/Spam.php: -------------------------------------------------------------------------------- 1 | body; 18 | } 19 | 20 | /** 21 | * @param string 22 | */ 23 | public function setBody($body) 24 | { 25 | $this->body = $body; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Security/ParticipantProviderInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface ParticipantProviderInterface 13 | { 14 | /** 15 | * Gets the current authenticated user. 16 | * 17 | * @return ParticipantInterface 18 | */ 19 | public function getAuthenticatedParticipant(); 20 | } 21 | -------------------------------------------------------------------------------- /Validator/Authorization.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface ParticipantInterface 13 | { 14 | /** 15 | * Gets the unique identifier of the participant. 16 | * 17 | * @return mixed 18 | */ 19 | public function getId(); 20 | } 21 | -------------------------------------------------------------------------------- /Tests/Functional/FunctionalTest.php: -------------------------------------------------------------------------------- 1 | 'guilhem', 11 | 'PHP_AUTH_PW' => 'pass', 12 | )); 13 | $crawler = $client->request('GET', '/sent'); 14 | 15 | $response = $client->getResponse(); 16 | $this->assertEquals(200, $response->getStatusCode()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Validator/ReplyAuthorization.php: -------------------------------------------------------------------------------- 1 | thread = $thread; 18 | } 19 | 20 | /** 21 | * @return ThreadInterface 22 | */ 23 | public function getThread() 24 | { 25 | return $this->thread; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /FormModel/ReplyMessage.php: -------------------------------------------------------------------------------- 1 | thread; 22 | } 23 | 24 | public function setThread(ThreadInterface $thread) 25 | { 26 | $this->thread = $thread; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Event/ReadableEvent.php: -------------------------------------------------------------------------------- 1 | readable = $readable; 18 | } 19 | 20 | /** 21 | * @return ReadableInterface 22 | */ 23 | public function getReadable() 24 | { 25 | return $this->readable; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Model/ReadableInterface.php: -------------------------------------------------------------------------------- 1 | getThread()); 17 | 18 | $this->message = $message; 19 | } 20 | 21 | /** 22 | * @return MessageInterface 23 | */ 24 | public function getMessage() 25 | { 26 | return $this->message; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Resources/doc/05-permissions.md: -------------------------------------------------------------------------------- 1 | Messaging permissions 2 | ====================== 3 | 4 | The default permissions authorizer service will authenticate a user if they're a 5 | participant of the thread and is very permissive by default. 6 | 7 | You can implement your own permissions service to replace the built in service and tell 8 | FOSMessageBundle about it: 9 | 10 | ```yaml 11 | # app/config/config.yml 12 | 13 | fos_message: 14 | authorizer: app.authorizer 15 | ``` 16 | 17 | Any such service must implement `FOS\MessageBundle\Security\AuthorizerInterface`. 18 | 19 | [Return to the documentation index](00-index.md) 20 | -------------------------------------------------------------------------------- /SpamDetection/SpamDetectorInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface SpamDetectorInterface 13 | { 14 | /** 15 | * Tells whether or not a new message looks like spam. 16 | * 17 | * @param NewThreadMessage $message 18 | * 19 | * @return bool true if it is spam, false otherwise 20 | */ 21 | public function isSpam(NewThreadMessage $message); 22 | } 23 | -------------------------------------------------------------------------------- /Resources/translations/validators.ar.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: لم يتم تحديد إي مستقبل 4 | recipients: 5 | blank: لم يتم تحديد المستقبلين 6 | subject: 7 | blank: رجاء ادخل العنوان 8 | short: العنوان قصير جدا|العنوان قصير جدا 9 | long: العنوان طويل جدا|العنوان طويل جدا 10 | body: 11 | blank: رجاء ادخل محتوى الرساله 12 | short: المحتوى قصير جدا 13 | spam: عذرا , لكن رسلاتك تبدو كرسالة مزعجة 14 | not_authorized: إنك لا تملك التصريح اللازم لإرسال هذه الرساله 15 | reply_not_authorized: إنك لا تملك التصريح اللازم لرد على هذه الرساله 16 | self_recipient: لا يمكنك إرسال رساله لنفسك 17 | 18 | -------------------------------------------------------------------------------- /Deleter/DeleterInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface DeleterInterface 13 | { 14 | /** 15 | * Marks the thread as deleted by the current authenticated user. 16 | */ 17 | public function markAsDeleted(ThreadInterface $thread); 18 | 19 | /** 20 | * Marks the thread as undeleted by the current authenticated user. 21 | */ 22 | public function markAsUndeleted(ThreadInterface $thread); 23 | } 24 | -------------------------------------------------------------------------------- /Resources/translations/validators.ru.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: Не указан адресат 4 | recipients: 5 | blank: Не указаны адресаты 6 | subject: 7 | blank: Укажите тему 8 | too_short: Название темы слишком короткое|Название темы слишком короткое 9 | too_long: Название темы слишком длинное|Название темы слишком длинное 10 | body: 11 | blank: Введите текст сообщения 12 | too_short: Текст сообщения слишком короткий 13 | spam: Сожалеем, но ваше сообщение похоже на спам 14 | not_authorized: Вы не можете отправить это сообщение 15 | self_recipient: Вы не можете отправить сообщение самому себе 16 | -------------------------------------------------------------------------------- /FormFactory/NewThreadMessageFormFactory.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | class NewThreadMessageFormFactory extends AbstractMessageFormFactory 13 | { 14 | /** 15 | * Creates a new thread message. 16 | * 17 | * @return FormInterface 18 | */ 19 | public function create() 20 | { 21 | return $this->formFactory->createNamed($this->formName, $this->formType, $this->createModelInstance()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Reader/ReaderInterface.php: -------------------------------------------------------------------------------- 1 | 11 | */ 12 | interface ReaderInterface 13 | { 14 | /** 15 | * Marks the readable as read by the current authenticated user. 16 | */ 17 | public function markAsRead(ReadableInterface $readable); 18 | 19 | /** 20 | * Marks the readable as unread by the current authenticated user. 21 | */ 22 | public function markAsUnread(ReadableInterface $readable); 23 | } 24 | -------------------------------------------------------------------------------- /Resources/doc/04-spam-detection.md: -------------------------------------------------------------------------------- 1 | Spam detection 2 | ============== 3 | 4 | Using Akismet 5 | ------------- 6 | 7 | Install AkismetBundle (https://github.com/ornicar/OrnicarAkismetBundle). 8 | 9 | Then, set the spam detector service accordingly:: 10 | 11 | ```yaml 12 | # app/config/config.yml 13 | 14 | fos_message: 15 | spam_detector: fos_message.akismet_spam_detector 16 | ``` 17 | 18 | Other strategies 19 | ---------------- 20 | 21 | You can use any spam detector service, including one of your own, provided the 22 | class implements ``FOS\MessageBundle\SpamDetection\SpamDetectorInterface``. 23 | 24 | [Return to the documentation index](00-index.md) 25 | -------------------------------------------------------------------------------- /Resources/translations/validators.en.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: No recipient specified 4 | recipients: 5 | blank: No recipients specified 6 | subject: 7 | blank: Please enter a subject 8 | short: The subject is too short|The subject is too short 9 | long: The subject is too long|The subject is too long 10 | body: 11 | blank: Please enter a body 12 | short: The body is too short 13 | spam: Sorry, your message looks like spam 14 | not_authorized: You are not allowed to send this message 15 | reply_not_authorized: You are not allowed to reply to this message 16 | self_recipient: You cannot send a message to yourself 17 | 18 | -------------------------------------------------------------------------------- /Resources/translations/validators.pl.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: Nie zdefiniowano odbiorcy 4 | recipients: 5 | blank: Nie zdefiniowano żadnych odbiorców 6 | subject: 7 | blank: Wprowadź temat 8 | short: Temat jest za krótki|Temat jest za krótki 9 | long: Temat jest za długi|Temat jest za długi 10 | body: 11 | blank: Wprowadź treść 12 | short: Treść jest za krótka 13 | spam: Przykro mi, Twoja wiadomość wygląda jak spam 14 | not_authorized: Nie masz uprawnień, aby wysłać tą wiadomość 15 | reply_not_authorized: Nie masz uprawnień, aby odpowiadać na tą wiadomość 16 | self_recipient: Nie możesz wysyłać wiadomości do siebie 17 | 18 | -------------------------------------------------------------------------------- /ModelManager/MessageManager.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | abstract class MessageManager implements MessageManagerInterface 14 | { 15 | /** 16 | * Creates an empty message instance. 17 | * 18 | * @return MessageInterface 19 | */ 20 | public function createMessage() 21 | { 22 | $class = $this->getClass(); 23 | 24 | return new $class(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ModelManager/ThreadManager.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | abstract class ThreadManager implements ThreadManagerInterface 14 | { 15 | /** 16 | * Creates an empty comment thread instance. 17 | * 18 | * @return ThreadInterface 19 | */ 20 | public function createThread() 21 | { 22 | $class = $this->getClass(); 23 | 24 | return new $class(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Resources/translations/validators.pt_BR.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: Nenhum destinatário especificado 4 | recipients: 5 | blank: Nenhum destinatário especificado 6 | subject: 7 | blank: Insira um assunto 8 | short: O assunto é muito curto|O assunto é muito curto 9 | long: O assunto é muito longo|O assunto é muito longo 10 | body: 11 | blank: Insira uma mensagem 12 | short: A mensagem é muito curta 13 | spam: Desculpe, sua mensagem parece ser um spam 14 | not_authorized: Você não tem permissão para enviar esta mensagem 15 | reply_not_authorized: Você não tem permissão para responder a esta mensagem 16 | self_recipient: Não é possível enviar uma mensagem para si mesmo 17 | 18 | -------------------------------------------------------------------------------- /Resources/translations/FOSMessageBundle.sv.yml: -------------------------------------------------------------------------------- 1 | messenger: Meddelanden 2 | inbox: Inkorg 3 | sent: Skickat 4 | send_new: Skriv nytt meddelande 5 | search: Sök 6 | threads_found: "%num% tråd hittad | %num% trådar hittade" 7 | 8 | message_info: "Av %sender%, den %date%" 9 | reply: Svara 10 | 11 | subject: Ämne 12 | starter: Avsändare 13 | startdate: Påbörjad den 14 | messages: Meddelanden 15 | last_message: Senaste meddelande 16 | actions: Åtgärder 17 | new: Ny 18 | goto_last: Gå till senaste meddelande 19 | on: "den %date%" 20 | by: "av %sender%" 21 | no_thread: Det finns inga trådar 22 | delete: Ta bort 23 | -------------------------------------------------------------------------------- /Entity/Message.php: -------------------------------------------------------------------------------- 1 | metadata; 19 | } 20 | 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function addMetadata(ModelMessageMetadata $meta) 25 | { 26 | $meta->setMessage($this); 27 | parent::addMetadata($meta); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tests/Functional/Entity/UserProvider.php: -------------------------------------------------------------------------------- 1 | 12 | */ 13 | interface ComposerInterface 14 | { 15 | /** 16 | * Starts composing a message, starting a new thread. 17 | * 18 | * @return AbstractMessageBuilder 19 | */ 20 | public function newThread(); 21 | 22 | /** 23 | * Starts composing a message in a reply to a thread. 24 | * 25 | * @return AbstractMessageBuilder 26 | */ 27 | public function reply(ThreadInterface $thread); 28 | } 29 | -------------------------------------------------------------------------------- /Resources/translations/validators.fr.yml: -------------------------------------------------------------------------------- 1 | fos_message: 2 | recipient: 3 | blank: Pas de destinataire spécifié 4 | recipients: 5 | blank: Pas de destinataires spécifié 6 | subject: 7 | blank: Vous devez entrer un sujet 8 | short: Le sujet est trop court|Le sujet est trop court 9 | long: Le sujet est trop long|Le sujet est trop long 10 | body: 11 | blank: Vous devez entrer un message 12 | short: Le message est trop court 13 | spam: Il semble que votre message soit un SPAM, il n'a pas été envoyé 14 | not_authorized: Vous n'avez pas le droit d'envoyer ce message 15 | reply_not_authorized: Vous n'avez pas de droit de répondre dans cette discussion 16 | self_recipient: Vous ne pouvez pas vous envoyer un message à vous-même 17 | -------------------------------------------------------------------------------- /Entity/MessageMetadata.php: -------------------------------------------------------------------------------- 1 | id; 19 | } 20 | 21 | /** 22 | * @return MessageInterface 23 | */ 24 | public function getMessage() 25 | { 26 | return $this->message; 27 | } 28 | 29 | public function setMessage(MessageInterface $message) 30 | { 31 | $this->message = $message; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Resources/translations/FOSMessageBundle.it.yml: -------------------------------------------------------------------------------- 1 | messenger: Messaggi 2 | inbox: Posta in arrivo 3 | sent: Posta inviata 4 | deleted: Cestino 5 | send_new: Scrivere un nuovo messaggio 6 | search: Cercare 7 | threads_found: "%num% conversazione trovata con | %num% conversazioni trovate con" 8 | 9 | message_info: "Di %sender%, il %date%" 10 | reply: Rispondere 11 | 12 | subject: Oggetto 13 | starter: Iniziato da 14 | startdate: Iniziato il 15 | messages: Messaggi 16 | last_message: Ultimo messaggio 17 | actions: Azioni 18 | new: Nuovo 19 | goto_last: Vedere l’ultimo messaggio 20 | on: "Il %date%" 21 | by: "Di %sender%" 22 | no_thread: Nessuna conversazione 23 | -------------------------------------------------------------------------------- /Tests/Functional/Entity/User.php: -------------------------------------------------------------------------------- 1 | id; 21 | } 22 | 23 | /** 24 | * @return ThreadInterface 25 | */ 26 | public function getThread() 27 | { 28 | return $this->thread; 29 | } 30 | 31 | public function setThread(ThreadInterface $thread) 32 | { 33 | $this->thread = $thread; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Resources/translations/FOSMessageBundle.fa.yml: -------------------------------------------------------------------------------- 1 | messenger: پیامرسان 2 | inbox: صندوق دریافتی 3 | sent: ارسالی 4 | deleted: حذفشده 5 | send_new: فرستادن یک پیام جدید 6 | search: جستجو 7 | threads_found: "%num% مورد یافت شد | %num% مورد یافت شد" 8 | 9 | message_info: توسط %sender%، در %date% 10 | reply: پاسخ 11 | 12 | subject: موضوع 13 | starter: شروعکننده 14 | startdate: تاریخ شروع 15 | messages: پیامها 16 | last_message: آخرین پیام 17 | actions: عملیاتها 18 | new: جدید 19 | goto_last: برو به آخرین پیام 20 | on: در %date% 21 | by: توسط %sender% 22 | no_thread: هیچ مورد جدیدی برای نمایش وجود ندارد. 23 | delete: حذف 24 | undelete: از حذف درآوردن 25 | -------------------------------------------------------------------------------- /Resources/translations/FOSMessageBundle.nl.yml: -------------------------------------------------------------------------------- 1 | messenger: Messenger 2 | inbox: Ontvangen 3 | sent: Verzonden 4 | deleted: Verwijderd 5 | send_new: Verstuur een nieuw bericht 6 | search: Zoek 7 | threads_found: "%num% bericht gevonden met | %num% berichten gevonden met" 8 | 9 | message_info: "Door %sender%, op %date%" 10 | reply: Reageer 11 | 12 | subject: Onderwerp 13 | starter: Starter 14 | startdate: Start datum 15 | messages: Berichten 16 | last_message: Laatste bericht 17 | actions: Acties 18 | new: Nieuw 19 | goto_last: Ga naar laatste bericht 20 | on: "Op %date%" 21 | by: "Door %sender%" 22 | no_thread: Geen onderwerpen gevonden 23 | delete: Verwijder 24 | -------------------------------------------------------------------------------- /Resources/config/doctrine/MessageMetadata.mongodb.xml: -------------------------------------------------------------------------------- 1 | 2 || {% trans from 'FOSMessageBundle' %}subject{% endtrans %} | 6 |{% trans from 'FOSMessageBundle' %}starter{% endtrans %} | 7 |{% trans from 'FOSMessageBundle' %}startdate{% endtrans %} | 8 |{% trans from 'FOSMessageBundle' %}messages{% endtrans %} | 9 |{% trans from 'FOSMessageBundle' %}last_message{% endtrans %} | 10 |{% trans from 'FOSMessageBundle' %}actions{% endtrans %} | 11 |
|---|---|---|---|---|---|
| 20 | 21 | {{ thread.subject }} 22 | 23 | 24 | {% if not fos_message_is_read(thread) %} 25 | ({% trans from 'FOSMessageBundle' %}new{% endtrans %}) 26 | {% endif %} 27 | | 28 |29 | {{ thread.createdBy }} 30 | | 31 |32 | {{ thread.createdAt|date }} 33 | | 34 |35 | {{ thread.messages|length }} 36 | | 37 |
38 | {% if thread.lastMessage %}
39 |
40 | →
41 |
42 | {% trans with {'%date%': thread.lastMessage.createdAt|date} from 'FOSMessageBundle' %}on{% endtrans %}
43 | 44 | {% trans with {'%sender%': thread.lastMessage.sender|e } from 'FOSMessageBundle' %}by{% endtrans %} 45 | {% else %} 46 | ---- 47 | {% endif %} 48 | |
49 | 50 | {% if fos_message_can_delete_thread(thread) %} 51 | {% if fos_message_deleted_by_participant(thread) %} 52 | {% set formAction %}{{ url('fos_message_thread_undelete', {'threadId': thread.id}) }}{% endset %} 53 | {% set submitValue %}{% trans from 'FOSMessageBundle' %}undelete{% endtrans %}{% endset %} 54 | {% else %} 55 | {% set formAction %}{{ url('fos_message_thread_delete', {'threadId': thread.id}) }}{% endset %} 56 | {% set submitValue %}{% trans from 'FOSMessageBundle' %}delete{% endtrans %}{% endset %} 57 | {% endif %} 58 | 61 | {% endif %} 62 | | 63 |
| 68 | {% trans from 'FOSMessageBundle' %}no_thread{% endtrans %}. 69 | | 70 ||||||