Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 17002 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 17002 Rev 17018
Línea 148... Línea 148...
148
                
148
                
149
                
149
                
Línea 150... Línea 150...
150
                $microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
150
                $microlearningCapsuleUserMapper = MicrolearningCapsuleUserMapper::getInstance($this->adapter);
151
                 $records = $paginator->getCurrentItems(); 
151
                 $records = $paginator->getCurrentItems(); 
Línea 152... Línea 152...
152
            
152
            
153
                 $storage = Storage::getInstance($this->config);
153
                 $storage = Storage::getInstance($this->config, $this->adapter);
Línea 351... Línea 351...
351
                    $capsule = $capsuleMapper->fetchOne($capsule->id);
351
                    $capsule = $capsuleMapper->fetchOne($capsule->id);
Línea 352... Línea 352...
352
                    
352
                    
353
                    $files = $this->getRequest()->getFiles()->toArray();
353
                    $files = $this->getRequest()->getFiles()->toArray();
354
                    if(isset($files['file']) && empty($files['file']['error'])) {
354
                    if(isset($files['file']) && empty($files['file']['error'])) {
355
                        $tmp_filename  = $files['file']['tmp_name'];
355
                        $tmp_filename  = $files['file']['tmp_name'];
Línea 356... Línea 356...
356
                        // $filename      = $this->normalizeString($files['file']['name']);
356
                        // $filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
357
                        
357
                        
Línea 358... Línea 358...
358
                        try {
358
                        try {
359
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
359
                            list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.microlearning_image_size']);
360
                            
360
                            
Línea 361... Línea 361...
361
                            $filename = 'capsule-' .uniqid() . '.jpg';
361
                            $filename = 'capsule-' .uniqid() . '.jpg';
362
                            $crop_to_dimensions = false;
362
                            $crop_to_dimensions = false;
363
                            $unlink_source = true;
363
                            $unlink_source = true;
364
                            
364
                            
365
                            if($image->uploadImageChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
365
                            if($image->uploadProcessChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
366
                                $capsule->image = $filename;
366
                                $capsule->image = $filename;
367
                                $capsuleMapper->update($capsule);
367
                                $capsuleMapper->update($capsule);
368
                            }
368
                            }
Línea 369... Línea 369...
369
                        } catch(\Throwable $e) {
369
                        } catch(\Throwable $e) {
370
                            error_log($e->getTraceAsString());
370
                            error_log($e->getTraceAsString());
371
                        }
371
                        }
Línea 372... Línea 372...
372
                    }
372
                    }
373
                    
373
                    
