Hi all,
Since like half a year we use OTRS to my great satisfaction.I also managed to add some columns to different dashboards and such to make the system fit even more to our needs. One of our customers wanted me to add a column to their dashboard with the pending time. So I added to CustomerTicketOverview.dtl a column with $Data{"UntilTime"} which works, but it gives the time in seconds, as where I wanted a more user friendly displaying of this time in days/hours/min/sec. Is it possible to convert this, I've Googled all over the place but I cannot seem to find a solution for this.
Any help would be much appreciated.
Time format on Customer login dashboard
Moderator: crythias
-
- Znuny newbie
- Posts: 4
- Joined: 21 Feb 2011, 17:55
- Znuny Version: 3
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Time format on Customer login dashboard
http://forums.otrs.org/viewtopic.php?f=60&t=5156 might give a hint, but $TimeLong might be what you want.
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
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
-
- Znuny newbie
- Posts: 4
- Joined: 21 Feb 2011, 17:55
- Znuny Version: 3
Re: Time format on Customer login dashboard
Thanks for the swift reply!
I have looked at that post before (should have mentioned that I guess). I've change the option I added from $Data{"UntilTime"} to $TimeLong{"$Data{"UntilTime"}"} in CustomerTicketOverview.dtl, but that doesnt do anything (not even an error or something as far as I can tell, the interface does not change in any case).
If I remove the quotes for example the $TimeLong{ does get displayed as plain text, so the command it is executed by the server script I guess. Is there a different location where I should convert this? Perhaps some kind of .pm file where it only works?
I hope you have more insight into this.
I have looked at that post before (should have mentioned that I guess). I've change the option I added from $Data{"UntilTime"} to $TimeLong{"$Data{"UntilTime"}"} in CustomerTicketOverview.dtl, but that doesnt do anything (not even an error or something as far as I can tell, the interface does not change in any case).
If I remove the quotes for example the $TimeLong{ does get displayed as plain text, so the command it is executed by the server script I guess. Is there a different location where I should convert this? Perhaps some kind of .pm file where it only works?
I hope you have more insight into this.
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Time format on Customer login dashboard
did you change the Language.pm?
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
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
-
- Znuny newbie
- Posts: 4
- Joined: 21 Feb 2011, 17:55
- Znuny Version: 3
Re: Time format on Customer login dashboard
I did, but I am wondering if that went okay. Every change that I tried to make to the original code failed. But since it is a if-statement I had thought it best to just add the code, perhaps thats where it goes wrong. The Segment of Language.pm that I edited now looks like this:
I am assuming that I made a huge error there, most likely by not altering the correct code?
Code: Select all
my $ReturnString = $Self->{$Config} || "$Config needs to be translated!";
if ( $String =~ /\d\d\d\d\d\d\d\d\d\d/ ) {
$String = $Self->{TimeObject}->SystemTime2TimeStamp(
SystemTime => $String,
)
}
if ( $String =~ /(\d\d\d\d)-(\d\d)-(\d\d)\s(\d\d:\d\d:\d\d)/ ) {
my ( $Y, $M, $D, $T ) = ( $1, $2, $3, $4 );
# add user time zone diff
if ( $Self->{TimeZone} ) {
my $TimeStamp = $Self->{TimeObject}->TimeStamp2SystemTime( String => "$Y-$M-$D $T", );
$TimeStamp = $TimeStamp + ( $Self->{TimeZone} * 60 * 60 );
my ( $Sec, $Min, $Hour, $Day, $Month, $Year ) = $Self->{TimeObject}->SystemTime2Date(
SystemTime => $TimeStamp,
);
( $Y, $M, $D, $T ) = ( $Year, $Month, $Day, "$Hour:$Min:$Sec" );
}
if ($Short) {
$T =~ s/(\d\d:\d\d):\d\d/$1/g;
}
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Time format on Customer login dashboard
this looks correct, but *I* might have made a mistake if the number of digits is not 10..
but on the other hand, what does "fail" mean? Errors? Nothing? still shows the epoch time?
but on the other hand, what does "fail" mean? Errors? Nothing? still shows the epoch time?
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
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
-
- Znuny newbie
- Posts: 4
- Joined: 21 Feb 2011, 17:55
- Znuny Version: 3
Re: Time format on Customer login dashboard
Right, I found the issue. It seems that UntilTime doesnt come out as it should (or maybe its ok, but it doesnt work with the code alteration in any case). The RealTillTimeNotUsed value is the one that I needed, somehow I skipped that in your other post, stupid me ^_^
Thanks for your help!
Thanks for your help!