Hello all,
i'd like to add a couple of columns to the ticket overview table in otrs
3.1.3 and I think I am halfway done. Two problems are left, though, and
I would gladly accept any help with these.
What I've done so far: I edited the CustomerTicketOverview.tdl template
and added three fields ("Priority, "Reporter" and "Created") to the html
table as follows:
Header rows:
$Text{"Priority"}
</a>
</th>
|
$Text{"Reporter"}
</a>
</th>
|
$Text{"Created"}
</a>
</th>
and data rows:
| $QData{"Priority"}</td>
| $QData{"CustomerUserID"}</td>
| $QData{"Created"}</td>
Bingo! These changes make the needed columns appear like expected and
they contain valid data. Two problems remain:
1) I can sort the CustomerTicketOverview table by "priority" but not by
"reporter" or "created". If I click on the column header of the latter
two - to trigger the sorting event - the customer welcome page is being
displayed instead of the ticket overview table.
The error logs seem to indicate that "sortBy=Reporter" is invalid:
[Thu Aug 16 22:12:18 2012] -e: Use of uninitialized value in
concatenation (.) or string at /opt/otrs//Kernel/System/Log.pm line 161.
ERROR: OTRS-CGI-10 Perl: 5.10.0 OS: linux Time: Thu Aug 16 22:12:18 2012
Message: Need valid SortBy (Reporter)!
Traceback (21908):
Module: Kernel::System::TicketSearch::TicketSearch (v1.12) Line: 411
Module: Kernel::Modules::CustomerTicketOverview::Run (v1.4) Line: 193
Module: Kernel::System::Web::InterfaceCustomer::Run (v1.63) Line: 998
Module:
ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_customer_2epl::handler
(unknown version) Line: 46
Module: (eval) (v1.44) Line: 204
Module: ModPerl::RegistryCooker::run (v1.44) Line: 204
Module: ModPerl::RegistryCooker::default_handler (v1.44) Line: 170
Module: ModPerl::Registry::handler (v1.99) Line: 31
Where are those declared?
2) The headers of the new columns lack the sortOrder image that
identifies the sorting column by a highlighted background and the
sorting order by an arrow. From wild grepping of the code (i am not a
perl hacker), i concluded that the necessary CSS classes for setting the
background image for the column header are being generated on the fly by
CustomerTicketOverview.pm. Looking at that code, i tried to add the
seemingly necessary variables by following the examples of the
preexisting ones. In this case, i added "ownerSort":
[...]
my $OrderBy = 'Down';
if ( $Self->{OrderBy} eq 'Down' ) {
$OrderBy = 'Up';
}
my $Sort = '';
my $StateSort = '';
my $TicketSort = '';
my $TitleSort = '';
my $AgeSort = '';
my $OwnerSort = '';
# this sets the opposit to the $OrderBy
if ( $OrderBy eq 'Down' ) {
$Sort = 'SortAscending';
}
if ( $OrderBy eq 'Up' ) {
$Sort = 'SortDescending';
}
# perl is missing 'switch' :-| have to learn to work effectivly
without it
if ( $Self->{SortBy} eq 'State' ) {
$StateSort = $Sort;
}
if ( $Self->{SortBy} eq 'Ticket' ) {
$TicketSort = $Sort;
}
if ( $Self->{SortBy} eq 'Title' ) {
$TitleSort = $Sort;
}
if ( $Self->{SortBy} eq 'Age' ) {
$AgeSort = $Sort;
}
if ( $Self->{SortBy} eq 'Owner' ) {
$OwnerSort = $Sort;
}
$Self->{LayoutObject}->Block(
Name => 'Filled',
Data => {
%Param,
%PNav,
OrderBy => $OrderBy,
StateSort => $StateSort,
TicketSort => $TicketSort,
TitleSort => $TitleSort,
AgeSort => $AgeSort,
OwnerSort => $OwnerSort,
Filter => $Self->{Filter},
},
);
[...]
However, this change makes loading the CustomerTicketOverview.pm module
fail with:
"Global symbol "%PNav" requires explicit package name at /opt/otrs//Kernel/Modules/CustomerTicketOverview.pm line 297. Compilation failed in require at /opt/otrs/Kernel/cpan-lib/Apache2/Reload.pm line 181."
Questions are:
1. What is wrong with the links in the "reporter" and "created" columns header that they display the welcome page instead of the table and is there a way to fix that?
2. How can i make the correct icons appear in the new columns header fields so that the user has an indication of what es being sorted and how?
Any help is being greatly appreciated!
Cheers,
Rouven
--
Blinkenlichten Open Source Solutions
Maass Sacha GbR | Weigandufer 45 | 12059 Berlin
tel: +493013896247 | fax: +493013896249 | mob: +491744220127
Web: http://www.blinkenlichten.de/ G+: http://gplus.to/blinkenlichten
Blinkenlichten Zarafa Hosted Tweets: http://twitter.com/zarafamail/
Show replies by date
Hi all,
thanks to @Sanchez from irc, i solved these problems:
1) Change $OTRS_HOME/Kernel/Modules/System/TicketSearch.pm l. 278 ff. to
include the sortBy criteria and the corresponding database fields:
my %SortOptions = (
Owner => 'st.user_id',
Responsible => 'st.responsible_user_id',
CustomerID => 'st.customer_id',
State => 'st.ticket_state_id',
Lock => 'st.ticket_lock_id',
Ticket => 'st.tn',
TicketNumber => 'st.tn',
Title => 'st.title',
Queue => 'sq.name',
Type => 'st.type_id',
Priority => 'st.ticket_priority_id',
Age => 'st.create_time_unix',
Changed => 'st.change_time',
Created => 'st.create_time',
Reporter => 'st.customer_user_id',
Service => 'st.service_id',
SLA => 'st.sla_id',
PendingTime => 'st.until_time',
TicketEscalation => 'st.escalation_time',
EscalationTime => 'st.escalation_time',
EscalationUpdateTime => 'st.escalation_update_time',
EscalationResponseTime => 'st.escalation_response_time',
EscalationSolutionTime => 'st.escalation_solution_time',
);
2) Changing %PNav in CutomerTicketOverview.pm to %PageNav.
Now the CSS Classes for the new columns seem to be generated correctly.
Thanks a lot & cheers,
Rouven
--
Blinkenlichten Open Source Solutions
Maass Sacha GbR | Weigandufer 45 | 12059 Berlin
tel: +493013896247 | fax: +493013896249 | mob: +491744220127
Web: http://www.blinkenlichten.de/ G+: http://gplus.to/blinkenlichten
Blinkenlichten Zarafa Hosted Tweets: http://twitter.com/zarafamail/
|