Add "Time left" column in view/dashboard

Moderator: crythias

Post Reply
rstainforth
Znuny newbie
Posts: 5
Joined: 13 Jun 2011, 17:10
Znuny Version: 3.0
Real Name: Richard
Company: Legend Club Management

Add "Time left" column in view/dashboard

Post by rstainforth »

Hi,

I'm looking to add a column into either the agent views and/or dashboard which will show time left until escalation, preferably for each type of escalation (First Response, Update and completion). So, in the view you would have something like the following columns:

Ticket Number Age From/Subject State Locked Queue Owner CustomerID Time Left (1st Response) Time Left (Update) Time Left (Resolution)

If this is not possible then simply Time Left (Escalation) would suffice. Hope this makes sense!
OTRS 3.0, Windows Server 2008 R2 X64, SQL 2005
tdeklein
Znuny newbie
Posts: 33
Joined: 06 Sep 2010, 10:09
Znuny Version: 3.0.6

Re: Add "Time left" column in view/dashboard

Post by tdeklein »

Hi,
maybe this will be a little help for you
http://forums.otrs.org/viewtopic.php?f=53&t=9809

At the moment I am trying to put the time to escalation/time while still pending into FreeTime6 in Ticket.pl and add just a new column for it. The must-have feature for this is to be able to sort the view by this column. No success yet, but still thinking about the right way to do this.

Cheers
Thomas
OTRS 3.0.8
Debian 6.0
MySQL
KundenDB aus postgres angebunden.
rstainforth
Znuny newbie
Posts: 5
Joined: 13 Jun 2011, 17:10
Znuny Version: 3.0
Real Name: Richard
Company: Legend Club Management

Re: Add "Time left" column in view/dashboard

Post by rstainforth »

Awesome dude, will take a look at this. Sounds like we are looking for the same solution....
OTRS 3.0, Windows Server 2008 R2 X64, SQL 2005
rstainforth
Znuny newbie
Posts: 5
Joined: 13 Jun 2011, 17:10
Znuny Version: 3.0
Real Name: Richard
Company: Legend Club Management

Re: Add "Time left" column in view/dashboard

Post by rstainforth »

Hi again,

OK, I've taken the mod code that you pointed to in your post, but I'm struggling to see where that would be inserted into the config file. I have tried amending C:\Program Files (x86)\OTRS\OTRS\Kernel\Output\HTML\Standard\AgentTicketOverviewSmall.dtl but it just mungs the view completely as below:
Capture.PNG
Any pointers? I'm a bit stuck, and this is becoming a fairly political point in the office as we could do this with our old ticketing system until I convinced them to move to OTRS :)
You do not have the required permissions to view the files attached to this post.
OTRS 3.0, Windows Server 2008 R2 X64, SQL 2005
renee
Znuny expert
Posts: 241
Joined: 06 Feb 2009, 11:15
Znuny Version: 3.0.x
Company: Perl-Services.de
Contact:

Re: Add "Time left" column in view/dashboard

Post by renee »

Can you show us what you have changed?
Need a Perl/OTRS developer? You can contact me at info@perl-services.de
rstainforth
Znuny newbie
Posts: 5
Joined: 13 Jun 2011, 17:10
Znuny Version: 3.0
Real Name: Richard
Company: Legend Club Management

Re: Add "Time left" column in view/dashboard

Post by rstainforth »

OK, after returning to this I realised that I had been editing AgentTicketOverviewSmall.dtl, rather than TicketOverviewSmall.pm as directed in the OP. I have the following code to add, but not sure where in TicketOverviewSmall.pm to place it:

### MOD START
### Always show EscalationTimeSpalte, not only in the Eskalationsview. Dont show Age
# Original
#my @Col = (qw(TicketNumber Age State Lock Queue Owner CustomerID));
# No Age, show EscalationTime
my @Col = (qw(TicketNumber EscalationTime State Lock Queue Owner CustomerID));

# Since EscalationTime is already in there, we dont need to put in in here
# show escalation
#if ( $Param{Escalation} ) {
# push @Col, 'EscalationTime';
#}

