Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

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

Rev 1651 Rev 1662
Línea 1472... Línea 1472...
1472
            //error_log('device_uuid = ' . $device_uuid);
1472
            //error_log('device_uuid = ' . $device_uuid);
1473
            //error_log('sync_id = ' . $sync_id);
1473
            //error_log('sync_id = ' . $sync_id);
1474
            //error_log(print_r($data, true));
1474
            //error_log(print_r($data, true));
Línea 1475... Línea 1475...
1475
            
1475
            
1476
            
1476
            
Línea 1477... Línea 1477...
1477
            $rawdata = file_get_contents("php://input");
1477
            //$rawdata = file_get_contents("php://input");
Línea 1478... Línea 1478...
1478
            error_log('$rawdata = ' . $rawdata );
1478
           // error_log('$rawdata = ' . $rawdata );
1479
           
1479
           
Línea 1797... Línea 1797...
1797
                    if(!$ok) {
1797
                    if(!$ok) {
1798
                        return new JsonModel([
1798
                        return new JsonModel([
1799
                            'success' => false,
1799
                            'success' => false,
1800
                            'data' => [
1800
                            'data' => [
1801
                                'sync_id' => $sync_id,
1801
                                'sync_id' => $sync_id,
1802
                                'message' => 'ERROR_INVALID_PARAMETERS',
1802
                                'message' => 'ERROR_INVALID_PARAMETERS 1',
1803
                            ]
1803
                            ]
1804
                        ]);
1804
                        ]);
1805
                    }
1805
                    }
Línea 1915... Línea 1915...
1915
                    if(!$ok) {
1915
                    if(!$ok) {
1916
                        return new JsonModel([
1916
                        return new JsonModel([
1917
                            'success' => false,
1917
                            'success' => false,
1918
                            'data' => [
1918
                            'data' => [
1919
                                'sync_id' => $sync_id,
1919
                                'sync_id' => $sync_id,
1920
                                'message' => 'ERROR_INVALID_PARAMETERS',
1920
                                'message' => 'ERROR_INVALID_PARAMETERS 2',
1921
                            ]
1921
                            ]
1922
                        ]);
1922
                        ]);
1923
                    }
1923
                    }
Línea 1924... Línea 1924...
1924
                    
1924
                    
Línea 2056... Línea 2056...
2056
                    if(!$ok) {
2056
                    if(!$ok) {
2057
                        return new JsonModel([
2057
                        return new JsonModel([
2058
                            'success' => false,
2058
                            'success' => false,
2059
                            'data' => [
2059
                            'data' => [
2060
                                'sync_id' => $sync_id,
2060
                                'sync_id' => $sync_id,
2061
                                'message' => 'ERROR_INVALID_PARAMETERS',
2061
                                'message' => 'ERROR_INVALID_PARAMETERS 3',
2062
                            ]
2062
                            ]
2063
                        ]);
2063
                        ]);
2064
                    }
2064
                    }
Línea 2065... Línea 2065...
2065
                                
2065
                                
Línea 2143... Línea 2143...
2143
                if(!$ok) {
2143
                if(!$ok) {
2144
                    return new JsonModel([
2144
                    return new JsonModel([
2145
                        'success' => false,
2145
                        'success' => false,
2146
                        'data' => [
2146
                        'data' => [
2147
                            'sync_id' => $sync_id,
2147
                            'sync_id' => $sync_id,
2148
                            'message' => 'ERROR_INVALID_PARAMETERS',
2148
                            'message' => 'ERROR_INVALID_PARAMETERS 4',
2149
                        ]
2149
                        ]
2150
                    ]);
2150
                    ]);
2151
                }
2151
                }
Línea 2152... Línea 2152...
2152
                
2152
                
