From 074920353a35f159abb4742b805f3bdb5fdf3630 Mon Sep 17 00:00:00 2001 From: aynsix Date: Tue, 16 Nov 2021 17:15:49 +0300 Subject: [PATCH] PHRAS-3555 add more webhook events --- Phraseanet-production-client/config/config.js | 2 +- Phraseanet-production-client/dist/account.js | 13 ++ .../dist/account.min.js | 13 ++ .../dist/authenticate.js | 2 +- .../dist/authenticate.min.js | 2 +- Phraseanet-production-client/dist/commons.js | 2 +- .../dist/commons.min.js | 2 +- .../src/components/account/index.js | 14 ++ .../Controller/Root/DeveloperController.php | 62 +++++++ .../ControllerProvider/Root/Developers.php | 9 +- .../WebhookRecordEventSubscriber.php | 127 +++++++++++++ .../Core/Provider/WebhookServiceProvider.php | 2 + .../Phrasea/Model/Entities/ApiApplication.php | 47 +++++ .../Phrasea/Model/Entities/WebhookEvent.php | 9 + .../Elastic/IndexerSubscriber.php | 2 + .../Phrasea/Twig/PhraseanetExtension.php | 2 +- .../Phrasea/Webhook/EventProcessorFactory.php | 4 + .../Processor/RecordEventProcessor.php | 16 ++ .../WorkerManager/Event/WorkerEvents.php | 2 + .../Subscriber/RecordSubscriber.php | 2 +- .../WorkerManager/Worker/WebhookWorker.php | 6 + resources/locales/messages.de.xlf | 169 ++++++++++++++---- resources/locales/messages.en.xlf | 169 ++++++++++++++---- resources/locales/messages.fr.xlf | 169 ++++++++++++++---- resources/locales/messages.nl.xlf | 155 ++++++++++++---- resources/locales/validators.de.xlf | 2 +- resources/locales/validators.en.xlf | 2 +- resources/locales/validators.fr.xlf | 2 +- resources/locales/validators.nl.xlf | 2 +- .../web/developers/application.html.twig | 39 ++++ 30 files changed, 896 insertions(+), 153 deletions(-) create mode 100644 lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookRecordEventSubscriber.php create mode 100644 lib/Alchemy/Phrasea/Webhook/Processor/RecordEventProcessor.php diff --git a/Phraseanet-production-client/config/config.js b/Phraseanet-production-client/config/config.js index 673a80f503..7c87bc1c59 100644 --- a/Phraseanet-production-client/config/config.js +++ b/Phraseanet-production-client/config/config.js @@ -13,5 +13,5 @@ module.exports = { setupDir: _root + 'tests/setup/node.js', karmaConf: _root + 'config/karma.conf.js', // change this version when you change JS file for lazy loading - assetFileVersion: 30 + assetFileVersion: 31 }; diff --git a/Phraseanet-production-client/dist/account.js b/Phraseanet-production-client/dist/account.js index eedab071c4..7ee20b05be 100644 --- a/Phraseanet-production-client/dist/account.js +++ b/Phraseanet-production-client/dist/account.js @@ -4210,6 +4210,19 @@ var account = function account(services) { }); }); + $container.on('click', '.update-listened-event', function () { + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('data-path'), + dataType: 'json', + data: { + action: $this.is(':checked') ? 'add' : 'remove' + }, + success: function success(data) {} + }); + }); + // delete an application /* $('a.delete-app').bind('click', function (e) { e.preventDefault(); diff --git a/Phraseanet-production-client/dist/account.min.js b/Phraseanet-production-client/dist/account.min.js index eedab071c4..7ee20b05be 100644 --- a/Phraseanet-production-client/dist/account.min.js +++ b/Phraseanet-production-client/dist/account.min.js @@ -4210,6 +4210,19 @@ var account = function account(services) { }); }); + $container.on('click', '.update-listened-event', function () { + var $this = (0, _jquery2.default)(this); + _jquery2.default.ajax({ + type: 'POST', + url: $this.attr('data-path'), + dataType: 'json', + data: { + action: $this.is(':checked') ? 'add' : 'remove' + }, + success: function success(data) {} + }); + }); + // delete an application /* $('a.delete-app').bind('click', function (e) { e.preventDefault(); diff --git a/Phraseanet-production-client/dist/authenticate.js b/Phraseanet-production-client/dist/authenticate.js index 9fe7bc0004..ed3240bf27 100644 --- a/Phraseanet-production-client/dist/authenticate.js +++ b/Phraseanet-production-client/dist/authenticate.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=30"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=31"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/authenticate.min.js b/Phraseanet-production-client/dist/authenticate.min.js index d807d93523..b17752b1c9 100644 --- a/Phraseanet-production-client/dist/authenticate.min.js +++ b/Phraseanet-production-client/dist/authenticate.min.js @@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=30"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=31"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.js b/Phraseanet-production-client/dist/commons.js index ab12731581..d56b474cc9 100644 --- a/Phraseanet-production-client/dist/commons.js +++ b/Phraseanet-production-client/dist/commons.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=30"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=31"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/dist/commons.min.js b/Phraseanet-production-client/dist/commons.min.js index bbcb9e079a..f46ce31bcf 100644 --- a/Phraseanet-production-client/dist/commons.min.js +++ b/Phraseanet-production-client/dist/commons.min.js @@ -91,7 +91,7 @@ /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } -/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=30"; +/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=31"; /******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ script.onerror = script.onload = onScriptComplete; /******/ function onScriptComplete() { diff --git a/Phraseanet-production-client/src/components/account/index.js b/Phraseanet-production-client/src/components/account/index.js index ab5f70ddfa..42a36e7b94 100644 --- a/Phraseanet-production-client/src/components/account/index.js +++ b/Phraseanet-production-client/src/components/account/index.js @@ -168,6 +168,20 @@ const account = (services) => { }); }); + $container.on('click', '.update-listened-event', function () { + let $this = $(this); + $.ajax({ + type: 'POST', + url: $this.attr('data-path'), + dataType: 'json', + data: { + action: $this.is(':checked') ? 'add' : 'remove' + }, + success: function (data) { + } + }); + }); + // delete an application /* $('a.delete-app').bind('click', function (e) { e.preventDefault(); diff --git a/lib/Alchemy/Phrasea/Controller/Root/DeveloperController.php b/lib/Alchemy/Phrasea/Controller/Root/DeveloperController.php index e39c8f8cd5..90be0bfa94 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/DeveloperController.php +++ b/lib/Alchemy/Phrasea/Controller/Root/DeveloperController.php @@ -9,10 +9,12 @@ */ namespace Alchemy\Phrasea\Controller\Root; +use Alchemy\Phrasea\Application\Helper\EntityManagerAware; use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\ControllerProvider\Api\V2; use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Model\Entities\ApiApplication; +use Alchemy\Phrasea\Model\Entities\WebhookEvent; use Alchemy\Phrasea\Model\Manipulator\ApiAccountManipulator; use Alchemy\Phrasea\Model\Manipulator\ApiApplicationManipulator; use Alchemy\Phrasea\Model\Manipulator\ApiOauthTokenManipulator; @@ -29,6 +31,8 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; class DeveloperController extends Controller { + use EntityManagerAware; + /** * Delete application. * @@ -253,9 +257,34 @@ class DeveloperController extends Controller "deliveries" => $deliveries, "user" => $user, "token" => $token, + "webhook_event_list" => $this->getWebhookEventsList() ]); } + /** + * Update listenedEvents in application + * + * @param Request $request + * @param ApiApplication $application + * @return JsonResponse + */ + public function updateListenedEvent(Request $request, ApiApplication $application) + { + $manager = $this->getEntityManager(); + $eventName = $request->query->get('event_name'); + + if ($request->request->get('action') == 'add') { + $application->addListenedEvent($eventName); + } elseif ($request->request->get('action') == 'remove') { + $application->removeListenedEvent($eventName); + } + + $manager->persist($application); + $manager->flush(); + + return $this->app->json(['success' => true]); + } + /** * @return ApiAccountRepository */ @@ -311,4 +340,37 @@ class DeveloperController extends Controller { return $this->app['webhook.delivery_repository']; } + + private function getWebhookEventsList() + { + return [ + WebhookEvent::RECORD_TYPE => [ + WebhookEvent::RECORD_CREATED => $this->app->trans("developers:: record or story created"), + WebhookEvent::RECORD_EDITED => $this->app->trans('developers:: record or story edited'), + WebhookEvent::RECORD_DELETED => $this->app->trans('developers:: record or story deleted'), + WebhookEvent::RECORD_MEDIA_SUBSTITUTED => $this->app->trans('developers:: media substituted for record'), + WebhookEvent::RECORD_COLLECTION_CHANGED => $this->app->trans('developers:: collection changed for record'), + WebhookEvent::RECORD_STATUS_CHANGED => $this->app->trans('developers:: status changed for record') + ], + WebhookEvent::RECORD_SUBDEF_TYPE => [ + WebhookEvent::RECORD_SUBDEF_CREATED => $this->app->trans('developers:: subdef created for a record'), + WebhookEvent::RECORD_SUBDEF_FAILED => $this->app->trans('developers:: subdef creation failed for a record'), + ], + WebhookEvent::USER_DELETED_TYPE => [ + WebhookEvent::USER_DELETED => $this->app->trans('developers:: user deleted on phraseanet') + ], + WebhookEvent::USER_REGISTRATION_TYPE => [ + WebhookEvent::USER_REGISTRATION_GRANTED => $this->app->trans('developers:: user registration granted on phraseanet'), + WebhookEvent::USER_REGISTRATION_REJECTED => $this->app->trans('developers:: user registration rejected on phraseanet') + ], + WebhookEvent::FEED_ENTRY_TYPE => [ + WebhookEvent::NEW_FEED_ENTRY => $this->app->trans('developers:: new feed entry on phraseanet') + ], + WebhookEvent::ORDER_TYPE => [ + WebhookEvent::ORDER_CREATED => $this->app->trans('developers:: new order created'), + WebhookEvent::ORDER_DELIVERED => $this->app->trans('developers:: a order delivered'), + WebhookEvent::ORDER_DENIED => $this->app->trans('developers:: a order denied') + ] + ]; + } } diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Root/Developers.php b/lib/Alchemy/Phrasea/ControllerProvider/Root/Developers.php index 8d05d943f6..ca041c3809 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Root/Developers.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Root/Developers.php @@ -14,6 +14,7 @@ namespace Alchemy\Phrasea\ControllerProvider\Root; use Alchemy\Phrasea\Application as PhraseaApplication; use Alchemy\Phrasea\Controller\Root\DeveloperController; use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait; +use Alchemy\Phrasea\Core\LazyLocator; use Silex\Application; use Silex\ControllerProviderInterface; use Silex\ServiceProviderInterface; @@ -25,7 +26,8 @@ class Developers implements ControllerProviderInterface, ServiceProviderInterfac public function register(Application $app) { $app['controller.account.developers'] = $app->share(function (PhraseaApplication $app) { - return (new DeveloperController($app)); + return (new DeveloperController($app)) + ->setEntityManagerLocator(new LazyLocator($app, 'orm.em')); }); } @@ -58,6 +60,11 @@ class Developers implements ControllerProviderInterface, ServiceProviderInterfac ->assert('application', '\d+') ->bind('developers_application'); + $controllers->post('/application/{application}/listened-event', 'controller.account.developers:updateListenedEvent') + ->before($app['middleware.api-application.converter']) + ->assert('application', '\d+') + ->bind('developers_application_listened_event'); + $controllers->delete('/application/{application}/', 'controller.account.developers:deleteApp') ->before($app['middleware.api-application.converter']) ->assert('application', '\d+') diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookRecordEventSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookRecordEventSubscriber.php new file mode 100644 index 0000000000..0b866a3677 --- /dev/null +++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/WebhookRecordEventSubscriber.php @@ -0,0 +1,127 @@ +app = $application; + $this->appboxLocator = new LazyLocator($this->app, 'phraseanet.appbox'); + } + + public function onRecordCreated(RecordEvent $event) + { + $this->createWebhookEvent($event, WebhookEvent::RECORD_CREATED); + } + + public function onRecordEdit(RecordEvent $event) + { + $this->createWebhookEvent($event, WebhookEvent::RECORD_EDITED); + } + + public function onRecordDeleted(RecordEvent $event) + { + $this->createWebhookEvent($event, WebhookEvent::RECORD_DELETED); + } + + public function onRecordMediaSubstituted(RecordEvent $event) + { + // event only from record_type = record + $this->createWebhookEvent($event, WebhookEvent::RECORD_MEDIA_SUBSTITUTED); + } + + public function onRecordCollectionChanged(RecordEvent $event) + { + $this->createWebhookEvent($event, WebhookEvent::RECORD_COLLECTION_CHANGED); + } + + public function onRecordStatusChanged(RecordEvent $event) + { + $this->createWebhookEvent($event, WebhookEvent::RECORD_STATUS_CHANGED); + } + + /** + * @inheritDoc + */ + public static function getSubscribedEvents() + { + return [ + RecordEvents::CREATED => 'onRecordCreated', /** @uses onRecordCreated */ + PhraseaEvents::RECORD_EDIT => 'onRecordEdit', /** @uses onRecordEdit */ + RecordEvents::DELETED => 'onRecordDeleted', /** @uses onRecordDeleted */ + RecordEvents::MEDIA_SUBSTITUTED => 'onRecordMediaSubstituted', /** @uses onRecordMediaSubstituted */ + RecordEvents::COLLECTION_CHANGED => 'onRecordCollectionChanged', /** @uses onRecordCollectionChanged */ + RecordEvents::STATUS_CHANGED => 'onRecordStatusChanged', /** @uses onRecordStatusChanged */ + ]; + } + + private function createWebhookEvent(RecordEvent $event, $webhookEventName) + { + $record = $this->convertToRecordAdapter($event->getRecord()); + + if ($record !== null) { + $eventData = [ + 'databox_id' => $event->getRecord()->getDataboxId(), + 'record_id' => $event->getRecord()->getRecordId(), + 'collection_name' => $record->getCollection()->get_name(), + 'record_type' => $event->getRecord()->isStory() ? "story" : "record" + ]; + + $this->app['manipulator.webhook-event']->create( + $webhookEventName, + WebhookEvent::RECORD_TYPE, + $eventData, + [$event->getRecord()->getBaseId()] + ); + } else { + $this->app['logger']->error("Record not found when wanting to create webhook data!"); + } + } + + private function convertToRecordAdapter(RecordInterface $record) + { + if ($record instanceof \record_adapter) { + return $record; + } + + $databox = $this->getApplicationBox()->get_databox($record->getDataboxId()); + + $recordAdapter = $databox->getRecordRepository()->find($record->getRecordId()); + + return ($recordAdapter !== null) ? $recordAdapter : null; + } + + /** + * @return \appbox + */ + private function getApplicationBox() + { + $callable = $this->appboxLocator; + + return $callable(); + } +} \ No newline at end of file diff --git a/lib/Alchemy/Phrasea/Core/Provider/WebhookServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/WebhookServiceProvider.php index 43a5aeafa4..a2ee94b0bb 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/WebhookServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/WebhookServiceProvider.php @@ -2,6 +2,7 @@ namespace Alchemy\Phrasea\Core\Provider; +use Alchemy\Phrasea\Core\Event\Subscriber\WebhookRecordEventSubscriber; use Alchemy\Phrasea\Core\Event\Subscriber\WebhookSubdefEventSubscriber; use Alchemy\Phrasea\Webhook\EventProcessorFactory; use Alchemy\Phrasea\Webhook\EventProcessorWorker; @@ -64,6 +65,7 @@ class WebhookServiceProvider implements ServiceProviderInterface $app['dispatcher'] = $app->share( $app->extend('dispatcher', function (EventDispatcher $dispatcher, Application $app) { $dispatcher->addSubscriber(new WebhookSubdefEventSubscriber($app)); + $dispatcher->addSubscriber(new WebhookRecordEventSubscriber($app)); return $dispatcher; }) diff --git a/lib/Alchemy/Phrasea/Model/Entities/ApiApplication.php b/lib/Alchemy/Phrasea/Model/Entities/ApiApplication.php index f67a4c4738..f9b01cbf18 100644 --- a/lib/Alchemy/Phrasea/Model/Entities/ApiApplication.php +++ b/lib/Alchemy/Phrasea/Model/Entities/ApiApplication.php @@ -131,6 +131,14 @@ class ApiApplication */ private $webhookUrl; + /** + * List of events to trigger webhook + * @var array + * + * @ORM\Column(name="listened_events", type="json_array", nullable=true) + */ + private $listenedEvents; + public function __construct() { $this->accounts = new ArrayCollection(); @@ -431,4 +439,43 @@ class ApiApplication return $this; } + + /** + * @param array $listenedEvents + */ + public function setListenedEvents(array $listenedEvents) + { + $this->listenedEvents = $listenedEvents; + } + + /** + * @param $eventName + */ + public function addListenedEvent($eventName) + { + $this->listenedEvents[] = $eventName; + } + + /** + * @param $eventName + * @return $this + */ + public function removeListenedEvent($eventName) + { + $keys = array_keys($this->listenedEvents, $eventName, true); + + foreach ($keys as $key) { + unset($this->listenedEvents[$key]); + } + + return $this; + } + + /** + * @return array + */ + public function getListenedEvents() + { + return $this->listenedEvents; + } } diff --git a/lib/Alchemy/Phrasea/Model/Entities/WebhookEvent.php b/lib/Alchemy/Phrasea/Model/Entities/WebhookEvent.php index a1091f531f..eeb34392cb 100644 --- a/lib/Alchemy/Phrasea/Model/Entities/WebhookEvent.php +++ b/lib/Alchemy/Phrasea/Model/Entities/WebhookEvent.php @@ -31,6 +31,15 @@ class WebhookEvent const ORDER_DELIVERED = 'order.delivered'; const ORDER_DENIED = 'order.denied'; + // const use only as name and type of a webhook + const RECORD_TYPE = 'record'; + const RECORD_CREATED = 'record.created'; + const RECORD_EDITED = 'record.edited'; + const RECORD_DELETED = 'record.deleted'; + const RECORD_MEDIA_SUBSTITUTED = 'record.media_substituted'; + const RECORD_COLLECTION_CHANGED = 'record.collection_changed'; + const RECORD_STATUS_CHANGED = 'record.status_changed'; + /** * @ORM\Column(type="integer") * @ORM\Id diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/IndexerSubscriber.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/IndexerSubscriber.php index f03b2e9d03..ff2b3ff903 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/IndexerSubscriber.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/IndexerSubscriber.php @@ -20,6 +20,7 @@ use Alchemy\Phrasea\Core\Event\Record\Structure\RecordStructureEvents; use Alchemy\Phrasea\Core\Event\Thesaurus\ReindexRequiredEvent; use Alchemy\Phrasea\Core\Event\Thesaurus\ThesaurusEvent; use Alchemy\Phrasea\Core\Event\Thesaurus\ThesaurusEvents; +use Alchemy\Phrasea\WorkerManager\Event\WorkerEvents; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** @@ -81,6 +82,7 @@ class IndexerSubscriber implements EventSubscriberInterface CollectionEvents::NAME_CHANGED => 'onCollectionChange', RecordEvents::CREATED => 'onRecordChange', RecordEvents::DELETED => 'onRecordDelete', + WorkerEvents::RECORD_DELETE_INDEX => 'onRecordDelete', RecordEvents::COLLECTION_CHANGED => 'onRecordChange', RecordEvents::METADATA_CHANGED => 'onRecordChange', RecordEvents::ORIGINAL_NAME_CHANGED => 'onRecordChange', diff --git a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php index 0ff1b8c35e..bef1273c2d 100644 --- a/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php +++ b/lib/Alchemy/Phrasea/Twig/PhraseanetExtension.php @@ -59,7 +59,7 @@ class PhraseanetExtension extends \Twig_Extension { return [ // change this version when you change JS file to force the navigation to reload js file - 'assetFileVersion' => 30 + 'assetFileVersion' => 31 ]; } diff --git a/lib/Alchemy/Phrasea/Webhook/EventProcessorFactory.php b/lib/Alchemy/Phrasea/Webhook/EventProcessorFactory.php index 79109a624c..ac549874ad 100644 --- a/lib/Alchemy/Phrasea/Webhook/EventProcessorFactory.php +++ b/lib/Alchemy/Phrasea/Webhook/EventProcessorFactory.php @@ -10,6 +10,7 @@ use Alchemy\Phrasea\Webhook\Processor\FeedEntryProcessorFactory; use Alchemy\Phrasea\Webhook\Processor\OrderNotificationProcessorFactory; use Alchemy\Phrasea\Webhook\Processor\ProcessorFactory; use Alchemy\Phrasea\Webhook\Processor\ProcessorInterface; +use Alchemy\Phrasea\Webhook\Processor\RecordEventProcessor; use Alchemy\Phrasea\Webhook\Processor\UserDeletedProcessorFactory; use Alchemy\Phrasea\Webhook\Processor\UserRegistrationProcessorFactory; use Alchemy\Phrasea\Webhook\Processor\SubdefEventProcessor; @@ -34,6 +35,9 @@ class EventProcessorFactory $this->registerCallableFactory(WebhookEvent::RECORD_SUBDEF_TYPE, function () { return new SubdefEventProcessor(); }); + $this->registerCallableFactory(WebhookEvent::RECORD_TYPE, function () { + return new RecordEventProcessor(); + }); } /** diff --git a/lib/Alchemy/Phrasea/Webhook/Processor/RecordEventProcessor.php b/lib/Alchemy/Phrasea/Webhook/Processor/RecordEventProcessor.php new file mode 100644 index 0000000000..5f79311137 --- /dev/null +++ b/lib/Alchemy/Phrasea/Webhook/Processor/RecordEventProcessor.php @@ -0,0 +1,16 @@ + $event->getName(), + 'data' => $event->getData() + ]; + } +} diff --git a/lib/Alchemy/Phrasea/WorkerManager/Event/WorkerEvents.php b/lib/Alchemy/Phrasea/WorkerManager/Event/WorkerEvents.php index c47de5a557..98c86dde26 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Event/WorkerEvents.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Event/WorkerEvents.php @@ -27,4 +27,6 @@ final class WorkerEvents const RECORD_EDIT_IN_WORKER = 'record.edit_in_worker'; const RECORDS_WRITE_META = 'records.write_meta'; + + const RECORD_DELETE_INDEX = 'record.delete_index'; } diff --git a/lib/Alchemy/Phrasea/WorkerManager/Subscriber/RecordSubscriber.php b/lib/Alchemy/Phrasea/WorkerManager/Subscriber/RecordSubscriber.php index fbb1245180..436b21dc23 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Subscriber/RecordSubscriber.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Subscriber/RecordSubscriber.php @@ -78,7 +78,7 @@ class RecordSubscriber implements EventSubscriberInterface public function onDelete(DeleteEvent $event) { // first remove record from the grid answer, so first delete the record in the index elastic - $this->app['dispatcher']->dispatch(RecordEvents::DELETED, new DeletedEvent($event->getRecord())); + $this->app['dispatcher']->dispatch(WorkerEvents::RECORD_DELETE_INDEX, new DeletedEvent($event->getRecord())); // publish payload to queue $payload = [ diff --git a/lib/Alchemy/Phrasea/WorkerManager/Worker/WebhookWorker.php b/lib/Alchemy/Phrasea/WorkerManager/Worker/WebhookWorker.php index 04f163305e..03d388cce6 100644 --- a/lib/Alchemy/Phrasea/WorkerManager/Worker/WebhookWorker.php +++ b/lib/Alchemy/Phrasea/WorkerManager/Worker/WebhookWorker.php @@ -161,6 +161,12 @@ class WebhookWorker implements WorkerInterface continue; } + // check if the third-application listen this event + // if listenedEvents is empty, third-application can received all webhookevent + if (!empty($thirdPartyApplication->getListenedEvents()) && !in_array($webhookevent->getName(), $thirdPartyApplication->getListenedEvents())) { + continue; + } + $creatorGrantedBaseIds = array_keys($this->app['acl']->get($creator)->get_granted_base()); $concernedBaseIds = array_intersect($webhookevent->getCollectionBaseIds(), $creatorGrantedBaseIds); diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index ffc6e4ecca..207b145d72 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig - %number% documents<br/>selectionnes + selectionnes]]> ausgewählt]]> Controller/Prod/QueryController.php @@ -249,7 +249,7 @@ %quantity% selected files %quantity% ausgewählte Dateien - prod/upload/upload.html.twig + prod/upload/upload.html.twig %quantity_records% records have been sent for validation to %quantity_users% users @@ -264,7 +264,7 @@ %record_count% records match the unique identifier : %record_count% Datensätze entsprechen dem eindeutigen Bezeichner: - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig %s field has been created with success. @@ -466,12 +466,12 @@ A file with the same UUID already exists in database Eine Datei mit ähnlichen UUID ist schon in der Datenbank - Border/Checker/UUID.php + Border/Checker/UUID.php A file with the same checksum already exists in database Eine Datei mit selber Checksumme ist schon in der Datenbank - Border/Checker/Sha256.php + Border/Checker/Sha256.php A file with the same filename already exists in database @@ -481,7 +481,7 @@ A record matches the unique identifier : Ein Datensatz entspricht dem eindeutigen Bezeichner : - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig A required field is missing or has an empty value @@ -670,8 +670,8 @@ Hinzufügen prod/User/Add.html.twig prod/actions/Push.html.twig - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Add a new field @@ -970,7 +970,7 @@ An error occured Ein Fehler ist aufgetreten Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/MoveCollectionController.php Controller/Prod/LazaretController.php Controller/Prod/BasketController.php @@ -1595,7 +1595,7 @@ Cancel all Alle abbrechen - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -1791,7 +1791,7 @@ Clear list Liste löschen - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -2382,8 +2382,8 @@ Delete Löschen - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig admin/task-manager/templates.html.twig @@ -2455,7 +2455,7 @@ Derniers envois Letzte Sendungen - web/developers/application.html.twig + web/developers/application.html.twig Des difficultes ont ete rencontres a la connection au serveur distant @@ -2534,7 +2534,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Anzeige und Handlung-Einstellungen admin/fields/templates.html.twig @@ -3283,8 +3283,8 @@ File is not present in quarantine anymore, please refresh Datei befindet sich nicht mehr in der Quarantäne, bitte aktualisieren Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/LazaretController.php Controller/Prod/LazaretController.php @@ -5922,7 +5922,7 @@ Résultats des derniers envois effectués pour cette application Ergebnisse der letzten gesendeten Nachrichten für diese Anwendung - web/developers/application.html.twig + web/developers/application.html.twig SMTP encryption @@ -6113,7 +6113,7 @@ web/login/forgot-password.html.twig prod/actions/Push.html.twig prod/actions/Push.html.twig - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig prod/orders/order_item.html.twig prod/orders/order_item.html.twig @@ -6472,8 +6472,8 @@ Substitute Ersetzung - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Substitution is not possible for this kind of record @@ -6745,7 +6745,7 @@ The file was moved to the quarantine Datei wurde unter Quarantäne gestellt - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The following errors have been detected @@ -6761,7 +6761,7 @@ The record was successfully created Datensatz wurde erfolgreich erstellt - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The records have been properly ordered @@ -6996,7 +6996,7 @@ Transmited files Übermittelte Dateien - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -7058,7 +7058,7 @@ Unable to add file to Phraseanet Unmöglich, Datei zu Phraseanet hinzuzufügen - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php Controller/Admin/FeedController.php @@ -7848,7 +7848,7 @@ You can not upload files Sie dürfen Dateien nicht hochladen - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -9988,7 +9988,7 @@ boutton::retour Zurück - web/developers/application.html.twig + web/developers/application.html.twig web/developers/application_form.html.twig Bridge/Flickr/photo_deleteelement.html.twig Bridge/Flickr/photoset_deleteelement.html.twig @@ -10345,6 +10345,101 @@ absteigend SearchEngine/Elastic/ElasticSearchEngine.php + + developers:: Events name + developers:: Events name + web/developers/application.html.twig + + + developers:: Events trigger this webhook + developers:: Events trigger this webhook + web/developers/application.html.twig + + + developers:: Events type + developers:: Events type + web/developers/application.html.twig + + + developers:: Select events to trigger this webhook url + developers:: Select events to trigger this webhook url + web/developers/application.html.twig + + + developers:: a order delivered + developers:: a order delivered + Controller/Root/DeveloperController.php + + + developers:: a order denied + developers:: a order denied + Controller/Root/DeveloperController.php + + + developers:: collection changed for record + developers:: collection changed for record + Controller/Root/DeveloperController.php + + + developers:: media substituted for record + developers:: media substituted for record + Controller/Root/DeveloperController.php + + + developers:: new feed entry on phraseanet + developers:: new feed entry on phraseanet + Controller/Root/DeveloperController.php + + + developers:: new order created + developers:: new order created + Controller/Root/DeveloperController.php + + + developers:: record or story created + developers:: record or story created + Controller/Root/DeveloperController.php + + + developers:: record or story deleted + developers:: record or story deleted + Controller/Root/DeveloperController.php + + + developers:: record or story edited + developers:: record or story edited + Controller/Root/DeveloperController.php + + + developers:: status changed for record + developers:: status changed for record + Controller/Root/DeveloperController.php + + + developers:: subdef created for a record + developers:: subdef created for a record + Controller/Root/DeveloperController.php + + + developers:: subdef creation failed for a record + developers:: subdef creation failed for a record + Controller/Root/DeveloperController.php + + + developers:: user deleted on phraseanet + developers:: user deleted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration granted on phraseanet + developers:: user registration granted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration rejected on phraseanet + developers:: user registration rejected on phraseanet + Controller/Root/DeveloperController.php + do you want to validate Möchten Sie bestätigen? @@ -11720,7 +11815,7 @@ Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Ihr Benutzerkonto kann nur durch die Administration Anwendung gelöscht werden. web/account/account.html.twig @@ -13864,12 +13959,12 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben same UUID dieselbe UUID - Border/Checker/UUID.php + Border/Checker/UUID.php same checksum gleiche Prüfsumme - Border/Checker/Sha256.php + Border/Checker/Sha256.php same filename @@ -14349,7 +14444,7 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig @@ -14927,9 +15022,9 @@ Vorsicht: die aktuelle Werte werden durch die neue Werte überschrieben upload:: Status : Status - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig users rights have been reseted diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index 45fafa19f4..39ed4b2a54 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig
- %number% documents<br/>selectionnes + selectionnes]]> selected]]> Controller/Prod/QueryController.php @@ -249,7 +249,7 @@ %quantity% selected files %quantity% selected files - prod/upload/upload.html.twig + prod/upload/upload.html.twig %quantity_records% records have been sent for validation to %quantity_users% users @@ -264,7 +264,7 @@ %record_count% records match the unique identifier : %record_count% records match the unique identifier: - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig %s field has been created with success. @@ -466,12 +466,12 @@ A file with the same UUID already exists in database A file with the same UUID already exists in the database - Border/Checker/UUID.php + Border/Checker/UUID.php A file with the same checksum already exists in database A file with the same checksum already exists in the database - Border/Checker/Sha256.php + Border/Checker/Sha256.php A file with the same filename already exists in database @@ -481,7 +481,7 @@ A record matches the unique identifier : A record matches the unique identifier: - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig A required field is missing or has an empty value @@ -670,8 +670,8 @@ Add prod/User/Add.html.twig prod/actions/Push.html.twig - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Add a new field @@ -971,7 +971,7 @@ An error occured An error occurred Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/MoveCollectionController.php Controller/Prod/LazaretController.php Controller/Prod/BasketController.php @@ -1596,7 +1596,7 @@ Cancel all Cancel all - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -1793,7 +1793,7 @@ Clear list Clear list - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -2385,8 +2385,8 @@ Delete Delete - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig admin/task-manager/templates.html.twig @@ -2458,7 +2458,7 @@ Derniers envois Last sent - web/developers/application.html.twig + web/developers/application.html.twig Des difficultes ont ete rencontres a la connection au serveur distant @@ -2537,7 +2537,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Display and action settings admin/fields/templates.html.twig @@ -3286,8 +3286,8 @@ File is not present in quarantine anymore, please refresh Document is not in quarantine anymore, please refresh Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/LazaretController.php Controller/Prod/LazaretController.php @@ -5925,7 +5925,7 @@ Résultats des derniers envois effectués pour cette application Last webhooks sent for this application - web/developers/application.html.twig + web/developers/application.html.twig SMTP encryption @@ -6116,7 +6116,7 @@ web/login/forgot-password.html.twig prod/actions/Push.html.twig prod/actions/Push.html.twig - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig prod/orders/order_item.html.twig prod/orders/order_item.html.twig @@ -6475,8 +6475,8 @@ Substitute Substitute - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Substitution is not possible for this kind of record @@ -6748,7 +6748,7 @@ The file was moved to the quarantine The file has moved to quarantine - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The following errors have been detected @@ -6764,7 +6764,7 @@ The record was successfully created The record has been successfully created - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The records have been properly ordered @@ -6999,7 +6999,7 @@ Transmited files Transmitted files - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -7061,7 +7061,7 @@ Unable to add file to Phraseanet Unable to add files to Phraseanet - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php Controller/Admin/FeedController.php @@ -7851,7 +7851,7 @@ You can not upload files You are not allowed to upload files - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -9991,7 +9991,7 @@ boutton::retour Back - web/developers/application.html.twig + web/developers/application.html.twig web/developers/application_form.html.twig Bridge/Flickr/photo_deleteelement.html.twig Bridge/Flickr/photoset_deleteelement.html.twig @@ -10348,6 +10348,101 @@ descending SearchEngine/Elastic/ElasticSearchEngine.php + + developers:: Events name + developers:: Events name + web/developers/application.html.twig + + + developers:: Events trigger this webhook + developers:: Events trigger this webhook + web/developers/application.html.twig + + + developers:: Events type + developers:: Events type + web/developers/application.html.twig + + + developers:: Select events to trigger this webhook url + developers:: Select events to trigger this webhook url + web/developers/application.html.twig + + + developers:: a order delivered + developers:: a order delivered + Controller/Root/DeveloperController.php + + + developers:: a order denied + developers:: a order denied + Controller/Root/DeveloperController.php + + + developers:: collection changed for record + developers:: collection changed for record + Controller/Root/DeveloperController.php + + + developers:: media substituted for record + developers:: media substituted for record + Controller/Root/DeveloperController.php + + + developers:: new feed entry on phraseanet + developers:: new feed entry on phraseanet + Controller/Root/DeveloperController.php + + + developers:: new order created + developers:: new order created + Controller/Root/DeveloperController.php + + + developers:: record or story created + developers:: record or story created + Controller/Root/DeveloperController.php + + + developers:: record or story deleted + developers:: record or story deleted + Controller/Root/DeveloperController.php + + + developers:: record or story edited + developers:: record or story edited + Controller/Root/DeveloperController.php + + + developers:: status changed for record + developers:: status changed for record + Controller/Root/DeveloperController.php + + + developers:: subdef created for a record + developers:: subdef created for a record + Controller/Root/DeveloperController.php + + + developers:: subdef creation failed for a record + developers:: subdef creation failed for a record + Controller/Root/DeveloperController.php + + + developers:: user deleted on phraseanet + developers:: user deleted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration granted on phraseanet + developers:: user registration granted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration rejected on phraseanet + developers:: user registration rejected on phraseanet + Controller/Root/DeveloperController.php + do you want to validate Do you want to validate @@ -11723,7 +11818,7 @@ Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Your rights do not allow to perform this action. Your account can only be deleted via the Administration interface. web/account/account.html.twig @@ -13872,12 +13967,12 @@ It is possible to place several search areas same UUID A file with the same UUID already exists in the database - Border/Checker/UUID.php + Border/Checker/UUID.php same checksum A file with the same checksum already exists in the database - Border/Checker/Sha256.php + Border/Checker/Sha256.php same filename @@ -14357,7 +14452,7 @@ It is possible to place several search areas web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig @@ -14935,9 +15030,9 @@ It is possible to place several search areas upload:: Status : Apply status - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig users rights have been reseted diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index f5f6ffbdb1..4a69b739f3 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1,14 +1,14 @@ - + - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.
- - + + Form/Configuration/EmailFormType.php Form/Login/PhraseaAuthenticationForm.php @@ -196,7 +196,7 @@ Bridge/Dailymotion/element_informations.html.twig
- %number% documents<br/>selectionnes + selectionnes]]> sélectionnés]]> Controller/Prod/QueryController.php @@ -249,7 +249,7 @@ %quantity% selected files %quantity% fichiers sélectionnés - prod/upload/upload.html.twig + prod/upload/upload.html.twig %quantity_records% records have been sent for validation to %quantity_users% users @@ -264,7 +264,7 @@ %record_count% records match the unique identifier : %record_count% enregistrements correspondent à des identifiants uniques existants: - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig %s field has been created with success. @@ -466,12 +466,12 @@ A file with the same UUID already exists in database Un fichier avec le même UUID existe déjà dans la base de données - Border/Checker/UUID.php + Border/Checker/UUID.php A file with the same checksum already exists in database Un fichier avec la même somme de contrôle existe déjà dans la base de données - Border/Checker/Sha256.php + Border/Checker/Sha256.php A file with the same filename already exists in database @@ -481,7 +481,7 @@ A record matches the unique identifier : Un enregistrement correspond à un identifiant unique existant : - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig A required field is missing or has an empty value @@ -670,8 +670,8 @@ Ajouter prod/User/Add.html.twig prod/actions/Push.html.twig - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Add a new field @@ -970,7 +970,7 @@ An error occured Une erreur est survenue. Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/MoveCollectionController.php Controller/Prod/LazaretController.php Controller/Prod/BasketController.php @@ -1595,7 +1595,7 @@ Cancel all Annuler tout - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -1791,7 +1791,7 @@ Clear list Vider la liste - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -2382,8 +2382,8 @@ Delete Supprimer - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig admin/task-manager/templates.html.twig @@ -2455,7 +2455,7 @@ Derniers envois Derniers envois - web/developers/application.html.twig + web/developers/application.html.twig Des difficultes ont ete rencontres a la connection au serveur distant @@ -2534,7 +2534,7 @@ Form/Configuration/ActionsFormType.php - Display & action settings + Paramétrage d'affichage et d'action admin/fields/templates.html.twig @@ -3283,8 +3283,8 @@ File is not present in quarantine anymore, please refresh Ce fichier n'est plus en quarantaine, rafraîchissez la page Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/LazaretController.php Controller/Prod/LazaretController.php @@ -5924,7 +5924,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Résultats des derniers envois effectués pour cette application Résultats des derniers envois effectués pour cette application - web/developers/application.html.twig + web/developers/application.html.twig SMTP encryption @@ -6115,7 +6115,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis web/login/forgot-password.html.twig prod/actions/Push.html.twig prod/actions/Push.html.twig - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig prod/orders/order_item.html.twig prod/orders/order_item.html.twig @@ -6474,8 +6474,8 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Substitute Substituer - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Substitution is not possible for this kind of record @@ -6747,7 +6747,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis The file was moved to the quarantine Le fichier a été déplacé en quarantaine - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The following errors have been detected @@ -6763,7 +6763,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis The record was successfully created L'enregistrement a été créé - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The records have been properly ordered @@ -6998,7 +6998,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Transmited files Fichiers transmis - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -7060,7 +7060,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis Unable to add file to Phraseanet Impossible d'ajouter des fichiers à Phraseanet - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php Controller/Admin/FeedController.php @@ -7850,7 +7850,7 @@ Pour les utilisateurs authentifiés, la demande de validation est également dis You can not upload files Vous ne pouvez ajouter des fichiers - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -9991,7 +9991,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le boutton::retour Retour - web/developers/application.html.twig + web/developers/application.html.twig web/developers/application_form.html.twig Bridge/Flickr/photo_deleteelement.html.twig Bridge/Flickr/photoset_deleteelement.html.twig @@ -10348,6 +10348,101 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Descendant SearchEngine/Elastic/ElasticSearchEngine.php + + developers:: Events name + developers:: Events name + web/developers/application.html.twig + + + developers:: Events trigger this webhook + developers:: Events trigger this webhook + web/developers/application.html.twig + + + developers:: Events type + developers:: Events type + web/developers/application.html.twig + + + developers:: Select events to trigger this webhook url + developers:: Select events to trigger this webhook url + web/developers/application.html.twig + + + developers:: a order delivered + developers:: a order delivered + Controller/Root/DeveloperController.php + + + developers:: a order denied + developers:: a order denied + Controller/Root/DeveloperController.php + + + developers:: collection changed for record + developers:: collection changed for record + Controller/Root/DeveloperController.php + + + developers:: media substituted for record + developers:: media substituted for record + Controller/Root/DeveloperController.php + + + developers:: new feed entry on phraseanet + developers:: new feed entry on phraseanet + Controller/Root/DeveloperController.php + + + developers:: new order created + developers:: new order created + Controller/Root/DeveloperController.php + + + developers:: record or story created + developers:: record or story created + Controller/Root/DeveloperController.php + + + developers:: record or story deleted + developers:: record or story deleted + Controller/Root/DeveloperController.php + + + developers:: record or story edited + developers:: record or story edited + Controller/Root/DeveloperController.php + + + developers:: status changed for record + developers:: status changed for record + Controller/Root/DeveloperController.php + + + developers:: subdef created for a record + developers:: subdef created for a record + Controller/Root/DeveloperController.php + + + developers:: subdef creation failed for a record + developers:: subdef creation failed for a record + Controller/Root/DeveloperController.php + + + developers:: user deleted on phraseanet + developers:: user deleted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration granted on phraseanet + developers:: user registration granted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration rejected on phraseanet + developers:: user registration rejected on phraseanet + Controller/Root/DeveloperController.php + do you want to validate Souhaitez vous valider l'opération? @@ -11723,7 +11818,7 @@ Si vous recevez cet e-mail sans l'avoir sollicité, merci de l'ignorer ou de le Controller/Root/AccountController.php - phraseanet::account: << your account can be deleted via admin interface >> + >]]> Vos droits ne vous permettent pas de réaliser cette action, votre compte ne peut être supprimé que via l'interface d'Administration. web/account/account.html.twig @@ -13875,12 +13970,12 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles same UUID Un fichier avec le même UUID existe déjà dans la base de données - Border/Checker/UUID.php + Border/Checker/UUID.php same checksum Un fichier avec la même somme de contrôle existe déjà dans la base de données - Border/Checker/Sha256.php + Border/Checker/Sha256.php same filename @@ -14360,7 +14455,7 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles web/thesaurus/thesaurus.html.twig - thesaurus:: Supprimer cette branche ?&#10;(les termes concernes remonteront en candidats a la prochaine indexation) + web/thesaurus/thesaurus.html.twig @@ -14938,9 +15033,9 @@ Attention: les valeurs actuellement en place seront écrasées par ces nouvelles upload:: Status : Appliquer les status - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig users rights have been reseted diff --git a/resources/locales/messages.nl.xlf b/resources/locales/messages.nl.xlf index c2acfaf914..4d1d1fc21d 100644 --- a/resources/locales/messages.nl.xlf +++ b/resources/locales/messages.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. @@ -249,7 +249,7 @@ %quantity% selected files %quantity% selected files - prod/upload/upload.html.twig + prod/upload/upload.html.twig %quantity_records% records have been sent for validation to %quantity_users% users @@ -264,7 +264,7 @@ %record_count% records match the unique identifier : %record_count% records zijn gelijk aan de unieke id : - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig %s field has been created with success. @@ -466,12 +466,12 @@ A file with the same UUID already exists in database Een bestand met dezelfde UUID bestaat al in de database - Border/Checker/UUID.php + Border/Checker/UUID.php A file with the same checksum already exists in database Een bestand met dezelfde checksum bestaat al in de database - Border/Checker/Sha256.php + Border/Checker/Sha256.php A file with the same filename already exists in database @@ -481,7 +481,7 @@ A record matches the unique identifier : Een record is gelijk aan de unieke id : - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig A required field is missing or has an empty value @@ -670,8 +670,8 @@ Toevoegen prod/User/Add.html.twig prod/actions/Push.html.twig - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Add a @@ -972,7 +972,7 @@ An error occured Er is een fout opgetreden Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/MoveCollectionController.php Controller/Prod/LazaretController.php Controller/Prod/BasketController.php @@ -1597,7 +1597,7 @@ Cancel all Annuleer alles - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -1795,7 +1795,7 @@ Clear list Lijst wissen - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -2388,8 +2388,8 @@ Delete Verwijder - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig admin/task-manager/templates.html.twig @@ -2461,7 +2461,7 @@ Derniers envois Derniers envois - web/developers/application.html.twig + web/developers/application.html.twig Des difficultes ont ete rencontres a la connection au serveur distant @@ -3295,8 +3295,8 @@ File is not present in quarantine anymore, please refresh Bestand is niet meer in de quarantiane aanwezig, gelieve te vernieuwen Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php - Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php + Model/Manipulator/LazaretManipulator.php Controller/Prod/LazaretController.php Controller/Prod/LazaretController.php @@ -5934,7 +5934,7 @@ Résultats des derniers envois effectués pour cette application Résultats des derniers envois effectués pour cette application - web/developers/application.html.twig + web/developers/application.html.twig SMTP encryption @@ -6125,7 +6125,7 @@ web/login/forgot-password.html.twig prod/actions/Push.html.twig prod/actions/Push.html.twig - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig prod/orders/order_item.html.twig prod/orders/order_item.html.twig @@ -6484,8 +6484,8 @@ Substitute Vervangen - prod/upload/lazaret.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig Substitution is not possible for this kind of record @@ -6757,7 +6757,7 @@ The file was moved to the quarantine De file werd naar de quarantaine verplaatst - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The following errors have been detected @@ -6773,7 +6773,7 @@ The record was successfully created De record werd met succes gemaakt - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php The records have been properly ordered @@ -7008,7 +7008,7 @@ Transmited files Verzonden bestanden - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -7070,7 +7070,7 @@ Unable to add file to Phraseanet Onmogelijk om een bestand aan Phraseanet toe te voegen - Controller/Prod/UploadController.php + Controller/Prod/UploadController.php Controller/Admin/FeedController.php @@ -7860,7 +7860,7 @@ You can not upload files U kunt geen files uploaden - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig @@ -10000,7 +10000,7 @@ boutton::retour terug - web/developers/application.html.twig + web/developers/application.html.twig web/developers/application_form.html.twig Bridge/Flickr/photo_deleteelement.html.twig Bridge/Flickr/photoset_deleteelement.html.twig @@ -10357,6 +10357,101 @@ oplopend SearchEngine/Elastic/ElasticSearchEngine.php + + developers:: Events name + developers:: Events name + web/developers/application.html.twig + + + developers:: Events trigger this webhook + developers:: Events trigger this webhook + web/developers/application.html.twig + + + developers:: Events type + developers:: Events type + web/developers/application.html.twig + + + developers:: Select events to trigger this webhook url + developers:: Select events to trigger this webhook url + web/developers/application.html.twig + + + developers:: a order delivered + developers:: a order delivered + Controller/Root/DeveloperController.php + + + developers:: a order denied + developers:: a order denied + Controller/Root/DeveloperController.php + + + developers:: collection changed for record + developers:: collection changed for record + Controller/Root/DeveloperController.php + + + developers:: media substituted for record + developers:: media substituted for record + Controller/Root/DeveloperController.php + + + developers:: new feed entry on phraseanet + developers:: new feed entry on phraseanet + Controller/Root/DeveloperController.php + + + developers:: new order created + developers:: new order created + Controller/Root/DeveloperController.php + + + developers:: record or story created + developers:: record or story created + Controller/Root/DeveloperController.php + + + developers:: record or story deleted + developers:: record or story deleted + Controller/Root/DeveloperController.php + + + developers:: record or story edited + developers:: record or story edited + Controller/Root/DeveloperController.php + + + developers:: status changed for record + developers:: status changed for record + Controller/Root/DeveloperController.php + + + developers:: subdef created for a record + developers:: subdef created for a record + Controller/Root/DeveloperController.php + + + developers:: subdef creation failed for a record + developers:: subdef creation failed for a record + Controller/Root/DeveloperController.php + + + developers:: user deleted on phraseanet + developers:: user deleted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration granted on phraseanet + developers:: user registration granted on phraseanet + Controller/Root/DeveloperController.php + + + developers:: user registration rejected on phraseanet + developers:: user registration rejected on phraseanet + Controller/Root/DeveloperController.php + do you want to validate Wilt u goedkeuren @@ -13875,12 +13970,12 @@ same UUID same UUID - Border/Checker/UUID.php + Border/Checker/UUID.php same checksum same checksum - Border/Checker/Sha256.php + Border/Checker/Sha256.php same filename @@ -14938,9 +15033,9 @@ upload:: Status : Status - prod/upload/upload.html.twig + prod/upload/upload.html.twig prod/upload/upload-flash.html.twig - prod/upload/lazaret.html.twig + prod/upload/lazaret.html.twig users rights have been reseted diff --git a/resources/locales/validators.de.xlf b/resources/locales/validators.de.xlf index 98caffb623..155e17558a 100644 --- a/resources/locales/validators.de.xlf +++ b/resources/locales/validators.de.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.en.xlf b/resources/locales/validators.en.xlf index 956bda1a9f..d7c474cf7b 100644 --- a/resources/locales/validators.en.xlf +++ b/resources/locales/validators.en.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.fr.xlf b/resources/locales/validators.fr.xlf index 962a3a17f9..a411c12e14 100644 --- a/resources/locales/validators.fr.xlf +++ b/resources/locales/validators.fr.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/resources/locales/validators.nl.xlf b/resources/locales/validators.nl.xlf index bb50ac5245..59e7f9ec60 100644 --- a/resources/locales/validators.nl.xlf +++ b/resources/locales/validators.nl.xlf @@ -1,6 +1,6 @@ - +
The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message. diff --git a/templates/web/developers/application.html.twig b/templates/web/developers/application.html.twig index 4bf851b168..6ca7503c99 100644 --- a/templates/web/developers/application.html.twig +++ b/templates/web/developers/application.html.twig @@ -122,6 +122,45 @@ +

{{ "developers:: Events trigger this webhook" | trans }}

+

{{ "developers:: Select events to trigger this webhook url" | trans }}

+ + + + + + + + + {% for webhook_type, webhooks in webhook_event_list %} + + + + + {% endfor %} + +
+ {{ "developers:: Events type" | trans }} + + {{ "developers:: Events name" | trans }} +
+ {{ webhook_type }} + +
    + {% for webhook_name, webhook_description in webhooks %} +
  • + +
  • + {% endfor %} +
+
{% if deliveries | length > 0 %}

{{ "Derniers envois" | trans }}

{{ "Résultats des derniers envois effectués pour cette application" | trans }}