mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 22:43:19 +00:00
Move substituion logger from class method to controllers
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user