]>
Commit | Line | Data |
---|---|---|
84fb5b46 MKG |
1 | %# BEGIN BPS TAGGED BLOCK {{{ |
2 | %# | |
3 | %# COPYRIGHT: | |
4 | %# | |
320f0092 | 5 | %# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC |
84fb5b46 MKG |
6 | %# <sales@bestpractical.com> |
7 | %# | |
8 | %# (Except where explicitly superseded by other copyright notices) | |
9 | %# | |
10 | %# | |
11 | %# LICENSE: | |
12 | %# | |
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 | |
16 | %# from www.gnu.org. | |
17 | %# | |
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. | |
22 | %# | |
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. | |
28 | %# | |
29 | %# | |
30 | %# CONTRIBUTION SUBMISSION POLICY: | |
31 | %# | |
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.) | |
37 | %# | |
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. | |
46 | %# | |
47 | %# END BPS TAGGED BLOCK }}} | |
af59614d | 48 | % if ($ShowTickets) { |
84fb5b46 MKG |
49 | <script type="text/javascript"> |
50 | jQuery(function() { | |
84fb5b46 MKG |
51 | jQuery(".more-about-requestor-tickets").tabs({ |
52 | cache: true, | |
53 | collapsible: true, | |
54 | selected: <% $selected %> | |
55 | }); | |
84fb5b46 MKG |
56 | }); |
57 | </script> | |
af59614d | 58 | % } |
84fb5b46 MKG |
59 | |
60 | <&| /Widgets/TitleBox, | |
61 | title_raw => loc("More about the requestors"), | |
62 | class => 'ticket-info-requestor' | |
63 | &> | |
64 | ||
af59614d | 65 | <div id="requestor-accordion" class="user-accordion"> |
84fb5b46 MKG |
66 | |
67 | % while ( my $requestor = $people->Next ) { | |
af59614d MKG |
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> | |
84fb5b46 MKG |
70 | <div class="details"> |
71 | ||
72 | %# Additional information about this user. Empty by default. | |
73 | % $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AboutThisUser' ); | |
74 | <& ShowRequestorExtraInfo, Requestor => $requestor &> | |
75 | ||
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> | |
80 | </div> | |
81 | % } | |
82 | ||
af59614d MKG |
83 | % $m->callback( requestor => $requestor, %ARGS, CallbackName => 'AfterComments' ); |
84 | ||
84fb5b46 MKG |
85 | % if ( $ShowTickets ) { |
86 | <div class="more-about-requestor-tickets ui-tabs" id="more-about-requestor-tickets-<%$requestor->Id%>"> | |
87 | <ul> | |
88 | % my $index = 1; | |
89 | % for my $status ( @$status_order ) { | |
90 | <li> | |
91 | % if ( $status eq $DefaultTicketsTab ) { | |
92 | <a href="#requestor-<%$requestor->Id%>-ticket-tab-default">\ | |
93 | % } else { | |
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++ %>">\ | |
97 | % } | |
98 | <% $status_link_text->{$status} %></a> | |
99 | </li> | |
100 | % } | |
101 | </ul> | |
102 | % $index = 1; | |
103 | % for my $status (@$status_order) { | |
104 | % if ( $status eq $DefaultTicketsTab ) { | |
105 | <div id="requestor-<%$requestor->Id%>-ticket-tab-default"> | |
106 | <& $TicketTemplate, Requestor => $requestor &> | |
107 | % } else { | |
af59614d | 108 | <div id="requestor-<%$requestor->Id%>-ticket-tab-<% $index++ %>" class="hidden"> |
84fb5b46 MKG |
109 | <span class="label"><&|/l&>Loading...</&></span> |
110 | % } | |
111 | </div> | |
112 | % } | |
113 | </div> | |
114 | % } | |
115 | ||
116 | % my $grouplimit = RT->Config->Get('MoreAboutRequestorGroupsLimit'); | |
117 | % if ( $ShowGroups and defined $grouplimit ) { | |
118 | <div class="more-about-user-groups"> | |
119 | <span class="label"> | |
120 | <&|/l&>Groups this user belongs to</&> | |
121 | ||
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>] | |
125 | % } | |
126 | </span> | |
127 | <span class="value"><& /Elements/ShowMemberships, UserObj => $requestor, Limit => $grouplimit &></span> | |
128 | </div> | |
129 | % } | |
130 | ||
84fb5b46 MKG |
131 | %# end of individual requestor details <div> |
132 | </div> | |
133 | % } | |
134 | %# end of requestors loop | |
135 | ||
af59614d MKG |
136 | % $m->callback( %ARGS, CallbackName => 'AfterRequestors' ); |
137 | ||
84fb5b46 MKG |
138 | </div> |
139 | </&> | |
140 | <%INIT> | |
141 | my $show_privileged = RT->Config->Get('ShowMoreAboutPrivilegedUsers'); | |
142 | ||
143 | my $people = $Ticket->Requestors->UserMembersObj; | |
144 | $people->LimitToUnprivileged unless $show_privileged; | |
145 | ||
146 | my $count = $people->Count; | |
147 | return unless $count; | |
148 | ||
149 | my $has_right_adminusers = $session{'CurrentUser'}->HasRight( | |
150 | Object => $RT::System, Right => 'AdminUsers' | |
151 | ); | |
152 | $has_right_adminusers &&= $session{'CurrentUser'}->HasRight( | |
153 | Object => $RT::System, Right => 'ShowConfigTab' | |
154 | ); | |
155 | ||
156 | # Ticket list tabs | |
157 | my $selected = -1; | |
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 ); | |
164 | ||
165 | unless ( $DefaultTicketsTab eq 'None' ) { | |
166 | for (0 .. (@$status_order - 1)) { | |
167 | $selected = $_ && last | |
168 | if $status_order->[$_] eq $DefaultTicketsTab; | |
169 | } | |
170 | } | |
171 | ||
172 | my $TicketTemplate = "ShowRequestorTickets$DefaultTicketsTab"; | |
173 | $TicketTemplate = "ShowRequestorTicketsActive" | |
174 | unless RT::Interface::Web->ComponentPathIsSafe($TicketTemplate) | |
175 | and $m->comp_exists($TicketTemplate); | |
176 | </%INIT> | |
177 | <%ARGS> | |
178 | $Ticket=>undef | |
179 | $DefaultTicketsTab => undef | |
180 | $ShowComments => 1 | |
181 | $ShowTickets => 1 | |
182 | $ShowGroups => 1 | |
183 | $Title => 'More about [_1]' | |
184 | </%ARGS> |