Kernel::System::SysConfig::ValueType::VacationDays

NAME

Kernel::System::SysConfig::ValueType::VacationDays – System configuration vacation-days value type backed.

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::VacationDays');

SettingEffectiveValueCheck()

Check if provided EffectiveValue matches structure defined in XMLContentParsed.

    my %Result = $ValueTypeObject->SettingEffectiveValueCheck(
        XMLContentParsed => {
            Value => [
                {
                    'Item' => [
                        {
                            'Item' => [
                                {
                                    'Content'      => 'New Year\'s Day',
                                    'Translatable' => '1',
                                    'ValueDay'     => '1',
                                    'ValueMonth'   => '1',
                                },
                            ],
                            'ValueType' => 'VacationDays',
                        },
                    ],
                },
            ],
        },
        EffectiveValue => {
            '1' => {
                '1' => 'New Year\'s Day',
            },
            '12' => {
                '24' => 'Christmas Eve',
            },
        },
    );

Result: %Result = ( EffectiveValue => { # Note for VacationDays ValueTypes EffectiveValue is not changed. '1' => { '1' => 'New Year\'s Day', }, '12' => { '24' => 'Christmas Eve', }, }, Success => 1, Error => undef, );

SettingRender()

Extracts the effective value from a XML parsed setting.

    my $SettingHTML = $ValueTypeObject->SettingRender(
        Name           => 'SettingName',
        DefaultID      =>  123,             # (required)
        EffectiveValue => '{
            '1' => {
                '1' => 'New Year\'s Day',
            },
            ...
        },
        DefaultValue   => 'Product 5',      # (optional)
        Class          => 'My class'        # (optional)
        Item           => [                 # (optional) XML parsed item
            {
                'ValueType' => 'VacationDays',
                'Content' => '',
                'ValueRegex' => '',
            },
        ],
        RW       => 1,                      # (optional) Allow editing. Default 0.
        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    => {                 (optional) DefaultItem hash, if available
            Item => {
                Content => 'Value',
            },
        },
    );

Returns:

    $HTML = "<input type='text' id='Setting_ExampleArray'
        value='Value' name='ExampleArray' class='Entry'/>";

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 => 'VacationDays',
    };
Scroll to Top