diff --git a/twake/backend/core/src/Twake/Core/Command/MappingCommand.php b/twake/backend/core/src/Twake/Core/Command/MappingCommand.php index 83278e2ca1..5a4380d5d4 100755 --- a/twake/backend/core/src/Twake/Core/Command/MappingCommand.php +++ b/twake/backend/core/src/Twake/Core/Command/MappingCommand.php @@ -205,7 +205,7 @@ protected function execute() "_source" => Array( "includes" => Array("id"), "excludes" => Array( - "firstname", "lastname", "username", "language", "creation_date", "groups_id", "workspaces_id" + "firstname", "lastname", "username", "email", "language", "creation_date", "groups_id", "workspaces_id" ) ), "properties" => Array( @@ -213,6 +213,7 @@ protected function execute() "firstname" => Array("type" => "text"), "lastname" => Array("type" => "text"), "username" => Array("type" => "text"), + "email" => Array("type" => "text"), "language" => Array("type" => "keyword"), "creation_date" => Array("type" => "date"), "workspaces_id" => Array("type" => "keyword"), diff --git a/twake/backend/core/src/Twake/Discussion/Command/MessageToDispatchQueueCommand.php b/twake/backend/core/src/Twake/Discussion/Command/MessageToDispatchQueueCommand.php index 67fb94671b..5e6e287619 100755 --- a/twake/backend/core/src/Twake/Discussion/Command/MessageToDispatchQueueCommand.php +++ b/twake/backend/core/src/Twake/Discussion/Command/MessageToDispatchQueueCommand.php @@ -54,12 +54,16 @@ protected function execute() $user_id = $dispatch_informations["user_id"]; $message_id = $dispatch_informations["message_id"]; - $message_system->dispatchMessage( - $channel, - $application_id, - $user_id, - $message_id - ); + try{ + $message_system->dispatchMessage( + $channel, + $application_id, + $user_id, + $message_id + ); + }catch(\Exception $e){ + error_log($e->getMessage()); + } $queues->ack("message_dispatch_queue", $queue_message); } diff --git a/twake/backend/core/src/Twake/Notifications/Services/Notifications.php b/twake/backend/core/src/Twake/Notifications/Services/Notifications.php index 3f206a07a1..f28d14bfa8 100755 --- a/twake/backend/core/src/Twake/Notifications/Services/Notifications.php +++ b/twake/backend/core/src/Twake/Notifications/Services/Notifications.php @@ -217,7 +217,7 @@ public function pushNotification( foreach ($keywords as $keyword) { $keyword = trim($keyword); $keyword = " " . $keyword . " "; - if (strrpos(strtolower($title . " " . $text . " "), strtolower($keyword)) >= 0) { + if (mb_strrpos(mb_strtolower($title . " " . $text . " "), mb_strtolower($keyword)) >= 0) { $present = true; } } @@ -301,8 +301,8 @@ public function pushDevice($user, $text, $title, $badge = null, $data = null, $d $token = $device->getValue(); $this->pushDeviceInternal($device->getType(), $token, - substr($text, 0, 100) . (strlen($title) > 100 ? "..." : ""), - substr($title, 0, 50) . (strlen($title) > 50 ? "..." : ""), + mb_substr($text, 0, 100) . (mb_strlen($title) > 100 ? "..." : ""), + mb_substr($title, 0, 50) . (mb_strlen($title) > 50 ? "..." : ""), $badge, $data, $doPush @@ -315,7 +315,7 @@ public function pushDevice($user, $text, $title, $badge = null, $data = null, $d public function pushDeviceInternal($type, $deviceId, $message, $title, $badge, $_data, $doPush = true) { - if (strlen($deviceId) < 32) { //False device + if (mb_strlen($deviceId) < 32) { //False device return; } diff --git a/twake/backend/core/src/Twake/Users/Entity/User.php b/twake/backend/core/src/Twake/Users/Entity/User.php index 9f93ba25c1..ec061c0c55 100755 --- a/twake/backend/core/src/Twake/Users/Entity/User.php +++ b/twake/backend/core/src/Twake/Users/Entity/User.php @@ -566,6 +566,7 @@ public function getAsArray() public function getIndexationArray() { $return = Array( + "email" => $this->getEmail(), "username" => $this->getUsername(), "firstname" => $this->getFirstName(), "lastname" => $this->getLastName(), diff --git a/twake/backend/core/src/Twake/Users/Services/Users.php b/twake/backend/core/src/Twake/Users/Services/Users.php index 63afb47077..d5bb6c6eba 100755 --- a/twake/backend/core/src/Twake/Users/Services/Users.php +++ b/twake/backend/core/src/Twake/Users/Services/Users.php @@ -41,6 +41,16 @@ public function search($options = Array()) ) ); + $should[] = Array( + "bool" => Array( + "filter" => Array( + "regexp" => Array( + "email" => $name . ".*" + ) + ) + ) + ); + $should[] = Array( "bool" => Array( "filter" => Array( diff --git a/twake/frontend/src/app/components/UserListManager/UserListManager.js b/twake/frontend/src/app/components/UserListManager/UserListManager.js index c2e52a12f5..1df73b9069 100755 --- a/twake/frontend/src/app/components/UserListManager/UserListManager.js +++ b/twake/frontend/src/app/components/UserListManager/UserListManager.js @@ -103,7 +103,7 @@ export default class UserListManager extends React.Component { return ''; } - if (item.email && !item.thumbnail) { + if (item.email && !item.username) { item = item.email; } diff --git a/twake/frontend/src/app/services/languages/locale/en.js b/twake/frontend/src/app/services/languages/locale/en.js index 17dd5e30b1..14c3db292c 100755 --- a/twake/frontend/src/app/services/languages/locale/en.js +++ b/twake/frontend/src/app/services/languages/locale/en.js @@ -1202,7 +1202,8 @@ export default { 'Invite your collaborators into your workspace.', 'scenes.app.channelsbar.public_channel_label': 'Public channel', 'scenes.app.channelsbar.private_channel_label': 'Private channel', - 'scenes.app.channelsbar.private_channel_message': 'This is a public channel, all the workspace will be invited !', + 'scenes.app.channelsbar.private_channel_message': + 'This is a public channel, all the workspace will be invited !', 'scenes.app.channelsbar.save_channel_button': 'Save', 'scenes.app.channelsbar.sending_message_instruction': 'Send a first message in a discussion', 'scenes.app.channelsbar.tutorial_alert': 'Never show this frame again?', @@ -1250,7 +1251,7 @@ export default { 'scenes.app.popup.appsparameters.pages.application_title': 'Application', 'scenes.app.popup.appsparameters.pages.apps_connectors_small_text': 'Create and administer your applications and connectors.', - 'scenes.app.popup.appsparameters.pages.apps_title': 'Your apllications and connectors', + 'scenes.app.popup.appsparameters.pages.apps_title': 'Your applications and connectors', 'scenes.app.popup.appsparameters.pages.automatique_label': 'Automatic', 'scenes.app.popup.appsparameters.pages.automatique_option_information': "If you activate 'Automatic', this application will automatically be added to the next workspaces of this company.", @@ -1262,7 +1263,7 @@ export default { 'scenes.app.popup.appsparameters.pages.categories_label': 'Categories', 'scenes.app.popup.appsparameters.pages.company_label': 'Company owner', 'scenes.app.popup.appsparameters.pages.configuration_label': 'Configuration', - 'scenes.app.popup.appsparameters.pages.create_app_button': 'Create an apllication', + 'scenes.app.popup.appsparameters.pages.create_app_button': 'Create an application', 'scenes.app.popup.appsparameters.pages.create_my_app': 'Create my application', 'scenes.app.popup.appsparameters.pages.creation_app_instruction': 'Please confirm the following information before creating your app.',