Merge pull request #2802 from aynsix/PHRAS-2274-port41-changing-status-in-log_docs

PHRAS-2274 port to 4.1 PHRAS-2227 FIX changing status appear in log_docs table
This commit is contained in:
Nicolas Maillat
2018-11-06 09:32:11 +00:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -9,6 +9,7 @@
*/ */
namespace Alchemy\Phrasea\Controller\Prod; namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Application\Helper\DataboxLoggerAware;
use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Controller\RecordsRequest;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@@ -16,6 +17,8 @@ use Symfony\Component\HttpFoundation\Response;
class PropertyController extends Controller class PropertyController extends Controller
{ {
use DataboxLoggerAware;
/** /**
* Display Status property * Display Status property
* *
@@ -198,6 +201,9 @@ class PropertyController extends Controller
$record->setStatus(strrev($newStatus)); $record->setStatus(strrev($newStatus));
$this->getDataboxLogger($record->getDatabox())
->log($record, \Session_Logger::EVENT_STATUS, '', '');
return [ return [
'current_status' => $currentStatus, 'current_status' => $currentStatus,
'new_status' => $newStatus, 'new_status' => $newStatus,

View File

@@ -25,7 +25,9 @@ class Property implements ControllerProviderInterface, ServiceProviderInterface
public function register(Application $app) public function register(Application $app)
{ {
$app['controller.prod.property'] = $app->share(function (PhraseaApplication $app) { $app['controller.prod.property'] = $app->share(function (PhraseaApplication $app) {
return (new PropertyController($app)); return (new PropertyController($app))
->setDataboxLoggerLocator($app['phraseanet.logger'])
;
}); });
} }