diff options
author | Ivan Kohler <ivan@freeside.biz> | 2012-06-07 16:55:45 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2012-06-07 16:55:45 -0700 |
commit | c24d6e2242ae0e026684b8f95decf156aba6e75e (patch) | |
tree | 8597d00e2e6bf2cf400437b9344f43b1500da412 /rt/share/html/Elements | |
parent | 6686c29104e555ea23446fe1db330664fa110bc0 (diff) |
rt 4.0.6
Diffstat (limited to 'rt/share/html/Elements')
24 files changed, 111 insertions, 56 deletions
diff --git a/rt/share/html/Elements/CollectionAsTable/Header b/rt/share/html/Elements/CollectionAsTable/Header index 81d8bbb27..20586f9c3 100644 --- a/rt/share/html/Elements/CollectionAsTable/Header +++ b/rt/share/html/Elements/CollectionAsTable/Header @@ -129,11 +129,11 @@ foreach my $col ( @Format ) { if $OrderBy[0] && ($OrderBy[0] eq $attr or "$attr|$OrderBy[0]" =~ /^(Created|id)\|(Created|id)$/); $m->out( - '<a href="' . $BaseURL + '<a href="' . $m->interp->apply_escapes($BaseURL . $m->comp( '/Elements/QueryString', %$generic_query_args, OrderBy => $attr, Order => $new_order - ) + ), 'h') . '">'. loc($title) .'</a>' ); } diff --git a/rt/share/html/Elements/CollectionList b/rt/share/html/Elements/CollectionList index 0c816fe2f..402a272b4 100644 --- a/rt/share/html/Elements/CollectionList +++ b/rt/share/html/Elements/CollectionList @@ -68,7 +68,7 @@ if ( $Rows ) { # collection is ordered or not if ( @OrderBy && ($AllowSorting || !$Collection->{'order_by'}) ) { if ( $OrderBy[0] =~ /\|/ ) { - @OrderBy = split /\|/, $OrderBy[0]; + @OrderBy = grep length($_), split /\|/, $OrderBy[0]; @Order = split /\|/,$Order[0]; } $Collection->OrderByCols( diff --git a/rt/share/html/Elements/CollectionListPaging b/rt/share/html/Elements/CollectionListPaging index b1faa2101..26c082348 100644 --- a/rt/share/html/Elements/CollectionListPaging +++ b/rt/share/html/Elements/CollectionListPaging @@ -55,22 +55,24 @@ $URLParams => undef </%ARGS> <%INIT> +$BaseURL = $m->interp->apply_escapes($BaseURL, 'h'); + $m->out(qq{<div class="paging">}); if ($Pages == 1) { $m->out(loc('Page 1 of 1')); } else{ $m->out(loc('Page') . ' '); -my $prev = $m->comp( +my $prev = $m->interp->apply_escapes($m->comp( '/Elements/QueryString', %$URLParams, Page => ( $CurrentPage - 1 ) - ); -my $next = $m->comp( + ), 'h'); +my $next = $m->interp->apply_escapes($m->comp( '/Elements/QueryString', %$URLParams, Page => ( $CurrentPage + 1 ) - ); + ), 'h'); my %show; $show{1} = 1; $show{$_} = 1 for (($CurrentPage - 2)..($CurrentPage + 2)); @@ -81,7 +83,7 @@ for my $number ( 1 .. $Pages ) { if ( $show{$number} ) { $dots = undef; my $qs = - $m->comp( '/Elements/QueryString', %$URLParams, Page => $number ); + $m->interp->apply_escapes($m->comp( '/Elements/QueryString', %$URLParams, Page => $number ), 'h'); $m->out(qq{<span class="pagenum">}); if ( $number == $CurrentPage ) { $m->out(qq{<span class="currentpage">$number</span> }); diff --git a/rt/share/html/Elements/ColumnMap b/rt/share/html/Elements/ColumnMap index 745e57f83..b9c3b4bc8 100644 --- a/rt/share/html/Elements/ColumnMap +++ b/rt/share/html/Elements/ColumnMap @@ -120,14 +120,16 @@ my $COLUMN_MAP = { my $name = $_[1] || 'SelectedTickets'; my $checked = $m->request_args->{ $name .'All' }? 'checked="checked"': ''; - return \qq{<input type="checkbox" name="${name}All" value="1" $checked - onclick="setCheckbox(this.form, '$name', this.checked)" />}; + return \qq{<input type="checkbox" name="}, $name, \qq{All" value="1" $checked + onclick="setCheckbox(this.form, }, + $m->interp->apply_escapes($name,'j'), + \qq{, this.checked)" />}; }, value => sub { my $id = $_[0]->id; my $name = $_[2] || 'SelectedTickets'; - return \qq{<input type="checkbox" name="$name" value="$id" checked="checked" />} + return \qq{<input type="checkbox" name="}, $name, \qq{" value="$id" checked="checked" />} if $m->request_args->{ $name . 'All'}; my $arg = $m->request_args->{ $name }; @@ -138,7 +140,7 @@ my $COLUMN_MAP = { elsif ( $arg ) { $checked = 'checked="checked"' if $arg == $id; } - return \qq{<input type="checkbox" name="$name" value="$id" $checked />} + return \qq{<input type="checkbox" name="}, $name, \qq{" value="$id" $checked />} }, }, RadioButton => { diff --git a/rt/share/html/Elements/CreateTicket b/rt/share/html/Elements/CreateTicket index 6e541db9b..6702abcbf 100755 --- a/rt/share/html/Elements/CreateTicket +++ b/rt/share/html/Elements/CreateTicket @@ -51,7 +51,7 @@ % my $button_start = '<input type="submit" class="button" value="'; % my $button_end = '" />'; % my $queue_selector = $m->scomp('/Elements/SelectNewTicketQueue', OnChange => 'document.CreateTicketInQueue.submit()', SendTo => $SendTo ); -<&|/l, $button_start, $button_end, $queue_selector &>[_1]New ticket in[_2] [_3]</&> +<&|/l_unsafe, $button_start, $button_end, $queue_selector &>[_1]New ticket in[_2] [_3]</&> % $m->callback(CallbackName => 'BeforeFormEnd'); </form> <%ARGS> diff --git a/rt/share/html/Elements/EditCustomField b/rt/share/html/Elements/EditCustomField index c7c8bfa36..b74c4844e 100644 --- a/rt/share/html/Elements/EditCustomField +++ b/rt/share/html/Elements/EditCustomField @@ -85,7 +85,7 @@ if ($MaxValues == 1 && $Values) { } # The "Magic" hidden input causes RT to know that we were trying to edit the field, even if # we don't see a value later, since browsers aren't compelled to submit empty form fields -$m->out("\n".'<input type="hidden" class="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1" />'."\n"); +$m->out("\n".'<input type="hidden" class="hidden" name="'.$m->interp->apply_escapes($NamePrefix, 'h').$CustomField->Id.'-Values-Magic" value="1" />'."\n"); my $EditComponent = "EditCustomField$Type"; $m->callback( %ARGS, CallbackName => 'EditComponentName', Name => \$EditComponent, CustomField => $CustomField, Object => $Object ); diff --git a/rt/share/html/Elements/EditCustomFieldAutocomplete b/rt/share/html/Elements/EditCustomFieldAutocomplete index aaf551716..911e60707 100644 --- a/rt/share/html/Elements/EditCustomFieldAutocomplete +++ b/rt/share/html/Elements/EditCustomFieldAutocomplete @@ -49,10 +49,10 @@ <textarea cols="<% $Cols %>" rows="<% $Rows %>" name="<% $name %>-Values" id="<% $name %>-Values" class="CF-<%$CustomField->id%>-Edit"><% $Default || '' %></textarea> <script type="text/javascript"> -var id = '<% $name . '-Values' %>'; +var id = <% "$name-Values" |n,j%>; id = id.replace(/:/g,'\\:'); jQuery('#'+id).autocomplete( { - source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Values' %>", + source: <%RT->Config->Get('WebPath') |n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Values" |n,u,j%>, focus: function () { // prevent value inserted on focus return false; @@ -73,10 +73,10 @@ jQuery('#'+id).autocomplete( { % } else { <input type="text" id="<% $name %>-Value" name="<% $name %>-Value" class="CF-<%$CustomField->id%>-Edit" value="<% $Default || '' %>"/> <script type="text/javascript"> -var id = '<% $name . '-Value' %>'; +var id = <% "$name-Value" |n,j%>; id = id.replace(/:/g,'\\:'); jQuery('#'+id).autocomplete( { - source: "<%RT->Config->Get('WebPath')%>/Helpers/Autocomplete/CustomFieldValues?<% $name . '-Value' %>" + source: <%RT->Config->Get('WebPath')|n,j%>+"/Helpers/Autocomplete/CustomFieldValues?"+<% $Context |n,j %>+<% "$name-Value" |n,u,j%> } ); % } @@ -92,6 +92,11 @@ if ( $Multiple and $Values ) { $Default .= $value->Content ."\n"; } } +my $Context = ""; +if ($CustomField->ContextObject) { + $Context .= "ContextId=" . $CustomField->ContextObject->Id . "&"; + $Context .= "ContextType=". ref($CustomField->ContextObject) . "&"; +} </%INIT> <%ARGS> $CustomField => undef diff --git a/rt/share/html/Elements/EditCustomFieldSelect b/rt/share/html/Elements/EditCustomFieldSelect index b3fefbd49..ed6bb146f 100644 --- a/rt/share/html/Elements/EditCustomFieldSelect +++ b/rt/share/html/Elements/EditCustomFieldSelect @@ -55,7 +55,7 @@ % if (!$HideCategory and @category and not $CustomField->BasedOnObj->id) { <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/cascaded.js"></script> %# XXX - Hide this select from w3m? - <select onchange="filter_cascade('<% $id %>-Values', this.value)" name="<% $id %>-Category" class="CF-<%$CustomField->id%>-Edit"> + <select onchange="filter_cascade(<% "$id-Values" |n,j%>, this.value)" name="<% $id %>-Category" class="CF-<%$CustomField->id%>-Edit"> <option value=""<% !$selected && qq[ selected="selected"] |n %>><&|/l&>-</&></option> % foreach my $cat (@category) { % my ($depth, $name) = @$cat; @@ -66,12 +66,12 @@ <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/cascaded.js"></script> <script type="text/javascript"><!-- jQuery( function () { - var basedon = document.getElementById('<% $NamePrefix . $CustomField->BasedOnObj->id %>-Values'); + var basedon = document.getElementById(<% $NamePrefix . $CustomField->BasedOnObj->id . "-Values" |n,j%>); if (basedon != null) { var oldchange = basedon.onchange; basedon.onchange = function () { filter_cascade( - '<% $id %>-Values', + <% "$id-Values" |n,j%>, basedon.value, 1 ); diff --git a/rt/share/html/Elements/Error b/rt/share/html/Elements/Error index 50f3b775c..87dfd0245 100755 --- a/rt/share/html/Elements/Error +++ b/rt/share/html/Elements/Error @@ -81,7 +81,7 @@ Encode::_utf8_off($error); $RT::Logger->error($error); -if ( defined $session{'SessionType'} && $session{'SessionType'} eq 'REST' ) { +if ( $session{'REST'} ) { $r->content_type('text/plain'); $m->out( "Error: " . $Why . "\n" ); $m->out( $Details . "\n" ) if defined $Details && length $Details; diff --git a/rt/share/html/Elements/Header b/rt/share/html/Elements/Header index 5d89fe690..1830c4bf2 100755 --- a/rt/share/html/Elements/Header +++ b/rt/share/html/Elements/Header @@ -87,7 +87,8 @@ my $head = ''; #XXX $head .= <& /Elements/Framekiller &>; if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) { - $head .= qq( <meta http-equiv="refresh" content="$Refresh" /> ); + my $URL = $m->notes->{RefreshURL}; $URL = $URL ? ";URL=$URL" : ""; + $head .= qq( <meta http-equiv="refresh" content="$1$URL" /> ); } my $WebPath = RT->Config->Get('WebPath'); diff --git a/rt/share/html/Elements/HeaderJavascript b/rt/share/html/Elements/HeaderJavascript index e392ac262..28788db57 100644 --- a/rt/share/html/Elements/HeaderJavascript +++ b/rt/share/html/Elements/HeaderJavascript @@ -60,14 +60,14 @@ $onload => undef <script type="text/javascript"><!-- jQuery( loadTitleBoxStates ); % if ( $focus ) { - jQuery(function () { focusElementById('<% $focus %>') }); + jQuery(function () { focusElementById(<% $focus |n,j%>) }); % } % if ( $onload ) { jQuery( <% $onload |n %> ); % } % if ( $RichText and RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'})) { - jQuery().ready(function () { ReplaceAllTextareas('<%$m->request_args->{'CKeditorEncoded'} || 0 %>') }); + jQuery().ready(function () { ReplaceAllTextareas(<%$m->request_args->{'CKeditorEncoded'} || 0 |n,j%>) }); % } --></script> <%ARGS> diff --git a/rt/share/html/Elements/MessageBox b/rt/share/html/Elements/MessageBox index 2943cab4e..61995e057 100755 --- a/rt/share/html/Elements/MessageBox +++ b/rt/share/html/Elements/MessageBox @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<textarea autocomplete="off" class="messagebox" <% $cols |n %> rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">\ +<textarea autocomplete="off" class="messagebox" <% $width_attr %>="<% $Width %>" rows="<% $Height %>" <% $wrap_type |n %> name="<% $Name %>" id="<% $Name %>">\ % $m->comp('/Articles/Elements/IncludeArticle', %ARGS); % $m->callback( %ARGS, SignatureRef => \$signature ); <% $Default || '' %><% $message %><% $signature %></textarea> @@ -68,13 +68,16 @@ if ( $IncludeSignature and my $text = $session{'CurrentUser'}->UserObj->Signatur # wrap="something" seems to really break IE + richtext my $wrap_type = ''; if ( not RT->Config->Get('MessageBoxRichText', $session{'CurrentUser'}) ) { - $wrap_type = qq(wrap="$Wrap"); + $wrap_type = 'wrap="' . $m->interp->apply_escapes($Wrap, 'h') . '"'; } -# If there's no cols specified, we want to set the width to 100% -my $cols = 'style="width: 100%"'; -if ( defined $Width and length $Width ) { - $cols = qq(cols="$Width"); +# If there's no cols specified, we want to set the width to 100% in CSS +my $width_attr; +if ($Width) { + $width_attr = 'cols'; +} else { + $width_attr = 'style'; + $Width = 'width: 100%'; } </%INIT> diff --git a/rt/share/html/Elements/RT__CustomField/ColumnMap b/rt/share/html/Elements/RT__CustomField/ColumnMap index 06e2674ca..ecb219d9e 100644 --- a/rt/share/html/Elements/RT__CustomField/ColumnMap +++ b/rt/share/html/Elements/RT__CustomField/ColumnMap @@ -120,8 +120,10 @@ my $COLUMN_MAP = { my $name = 'RemoveCustomField'; my $checked = $m->request_args->{ $name .'All' }? 'checked="checked"': ''; - return \qq{<input type="checkbox" name="${name}All" value="1" $checked - onclick="setCheckbox(this.form, '$name', this.checked)" />}; + return \qq{<input type="checkbox" name="}, $name, \qq{All" value="1" $checked + onclick="setCheckbox(this.form, }, + $m->interp->apply_escapes($name,'j'), + \qq{, this.checked)" />}; }, value => sub { my $id = $_[0]->id; @@ -137,7 +139,7 @@ my $COLUMN_MAP = { elsif ( $arg ) { $checked = 'checked="checked"' if $arg == $id; } - return \qq{<input type="checkbox" name="$name" value="$id" $checked />} + return \qq{<input type="checkbox" name="}, $name, \qq{" value="$id" $checked />} }, }, MoveCF => { diff --git a/rt/share/html/Elements/RT__Dashboard/ColumnMap b/rt/share/html/Elements/RT__Dashboard/ColumnMap index 8bc4383d8..6c366ec78 100644 --- a/rt/share/html/Elements/RT__Dashboard/ColumnMap +++ b/rt/share/html/Elements/RT__Dashboard/ColumnMap @@ -111,7 +111,7 @@ my $COLUMN_MAP = { } } - return \('<a href="'.$url.'">'.$frequency.'</a>'); + return \'<a href="', $url, \'">', $frequency, \'</a>'; }, }, ShowURL => { diff --git a/rt/share/html/Elements/RT__Queue/ColumnMap b/rt/share/html/Elements/RT__Queue/ColumnMap index 00655c5eb..e08dd7c91 100644 --- a/rt/share/html/Elements/RT__Queue/ColumnMap +++ b/rt/share/html/Elements/RT__Queue/ColumnMap @@ -84,12 +84,16 @@ my $COLUMN_MAP = { title => 'Encrypt', # loc value => sub { return $_[0]->Encrypt? $_[0]->loc('yes') : $_[0]->loc('no') }, }, + Lifecycle => { + title => 'Lifecycle', + attribute => 'Lifecycle', + value => sub { return $_[0]->Lifecycle->Name }, + }, }; foreach my $field (qw( Name Description CorrespondAddress CommentAddress InitialPriority FinalPriority DefaultDueIn - Lifecycle )) { $COLUMN_MAP->{$field} = { title => $field, diff --git a/rt/share/html/Elements/SelectOwner b/rt/share/html/Elements/SelectOwner index cc64e247b..37a5971ac 100755 --- a/rt/share/html/Elements/SelectOwner +++ b/rt/share/html/Elements/SelectOwner @@ -59,8 +59,12 @@ if ($TicketObj) { @objects = ($TicketObj); } elsif ($QueueObj) { @objects = ($QueueObj); -} elsif ($cfqueues) { - @objects = keys %{$cfqueues}; +} elsif (%Queues) { + for my $name (keys %Queues) { + my $q = RT::Queue->new($session{'CurrentUser'}); + $q->Load($name); + push @objects, $q; + } } else { # Let's check rights on an empty queue object. that will do a search # for any queue. @@ -77,5 +81,5 @@ $m->callback( <%ARGS> $TicketObj => undef $QueueObj => undef -$cfqueues => undef +%Queues => () </%ARGS> diff --git a/rt/share/html/Elements/SelectOwnerAutocomplete b/rt/share/html/Elements/SelectOwnerAutocomplete index cf2010a80..81b38386c 100644 --- a/rt/share/html/Elements/SelectOwnerAutocomplete +++ b/rt/share/html/Elements/SelectOwnerAutocomplete @@ -78,7 +78,7 @@ my $query = $m->comp('/Elements/QueryString', <script type="text/javascript"> jQuery(function() { var cache = {}; - jQuery("#<% $Name %>").autocomplete({ + jQuery("#"+<% $Name |n,j%>).autocomplete({ minLength: 2, source: function(request, response) { if ( request.term in cache ) { @@ -86,7 +86,7 @@ my $query = $m->comp('/Elements/QueryString', } else { jQuery.ajax({ - url: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Owners?<% $query|n %>", + url: <% RT->Config->Get('WebPath')|n,j%>+"/Helpers/Autocomplete/Owners?"+<% $query|n,j %>, dataType: "json", data: request, success: function( data ) { diff --git a/rt/share/html/Elements/SelectStatus b/rt/share/html/Elements/SelectStatus index e571baf63..af1ff615f 100755 --- a/rt/share/html/Elements/SelectStatus +++ b/rt/share/html/Elements/SelectStatus @@ -66,6 +66,8 @@ if ( @Statuses ) { } elsif ( $TicketObj ) { my $current = $TicketObj->Status; + push @status, $current; + my $lifecycle = $TicketObj->QueueObj->Lifecycle; my %has = (); @@ -78,8 +80,15 @@ elsif ( $TicketObj ) { } elsif ( $QueueObj ) { @status = $QueueObj->Lifecycle->Transitions(''); -} -else { +} elsif ( %Queues ) { + for my $id (keys %Queues) { + my $queue = RT::Queue->new($session{'CurrentUser'}); + $queue->Load($id); + push @status, $queue->Lifecycle->Valid if $queue->id; + } + my %seen; + @status = grep { not $seen{$_}++ } @status; +} else { @status = RT::Queue->Lifecycle->Valid; } </%INIT> @@ -89,6 +98,7 @@ $Name => undef @Statuses => () $TicketObj => undef $QueueObj => undef +%Queues => () $Default => '' $SkipDeleted => 0 diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index fcd530e95..6059f4ee7 100644 --- a/rt/share/html/Elements/ShowCustomFields +++ b/rt/share/html/Elements/ShowCustomFields @@ -114,12 +114,12 @@ my $print_value = sub { my $vid = $value->id; $m->out( '<div class="object_cf_value_include" id="object_cf_value_'. $vid .'">' ); $m->out( loc("See also:") ); - $m->out( '<a href="'. $value->IncludeContentForValue .'">' ); - $m->out( $value->IncludeContentForValue ); + $m->out( '<a href="'. $m->interp->apply_escapes($value->IncludeContentForValue, 'h') .'">' ); + $m->out( $m->interp->apply_escapes($value->IncludeContentForValue, 'h') ); $m->out( qq{</a></div>\n} ); - $m->out( qq{<script><!--\njQuery('#object_cf_value_$vid').load('} ); - $m->out( $value->IncludeContentForValue ); - $m->out( qq{');\n--></script>\n} ); + $m->out( qq{<script><!--\njQuery('#object_cf_value_$vid').load(} ); + $m->out( $m->interp->apply_escapes($value->IncludeContentForValue, 'j') ); + $m->out( qq{);\n--></script>\n} ); } }; diff --git a/rt/share/html/Elements/ShowLink b/rt/share/html/Elements/ShowLink index 8913a32fb..1727fa397 100644 --- a/rt/share/html/Elements/ShowLink +++ b/rt/share/html/Elements/ShowLink @@ -45,7 +45,7 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<a href="<%$URI->Resolver->HREF%>"> +<a href="<% $href %>"> % if ($URI->IsLocal) { % my $member = $URI->Object; % my $has_name = UNIVERSAL::can($member, 'Name') || (UNIVERSAL::can($member, '_Accessible') && $member->_Accessible('Name', 'read')); @@ -69,3 +69,12 @@ <%ARGS> $URI => undef </%ARGS> + +<%INIT> +my $href = $URI->Resolver->HREF; +if ( $URI->IsLocal ) { + my $base = RT->Config->Get('WebBaseURL'); + # URI->rel doesn't contain the leading '/' + $href = '/' . URI->new($href)->rel($base); +} +</%INIT> diff --git a/rt/share/html/Elements/ShowSearch b/rt/share/html/Elements/ShowSearch index 2b23181c2..4b96bbfda 100644 --- a/rt/share/html/Elements/ShowSearch +++ b/rt/share/html/Elements/ShowSearch @@ -64,12 +64,12 @@ my $query_link_url = RT->Config->Get('WebPath').'/Search/Results.html'; if ($SavedSearch) { my ( $container_object, $search_id ) = _parse_saved_search($SavedSearch); unless ( $container_object ) { - $m->out(loc("Either you have no rights to view saved search [_1] or identifier is incorrect", $SavedSearch)); + $m->out(loc("Either you have no rights to view saved search [_1] or identifier is incorrect", $m->interp->apply_escapes($SavedSearch, 'h'))); return; } $search = $container_object->Attributes->WithId($search_id); unless ( $search->Id && ref( $SearchArg = $search->Content ) eq 'HASH' ) { - $m->out(loc("Saved Search [_1] not found", $SavedSearch)) unless $IgnoreMissing; + $m->out(loc("Saved Search [_1] not found", $m->interp->apply_escapes($SavedSearch, 'h'))) unless $IgnoreMissing; return; } $SearchArg->{'SavedSearchId'} ||= $SavedSearch; @@ -79,7 +79,7 @@ if ($SavedSearch) { # XXX: dispatch to different handler here $query_display_component = '/Search/Elements/' . $SearchArg->{SearchType}; - $query_link_url = RT->Config->Get('WebURL') . "/Search/$SearchArg->{SearchType}.html"; + $query_link_url = RT->Config->Get('WebPath') . "/Search/$SearchArg->{SearchType}.html"; } elsif ($ShowCustomize) { $customize = RT->Config->Get('WebPath') . '/Search/Build.html?' . $m->comp( '/Elements/QueryString', @@ -93,7 +93,7 @@ if ($SavedSearch) { if ($custom->Description eq $Name) { $search = $custom; last } } unless ($search && $search->id) { - $m->out("Predefined search $Name not found"); + $m->out(loc("Predefined search [_1] not found", $m->interp->apply_escapes($Name, 'h'))); return; } } diff --git a/rt/share/html/Elements/ShowUser b/rt/share/html/Elements/ShowUser index 044ec4c84..365497765 100644 --- a/rt/share/html/Elements/ShowUser +++ b/rt/share/html/Elements/ShowUser @@ -51,7 +51,7 @@ # $Address is Email::Address object my $comp = '/Elements/ShowUser'. ucfirst lc $style; -unless ( $m->comp_exists( $comp ) ) { +unless ( RT::Interface::Web->ComponentPathIsSafe($comp) and $m->comp_exists( $comp ) ) { $RT::Logger->error( 'Either system config or user #' . $session{'CurrentUser'}->id diff --git a/rt/share/html/Elements/Submit b/rt/share/html/Elements/Submit index cbf3f58e8..b7840d34b 100755 --- a/rt/share/html/Elements/Submit +++ b/rt/share/html/Elements/Submit @@ -52,10 +52,10 @@ id="<%$id%>" > <div class="extra-buttons"> % if ($CheckAll) { - <input type="button" value="<%$CheckAllLabel%>" onclick="setCheckbox(this.form, <% length $CheckboxName ? qq{'$CheckboxName'} : length $CheckboxNameRegex ? $CheckboxNameRegex : q{''} %>, true);return false;" class="button" /> + <input type="button" value="<%$CheckAllLabel%>" onclick="setCheckbox(this.form, <% $match %>, true);return false;" class="button" /> % } % if ($ClearAll) { - <input type="button" value="<%$ClearAllLabel%>" onclick="setCheckbox(this.form, <% length $CheckboxName ? qq{'$CheckboxName'} : length $CheckboxNameRegex ? $CheckboxNameRegex : q{''} %>, false);return false;" class="button" /> + <input type="button" value="<%$ClearAllLabel%>" onclick="setCheckbox(this.form, <% $match %>, false);return false;" class="button" /> % } % if ($Reset) { <input type="reset" value="<%$ResetLabel%>" class="button" /> @@ -115,3 +115,13 @@ $ResetLabel => loc('Reset') $SubmitId => undef $id => undef </%ARGS> +<%init> +my $match; +if (length $CheckboxName) { + $match = $m->interp->apply_escapes($CheckboxName,'j'); +} elsif (length $CheckboxNameRegex) { + $match = $CheckboxNameRegex; +} else { + $match = q{''}; +} +</%init> diff --git a/rt/share/html/Elements/Tabs b/rt/share/html/Elements/Tabs index 75b8160da..3193b488d 100755 --- a/rt/share/html/Elements/Tabs +++ b/rt/share/html/Elements/Tabs @@ -734,6 +734,9 @@ my $build_main_nav = sub { $current_search_menu->child( bulk => title => loc('Bulk Update'), path => "/Search/Bulk.html$args" ); $current_search_menu->child( chart => title => loc('Chart'), path => "/Search/Chart.html$args" ); + #formerly Callbacks/RTx-Calendar/Ticket/Element/Tabs/Default + $current_search_menu->child( calendar => title => loc('Calendar'), path => "/Search/Calendar.html$args" ); + my $more = $current_search_menu->child( more => title => loc('Feeds') ); $more->child( tsv => title => loc('TSV'), path => "/Search/Results.tsv$args" ); |