mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 10:23:17 +00:00
confirmation on delete
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
namespace Alchemy\Phrasea\Command\User;
|
namespace Alchemy\Phrasea\Command\User;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Command;
|
use Alchemy\Phrasea\Command\Command;
|
||||||
|
use Symfony\Component\Console\Helper\DialogHelper;
|
||||||
use Alchemy\Phrasea\ControllerProvider\Api\V2;
|
use Alchemy\Phrasea\ControllerProvider\Api\V2;
|
||||||
use Alchemy\Phrasea\Core\LazyLocator;
|
use Alchemy\Phrasea\Core\LazyLocator;
|
||||||
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
use Alchemy\Phrasea\Model\Entities\ApiApplication;
|
||||||
@@ -278,6 +279,19 @@ class UserApplicationsCommand extends Command
|
|||||||
|
|
||||||
$application = $apiApllicationConverter->convert($appId);
|
$application = $apiApllicationConverter->convert($appId);
|
||||||
|
|
||||||
|
if (is_null($application->getCreator())) {
|
||||||
|
/** @var DialogHelper $dialog */
|
||||||
|
$dialog = $this->getHelperSet()->get('dialog');
|
||||||
|
|
||||||
|
$continue = $dialog->askConfirmation($output, "<question>It's a special phraseanet application, do you want really to delete it? (N/y)</>", false);
|
||||||
|
|
||||||
|
if (!$continue) {
|
||||||
|
$output->writeln("<info>See you later !</>");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$applicationManipulator->delete($application);
|
$applicationManipulator->delete($application);
|
||||||
|
|
||||||
$output->writeln("<info>Application ID $appId deleted successfully !</info>");
|
$output->writeln("<info>Application ID $appId deleted successfully !</info>");
|
||||||
|
|||||||
Reference in New Issue
Block a user