Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 333 Rev 338
Línea 195... Línea 195...
195
            
195
            
196
            $date = date('Y-m-d');
196
            $date = date('Y-m-d');
197
            $time = date('H:i:s');
197
            $time = date('H:i:s');
198
            foreach($records as $record)
198
            foreach($records as $record)
199
            {
199
            {
200
                $code = trim($this->params()->fromPost('cat_' . $record->uuid, ''));
200
                $code = trim($this->params()->fromPost($record->uuid, ''));
201
                if(isset($codes[$code])) {
201
                if(isset($codes[$code])) {
202
                    $habitUserLogCategory = $habitUserLogCategoryMapper->fetchOneByUserIdAndCategoryIdAndDate($currentUser->id, $record->id, $date);
202
                    $habitUserLogCategory = $habitUserLogCategoryMapper->fetchOneByUserIdAndCategoryIdAndDate($currentUser->id, $record->id, $date);
203
                    if($habitUserLogCategory) {
-
 
204
                        $habitUserLogCategory->emoji_id = $codes[$code];
203
                    if($habitUserLogCategory) {
Línea 205... Línea 204...
205
                        $habitUserLogCategory->code     = $code;
204
                        $habitUserLogCategory->code     = $code;
206
                        
205
                        
207
                        $habitUserLogCategoryMapper->update($habitUserLogCategory);
206
                        $habitUserLogCategoryMapper->update($habitUserLogCategory);
208
                    } else {
207
                    } else {
209
                        $habitUserLogCategory = new \LeadersLinked\Model\HabitUserLogCategory();
208
                        $habitUserLogCategory = new \LeadersLinked\Model\HabitUserLogCategory();
210
                        $habitUserLogCategory->company_id = $company->id;
209
                        $habitUserLogCategory->company_id = $company->id;
211
                        $habitUserLogCategory->date = $date;
210
                        $habitUserLogCategory->date = $date;
212
                        $habitUserLogCategory->time = $time;
211
                        $habitUserLogCategory->time = $time;
213
                        $habitUserLogCategory->user_id = $currentUser->id;
212
                        $habitUserLogCategory->user_id = $currentUser->id;
Línea 214... Línea 213...
214
                        $habitUserLogCategory->emoji_id = $codes[$code];
213
                        $habitUserLogCategory->category_id = $record->id;
215
                        $habitUserLogCategory->code = $code; 
214
                        $habitUserLogCategory->code = $code; 
Línea 249... Línea 248...
249
                
248
                
250
                $type = $habitContent->type;
249
                $type = $habitContent->type;
Línea -... Línea 250...
-
 
250
                $link = $storage->getGenericFile($path, $habitContent->uuid, $habitContent->file);
-
 
251
                
-
 
252
                
-
 
253
                $userLogContent = new \LeadersLinked\Model\HabitUserLogContent();
-
 
254
                $userLogContent->company_id = $company->id;
-
 
255
                $userLogContent->content_id = $habitContent->id;
-
 
256
                $userLogContent->user_id    = $currentUser->id;
-
 
257
                $userLogContent->date       = $date;
-
 
258
                $userLogContent->time       = $time;
251
                $link = $storage->getGenericFile($path, $habitContent->uuid, $habitContent->file);
259
                
Línea -... Línea 260...
-
 
260
                $userLogContentMapper->insert($userLogContent);
-
 
261
                
-
 
262
            };
Línea 252... Línea 263...
252
                
263
            
253
                
264
            
254
            };
265