1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
6 %# <sales@bestpractical.com>
8 %# (Except where explicitly superseded by other copyright notices)
13 %# This work is made available to you under the terms of Version 2 of
14 %# the GNU General Public License. A copy of that license should have
15 %# been provided with this software, but in any event can be snarfed
18 %# This work is distributed in the hope that it will be useful, but
19 %# WITHOUT ANY WARRANTY; without even the implied warranty of
20 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 %# General Public License for more details.
23 %# You should have received a copy of the GNU General Public License
24 %# along with this program; if not, write to the Free Software
25 %# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26 %# 02110-1301 or visit their web page on the internet at
27 %# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
30 %# CONTRIBUTION SUBMISSION POLICY:
32 %# (The following paragraph is not intended to limit the rights granted
33 %# to you to modify and distribute this software under the terms of
34 %# the GNU General Public License and is only of importance to you if
35 %# you choose to contribute your changes and enhancements to the
36 %# community by submitting them to Best Practical Solutions, LLC.)
38 %# By intentionally submitting any modifications, corrections or
39 %# derivatives to this work, or any other work intended for use with
40 %# Request Tracker, to Best Practical Solutions, LLC, you confirm that
41 %# you are the copyright holder for those contributions and you grant
42 %# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
43 %# royalty-free, perpetual, license to use, copy, create derivative
44 %# works based on those contributions, and sublicense and distribute
45 %# those contributions and any derivatives thereof.
47 %# END BPS TAGGED BLOCK }}}
49 <script type="text/javascript">
51 jQuery(".more-about-requestor-tickets").tabs({
54 active: <% $selected %>
60 <&| /Widgets/TitleBox,
61 title_raw => loc("More about the requestors"),
62 class => 'ticket-info-requestor'
65 <div id="requestor-accordion" class="user-accordion">
67 % while ( my $requestor = $people->Next ) {
68 <h3><a href="#"><& /Elements/ShowUser, User => $requestor, Link => 0 &></a>
69 <a class="user-summary" href="<%RT->Config->Get('WebPath')%>/User/Summary.html?id=<%$requestor->Id%>">User Summary</a></h3>
72 %# Additional information about this user. Empty by default.
73 % $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AboutThisUser' );
74 <& ShowRequestorExtraInfo, Requestor => $requestor &>
76 % if ( $ShowComments ) {
77 <div class="comments-about-user">
78 <span class="label"><&|/l&>Comments about this user</&>:</span>
79 <span class="value"><% ($requestor->Comments || loc("No comment entered about this user")) %></span>
83 % $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AfterComments' );
85 % if ( $ShowTickets ) {
86 <div class="more-about-requestor-tickets ui-tabs" id="more-about-requestor-tickets-<%$requestor->Id%>">
89 % for my $status ( @$status_order ) {
91 % if ( $status eq $DefaultTicketsTab ) {
92 <a href="#requestor-<%$requestor->Id%>-ticket-tab-default">\
94 % my $url = RT->Config->Get('WebPath').'/Helpers/Toggle/ShowRequestor?'.
95 % $m->comp('/Elements/QueryString', Requestor => $requestor->Id , Status => $status);
96 <a href="<% $url | n %>" title="requestor-<%$requestor->Id%>-ticket-tab-<% $index++ %>">\
98 <% $status_link_text->{$status} %></a>
103 % for my $status (@$status_order) {
104 % if ( $status eq $DefaultTicketsTab ) {
105 <div id="requestor-<%$requestor->Id%>-ticket-tab-default">
106 <& $TicketTemplate, Requestor => $requestor &>
108 <div id="requestor-<%$requestor->Id%>-ticket-tab-<% $index++ %>" class="hidden">
109 <span class="label"><&|/l&>Loading...</&></span>
116 % my $grouplimit = RT->Config->Get('MoreAboutRequestorGroupsLimit');
117 % if ( $ShowGroups and defined $grouplimit ) {
118 <div class="more-about-user-groups">
120 <&|/l&>Groups this user belongs to</&>
122 % if ( $session{CurrentUser}->HasRight( Right => 'AdminUsers', Object => $RT::System ) &&
123 % $session{CurrentUser}->HasRight( Right => 'ShowConfigTab', Object =>$RT::System ) ) {
124 [<a href=<% RT->Config->Get('WebPath') . '/Admin/Users/Memberships.html?id=' . $requestor->id %> ><&|/l&>Edit</&></a>]
127 <span class="value"><& /Elements/ShowMemberships, UserObj => $requestor, Limit => $grouplimit &></span>
131 %# end of individual requestor details <div>
134 %# end of requestors loop
136 % $m->callback( %ARGS, CallbackName => 'AfterRequestors' );
141 my $show_privileged = RT->Config->Get('ShowMoreAboutPrivilegedUsers');
143 my $people = $Ticket->Requestors->UserMembersObj;
144 $people->LimitToUnprivileged unless $show_privileged;
146 my $count = $people->Count;
147 return unless $count;
149 my $has_right_adminusers = $session{'CurrentUser'}->HasRight(
150 Object => $RT::System, Right => 'AdminUsers'
152 $has_right_adminusers &&= $session{'CurrentUser'}->HasRight(
153 Object => $RT::System, Right => 'ShowConfigTab'
158 $DefaultTicketsTab ||= RT->Config->Get('MoreAboutRequestorTicketList', $session{CurrentUser}) || 'Active';
159 my $status_link_text = {Active => loc('Active Tickets'),
160 Inactive => loc('Inactive Tickets'),
161 All => loc('All Tickets')};
162 my $status_order = [qw/Active Inactive All/];
163 $m->callback( CallbackName => 'AddStatus', status_link_text => \$status_link_text, status_order => \$status_order );
165 $ShowTickets = 0 if $DefaultTicketsTab eq 'None';
169 for (0 .. (@$status_order - 1)) {
170 if ( $status_order->[$_] eq $DefaultTicketsTab ) {
176 $TicketTemplate = "ShowRequestorTickets$DefaultTicketsTab";
177 $TicketTemplate = "ShowRequestorTicketsActive"
178 unless RT::Interface::Web->ComponentPathIsSafe($TicketTemplate)
179 and $m->comp_exists($TicketTemplate);
184 $DefaultTicketsTab => undef
188 $Title => 'More about [_1]'