diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php index f5d95a70bb..7658079c3c 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php @@ -294,6 +294,12 @@ class Edit implements ControllerProviderInterface } $media = $app['mediavorus']->guess($value->get_pathfile()); $reg_record->substitute_subdef($name, $media, $app); + $app['phraseanet.logger']($reg_record->get_databox())->log( + $reg_record, + \Session_Logger::EVENT_SUBSTITUTE, + $name == 'document' ? 'HD' : $name, + '' + ); } } catch (\Exception $e) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php index d6ed2e3e5d..516e85de2d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php @@ -483,6 +483,12 @@ class Lazaret implements ControllerProviderInterface $record = $lazaretFile->getCollection($app)->get_databox()->get_record($recordId); $record->substitute_subdef('document', $media, $app); + $app['phraseanet.logger']($record->get_databox())->log( + $record, + \Session_Logger::EVENT_SUBSTITUTE, + 'HD', + '' + ); //Delete lazaret file $app['EM']->remove($lazaretFile); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php index 873ded0ec5..7e6b6f4960 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php @@ -142,6 +142,7 @@ class Tools implements ControllerProviderInterface $media = $app['mediavorus']->guess($tempoFile); $record->substitute_subdef('document', $media, $app); + $app['phraseanet.logger']($record->get_databox())->log($record, \Session_Logger::EVENT_SUBSTITUTE, 'HD', ''); if ((int) $request->request->get('ccfilename') === 1) { $record->set_original_name($fileName); @@ -194,6 +195,7 @@ class Tools implements ControllerProviderInterface $media = $app['mediavorus']->guess($tempoFile); $record->substitute_subdef('thumbnail', $media, $app); + $app['phraseanet.logger']($record->get_databox())->log($record, \Session_Logger::EVENT_SUBSTITUTE, 'thumbnail', ''); unlink($tempoFile); rmdir($tempoDir); @@ -253,6 +255,12 @@ class Tools implements ControllerProviderInterface $media = $app['mediavorus']->guess($fileName); $record->substitute_subdef('thumbnail', $media, $app); + $app['phraseanet.logger']($record->get_databox())->log( + $record, + \Session_Logger::EVENT_SUBSTITUTE, + 'thumbnail', + '' + ); unset($media); $app['filesystem']->remove($fileName); diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 5d76249393..78aaa2c822 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -1036,11 +1036,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface $this->rebuild_subdefs(); } - $type = $name == 'document' ? 'HD' : $name; - - $this->app['phraseanet.logger']($this->get_databox()) - ->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, ''); - return $this; }