2023-06-12 13:07:28 +02:00
|
|
|
# --
|
|
|
|
# OTOBO is a web-based ticketing system for service organisations.
|
|
|
|
# --
|
|
|
|
# Copyright (C) 2001-2020 OTRS AG, https://otrs.com/
|
|
|
|
# Copyright (C) 2019-2023 Rother OSS GmbH, https://otobo.de/
|
|
|
|
# --
|
|
|
|
# This program is free software: you can redistribute it and/or modify it under
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
# Foundation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
# --
|
|
|
|
|
|
|
|
package Kernel::System::Console::Command::Admin::DynamicField::Delete;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
|
|
|
# core modules
|
|
|
|
|
|
|
|
# CPAN modules
|
|
|
|
|
|
|
|
# OTOBO modules
|
|
|
|
|
2023-10-10 18:57:05 +02:00
|
|
|
use parent qw(Kernel::System::Console::BaseCommand);
|
2023-06-12 13:07:28 +02:00
|
|
|
|
2023-10-10 18:57:05 +02:00
|
|
|
our @ObjectDependencies = (
|
|
|
|
'Kernel::System::DynamicField',
|
2023-06-12 13:07:28 +02:00
|
|
|
);
|
|
|
|
|
2023-10-10 18:57:05 +02:00
|
|
|
sub Configure {
|
|
|
|
my ( $Self, %Param ) = @_;
|
|
|
|
|
|
|
|
$Self->Description('Delete an existing dynamic field.');
|
|
|
|
$Self->AddArgument(
|
|
|
|
Name => 'name',
|
|
|
|
Description => 'Delete dynamic field by name.',
|
|
|
|
Required => 0,
|
|
|
|
ValueRegex => qr/([A-Za-z0-9]+\-)?[A-Za-z0-9]+/smx,
|
|
|
|
);
|
|
|
|
$Self->AddArgument(
|
|
|
|
Name => 'id',
|
|
|
|
Description => 'Delete dynamic field by field id.',
|
|
|
|
Required => 0,
|
|
|
|
ValueRegex => qr/\d+/smx,
|
|
|
|
);
|
|
|
|
$Self->AddOption(
|
|
|
|
Name => 'dry-run',
|
|
|
|
Description => 'Perform a dry run and show which field whould be deleted.',
|
|
|
|
Required => 0,
|
|
|
|
HasValue => 0,
|
|
|
|
);
|
|
|
|
$Self->AddOption(
|
|
|
|
Name => 'execute',
|
|
|
|
Description => 'Execute the deletion.',
|
|
|
|
Required => 0,
|
|
|
|
HasValue => 0,
|
|
|
|
);
|
|
|
|
|
|
|
|
return;
|
2023-06-12 13:07:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
sub Run {
|
2023-10-10 18:57:05 +02:00
|
|
|
my ( $Self, %Param ) = @_;
|
|
|
|
|
|
|
|
return;
|
2023-06-12 13:07:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|