### MOD STOP
...
### MOD START
### Original
# # escalation human times
# if ( $Article{EscalationTime} ) {
# $Article{EscalationTimeHuman} = $Self->{LayoutObject}->CustomerAgeInHours(
# Age => $Article{EscalationTime},
# Space => ' ',
# );
# $Article{EscalationTimeWorkingTime} = $Self->{LayoutObject}->CustomerAgeInHours(
# Age => $Article{EscalationTimeWorkingTime},
# Space => ' ',
# );
# }
# escalation human times
#if ( $Article{EscalationTime} ) {
$Article{EscalationTimeHuman} = $Self->{LayoutObject}->CustomerAgeInHours(
Age => $Article{EscalationTime},
Space => ' ',
);
$Article{EscalationTimeWorkingTime} = $Self->{LayoutObject}->CustomerAgeInHours(
Age => $Article{EscalationTimeWorkingTime},
Space => ' ',
);
#}
# Falls Eskalationszeit = 0 (weil z. B. Ticket pending), dann pending Zeit anzeigen
if ($Article{EscalationTimeHuman} == 0) {
$Article{EscalationTimeHuman} = $Self->{LayoutObject}->CustomerAgeInHours(
Age => $Article{UntilTime},
Space => ' ',
);
# If the rest of the pending time is not negative (still pending), don't show
# EscalationTime in red in condition check later.
# > 0 = Rot wenn Ablauf
# > 3600 = Rot eine Stunde vor Ablauf
if ($Article{UntilTime} > 3600) {
$Article{EscalationTime} = 60 * 60 * 1;
}

# Time till end of pending
my $DestDate = $Self->{TimeObject}->SystemTime() + $Article{UntilTime};
my $TimeStamp = $Self->{TimeObject}->SystemTime2TimeStamp(SystemTime => $DestDate,);
# Seconds of worktime till escalation
my $WorkingTimeTillEscalation = $Self->{TimeObject}->WorkingTime(
StartTime => $Self->{TimeObject}->SystemTime(),
StopTime => $Self->{TimeObject}->SystemTime() + $Article{UntilTime},
);
$Article{EscalationTimeWorkingTime} = $WorkingTimeTillEscalation/60/60 ." h"; # (seconds of working/service time till escalation, e. g. "1800")
$Article{EscalationDestinationDate} = $TimeStamp;
$Article{UpdateTimeDestinationDate} = $TimeStamp;
}
### MOD STOP
...
### MOD START
### Original
### # show escalation
### if ( $Param{Escalation} ) {
### if ( $Article{EscalationTime} < 60 * 60 * 1 ) {
### $Article{EscalationClass} = 'Warning';
### }
### $Self->{LayoutObject}->Block(
### Name => 'RecordEscalationTime',
### Data => { %Article, %UserInfo },
### );
### }
# show escalation
#if ( $Param{Escalation} ) {
if ( $Article{EscalationTime} < 60 * 60 * 1 ) {
$Article{EscalationClass} = 'Warning';
}
$Self->{LayoutObject}->Block(
Name => 'RecordEscalationTime',
Data => { %Article, %UserInfo },
);
#}
### MOD STOP
...
### MOD START
### Original
### # show escalation
### if ( $Param{Escalation} ) {
### if ( $Article{EscalationTime} < 60 * 60 * 1 ) {
### $Article{EscalationClass} = 'Warning';
### }
### $Self->{LayoutObject}->Block(
### Name => 'RecordEscalationTime',
### Data => { %Article, %UserInfo },
### );
### }
# show escalation
#if ( $Param{Escalation} ) {
if ( $Article{EscalationTime} < 60 * 60 * 1 ) {
$Article{EscalationClass} = 'Warning';
}
$Self->{LayoutObject}->Block(
Name => 'RecordEscalationTime',
Data => { %Article, %UserInfo },
);
#}
### MOD STOP
OTRS 3.0, Windows Server 2008 R2 X64, SQL 2005
tdeklein
Znuny newbie
Posts: 33
Joined: 06 Sep 2010, 10:09
Znuny Version: 3.0.6

Re: Add "Time left" column in view/dashboard

Post by tdeklein »

Hi,

you just have to look where you find the parts marked "original". I left why I
left them in there so one has a chance to find the right place for the
modifications.

Cheers
Thomas
OTRS 3.0.8
Debian 6.0
MySQL
KundenDB aus postgres angebunden.
Post Reply