Línea 2196... Línea 2196...
2196
    {
2196
    {
2197
        $request = $this->getRequest();
2197
        $request = $this->getRequest();
Línea 2198... Línea 2198...
2198
        
2198
        
Línea 2199... Línea -...
2199
        if($request->isPost()) {
-
 
-
 
2199
        if($request->isPost()) {
-
 
2200
            
Línea 2200... Línea 2201...
2200
            
2201
            $rawdata = file_get_contents("php://input");
Línea 2201... Línea 2202...
2201
 
2202
            error_log('$rawdata = ' . $rawdata );
2202
            
2203
            
-
 
2204
            $serviceDatetimeFormat = $this->config['leaderslinked.services.datetime'];
-
 
2205
            
Línea 2203... Línea 2206...
2203
            $serviceDatetimeFormat = $this->config['leaderslinked.services.datetime'];
2206
            $device_uuid = filter_var($this->params()->fromPost('device_uuid', ''), FILTER_SANITIZE_STRING);
Línea 2204... Línea 2207...
2204
            
2207
            $max_records = filter_var($this->params()->fromPost('max_records', 0), FILTER_SANITIZE_NUMBER_INT);
2205
            $device_uuid = filter_var($this->params()->fromPost('device_uuid', ''), FILTER_SANITIZE_STRING);
2208
            
Línea 2263... Línea 2266...
2263
            $answerMapper = CompanyMicrolearningAnswerMapper::getInstance($this->adapter);
2266
            $answerMapper = CompanyMicrolearningAnswerMapper::getInstance($this->adapter);
Línea 2264... Línea 2267...
2264
            
2267
            
2265
            
2268
            
-
 
2269
            $userProgressMapper = CompanyMicrolearningUserProgressMapper::getInstance($this->adapter);
Línea 2266... Línea 2270...
2266
            $userProgressMapper = CompanyMicrolearningUserProgressMapper::getInstance($this->adapter);
2270
            $userLogMapper = CompanyMicrolearningUserLogMapper::getInstance($this->adapter);
2267
            $userLogMapper = CompanyMicrolearningUserLogMapper::getInstance($this->adapter);
2271
 
2268
            
2272
            
2269
            for($i = 1; $i <= $max_records; $i++)
2273
            for($i = 1; $i <= $max_records; $i++)
2270
            {
2274
            {
2271
                $sync_id        = filter_var($this->params()->fromPost('record_sync_id' . $i, ''), FILTER_SANITIZE_NUMBER_INT);
2275
                $sync_id        = filter_var($this->params()->fromPost('record_sync_id' . $i, ''), FILTER_SANITIZE_NUMBER_INT);
2272
                $record_data    = $this->params()->fromPost('record_data' . $i, '');
2276
                $record_data    = $this->params()->fromPost('record_data' . $i, '');
2273
 
2277
                
2274
                if(empty($record_data) || empty($sync_id )) {
-
 
Línea 2275... Línea 2278...
2275
                    continue;
2278
                if(empty($record_data) || empty($sync_id )) {
2276
                }
2279
                    continue;
2277
                
2280
                }
Línea 2605... Línea 2608...
2605
 
2608
 
2606
                        if(!$ok) {
2609
                        if(!$ok) {
2607
                            array_push($result_sync_ids, [
2610
                            array_push($result_sync_ids, [
2608
                                'success' => false,
2611
                                'success' => false,
2609
                                'sync_id' => $sync_id,
2612
                                'sync_id' => $sync_id,
2610
                                'message' => 'ERROR_INVALID_PARAMETERS',
2613
                                'message' => 'ERROR_INVALID_PARAMETERS 9',
2611
                            ]);
2614
                            ]);
2612
                            continue;
2615
                            continue;
Línea 2613... Línea 2616...
2613
                        }
2616
                        }
Línea 2743... Línea 2746...
2743
                        
2746
                        
2744
                        if(!$ok) {
2747
                        if(!$ok) {
2745
                            array_push($result_sync_ids, [
2748
                            array_push($result_sync_ids, [
2746
                                'success' => false,
2749
                                'success' => false,
2747
                                'sync_id' => $sync_id,
2750
                                'sync_id' => $sync_id,
2748
                                'message' => 'ERROR_INVALID_PARAMETERS',
2751
                                'message' => 'ERROR_INVALID_PARAMETERS 10',
2749
                            ]);
2752
                            ]);
2750
                            continue;
2753
                            continue;
Línea 2751... Línea 2754...
2751
                        }
2754
                        }
Línea 2866... Línea 2869...
2866
                    
2869
                    
2867
                    if($sync_type == 'microlearning-userlog') {
2870
                    if($sync_type == 'microlearning-userlog') {
2868
                        $activity   = isset($record['activity'])      ? filter_var($record['activity'], FILTER_SANITIZE_STRING)  :  '';
2871
                        $activity   = isset($record['activity'])      ? filter_var($record['activity'], FILTER_SANITIZE_STRING)  :  '';
Línea 2869... Línea -...
2869
                        $added_on   = isset($record['added_on'])      ? filter_var($record['added_on'], FILTER_SANITIZE_STRING)  :  '';
-
 
2870
                        
2872
                        $added_on   = isset($record['added_on'])      ? filter_var($record['added_on'], FILTER_SANITIZE_STRING)  :  '';
2871
                        
2873
                        
2872
                        if(empty($activity)) {
2874
                        if(empty($activity)) {
Línea 2873... Línea 2875...
2873
                            $ok = false;
2875
                            $ok = false;
Línea 2882... Línea 2884...
2882
                        
2884
                        
2883
                        if(!$ok) {
2885
                        if(!$ok) {
2884
                            array_push($result_sync_ids, [
2886
                            array_push($result_sync_ids, [
2885
                                'success' => false,
2887
                                'success' => false,
2886
                                'sync_id' => $sync_id,
2888
                                'sync_id' => $sync_id,
2887
                                'message' => 'ERROR_INVALID_PARAMETERS',
2889
                                'message' => 'ERROR_INVALID_PARAMETERS 11',
2888
                            ]);
2890
                            ]);
2889
                            continue;
2891
                            continue;
Línea 2943... Línea 2945...
2943
                /***** INICIO LOG DE USUARIO GENERAL *****/
2945
                /***** INICIO LOG DE USUARIO GENERAL *****/
Línea 2944... Línea 2946...
2944
                
2946
                
Línea -... Línea 2947...
-
 
2947
                if($user_uuid && $sync_type == 'userlog' && $device->application_id = Application::TWOGETSKILLS) {
2945
                if($user_uuid && $sync_type == 'userlog' && $device->application_id = Application::TWOGETSKILLS) {
2948
                    
2946
                    
2949
                    
2947
                    
2950
                    
2948
                    if(isset($users[$user_uuid])) {
2951
                    if(isset($users[$user_uuid])) {
2949
                        $user = $users[$user_uuid];
2952
                        $user = $users[$user_uuid];
Línea 2994... Línea 2997...
2994
                    
2997
                    
2995
                    if(!$ok) {
2998
                    if(!$ok) {
2996
                        array_push($result_sync_ids, [
2999
                        array_push($result_sync_ids, [
2997
                            'success' => false,
3000
                            'success' => false,
2998
                            'sync_id' => $sync_id,
3001
                            'sync_id' => $sync_id,
2999
                            'message' => 'ERROR_INVALID_PARAMETERS',
3002
                            'message' => 'ERROR_INVALID_PARAMETERS 12',
3000
                        ]);
3003
                        ]);
3001
                        continue;
3004
                        continue;
Línea 3052... Línea 3055...
3052
                    'data' => $result_sync_ids
3055
                    'data' => $result_sync_ids
3053
                ]);
3056
                ]);
3054
            } else {
3057
            } else {
3055
                return new JsonModel([
3058
                return new JsonModel([
3056
                    'success' => false,
3059
                    'success' => false,
3057
                    'data' => 'ERROR_INVALID_PARAMETERS'
3060
                    'data' => 'ERROR_INVALID_PARAMETERS 13'
3058
                ]);
3061
                ]);
3059
            }
3062
            }
Línea 3060... Línea 3063...
3060
           
3063