creation of a new menu option

English! place to talk about OTRS development, programming and coding

Moderator: tto

Post Reply
ganesh123
OTRS newbie
Posts: 2
Joined: 10 Dec 2018, 06:05
OTRS Version?: 6.0.12
Real Name: Ganesh Chandra Mishra
Company: Apmosys Technology

creation of a new menu option

Post by ganesh123 » 13 Dec 2018, 09:39

Hi All,

I want add a menu item "Tasks". It will open a window and show the Dynamic fileds.

I worked on Tasks.xml (/opt/otrs/Kernel/Config/Files/XML/)

<?xml version="1.0" encoding="UTF-8" ?>
<otrs_config version="2.0" init="Application">
<Setting Name="Frontend::Module###Tasks" Required="1" Valid="1">
<Description Translatable="1">FrontendModuleRegistration for Tasks module.</Description>
<Navigation>Frontend::Agent::ModuleRegistration</Navigation>
<Value>
<Item ValueType="FrontendRegistration">
<Hash>
<Item Key="Group">
<Array>
<Item>users</Item>
</Array>
</Item>
<Item Key="GroupRo">
<Array>
</Array>
</Item>
<Item Key="Description" Translatable="1">Tasks.</Item>
<Item Key="Title" Translatable="1">Tasks</Item>
<Item Key="NavBarName">Tasks</Item>
</Hash>
</Item>
</Value>
</Setting>
<Setting Name="Loader::Module::AgentTasks###002-Filename" Required="0" Valid="1">
<Description Translatable="1">Loader module registration for the agent interface.</Description>
<Navigation>Frontend::Agent::ModuleRegistration::Loader</Navigation>
<Value>
<Hash>
<Item Key="CSS">
<Array>
</Array>
</Item>
<Item Key="JavaScript">
<Array>
</Array>
</Item>
</Hash>
</Value>
</Setting>
<Setting Name="Frontend::Navigation###AgentTasks###002-Filename" Required="0" Valid="1">
<Description Translatable="1">Main menu item registration.</Description>
<Navigation>Frontend::Agent::ModuleRegistration::MainMenu</Navigation>
<Value>
<Array>
<DefaultItem ValueType="FrontendNavigation">
<Hash>
</Hash>
</DefaultItem>
<Item>
<Hash>
<Item Key="Group">
<Array>
<Item>users</Item>
</Array>
</Item>
<Item Key="GroupRo">
<Array>
</Array>
</Item>
<Item Key="Description" Translatable="1">Tasks.</Item>
<Item Key="Name" Translatable="1">Tasks</Item>
<Item Key="Link">Action=AgentTasks</Item>
<Item Key="LinkOption"></Item>
<Item Key="NavBar">Tasks</Item>
<Item Key="Type">Menu</Item>
<Item Key="Block"></Item>
<Item Key="AccessKey"></Item>
<Item Key="Prio">8400</Item>
</Hash>
</Item>
</Array>
</Value>
</Setting>
</otrs_config>

I also added AgentTasks.pm file (/opt/otrs/Kernel/Modules/) and AgentTasks.tt file (/opt/otrs/Kernel/Output/HTML/Templates/Standard/)

When I rebuld the config and restart my apache, new menu not showing in otrs web.

can anyone help me to create the menu item. I am using OTRS 6

Thanks in advance

RStraub
OTRS guru
Posts: 2156
Joined: 13 Mar 2014, 09:16
OTRS Version?: 6.0.14
Real Name: Rolf Straub

Re: creation of a new menu option

Post by RStraub » 21 Dec 2018, 09:53

Hey, please try using the code blocks for better formatting.

Can you try these settings? All I did was remove the Loader block (as you didn't load anything yet) and renamed the MainMenu Registration from "AgentTasks" to "Tasks" to match the FrontendRegistration.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<otrs_config version="2.0" init="Application">
  <Setting Name="Frontend::Module###Tasks" Required="1" Valid="1">
    <Description Translatable="1">FrontendModuleRegistration for Tasks module.</Description>
    <Navigation>Frontend::Agent::ModuleRegistration</Navigation>
    <Value>
      <Item ValueType="FrontendRegistration">
        <Hash>
          <Item Key="Group">
            <Array>
              <Item>users</Item>
            </Array>
          </Item>
          <Item Key="GroupRo">
            <Array>
						</Array>
          </Item>
          <Item Key="Description" Translatable="1">Tasks.</Item>
          <Item Key="Title" Translatable="1">Tasks</Item>
          <Item Key="NavBarName">Tasks</Item>
        </Hash>
      </Item>
    </Value>
  </Setting>
  <Setting Name="Frontend::Navigation###AgentTasks###002-Filename" Required="0" Valid="1">
    <Description Translatable="1">Main menu item registration.</Description>
    <Navigation>Frontend::Agent::ModuleRegistration::MainMenu</Navigation>
    <Value>
      <Array>
        <DefaultItem ValueType="FrontendNavigation">
          <Hash>
					</Hash>
        </DefaultItem>
        <Item>
          <Hash>
            <Item Key="Group">
              <Array>
                <Item>users</Item>
              </Array>
            </Item>
            <Item Key="GroupRo">
              <Array>
							</Array>
            </Item>
            <Item Key="Description" Translatable="1">Tasks.</Item>
            <Item Key="Name" Translatable="1">Tasks</Item>
            <Item Key="Link">Action=AgentTasks</Item>
            <Item Key="LinkOption"/>
            <Item Key="NavBar">Tasks</Item>
            <Item Key="Type">Menu</Item>
            <Item Key="Block"/>
            <Item Key="AccessKey"/>
            <Item Key="Prio">8400</Item>
          </Hash>
        </Item>
      </Array>
    </Value>
  </Setting>
</otrs_config>
Edit:

When you are done, run as otrs user: ~/bin/otrs.Console.pl Maint::Config::Rebuild --cleanup
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS

Post Reply