98 lines
2.7 KiB
Perl
98 lines
2.7 KiB
Perl
# --
|
|
# 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::List;
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
# core modules
|
|
|
|
# CPAN modules
|
|
|
|
# OTOBO modules
|
|
|
|
use parent qw(Kernel::System::Console::BaseCommand);
|
|
|
|
our @ObjectDependencies = (
|
|
'Kernel::System::DynamicField',
|
|
'Kernel::System::YAML',
|
|
'Kernel::System::JSON',
|
|
);
|
|
|
|
sub Configure {
|
|
my ( $Self, %Param ) = @_;
|
|
|
|
$Self->Description('List existing dynamic fields.');
|
|
$Self->AddOption(
|
|
Name => 'field-type',
|
|
Description => 'Filter by comma-separated field type(s).',
|
|
Required => 0,
|
|
HasValue => 1,
|
|
ValueRegex => qr/[A-Za-z0-9,]+/smx,
|
|
);
|
|
$Self->AddOption(
|
|
Name => 'object-type',
|
|
Description => 'Filter by comma-separated object type(s).',
|
|
Required => 0,
|
|
HasValue => 1,
|
|
ValueRegex => qr/[A-Za-z0-9,]+/smx,
|
|
);
|
|
$Self->AddOption(
|
|
Name => 'name-search',
|
|
Description => 'Filter by name or part of a name.',
|
|
Required => 0,
|
|
HasValue => 1,
|
|
ValueRegex => qr/[A-Za-z0-9-]+/smx,
|
|
);
|
|
$Self->AddOption(
|
|
Name => 'active',
|
|
Description => 'Filter by active state (0 or 1), default is both.',
|
|
Required => 0,
|
|
HasValue => 1,
|
|
ValueRegex => qr/^[0-1]{1}$/smx,
|
|
);
|
|
$Self->AddOption(
|
|
Name => 'verbose',
|
|
Description => 'If set, result includes complete config, otherwise only names and orders are given.',
|
|
Required => 0,
|
|
HasValue => 0,
|
|
);
|
|
$Self->AddOption(
|
|
Name => 'return-structure',
|
|
Description => 'Supported return structures are JSON and YAML, default is YAML.',
|
|
Required => 0,
|
|
HasValue => 1,
|
|
ValueRegex => qr/^(JSON)|(YAML)$/smx,
|
|
);
|
|
}
|
|
|
|
sub new {
|
|
my ( $Type, %Param ) = @_;
|
|
|
|
# allocate new hash for object
|
|
my $Self = {%Param};
|
|
bless( $Self, $Type );
|
|
|
|
return $Self;
|
|
}
|
|
|
|
sub Run {
|
|
my ( $Self, %Param ) = @_;
|
|
}
|
|
|
|
1;
|