1 %# BEGIN BPS TAGGED BLOCK {{{
5 %# This software is Copyright (c) 1996-2013 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 }}}
48 <script type="text/javascript">
50 jQuery("#requestor-accordion").accordion({
51 active: <% $count == 1 ? 0 : 'false' %>,
57 jQuery(".more-about-requestor-tickets").tabs({
60 selected: <% $selected %>
66 <&| /Widgets/TitleBox,
67 title_raw => loc("More about the requestors"),
68 class => 'ticket-info-requestor'
71 <div id="requestor-accordion">
73 % while ( my $requestor = $people->Next ) {
74 <h3><a href="#"><& /Elements/ShowUser, User => $requestor &></a></h3>
77 %# Additional information about this user. Empty by default.
78 % $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AboutThisUser' );
79 <& ShowRequestorExtraInfo, Requestor => $requestor &>
81 % if ( $ShowComments ) {
82 <div class="comments-about-user">
83 <span class="label"><&|/l&>Comments about this user</&>:</span>
84 <span class="value"><% ($requestor->Comments || loc("No comment entered about this user")) %></span>
88 % if ( $ShowTickets ) {
89 <div class="more-about-requestor-tickets ui-tabs" id="more-about-requestor-tickets-<%$requestor->Id%>">
92 % for my $status ( @$status_order ) {
94 % if ( $status eq $DefaultTicketsTab ) {
95 <a href="#requestor-<%$requestor->Id%>-ticket-tab-default">\
97 % my $url = RT->Config->Get('WebPath').'/Helpers/Toggle/ShowRequestor?'.
98 % $m->comp('/Elements/QueryString', Requestor => $requestor->Id , Status => $status);
99 <a href="<% $url | n %>" title="requestor-<%$requestor->Id%>-ticket-tab-<% $index++ %>">\
101 <% $status_link_text->{$status} %></a>
106 % for my $status (@$status_order) {
107 % if ( $status eq $DefaultTicketsTab ) {
108 <div id="requestor-<%$requestor->Id%>-ticket-tab-default">
109 <& $TicketTemplate, Requestor => $requestor &>
111 <div id="requestor-<%$requestor->Id%>-ticket-tab-<% $index++ %>" class="ui-tabs-hide">
112 <span class="label"><&|/l&>Loading...</&></span>
119 % my $grouplimit = RT->Config->Get('MoreAboutRequestorGroupsLimit');
120 % if ( $ShowGroups and defined $grouplimit ) {
121 <div class="more-about-user-groups">
123 <&|/l&>Groups this user belongs to</&>
125 % if ( $session{CurrentUser}->HasRight( Right => 'AdminUsers', Object => $RT::System ) &&
126 % $session{CurrentUser}->HasRight( Right => 'ShowConfigTab', Object =>$RT::System ) ) {
127 [<a href=<% RT->Config->Get('WebPath') . '/Admin/Users/Memberships.html?id=' . $requestor->id %> ><&|/l&>Edit</&></a>]
130 <span class="value"><& /Elements/ShowMemberships, UserObj => $requestor, Limit => $grouplimit &></span>
134 % if ( $has_right_adminusers ) {
135 <a class="modify-user" href="<% RT->Config->Get('WebPath')."/Admin/Users/Modify.html?id=".$requestor->id %>"><&|/l&>Modify this user</&></a>
138 %# end of individual requestor details <div>
141 %# end of requestors loop
146 my $show_privileged = RT->Config->Get('ShowMoreAboutPrivilegedUsers');
148 my $people = $Ticket->Requestors->UserMembersObj;
149 $people->LimitToUnprivileged unless $show_privileged;
151 my $count = $people->Count;
152 return unless $count;
154 my $has_right_adminusers = $session{'CurrentUser'}->HasRight(
155 Object => $RT::System, Right => 'AdminUsers'
157 $has_right_adminusers &&= $session{'CurrentUser'}->HasRight(
158 Object => $RT::System, Right => 'ShowConfigTab'
163 $DefaultTicketsTab ||= RT->Config->Get('MoreAboutRequestorTicketList', $session{CurrentUser}) || 'Active';
164 my $status_link_text = {Active => loc('Active Tickets'),
165 Inactive => loc('Inactive Tickets'),
166 All => loc('All Tickets')};
167 my $status_order = [qw/Active Inactive All/];
168 $m->callback( CallbackName => 'AddStatus', status_link_text => \$status_link_text, status_order => \$status_order );
170 unless ( $DefaultTicketsTab eq 'None' ) {
171 for (0 .. (@$status_order - 1)) {
172 $selected = $_ && last
173 if $status_order->[$_] eq $DefaultTicketsTab;
177 my $TicketTemplate = "ShowRequestorTickets$DefaultTicketsTab";
178 $TicketTemplate = "ShowRequestorTicketsActive"
179 unless RT::Interface::Web->ComponentPathIsSafe($TicketTemplate)
180 and $m->comp_exists($TicketTemplate);
184 $DefaultTicketsTab => undef
188 $Title => 'More about [_1]'