import rt 3.8.9
[freeside.git] / rt / share / html / Admin / Tools / Configuration.html
1 %# BEGIN BPS TAGGED BLOCK {{{
2 %#
3 %# COPYRIGHT:
4 %#
5 %# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
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 }}}
48 <%init>
49 require  Module::Versions::Report;
50 my $title = loc('System Configuration');
51 unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
52  Abort(loc('This feature is only available to system administrators'));
53 }
54 </%init>
55 <& /Admin/Elements/Header, Title => $title &>
56 <& /Admin/Elements/ToolTabs, 
57     current_tab => 'Admin/Tools/Configuration.html',
58     current_subtab => 'Admin/Tools/Configuration.html', 
59     Title => $title &>
60
61 <&|/Widgets/TitleBox, title => loc("RT Configuration") &>
62 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
63 <tr class="collection-as-table">
64 <th class="collection-as-table"><&|/l&>Option</&></th>
65 <th class="collection-as-table"><&|/l&>Value</&></th>
66 <th class="collection-as-table"><&|/l&>Source</&></th>
67 </tr>
68 <%PERL>
69 my $index_conf;
70 foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
71     my $val = RT->Config->Get( $key );
72     next unless defined $val;
73
74     my $meta = RT->Config->Meta( $key );
75     my $description = '';
76     if ( $meta->{'Source'}{'Extension'} && $meta->{'Source'}{'SiteConfig'} ) {
77         $description = loc("[_1] site config", $meta->{'Source'}{'Extension'});
78     }
79     elsif ( $meta->{'Source'}{'Extension'} ) {
80         $description = loc("[_1] core config", $meta->{'Source'}{'Extension'});
81     }
82     elsif ( $meta->{'Source'}{'SiteConfig'} ) {
83         $description = loc("site config");
84     }
85     else {
86         $description = loc("core config");
87     }
88     $index_conf++;
89 </%PERL>
90 <tr class="<% $index_conf%2 ? 'oddline' : 'evenline'%>">
91 <td class="collection-as-table"><% $key %></td>
92 <td class="collection-as-table">
93 % if ( $key =~ /Password(?!Length)/i ) { 
94 <em>Password not printed</em>\
95 % } elsif ( !ref $val ) {
96 <% "$val" %>\
97 % } elsif ( ref $val eq 'ARRAY' ) {
98 <% join ', ', @$val %>\
99 % } elsif ( ref $val eq 'HASH' ) {
100 <% join ', ', %$val %>\
101 % } else {
102 <% ref $val %>\
103 % }
104 </td>
105 <td class="collection-as-table" style="white-space: nowrap">
106 % if ( $description =~ /^.*site config$/ ) {
107 <span style="font-weight: bold"><% $description %></span>
108 % } else {
109 <% $description %>
110 % }
111 </td>
112 </tr>
113 % }
114 </table>
115 </&>
116 <table width="100%">
117     <tr>
118         <td valign="top" width="60%" class="boxcontainer">
119 <&|/Widgets/TitleBox, title=> loc("RT core variables") &>
120 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
121 <tr class="collection-as-table">
122 <th class="collection-as-table"><&|/l&>Variable</&></th>
123 <th class="collection-as-table"><&|/l&>Value</&></th>
124 </tr>
125 <%PERL>
126 { no strict qw/refs/;
127 my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
128 my $index_var;
129 foreach my $key ( sort keys %{*RT::} ) {
130     next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
131     $index_var++;
132 </%PERL>
133 <tr class="collection-as-table <% $index_var%2 ? 'oddline' : 'evenline'%>">
134 <td class="collection-as-table">RT::<% $key %></td>
135 <td class="collection-as-table">
136 % if ( $key =~ /Password(?!Length)/i ) { 
137 <em>Password not printed</em>
138 % } else {
139 <% ${'RT::'.$key} %>
140 % }
141 </td>
142 </tr>
143 % }
144 % }
145 </table>
146 </&>
147
148 <&|/Widgets/TitleBox, title => loc("RT Size") &>
149 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
150 <tr class="collection-as-table">
151 <th class="collection-as-table"><&|/l&>Object</&></th>
152 <th class="collection-as-table"><&|/l&>Size</&></th>
153 </tr>
154 <%PERL>
155 my ($index_size, $user_count, $privileged_count);
156 for my $type (qw/Tickets Queues Transactions Groups PrivilegedUsers UnprivilegedUsers/) {
157     my $count;
158     my $class = 'RT::' . $type;
159     $class =~ s/Privileged|Unprivileged//;
160     my $collection = $class->new($RT::SystemUser);
161     $collection->UnLimit;
162     if ($type =~ /PrivilegedUsers/) {
163         $user_count = $collection->CountAll;
164         $collection->LimitToPrivileged;
165         $count = $privileged_count = $collection->CountAll;
166     } elsif ($type =~ /UnprivilegedUsers/) {
167         $count = $user_count - $privileged_count;
168     } else {
169         $count = $collection->CountAll;
170     }
171     $index_size++;
172 </%PERL>
173 <tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>">
174 <td class="collection-as-table"><% $type %></td>
175 <td class="collection-as-table"><% $count %></td>
176 </tr>
177 % }
178 </table>
179 </&>
180 </td>
181 <td valign="top" class="boxcontainer">
182
183 <&|/Widgets/TitleBox, title => loc("Mason template search order") &>
184 <ol>
185 % foreach my $path ( map { $_->[1] } $m->interp->comp_root_array ) {
186 <li><% $path %></li>
187 % }
188 </ol>
189 </&>
190
191 <&|/Widgets/TitleBox, title => loc("Perl library search order") &>
192 <ol>
193 % foreach my $inc (@INC) {
194 <li><% $inc %></li>
195 % }
196 </ol>
197 </&>
198
199 </td>
200 </table>
201
202 <&|/Widgets/TitleBox, title => loc("Loaded perl modules")&>
203 <table border="0" cellspacing="0" cellpadding="5" width="100%" class="collection">
204 <tr class="collection-as-table">
205 <th class="collection-as-table"><&|/l&>Module</&></th>
206 <th class="collection-as-table"><&|/l&>Version</&></th>
207 <th class="collection-as-table"><&|/l&>Source</&></th>
208
209
210 <%perl>
211 my $i = 0;
212 my $report = Module::Versions::Report::report();
213 my @report = grep /v\d/, split("\n",$report);
214 shift @report; # throw away the perl version
215 my ($ver, $source, $distfile);
216 foreach my $item (@report) {
217 if ($item =~ /^\s*(.*?)\s*v(\S+);/) {
218     $item = $1;
219     $ver = $2;
220     $distfile = $item.".pm";
221     $distfile =~ s|::|/|g;
222 }
223 </%perl>
224 <tr class="<% $i++ %2 ? 'oddline' : 'evenline'%>">
225 <td class="collection-as-table"><% $item %></td>
226     <td class="collection-as-table">
227         <%$ver%>
228     </td>
229     <td class="collection-as-table">
230         <% $INC{$distfile} %>
231     </td>
232 </tr>
233 % }
234 </table>
235 </&>
236
237 <&|/Widgets/TitleBox, title => loc("Perl configuration") &>
238 % require Config;
239 <pre>
240 <% Config::myconfig() %>
241 </pre>
242 </&>