OTRS custom Service fields

English! place to talk about development, programming and coding
Post Reply
smialo960
Znuny newbie
Posts: 4
Joined: 29 Jul 2021, 15:26
Znuny Version: 6.0.35
Real Name: Szymon

OTRS custom Service fields

Post by smialo960 »

Hello, I'm currently working on getting OTRS to work fine for my company.
What I'd need are 2 custom fields for Services defined for Customer Users:
- FROM-TO field (date to date) to define what's the expiration date of service that we provide to our client
- Image field (possbility to upload and assign .jpg/.bmp/.png image file to particular services and view it while browsing services) - i don't know if it's even possible to do that, but that would be great to define the area in which the service exists.

I can't really find how to edit such things as fields template for particular modules (the only one i found are the dynamic fields for tickets), so if anybody could give me any clues how to do that by myself I'd be really gratefull. I know it requires some code changes whereas I'm not really into Perl, but I have to do that, so the only thing I can do is to ask for some help.

Thanks in advance,
Best regards
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS custom Service fields

Post by root »

Hi,

Do you need these field on the customer user or on the service?

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
smialo960
Znuny newbie
Posts: 4
Joined: 29 Jul 2021, 15:26
Znuny Version: 6.0.35
Real Name: Szymon

Re: OTRS custom Service fields

Post by smialo960 »

On the Service. I'd just like to have information about the term of validity and pereferably a picture added to every single Service that we have added to the system.
Just like: ticket appears, from a customer - i check the ID of Service he has written about and then i can easily check if the service is still valid for him, and the attached picture.
Is it quite hard to implement such features?
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS custom Service fields

Post by root »

Hi,

except of the image this is possibe without development. Place a new XML file in Kernel/Config/Files/XML/ with this content:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="2.0" init="Changes">
    <Setting Name="ServicePreferences###Selectbox" Required="0" Valid="1">
        <Description Translatable="1">Registers an additional service preference.</Description>
        <Navigation>Core::Service</Navigation>
        <Value>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::ServicePreferences::Generic</Item>
                <Item Key="Label" Translatable="1">Your label 1</Item>
                <Item Key="Data">
                    <Hash>
                        <Item Key="yes">yes</Item>
                        <Item Key="no">no</Item>
                        <Item Key="unknown">unknown</Item>
                    </Hash>
                </Item>
                <Item Key="DataSelected">no</Item>
                <Item Key="PrefKey">YourPreferencesKey1</Item>
            </Hash>
        </Value>
    </Setting>
    <Setting Name="ServicePreferences###Text" Required="0" Valid="1">
        <Description Translatable="1">Registers an additional service preference.</Description>
        <Navigation>Core::Service</Navigation>
        <Value>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::ServicePreferences::Generic</Item>
                <Item Key="Label" Translatable="1">Your label 2</Item>
                <Item Key="Desc" Translatable="1"></Item>
                <Item Key="Block">Input</Item>
                <Item Key="PrefKey">YourPreferencesKey2</Item>
            </Hash>
        </Value>
    </Setting>
</otrs_config>
The run as the OTRS user bin/otrs.Console.pl Maint::Config::Rebuild and check your service settings.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
smialo960
Znuny newbie
Posts: 4
Joined: 29 Jul 2021, 15:26
Znuny Version: 6.0.35
Real Name: Szymon

Re: OTRS custom Service fields

Post by smialo960 »

Hands down, everything works as I wished it to.
Thank you very much, Sir.

Is there any documentation that would allow me to understand this xml code and make such changes on my own?

Best regards
estomagado
Znuny newbie
Posts: 44
Joined: 20 Sep 2019, 16:24
Znuny Version: 6.0.36
Real Name: Henrique Ulbrich
Company: Design for Context

Re: OTRS custom Service fields

Post by estomagado »

Not trying to hijack, but I think the answer is relevant to this thread.

Question: WHY is there a restriction on embedding images in these templates? Is it a technical impossibility?
--
Your pal
Estomagado

Znuny 6.0.36 Vanilla (no add-ons installed, no fancy customization)
MySQL BD backend for external customer users
LDAP (AD) backend for internal customer users & agents
root
Administrator
Posts: 3934
Joined: 18 Dec 2007, 12:23
Znuny Version: Znuny and Znuny LTS
Real Name: Roy Kaldung
Company: Znuny
Contact:

Re: OTRS custom Service fields

Post by root »

estomagado wrote: 18 Aug 2021, 20:41
Question: WHY is there a restriction on embedding images in these templates? Is it a technical impossibility?
Hi,

Besides the fact that this thread is not templates: a different data type needs different preferences modules. Right now there is no for images / files.

- Roy
Znuny and Znuny LTS running on CentOS / RHEL / Debian / SLES / MySQL / PostgreSQL / Oracle / OpenLDAP / Active Directory / SSO

Use a test system - always.

Do you need professional services? Check out https://www.znuny.com/

Do you want to contribute or want to know where it goes ?
estomagado
Znuny newbie
Posts: 44
Joined: 20 Sep 2019, 16:24
Znuny Version: 6.0.36
Real Name: Henrique Ulbrich
Company: Design for Context

Re: OTRS custom Service fields

Post by estomagado »

Thank you, Roy.

I said templates because it it's what was on my mind, but yeah, I meant the services. I am really a Python guy, so Perl is a little too high for me, but having fiddled with OTRS for the last two years I think I'll dive into it.

As always, your help is very much appreciated and spot on.
Again, a Big Thank You.
--
Your pal
Estomagado

Znuny 6.0.36 Vanilla (no add-ons installed, no fancy customization)
MySQL BD backend for external customer users
LDAP (AD) backend for internal customer users & agents
Post Reply