diff --git a/usr/module/message/asset/script/admin.css b/usr/module/message/asset/script/admin.css new file mode 100644 index 0000000000..2884f14a2c --- /dev/null +++ b/usr/module/message/asset/script/admin.css @@ -0,0 +1,4 @@ +.message-single { + padding: 15px 5px; + border-bottom: 1px solid #ccc; +} \ No newline at end of file diff --git a/usr/module/message/asset/script/front.css b/usr/module/message/asset/script/front.css index 59c8ed2feb..510c31cc27 100644 --- a/usr/module/message/asset/script/front.css +++ b/usr/module/message/asset/script/front.css @@ -12,7 +12,6 @@ padding: 12px 20px 18px 15px; padding-left: 12px \9; margin-top: 0; - cursor: pointer; } .message-hidden .message-mark, @@ -31,7 +30,7 @@ .message-detail-primary:hover .message-hidden, .message-item:hover .message-hidden { - display: block; + /* display: block; */ } .message-hidden { @@ -40,8 +39,7 @@ } .message-media-right { - width: 160px; - margin-left: 60px; + width: 200px; } .message-time { @@ -79,20 +77,20 @@ color: #005580; } -.message-content p { - width: 628px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.message-content p.message-body { - width: 690px; +.message-content a { + color: #000; + text-decoration: none; + width: 100%; + padding: 8px; + display: block; + margin: 0 -8px; } -.message-content p a { - color: #888; +.message-content a:hover { + color: #000; text-decoration: none; + background-color: #e0e0e0; + border-radius: 4px; } .message-foot-form { @@ -272,3 +270,14 @@ font-weight: bold; } +.form-group label.col-md-12 { + text-align: left; +} + +.message-checkbox { + margin-top: 10px; +} + +.message-avatar { + margin: 0 20px; +} \ No newline at end of file diff --git a/usr/module/message/asset/script/index-detail.js b/usr/module/message/asset/script/index-detail.js index e6589d0900..039eae6176 100644 --- a/usr/module/message/asset/script/index-detail.js +++ b/usr/module/message/asset/script/index-detail.js @@ -38,7 +38,7 @@ var href = app.$delete.attr('href'); $('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm')); $('.confirm-ok').attr('href', href); - $('#confirm-modal').modal({show: true}); + $('#confirm-modal').modal('show'); return false; }, }; diff --git a/usr/module/message/asset/script/index-index.js b/usr/module/message/asset/script/index-index.js index b1e6565111..d4cb8017d9 100644 --- a/usr/module/message/asset/script/index-index.js +++ b/usr/module/message/asset/script/index-index.js @@ -38,18 +38,18 @@ } }, batchAction: function () { - var checked = app.$('.message-js-check:checked'); + var checked = this.$('.message-js-check:checked'); var action = $.trim(this.$select.val()); var ids = []; - if (checked.length) { if (action == "delete") { - if (!confirm(options.confirms)) { - app.$select.attr('value', ''); - return; + if (checked.length > 1) { + $('#confirm-modal').modal('show'); + } else { + $('#confirm-modal').modal('show'); } + return false; } - checked.each(function () { ids.push($(this).attr('data-id')); }); @@ -60,21 +60,21 @@ location.href = url; } } else { - app.$select.attr('value', ''); + this.$select.attr('value', ''); } }, itemsBind: function (c) { if (c.target.tagName === "A" || c.target.tagName === "INPUT" || c.target.tagName === "IMG") { return; } - window.location = $(this).find(".message-content p a").attr("href") + window.location = $(this).find(".message-content-link").attr("href") }, - deleteAction: function (e) { - var target = $(e.target); - var msg = target.data('confirm') - if (!confirm(msg)) { - e.preventDefault(); - } + deleteAction: function () { + var href = $(this).attr('href'); + $('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm')); + $('.confirm-ok').attr('href', href); + $('#confirm-modal').modal('show'); + return false; }, }; diff --git a/usr/module/message/asset/script/notify-index.js b/usr/module/message/asset/script/notify-index.js index dd131ab3f3..a9e86c695c 100644 --- a/usr/module/message/asset/script/notify-index.js +++ b/usr/module/message/asset/script/notify-index.js @@ -44,10 +44,9 @@ if (checked.length) { if (action == "delete") { if (checked.length > 1) { - $('#confirm-modals').modal({show: true}); - } - else { - $('#confirm-modal').modal({show: true}); + $('#confirm-modal').modal('show'); + } else { + $('#confirm-modal').modal('show'); } return false; } @@ -63,9 +62,6 @@ } else { this.$select.attr('value', ''); } - if ($(this).val() == 'delete') { - - } }, itemsBind: function (c) { if (c.target.tagName === "A" || c.target.tagName === "INPUT" || c.target.tagName === "IMG") { @@ -77,7 +73,7 @@ var href = $(this).attr('href'); $('#confirm-modal').find('.modal-body').text($(this).attr('data-confirm')); $('.confirm-ok').attr('href', href); - $('#confirm-modal').modal({show: true}); + $('#confirm-modal').modal('show'); return false; }, }; diff --git a/usr/module/message/config/module.php b/usr/module/message/config/module.php index 5bc76e2053..5c3e31486a 100644 --- a/usr/module/message/config/module.php +++ b/usr/module/message/config/module.php @@ -18,7 +18,7 @@ // Description, for admin, optional 'description' => _a('A module to send message'), // Version number, required - 'version' => '1.0.0', + 'version' => '1.0.6', // Distribution license, required 'license' => 'New BSD', // Module is ready for clone? Default as false @@ -45,10 +45,13 @@ // SQL schema/data file 'sqlfile' => 'sql/mysql.sql', ), + // permission + 'permission' => 'permission.php', + // page + 'page' => 'page.php', // Navigation definition 'navigation' => 'navigation.php', // User specs 'user' => 'user.php', ), - ); diff --git a/usr/module/message/config/navigation.php b/usr/module/message/config/navigation.php index ed9eef27c1..a84570df19 100755 --- a/usr/module/message/config/navigation.php +++ b/usr/module/message/config/navigation.php @@ -8,35 +8,29 @@ */ return array( - // Hide from front menu 'front' => false, - /* - 'front' => array( - 'private' => array( - 'label' => _a('Private message'), - 'route' => 'default', - 'controller' => 'index', - 'action' => 'index', - ), - 'archive' => array( - 'label' => _a('Archive'), - 'route' => 'default', - 'controller' => 'index', - 'action' => 'archive' - ), - 'notify' => array( - 'label' => _a('Notification'), - 'route' => 'default', - 'controller' => 'notify', - 'action' => 'index', + // Admin side + 'admin' => array( + 'list' => array( + 'label' => _a('List'), + 'permission' => array( + 'resource' => 'list', + ), + 'route' => 'admin', + 'module' => 'message', + 'controller' => 'list', + 'action' => 'index', ), - 'send' => array( - 'label' => _a('New message'), - 'route' => 'default', - 'controller' => 'index', - 'action' => 'send', + 'prune' => array( + 'label' => _a('Prune'), + 'permission' => array( + 'resource' => 'prune', + ), + 'route' => 'admin', + 'module' => 'message', + 'controller' => 'prune', + 'action' => 'index', ), ), - */ -); +); \ No newline at end of file diff --git a/usr/module/message/config/page.php b/usr/module/message/config/page.php new file mode 100755 index 0000000000..337549f327 --- /dev/null +++ b/usr/module/message/config/page.php @@ -0,0 +1,27 @@ + + */ +return array( + // Admin section + 'admin' => array( + array( + 'title' => _a('List'), + 'controller' => 'list', + 'permission' => 'list', + ), + array( + 'title' => _a('Prune'), + 'controller' => 'prune', + 'permission' => 'prune', + ), + ), +); \ No newline at end of file diff --git a/usr/module/message/config/permission.php b/usr/module/message/config/permission.php new file mode 100755 index 0000000000..376bb2a1b0 --- /dev/null +++ b/usr/module/message/config/permission.php @@ -0,0 +1,25 @@ + + */ +return array( + // Admin section + 'admin' => array( + 'list' => array( + 'title' => _a('List'), + 'access' => array(), + ), + 'prune' => array( + 'title' => _a('Prune'), + 'access' => array(), + ), + ), +); \ No newline at end of file diff --git a/usr/module/message/locale/en/admin.mo b/usr/module/message/locale/en/admin.mo index b2455ca078..e2bae93ab2 100644 Binary files a/usr/module/message/locale/en/admin.mo and b/usr/module/message/locale/en/admin.mo differ diff --git a/usr/module/message/locale/en/admin.po b/usr/module/message/locale/en/admin.po index 4cdc14dcdc..b02b3b4273 100644 --- a/usr/module/message/locale/en/admin.po +++ b/usr/module/message/locale/en/admin.po @@ -1,39 +1,36 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2013-11-10 13:57+0800\n" -"PO-Revision-Date: 2013-11-10 13:58+0800\n" +"POT-Creation-Date: 2016-02-25 15:54+0330\n" +"PO-Revision-Date: 2016-02-25 15:54+0330\n" "Last-Translator: Taiwen Jiang \n" "Language-Team: \n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-KeywordsList: _a;_t\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: C:\\wamp\\www\\master\\usr\\module\\message\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: C:\wamp\www\master\usr\module\message/config/module.php:17 +#: config/module.php:17 msgid "Message" msgstr "" -#: C:\wamp\www\master\usr\module\message/config/module.php:19 +#: config/module.php:19 msgid "A module to send message" msgstr "" -#: C:\wamp\www\master\usr\module\message/config/navigation.php:13 -msgid "Private message" +#: config/navigation.php:16 config/page.php:17 config/permission.php:17 +msgid "List" msgstr "" -#: C:\wamp\www\master\usr\module\message/config/navigation.php:19 -msgid "Notification" +#: config/navigation.php:26 config/page.php:22 config/permission.php:21 +msgid "Prune" msgstr "" -#: C:\wamp\www\master\usr\module\message/config/navigation.php:25 -msgid "New message" -msgstr "" - -#: C:\wamp\www\master\usr\module\message/config/user.php:20 +#: config/user.php:20 msgid "Messages" msgstr "" diff --git a/usr/module/message/locale/en/block.mo b/usr/module/message/locale/en/block.mo index 22536403ec..8a0437aa7d 100644 Binary files a/usr/module/message/locale/en/block.mo and b/usr/module/message/locale/en/block.mo differ diff --git a/usr/module/message/locale/en/block.po b/usr/module/message/locale/en/block.po index 943de15409..6c775f35df 100644 --- a/usr/module/message/locale/en/block.po +++ b/usr/module/message/locale/en/block.po @@ -1,17 +1,18 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2013-11-10 13:58+0800\n" -"PO-Revision-Date: 2013-11-10 13:58+0800\n" +"POT-Creation-Date: 2015-10-23 10:13+0330\n" +"PO-Revision-Date: 2015-10-23 10:13+0330\n" "Last-Translator: Taiwen Jiang \n" "Language-Team: \n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-KeywordsList: _b\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: C:\\wamp\\www\\master\\usr\\module\\message\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" #~ msgid "Checked all" #~ msgstr "All Categories" diff --git a/usr/module/message/locale/en/default.mo b/usr/module/message/locale/en/default.mo index 5e35dd7fb7..526ee667c9 100644 Binary files a/usr/module/message/locale/en/default.mo and b/usr/module/message/locale/en/default.mo differ diff --git a/usr/module/message/locale/en/default.po b/usr/module/message/locale/en/default.po index 5f7e3cabf3..fdec6fa939 100644 --- a/usr/module/message/locale/en/default.po +++ b/usr/module/message/locale/en/default.po @@ -1,159 +1,264 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2013-11-10 13:57+0800\n" -"PO-Revision-Date: 2013-11-10 13:57+0800\n" +"POT-Creation-Date: 2016-02-25 15:54+0330\n" +"PO-Revision-Date: 2016-02-25 15:54+0330\n" "Last-Translator: Taiwen Jiang \n" "Language-Team: \n" +"Language: en\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: C:\\wamp\\www\\master\\usr\\module\\message\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:181 -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/NotifyController.php:41 +#: src/Api/Breadcrumbs.php:47 +msgid "Archive" +msgstr "" + +#: src/Api/Breadcrumbs.php:53 +msgid "Message detail" +msgstr "" + +#: src/Api/Breadcrumbs.php:59 src/Controller/Front/IndexController.php:326 +msgid "Send message" +msgstr "" + +#: src/Controller/Admin/PruneController.php:24 +msgid "" +"You can prune all old message, select time to remove messages before that " +"time and you can filter list of removed messages by this from option." +msgstr "" + +#: src/Controller/Admin/PruneController.php:41 #, php-format -msgid "Private message(%s) unread" +msgid "%s old messages removed" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:185 -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/NotifyController.php:45 +#: src/Controller/Admin/PruneController.php:43 +msgid "No messages removed ! check your selected filter and try again" +msgstr "" + +#: src/Controller/Admin/PruneController.php:48 +msgid "Prune old messages" +msgstr "" + +#: src/Controller/Front/IndexController.php:184 +#: src/Controller/Front/NotifyController.php:43 #, php-format -msgid "Notification(%s) unread" +msgid "Private message ( %s unread )" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:206 -msgid "Need login" +#: src/Controller/Front/IndexController.php:188 +#: src/Controller/Front/NotifyController.php:47 +#, php-format +msgid "Notification ( %s unread )" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:231 +#: src/Controller/Front/IndexController.php:224 msgid "Username is invalid, please try again." msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:247 -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:373 +#: src/Controller/Front/IndexController.php:240 +#: src/Controller/Front/IndexController.php:377 msgid "Send failed, please try again." msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:280 +#: src/Controller/Front/IndexController.php:275 msgid "User" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:284 +#: src/Controller/Front/IndexController.php:279 msgid "not found" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:290 +#: src/Controller/Front/IndexController.php:285 msgid "Sorry, you can't send message to yourself." msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:302 +#: src/Controller/Front/IndexController.php:297 msgid "An error occurred, please try again." msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Controller/Front/IndexController.php:331 -msgid "Send message" +#: src/Form/PruneForm.php:34 +msgid "All messages Before" +msgstr "" + +#: src/Form/PruneForm.php:50 +msgid "Just read messages by user" +msgstr "" + +#: src/Form/PruneForm.php:54 +msgid "Remove read messages by user before selected time" +msgstr "" + +#: src/Form/PruneForm.php:62 +msgid "Just deleted messages by user" +msgstr "" + +#: src/Form/PruneForm.php:66 +msgid "Remove deleted messages by user before selected time" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Form/ReplyForm.php:66 -#: C:\wamp\www\master\usr\module\message/src/Form/SendForm.php:77 +#: src/Form/PruneForm.php:74 +msgid "Prune" +msgstr "" + +#: src/Form/ReplyForm.php:66 src/Form/SendForm.php:77 msgid "Content" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Form/ReplyForm.php:86 -#: C:\wamp\www\master\usr\module\message/src/Form/SendForm.php:91 +#: src/Form/ReplyForm.php:88 src/Form/SendForm.php:93 msgid "Send" msgstr "" -#: C:\wamp\www\master\usr\module\message/src/Form/SendForm.php:55 +#: src/Form/SendForm.php:55 msgid "Recipient" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-detail.phtml:11 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:9 -#: C:\wamp\www\master\usr\module\message/template/front/index-send.phtml:8 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:11 -msgid "Private message" +#: src/Form/SendForm.php:83 +msgid "Message content" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-detail.phtml:14 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:12 -#: C:\wamp\www\master\usr\module\message/template/front/index-send.phtml:9 -#: C:\wamp\www\master\usr\module\message/template/front/notify-detail.phtml:11 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:14 -msgid "Notification" +#: template/admin/list-index.phtml:4 +msgid "List of messages" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-detail.phtml:19 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:17 -#: C:\wamp\www\master\usr\module\message/template/front/index-send.phtml:11 -#: C:\wamp\www\master\usr\module\message/template/front/notify-detail.phtml:14 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:17 -msgid "New message" +#: template/admin/list-index.phtml:19 template/admin/list-index.phtml:40 +#: template/admin/list-index.phtml:47 template/front/index-detail.phtml:28 +#: template/front/index-index.phtml:36 +msgid "From" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-detail.phtml:59 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:46 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:91 -#: C:\wamp\www\master\usr\module\message/template/front/notify-detail.phtml:59 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:44 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:100 -msgid "Delete" +#: template/admin/list-index.phtml:21 template/admin/list-index.phtml:41 +#: template/admin/list-index.phtml:59 template/front/index-detail.phtml:28 +#: template/front/index-index.phtml:36 +msgid "To" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:59 -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:90 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:60 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:99 -msgid "Mark as read" +#: template/admin/list-index.phtml:23 template/admin/list-index.phtml:42 +msgid "Send on" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:77 -msgid "
No message for you!
" +#: template/admin/list-index.phtml:25 +msgid "ID" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:87 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:96 -msgid "Checked all" -msgstr "All Categories" +#: template/admin/list-index.phtml:31 +msgid "Full details" +msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/index-index.phtml:89 -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:98 -msgid "Massive operation" +#: template/admin/list-index.phtml:38 +msgid "Close" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/notify-detail.phtml:8 -msgid "Messages" +#: template/admin/list-index.phtml:49 template/admin/list-index.phtml:61 +msgid "Name" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/notify-index.phtml:85 -msgid "" -"
No notification for you!
" +#: template/admin/list-index.phtml:50 template/admin/list-index.phtml:62 +msgid "Identity" +msgstr "" + +#: template/admin/list-index.phtml:51 template/admin/list-index.phtml:63 +msgid "Email" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:4 +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:64 +msgid "Is read ?" +msgstr "" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:53 +#: template/admin/list-index.phtml:64 template/admin/list-index.phtml:65 +msgid "Yes" +msgstr "" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:53 +#: template/admin/list-index.phtml:64 template/admin/list-index.phtml:65 +msgid "No" +msgstr "" + +#: template/admin/list-index.phtml:53 template/admin/list-index.phtml:65 +msgid "Is deleted ?" +msgstr "" + +#: template/admin/list-index.phtml:85 +msgid "Message list is empty !" +msgstr "" + +#: template/front/_confirm-modal.phtml:5 msgid "Delete this message?" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:7 +#: template/front/_confirm-modal.phtml:8 template/front/index-detail.phtml:64 +#: template/front/index-index.phtml:55 template/front/notify-detail.phtml:52 msgid "Once you delete this message, it cannot be undone." msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:11 +#: template/front/_confirm-modal.phtml:12 msgid "Delete message" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:20 -msgid "Delete these messages?" +#: template/front/_confirm-modal.phtml:14 +msgid "Cancel" +msgstr "" + +#: template/front/index-detail.phtml:10 template/front/index-index.phtml:13 +#: template/front/notify-detail.phtml:10 template/front/notify-index.phtml:13 +msgid "Private message" +msgstr "" + +#: template/front/index-detail.phtml:14 template/front/index-index.phtml:17 +#: template/front/notify-detail.phtml:14 template/front/notify-index.phtml:8 +#: template/front/notify-index.phtml:17 +msgid "Notification" +msgstr "" + +#: template/front/index-detail.phtml:45 template/front/index-index.phtml:56 +#: template/front/index-index.phtml:102 template/front/notify-detail.phtml:53 +#: template/front/notify-index.phtml:53 +msgid "Delete" +msgstr "" + +#: template/front/index-index.phtml:8 +msgid "Message" +msgstr "" + +#: template/front/index-index.phtml:70 template/front/index-index.phtml:101 +#: template/front/notify-index.phtml:52 +msgid "Mark as read" +msgstr "" + +#: template/front/index-index.phtml:76 +msgid "Read" +msgstr "" + +#: template/front/index-index.phtml:89 +msgid "No message for you!" +msgstr "" + +#: template/front/index-index.phtml:98 template/front/notify-index.phtml:49 +msgid "Checked all" +msgstr "All Categories" + +#: template/front/index-index.phtml:100 template/front/notify-index.phtml:51 +msgid "Massive operation" +msgstr "" + +#: template/front/index-index.phtml:113 +msgid "Once you delete those message, it cannot be undone." +msgstr "" + +#: template/front/index-send.phtml:9 +msgid "Return message list page" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:23 -msgid "Once you delete these messages, they cannot be undone." +#: template/front/index-send.phtml:11 +msgid "Write message" msgstr "" -#: C:\wamp\www\master\usr\module\message/template/front/_confirm-modal.phtml:27 -msgid "Delete messages" +#: template/front/notify-index.phtml:38 +msgid "No notification for you!" msgstr "" diff --git a/usr/module/message/locale/en/mail/notification.txt b/usr/module/message/locale/en/mail/notification.txt new file mode 100644 index 0000000000..606d0586ea --- /dev/null +++ b/usr/module/message/locale/en/mail/notification.txt @@ -0,0 +1,17 @@ +[comment]Get new message[/comment] + +[format]html[/format] + +[subject]New message[/subject] + +[body] +
+

Dear %name%

+
You get new message on %site_name% website from %sender%.
+
Please log into the site to check your messages.
+
Don't reply to this email !
+
+ %site_name% +
+
+[/body] diff --git a/usr/module/message/locale/fa/admin.mo b/usr/module/message/locale/fa/admin.mo index 679d1e5e7c..c3adb64e1f 100644 Binary files a/usr/module/message/locale/fa/admin.mo and b/usr/module/message/locale/fa/admin.mo differ diff --git a/usr/module/message/locale/fa/admin.po b/usr/module/message/locale/fa/admin.po index c63e1f2f72..49818dcd25 100644 --- a/usr/module/message/locale/fa/admin.po +++ b/usr/module/message/locale/fa/admin.po @@ -1,32 +1,42 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2015-02-20 12:11+0330\n" -"PO-Revision-Date: 2015-02-20 12:11+0330\n" +"POT-Creation-Date: 2016-02-25 15:54+0330\n" +"PO-Revision-Date: 2016-02-25 15:54+0330\n" "Last-Translator: \n" "Language-Team: \n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.3\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-KeywordsList: _a;_t\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-release-2.5.0/usr/module/" -"message\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/config/module.php:17 +#: config/module.php:17 msgid "Message" msgstr "پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/config/module.php:19 +#: config/module.php:19 msgid "A module to send message" msgstr "ماژول ارسال پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/config/user.php:20 +#: config/navigation.php:16 config/page.php:17 config/permission.php:17 +msgid "List" +msgstr "فهرست" + +#: config/navigation.php:26 config/page.php:22 config/permission.php:21 +msgid "Prune" +msgstr "پاکسازی" + +#: config/user.php:20 msgid "Messages" msgstr "پیام ها" +#~ msgid "Send" +#~ msgstr "ارسال پیام گروهی" + #~ msgid "Private message" #~ msgstr "پیام شخصی" diff --git a/usr/module/message/locale/fa/default.mo b/usr/module/message/locale/fa/default.mo index 563876031a..f5c671ca4c 100644 Binary files a/usr/module/message/locale/fa/default.mo and b/usr/module/message/locale/fa/default.mo differ diff --git a/usr/module/message/locale/fa/default.po b/usr/module/message/locale/fa/default.po index e2506be37c..8aa8a7a0a9 100644 --- a/usr/module/message/locale/fa/default.po +++ b/usr/module/message/locale/fa/default.po @@ -1,181 +1,275 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2015-02-20 12:12+0330\n" -"PO-Revision-Date: 2015-02-20 12:12+0330\n" +"POT-Creation-Date: 2016-02-25 15:54+0330\n" +"PO-Revision-Date: 2016-02-25 15:55+0330\n" "Last-Translator: \n" "Language-Team: \n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.3\n" +"X-Generator: Poedit 1.8.5\n" "X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SearchPath-0: /var/www/html/local/pi/pi-release-2.5.0/usr/module/" -"message\n" +"X-Poedit-Basepath: ../..\n" +"X-Poedit-SearchPath-0: .\n" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:183 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/NotifyController.php:42 +#: src/Api/Breadcrumbs.php:47 +msgid "Archive" +msgstr "آرشیو" + +#: src/Api/Breadcrumbs.php:53 +msgid "Message detail" +msgstr "جزئیات پیام" + +#: src/Api/Breadcrumbs.php:59 src/Controller/Front/IndexController.php:326 +msgid "Send message" +msgstr "ارسال پیام" + +#: src/Controller/Admin/PruneController.php:24 +msgid "" +"You can prune all old message, select time to remove messages before that " +"time and you can filter list of removed messages by this from option." +msgstr "" +"شما میتوانید تمام پیام های قدیمی را پاکسازی کنید ، تاریخی که تمام پیام ها " +"قبل از آن حذف خواهد شد را انتخاب کنید ، همچنین شما میتوانید از فیلتر های " +"موجود در فرم هم استفاده فرمایید. لازم به ذکر است این فرایند برگشت پذیر نیست" + +#: src/Controller/Admin/PruneController.php:41 #, php-format -msgid "Private message(%s unread)" -msgstr "پایام خصوصی (%s خوانده نشده)" +msgid "%s old messages removed" +msgstr "%s پیام قدیمی پاکسازی شد" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:187 +#: src/Controller/Admin/PruneController.php:43 +msgid "No messages removed ! check your selected filter and try again" +msgstr "" +"هیپ پیامی حذف نشد ! لطفا تنظیمات خود را مجددا بررسی کرده و تلاش نمایید." + +#: src/Controller/Admin/PruneController.php:48 +msgid "Prune old messages" +msgstr "پاکسازی پیام های قدیمی" + +#: src/Controller/Front/IndexController.php:184 +#: src/Controller/Front/NotifyController.php:43 #, php-format -msgid "Notification(%s unread)" -msgstr "آگاهی رسانی (%s خوانده نشده)" +msgid "Private message ( %s unread )" +msgstr "پیام شخصی ( %s خوانده نشده )" + +#: src/Controller/Front/IndexController.php:188 +#: src/Controller/Front/NotifyController.php:47 +#, php-format +msgid "Notification ( %s unread )" +msgstr "" +"آگاهی رسانی ( %s خوانده نشده )" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:223 +#: src/Controller/Front/IndexController.php:224 msgid "Username is invalid, please try again." msgstr "نام کاربری صحیح نیست ، دوباره امتحان کنید." -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:239 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:367 +#: src/Controller/Front/IndexController.php:240 +#: src/Controller/Front/IndexController.php:377 msgid "Send failed, please try again." msgstr "ارسال موفقیت آمیز نبود ، دوباره امتحان کنید." -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:273 +#: src/Controller/Front/IndexController.php:275 msgid "User" msgstr "کاربر" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:277 +#: src/Controller/Front/IndexController.php:279 msgid "not found" msgstr "یافت نشد" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:283 +#: src/Controller/Front/IndexController.php:285 msgid "Sorry, you can't send message to yourself." msgstr "متاسفانه شما نمیتوانید به خودتان پیام بفرستید." -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:295 +#: src/Controller/Front/IndexController.php:297 msgid "An error occurred, please try again." msgstr "یک خطا روی داده است ، لطفا دوباره امتحان کنید." -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/IndexController.php:324 -msgid "Send message" -msgstr "ارسال پیام" +#: src/Form/PruneForm.php:34 +msgid "All messages Before" +msgstr "تمام پیام های قبل از" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Controller/Front/NotifyController.php:46 -#, php-format -msgid "Notification(%s unread)" -msgstr "آگاهی رسانی (%s خوانده نشده)" +#: src/Form/PruneForm.php:50 +msgid "Just read messages by user" +msgstr "فقط پیام های خوانده شده توسط مخاطب" + +#: src/Form/PruneForm.php:54 +msgid "Remove read messages by user before selected time" +msgstr "فقط پاکسازی پیام های خوانده شده توسط کاربر قبل از تاریخ انتخابی" + +#: src/Form/PruneForm.php:62 +msgid "Just deleted messages by user" +msgstr "فقط پیام های حذف شده توسط مخاطب" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/ReplyForm.php:66 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/SendForm.php:77 +#: src/Form/PruneForm.php:66 +msgid "Remove deleted messages by user before selected time" +msgstr "فقط پاکسازی پیام های حذف شده توسط کاربر قبل از تاریخ انتخابی" + +#: src/Form/PruneForm.php:74 +msgid "Prune" +msgstr "پاکسازی" + +#: src/Form/ReplyForm.php:66 src/Form/SendForm.php:77 msgid "Content" msgstr "تماس" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/ReplyForm.php:86 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/SendForm.php:93 +#: src/Form/ReplyForm.php:88 src/Form/SendForm.php:93 msgid "Send" msgstr "ارسال" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/SendForm.php:55 +#: src/Form/SendForm.php:55 msgid "Recipient" msgstr "دریافت کننده" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/src/Form/SendForm.php:83 +#: src/Form/SendForm.php:83 msgid "Message content" msgstr "متن پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-archive.phtml:3 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-detail.phtml:6 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:6 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:10 +#: template/admin/list-index.phtml:4 +msgid "List of messages" +msgstr "فهرست پیام ها" + +#: template/admin/list-index.phtml:19 template/admin/list-index.phtml:40 +#: template/admin/list-index.phtml:47 template/front/index-detail.phtml:28 +#: template/front/index-index.phtml:36 +msgid "From" +msgstr "از" + +#: template/admin/list-index.phtml:21 template/admin/list-index.phtml:41 +#: template/admin/list-index.phtml:59 template/front/index-detail.phtml:28 +#: template/front/index-index.phtml:36 +msgid "To" +msgstr "به" + +#: template/admin/list-index.phtml:23 template/admin/list-index.phtml:42 +msgid "Send on" +msgstr "ارسال شده در تاریخ" + +#: template/admin/list-index.phtml:25 +msgid "ID" +msgstr "شناسه" + +#: template/admin/list-index.phtml:31 +msgid "Full details" +msgstr "اطلاعات کامل" + +#: template/admin/list-index.phtml:38 +msgid "Close" +msgstr "بستن" + +#: template/admin/list-index.phtml:49 template/admin/list-index.phtml:61 +msgid "Name" +msgstr "نام" + +#: template/admin/list-index.phtml:50 template/admin/list-index.phtml:62 +msgid "Identity" +msgstr "هویت" + +#: template/admin/list-index.phtml:51 template/admin/list-index.phtml:63 +msgid "Email" +msgstr "ایمیل" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:64 +msgid "Is read ?" +msgstr "خوانده شده ؟" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:53 +#: template/admin/list-index.phtml:64 template/admin/list-index.phtml:65 +msgid "Yes" +msgstr "بله" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:53 +#: template/admin/list-index.phtml:64 template/admin/list-index.phtml:65 +msgid "No" +msgstr "خیر" + +#: template/admin/list-index.phtml:53 template/admin/list-index.phtml:65 +msgid "Is deleted ?" +msgstr "حذف شده ؟" + +#: template/admin/list-index.phtml:85 +msgid "Message list is empty !" +msgstr "فهرست پیام ها خالی است !" + +#: template/front/_confirm-modal.phtml:5 +msgid "Delete this message?" +msgstr "این پیام حذف شود؟" + +#: template/front/_confirm-modal.phtml:8 template/front/index-detail.phtml:64 +#: template/front/index-index.phtml:55 template/front/notify-detail.phtml:52 +msgid "Once you delete this message, it cannot be undone." +msgstr "شما این پیام را حذف کردید ، این فرایند برگشت پذیر نیست." + +#: template/front/_confirm-modal.phtml:12 +msgid "Delete message" +msgstr "حذف پیام" + +#: template/front/_confirm-modal.phtml:14 +msgid "Cancel" +msgstr "لغو" + +#: template/front/index-detail.phtml:10 template/front/index-index.phtml:13 +#: template/front/notify-detail.phtml:10 template/front/notify-index.phtml:13 msgid "Private message" msgstr "پیام شخصی" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-archive.phtml:6 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-detail.phtml:9 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:10 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-detail.phtml:7 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:13 -msgid "Archive" -msgstr "آرشیو" +#: template/front/index-detail.phtml:14 template/front/index-index.phtml:17 +#: template/front/notify-detail.phtml:14 template/front/notify-index.phtml:8 +#: template/front/notify-index.phtml:17 +msgid "Notification" +msgstr "آگاهی رسانی" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-detail.phtml:57 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:47 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:96 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-detail.phtml:56 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:47 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:103 +#: template/front/index-detail.phtml:45 template/front/index-index.phtml:56 +#: template/front/index-index.phtml:102 template/front/notify-detail.phtml:53 +#: template/front/notify-index.phtml:53 msgid "Delete" msgstr "حذف" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-detail.phtml:92 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:46 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-detail.phtml:55 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:46 -msgid "Once you delete this message, it cannot be undone." -msgstr "شما این پیام را حذف کردید ، این فرایند برگشت پذیر نیست." +#: template/front/index-index.phtml:8 +msgid "Message" +msgstr "پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:60 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:95 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:63 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:102 +#: template/front/index-index.phtml:70 template/front/index-index.phtml:101 +#: template/front/notify-index.phtml:52 msgid "Mark as read" msgstr "به عنوان خوانده شده نشان کن" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:68 -msgid "To" -msgstr "به" - -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:68 -msgid "From" -msgstr "از" +#: template/front/index-index.phtml:76 +msgid "Read" +msgstr "مشاهده" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:82 -msgid "
No message for you!
" -msgstr "" -"
هیچ پیامی برای شما نیست !
" +#: template/front/index-index.phtml:89 +msgid "No message for you!" +msgstr "هیچ پیامی برای شما وجود ندارد !" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:92 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:99 +#: template/front/index-index.phtml:98 template/front/notify-index.phtml:49 msgid "Checked all" -msgstr "All Categories" +msgstr "انتخاب همه" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:94 -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:101 +#: template/front/index-index.phtml:100 template/front/notify-index.phtml:51 msgid "Massive operation" msgstr "عملکرد های پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-index.phtml:104 +#: template/front/index-index.phtml:113 msgid "Once you delete those message, it cannot be undone." msgstr "شما این پیام را حذف کردید ، این فرایند برگشت پذیر نیست." -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-send.phtml:3 +#: template/front/index-send.phtml:9 msgid "Return message list page" msgstr "بازگشت به صفحه فهرست پیام ها" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/index-send.phtml:5 +#: template/front/index-send.phtml:11 msgid "Write message" msgstr "نوشتن پیام" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-detail.phtml:5 -msgid "Messages" -msgstr "پیام ها" +#: template/front/notify-index.phtml:38 +msgid "No notification for you!" +msgstr "هیچ اطلاع رسانی برای شما وجود ندارد !" -#: /var/www/html/local/pi/pi-release-2.5.0/usr/module/message/template/front/notify-index.phtml:88 -msgid "" -"
No notification for you!
" -msgstr "" -"
هیچ آگاهی رسانی برای شما نیست !" -"
" - -#~ msgid "Need login" -#~ msgstr "برای استفاده وارد شوید" - -#~ msgid "Notification" -#~ msgstr "آگاهی رسانی" - -#~ msgid "New message" -#~ msgstr "پیام جدید" - -#~ msgid "Delete this message?" -#~ msgstr "این پیام حذف شود؟" - -#~ msgid "Delete message" -#~ msgstr "حذف پیام" +#~ msgid "This part not finished now !" +#~ msgstr "این بخش هنوز تکمیل نشده است !" #~ msgid "Delete these messages?" #~ msgstr "این پیام ها حذف شوند؟" @@ -185,3 +279,37 @@ msgstr "" #~ msgid "Delete messages" #~ msgstr "حذف پیام ها" + +#~ msgid "Message archive" +#~ msgstr "آرشیو پیام ها" + +#~ msgid "" +#~ "
No message for you!
" +#~ msgstr "" +#~ "
هیچ پیامی برای شما نیست !" + +#~ msgid "Messages" +#~ msgstr "پیام ها" + +#~ msgid "" +#~ "
No notification for you!" +#~ msgstr "" +#~ "
هیچ آگاهی رسانی برای شما " +#~ "نیست !
" + +#~ msgid "Notification(%s unread)" +#~ msgstr "آگاهی رسانی (%s خوانده نشده)" + +#~ msgid "Private message(%s unread)" +#~ msgstr "پایام خصوصی (%s خوانده نشده)" + +#~ msgid "Notification(%s unread)" +#~ msgstr "آگاهی رسانی (%s خوانده نشده)" + +#~ msgid "Need login" +#~ msgstr "برای استفاده وارد شوید" + +#~ msgid "New message" +#~ msgstr "پیام جدید" diff --git a/usr/module/message/locale/fa/mail/notification.txt b/usr/module/message/locale/fa/mail/notification.txt new file mode 100644 index 0000000000..8d69753510 --- /dev/null +++ b/usr/module/message/locale/fa/mail/notification.txt @@ -0,0 +1,17 @@ +[comment]Get new message[/comment] + +[format]html[/format] + +[subject]New message[/subject] + +[body] +
+

Dear %name%

+
You get new message on %site_name% website from %sender%.
+
Please log into the site to check your messages.
+
Don't reply to this email !
+ +
+[/body] \ No newline at end of file diff --git a/usr/module/message/locale/fr/admin.mo b/usr/module/message/locale/fr/admin.mo index 1712e20943..8ebd095056 100644 Binary files a/usr/module/message/locale/fr/admin.mo and b/usr/module/message/locale/fr/admin.mo differ diff --git a/usr/module/message/locale/fr/admin.po b/usr/module/message/locale/fr/admin.po index f53cd00792..4a93aaf323 100644 --- a/usr/module/message/locale/fr/admin.po +++ b/usr/module/message/locale/fr/admin.po @@ -1,33 +1,41 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2015-04-20 18:12+0100\n" -"PO-Revision-Date: 2015-04-20 18:12+0100\n" +"POT-Creation-Date: 2015-10-24 20:08+0100\n" +"PO-Revision-Date: 2015-10-24 20:08+0100\n" "Last-Translator: Marc Desrousseaux\n" "Language-Team: Marc Desrousseaux\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.4\n" +"X-Generator: Poedit 1.8.1\n" "X-Poedit-KeywordsList: _a;_t\n" -"X-Poedit-Basepath: .\n" +"X-Poedit-Basepath: ..\\..\\\n" "X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: C:\\Users\\LAPTOP MARC\\Documents\\GitHub\\pi\\usr" -"\\module\\message\n" +"X-Poedit-SearchPath-0: .\n" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/config/module.php:17 +#: config/module.php:17 msgid "Message" msgstr "Message" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/config/module.php:19 +#: config/module.php:19 msgid "A module to send message" msgstr "Module de gestion des messages et notifications" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/config/user.php:20 +#: config/navigation.php:16 config/page.php:17 config/permission.php:17 +msgid "List" +msgstr "Liste" + +#: config/navigation.php:26 config/page.php:22 config/permission.php:21 +msgid "Prune" +msgstr "Purger" + +#: config/navigation.php:36 config/page.php:27 config/permission.php:25 +msgid "Send" +msgstr "Envoyer" + +#: config/user.php:20 msgid "Messages" msgstr "Messages" diff --git a/usr/module/message/locale/fr/block.mo b/usr/module/message/locale/fr/block.mo index 9501887819..6239f863c9 100644 Binary files a/usr/module/message/locale/fr/block.mo and b/usr/module/message/locale/fr/block.mo differ diff --git a/usr/module/message/locale/fr/block.po b/usr/module/message/locale/fr/block.po index d8fce7c119..845fa9167f 100644 --- a/usr/module/message/locale/fr/block.po +++ b/usr/module/message/locale/fr/block.po @@ -1,20 +1,19 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2013-11-10 13:58+0800\n" -"PO-Revision-Date: 2014-05-18 23:19+0100\n" +"POT-Creation-Date: 2015-10-24 20:10+0100\n" +"PO-Revision-Date: 2015-10-24 20:10+0100\n" "Last-Translator: Marc Desrousseaux\n" "Language-Team: Marc Desrousseaux\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.6.5\n" +"X-Generator: Poedit 1.8.1\n" "X-Poedit-KeywordsList: _b\n" -"X-Poedit-Basepath: .\n" -"Language: fr\n" +"X-Poedit-Basepath: ..\\..\\\n" "X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: C:\\Users\\LAPTOP MARC\\Documents\\GitHub\\pi\\usr" -"\\module\\message\n" +"X-Poedit-SearchPath-0: .\n" #~ msgid "Checked all" #~ msgstr "All Categories" diff --git a/usr/module/message/locale/fr/default.mo b/usr/module/message/locale/fr/default.mo index 2a5d743fc1..2b94a6966b 100644 Binary files a/usr/module/message/locale/fr/default.mo and b/usr/module/message/locale/fr/default.mo differ diff --git a/usr/module/message/locale/fr/default.po b/usr/module/message/locale/fr/default.po index 2ca53171af..74b34474ca 100644 --- a/usr/module/message/locale/fr/default.po +++ b/usr/module/message/locale/fr/default.po @@ -1,196 +1,301 @@ msgid "" msgstr "" "Project-Id-Version: Pi-message\n" -"POT-Creation-Date: 2015-04-20 18:12+0100\n" -"PO-Revision-Date: 2015-04-20 19:25+0100\n" +"POT-Creation-Date: 2015-10-24 20:11+0100\n" +"PO-Revision-Date: 2015-10-24 20:34+0100\n" "Last-Translator: Marc Desrousseaux\n" "Language-Team: Marc Desrousseaux\n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.4\n" +"X-Generator: Poedit 1.8.1\n" "X-Poedit-KeywordsList: __;_e\n" -"X-Poedit-Basepath: .\n" +"X-Poedit-Basepath: ..\\..\\\n" "X-Poedit-SourceCharset: UTF-8\n" -"X-Poedit-SearchPath-0: C:\\Users\\LAPTOP MARC\\Documents\\GitHub\\pi\\usr" -"\\module\\message\n" +"X-Poedit-SearchPath-0: .\n" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:183 -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/NotifyController.php:42 +#: src/Api/Breadcrumbs.php:47 template/front/index-archive.phtml:17 +#: template/front/index-detail.phtml:14 template/front/index-index.phtml:17 +#: template/front/notify-detail.phtml:13 template/front/notify-index.phtml:15 +msgid "Archive" +msgstr "Archive" + +#: src/Api/Breadcrumbs.php:53 +msgid "Message detail" +msgstr "Détail du message" + +#: src/Api/Breadcrumbs.php:59 src/Controller/Front/IndexController.php:325 +msgid "Send message" +msgstr "Envoyer le message" + +#: src/Controller/Admin/PruneController.php:24 +msgid "" +"You can prune all old message, select time to remove messages before that " +"time and you can filter list of removed messages by this from option." +msgstr "" +"Vous pouvez purger les anciens messages, sélectionnez la date avant laquelle " +"les messages seront supprimés. Vous pouvez également filtrer la liste des " +"messages à supprimer en sélectionnant l'une des options de sélection." + +#: src/Controller/Admin/PruneController.php:41 #, php-format -msgid "Private message(%s unread)" -msgstr "Messages privés (%s non lus)" +msgid "%s old messages removed" +msgstr "%s anciens messages ont été supprimés définitement" + +#: src/Controller/Admin/PruneController.php:43 +msgid "No messages removed ! check your selected filter and try again" +msgstr "" +"Aucun message supprimé ! Vérifiez vos filtres de sélection et essayez de " +"nouveau." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:187 +#: src/Controller/Admin/PruneController.php:48 +msgid "Prune old messages" +msgstr "Purger les anciens messages" + +#: src/Controller/Front/IndexController.php:183 +#: src/Controller/Front/NotifyController.php:42 #, php-format -msgid "Notification(%s unread)" -msgstr "Notifications(%s non lues)" +msgid "Private message ( %s unread )" +msgstr "Message Privé ( %s non lu )" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:223 +#: src/Controller/Front/IndexController.php:187 +#: src/Controller/Front/NotifyController.php:46 +#, php-format +msgid "Notification ( %s unread )" +msgstr "Notification ( %s non lu)" + +#: src/Controller/Front/IndexController.php:223 msgid "Username is invalid, please try again." msgstr "Le nom de compte utilisateur est invalide, merci d'essayer de nouveau." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:239 -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:367 +#: src/Controller/Front/IndexController.php:239 +#: src/Controller/Front/IndexController.php:368 msgid "Send failed, please try again." msgstr "Envoi non effectué, merci d'essayer de nouveau" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:273 +#: src/Controller/Front/IndexController.php:274 msgid "User" msgstr "Utilisateur" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:277 +#: src/Controller/Front/IndexController.php:278 msgid "not found" msgstr "non trouvé" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:283 +#: src/Controller/Front/IndexController.php:284 msgid "Sorry, you can't send message to yourself." msgstr "Désolé, vous ne pouvez pas vous envoyer un message à vous-même." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:295 +#: src/Controller/Front/IndexController.php:296 msgid "An error occurred, please try again." msgstr "Une erreur est survenue, merci d'essayer de nouveau." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/IndexController.php:324 -msgid "Send message" -msgstr "Envoyer le message" +#: src/Form/PruneForm.php:34 +msgid "All messages Before" +msgstr "Tous les messages Avant" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Controller/Front/NotifyController.php:46 -#, php-format -msgid "Notification(%s unread)" -msgstr "Notifications(%s non lues)" +#: src/Form/PruneForm.php:50 +msgid "Just read messages by user" +msgstr "Uniquement les messages lus par l'utilisateur" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/ReplyForm.php:66 -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/SendForm.php:77 +#: src/Form/PruneForm.php:54 +msgid "Remove read messages by user before selected time" +msgstr "Supprimer les messages lus par les utilisateurs avant la date limite" + +#: src/Form/PruneForm.php:62 +msgid "Just deleted messages by user" +msgstr "Uniquement les messages supprimés par l'utilisateur" + +#: src/Form/PruneForm.php:66 +msgid "Remove deleted messages by user before selected time" +msgstr "" +"Supprimer les messages supprimés par les utilisateurs avant la date limite" + +#: src/Form/PruneForm.php:74 +msgid "Prune" +msgstr "Purge" + +#: src/Form/ReplyForm.php:66 src/Form/SendForm.php:77 msgid "Content" msgstr "Contenu" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/ReplyForm.php:86 -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/SendForm.php:93 +#: src/Form/ReplyForm.php:86 src/Form/SendForm.php:93 msgid "Send" msgstr "Envoyer" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/SendForm.php:55 +#: src/Form/SendForm.php:55 msgid "Recipient" msgstr "Destinataire" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/src/Form/SendForm.php:83 +#: src/Form/SendForm.php:83 msgid "Message content" msgstr "Contenu du message" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-archive.phtml:3 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-detail.phtml:6 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:6 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:10 -msgid "Private message" -msgstr "Message privé" +#: template/admin/list-index.phtml:4 +msgid "List of messages" +msgstr "Liste des messages" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-archive.phtml:6 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-detail.phtml:9 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:10 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-detail.phtml:7 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:13 -msgid "Archive" -msgstr "Archive" +#: template/admin/list-index.phtml:19 template/admin/list-index.phtml:40 +#: template/admin/list-index.phtml:48 template/front/index-detail.phtml:40 +#: template/front/index-index.phtml:50 +msgid "From" +msgstr "De" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-detail.phtml:57 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:47 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:96 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-detail.phtml:56 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:47 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:103 -msgid "Delete" -msgstr "Supprimer" +#: template/admin/list-index.phtml:21 template/admin/list-index.phtml:41 +#: template/admin/list-index.phtml:60 template/front/index-detail.phtml:40 +#: template/front/index-index.phtml:50 +msgid "To" +msgstr "A" + +#: template/admin/list-index.phtml:23 template/admin/list-index.phtml:42 +msgid "Send on" +msgstr "Envoyé le" + +#: template/admin/list-index.phtml:25 +msgid "ID" +msgstr "ID" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-detail.phtml:92 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:46 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-detail.phtml:55 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:46 +#: template/admin/list-index.phtml:31 +msgid "Full details" +msgstr "En détail" + +#: template/admin/list-index.phtml:38 +msgid "Close" +msgstr "Fermer" + +#: template/admin/list-index.phtml:50 template/admin/list-index.phtml:62 +msgid "Name" +msgstr "Nom" + +#: template/admin/list-index.phtml:51 template/admin/list-index.phtml:63 +msgid "Identity" +msgstr "Identité" + +#: template/admin/list-index.phtml:52 template/admin/list-index.phtml:64 +msgid "Email" +msgstr "Email" + +#: template/admin/list-index.phtml:53 template/admin/list-index.phtml:65 +msgid "Is read ?" +msgstr "Lu?" + +#: template/admin/list-index.phtml:53 template/admin/list-index.phtml:54 +#: template/admin/list-index.phtml:65 template/admin/list-index.phtml:66 +msgid "Yes" +msgstr "Oui" + +#: template/admin/list-index.phtml:53 template/admin/list-index.phtml:54 +#: template/admin/list-index.phtml:65 template/admin/list-index.phtml:66 +msgid "No" +msgstr "Non" + +#: template/admin/list-index.phtml:54 template/admin/list-index.phtml:66 +msgid "Is deleted ?" +msgstr "Supprimé?" + +#: template/admin/list-index.phtml:85 +msgid "Message list is empty !" +msgstr "La liste de message est vide !" + +#: template/admin/send-index.phtml:3 +msgid "This part not finished now !" +msgstr "Cette fonctionnalité n'est pas encore finalisée !" + +#: template/front/_confirm-modal.phtml:4 +msgid "Delete this message?" +msgstr "Supprimer ce message?" + +#: template/front/_confirm-modal.phtml:7 template/front/index-detail.phtml:97 +#: template/front/index-index.phtml:69 template/front/notify-detail.phtml:65 +#: template/front/notify-index.phtml:51 msgid "Once you delete this message, it cannot be undone." msgstr "" "Une fois la suppression de ce message effectuée, vous ne pourrez pas " "l'annuler." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:60 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:95 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:63 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:102 -msgid "Mark as read" -msgstr "Marquer comme lu" +#: template/front/_confirm-modal.phtml:11 +msgid "Delete message" +msgstr "Supprimer ce message" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:68 -msgid "To" -msgstr "A" +#: template/front/_confirm-modal.phtml:20 +msgid "Delete these messages?" +msgstr "Supprimer ces messages?" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:68 -msgid "From" -msgstr "De" +#: template/front/_confirm-modal.phtml:23 +msgid "Once you delete these messages, they cannot be undone." +msgstr "" +"Une fois que vous avez supprimé ces messages, l'action ne peut être annulée." + +#: template/front/_confirm-modal.phtml:27 +msgid "Delete messages" +msgstr "Supprimer les messages" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:82 +#: template/front/index-archive.phtml:8 +msgid "Message archive" +msgstr "Archive des messages" + +#: template/front/index-archive.phtml:13 template/front/index-detail.phtml:10 +#: template/front/index-index.phtml:13 template/front/notify-index.phtml:11 +msgid "Private message" +msgstr "Message privé" + +#: template/front/index-detail.phtml:60 template/front/index-index.phtml:70 +#: template/front/index-index.phtml:111 template/front/notify-detail.phtml:66 +#: template/front/notify-index.phtml:52 template/front/notify-index.phtml:110 +msgid "Delete" +msgstr "Supprimer" + +#: template/front/index-index.phtml:8 +msgid "Message" +msgstr "Message" + +#: template/front/index-index.phtml:84 template/front/index-index.phtml:110 +#: template/front/notify-index.phtml:68 template/front/notify-index.phtml:109 +msgid "Mark as read" +msgstr "Marquer comme lu" + +#: template/front/index-index.phtml:97 msgid "
No message for you!
" msgstr "" "
Aucun message pour vous !
" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:92 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:99 +#: template/front/index-index.phtml:107 template/front/notify-index.phtml:106 msgid "Checked all" msgstr "Sélectionner Tout" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:94 -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:101 +#: template/front/index-index.phtml:109 template/front/notify-index.phtml:108 msgid "Massive operation" msgstr "Opération de masse" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-index.phtml:104 +#: template/front/index-index.phtml:120 msgid "Once you delete those message, it cannot be undone." msgstr "" "Une fois la suppression du message effectuée, vous ne pourrez pas l'annuler." -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-send.phtml:3 +#: template/front/index-send.phtml:9 msgid "Return message list page" msgstr "Retourner à la page de liste des messages" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/index-send.phtml:5 +#: template/front/index-send.phtml:11 msgid "Write message" msgstr "Ecrire un message" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-detail.phtml:5 +#: template/front/notify-detail.phtml:9 msgid "Messages" msgstr "Messages" -#: C:\Users\LAPTOP -#: MARC\Documents\GitHub\pi\usr\module\message/template/front/notify-index.phtml:88 +#: template/front/notify-index.phtml:95 msgid "" "
No notification for you!
" msgstr "" "
Aucune notification pour vous !" "
" + +#~ msgid "Private message(%s unread)" +#~ msgstr "Messages privés (%s non lus)" + +#~ msgid "Notification(%s unread)" +#~ msgstr "Notifications(%s non lues)" + +#~ msgid "Notification(%s unread)" +#~ msgstr "Notifications(%s non lues)" diff --git a/usr/module/message/locale/fr/mail/notification.txt b/usr/module/message/locale/fr/mail/notification.txt new file mode 100644 index 0000000000..539d1c4fcb --- /dev/null +++ b/usr/module/message/locale/fr/mail/notification.txt @@ -0,0 +1,17 @@ +[comment]Get new message[/comment] + +[format]html[/format] + +[subject]Nouveau message reçu sur %site_name%[/subject] + +[body] +
+

Dear %name%,

+
Tu as reçu un nouveau message de la part de %sender% sur le site %site_name% .
+
Connecte-toi sur le site pour lire tes messages.
+
Merci de ne pas répondre à ce mail !
+ +
+[/body] \ No newline at end of file diff --git a/usr/module/message/sql/mysql.sql b/usr/module/message/sql/mysql.sql index aec64020e0..ddb87085cd 100644 --- a/usr/module/message/sql/mysql.sql +++ b/usr/module/message/sql/mysql.sql @@ -8,8 +8,15 @@ CREATE TABLE `{message}` ( `is_read_to` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, `is_deleted_from` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, `is_deleted_to` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0, - - PRIMARY KEY (`id`) + `conversation` VARCHAR(32) NOT NULL DEFAULT '', + PRIMARY KEY (`id`), + KEY `conversation` (`conversation`), + KEY `uid_from` (`uid_from`), + KEY `uid_to` (`uid_to`), + KEY `time_send` (`time_send`), + KEY `select_1` (`uid_from`, `is_deleted_from`), + KEY `select_2` (`uid_to`, `is_deleted_to`), + KEY `unread` (`uid_to`, `is_deleted_to`, `is_read_to`) ); CREATE TABLE `{notification}` ( diff --git a/usr/module/message/src/Api/Api.php b/usr/module/message/src/Api/Api.php index 0575ce994b..6fd7d021ce 100644 --- a/usr/module/message/src/Api/Api.php +++ b/usr/module/message/src/Api/Api.php @@ -41,7 +41,10 @@ * Pi::user()->message()->getAlert(1); * or * Pi::api('api', 'message')->getAlert(1); - * ``` + * // get Unread + * Pi::api('api', 'message')->getUnread($uid, $type); + * // + * Pi::api('api', 'message')->setConversation(); * * @author Xingyu Ji */ @@ -53,12 +56,15 @@ class Api extends AbstractApi * @param int $to * @param string $message * @param int $from + * @param string $conversation * @return bool */ - public function send($to, $message, $from) + public function send($to, $message, $from, $conversation = '') { $result = true; $model = Pi::model('message', $this->getModule()); + + $conversation = empty($conversation) ? $this->setConversation() : $conversation; $messageData = array( 'uid_from' => $from, 'uid_to' => $to, @@ -66,6 +72,7 @@ public function send($to, $message, $from) 'is_read_from' => 1, 'content' => $message, 'time_send' => time(), + 'conversation' => $conversation, ); $row = $model->createRow($messageData); try { @@ -81,6 +88,9 @@ public function send($to, $message, $from) // increase message alert $this->increaseAlert($to); + // Send mail + $this->sendMail($to, $message, $from); + return $result; } @@ -220,4 +230,229 @@ public function increaseAlert($uid) { return Pi::user()->data()->increment($uid, 'message-alert', 1); } + + /** + * Send notification as mail + * + * @param int $uid + * @return bool + */ + public function sendMail($to, $message, $from) + { + if (Pi::service('module')->isActive('notification')) { + // Get user info + $user = Pi::user()->get($to, array( + 'id', 'identity', 'name', 'email' + )); + // Get sender info + $sender = Pi::user()->get($from, array( + 'id', 'identity', 'name', 'email' + )); + // Set to user + $toUser = array( + $user['email'] => $user['name'], + ); + // Set information + $information = array( + 'name' => $user['name'], + 'sender' => $sender['name'], + ); + // Send mail + Pi::api('mail', 'notification')->send( + $toUser, + 'notification', + $information, + 'message' + ); + } + } + + /** + * Message summary + * + * @param string $message + * @param int $length + * @return string + */ + /* public static function messageSummary($message, $length = 40) + { + $encoding = Pi::service('i18n')->getCharset(); + $message = trim($message); + + if ($length && strlen($message) > $length) { + $wordscut = ''; + if (strtolower($encoding) == 'utf-8') { + $n = 0; + $tn = 0; + $noc = 0; + while ($n < strlen($message)) { + $t = ord($message[$n]); + if ($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { + $tn = 1; + $n++; + $noc++; + } elseif (194 <= $t && $t <= 223) { + $tn = 2; + $n += 2; + $noc += 2; + } elseif (224 <= $t && $t < 239) { + $tn = 3; + $n += 3; + $noc += 2; + } elseif (240 <= $t && $t <= 247) { + $tn = 4; + $n += 4; + $noc += 2; + } elseif (248 <= $t && $t <= 251) { + $tn = 5; + $n += 5; + $noc += 2; + } elseif ($t == 252 || $t == 253) { + $tn = 6; + $n += 6; + $noc += 2; + } else { + $n++; + } + if ($noc >= $length) { + break; + } + } + if ($noc > $length) { + $n -= $tn; + } + $wordscut = substr($message, 0, $n); + } else { + for ($i = 0; $i < $length - 1; $i++) { + if (ord($message[$i]) > 127) { + $wordscut .= $message[$i] . $message[$i + 1]; + $i++; + } else { + $wordscut .= $message[$i]; + } + } + } + $message = $wordscut . '...'; + } + + return trim($message); + } */ + + /** + * Get unread message count + * + * @param int $uid + * @param string $type + * @return int|false + */ + public static function getUnread($uid, $type = '') + { + switch ($type) { + case 'message': + case 'notification': + break; + default: + $type = ''; + break; + } + if ('notification' == $type) { + $where = array( + 'uid' => $uid, + 'is_deleted' => 0, + 'is_read' => 0, + ); + $model = Pi::model('notification', 'message'); + /* + $select = $model->select(); + $select->columns(array( + 'count' => Pi::db()->expression('count(*)'), + )); + $select->where($where); + $row = $model->selectWith($select)->current(); + $count = (int) $row['count']; + */ + $count = $model->count($where); + } elseif ('message' == $type) { + $where = array( + 'uid_to' => $uid, + 'is_deleted_to' => 0, + 'is_read_to' => 0, + ); + $model = Pi::model('message', 'message'); + /* + $select = $model->select(); + $select->columns(array( + 'count' => Pi::db()->expression('count(*)'), + )); + $select->where($where); + $row = $model->selectWith($select)->current(); + $count = (int) $row['count']; + */ + $count = $model->count($where); + } else { + $count = static::getUnread($uid, 'message') + + static::getUnread($uid, 'notification'); + } + + return $count; + } + + public function setConversation($time = '') + { + $time = !empty($time) ? $time : time(); + return md5($time); + } + + public function canonizeMessage($message) + { + // Set message to array + $message = $message->toArray(); + //current user id + $userId = Pi::user()->getUser()->id; + // Set modle + $model = Pi::model('message', $this->getModule()); + // Get user + if ($userId == $message['uid_from']) { + //get username url + $user = Pi::user()->getUser($message['uid_to']) + ?: Pi::user()->getUser(0); + $message['name'] = $user->name; + } else { + //get username url + $user = Pi::user()->getUser($message['uid_from']) + ?: Pi::user()->getUser(0); + $message['name'] = $user->name; + } + + // Get avatar + $message['avatar'] = Pi::user()->avatar($message['uid_from'], 'medium', array( + 'alt' => $user->name, + 'class' => 'img-circle', + )); + + // Set profile Url + $message['profileUrl'] = Pi::user()->getUrl( + 'profile', + $message['uid_from'] + ); + + // Set content type + $type = ($this->is_html($message['content'])) ? 'html' : 'text'; + + //markup content + $message['content'] = Pi::service('markup')->render($message['content'], 'html', $type); + + if (!$message['is_read_to'] && $userId == $message['uid_to']) { + //mark the message as read + $model->update(array('is_read_to' => 1), array('id' => $message['id'])); + } + + return $message; + } + + public function is_html($message) + { + // return $string != strip_tags($string) ? true:false; + return preg_match("/<[^<]+>/",$message,$m) != 0; + } } diff --git a/usr/module/message/src/Api/Breadcrumbs.php b/usr/module/message/src/Api/Breadcrumbs.php new file mode 100644 index 0000000000..3e1c458793 --- /dev/null +++ b/usr/module/message/src/Api/Breadcrumbs.php @@ -0,0 +1,66 @@ + + */ +namespace Module\Message\Api; + +use Pi; +use Pi\Application\Api\AbstractBreadcrumbs; + +class Breadcrumbs extends AbstractBreadcrumbs +{ + /** + * {@inheritDoc} + */ + public function load() + { + // Get params + $params = Pi::service('url')->getRouteMatch()->getParams(); + // Set module link + $moduleData = Pi::registry('module')->read($this->getModule()); + // Set index link + if ($params['action'] == 'index') { + $href = ''; + } else { + $href = Pi::service('url')->assemble('default', array( + 'module' => $this->getModule(), + )); + } + // Set result + $result = array(); + $result[] = array( + 'label' => $moduleData['title'], + 'href' => $href, + ); + // Set module internal links + switch ($params['action']) { + case 'archive': + $result[] = array( + 'label' => __('Archive'), + ); + break; + + case 'detail': + $result[] = array( + 'label' => __('Message detail'), + ); + break; + + case 'send': + $result[] = array( + 'label' => __('Send message'), + ); + break; + } + + return $result; + } +} diff --git a/usr/module/message/src/Controller/Admin/IndexController.php b/usr/module/message/src/Controller/Admin/IndexController.php new file mode 100644 index 0000000000..8a356e0aac --- /dev/null +++ b/usr/module/message/src/Controller/Admin/IndexController.php @@ -0,0 +1,27 @@ + + */ +namespace Module\Message\Controller\Admin; + +use Pi; +use Pi\Mvc\Controller\ActionController; + +class IndexController extends ActionController +{ + public function indexAction() + { + return $this->redirect()->toRoute('', array( + 'controller' => 'list', + 'action' => 'index', + )); + } +} \ No newline at end of file diff --git a/usr/module/message/src/Controller/Admin/ListController.php b/usr/module/message/src/Controller/Admin/ListController.php new file mode 100644 index 0000000000..b43376df76 --- /dev/null +++ b/usr/module/message/src/Controller/Admin/ListController.php @@ -0,0 +1,81 @@ + + */ +namespace Module\Message\Controller\Admin; + +use Pi; +use Pi\Mvc\Controller\ActionController; +use Pi\Paginator\Paginator; +use Zend\Db\Sql\Predicate\Expression; + +class ListController extends ActionController +{ + public function indexAction() + { + // Get page + $page = $this->params('page', 1); + $list = array(); + $limit = 50; + // Set info + $order = array('time_send DESC', 'id DESC'); + $offset = (int)($page - 1) * $limit; + // Get info + $select = $this->getModel('message')->select()->order($order)->offset($offset)->limit($limit); + $rowset = $this->getModel('message')->selectWith($select); + // Make list + foreach ($rowset as $row) { + $list[$row->id] = $row->toArray(); + // markup content + $list[$row->id]['content'] = Pi::service('markup')->compile( + $row->content, + 'html', + array('nl2br' => false) + ); + // content Short + $list[$row->id]['contentShort'] = (mb_strlen(strip_tags($row->content), 'utf-8') > 300) ? mb_substr(strip_tags($row->content), 0, 300, 'utf-8' ) . ' ... ' : strip_tags($row->content); + // user from + $list[$row->id]['userFrom'] = Pi::user()->getUser($row->uid_from)->toArray(); + $list[$row->id]['userFrom']['avatar'] = Pi::user()->avatar($row->uid_from, 'medium', array( + 'alt' => $list[$row->id]['userFrom']['name'], + 'class' => 'img-circle', + )); + // user to + $list[$row->id]['userTo'] = Pi::user()->getUser($row->uid_to)->toArray(); + $list[$row->id]['userTo']['avatar'] = Pi::user()->avatar($row->uid_to, 'medium', array( + 'alt' => $list[$row->id]['userTo']['name'], + 'class' => 'img-circle', + )); + // Tiem send view + $list[$row->id]['time_send_view'] = _date($row->time_send); + } + // Set paginator + $columns = array('count' => new Expression('count(*)')); + $select = $this->getModel('message')->select()->columns($columns); + $count = $this->getModel('message')->selectWith($select)->current()->count; + $paginator = Paginator::factory(intval($count)); + $paginator->setItemCountPerPage($limit); + $paginator->setCurrentPageNumber($page); + $paginator->setUrlOptions(array( + 'router' => $this->getEvent()->getRouter(), + 'route' => $this->getEvent()->getRouteMatch()->getMatchedRouteName(), + 'params' => array_filter(array( + 'module' => $this->getModule(), + 'controller' => 'list', + 'action' => 'index', + )), + )); + // Set view + $this->view()->setTemplate('list-index'); + $this->view()->assign('list', $list); + $this->view()->assign('paginator', $paginator); + } +} \ No newline at end of file diff --git a/usr/module/message/src/Controller/Admin/PruneController.php b/usr/module/message/src/Controller/Admin/PruneController.php new file mode 100644 index 0000000000..ea62b3d383 --- /dev/null +++ b/usr/module/message/src/Controller/Admin/PruneController.php @@ -0,0 +1,51 @@ + + */ +namespace Module\Message\Controller\Admin; + +use Pi; +use Pi\Mvc\Controller\ActionController; +use Module\Message\Form\PruneForm; + +class PruneController extends ActionController +{ + public function indexAction() + { + $form = new PruneForm('prune'); + $message = __('You can prune all old message, select time to remove messages before that time and you can filter list of removed messages by this from option.'); + if ($this->request->isPost()) { + // Set form date + $values = $this->request->getPost(); + // Set prune create + $where = array('`time_send` < ?' => strtotime($values['date'])); + // Set prune read + if ($values['read']) { + $where['is_read_to'] = 1; + } + // Set prune deleted + if ($values['deleted']) { + $where['is_deleted_to'] = 1; + } + // Delete storys + $number = Pi::model('message', $this->params('module'))->delete($where); + if ($number) { + $message = sprintf(__('%s old messages removed'), $number); + } else { + $message = __('No messages removed ! check your selected filter and try again'); + } + } + $this->view()->setTemplate('prune-index'); + $this->view()->assign('form', $form); + $this->view()->assign('title', __('Prune old messages')); + $this->view()->assign('message', $message); + } +} \ No newline at end of file diff --git a/usr/module/message/src/Controller/Front/IndexController.php b/usr/module/message/src/Controller/Front/IndexController.php index 78a6e2bd9c..1f34701bfc 100755 --- a/usr/module/message/src/Controller/Front/IndexController.php +++ b/usr/module/message/src/Controller/Front/IndexController.php @@ -86,6 +86,7 @@ public function indexAction() $where->andPredicate($fromWhere) ->orPredicate($toWhere); }) + ->group(new \Zend\Db\Sql\Predicate\Expression('conversation DESC')) ->order('time_send DESC') ->limit($limit) ->offset($offset); @@ -103,15 +104,13 @@ public function indexAction() } array_walk($messageList, function (&$v, $k) use ($userId) { - //format messages -// $v['content'] = Service::messageSummary($v['content']); - // markup content $v['content'] = Pi::service('markup')->compile( $v['content'], 'html', array('nl2br' => false) ); + $v['content'] = (mb_strlen(strip_tags($v['content']), 'utf-8') > 300) ? mb_substr(strip_tags($v['content']), 0, 300, 'utf-8' ) . ' ... ' : strip_tags($v['content']); if ($userId == $v['uid_from']) { $v['is_read'] = 1; @@ -122,8 +121,6 @@ public function indexAction() // username link, 4 locations $v['profileUrl'] = Pi::user()->getUrl('profile', $v['uid_to']); - //get avatar - $v['avatar'] = Pi::user()->avatar($v['uid_to'], 'small'); } else { $v['is_read'] = $v['is_read_to']; $user = Pi::user()->getUser($v['uid_from']) @@ -132,10 +129,14 @@ public function indexAction() $v['name'] = $user->name; $v['profileUrl'] = Pi::user()->getUrl('profile', $v['uid_from']); - //get avatar - $v['avatar'] = Pi::user()->avatar($v['uid_from'], 'small'); } + //get avatar + $v['avatar'] = Pi::user()->avatar($v['uid_from'], 'medium', array( + 'alt' => $user->name, + 'class' => 'img-circle', + )); + unset( $v['is_read_from'], $v['is_read_to'], @@ -180,12 +181,12 @@ protected function renderNav() $userId = Pi::user()->getUser()->id; $messageTitle = sprintf( - __('Private message(%s unread)'), - Service::getUnread($userId, 'message') + __('Private message ( %s unread )'), + _number(Pi::api('api', 'message')->getUnread($userId, 'message')) ); $notificationTitle = sprintf( - __('Notification(%s unread)'), - Service::getUnread($userId, 'notification') + __('Notification ( %s unread )'), + _number(Pi::api('api', 'message')->getUnread($userId, 'notification')) ); $this->view()->assign('messageTitle', $messageTitle); $this->view()->assign('notificationTitle', $notificationTitle); @@ -260,6 +261,7 @@ public function sendAction() */ public function checkUsernameAction() { + Pi::service('authentication')->requireLogin(); try { $username = _get('username', 'string'); $user = Pi::user()->getUser($username, 'identity'); @@ -336,14 +338,22 @@ public function detailAction() Pi::service('authentication')->requireLogin(); $messageId = _get('mid', 'int'); $messageId = $messageId ?: 0; - //current user id + // Current user id $userId = Pi::user()->getUser()->id; - + // Get message detail + $detail = $this->showDetail($messageId); + if ($userId == $detail['uid_from']) { + $toId = $detail['uid_to']; + } else { + $toId = $detail['uid_from']; + } + // Set form $form = new ReplyForm('reply'); $form->setAttribute('action', $this->url('', array( 'action' => 'detail', 'mid' => $messageId, ))); + // Manage post reply if ($this->request->isPost()) { $post = $this->request->getPost(); $form->setData($post); @@ -355,11 +365,11 @@ public function detailAction() return; } $data = $form->getData(); - $result = Pi::api('api', 'message')->send( $data['uid_to'], $data['content'], - $userId + $userId, + $detail['conversation'] ); if (!$result) { $this->view()->assign( @@ -378,16 +388,27 @@ public function detailAction() )); return; - } else { - $detail = $this->showDetail($messageId); - if ($userId == $detail['uid_from']) { - $toId = $detail['uid_to']; - } else { - $toId = $detail['uid_from']; - } - $form->setData(array('uid_to' => $toId)); - $this->view()->assign('form', $form); } + // Set to form + $form->setData(array('uid_to' => $toId)); + // Get list of conversations + $list = array(); + $where = array( + 'conversation' => $detail['conversation'], + 'is_deleted_from' => 0, + 'is_deleted_to' => 0 + ); + $order = array('time_send ASC', 'id ASC'); + $model = $this->getModel('message'); + $select = $model->select()->where($where)->order($order); + $rowset = $model->selectWith($select); + foreach ($rowset as $row) { + $list[$row->id] = Pi::api('api', 'message')->canonizeMessage($row); + } + + // Set view + $this->view()->assign('form', $form); + $this->view()->assign('list', $list); } /** @@ -421,13 +442,8 @@ protected function showDetail($messageId) return; } $detail = $rowset->toArray(); - //get avatar - $detail['avatar'] = Pi::user()->avatar($detail['uid_from'], 'small'); - $detail['profileUrl'] = Pi::user()->getUrl( - 'profile', - $detail['uid_from'] - ); + // Get user if ($userId == $detail['uid_from']) { //get username url $user = Pi::user()->getUser($detail['uid_to']) @@ -440,6 +456,18 @@ protected function showDetail($messageId) $detail['name'] = $user->name; } + // Get avatar + $detail['avatar'] = Pi::user()->avatar($detail['uid_from'], 'medium', array( + 'alt' => $user->name, + 'class' => 'img-circle', + )); + + // Set profile Url + $detail['profileUrl'] = Pi::user()->getUrl( + 'profile', + $detail['uid_from'] + ); + //markup content $detail['content'] = Pi::service('markup')->render($detail['content'], 'html', 'html'); @@ -462,6 +490,7 @@ protected function showDetail($messageId) */ public function markAction() { + Pi::service('authentication')->requireLogin(); $messageIds = _get('ids', 'regexp', array('regexp' => '/^[0-9,]+$/')); $page = _get('p', 'int'); $page = $page ?: 1; @@ -499,6 +528,7 @@ public function markAction() */ public function deleteAction() { + Pi::service('authentication')->requireLogin(); $messageIds = _get('ids', 'regexp', array('regexp' => '/^[0-9,]+$/')); $toId = _get('tid', 'int'); $page = _get('p', 'int'); @@ -548,13 +578,4 @@ public function deleteAction() return; } - - /* - * Archive - */ - public function archiveAction() - { - Pi::service('authentication')->requireLogin(); - $this->renderNav(); - } -} +} \ No newline at end of file diff --git a/usr/module/message/src/Controller/Front/NotifyController.php b/usr/module/message/src/Controller/Front/NotifyController.php index eca2ee9e9b..a94c77bfcd 100644 --- a/usr/module/message/src/Controller/Front/NotifyController.php +++ b/usr/module/message/src/Controller/Front/NotifyController.php @@ -36,15 +36,16 @@ class NotifyController extends ActionController protected function renderNav() { //current user id + Pi::service('authentication')->requireLogin(); $userId = Pi::user()->getUser()->id; $messageTitle = sprintf( - __('Private message(%s unread)'), - Service::getUnread($userId, 'message') + __('Private message ( %s unread )'), + _number(Pi::api('api', 'message')->getUnread($userId, 'message')) ); $notificationTitle = sprintf( - __('Notification(%s unread)'), - Service::getUnread($userId, 'notification') + __('Notification ( %s unread )'), + _number(Pi::api('api', 'message')->getUnread($userId, 'notification')) ); $this->view()->assign('messageTitle', $messageTitle); $this->view()->assign('notificationTitle', $notificationTitle); @@ -131,8 +132,6 @@ public function indexAction() } $this->renderNav(); $this->view()->assign('notifications', $notificationList); - - return; } /** @@ -164,7 +163,7 @@ public function detailAction() $detail = $rowset->toArray(); //markup content - $detail['content'] = Pi::service('markup')->render($detail['content']); + $detail['content'] = Pi::service('markup')->render($detail['content'], 'html', 'html'); if (!$detail['is_read']) { //mark the notification as read diff --git a/usr/module/message/src/Form/PruneForm.php b/usr/module/message/src/Form/PruneForm.php new file mode 100644 index 0000000000..4361c9ee3f --- /dev/null +++ b/usr/module/message/src/Form/PruneForm.php @@ -0,0 +1,78 @@ + + */ +namespace Module\Message\Form; + +use Pi; +use Pi\Form\Form as BaseForm; + +class PruneForm extends BaseForm +{ + protected $options; + + public function __construct($name = null, $options = array()) + { + parent::__construct($name); + } + + public function init() + { + // date + $this->add(array( + 'name' => 'date', + 'type' => 'datepicker', + 'options' => array( + 'label' => __('All messages Before'), + 'datepicker' => array( + 'format' => 'yyyy-mm-dd', + ), + ), + 'attributes' => array( + 'id' => 'time-start', + 'required' => true, + 'value' => date('Y-m-d', strtotime("-3 Months")), + ) + )); + // read + $this->add(array( + 'name' => 'read', + 'type' => 'checkbox', + 'options' => array( + 'label' => __('Just read messages by user'), + ), + 'attributes' => array( + 'value' => 0, + 'description' => __('Remove read messages by user before selected time'), + ) + )); + // deleted + $this->add(array( + 'name' => 'deleted', + 'type' => 'checkbox', + 'options' => array( + 'label' => __('Just deleted messages by user'), + ), + 'attributes' => array( + 'value' => 0, + 'description' => __('Remove deleted messages by user before selected time'), + ) + )); + // Submit + $this->add(array( + 'name' => 'submit', + 'type' => 'submit', + 'attributes' => array( + 'value' => __('Prune'), + ) + )); + } +} \ No newline at end of file diff --git a/usr/module/message/src/Form/ReplyForm.php b/usr/module/message/src/Form/ReplyForm.php index 8c4ef9cf3e..80da16987d 100644 --- a/usr/module/message/src/Form/ReplyForm.php +++ b/usr/module/message/src/Form/ReplyForm.php @@ -69,6 +69,7 @@ public function init() ), 'attributes' => array( 'type' => 'editor', + 'rows' => '5', ), )); @@ -81,8 +82,9 @@ public function init() $this->add(array( 'name' => 'submit', + 'type' => 'submit', 'attributes' => array( - 'type' => 'submit', + 'class' => 'btn btn-primary', 'value' => __('Send'), ) )); diff --git a/usr/module/message/src/Form/SendForm.php b/usr/module/message/src/Form/SendForm.php index 18873a0dd0..835b84952e 100755 --- a/usr/module/message/src/Form/SendForm.php +++ b/usr/module/message/src/Form/SendForm.php @@ -81,8 +81,8 @@ public function init() 'attributes' => array( 'type' => 'editor', 'placeholder' => __('Message content'), - 'rows' => 5 - ), + 'rows' => '5', + ), )); $this->add(array( diff --git a/usr/module/message/src/Installer/Action/Update.php b/usr/module/message/src/Installer/Action/Update.php new file mode 100644 index 0000000000..1f72a8a047 --- /dev/null +++ b/usr/module/message/src/Installer/Action/Update.php @@ -0,0 +1,154 @@ + + */ +namespace Module\Message\Installer\Action; + +use Pi; +use Pi\Application\Installer\Action\Update as BasicUpdate; +use Pi\Application\Installer\SqlSchema; +use Zend\EventManager\Event; + +class Update extends BasicUpdate +{ + /** + * {@inheritDoc} + */ + protected function attachDefaultListeners() + { + $events = $this->events; + $events->attach('update.pre', array($this, 'updateSchema')); + parent::attachDefaultListeners(); + + return $this; + } + + /** + * {@inheritDoc} + */ + public function updateSchema(Event $e) + { + $moduleVersion = $e->getParam('version'); + + // Set message model + $messageModel = Pi::model('message', $this->module); + $messageTable = $messageModel->getTable(); + $messageAdapter = $messageModel->getAdapter(); + + // Update to version 1.0.3 + if (version_compare($moduleVersion, '1.0.3', '<')) { + // Alter table : ADD conversation + $sql = sprintf("ALTER TABLE %s ADD `conversation` VARCHAR(32) NOT NULL DEFAULT '' , ADD INDEX (`conversation`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `uid_from` (`uid_from`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `uid_to` (`uid_to`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `time_send` (`time_send`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `select_1` (`uid_from`, `is_deleted_from`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `select_2` (`uid_to`, `is_deleted_to`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + + // Add index + $sql = sprintf("ALTER TABLE %s ADD INDEX `unread` (`uid_to`, `is_deleted_to`, `is_read_to`)", $messageTable); + try { + $messageAdapter->query($sql, 'execute'); + } catch (\Exception $exception) { + $this->setResult('db', array( + 'status' => false, + 'message' => 'Table alter query failed: ' + . $exception->getMessage(), + )); + return false; + } + } + + // Update to version 1.0.4 + if (version_compare($moduleVersion, '1.0.4', '<')) { + // Update value + $select = $messageModel->select(); + $rowset = $messageModel->selectWith($select); + foreach ($rowset as $row) { + $conversation = Pi::api('api', 'message')->setConversation($row->time_send); + $row->conversation = $conversation; + $row->save(); + } + } + + return true; + } +} \ No newline at end of file diff --git a/usr/module/message/src/Service.php b/usr/module/message/src/Service.php deleted file mode 100644 index 1d55db3367..0000000000 --- a/usr/module/message/src/Service.php +++ /dev/null @@ -1,153 +0,0 @@ - - */ -class Service -{ - /** - * Message summary - * - * @param string $message - * @param int $length - * @return string - */ - public static function messageSummary($message, $length = 40) - { - $encoding = Pi::service('i18n')->getCharset(); - $message = trim($message); - - if ($length && strlen($message) > $length) { - $wordscut = ''; - if (strtolower($encoding) == 'utf-8') { - $n = 0; - $tn = 0; - $noc = 0; - while ($n < strlen($message)) { - $t = ord($message[$n]); - if ($t == 9 || $t == 10 || (32 <= $t && $t <= 126)) { - $tn = 1; - $n++; - $noc++; - } elseif (194 <= $t && $t <= 223) { - $tn = 2; - $n += 2; - $noc += 2; - } elseif (224 <= $t && $t < 239) { - $tn = 3; - $n += 3; - $noc += 2; - } elseif (240 <= $t && $t <= 247) { - $tn = 4; - $n += 4; - $noc += 2; - } elseif (248 <= $t && $t <= 251) { - $tn = 5; - $n += 5; - $noc += 2; - } elseif ($t == 252 || $t == 253) { - $tn = 6; - $n += 6; - $noc += 2; - } else { - $n++; - } - if ($noc >= $length) { - break; - } - } - if ($noc > $length) { - $n -= $tn; - } - $wordscut = substr($message, 0, $n); - } else { - for ($i = 0; $i < $length - 1; $i++) { - if (ord($message[$i]) > 127) { - $wordscut .= $message[$i] . $message[$i + 1]; - $i++; - } else { - $wordscut .= $message[$i]; - } - } - } - $message = $wordscut . '...'; - } - - return trim($message); - } - - /** - * Get unread message count - * - * @param int $uid - * @param string $type - * @return int|false - */ - public static function getUnread($uid, $type = '') - { - switch ($type) { - case 'message': - case 'notification': - break; - default: - $type = ''; - break; - } - if ('notification' == $type) { - $where = array( - 'uid' => $uid, - 'is_deleted' => 0, - 'is_read' => 0, - ); - $model = Pi::model('notification', 'message'); - /* - $select = $model->select(); - $select->columns(array( - 'count' => Pi::db()->expression('count(*)'), - )); - $select->where($where); - $row = $model->selectWith($select)->current(); - $count = (int) $row['count']; - */ - $count = $model->count($where); - } elseif ('message' == $type) { - $where = array( - 'uid_to' => $uid, - 'is_deleted_to' => 0, - 'is_read_to' => 0, - ); - $model = Pi::model('message', 'message'); - /* - $select = $model->select(); - $select->columns(array( - 'count' => Pi::db()->expression('count(*)'), - )); - $select->where($where); - $row = $model->selectWith($select)->current(); - $count = (int) $row['count']; - */ - $count = $model->count($where); - } else { - $count = static::getCount($uid, 'message') - + static::getCount($uid, 'notification'); - } - - return $count; - } -} diff --git a/usr/module/message/template/admin/list-index.phtml b/usr/module/message/template/admin/list-index.phtml new file mode 100644 index 0000000000..d15c02c2ee --- /dev/null +++ b/usr/module/message/template/admin/list-index.phtml @@ -0,0 +1,91 @@ +css($this->assetModule('script/admin.css')); ?> +
+ +

+
+ + +
+
+ +
+
+
    +
  • :
  • +
  • |
  • +
  • :
  • +
  • |
  • +
  • :
  • +
  • |
  • +
  • :
  • +
+
+ + + + + +
+
+
+ +
+ +
+ +
+ +
+ paginationControl($paginator, 'Sliding', 'paginator'); ?> +
+
\ No newline at end of file diff --git a/usr/module/message/template/admin/prune-index.phtml b/usr/module/message/template/admin/prune-index.phtml new file mode 100644 index 0000000000..c5ccd25005 --- /dev/null +++ b/usr/module/message/template/admin/prune-index.phtml @@ -0,0 +1,8 @@ +css($this->assetModule('script/admin.css')); ?> +
+

escape($title); ?>

+
+ escape($message); ?> +
+ form($form); ?> +
\ No newline at end of file diff --git a/usr/module/message/template/front/_confirm-modal.phtml b/usr/module/message/template/front/_confirm-modal.phtml new file mode 100644 index 0000000000..3093b12dcf --- /dev/null +++ b/usr/module/message/template/front/_confirm-modal.phtml @@ -0,0 +1,18 @@ + \ No newline at end of file diff --git a/usr/module/message/template/front/index-archive.phtml b/usr/module/message/template/front/index-archive.phtml deleted file mode 100644 index 44c9cb1b4c..0000000000 --- a/usr/module/message/template/front/index-archive.phtml +++ /dev/null @@ -1,21 +0,0 @@ -css($this->assetModule('script/front.css')); ?> -
-
- templateModule('front/user-profile-sidebar.phtml', 'user'); ?> -
-
- - -
-
\ No newline at end of file diff --git a/usr/module/message/template/front/index-detail.phtml b/usr/module/message/template/front/index-detail.phtml index 1bb7364dfc..72d1053aeb 100755 --- a/usr/module/message/template/front/index-detail.phtml +++ b/usr/module/message/template/front/index-detail.phtml @@ -1,101 +1,70 @@ -css($this->assetModule('script/front.css')); ?> -
- templateModule('front/user-profile-sidebar.phtml', 'user'); ?> -
-
- - - -
- - -
- - -
-
-
-
- - -
-

- -

-
-
- - - -
-

- -

-
-

- - - - -

-
-
-
-
- setAttribute('class', 'message-form-posi'); - echo $this->form()->openTag($form); - ?> - get('content'); - $element->setAttributes(array( - 'class' => 'form-control message-textarea', - 'rows' => '6' - )); - echo '
' . $this->formElement($element); - echo $this->formElementErrors($element); - echo '
' - ?> - formElement($form->get('uid_to')); - $element = $form->get('submit'); - $element->setAttributes(array( - 'class' => 'btn btn-primary pull-right', - )); - echo $this->formSubmit($element); - echo $this->form()->closeTag($form); - ?> -
- -
-getCurrentPageNumber() : ''; -$host = $this->url('', array('module' => 'message')); -$confirm = __('Once you delete this message, it cannot be undone.'); -$script = "messageIndex({p: '%s', host: '%s', confirm: '%s'});"; -$script = sprintf($script, $paginator, $host, $confirm); - -$this->footScript()->appendFile($this->assetModule('script/index-detail.js')); -$this->footScript()->appendScript($script); +css($this->assetModule('script/front.css')); ?> +
+
+ templateModule('front/user-profile-sidebar.phtml', 'user'); ?> +
+
+ + +
+ +
+ + + +
+
+
+

+ + +

+

+ +

+
+
+ + + +
+

+
+

+ + + +

+
+
+
+
+ +
+ form($form, 'horizontal'); ?> +
+
+ + template('./_confirm-modal.phtml'); ?> +
+
+getCurrentPageNumber() : ''; +$host = $this->url('', array('module' => 'message')); +$confirm = __('Once you delete this message, it cannot be undone.'); +$script = "messageIndex({p: '%s', host: '%s', confirm: '%s'});"; +$script = sprintf($script, $paginator, $host, $confirm); + +$this->footScript()->appendFile($this->assetModule('script/index-detail.js')); +$this->footScript()->appendScript($script); ?> \ No newline at end of file diff --git a/usr/module/message/template/front/index-index.phtml b/usr/module/message/template/front/index-index.phtml index ed27686d20..9ed676709c 100755 --- a/usr/module/message/template/front/index-index.phtml +++ b/usr/module/message/template/front/index-index.phtml @@ -1,129 +1,118 @@ -css($this->assetModule('script/front.css')); ?> -
-
- templateModule('front/user-profile-sidebar.phtml', 'user'); ?> -
-
- - -
- - -
-
- - - - -
-
-

- -

- -

- - - - - - - | - - - - - -

-
-
-
- - - - - - -
-

- - -

-
-
- - No message for you!
'); - } ?> - paginationControl($paginator, 'Sliding', 'paginator.phtml', array( - 'class' => 'pagination-right pull-right message-pagination' - )); - } - ?> -
- - -
-
-
-
-getCurrentPageNumber() : ''; -$host = $this->url('', array('module' => 'message')); -$confirm = __('Once you delete those message, it cannot be undone.'); -$script = "messageIndex({p: '%s', host: '%s', confirm: '%s'});"; -$script = sprintf($script, $paginator, $host, $confirm); - -$this->footScript()->appendFile($this->assetModule('script/index-index.js')); -$this->footScript()->appendScript($script); +css($this->assetModule('script/front.css')); ?> +
+
+ templateModule('front/user-profile-sidebar.phtml', 'user'); ?> +
+
+ + +
+ + +
+
+
+ +
+
+ + + +
+
+
+ +
+ + +
+
+
+ + +
+ + paginationControl($paginator, 'Sliding', 'paginator.phtml', array( + 'class' => 'pagination-right pull-right message-pagination' + )); + } ?> +
+
+ + +
+
+ template('./_confirm-modal.phtml'); ?> +
+
+
+getCurrentPageNumber() : ''; +$host = $this->url('', array('module' => 'message')); +$confirm = __('Once you delete those message, it cannot be undone.'); +$script = "messageIndex({p: '%s', host: '%s', confirm: '%s'});"; +$script = sprintf($script, $paginator, $host, $confirm); +$this->footScript()->appendFile($this->assetModule('script/index-index.js')); +$this->footScript()->appendScript($script); ?> \ No newline at end of file diff --git a/usr/module/message/template/front/index-send.phtml b/usr/module/message/template/front/index-send.phtml index 83c4141cc1..8294305dd0 100755 --- a/usr/module/message/template/front/index-send.phtml +++ b/usr/module/message/template/front/index-send.phtml @@ -1,13 +1,15 @@ -
- templateModule('front/user-profile-sidebar.phtml', 'user'); ?> -
-
- -getCurrentPageNumber() : ''; -$host = $this->url('', array('module' => 'message')); -$script = "messageIndex({p: '%s', host: '%s'});"; -$script = sprintf($script, $paginator, $host); - -$this->footScript()->appendFile($this->assetModule('script/notify-index.js')); -$this->footScript()->appendScript($script); +css($this->assetModule('script/front.css')); ?> +
+
+ templateModule('front/user-profile-sidebar.phtml', 'user'); ?> +
+
+ + +
+ + +
+
+ + + + +
+
+

+ +

+
+
+ + +
+ + paginationControl($paginator, 'Sliding', 'paginator.phtml', array( + 'class' => 'pagination-right pull-right message-pagination' + )); + } + ?> +
+
+ + +
+
+ template('./_confirm-modal.phtml'); ?> +
+
+
+getCurrentPageNumber() : ''; +$host = $this->url('', array('module' => 'message')); +$script = "messageIndex({p: '%s', host: '%s'});"; +$script = sprintf($script, $paginator, $host); +$this->footScript()->appendFile($this->assetModule('script/notify-index.js')); +$this->footScript()->appendScript($script); ?> \ No newline at end of file diff --git a/usr/module/system/src/Installer/Action/Install.php b/usr/module/system/src/Installer/Action/Install.php index 998038fd06..cc63cba218 100644 --- a/usr/module/system/src/Installer/Action/Install.php +++ b/usr/module/system/src/Installer/Action/Install.php @@ -190,7 +190,6 @@ public function installApplication(Event $e) 'order' => 1, 'modules' => array( 'user', - 'uclient', 'article', 'document', 'solution', @@ -206,7 +205,11 @@ public function installApplication(Event $e) 'portfolio', 'gallery', 'download', - 'ask' + 'ask', + 'event', + 'plans', + 'support', + 'blog' ), ), array( @@ -226,7 +229,9 @@ public function installApplication(Event $e) 'order', 'vote', 'sitemap', - 'ads' + 'ads', + 'usmartphone', + 'notification' ), ) ); diff --git a/www/public/vendor/bootstrap/datepicker/locales/.directory b/www/public/vendor/bootstrap/datepicker/locales/.directory new file mode 100644 index 0000000000..67c573b7f1 --- /dev/null +++ b/www/public/vendor/bootstrap/datepicker/locales/.directory @@ -0,0 +1,3 @@ +[Dolphin] +Timestamp=2015,12,31,17,44,14 +Version=3 diff --git a/www/static/Thumbs.db b/www/static/Thumbs.db deleted file mode 100644 index 9c081a1a9d..0000000000 Binary files a/www/static/Thumbs.db and /dev/null differ