Proyectos de Subversion LeadersLinked - Services

Rev

Rev 207 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 207 Rev 208
Línea 317... Línea 317...
317
 
317
 
Línea 318... Línea 318...
318
                    if ($chatUserOwner->user_id == $currentUser->id) {
318
                    if ($chatUserOwner->user_id == $currentUser->id) {
319
 
319
 
320
                        $chat = [
320
                        $chat = [
321
                            'url_leave'                             => '',
321
                            'url_leave'                             => '',
322
                            'url_delete'                            => $this->url()->fromRoute('chat/delete-group', ['group_id' => $chatGroup->uuid]),
322
                            'url_delete'                            => $this->url()->fromRoute('chat/delete-group', ['group_id' => $chatGroup->uuid],['force_canonical' => true]),
323
                            'url_add_user_to_group'                 => $this->url()->fromRoute('chat/add-user-to-group', ['group_id' => $chatGroup->uuid]),
323
                            'url_add_user_to_group'                 => $this->url()->fromRoute('chat/add-user-to-group', ['group_id' => $chatGroup->uuid],['force_canonical' => true]),
324
                            'url_get_contact_group_list'            => $this->url()->fromRoute('chat/get-contact-group-list', ['group_id' => $chatGroup->uuid]),
324
                            'url_get_contact_group_list'            => $this->url()->fromRoute('chat/get-contact-group-list', ['group_id' => $chatGroup->uuid],['force_canonical' => true]),
325
                            'url_get_contacts_availables_for_group' => $this->url()->fromRoute('chat/get-contacts-availables-for-group', ['group_id' => $chatGroup->uuid]),
325
                            'url_get_contacts_availables_for_group' => $this->url()->fromRoute('chat/get-contacts-availables-for-group', ['group_id' => $chatGroup->uuid],['force_canonical' => true]),
326
                            'url_clear'                             => $this->url()->fromRoute('chat/clear', ['id' => $chatGroup->uuid]),
326
                            'url_clear'                             => $this->url()->fromRoute('chat/clear', ['id' => $chatGroup->uuid],['force_canonical' => true]),
327
                            'url_close'                             => $this->url()->fromRoute('chat/close', ['id' => $chatGroup->uuid]),
327
                            'url_close'                             => $this->url()->fromRoute('chat/close', ['id' => $chatGroup->uuid],['force_canonical' => true]),
328
                            'url_open'                              => $this->url()->fromRoute('chat/open', ['id' => $chatGroup->uuid]),
328
                            'url_open'                              => $this->url()->fromRoute('chat/open', ['id' => $chatGroup->uuid],['force_canonical' => true]),
329
                            'url_send'                              => $this->url()->fromRoute('chat/send', ['id' => $chatGroup->uuid]),
329
                            'url_send'                              => $this->url()->fromRoute('chat/send', ['id' => $chatGroup->uuid],['force_canonical' => true]),
330
                            'url_upload'                            => $this->url()->fromRoute('chat/upload', ['id' => $chatGroup->uuid]),
330
                            'url_upload'                            => $this->url()->fromRoute('chat/upload', ['id' => $chatGroup->uuid],['force_canonical' => true]),
331
                            'url_get_all_messages'                  => $this->url()->fromRoute('chat/get-all-messages', ['id' => $chatGroup->uuid]),
331
                            'url_get_all_messages'                  => $this->url()->fromRoute('chat/get-all-messages', ['id' => $chatGroup->uuid],['force_canonical' => true]),
332
                            'url_mark_seen'                         => $this->url()->fromRoute('chat/mark-seen', ['id' => $chatGroup->uuid]),
332
                            'url_mark_seen'                         => $this->url()->fromRoute('chat/mark-seen', ['id' => $chatGroup->uuid],['force_canonical' => true]),
333
                            'url_mark_received'                     => $this->url()->fromRoute('chat/mark-received', ['id' => $chatGroup->uuid]),
333
                            'url_mark_received'                     => $this->url()->fromRoute('chat/mark-received', ['id' => $chatGroup->uuid],['force_canonical' => true]),
334
                            'url_zoom'                              => $this->url()->fromRoute('chat/zoom', ['id' => $chatGroup->uuid, 'type' => 'chat']),
334
                            'url_zoom'                              => $this->url()->fromRoute('chat/zoom', ['id' => $chatGroup->uuid, 'type' => 'chat'],['force_canonical' => true]),
335
                            'id'                                    => $chatGroup->uuid,
335
                            'id'                                    => $chatGroup->uuid,
336
                            'name'                                  => $chatGroup->name,
336
                            'name'                                  => $chatGroup->name,
337
                            'type'                                  => 'group',
337
                            'type'                                  => 'group',
Línea 793... Línea 793...
793
            $userMapper->updateLastActivity($currentUser->id);
793
            $userMapper->updateLastActivity($currentUser->id);
Línea 794... Línea 794...
794
 
794
 
795
            return new JsonModel([
795
            return new JsonModel([
796
                'success' => true,
796
                'success' => true,
797
                'data' => [
797
                'data' => [
798
                    'url_remove_from_group' => $this->url()->fromRoute('chat/remove-user-from-group', ['group_id' => $chatGroup->uuid, 'user_id' => $user->uuid]),
798
                    'url_remove_from_group' => $this->url()->fromRoute('chat/remove-user-from-group', ['group_id' => $chatGroup->uuid, 'user_id' => $user->uuid],['force_canonical' => true]),
799
                    'id'        => $user->uuid,
799
                    'id'        => $user->uuid,
800
                    'name'      => trim($user->first_name . ' ' . $user->last_name),
800
                    'name'      => trim($user->first_name . ' ' . $user->last_name),
801
                    'image'     => $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image],['force_canonical' => true]),
801
                    'image'     => $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image],['force_canonical' => true]),
802
                    'type'      => 'user',
802
                    'type'      => 'user',
Línea 1834... Línea 1834...
1834
 
1834
 
1835
 
1835
 
1836
                if ($chatGroupUser->owner == ChatGroupUser::OWNER_YES) {
1836
                if ($chatGroupUser->owner == ChatGroupUser::OWNER_YES) {
1837
                    $url_remove_from_group = '';
1837
                    $url_remove_from_group = '';
1838
                } else {
1838
                } else {
Línea 1839... Línea 1839...
1839
                    $url_remove_from_group = $this->url()->fromRoute('chat/remove-user-from-group', ['group_id' => $chatGroup->uuid, 'user_id' => $user->uuid]);
1839
                    $url_remove_from_group = $this->url()->fromRoute('chat/remove-user-from-group', ['group_id' => $chatGroup->uuid, 'user_id' => $user->uuid],['force_canonical' => true]);
1840
                }
1840
                }
Línea 2268... Línea 2268...
2268
 
2268
 
2269
            $not_received_messages = $count_not_received_messages > 0;
2269
            $not_received_messages = $count_not_received_messages > 0;
Línea 2270... Línea 2270...
2270
            $not_seen_messages = $count_not_seen_messages > 0;
2270
            $not_seen_messages = $count_not_seen_messages > 0;
2271
 
2271
 
2272
            $data = [
2272
            $data = [
2273
                'url_clear'                 => $this->url()->fromRoute('chat/clear', ['id' => $user->uuid]),
2273
                'url_clear'                 => $this->url()->fromRoute('chat/clear', ['id' => $user->uuid],['force_canonical' => true]),
2274
                'url_close'                 => $this->url()->fromRoute('chat/close', ['id' => $user->uuid]),
2274
                'url_close'                 => $this->url()->fromRoute('chat/close', ['id' => $user->uuid],['force_canonical' => true]),
2275
                'url_open'                  => $this->url()->fromRoute('chat/open', ['id' => $user->uuid]),
2275
                'url_open'                  => $this->url()->fromRoute('chat/open', ['id' => $user->uuid],['force_canonical' => true]),
2276
                'url_send'                  => $this->url()->fromRoute('chat/send', ['id' => $user->uuid]),
2276
                'url_send'                  => $this->url()->fromRoute('chat/send', ['id' => $user->uuid],['force_canonical' => true]),
2277
                'url_upload'                => $this->url()->fromRoute('chat/upload', ['id' => $user->uuid]),
2277
                'url_upload'                => $this->url()->fromRoute('chat/upload', ['id' => $user->uuid],['force_canonical' => true]),
2278
                'url_mark_seen'             => $this->url()->fromRoute('chat/mark-seen', ['id' => $user->uuid]),
2278
                'url_mark_seen'             => $this->url()->fromRoute('chat/mark-seen', ['id' => $user->uuid],['force_canonical' => true]),
2279
                'url_mark_received'         => $this->url()->fromRoute('chat/mark-received', ['id' => $user->uuid]),
2279
                'url_mark_received'         => $this->url()->fromRoute('chat/mark-received', ['id' => $user->uuid],['force_canonical' => true]),
2280
                'url_get_all_messages'      => $this->url()->fromRoute('chat/get-all-messages', ['id' => $user->uuid]),
2280
                'url_get_all_messages'      => $this->url()->fromRoute('chat/get-all-messages', ['id' => $user->uuid],['force_canonical' => true]),
2281
                'url_zoom'                  => $this->url()->fromRoute('chat/zoom', ['id' => $user->uuid, 'type' => 'chat']),
2281
                'url_zoom'                  => $this->url()->fromRoute('chat/zoom', ['id' => $user->uuid, 'type' => 'chat'],['force_canonical' => true]),
2282
                'id'                        => $user->uuid,
2282
                'id'                        => $user->uuid,
2283
                'name'                      => trim($user->first_name . ' ' . $user->last_name),
2283
                'name'                      => trim($user->first_name . ' ' . $user->last_name),
2284
                'image'                     => $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image],['force_canonical' => true]),
2284
                'image'                     => $this->url()->fromRoute('storage', ['code' => $user->uuid, 'type' => 'user', 'filename' => $user->image],['force_canonical' => true]),
2285
                'profile'                   => $this->url()->fromRoute('profile/view', ['id' => $user->uuid]),
2285
                'profile'                   => $this->url()->fromRoute('profile/view', ['id' => $user->uuid],['force_canonical' => true]),
2286
                'type'                      => 'user',
2286
                'type'                      => 'user',
2287
                'online'                    => $user->online ? 1 : 0,
2287
                'online'                    => $user->online ? 1 : 0,
2288
                'is_open'                   => $is_open ? 1 : 0,
2288
                'is_open'                   => $is_open ? 1 : 0,
Línea 2853... Línea 2853...
2853
                $records = $userMapper->fetchAllByIdsAndSearch($user_ids, $search, $currentUser->id);
2853
                $records = $userMapper->fetchAllByIdsAndSearch($user_ids, $search, $currentUser->id);
Línea 2854... Línea 2854...
2854
 
2854
 
2855
                foreach ($records as $record) {
2855
                foreach ($records as $record) {
2856
                    $chatUser = $chatUserMapper->fetchOneByUserId1AndUserId2($currentUser->id, $record->id);
2856
                    $chatUser = $chatUserMapper->fetchOneByUserId1AndUserId2($currentUser->id, $record->id);
2857
                    if ($chatUser) {
2857
                    if ($chatUser) {
2858
                        $link_send = $this->url()->fromRoute('chat/send', ['id' => $record->uuid]);
2858
                        $link_send = $this->url()->fromRoute('chat/send', ['id' => $record->uuid],['force_canonical' => true]);
2859
                    } else {
2859
                    } else {
2860
                        $link_send = '';
2860
                        $link_send = '';
Línea 2861... Línea 2861...
2861
                    }
2861
                    }
Línea 2862... Línea 2862...
2862
 
2862