mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +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());
|
$media = $app['mediavorus']->guess($value->get_pathfile());
|
||||||
$reg_record->substitute_subdef($name, $media, $app);
|
$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) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
|
@@ -483,6 +483,12 @@ class Lazaret implements ControllerProviderInterface
|
|||||||
|
|
||||||
$record = $lazaretFile->getCollection($app)->get_databox()->get_record($recordId);
|
$record = $lazaretFile->getCollection($app)->get_databox()->get_record($recordId);
|
||||||
$record->substitute_subdef('document', $media, $app);
|
$record->substitute_subdef('document', $media, $app);
|
||||||
|
$app['phraseanet.logger']($record->get_databox())->log(
|
||||||
|
$record,
|
||||||
|
\Session_Logger::EVENT_SUBSTITUTE,
|
||||||
|
'HD',
|
||||||
|
''
|
||||||
|
);
|
||||||
|
|
||||||
//Delete lazaret file
|
//Delete lazaret file
|
||||||
$app['EM']->remove($lazaretFile);
|
$app['EM']->remove($lazaretFile);
|
||||||
|
@@ -142,6 +142,7 @@ class Tools implements ControllerProviderInterface
|
|||||||
$media = $app['mediavorus']->guess($tempoFile);
|
$media = $app['mediavorus']->guess($tempoFile);
|
||||||
|
|
||||||
$record->substitute_subdef('document', $media, $app);
|
$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) {
|
if ((int) $request->request->get('ccfilename') === 1) {
|
||||||
$record->set_original_name($fileName);
|
$record->set_original_name($fileName);
|
||||||
@@ -194,6 +195,7 @@ class Tools implements ControllerProviderInterface
|
|||||||
$media = $app['mediavorus']->guess($tempoFile);
|
$media = $app['mediavorus']->guess($tempoFile);
|
||||||
|
|
||||||
$record->substitute_subdef('thumbnail', $media, $app);
|
$record->substitute_subdef('thumbnail', $media, $app);
|
||||||
|
$app['phraseanet.logger']($record->get_databox())->log($record, \Session_Logger::EVENT_SUBSTITUTE, 'thumbnail', '');
|
||||||
|
|
||||||
unlink($tempoFile);
|
unlink($tempoFile);
|
||||||
rmdir($tempoDir);
|
rmdir($tempoDir);
|
||||||
@@ -253,6 +255,12 @@ class Tools implements ControllerProviderInterface
|
|||||||
$media = $app['mediavorus']->guess($fileName);
|
$media = $app['mediavorus']->guess($fileName);
|
||||||
|
|
||||||
$record->substitute_subdef('thumbnail', $media, $app);
|
$record->substitute_subdef('thumbnail', $media, $app);
|
||||||
|
$app['phraseanet.logger']($record->get_databox())->log(
|
||||||
|
$record,
|
||||||
|
\Session_Logger::EVENT_SUBSTITUTE,
|
||||||
|
'thumbnail',
|
||||||
|
''
|
||||||
|
);
|
||||||
|
|
||||||
unset($media);
|
unset($media);
|
||||||
$app['filesystem']->remove($fileName);
|
$app['filesystem']->remove($fileName);
|
||||||
|
@@ -1036,11 +1036,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$this->rebuild_subdefs();
|
$this->rebuild_subdefs();
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = $name == 'document' ? 'HD' : $name;
|
|
||||||
|
|
||||||
$this->app['phraseanet.logger']($this->get_databox())
|
|
||||||
->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, '');
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user