creation of a new menu option [solved]

Moderator: crythias

Post Reply
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

creation of a new menu option [solved]

Post by rvaldomir »

Hi All,

I have added a new menu option called "Handover", the idea is to open a window similar to Note, but with a different subject "Handover" and a dynamic field HO (flag) as required.

I worked on

1) Handover.xml (/opt/otrs/Kernel/Config/Files)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###12-Handover" Required="0" Valid="1">
        <Description Translatable="1">Set this ticket for Handover.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">Handover</Item>
                <Item Key="Description" Translatable="1">See Data</Item>
                <Item Key="Action">AgentTicketHandover</Item>
                <Item Key="Link">Action=AgentTicketHandover;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
2) copied AgentTicketNote.pm to AgentTicketHandover.pm and replaced Note by Handover (/opt/otrs/Kernel/Modules)

Code: Select all

# --
# Kernel/Modules/AgentTicketHandover.pm - to add notes to a ticket
# Copyright (C) 2001-2014 xxx, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Modules::AgentTicketHandover;

use strict;
use warnings;

use base qw( Kernel::Modules::AgentTicketActionCommon );

1;
3) copied AgentTicketNote.dtl to AgentTicketHandover.dtl and replaced Note by Handover. (/opt/otrs/Kernel/Output/HTML/Standard)

Code: Select all

# --
# AgentTicketHandover.dtl - provides HTML form for note mask
# Copyright (C) 2001-2014 xxx, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

$Include{"AgentTicketActionCommon"}
So, If I go to sysconf and search for Handover I got this:
MenuModule.png
But in ticket zoom the new option is not shown. If in MenuModule I replace Handover by Note, It appears in zoom and open the note as you can see
TestWithNoteInMenuModule.png
but if I call the AgentTicketHandover from the URL navigation bar I got this error.
notRegistered.png
ERROR: OTRS-CGI-78 Perl: 5.14.2 OS: linux Time: Fri May 22 12:31:23 2015

Message: Module Kernel::Modules::AgentTicketHandover not registered in Kernel/Config.pm!

RemoteAddress: 192.168.0.74
RequestURI: /otrs/index.pl?Action=AgentTicketHandover;TicketID=43

Traceback (1848):
Module: Kernel::System::Web::InterfaceAgent::Run (OTRS 3.3.8) Line: 734
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler (unknown version) Line: 41
Module: (eval) (v1.99) Line: 204
Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
Module: ModPerl::Registry::handler (v1.99) Line: 31
What I have to do now?
You do not have the required permissions to view the files attached to this post.
Last edited by rvaldomir on 04 Jun 2015, 14:21, edited 1 time in total.
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

Judging from the error message, I guess your module is not registered in SysConfig. Take a look whether your module has the checbox next to it ticked under Ticket -> Frontend::Agent::ModuleRegistration
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

is not there, how I can register it?
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

See if deleting cache and rebuilding config helps
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: creation of a new menu option

Post by reneeb »

You need something like

Code: Select all

    <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
        <Group>Handover</Group>
        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
        <Setting>
            <FrontendModuleReg>
                <Description>AgentTicketHandover</Description>
                <Title></Title>
                <NavBarName></NavBarName>
            </FrontendModuleReg>
        </Setting>
    </ConfigItem>
in your config file
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

tried this but OTRS crashed

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
<ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
<Description Translatable="1">Frontend module registration for the agent interface.</Description>
<Group>Handover</Group>
<SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
<Setting>
<FrontendModuleReg>
<Description>AgentTicketHandover</Description>
<Title></Title>
<NavBarName></NavBarName>
</FrontendModuleReg>
</Setting>
</ConfigItem>
</otrs_config>
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: creation of a new menu option

Post by crythias »

rvaldomir wrote:tried this but OTRS crashed
no errors?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

