How to add "unchanged duration" to Dashboard

English! place to talk about development, programming and coding
Post Reply
HervE
Znuny wizard
Posts: 391
Joined: 03 Jan 2011, 17:15
Znuny Version: 3.3.8
Location: France

How to add "unchanged duration" to Dashboard

Post by HervE »

Hello,

As we wanted to display the "unchanged duration" of a Ticket (i.e. how long a ticket has remained untouched) instead of Age in the Dashboard, I tried this package but finally I found something easier.

I only modified Kernel\System\Ticket.pm in sub TicketGet:

Code: Select all

    # fillup runtime values
    $Ticket{Age} = $Self->{TimeObject}->SystemTime() - $Ticket{CreateTimeUnix};
	# Add UnchangedDuration (new)
	$Ticket{UnchangedDuration} = $Self->{TimeObject}->SystemTime() 
		- $Self->{TimeObject}->TimeStamp2SystemTime(
            String => $Ticket{Changed},
        );
Then I went to SysConfig Ticket -> Frontend::Agent::Dashboard, and assigned variable Time=UnchangedDuration in the desired panes (DashboardBackend###0130-TicketOpen, for instance).

As we also wanted to sort by UnchangedDuration, I added it in sub TicketSearch too (still in Ticket.pm):

Code: Select all

# Modified default sort by 'Age' into 'UnchangedDuration'
#    my $SortBy  = $Param{SortBy}  || 'Age';
    my $SortBy  = $Param{SortBy}  || 'UnchangedDuration';
(...)

    my %SortOptions = (
(...)
        Age                    => 'st.create_time_unix',
        # Add UnchangedDuration
        UnchangedDuration      => 'st.change_time',
Now it works fine... provided ticket.change_time is updated. (Warning! This is ticket table, not article!)
I think this column is updated whenever a new mail article is appended to the ticket. It is not updated when a new note is added.

What's your opinion about this?

Regards,
HervE
OTRS 3.3.8 - Windows 7 - IIS7 - SQL Server - Firefox 30
Rene_1981
Znuny newbie
Posts: 7
Joined: 26 Apr 2011, 16:39
Znuny Version: 2.4.9
Real Name: Rene

Re: How to add "unchanged duration" to Dashboard

Post by Rene_1981 »

using this modification it is showing in dashboard: 16009 Tage 21 Stunden means in eng: 16009 days 21 hours

not true... any idea what to change?
Post Reply