Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 3454 | Rev 3912 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3454 Rev 3648
Línea 272... Línea 272...
272
     * Borrar un perfil excepto el público
272
     * Borrar un perfil excepto el público
273
     * @return \Laminas\View\Model\JsonModel
273
     * @return \Laminas\View\Model\JsonModel
274
     */
274
     */
275
    public function deleteAction()
275
    public function deleteAction()
276
    {
276
    {
-
 
277
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
278
        $currentUser = $currentUserPlugin->getUser();
-
 
279
        
277
        $request = $this->getRequest();
280
        $request = $this->getRequest();
278
        $id = $this->params()->fromRoute('id');
281
        $id = $this->params()->fromRoute('id');
Línea 279... Línea 282...
279
        
282
        
280
        if(!$id) {
283
        if(!$id) {
Línea 297... Línea 300...
297
            ];
300
            ];
Línea 298... Línea 301...
298
            
301
            
299
            return new JsonModel($data);
302
            return new JsonModel($data);
Línea 300... Línea -...
300
        }
-
 
-
 
303
        }
301
        
304
        
302
        $currentUser = $this->plugin('currentUserPlugin');
305
 
303
        if($currentUser->getUserId() != $userProfile->user_id) {
306
        if($currentUser->id != $userProfile->user_id) {
304
            $response = [
307
            $response = [
305
                'success' => false,
308
                'success' => false,
Línea 353... Línea 356...
353
     * Presenta el perfil con las opciónes de edición de cada sección
356
     * Presenta el perfil con las opciónes de edición de cada sección
354
     * @return \Laminas\Http\Response|\Laminas\View\Model\ViewModel|\Laminas\View\Model\JsonModel
357
     * @return \Laminas\Http\Response|\Laminas\View\Model\ViewModel|\Laminas\View\Model\JsonModel
355
     */
358
     */
356
    public function editAction()
359
    public function editAction()
357
    {
360
    {
-
 
361
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
362
        $currentUser = $currentUserPlugin->getUser();
-
 
363
        
358
        $flashMessenger = $this->plugin('FlashMessenger');
364
        $flashMessenger = $this->plugin('FlashMessenger');
Línea 359... Línea 365...
359
        
365
        
360
        
366
        
Línea 375... Línea 381...
375
        if(!$userProfile) {
381
        if(!$userProfile) {
376
            $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
382
            $flashMessenger->addErrorMessage('ERROR_RECORD_NOT_FOUND');
377
            return $this->redirect()->toRoute('dashboard');
383
            return $this->redirect()->toRoute('dashboard');
378
        }
384
        }
Línea 379... Línea -...
379
        
-
 
380
        $currentUser = $this->plugin('currentUserPlugin');
385
        
381
        if($currentUser->getUserId() != $userProfile->user_id) {
386
        if($currentUser->id != $userProfile->user_id) {
382
            $flashMessenger->addErrorMessage('ERROR_UNAUTHORIZED');
387
            $flashMessenger->addErrorMessage('ERROR_UNAUTHORIZED');
383
            return $this->redirect()->toRoute('dashboard');
388
            return $this->redirect()->toRoute('dashboard');
Línea 663... Línea 668...
663
     * Actualización de las habilidades
668
     * Actualización de las habilidades
664
     * @return \Laminas\View\Model\JsonModel
669
     * @return \Laminas\View\Model\JsonModel
665
     */
670
     */
666
    public function skillAction()
671
    public function skillAction()
667
    {
672
    {
-
 
673
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
674
        $currentUser = $currentUserPlugin->getUser();
Línea 668... Línea 675...
668
        
675
        
669
        $user_profile_id = $this->params()->fromRoute('id');
676
        $user_profile_id = $this->params()->fromRoute('id');
Línea 670... Línea 677...
670
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
677
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
Línea 677... Línea 684...
677
            ];
684
            ];
Línea 678... Línea 685...
678
            
685
            
Línea 679... Línea 686...
679
            return new JsonModel($response);
686
            return new JsonModel($response);
680
            
687
            
681
        }
-
 
682
        
688
        }
683
        $currentUser = $this->plugin('currentUserPlugin');
689
 
684
        if($currentUser->getUserId() != $userProfile->user_id) {
690
        if($currentUser->id != $userProfile->user_id) {
685
            $response = [
691
            $response = [
686
                'success' => false,
692
                'success' => false,
Línea 795... Línea 801...
795
     * @return \Laminas\View\Model\JsonModel
801
     * @return \Laminas\View\Model\JsonModel
796
     */
802
     */
797
    public function languageAction()
803
    public function languageAction()
798
    {
804
    {
Línea -... Línea 805...
-
 
805
        
-
 
806
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
807
        $currentUser = $currentUserPlugin->getUser();
799
        
808
        
800
        $user_profile_id = $this->params()->fromRoute('id');
809
        $user_profile_id = $this->params()->fromRoute('id');
Línea 801... Línea 810...
801
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
810
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
802
        
811
        
Línea 809... Línea 818...
809
            
818
            
Línea 810... Línea 819...
810
            return new JsonModel($response);
819
            return new JsonModel($response);
Línea 811... Línea -...
811
            
-
 
-
 
820
            
812
        }
821
        }
813
        
822
        
814
        $currentUser = $this->plugin('currentUserPlugin');
823
  
815
        if($currentUser->getUserId() != $userProfile->user_id) {
824
        if($currentUser->id != $userProfile->user_id) {
816
            $response = [
825
            $response = [
Línea 913... Línea 922...
913
     * Actualización de la descripción y cualquier otro campo extendido del perfil a futuro
922
     * Actualización de la descripción y cualquier otro campo extendido del perfil a futuro
914
     * @return \Laminas\View\Model\JsonModel
923
     * @return \Laminas\View\Model\JsonModel
915
     */
924
     */
916
    public function extendedAction()
925
    public function extendedAction()
917
    {
926
    {
-
 
927
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
928
        $currentUser = $currentUserPlugin->getUser();
-
 
929
        
Línea 918... Línea 930...
918
        
930
        
919
        $user_profile_id = $this->params()->fromRoute('id');
931
        $user_profile_id = $this->params()->fromRoute('id');
Línea 920... Línea 932...
920
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
932
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
Línea 928... Línea 940...
928
            
940
            
Línea 929... Línea 941...
929
            return new JsonModel($response);
941
            return new JsonModel($response);
Línea 930... Línea -...
930
            
-
 
931
        }
942
            
932
        
943
        }
933
        $currentUser = $this->plugin('currentUserPlugin');
944
        
934
        if($currentUser->getUserId() != $userProfile->user_id) {
945
        if($currentUser->id != $userProfile->user_id) {
935
            $response = [
946
            $response = [
Línea 1008... Línea 1019...
1008
     * Actualización de la ubucación
1019
     * Actualización de la ubucación
1009
     * @return \Laminas\View\Model\JsonModel
1020
     * @return \Laminas\View\Model\JsonModel
1010
     */
1021
     */
1011
    public function locationAction()
1022
    public function locationAction()
1012
    {
1023
    {
-
 
1024
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1025
        $currentUser = $currentUserPlugin->getUser();
Línea 1013... Línea 1026...
1013
        
1026
        
1014
        $user_profile_id = $this->params()->fromRoute('id');
1027
        $user_profile_id = $this->params()->fromRoute('id');
Línea 1015... Línea 1028...
1015
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
1028
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
Línea 1023... Línea 1036...
1023
            
1036
            
Línea 1024... Línea 1037...
1024
            return new JsonModel($response);
1037
            return new JsonModel($response);
Línea 1025... Línea -...
1025
            
-
 
1026
        }
-
 
-
 
1038
            
1027
        
1039
        }
1028
        $currentUser = $this->plugin('currentUserPlugin');
1040
        
1029
        $currentUser = $currentUser->getUser();
1041
 
1030
        if($currentUser->id != $userProfile->user_id) {
1042
        if($currentUser->id != $userProfile->user_id) {
1031
            $response = [
1043
            $response = [
Línea 1120... Línea 1132...
1120
     * Actualización de las redes sociales
1132
     * Actualización de las redes sociales
1121
     * @return \Laminas\View\Model\JsonModel
1133
     * @return \Laminas\View\Model\JsonModel
1122
     */
1134
     */
1123
    public function socialNetworkAction()
1135
    public function socialNetworkAction()
1124
    {
1136
    {
-
 
1137
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1138
        $currentUser = $currentUserPlugin->getUser();
Línea 1125... Línea 1139...
1125
        
1139
        
1126
        $user_profile_id = $this->params()->fromRoute('id');
1140
        $user_profile_id = $this->params()->fromRoute('id');
Línea 1127... Línea 1141...
1127
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
1141
        $userProfileMapper = UserProfileMapper::getInstance($this->adapter);
Línea 1135... Línea 1149...
1135
            
1149
            
Línea 1136... Línea 1150...
1136
            return new JsonModel($response);
1150
            return new JsonModel($response);
Línea 1137... Línea -...
1137
            
-
 
-
 
1151
            
1138
        }
1152
        }
1139
        
1153
        
1140
        $currentUser = $this->plugin('currentUserPlugin');
1154
 
1141
        if($currentUser->getUserId() != $userProfile->user_id) {
1155
        if($currentUser->id != $userProfile->user_id) {
1142
            $response = [
1156
            $response = [
Línea 1218... Línea 1232...
1218
     * @return \Laminas\View\Model\JsonModel
1232
     * @return \Laminas\View\Model\JsonModel
1219
     */
1233
     */
1220
    public function  educationAction()
1234
    public function  educationAction()
1221
    {
1235
    {
Línea -... Línea 1236...
-
 
1236
        
-
 
1237
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1238
        $currentUser = $currentUserPlugin->getUser();
1222
        
1239
        
1223
        $user_profile_id    = $this->params()->fromRoute('id');
1240
        $user_profile_id    = $this->params()->fromRoute('id');
1224
        $user_education_id  = $this->params()->fromRoute('user_education_id');
1241
        $user_education_id  = $this->params()->fromRoute('user_education_id');
Línea 1225... Línea 1242...
1225
        $operation          = $this->params()->fromRoute('operation');
1242
        $operation          = $this->params()->fromRoute('operation');
Línea 1235... Línea 1252...
1235
            
1252
            
Línea 1236... Línea 1253...
1236
            return new JsonModel($response);
1253
            return new JsonModel($response);
Línea 1237... Línea -...
1237
            
-
 
-
 
1254
            
1238
        }
1255
        }
1239
        
1256
        
1240
        $currentUser = $this->plugin('currentUserPlugin');
1257
 
1241
        if($currentUser->getUserId() != $userProfile->user_id) {
1258
        if($currentUser->id != $userProfile->user_id) {
1242
            $response = [
1259
            $response = [
Línea 1468... Línea 1485...
1468
     * Actualización de los registros de la experiencia laboral
1485
     * Actualización de los registros de la experiencia laboral
1469
     * @return \Laminas\View\Model\JsonModel
1486
     * @return \Laminas\View\Model\JsonModel
1470
     */
1487
     */
1471
    public function  experienceAction()
1488
    public function  experienceAction()
1472
    {
1489
    {
-
 
1490
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1491
        $currentUser = $currentUserPlugin->getUser();
Línea 1473... Línea 1492...
1473
        
1492
        
1474
        $user_profile_id    = $this->params()->fromRoute('id');
1493
        $user_profile_id    = $this->params()->fromRoute('id');
1475
        $user_experience_id = $this->params()->fromRoute('user_experience_id');
1494
        $user_experience_id = $this->params()->fromRoute('user_experience_id');
Línea 1486... Línea 1505...
1486
            
1505
            
Línea 1487... Línea 1506...
1487
            return new JsonModel($response);
1506
            return new JsonModel($response);
Línea 1488... Línea -...
1488
            
-
 
1489
        }
1507
            
1490
        
1508
        }
1491
        $currentUser = $this->plugin('currentUserPlugin');
1509
        
1492
        if($currentUser->getUserId() != $userProfile->user_id) {
1510
        if($currentUser->id != $userProfile->user_id) {
1493
            $response = [
1511
            $response = [
Línea 1723... Línea 1741...
1723
     * Cambio de la imagen del image del perfil
1741
     * Cambio de la imagen del image del perfil
1724
     * @return \Laminas\View\Model\JsonModel
1742
     * @return \Laminas\View\Model\JsonModel
1725
     */
1743
     */
1726
    public function imageAction()
1744
    public function imageAction()
1727
    {
1745
    {
-
 
1746
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1747
        $currentUser = $currentUserPlugin->getUser();
-
 
1748
        
1728
        $user_profile_id    = $this->params()->fromRoute('id');
1749
        $user_profile_id    = $this->params()->fromRoute('id');
1729
        $operation          = $this->params()->fromRoute('operation');
1750
        $operation          = $this->params()->fromRoute('operation');
Línea 1730... Línea 1751...
1730
        
1751
        
Línea 1738... Línea 1759...
1738
            ];
1759
            ];
Línea 1739... Línea 1760...
1739
            
1760
            
Línea 1740... Línea 1761...
1740
            return new JsonModel($response);
1761
            return new JsonModel($response);
1741
            
1762
            
1742
        }
-
 
1743
        
-
 
1744
        $currentUser = $this->plugin('currentUserPlugin');
-
 
1745
        $currentUser = $currentUser->getUser();
1763
        }
1746
        
1764
 
1747
        if($currentUser->id != $userProfile->user_id) {
1765
        if($currentUser->id != $userProfile->user_id) {
1748
            $response = [
1766
            $response = [
1749
                'success' => false,
1767
                'success' => false,
Línea 1876... Línea 1894...
1876
     * Cambio de la imagen de fondo superior (cover) del perfil
1894
     * Cambio de la imagen de fondo superior (cover) del perfil
1877
     * @return \Laminas\View\Model\JsonModel
1895
     * @return \Laminas\View\Model\JsonModel
1878
     */
1896
     */
1879
    public function coverAction()
1897
    public function coverAction()
1880
    {
1898
    {
-
 
1899
        $currentUserPlugin = $this->plugin('currentUserPlugin');
-
 
1900
        $currentUser = $currentUserPlugin->getUser();
-
 
1901
        
1881
        $user_profile_id    = $this->params()->fromRoute('id');
1902
        $user_profile_id    = $this->params()->fromRoute('id');
1882
        $operation          = $this->params()->fromRoute('operation');
1903
        $operation          = $this->params()->fromRoute('operation');
Línea 1883... Línea 1904...
1883
        
1904
        
Línea 1893... Línea 1914...
1893
            return new JsonModel($response);
1914
            return new JsonModel($response);
Línea 1894... Línea 1915...
1894
            
1915
            
Línea 1895... Línea -...
1895
        }
-
 
1896
        
-
 
1897
        
1916
        }
1898
        $currentUser = $this->plugin('currentUserPlugin');
1917
        
1899
        $currentUser = $currentUser->getUser();
1918
        
1900
        
1919
 
1901
        if($currentUser->id != $userProfile->user_id) {
1920
        if($currentUser->id != $userProfile->user_id) {
1902
            $response = [
1921
            $response = [