Add elasticsearch reindex events

This commit is contained in:
Nicolas Le Goff
2015-01-02 18:47:21 +01:00
committed by Mathieu Darse
parent ad868dc70f
commit a01bf29c5b
73 changed files with 1708 additions and 182 deletions

View File

@@ -12,6 +12,8 @@
namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Core\Event\RecordEvent\ChangeCollectionEvent;
use Alchemy\Phrasea\Core\PhraseaEvents;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -93,10 +95,15 @@ class MoveCollection implements ControllerProviderInterface
foreach ($records as $record) {
$record->move_to_collection($collection, $app['phraseanet.appbox']);
$app['dispatcher']->dispatch(PhraseaEvents::RECORD_CHANGE_COLLECTION, new ChangeCollectionEvent($record));
if ($request->request->get("chg_coll_son") == "1") {
foreach ($record->get_children() as $child) {
if ($app['acl']->get($app['authentication']->getUser())->has_right_on_base($child->get_base_id(), 'candeleterecord')) {
$child->move_to_collection($collection, $app['phraseanet.appbox']);
$app['dispatcher']->dispatch(PhraseaEvents::RECORD_CHANGE_COLLECTION, new ChangeCollectionEvent($child));
}
}
}