[Mon Jun 1 08:45:05 2015] Config.pm: Bareword found where operator expected at /opt/otrs//Kernel/Config.pm line 94, near ""1.0" init"
[Mon Jun 1 08:45:05 2015] Config.pm: (Missing operator before init?)
[Mon Jun 1 08:45:05 2015] Config.pm: Bareword found where operator expected at /opt/otrs//Kernel/Config.pm line 97, near "<Group>Handover"
[Mon Jun 1 08:45:05 2015] Config.pm: (Missing operator before Handover?)
[Mon Jun 1 08:45:05 2015] Config.pm: Having no space between pattern and following word is deprecated at /opt/otrs//Kernel/Config.pm line 98.
[Mon Jun 1 08:45:05 2015] Config.pm: Bareword found where operator expected at /opt/otrs//Kernel/Config.pm line 101, near "<Description>AgentTicketHandover"
[Mon Jun 1 08:45:05 2015] Config.pm: (Missing operator before AgentTicketHandover?)
[Mon Jun 1 08:45:05 2015] Config.pm: Having no space between pattern and following word is deprecated at /opt/otrs//Kernel/Config.pm line 102.
[Mon Jun 1 08:45:05 2015] Config.pm: Having no space between pattern and following word is deprecated at /opt/otrs//Kernel/Config.pm line 104.
[Mon Jun 01 08:45:05 2015] [error] [client 192.168.0.74] Can't modify numeric lt (<) in scalar assignment at /opt/otrs//Kernel/Config.pm line 94, near ""1.0" init"\nsyntax error at /opt/otrs//Kernel/Config.pm line 94, near ""1.0" init"\nBEGIN not safe after errors--compilation aborted at /opt/otrs//Kernel/Config.pm line 122.\nCompilation failed in require at /opt/otrs/Kernel/cpan-lib/Apache2/Reload.pm line 179.\n, referer: http://172.16.2.123/otrs/index.pl?OTRSA ... DlIzaXIEgg
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: creation of a new menu option

Post by reneeb »

What you've shown should be a XML file in Kernel/Config/Files/, not be a part of Kernel/Config.pm
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

Have you read my first post?

An xml named Handover.xml was created:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###12-Handover" Required="0" Valid="1">
        <Description Translatable="1">Set this ticket for Handover.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">Handover</Item>
                <Item Key="Description" Translatable="1">See Data</Item>
                <Item Key="Action">AgentTicketHandover</Item>
                <Item Key="Link">Action=AgentTicketHandover;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
Do I have to create a new one? with;

Code: Select all

<?xml	version="1.0"	encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
   <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
        <Group>Handover</Group>
        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
        <Setting>
            <FrontendModuleReg>
                <Description>AgentTicketHandover</Description>
                <Title></Title>
                <NavBarName></NavBarName>
            </FrontendModuleReg>
        </Setting>
    </ConfigItem>
</otrs_config>
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

You should add the ConfigItem to your Handover.xml.

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###12-Handover" Required="0" Valid="1">
        <Description Translatable="1">Set this ticket for Handover.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">Handover</Item>
                <Item Key="Description" Translatable="1">See Data</Item>
                <Item Key="Action">AgentTicketHandover</Item>
                <Item Key="Link">Action=AgentTicketHandover;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
        <Group>Handover</Group>
        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
        <Setting>
            <FrontendModuleReg>
                <Description>AgentTicketHandover</Description>
                <Title></Title>
                <NavBarName></NavBarName>
            </FrontendModuleReg>
        </Setting>
    </ConfigItem>
</otrs_config>
reneeb wrote:You need something like

Code: Select all

    <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        ..........
    </ConfigItem>
in your config file
I suppose by that reneeb meant in your xml file (/opt/otrs/Kernel/Config/Files/Handover.xml) and not in your /opt/otrs/Kernel/Config.pm
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

so you mean adding the following to the Handover.xml?

Code: Select all

 
 <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
        <Group>Handover</Group>
        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
        <Setting>
            <FrontendModuleReg>
                <Description>AgentTicketHandover</Description>
                <Title></Title>
                <NavBarName></NavBarName>
            </FrontendModuleReg>
        </Setting>
    </ConfigItem>
Now my Handover.xml looks like

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="Ticket::Frontend::MenuModule###12-Handover" Required="0" Valid="1">
        <Description Translatable="1">Set this ticket for Handover.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::MenuModule</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::TicketMenuGeneric</Item>
                <Item Key="Name">Handover</Item>
                <Item Key="Description" Translatable="1">See Data</Item>
                <Item Key="Action">AgentTicketHandover</Item>
                <Item Key="Link">Action=AgentTicketHandover;TicketID=$QData{"TicketID"}</Item>
                <Item Key="Target"></Item>
                <Item Key="PopupType">TicketHistory</Item>
            </Hash>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Frontend::Module###AgentTicketHandover" Required="0" Valid="1">
        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
        <Group>Handover</Group>
        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
        <Setting>
            <FrontendModuleReg>
                <Description>AgentTicketHandover</Description>
                <Title></Title>
                <NavBarName></NavBarName>
            </FrontendModuleReg>
        </Setting>
    </ConfigItem>
