Ho I can add key to existing config option?

English! place to talk about development, programming and coding
Post Reply
kmx
Znuny newbie
Posts: 4
Joined: 02 Jun 2016, 08:08
Znuny Version: 4.0.x
Real Name: Maxim

Ho I can add key to existing config option?

Post by kmx »

Hi!
Can I add key from another file without rewriting of existing structure in Ticket.xml?

Code: Select all

    <ConfigItem Name="StandardTemplate::Types" Required="0" Valid="1">
        <Description Translatable="1">Defines the list of types for templates.</Description>
        <Group>Ticket</Group>
        <SubGroup>Core::Ticket</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Answer">Answer</Item>
                <Item Key="Create">Create</Item>
                <Item Key="Forward">Forward</Item>
                <Item Key="Email">Email</Item>
                <Item Key="PhoneCall">Phone call</Item>
                <Item Key="Note">Note</Item>
            </Hash>
        </Setting>
    </ConfigItem>
I want to keep all options of my module in same config file.
OTRS verson 4.x.x
Last edited by kmx on 10 Feb 2017, 05:23, edited 1 time in total.
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Ho I can add key to existing config option?

Post by RStraub »

So you want to have different default values?

You can do that with a custom file. Not how the first lines of the Ticket.xml are:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
If you use a custom file with:

Code: Select all

 [...] init="Config"> [...]
It will overwrite the setting in Ticket.xml.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
kmx
Znuny newbie
Posts: 4
Joined: 02 Jun 2016, 08:08
Znuny Version: 4.0.x
Real Name: Maxim

Re: Ho I can add key to existing config option?

Post by kmx »

RStraub wrote:So you want to have different default values?
No. I want just add value to the list of defaults without overwriting them. I want to keep new value in config of my module, not in the Ticket.xml.
Is it possible?

Thanks for your reply!
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Ho I can add key to existing config option?

Post by RStraub »

Well, sure. Just go to the SysConfig and add another value.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
jooperik
Znuny newbie
Posts: 1
Joined: 06 Sep 2019, 13:42
Znuny Version: 5.0.23
Real Name: Michal Němeček
Company: O2 IT Services

Re: Ho I can add key to existing config option?

Post by jooperik »

Hi, kmx was asking, if it's possible to add key via xml config file, not via sysconfig. That's exactly what I want and what I'm looking for. I want to add key via config file that is installed with package. I don't want to think everytime I install this package, that I need to add new key via sysconfig. I want the package to add it for me. Is that possible?
zzz
Znuny superhero
Posts: 889
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Ho I can add key to existing config option?

Post by zzz »

Hello Michal,

You can do it like Rolf mentioned it.
Simply copy the original 'ConfigItem' tag into your own .xml file and make your changes to it, like so (OTRS 5):

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<otrs_config version="1.0" init="Changes">
    <ConfigItem Name="AgentLoginLogo" Required="0" Valid="1">
        <Description Translatable="1">The logo shown on top of the login box of the agent interface. The URL to the image must be relative URL to the skin image directory.</Description>
        <Group>Framework</Group>
        <SubGroup>Frontend::Agent</SubGroup>
        <Setting>
            <Hash>
		<Item Key="URL">https://yourwebsite.com/yourlogo.png</Item>
                <Item Key="StyleHeight">50px</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem ...>
    	...
    </ConfigItem>
</otrs_config>
Tutorial on how to create your own package: https://doc.otrs.com/doc/manual/develop ... lding.html

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
Post Reply