Add field "State" to Articles in AgentTicketZoom

Moderator: crythias

Post Reply
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

Hi all,

I'm trying to add a new field in the AgentTicketZoom, more exactly inside the Articles tab.

I've tried to add this in the AgentTicketZoom.dtl, line 540 +/-:

Code: Select all

...
<th class="State"><a href="#">$Text{"State"}</a></th>
...
But of course I don't know the class name that this needs. I guess it is class="State", but I don't think so after try it. Then I have added this as <td>, line 595 +/-:

Code: Select all

<td class="State">
                            <div title="$QData{"State"}"><a href="#">$QData{"State"}</a></div>
                            <input type="hidden" class="SortData" value="$QData{"State"}" />
</td>
Any of this code is working.

Does anyone know how to do or how to achieve that?

Thank you very much.

Rafa
OTRS 3.0.11 and KIX4OTRS on Linux
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by crythias »

You mean the very first item on the ticket information area on the right you'd like to apply to ... what do you want to accomplish?
See the state of a ticket as applied to an article when the article was submitted or the ability to change the state?
Do you want to see the before state or the after state? Because what you're trying should only show you the current state.
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
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

crythias wrote:You mean the very first item on the ticket information area on the right you'd like to apply to ... what do you want to accomplish?
See the state of a ticket as applied to an article when the article was submitted or the ability to change the state?
Do you want to see the before state or the after state? Because what you're trying should only show you the current state.
What I'd like to achieve is to show the State for each row in the table showed in the articles tab in the AgentTicketZoom.

In fact I want what you say, for each article (row), the state that the ticket has had for that concret article, so that means, that almost every time a new article on there will have the new state that has been changed. I don't want to change the state from there.

Is that possible? I've copied in my own folder the same AgentTicketZoom.dtl that is in the Standard folder, and the AgentTicketZoom page is not showed in the right way, it's almost empty.

Thanks for your answer.
OTRS 3.0.11 and KIX4OTRS on Linux
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

crythias wrote:What you're trying should only show you the current state.
You're right. I achieved to show a new column STATE in the Articles table, but the state is the current state. Is there a way to show the old status for each Article?

Thanks a lot.
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

No, there is no way to show States per Article as there is no Article State
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by crythias »

What jojo said is correct. State changes are ticket_history and not reflected in the article.
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
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

crythias wrote:What jojo said is correct. State changes are ticket_history and not reflected in the article.
And there is no way to show the states from the ticket_history in the articles??

Thank you very much to both.
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

no
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by crythias »

no, but you can click History ...
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
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

crythias wrote:no, but you can click History ...
Hahaha... yes, I know :) It's just a client requirement. Of course I know that you can click History and see the old states.

Thanks a lot.

Cheers.
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

an article does not belong to a state. so what is the background of the client request?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

jojo wrote:an article does not belong to a state. so what is the background of the client request?
They'd like to have a column STATE in the Articles table under the Articles tab.

They want to see directly in the AgentTicketZoom the evolution of states by clicking in the Articles tab, so that they can see for each article which was the previous state of the ticket, and the current state in the Ticket Information. That means, that if there are 3 articles for example, the most probably thing is the first article to have a "new" state in the column state that they want to have, the second article would be "accepted"... etc.

They don't want to click history and look at it because we are making the same system they have but a newer version, so they want to have almost everything like they are used to have it. That's why they ask for the possibility to see each state just with one click on the Articles tab.
OTRS 3.0.11 and KIX4OTRS on Linux
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

I'm going to try to read the states from database with a perl script. I think it's the only way to achieve that.

What do you think?
OTRS 3.0.11 and KIX4OTRS on Linux
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by crythias »

rafaqf wrote:What do you think?
I think you're going to have a null result.

There is no field that indicates the state for a given article. If you need that, you need to do some magic querying of ticket_history at the date/time of the creation of article for the given ticket id.
If you can do that, more power to you.
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
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

crythias wrote:
rafaqf wrote:What do you think?
I think you're going to have a null result.

There is no field that indicates the state for a given article. If you need that, you need to do some magic querying of ticket_history at the date/time of the creation of article for the given ticket id.
If you can do that, more power to you.
Ya, I thought to retrieve the StatusUpdate from the ticket_history since every article will have a status update, and for each article add the status from the query in the order that they appear.

If it works I let you know, otherwise, History is always there!
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

There can be articles without any state updates or there can be state updates without articles.

The best way for developing this would be:

- create an article dynamic field.
- create an event module which populates this field with actual ticket state on article create event
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

Ok, script works, now the question is, how to call the perl script so that every <td> shows the state retrieved by the script?

Can you help me with this?

Thanks a lot.
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

you don't need to change any template for this now.

Just activate the dynamic field in Ticket Zoom to be shown
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
rafaqf
Znuny newbie
Posts: 80
Joined: 30 Mar 2011, 11:10
Znuny Version: 3

Re: Add field "State" to Articles in AgentTicketZoom

Post by rafaqf »

jojo wrote:There can be articles without any state updates or there can be state updates without articles.

The best way for developing this would be:

- create an article dynamic field.
- create an event module which populates this field with actual ticket state on article create event
I already have the actual state shown for every article, but I need the State that the article had when that article was created. So that means to have the StateUpdate from the History but in a new column in the Articles Tab.

I have the perl module that gives me the old states by passing it the ticketID, but I don't understand all that $QData{"State"}, etc in the dtl files, and I don't know how to call my script from the dtl's, or to add my code to which OTRS perl module (.pm). I'm quite new to perl, write a module is not so difficult, but to understand the OTRS code is really difficult!

Thanks for your help.
OTRS 3.0.11 and KIX4OTRS on Linux
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Add field "State" to Articles in AgentTicketZoom

Post by jojo »

as I already wrote write an event module. Don't mess up with the frontend code
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
gecelann
Znuny expert
Posts: 164
Joined: 12 Feb 2016, 08:05
Znuny Version: 5.0.0
Real Name: ann
Company: rghdinc

Re: Add field "State" to Articles in AgentTicketZoom

Post by gecelann »

rafaqf wrote:
crythias wrote:no, but you can click History ...
Hahaha... yes, I know :) It's just a client requirement. Of course I know that you can click History and see the old states.

Thanks a lot.

Cheers.
Hi rafaqf,

Did it worked? can you give me some tips on how to work on it, this is actually one of the requirements of our client and I'm newbie in perl language.
Thank you! :D
Post Reply