Skip to content

Instantly share code, notes, and snippets.

@xhoy
Created June 20, 2014 19:18
Show Gist options
  • Select an option

  • Save xhoy/dbae31e30fee1c199963 to your computer and use it in GitHub Desktop.

Select an option

Save xhoy/dbae31e30fee1c199963 to your computer and use it in GitHub Desktop.
Add escalation to OTRS dashboard
<!-- dtl:block:ContentLargeTicketGenericFilterResponsible -->
<li class="$QData{"Responsible::Selected"}"><a href="#" id="Dashboard$QData{"Name"}Responsible">$Text{"My responsibilities"} ($QData{"Responsible"})</a></li>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
$('#Dashboard$QData{"Name"}Responsible').unbind('click').bind('click', function(){
$('#Dashboard$QData{"Name"}-box').addClass('Loading');
Core.AJAX.ContentUpdate($('#Dashboard$QData{"Name"}'), '$Env{"Baselink"}Action=$Env{"Action"};Subaction=Element;Name=$QData{"Name"};Filter=Responsible', function () {
Core.UI.Table.InitCSSPseudoClasses($('#Dashboard$QData{"Name"}'));
$('#Dashboard$QData{"Name"}-box').removeClass('Loading');
});
return false;
});
//]]></script>
<!-- dtl:js_on_document_complete -->
<!-- dtl:block:ContentLargeTicketGenericFilterResponsible -->
### toegevoegd door TWs ####
<!-- dtl:block:ContentLargeTicketGenericFilterEscalation -->
<li class="$QData{"Escalation::Selected"}"><a href="#" id="Dashboard$QData{"Name"}Escalation">$Text{"Escalation"} ($QData{"Escalation"})</a></li>
<!-- dtl:js_on_document_complete -->
<script type="text/javascript">//<![CDATA[
$('#Dashboard$QData{"Name"}Escalation').unbind('click').bind('click', function(){
$('#Dashboard$QData{"Name"}-box').addClass('Loading');
Core.AJAX.ContentUpdate($('#Dashboard$QData{"Name"}'), '$Env{"Baselink"}Action=$Env{"Action"};Subaction=Element;Name=$QData{"Name"};Filter=Escalation', function () {
Core.UI.Table.InitCSSPseudoClasses($('#Dashboard$QData{"Name"}'));
$('#Dashboard$QData{"Name"}-box').removeClass('Loading');
});
return false;
});
//]]></script>
<!-- dtl:js_on_document_complete -->
<!-- dtl:block:ContentLargeTicketGenericFilterEscalation -->
######
<!-- dtl:block:ContentLargeTicketGenericFilterMyQueues -->
my %TicketSearchSummary = (
Escalation => {
TicketEscalationTimeOlderMinutes => 1,
Locks => undef,
},
### SOME WHERE ELSE IN THE FILE ###
# show also responsible if feature is enabled
if ( $Self->{ConfigObject}->Get('Ticket::Responsible') ) {
$Self->{LayoutObject}->Block(
Name => 'ContentLargeTicketGenericFilterResponsible',
Data => {
%{ $Self->{Config} },
Name => $Self->{Name},
%{$Summary},
},
);
}
# show only myqueues if we have the filter
if ( $TicketSearchSummary{MyQueues} ) {
$Self->{LayoutObject}->Block(
Name => 'ContentLargeTicketGenericFilterMyQueues',
Data => {
%{ $Self->{Config} },
Name => $Self->{Name},
%{$Summary},
},
);
}
# show only Escalation if we have the filter
if ( $TicketSearchSummary{Escalation} ) {
$Self->{LayoutObject}->Block(
Name => 'ContentLargeTicketGenericFilterEscalation',
Data => {
%{ $Self->{Config} },
Name => "bla ",
%{$Summary},
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment