diff --git a/bin/console b/bin/console index 1dfa643be2..96ae294af0 100755 --- a/bin/console +++ b/bin/console @@ -31,7 +31,7 @@ use Alchemy\Phrasea\Command\Compile\Configuration; use Alchemy\Phrasea\Command\RecordAdd; use Alchemy\Phrasea\Command\RescanTechnicalDatas; use Alchemy\Phrasea\CLI; -use Alchemy\Phrasea\Command\Application\ApplicationAppCommand; +use Alchemy\Phrasea\Command\User\UserApplicationsCommand; use Alchemy\Phrasea\Command\Plugin\AddPlugin; use Alchemy\Phrasea\Command\Plugin\RemovePlugin; use Alchemy\Phrasea\Command\CheckConfig; @@ -113,7 +113,7 @@ $cli->command(new \module_console_fieldsDelete('fields:delete')); $cli->command(new \module_console_fieldsRename('fields:rename')); $cli->command(new \module_console_fieldsMerge('fields:merge')); -$cli->command(new ApplicationAppCommand('application:app')); +$cli->command(new UserApplicationsCommand('user:applications')); $cli->command(new CreateCollection('collection:create')); $cli->command(new ListCollectionCommand('collection:list')); diff --git a/lib/Alchemy/Phrasea/Command/Application/ApplicationAppCommand.php b/lib/Alchemy/Phrasea/Command/User/UserApplicationsCommand.php similarity index 97% rename from lib/Alchemy/Phrasea/Command/Application/ApplicationAppCommand.php rename to lib/Alchemy/Phrasea/Command/User/UserApplicationsCommand.php index 7ac9a1d7a0..8163992433 100644 --- a/lib/Alchemy/Phrasea/Command/Application/ApplicationAppCommand.php +++ b/lib/Alchemy/Phrasea/Command/User/UserApplicationsCommand.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Alchemy\Phrasea\Command\Application; +namespace Alchemy\Phrasea\Command\User; use Alchemy\Phrasea\Command\Command; use Alchemy\Phrasea\Core\LazyLocator; @@ -24,7 +24,7 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputOption; -class ApplicationAppCommand extends Command +class UserApplicationsCommand extends Command { /** @@ -32,7 +32,7 @@ class ApplicationAppCommand extends Command */ public function __construct($name = null) { - parent::__construct('application:app'); + parent::__construct('user:applications'); $this->setDescription('List, Create, Edit, Delete application in Phraseanet (experimental)') ->addOption('user_id', 'u', InputOption::VALUE_REQUIRED, 'The id of user.') @@ -129,6 +129,11 @@ class ApplicationAppCommand extends Command } } + if ($webhookUrl) { + $applicationManipulator->setWebhookUrl($application, $webhookUrl); + $applicationManipulator->update($application); + } + $this->showApllicationInformation($apiOauthRepository, $account, $application, $jsonformat, $output); } catch (\Exception $e) { $output->writeln('Create an application for user failed : '.$e->getMessage().'');