summaryrefslogtreecommitdiff
path: root/rt/share/html/Widgets
diff options
context:
space:
mode:
Diffstat (limited to 'rt/share/html/Widgets')
-rw-r--r--rt/share/html/Widgets/BulkEdit2
-rw-r--r--rt/share/html/Widgets/BulkProcess2
-rw-r--r--rt/share/html/Widgets/ComboBox6
-rw-r--r--rt/share/html/Widgets/FinalizeWidgetArguments9
-rw-r--r--rt/share/html/Widgets/Form/Boolean4
-rw-r--r--rt/share/html/Widgets/Form/Integer13
-rw-r--r--rt/share/html/Widgets/Form/Select6
-rw-r--r--rt/share/html/Widgets/Form/String4
-rw-r--r--rt/share/html/Widgets/SavedSearch10
-rw-r--r--rt/share/html/Widgets/SelectionBox2
-rw-r--r--rt/share/html/Widgets/TitleBox10
-rwxr-xr-xrt/share/html/Widgets/TitleBoxEnd2
-rwxr-xr-xrt/share/html/Widgets/TitleBoxStart27
13 files changed, 54 insertions, 43 deletions
diff --git a/rt/share/html/Widgets/BulkEdit b/rt/share/html/Widgets/BulkEdit
index 47388e280..de6126ac2 100644
--- a/rt/share/html/Widgets/BulkEdit
+++ b/rt/share/html/Widgets/BulkEdit
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
diff --git a/rt/share/html/Widgets/BulkProcess b/rt/share/html/Widgets/BulkProcess
index e7881e60b..2a2689086 100644
--- a/rt/share/html/Widgets/BulkProcess
+++ b/rt/share/html/Widgets/BulkProcess
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
diff --git a/rt/share/html/Widgets/ComboBox b/rt/share/html/Widgets/ComboBox
index 6d4e9f75f..69ac0793b 100644
--- a/rt/share/html/Widgets/ComboBox
+++ b/rt/share/html/Widgets/ComboBox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -56,7 +56,7 @@ my $z_index = 9999;
<div id="<% $Name %>_Container" class="combobox <%$Class%>" style="z-index: <%$z_index--%>">
<input name="<% $Name %>" id="<% $Name %>" class="combo-text" value="<% $Default || '' %>" type="text" <% $Size ? "size='$Size'" : '' |n %> autocomplete="off" />
-<br style="display: none" /><span id="<% $Name %>_Button" class="combo-button">&#9660;</span><select name="List-<% $Name %>" id="<% $Name %>_List" class="combo-list" onchange="ComboBox_SimpleAttach(this, this.form['<% $Name %>']); " size="<% $Rows %>">
+<br style="display: none" /><span id="<% $Name %>_Button" class="combo-button">&#9660;</span><select name="List-<% $Name %>" id="<% $Name %>_List" class="combo-list" onchange="ComboBox_SimpleAttach(this, this.form[<% $Name |n,j%>]); " size="<% $Rows %>">
<option style="display: none" value="">-</option>
% foreach my $value (@Values) {
<option value="<%$value%>"><% $value%></option>
@@ -64,7 +64,7 @@ my $z_index = 9999;
</select>
</div>
<script language="javascript"><!--
-ComboBox_InitWith('<% $Name %>');
+ComboBox_InitWith(<% $Name |n,j %>);
//--></script>
</nobr>
<%ARGS>
diff --git a/rt/share/html/Widgets/FinalizeWidgetArguments b/rt/share/html/Widgets/FinalizeWidgetArguments
index 00fa82ebe..39cea5cfc 100644
--- a/rt/share/html/Widgets/FinalizeWidgetArguments
+++ b/rt/share/html/Widgets/FinalizeWidgetArguments
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -52,9 +52,10 @@
$args{'Description'} = loc( $args{'Description'} ) if $args{'Description'};
$args{'Hints'} = loc( $args{'Hints'} ) if $args{'Hints'};
if ( $args{'ValuesLabel'} ) {
- while (my ($k, $v) = each %{ $args{'ValuesLabel'} } ) {
- $args{'ValuesLabel'}->{$k} = loc( $args{'ValuesLabel'}->{$k} );
- }
+ my %labels;
+ $labels{$_} = loc( $args{'ValuesLabel'}->{$_} )
+ for keys %{$args{'ValuesLabel'}};
+ $args{'ValuesLabel'} = \%labels;
}
return \%args;
</%init>
diff --git a/rt/share/html/Widgets/Form/Boolean b/rt/share/html/Widgets/Form/Boolean
index 1d6c8821d..62890df0a 100644
--- a/rt/share/html/Widgets/Form/Boolean
+++ b/rt/share/html/Widgets/Form/Boolean
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<%DOC>
-see docs/using_forms_widgets.pod
+see docs/extending/using_forms_widgets.pod
</%DOC>
<div id="form-box-<% lc $Name %>" class="widget">
<span class="label description"><% $Description %></span>
diff --git a/rt/share/html/Widgets/Form/Integer b/rt/share/html/Widgets/Form/Integer
index ac349e866..b8d8f90bf 100644
--- a/rt/share/html/Widgets/Form/Integer
+++ b/rt/share/html/Widgets/Form/Integer
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<%DOC>
-see docs/using_forms_widgets.pod
+see docs/extending/using_forms_widgets.pod
</%DOC>
<div id="form-box-<% lc $Name %>" class="widget">
<span class="label description"><% $Description %></span>
@@ -57,6 +57,8 @@ see docs/using_forms_widgets.pod
<span class="hints"><% $Hints %></span>
</div>
<%INIT>
+$_ = '' foreach grep !defined, $CurrentValue, $DefaultValue;
+$DefaultLabel ||= loc( 'Default: [_1]', $DefaultValue );
</%INIT>
<%ARGS>
$Name
@@ -68,15 +70,18 @@ $CurrentValue => '',
$Default => 0,
$DefaultValue => 0,
-$DefaultLabel => loc( 'Default: [_1]', $DefaultValue ),
+$DefaultLabel => undef
</%ARGS>
<%METHOD InputOnly>
-<input type="text" name="<% $Name %>" value="<% $CurrentValue || '' %>" />\
+<input type="text" name="<% $Name %>" value="<% $CurrentValue %>" />\
<%ARGS>
$Name
$CurrentValue => '',
</%ARGS>
+<%INIT>
+$CurrentValue = '' unless defined $CurrentValue;
+</%INIT>
</%METHOD>
<%METHOD Process>
diff --git a/rt/share/html/Widgets/Form/Select b/rt/share/html/Widgets/Form/Select
index 626ee2bd1..438f9ccd7 100644
--- a/rt/share/html/Widgets/Form/Select
+++ b/rt/share/html/Widgets/Form/Select
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,17 +46,19 @@
%#
%# END BPS TAGGED BLOCK }}}
<%DOC>
-see docs/using_forms_widgets.pod
+see docs/extending/using_forms_widgets.pod
</%DOC>
<div id="form-box-<% lc $Name %>" class="widget">
% if ( $Description ) {
<span class="label"><% $Description %></span>
% }
<span class="value"><& SELF:InputOnly, %ARGS &></span>
+<span class="hints"><% $Hints %></span>
</div>
<%ARGS>
$Name
$Description => undef,
+$Hints => ''
</%ARGS>
<%METHOD InputOnly>
diff --git a/rt/share/html/Widgets/Form/String b/rt/share/html/Widgets/Form/String
index 4a7c60fce..a5b3c6c22 100644
--- a/rt/share/html/Widgets/Form/String
+++ b/rt/share/html/Widgets/Form/String
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,7 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<%DOC>
-see docs/using_forms_widgets.pod
+see docs/extending/using_forms_widgets.pod
</%DOC>
<div id="form-box-<% lc $Name %>" class="widget">
<span class="description label"><% $Description %></span>
diff --git a/rt/share/html/Widgets/SavedSearch b/rt/share/html/Widgets/SavedSearch
index fe75a75b3..5d3a828e3 100644
--- a/rt/share/html/Widgets/SavedSearch
+++ b/rt/share/html/Widgets/SavedSearch
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -55,10 +55,6 @@ return \%ARGS;
<%init>
my @actions;
-my @Objects = RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects;
-push @Objects, RT::System->new($session{'CurrentUser'})
- if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
- Right => 'SuperUser' );
$self->{SearchId} ||= $args->{'SavedChartSearchId'} || 'new';
my $SearchParams = { map { $_ => $args->{$_} } @{$self->{SearchFields}} };
@@ -90,6 +86,10 @@ if ( my ( $container_object, $search_id ) = _parse_saved_search(
# look for the current one in the available saved searches
if ($self->{SearchId} eq 'new') {
+ my @Objects = RT::SavedSearch->new( $session{CurrentUser} )->ObjectsForLoading;
+ push @Objects, RT::System->new($session{'CurrentUser'})
+ if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
+ Right => 'SuperUser' );
for my $obj (@Objects) {
for ( $m->comp( "/Search/Elements/SearchesForObject", Object => $obj ) ) {
my ( $desc, $search ) = @$_;
diff --git a/rt/share/html/Widgets/SelectionBox b/rt/share/html/Widgets/SelectionBox
index b4e275638..979adc927 100644
--- a/rt/share/html/Widgets/SelectionBox
+++ b/rt/share/html/Widgets/SelectionBox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
diff --git a/rt/share/html/Widgets/TitleBox b/rt/share/html/Widgets/TitleBox
index 703e2a82d..3c044b698 100644
--- a/rt/share/html/Widgets/TitleBox
+++ b/rt/share/html/Widgets/TitleBox
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,9 +46,13 @@
%#
%# END BPS TAGGED BLOCK }}}
<div class="<% $class %>">
- <& TitleBoxStart, %ARGS &><% $m->content | n %><& TitleBoxEnd &>
+ <& TitleBoxStart, %ARGS &><% $content | n %><& TitleBoxEnd &>
</div>
<%ARGS>
$class => ''
+$hide_empty => 0
</%ARGS>
-
+<%INIT>
+my $content = $m->content;
+return if $hide_empty && $content =~ /^\s*$/s;
+</%INIT>
diff --git a/rt/share/html/Widgets/TitleBoxEnd b/rt/share/html/Widgets/TitleBoxEnd
index d39512042..009717e61 100755
--- a/rt/share/html/Widgets/TitleBoxEnd
+++ b/rt/share/html/Widgets/TitleBoxEnd
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
diff --git a/rt/share/html/Widgets/TitleBoxStart b/rt/share/html/Widgets/TitleBoxStart
index 492cfab0b..cbcc5c3d5 100755
--- a/rt/share/html/Widgets/TitleBoxStart
+++ b/rt/share/html/Widgets/TitleBoxStart
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -45,24 +45,20 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<div class="titlebox<% $class ? " $class " : '' %>" id="<% $id %>">
+<div class="titlebox<% $class ? " $class " : '' %><% $rolledup ? " rolled-up" : ""%>" id="<% $id %>">
<div class="titlebox-title<% $title_class ? " $title_class" : ''%>">
% if ($hideable) {
- <span class="widget"><a href="#"
- onclick="return rollup('<%$tid%>');"
- title="Toggle visibility"></a>
- </span>
+ <span class="widget"><a href="#" onclick="return rollup(<%$tid|n,j%>);" title="Toggle visibility"></a></span>
% }
- <span class="left">
- <% $title_href ? qq[<a href="$title_href">] : '' | n
+ <span class="left"><%
+ $title_href ? qq[<a href="$title_href">] : '' | n
%><% $title %><% $title_raw |n %><% $title_href ? "</a>" : '' |n%></span>
- <span class="right<%($titleright_href || $titleright || $titleright_raw) ? '' : '-empty' %>">
- <% $titleright_href ? qq[<a href="$titleright_href">] : '' | n %>
- <% $titleright %><% $titleright_raw |n%><% $titleright_href ? "</a>" : '' |n%>
+ <span class="right<%($titleright_href || $titleright || $titleright_raw) ? '' : '-empty' %>">\
+ <% $titleright_href ? qq[<a href="$titleright_href">] : '' | n %>\
+ <% $titleright %><% $titleright_raw |n%><% $titleright_href ? "</a>" : '' |n%>\
</span>
</div>
- <div class="titlebox-content <% $bodyclass %>" id="<% $tid %>">
-
+ <div class="titlebox-content <% $bodyclass %><% $rolledup ? " hidden" : ""%>" id="<% $tid %>">
<%ARGS>
$class => ''
$bodyclass => ''
@@ -75,9 +71,11 @@ $titleright => ''
$titleright_raw => ''
$id => ''
$hideable => 1
+$rolledup => 0
</%ARGS>
<%init>
+$hideable = 1 if $rolledup;
#
# This should be pretty bulletproof
#
@@ -88,7 +86,8 @@ my $title_b64 = MIME::Base64::encode_base64(Encode::encode_utf8($title), '');
my $tid = "TitleBox--$page--" .
join '--', ($class, $bodyclass, $title_b64, $id);
-$tid =~ s{[^A-Za-z0-9\-_:\.]+}{_}g;
+# Replace anything that ISN'T alphanumeric, a hyphen, or an underscore
+$tid =~ s{[^A-Za-z0-9\-_]}{_}g;
my $i = 0;
$i++ while $m->notes("$tid-$i");