NAME
Kernel::System::SysConfig::ValueType::OrganizerItem – System configuration organizer item value type backend.
PUBLIC INTERFACE
new()
Create an object. Do not use it directly, instead use:
use Kernel::System::ObjectManager;
local $Kernel::OM = Kernel::System::ObjectManager->new();
my $ValueTypeObject = $Kernel::OM->Get('Kernel::System::SysConfig::ValueType::OrganizerItem');
SettingEffectiveValueCheck()
Check if provided EffectiveValue matches structure defined in XMLContentParsed.
my %Result = $ValueTypeObject->SettingEffectiveValueCheck(
XMLContentParsed => {
Value => {
ItemName => {
ItemType => '...',
Label => '...',
Order => '...',
Icon => '...',
Available => '...',
Visible => '...',
Changeable => '...',
Groups => [ ... ],
},
},
},
EffectiveValue => {
...
},
);
Result: %Result = ( EffectiveValue => { # Note for OrganizerItem ValueTypes EffectiveValue is not changed. … }, Success => 1, Error => undef, );
EffectiveValueGet()
Extracts the effective value from a XML parsed setting.
my $EffectiveValue = $ValueTypeObject->EffectiveValueGet(
Value => [
{
ValueRegex => '', # optional
Content => 'TheEffectiveValue',
ValueType => 'AValueType', # optional
# ...
}
],
);
Returns:
$EffectiveValue = 'TheEffectiveValue';
SettingRender()
Extracts the effective value from a XML parsed setting.
my $SettingHTML = $ValueTypeObject->SettingRender(
Name => 'SettingName',
DefaultID => 123, # (required)
EffectiveValue => {
ItemName => {
ItemType => '...',
Label => '...',
Visible => '...',
Changeable => '...',
Groups => [...],
Available => '...',
Order => '...',
Icon => '...',
},
},
DefaultValue => 'Product 5', # (optional)
Class => 'My class' # (optional)
RW => 1, # (optional) Allow editing. Default 0.
Item => [ # (optional) XML parsed item
{
Hash => [
{
Item => [
{
Key => 'Dummy',
Hash => [
{
Item => [
{
Key => 'ItemType',
Content => 'Dummy',
},
{
Key => 'Label',
Content => 'Dummy Item',
},
{
Key => 'Order',
Content => '1000',
},
{
Key => 'Icon',
Content => 'dummy',
},
{
Key => 'Available',
Content => '1',
},
{
Key => 'Visible',
Content => '1',
},
{
Key => 'Changeable',
Content => '1',
},
{
Key => 'Groups',
Content => [],
},
],
},
],
},
],
},
],
ValueType => 'OrganizerItem',
},
],
IsArray => 1, # (optional) Item is part of the array
IsHash => 1, # (optional) Item is part of the hash
IDSuffix => 1, # (optional) Suffix will be added to the element ID
SkipEffectiveValueCheck => 1, # (optional) If enabled, system will not perform effective value check.
# Default: 1.
);
Returns:
$SettingHTML = '<div class "Field"...</div>';
AddItem()
Generate HTML for new array/hash item.
my $HTML = $ValueTypeObject->AddItem(
Name => 'SettingName', (required) Name
DefaultItem => { (required) DefaultItem hash
Hash => {
},
},
IDSuffix => '_Array1', (optional) IDSuffix is needed for arrays and hashes.
);
Returns:
$HTML = '<select class="Modernize" id="SettingName" name="SettingName" title="SettingName">
...
</select>';
DefaultItemAdd()
Return structure of the DefaultItem in case it's not inside of Array or Hash.
my $DefaultItem = $ValueTypeObject->DefaultItemAdd();
Returns:
$DefaultItem = {
Item => {
Content => '',
},
ValueType => 'OrganizerItem',
};