Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17063 Rev 17064
Línea 241... Línea 241...
241
                    'total_users' => $totalUsers,
241
                    'total_users' => $totalUsers,
242
                    'total_users_active' => $totalUsersActive,
242
                    'total_users_active' => $totalUsersActive,
243
                ],
243
                ],
244
                'images' => [
244
                'images' => [
245
                    'image' => $storage->getGenericImage($path, $record->uuid, $record->image),
245
                    'image' => $storage->getGenericImage($path, $record->uuid, $record->image),
246
                    'marketplace' => $record->marketplace ? $storage->getGenericImage($path, $record->uuid, $record->marketplace) : '',
-
 
247
                ],
246
                ],
248
                'actions' => $this->prepareCapsuleActions($record, $permissions, $totalUsers, $totalUsersActive)
247
                'actions' => $this->prepareCapsuleActions($record, $permissions, $totalUsers, $totalUsersActive)
249
            ];
248
            ];
250
        }
249
        }
Línea 339... Línea 338...
339
     * @return \Laminas\View\Model\ViewModel
338
     * @return \Laminas\View\Model\ViewModel
340
     */
339
     */
341
    private function handleHtmlRequest($currentCompany)
340
    private function handleHtmlRequest($currentCompany)
342
    {
341
    {
343
        $imageSize = $this->config['leaderslinked.image_sizes.microlearning_image_upload'];
342
        $imageSize = $this->config['leaderslinked.image_sizes.microlearning_image_upload'];
344
        $marketplaceSize = $this->config['leaderslinked.image_sizes.marketplace'];
-
 
Línea 345... Línea 343...
345
        
343
        
346
        $formAdd = new CapsuleAddForm($currentCompany->internal);
344
        $formAdd = new CapsuleAddForm($currentCompany->internal);
Línea 347... Línea 345...
347
        $formEdit = new CapsuleEditForm($currentCompany->internal);
345
        $formEdit = new CapsuleEditForm($currentCompany->internal);
Línea 352... Línea 350...
352
        $viewModel->setVariables([
350
        $viewModel->setVariables([
353
            'formAdd' => $formAdd,
351
            'formAdd' => $formAdd,
354
            'formEdit' => $formEdit,
352
            'formEdit' => $formEdit,
355
            'company_uuid' => $currentCompany->uuid,
353
            'company_uuid' => $currentCompany->uuid,
356
            'image_size' => $imageSize,
354
            'image_size' => $imageSize,
357
            'marketplace_size' => $marketplaceSize,
-
 
358
        ]);
355
        ]);
Línea 359... Línea 356...
359
        
356
        
360
        return $viewModel;
357
        return $viewModel;
Línea 414... Línea 411...
414
        $hydrator = new ObjectPropertyHydrator();
411
        $hydrator = new ObjectPropertyHydrator();
415
        $capsule = new MicrolearningCapsule();
412
        $capsule = new MicrolearningCapsule();
416
        $hydrator->hydrate($dataPost, $capsule);
413
        $hydrator->hydrate($dataPost, $capsule);
417
        $capsule->company_id = $currentCompany->id;
414
        $capsule->company_id = $currentCompany->id;
418
        $capsule->image = '';
415
        $capsule->image = '';
419
        $capsule->marketplace = '';
-
 
Línea 420... Línea 416...
420
        
416
        
Línea 421... Línea 417...
421
        $capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
417
        $capsuleMapper = MicrolearningCapsuleMapper::getInstance($this->adapter);
422
        
418
        
Línea 455... Línea 451...
455
                'success'   => false,
451
                'success'   => false,
456
                'data'      => 'ERROR_UPLOAD_IMAGE'
452
                'data'      => 'ERROR_UPLOAD_IMAGE'
457
            ]);
453
            ]);
458
        }
454
        }
Línea 459... Línea 455...
459
 
455
 
460
        if(!$storage->setCurrentFilename('marketplace')) {
456
        /* if(!$storage->setCurrentFilename('marketplace')) {
461
            return new JsonModel([
457
            return new JsonModel([
462
                'success'   => false,
458
                'success'   => false,
463
                'data'      => 'ERROR_UPLOAD_IMAGE'
459
                'data'      => 'ERROR_UPLOAD_IMAGE'
464
            ]);
460
            ]);
Línea 480... Línea 476...
480
                'success'   => false,
476
                'success'   => false,
481
                'data'      => 'ERROR_UPLOAD_IMAGE'
477
                'data'      => 'ERROR_UPLOAD_IMAGE'
482
            ]);
478
            ]);
483
        }
479
        }
Línea 484... Línea 480...
484
 
480
 
485
        $capsule->marketplace = $marketplace_filename;
481
        $capsule->marketplace = $marketplace_filename; */
Línea 486... Línea 482...
486
        $capsule->image = $filename;
482
        $capsule->image = $filename;
487
 
483
 
488
        if(!$capsuleMapper->update($capsule)) {
484
        if(!$capsuleMapper->update($capsule)) {
Línea 571... Línea 567...
571
        }
567
        }
Línea 572... Línea 568...
572
        
568
        
573
        return new JsonModel($data);
569
        return new JsonModel($data);
Línea 574... Línea -...
574
    }
-
 
575
    
570
    }
576
 
571
    
577
    public function editAction()
572
    public function editAction()
578
    {
573
    {
579
        $currentUserPlugin = $this->plugin('currentUserPlugin');
574
        $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 776... Línea 771...
776
        }
771
        }
Línea 777... Línea 772...
777
        
772
        
778
        return new JsonModel($data);
773
        return new JsonModel($data);
Línea 779... Línea -...
779
    }
-
 
780
    
774
    }
781
    
775
    
782
    public function usersAction()
776
    public function usersAction()
783
    {
777
    {
784
        $currentUserPlugin = $this->plugin('currentUserPlugin');
778
        $currentUserPlugin = $this->plugin('currentUserPlugin');
Línea 915... Línea 909...
915
            return new JsonModel($data);
909
            return new JsonModel($data);
916
        }
910
        }
Línea 917... Línea 911...
917
        
911
        
918
        return new JsonModel($data);
912
        return new JsonModel($data);
919
    }
-
 
920
    
913
    }