Ho I can add key to existing config option?

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

Ho I can add key to existing config option?

Post by kmx » 09 Feb 2017, 07:40

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
OTRS guru
Posts: 2162
Joined: 13 Mar 2014, 09:16
OTRS Version?: 6.0.14
Real Name: Rolf Straub

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

Post by RStraub » 09 Feb 2017, 09:50

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
OTRS newbie
Posts: 4
Joined: 02 Jun 2016, 08:08
OTRS Version?: 4.0.x
Real Name: Maxim

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

Post by kmx » 10 Feb 2017, 05:22

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
OTRS guru
Posts: 2162
Joined: 13 Mar 2014, 09:16
OTRS Version?: 6.0.14
Real Name: Rolf Straub

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

Post by RStraub » 13 Feb 2017, 09:23

Well, sure. Just go to the SysConfig and add another value.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS

jooperik
OTRS newbie
Posts: 1
Joined: 06 Sep 2019, 13:42
OTRS 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 » 06 Sep 2019, 14:50

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
OTRS superhero
Posts: 267
Joined: 15 Dec 2016, 15:13
OTRS Version?: 3.x - 6.0.x
Real Name: Emin
Company: Efflux GmbH
Contact:

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

Post by zzz » 06 Sep 2019, 18:23

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 services for development, consulting, hosting and support:
efflux.de – German | efflux.de/en/ – English

Free and premium OTRS add-ons (TextModule, AdBlocker, ModernSkin ... growing): portal.efflux.de

Post Reply