Hi! i want to know how to set european format for the <OTRS_TICKET_Created> variable. I use it into the auto reply's body email to customer after a new ticket creation.
The format is yyyy-mm-dd, and what i want is dd-mm-yyyy, and if it's possible i don't want to see the seconds (now is hh:mm:ss, i want hh:mm).
I tried to edit Kernel/System/Time.pm, but after modifying that file, the OTRS' error log gives me a lot of "Invalid time format '27-11-2013 12:29:17'!" error in OTRS-CGI-01 function.
Thanks & regards!
european format for <OTRS_TICKET_Created>
Moderator: crythias
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: european format for <OTRS_TICKET_Created>
To do what you want would probably require modifying Kernel/System/Ticket.pm ...
something like:
and then in Time.pm:
<OTRS_TICKET_myCreated>
This won't survive updates and has been coded without testing, but generally copied from existing code, which you probably could figure out where to place near likeminded code.
something like:
Code: Select all
$Ticket{myCreated} = $Self->{TimeObject}->SystemTime2TimeStamp(
SystemTime => $Ticket{CreateTimeUnix},
MyFlag => '1',
);
Code: Select all
if ( $Param{MyFlag} && $Param{MyFlag} eq '1' ) {
return "$Day-$Month-$Year $Hour:$Min";
}
This won't survive updates and has been coded without testing, but generally copied from existing code, which you probably could figure out where to place near likeminded code.
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
Re: european format for <OTRS_TICKET_Created>
oh very nice! it works!
the only problem is that in OTRS' error log:
Wed Nov 27 15:12:07 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:07 2013 error OTRS-CGI-01 Need Time!
Wed Nov 27 15:12:07 2013 error OTRS-CGI-01 Need String!
Wed Nov 27 15:12:06 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:06 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:06 2013 info OTRS-CGI-01 Sent agent 'NewTicket' notification to 'xxx'.
where xxx are my tasks for generic agent, and the escalation time for ticket is null.
Where's the problem?
edit: I've found my error! i have to ADD "myCreated" entry in Ticket.pm, and not to modify the existent "Created".
In Ticket.pm
and in Time.pm
the only problem is that in OTRS' error log:
Wed Nov 27 15:12:07 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:07 2013 error OTRS-CGI-01 Need Time!
Wed Nov 27 15:12:07 2013 error OTRS-CGI-01 Need String!
Wed Nov 27 15:12:06 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:06 2013 notice OTRS-CGI-01 Run GenericAgent Job 'xxx' from db.
Wed Nov 27 15:12:06 2013 info OTRS-CGI-01 Sent agent 'NewTicket' notification to 'xxx'.
where xxx are my tasks for generic agent, and the escalation time for ticket is null.
Where's the problem?
edit: I've found my error! i have to ADD "myCreated" entry in Ticket.pm, and not to modify the existent "Created".
In Ticket.pm
Code: Select all
Returns:
%Ticket = (
TicketNumber => '20101027000001',
Title => 'some title',
TicketID => 123,
State => 'some state',
StateID => 123,
StateType => 'some state type',
Priority => 'some priority',
PriorityID => 123,
Lock => 'lock',
LockID => 123,
Queue => 'some queue',
QueueID => 123,
CustomerID => 'customer_id_123',
CustomerUserID => 'customer_user_id_123',
Owner => 'some_owner_login',
OwnerID => 123,
Type => 'some ticket type',
TypeID => 123,
SLA => 'some sla',
SLAID => 123,
Service => 'some service',
ServiceID => 123,
Responsible => 'some_responsible_login',
ResponsibleID => 123,
Age => 3456,
Created => '2010-10-27 20:15:00'
myCreated => '27-10-2010 20:15'
CreateTimeUnix => '1231414141',
CreateBy => 123,
Changed => '2010-10-27 20:15:15',
ChangeBy => 123,
ArchiveFlag => 'y',
Code: Select all
$Ticket{Created} = $Self->{TimeObject}->SystemTime2TimeStamp(
SystemTime => $Ticket{CreateTimeUnix},
);
$Ticket{myCreated} = $Self->{TimeObject}->SystemTime2TimeStamp(
SystemTime => $Ticket{CreateTimeUnix},
MyFlag => '1',
);
Code: Select all
# check needed stuff
if ( !$Param{SystemTime} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => 'Need SystemTime!' );
return;
}
my ( $Sec, $Min, $Hour, $Day, $Month, $Year ) = $Self->SystemTime2Date(%Param);
if ( $Param{Type} && $Param{Type} eq 'Short' ) {
my ( $CSec, $CMin, $CHour, $CDay, $CMonth, $CYear ) = $Self->SystemTime2Date(
SystemTime => $Self->SystemTime(),
);
if ( $CYear == $Year && $CMonth == $Month && $CDay == $Day ) {
return "$Hour:$Min:$Sec";
}
return "$Year-$Month-$Day $Hour:$Min:$Sec";
}
if ( $Param{MyFlag} && $Param{MyFlag} eq '1' ) {
return "$Day-$Month-$Year $Hour:$Min";
}
return "$Year-$Month-$Day $Hour:$Min:$Sec";
}
-
- Moderator
- Posts: 10169
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: european format for <OTRS_TICKET_Created>
Great to hear!
Also, and this is just a "in case you're adventurous", the Ticket myCreated parameter is globally usable for all *frontend* places you'd use Created (like stats). (You may have to add the field in SysConfig or modify .dtls, but ...)
obviously, not backend...
Also, and this is just a "in case you're adventurous", the Ticket myCreated parameter is globally usable for all *frontend* places you'd use Created (like stats). (You may have to add the field in SysConfig or modify .dtls, but ...)
obviously, not backend...
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
Re: european format for <OTRS_TICKET_Created>
Hi,
do you know how to implement european datetime format in OTRS 6 ?
Thanks.
do you know how to implement european datetime format in OTRS 6 ?
Thanks.
OTRS 6.0.3-1, MySQL