diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Records.php b/lib/Alchemy/Phrasea/Controller/Prod/Records.php index 3621fd97d3..9bdc1bc106 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Records.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Records.php @@ -14,8 +14,6 @@ namespace Alchemy\Phrasea\Controller\Prod; use Alchemy\Phrasea\Controller\RecordsRequest; use Alchemy\Phrasea\Core\Event\RecordEvent\RecordDeletedEvent; use Alchemy\Phrasea\Core\Event\RecordEvent\RecordEvents; -use Alchemy\Phrasea\Core\Event\RecordEvent\StoryDeletedEvent; -use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\SearchEngine\SearchEngineOptions; use Silex\Application; use Silex\ControllerProviderInterface; @@ -179,11 +177,7 @@ class Records implements ControllerProviderInterface $deleted[] = $record->get_serialize_key(); $record->delete(); - if ($record->isStory()) { - $app['dispatcher']->dispatch(PhraseaEvents::STORY_DELETED, new StoryDeletedEvent($record)); - } else { - $app['dispatcher']->dispatch(RecordEvents::DELETED, new RecordDeletedEvent($record)); - } + $app['dispatcher']->dispatch(RecordEvents::DELETED, new RecordDeletedEvent($record)); } catch (\Exception $e) { } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 22dc497cc2..d3ea669d3d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -13,8 +13,8 @@ namespace Alchemy\Phrasea\Controller\Prod; use Alchemy\Phrasea\Controller\Exception as ControllerException; use Alchemy\Phrasea\Controller\RecordsRequest; -use Alchemy\Phrasea\Core\Event\RecordEvent\StoryMetadataChangedEvent; -use Alchemy\Phrasea\Core\PhraseaEvents; +use Alchemy\Phrasea\Core\Event\RecordEvent\RecordEvents; +use Alchemy\Phrasea\Core\Event\RecordEvent\RecordMetadataChangedEvent; use Alchemy\Phrasea\Model\Entities\StoryWZ; use Silex\Application; use Silex\ControllerProviderInterface; @@ -76,7 +76,7 @@ class Story implements ControllerProviderInterface $Story->set_metadatas($metadatas)->rebuild_subdefs(); - $app['dispatcher']->dispatch(PhraseaEvents::STORY_METADATA_CHANGED, new StoryMetadataChangedEvent($Story)); + $app['dispatcher']->dispatch(RecordEvents::METADATA_CHANGED, new RecordMetadataChangedEvent($Story)); $StoryWZ = new StoryWZ(); $StoryWZ->setUser($app['authentication']->getUser()); diff --git a/lib/Alchemy/Phrasea/Core/Event/RecordEvent/StoryCreatedEvent.php b/lib/Alchemy/Phrasea/Core/Event/RecordEvent/StoryCreatedEvent.php deleted file mode 100644 index 4847f0794a..0000000000 --- a/lib/Alchemy/Phrasea/Core/Event/RecordEvent/StoryCreatedEvent.php +++ /dev/null @@ -1,16 +0,0 @@ -set_binary_status(\databox_status::operation_or($app, $stat0, $stat1)); $story->rebuild_subdefs(); - $app['dispatcher']->dispatch(PhraseaEvents::STORY_CREATED, new StoryCreatedEvent($story)); + $app['dispatcher']->dispatch(RecordEvents::CREATED, new RecordCreatedEvent($story)); unset($media);