Move substituion logger from class method to controllers

This commit is contained in:
Nicolas Le Goff
2013-08-08 13:00:16 +02:00
parent 6e74d4118a
commit 47bb3331dd
4 changed files with 20 additions and 5 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}