</otrs_config>
[\code]

but still getting the error:
[attachment=0]error.png[/attachment]

[code]
ERROR: OTRS-CGI-78 Perl: 5.14.2 OS: linux Time: Mon Jun  1 10:34:41 2015

 Message: Module Kernel::Modules::AgentTicketHandover not registered in Kernel/Config.pm!

 RemoteAddress: 192.168.0.74
 RequestURI: /otrs/index.pl?Action=AgentTicketHandover;TicketID=41

 Traceback (19132):
   Module: Kernel::System::Web::InterfaceAgent::Run (OTRS 3.3.8) Line: 734
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler (unknown version) Line: 41
   Module: (eval) (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
   Module: ModPerl::Registry::handler (v1.99) Line: 31
I'm re-using the AgentTicketNote.dtl and AgentTicketNote.pm those files are calling a AgentTicketActionCommon do I have to add something to this file pointing to my new files?
You do not have the required permissions to view the files attached to this post.
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

Coul you rebuild config, delete cache and restart webserver, log out and log in again to see if error still persists.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

Code: Select all

otrs@otrsFreshInstall:/opt/otrs/bin$ ./otrs.RebuildConfig.pl
otrs.RebuildConfig.pl - OTRS rebuild default config
Copyright (C) 2001-2014 xxx, http://otrs.com/
Done.
otrs@otrsFreshInstall:/opt/otrs/bin$ ./otrs.DeleteCache.pl
otrs.DeleteCache.pl - delete OTRS cache
Copyright (C) 2001-2014 xxx, http://otrs.com/

Deleting cache... Done.
otrs@otrsFreshInstall:/opt/otrs/bin$ sudo /etc/init.d/apache2 restart
[ ok ] Restarting web server: apache2 ... waiting .
otrs@otrsFreshInstall:/opt/otrs/bin$
After that I had to re-set permissions then, testing (almost close :d)

getting:
error2.png

Code: Select all

ERROR: OTRS-CGI-78 Perl: 5.14.2 OS: linux Time: Mon Jun  1 10:51:53 2015

 Message: Need Type!

 RemoteAddress: 192.168.0.74
 RequestURI: /otrs/index.pl?Action=AgentTicketHandover;TicketID=41

 Traceback (21927):
   Module: Kernel::System::Ticket::TicketPermission (OTRS 3.3.8) Line: 3049
   Module: Kernel::Modules::AgentTicketActionCommon::Run (OTRS 3.3.8) Line: 91
   Module: Kernel::System::Web::InterfaceAgent::Run (OTRS 3.3.8) Line: 871
   Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler (unknown version) Line: 41
   Module: (eval) (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
   Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
   Module: ModPerl::Registry::handler (v1.99) Line: 31

[Mon Jun  1 10:51:53 2015] -e: Use of uninitialized value in concatenation (.) or string at /opt/otrs//Kernel/Modules/AgentTicketActionCommon.pm line 99.
thanks in advance, how to continue now?
You do not have the required permissions to view the files attached to this post.
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

Perhaps you need in your Config.xml

Code: Select all

 <Item Key="Permission">rw</Item>
.
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
aph
Znuny superhero
Posts: 646
Joined: 20 Jun 2014, 12:11
Znuny Version: 3.3.9, 4.x, 5.x

Re: creation of a new menu option

Post by aph »

Also run setPermissions.pl
OTRS 3.3.x (private/testing) on Windows Server 2008 with MSSQL database.
OTRS 3.3.x (private/testing) on CentOS with MySQL database and apache
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

still getting same error

ERROR: OTRS-CGI-78 Perl: 5.14.2 OS: linux Time: Mon Jun 1 12:08:42 2015

Message: Need Type!

RemoteAddress: 192.168.0.74
RequestURI: /otrs/index.pl?Action=AgentTicketHandover;TicketID=41

Traceback (24142):
Module: Kernel::System::Ticket::TicketPermission (OTRS 3.3.8) Line: 3050
Module: Kernel::Modules::AgentTicketActionCommon::Run (OTRS 3.3.8) Line: 91
Module: Kernel::System::Web::InterfaceAgent::Run (OTRS 3.3.8) Line: 871
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler (unknown version) Line: 41
Module: (eval) (v1.99) Line: 204
Module: ModPerl::RegistryCooker::run (v1.99) Line: 204
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 170
Module: ModPerl::Registry::handler (v1.99) Line: 31
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option [solved]

Post by rvaldomir »

Solved...

As the first idea using agenticketnote module i hace created a new XML with the section agentticket note from the ticket.XML and replaced with my new module name agenttickethandover.
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: creation of a new menu option

Post by rvaldomir »

here is how I solved it:

-Created a new kind of internal note named as "handover-internal"

Code: Select all

INSERT INTO article_type (name, valid_id, create_by, create_time, change_by, change_time) VALUES ('handover-internal', 1, 1, sysdate, 1, sysdate);
-Created this AgentTicketHandover.xml file so I registered the module and defined a configuration item as seen in the image:

Code: Select all

   <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###Subject" Required="0" Valid="1">
        <Description Translatable="1">Sets the default subject for notes added in the ticket note screen of the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <String Regex="">$Text{"Handover!!!"}</String>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###InvolvedAgent" Required="0" Valid="1">
        <Description Translatable="1">Shows a list of all the involved agents on this ticket, in the ticket handover screen of the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <Option SelectedID="0">
                <Item Key="0">No</Item>
                <Item Key="1">Yes</Item>
            </Option>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###InformAgent" Required="1" Valid="1">
        <Description Translatable="1">Shows a list of all the possible agents (all agents with note permissions on the queue/ticket) to determine who should be informed about this handover, in the ticket handover screen of the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <Option SelectedID="1">
                <Item Key="0">No</Item>
                <Item Key="1">Yes</Item>
            </Option>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###ArticleTypeDefault" Required="1" Valid="1">
        <Description Translatable="1">Defines the default type of the note in the ticket handover screen of the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <String Regex="">note-handover-internal</String>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###HistoryType" Required="0" Valid="1">
        <Description Translatable="1">Defines the history type for the ticket handover screen action, which gets used for ticket history in the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <String Regex="">AddNote</String>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###HistoryComment" Required="0" Valid="1">
        <Description Translatable="1">Defines the history comment for the ticket handover screen action, which gets used for ticket history in the agent interface.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <String Regex="">%%Handover</String>
        </Setting>
    </ConfigItem>
    <ConfigItem Name="Ticket::Frontend::AgentTicketHandover###DynamicField" Required="0" Valid="1">
        <Description Translatable="1">Dynamic fields shown in the ticket handover screen of the agent interface. Possible settings: 0 = Disabled, 1 = Enabled, 2 = Enabled and required.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Ticket::Handover</SubGroup>
        <Setting>
            <Hash>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
a.png
-Then two files were created using the AgentTicketNote.pm and AgentTicketNote.dtl as template and replaced "Note" by "Handover".

Code: Select all

# --
# Kernel/Modules/AgentTicketHandover.pm - to add notes to a ticket
# Copyright (C) 2001-2014 xxx, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

package Kernel::Modules::AgentTicketHandover;

use strict;
use warnings;

use base qw( Kernel::Modules::AgentTicketActionCommon );

1;

Code: Select all

# --
# AgentTicketNote.dtl - provides HTML form for note mask
# Copyright (C) 2001-2014 xxx, http://otrs.com/
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --

$Include{"AgentTicketActionCommon"}
-Then added the AgentTicketHandover in the "Core::TicketACL" in order to use this module in ACLs.
b.png
Thats all!!!
You do not have the required permissions to view the files attached to this post.
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
JohnyGuardian
Znuny newbie
Posts: 8
Joined: 25 Mar 2021, 13:14
Znuny Version: 6.0.12
Real Name: Janko
Company: MicroStep

Re: creation of a new menu option [solved] REOPEN

Post by JohnyGuardian »

Hi!

is this process still applicable to OTRS v6?
What would I like to do is generate few new AgentTicketXyz forms, accessible from ATZoom, that would, for example:
  • Change owner to AdminOTRS,
  • Change Queue according to selection of agent,
  • Add article to Ticket with pre generated Name;
  • Article would contain some default text
As an example:
Image

I was planing to clone AgentTicketFreeText, change it a bit and register it with my OTRS... Is that the right way to go?

Thanks
Post Reply