Línea 374... Línea 374...
374
                    if(isset($files['marketplace']) && empty($files['marketplace']['error'])) {
374
                    if(isset($files['marketplace']) && empty($files['marketplace']['error'])) {
375
                        $tmp_filename  = $files['marketplace']['tmp_name'];
375
                        $tmp_filename  = $files['marketplace']['tmp_name'];
376
                        // $filename      = $this->normalizeString($files['file']['name']);
376
                        // $filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 377... Línea 377...
377
                        
377
                        
378
                        try {
378
                        try {
379
                        list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.marketplace']);
379
                        list($target_width, $target_height) = explode('x', $this->config['leaderslinked.image_sizes.marketplace']);
380
                            
380
                            
381
                            $filename = 'marketplace-' .uniqid() . '.jpg';
381
                            $filename = 'marketplace-' .uniqid() . '.jpg';
382
                            $crop_to_dimensions = false;
382
                            $crop_to_dimensions = false;
Línea 488... Línea 488...
488
            $result =  $capsuleMapper->delete($capsule);
488
            $result =  $capsuleMapper->delete($capsule);
489
            if($result) {
489
            if($result) {
490
                $this->logger->info('Se borro la cápsula : ' .  $capsule->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
490
                $this->logger->info('Se borro la cápsula : ' .  $capsule->name, ['user_id' => $currentUser->id, 'ip' => Functions::getUserIP()]);
Línea 491... Línea 491...
491
               
491
               
492
                
492
                
Línea 493... Línea 493...
493
                $storage = Storage::getInstance($this->config);
493
                $storage = Storage::getInstance($this->config, $this->adapter);
Línea 494... Línea 494...
494
                $target_path = $storage->getPathMicrolearningCapsule();
494
                $target_path = $storage->getPathMicrolearningCapsule();
Línea 572... Línea 572...
572
                'data'   => 'ERROR_UNAUTHORIZED'
572
                'data'   => 'ERROR_UNAUTHORIZED'
573
            ]);
573
            ]);
574
        }
574
        }
Línea 575... Línea 575...
575
        
575
        
576
        if($request->isGet()) {
576
        if($request->isGet()) {
577
            $storage = Storage::getInstance($this->config);
577
            $storage = Storage::getInstance($this->config, $this->adapter);
Línea 578... Línea 578...
578
            $path = $storage->getPathMicrolearningCapsule();
578
            $path = $storage->getPathMicrolearningCapsule();
579
            
579
            
Línea 620... Línea 620...
620
                    $files = $this->getRequest()->getFiles()->toArray();
620
                    $files = $this->getRequest()->getFiles()->toArray();
Línea 621... Línea 621...
621
            
621
            
622
                    
622
                    
623
                    if(isset($files['file']) && empty($files['file']['error'])) {
623
                    if(isset($files['file']) && empty($files['file']['error'])) {
Línea 624... Línea 624...
624
                        $tmp_filename  = $files['file']['tmp_name'];
624
                        $tmp_filename  = $files['file']['tmp_name'];
625
                        // $filename      = $this->normalizeString($files['file']['name']);
625
                        // $filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 626... Línea 626...
626
                        
626
                        
Línea 640... Línea 640...
640
                            
640
                            
641
                            $filename = 'capsule-' .uniqid() . '.jpg';
641
                            $filename = 'capsule-' .uniqid() . '.jpg';
642
                            $crop_to_dimensions = false;
642
                            $crop_to_dimensions = false;
Línea 643... Línea 643...
643
                            $unlink_source = true;
643
                            $unlink_source = true;
Línea 644... Línea 644...
644
                            
644
                            
645
                            if($image->uploadImageChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
645
                            if($image->uploadProcessChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
646
        
646
        
647
                                $capsule->image = $filename;
647
                                $capsule->image = $filename;
Línea 655... Línea 655...
655
                    if(isset($files['marketplace']) && empty($files['marketplace']['error'])) {
655
                    if(isset($files['marketplace']) && empty($files['marketplace']['error'])) {
Línea 656... Línea 656...
656
                        
656
                        
657
                        
657
                        
Línea 658... Línea 658...
658
                        
658
                        
659
                        $tmp_filename  = $files['marketplace']['tmp_name'];
659
                        $tmp_filename  = $files['marketplace']['tmp_name'];
Línea 660... Línea 660...
660
                        // $filename      = $this->normalizeString($files['file']['name']);
660
                        // $filename      = \LeadersLinked\Library\Functions::normalizeStringFilename($files['file']['name']);
Línea 674... Línea 674...
674
                            
674
                            
675
                            $filename = 'marketplace-' .uniqid() . '.jpg';
675
                            $filename = 'marketplace-' .uniqid() . '.jpg';
676
                            $crop_to_dimensions = false;
676
                            $crop_to_dimensions = false;
Línea 677... Línea 677...
677
                            $unlink_source = true;
677
                            $unlink_source = true;
Línea 678... Línea 678...
678
                            
678
                            
679
                            if($image->uploadImageChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
679
                            if($image->uploadProcessChangeSize($tmp_filename, $target_path, $capsule->uuid, $filename, $target_width, $target_height, $crop_to_dimensions, $unlink_source)) {
680
                         
680
                         
681
                                $capsule->marketplace = $filename;
681
                                $capsule->marketplace = $filename;