Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 671 Rev 777
Línea 574... Línea 574...
574
            ];
574
            ];
Línea 575... Línea 575...
575
 
575
 
576
            return new JsonModel($response);
576
            return new JsonModel($response);
Línea 577... Línea -...
577
        }
-
 
578
 
-
 
579
        $storage = Storage::getInstance($this->config, $this->adapter);
577
        }
-
 
578
 
580
 
579
        $request = $this->getRequest();
581
        $request = $this->getRequest();
580
        
-
 
581
        if ($request->isPost()) {
-
 
582
            $operation = $this->params()->fromRoute('operation');
582
        if ($request->isPost()) {
583
 
Línea 583... Línea 584...
583
            $operation          = $this->params()->fromRoute('operation');
584
            $storage = Storage::getInstance($this->config, $this->adapter);
584
            $target_path = $storage->getPathGroup();
585
            $target_path = $storage->getPathGroup();
585
 
586
 
Línea 624... Línea 625...
624
 
625
 
625
                    $source_filename    = $storage->getTmpFilename();
626
                    $source_filename    = $storage->getTmpFilename();
626
                    $filename           = 'group-image-' . uniqid() . '.png';
627
                    $filename           = 'group-image-' . uniqid() . '.png';
Línea 627... Línea 628...
627
                    $target_filename    = $storage->composePathToFilename(Storage::TYPE_GROUP, $group->uuid, $filename);
628
                    $target_filename    = $storage->composePathToFilename(Storage::TYPE_GROUP, $group->uuid, $filename);
Línea 628... Línea 629...
628
 
629
 
629
                    if ($storage->uploadImageResize($source_filename, $target_filename, $target_width, $target_height)) {
630
                    if ($storage->uploadImageWithOutChangeSize($source_filename, $target_filename, $target_width, $target_height)) {
630
 
631
 
631
                        if ($group->image) {
632
                        if ($group->image) {
Línea -... Línea 633...
-
 
633
                            $target_path = $storage->getPathGroup();
Línea -... Línea 634...
-
 
634
                            $storage->deleteFile($target_path, $group->uuid, $group->image);
Línea 632... Línea -...
632
                            $target_path = $storage->getPathGroup();
-
 
633
                            $storage->deleteFile($target_path, $group->uuid, $group->image);
-
 
634
                        }
-
 
635
 
635
                        }
636
 
636
 
637
 
637
                        $group->image = $filename;
638
 
638
 
639
 
639
                        $this->logger->info('Se guardo correctamente la imagen' . $filename . ' del grupo : ' . $group->name . ' en la ruta ' . $target_filename, ['user_id' => $group->user_id, 'ip' => Functions::getUserIP()]);