summaryrefslogtreecommitdiff
path: root/rt/html
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html')
-rw-r--r--rt/html/Approvals/Elements/PendingMyApproval1
-rw-r--r--rt/html/Elements/Callback4
-rw-r--r--rt/html/Elements/CollectionAsTable/Row1
-rw-r--r--rt/html/Elements/EditCustomField4
-rw-r--r--rt/html/Elements/EditCustomFieldSelect3
-rw-r--r--rt/html/Elements/FreesideInvoiceSearch20
-rw-r--r--rt/html/Elements/FreesideNewCust3
-rw-r--r--rt/html/Elements/FreesideSearch11
-rw-r--r--rt/html/Elements/FreesideSvcSearch11
-rw-r--r--rt/html/Elements/Header20
-rw-r--r--rt/html/Elements/PageLayout29
-rw-r--r--rt/html/Elements/QueryString6
-rw-r--r--rt/html/Elements/RT__Ticket/ColumnMap3
-rw-r--r--rt/html/Elements/ScrubHTML2
-rw-r--r--rt/html/Elements/ShowCustomFields3
-rw-r--r--rt/html/Elements/SimpleSearch13
-rw-r--r--rt/html/Elements/Tabs12
-rw-r--r--rt/html/Elements/TitleBoxStart2
-rw-r--r--rt/html/NoAuth/printrt.css77
-rw-r--r--rt/html/NoAuth/webrt.css200
-rw-r--r--rt/html/Search/Build.html488
-rw-r--r--rt/html/Search/Bulk.html2
-rw-r--r--rt/html/Search/Elements/BuildFormatString6
-rw-r--r--rt/html/Search/Results.rdf2
-rw-r--r--rt/html/Search/Results.tsv2
-rw-r--r--rt/html/Ticket/Elements/EditCustomFields3
-rw-r--r--rt/html/Ticket/Elements/EditCustomers2
-rw-r--r--rt/html/Ticket/Elements/ShowTransactionAttachments9
-rw-r--r--rt/html/User/Elements/Tabs3
29 files changed, 596 insertions, 346 deletions
diff --git a/rt/html/Approvals/Elements/PendingMyApproval b/rt/html/Approvals/Elements/PendingMyApproval
index f13ddf0f3..8d19399ab 100644
--- a/rt/html/Approvals/Elements/PendingMyApproval
+++ b/rt/html/Approvals/Elements/PendingMyApproval
@@ -77,6 +77,7 @@ $tickets->LimitOwner( VALUE => $session{'CurrentUser'}->Id );
# also consider AdminCcs as potential approvers.
my $group_tickets = RT::Tickets->new( $session{'CurrentUser'} );
+$group_tickets->LimitWatcher( VALUE => $session{'CurrentUser'}->UserObj->EmailAddress, TYPE => 'AdminCc' );
my $created_before = RT::Date->new( $session{'CurrentUser'} );
my $created_after = RT::Date->new( $session{'CurrentUser'} );
diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback
index 937e923a1..c7aeb9f5d 100644
--- a/rt/html/Elements/Callback
+++ b/rt/html/Elements/Callback
@@ -68,14 +68,14 @@ if (!$callbacks) {
push @$callbacks,
# Skip backup files, files without a leading package name,
# and files we've already seen
- grep { !/^\.|~$/
+ grep { !/\/\.|~$/
and $_ ne "/Callbacks/$Page/$_CallbackName"
and not $seen{$_}++ }
$m->interp->resolver->glob_path($path, $root);
}
$m->notes($CacheKey => $callbacks);
- $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode;
+ $cache{$CacheKey} = $callbacks if !$RT::DevelMode;
}
my @rv;
diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row
index 3316bc027..0de362ea8 100644
--- a/rt/html/Elements/CollectionAsTable/Row
+++ b/rt/html/Elements/CollectionAsTable/Row
@@ -71,6 +71,7 @@ foreach my $column (@Format) {
$item++;
$m->out('<td class="collection-as-table" ');
$m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} );
+ $m->out( 'style="' . $column->{style} . '"' ) if ( $column->{style} );
$m->out('>');
foreach my $subcol ( @{ $column->{output} } ) {
if ( $subcol =~ /^__(.*?)__$/o ) {
diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField
index d2398c9da..e443c764e 100644
--- a/rt/html/Elements/EditCustomField
+++ b/rt/html/Elements/EditCustomField
@@ -49,6 +49,10 @@ if ($Object) {
$Values = $Object->CustomFieldValues($CustomField->id);
$Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) );
$NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', '');
+} elsif (not $Default) {
+ my %TOP = $m->request_args;
+ $Default = $TOP{ $NamePrefix .$CustomField->Id . '-Values' }
+ || $TOP{ $NamePrefix .$CustomField->Id . '-Value' };
}
my $Type = $CustomField->Type;
diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect
index db33a6839..2a2a64a1d 100644
--- a/rt/html/Elements/EditCustomFieldSelect
+++ b/rt/html/Elements/EditCustomFieldSelect
@@ -53,7 +53,8 @@
% if ($Values) {
<% $Values->HasEntry($value->Name) && ($selected = 1) && 'SELECTED' %>
% } elsif ($Default) {
- <% ($Default eq $value->Name) && ($selected = 1) && 'SELECTED' %>
+ <% (ref $Default ? (grep {$_ eq $value->Name} @{$Default}) : ($Default eq $value->Name))
+ && ($selected = 1) && 'SELECTED' %>
% }
><% $value->Name%></option>
% }
diff --git a/rt/html/Elements/FreesideInvoiceSearch b/rt/html/Elements/FreesideInvoiceSearch
new file mode 100644
index 000000000..3842b2ff9
--- /dev/null
+++ b/rt/html/Elements/FreesideInvoiceSearch
@@ -0,0 +1,20 @@
+% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) {
+
+ <form action="<% $RT::URI::freeside::URL %>/search/cust_bill.html" STYLE="margin:0">
+ <SCRIPT TYPE="text/javascript">
+ function clearhint_search_invoice (what) {
+ if ( what.value == '(inv #)' )
+ what.value = '';
+ }
+ </SCRIPT>
+ <input name="invnum" accesskey="0" VALUE="(inv #)" SIZE="4" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" STYLE="text-align:right; margin-bottom:1px; font-family: Arial, Verdana, Helvetica, sans-serif;">
+
+% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) {
+ <A HREF="<% $RT::URI::freeside::URL %>search/report_cust_bill.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A>
+% }
+ <BR>
+
+ <input type="submit" value="<&|/l&>Search invoices</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+ </form>
+
+% }
diff --git a/rt/html/Elements/FreesideNewCust b/rt/html/Elements/FreesideNewCust
new file mode 100644
index 000000000..c752437da
--- /dev/null
+++ b/rt/html/Elements/FreesideNewCust
@@ -0,0 +1,3 @@
+<form action="<% $RT::URI::freeside::URL %>/edit/cust_main.cgi" STYLE="margin:0">
+<INPUT TYPE="submit" VALUE="<&|/l&>New customer</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;">&nbsp;
+</FORM>
diff --git a/rt/html/Elements/FreesideSearch b/rt/html/Elements/FreesideSearch
new file mode 100644
index 000000000..2fed8fc73
--- /dev/null
+++ b/rt/html/Elements/FreesideSearch
@@ -0,0 +1,11 @@
+<form action="<% $RT::URI::freeside::URL %>/search/cust_main.cgi" STYLE="margin:0">
+ <SCRIPT TYPE="text/javascript">
+ function clearhint_search_cust (what) {
+ if ( what.value == '(cust #, name, company or phone)' )
+ what.value = '';
+ }
+ </SCRIPT>
+<input name="search_cust" accesskey="0" VALUE="(cust #, name, company or phone)" SIZE="28" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
+<A NOTYET="<% $RT::URI::freeside::URL %>/search/cust_main.html" STYLE="color: #000000; font-size: 70%; font-weight:normal">Advanced</A>
+<input type="submit" value="<&|/l&>Search customers</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+</form>
diff --git a/rt/html/Elements/FreesideSvcSearch b/rt/html/Elements/FreesideSvcSearch
new file mode 100644
index 000000000..4a5942421
--- /dev/null
+++ b/rt/html/Elements/FreesideSvcSearch
@@ -0,0 +1,11 @@
+<form action="<% $RT::URI::freeside::URL %>/search/cust_svc.html" STYLE="margin:0">
+ <SCRIPT TYPE="text/javascript">
+ function clearhint_search_svc (what) {
+ if ( what.value == '(user, user@domain or domain)' )
+ what.value = '';
+ }
+ </SCRIPT>
+<input name="search_svc" accesskey="0" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
+ <A NOTYET="<% $RT::URI::freeside::URL %>search/svc_Smarter.html" STYLE="color: #000000; font-size: 70%; font-weight:normal">Advanced</A>
+<input type="submit" value="<&|/l&>Search services</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%">
+</form>
diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header
index a2563fee3..b5512aae9 100644
--- a/rt/html/Elements/Header
+++ b/rt/html/Elements/Header
@@ -47,12 +47,14 @@
<HTML>
<HEAD>
<TITLE><%$Title%></TITLE>
-% if ($Refresh > 0) {
+% if ($Refresh && $Refresh > 0) {
<META HTTP-EQUIV="REFRESH" CONTENT="<%$Refresh%>">
% }
-<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png">
-<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
+<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png" />
+<link media="all" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css" />
+<link media="print" rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/printrt.css" type="text/css" />
+
<script>
function hideshow(num) {
idstring = "element-" + num;
@@ -67,7 +69,7 @@ function hideshow(num) {
</script>
<& /Elements/Callback, _CallbackName => 'Head', %ARGS &>
</HEAD>
-<BODY BGCOLOR="<%$BgColor%>"
+<BODY BACKGROUND="<% $RT::URI::freeside::URL %>/images/background-cheat.png" STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0"
% if ($Focus) {
ONLOAD="
var tmp = (document.getElementsByName('<% $Focus %>'));
@@ -75,13 +77,15 @@ ONLOAD="
"
% }
>
-<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
+<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" STYLE="padding-left:0; padding-right:4">
<tr>
<td colspan=2 rowspan=2><img border=0 alt="freeside" src="<%$RT::WebImagesURL%>/small-logo.png" width="92" height="62"></td>
- <td align="left" rowspan=2><font size=6><% &RT::URI::freeside::FreesideGetConfig('company_name') %> Ticketing</font></td>
+ <td align="left" rowspan=2><font size=6><% &RT::URI::freeside::FreesideGetConfig('company_name') || 'ExampleCo' %></font></td>
<td align="right" valign="top">
% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) {
<SPAN STYLE="display: none"><A HREF="#skipnav"><&|/l&>Skip Menu</&></A> |</SPAN>
+<&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&>
+<BR>
%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) {
<A HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A>
% }
@@ -89,8 +93,6 @@ ONLOAD="
% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) {
| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a>
% }
-<BR>
-<&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&>
% } else {
<&|/l&>Not logged in.</&>
% }
@@ -105,7 +107,7 @@ ONLOAD="
<td align=right>
<FONT SIZE="-3">
<A HREF="http://www.sisd.com/freeside">Freeside</A>&nbsp;v<% &RT::URI::freeside::FreesideVersion() %><BR>
- <A HREF="../docs/">Documentation</A><BR>
+ <A HREF="<% FS::Conf->new->config('support-key') ? "http://www.sisd.com/mediawiki/index.php/Supported:Documentation" : "http://www.sisd.com/mediawiki/index.php/Freeside:1.7:Documentation" %>">Documentation</A><BR>
</FONT>
</td>
<td bgcolor=#000000></td>
diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout
index 94bdbe194..f13ee0dda 100644
--- a/rt/html/Elements/PageLayout
+++ b/rt/html/Elements/PageLayout
@@ -43,32 +43,43 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<table class="lightgray" border=0 cellspacing=0 cellpadding=0 width="100%">
- <th class="lightgray" align="left" width=42%><span class="rtname"><%$AppName%></span>
- </th>
+<table class="black" border=0 cellspacing=0 cellpadding=0 width="100%">
+<tr>
+ <TD colspan=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
+</tr>
+<tr>
+%# <th class="black" align="left" width=15%><span class="rtname"><%$AppName%></span>
+%# </th>
<span class="topactions">
-% foreach my $action (sort keys %{$topactions}) {
- <td class="lightgrayright">
+% my $notfirst = 0; foreach my $action (sort keys %{$topactions}) {
+ <td class="blackright" ALIGN="right" VALIGN="center">
<%$topactions->{"$action"}->{'html'} |n %>
</td>
% }
</span>
+</tr>
</table>
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="100%">
+<TR>
+ <TD BGCOLOR="#000000" STYLE="padding:0" WIDTH="154"></TD>
+ <TD STYLE="padding:0" WIDTH="13"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-corner.png"></TD>
+ <TD STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-top.png" HEIGHT="13" WIDTH="100%"></TD>
+</TR>
%# Vertical menu
<TR height="100%">
-<TD valign="top" width="140" class="lightgray">
+<TD valign="top" width="140" class="black">
<& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &>
</TD>
+<TD STYLE="padding:0" HEIGHT="100%" WIDTH=13 VALIGN="top"><IMG WIDTH="13" HEIGHT="100%" BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>/images/black-gray-side.png"></TD>
<td valign="top">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
- <td class="mediumgray" valign="top">
+ <td class="<% $actions ? 'darkmediumgray' : 'bggray' %>" valign="top">
<span class="title"><%$title%></span>
</td>
</tr>
<tr>
-<td class="mediumgrayright" valign="top">
+<td class="<% $actions ? 'darkmediumgrayright' : 'bggrayright' %>" valign="top">
<span class="nav">
% if ($actions) {
% my @actions;
@@ -80,7 +91,7 @@
% }
% }
%#<% join(" | ", @actions) | n %>
-<% '['. join("] [", @actions). ']' | n %>
+<% '['. join("] [", @actions). ']&nbsp;' | n %>
% if ($subactions) {
% my @actions;
% foreach my $action (sort keys %{$subactions}) {
diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString
index 7d41f15e0..1ddab85de 100644
--- a/rt/html/Elements/QueryString
+++ b/rt/html/Elements/QueryString
@@ -45,8 +45,12 @@
%# END BPS TAGGED BLOCK }}}
<%init>
my @params;
-while ( (my $key, my $value) = each %ARGS ){
+while ( my ($key, $value) = each %ARGS ){
+ if( UNIVERSAL::isa( $value, 'ARRAY' ) ) {
+ push @params, map $key."=".$m->interp->apply_escapes($_,'u'), @$value;
+ } else {
push @params, $key."=".$m->interp->apply_escapes($value,'u');
+ }
}
return(join('&',@params));
</%init>
diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap
index dade91494..80e3c693c 100644
--- a/rt/html/Elements/RT__Ticket/ColumnMap
+++ b/rt/html/Elements/RT__Ticket/ColumnMap
@@ -95,6 +95,7 @@ sub LinkCallback {
my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode};
my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type};
+ my $other_mode = ($mode eq "Target" ? "Base" : "Target");
my $mode_uri = $mode.'URI';
my $local_type = 'Local'.$mode;
@@ -105,7 +106,7 @@ sub LinkCallback {
\'">',
( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ),
\'</A><BR>',
- } @{ $_[0]->Links($mode,$type)->ItemsArrayRef }
+ } @{ $_[0]->Links($other_mode,$type)->ItemsArrayRef }
}
}
diff --git a/rt/html/Elements/ScrubHTML b/rt/html/Elements/ScrubHTML
index 94a729907..443ded9c4 100644
--- a/rt/html/Elements/ScrubHTML
+++ b/rt/html/Elements/ScrubHTML
@@ -62,7 +62,7 @@ $scrubber->default(
$scrubber->deny(qw[*]);
$scrubber->allow(
- qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD]);
+ qw[A B U P BR I HR BR SMALL EM FONT SPAN DIV UL OL LI DL DT DD PRE]);
$scrubber->comment(0);
return ( $scrubber->scrub($Content) );
</%init>
diff --git a/rt/html/Elements/ShowCustomFields b/rt/html/Elements/ShowCustomFields
index 7591fa3aa..986184120 100644
--- a/rt/html/Elements/ShowCustomFields
+++ b/rt/html/Elements/ShowCustomFields
@@ -71,6 +71,9 @@
</table>
<%INIT>
my $CustomFields = $Object->CustomFields;
+ $m->comp('/Elements/Callback', _CallbackName => 'MassageCustomFields',
+ CustomFields => $CustomFields);
+
</%INIT>
<%ARGS>
$Object => undef
diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch
index e76f801df..e9fc5c6ed 100644
--- a/rt/html/Elements/SimpleSearch
+++ b/rt/html/Elements/SimpleSearch
@@ -43,7 +43,14 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<form action="<% $RT::WebPath %>/index.html">
-<input size="12" name="q" autocomplete="off" accesskey="0">
-<input type="submit" value="<&|/l&>Search tickets</&>">&nbsp;
+<form action="<% $RT::WebPath %>/index.html" STYLE="margin:0">
+<SCRIPT TYPE="text/javascript">
+ function clearhint_search_ticket (what) {
+ if ( what.value == '(ticket # or subject string)' )
+ what.value = '';
+ }
+</SCRIPT>
+<input name="q" accesskey="0" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="text-align:right; font-family: Arial, Verdana, Helvetica, sans-serif;"><BR>
+<A HREF="<% $RT::WebPath %>/Search/Build.html" STYLE="color: #ffffff; font-size: 70%; font-weight:normal">Advanced</A>
+<input type="submit" value="<&|/l&>Search tickets</&>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:70%;padding-left:2px;padding-right:2px">
</form>
diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs
index f5839a9e5..721f920d5 100644
--- a/rt/html/Elements/Tabs
+++ b/rt/html/Elements/Tabs
@@ -57,9 +57,17 @@
<%INIT>
my $action;
my $basetopactions = {
- A => { html => $m->scomp('/Elements/CreateTicket')
+# A => { html => $m->scomp('/Elements/CreateTicket')
+# },
+ A => { html => $m->scomp('/Elements/FreesideNewCust')
},
- B => { html => $m->scomp('/Elements/SimpleSearch')
+ B => { html => $m->scomp('/Elements/FreesideSearch')
+ },
+ C => { html => $m->scomp('/Elements/FreesideInvoiceSearch')
+ },
+ D => { html => $m->scomp('/Elements/FreesideSvcSearch')
+ },
+ E => { html => $m->scomp('/Elements/SimpleSearch')
}
};
my $basetabs = {
diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart
index 804e5cfaa..d98fe2744 100644
--- a/rt/html/Elements/TitleBoxStart
+++ b/rt/html/Elements/TitleBoxStart
@@ -78,7 +78,7 @@ $title_class => ''
$titleright_href => undef
$titleright => undef
-$contentbg => "#dddddd"
+$contentbg => "#d4d4d4"
$color => "#336699"
</%ARGS>
<%init>
diff --git a/rt/html/NoAuth/printrt.css b/rt/html/NoAuth/printrt.css
new file mode 100644
index 000000000..72e7e8b7e
--- /dev/null
+++ b/rt/html/NoAuth/printrt.css
@@ -0,0 +1,77 @@
+%# {{{ BEGIN BPS TAGGED BLOCK
+%#
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# }}} END BPS TAGGED BLOCK
+%#
+%# Special stylesheet for printing tickets
+%# Koos van den Hout koos@cs.uu.nl 2005-11-21
+%#
+
+SPAN.nav { display: none !important; }
+.nav2 { display: none !important; }
+.nav { display: none !important; }
+.topnav { display: none !important; }
+.blue { display: none !important; }
+.darkblue { display: none !important; }
+.blueright { display: none !important; }
+.currentnav { display: none !important; }
+th.titlebox { border-top: none; border-bottom: none; }
+th.titleboxright { display:none !important; border-top: none; border-bottom: none; }
+.titlebox { border-top: none; border-bottom: none; }
+
+div.downloadattachment, div.downloadcontenttype {
+ display: none !important;
+}
+
+
+a[href$="Respond"], a[href$="Comment"], a[href*="ShowEmailRecord"] {
+ display: none !important;
+}
+
+
+%# Provide a callback for adding/modifying the style sheet.
+%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says:
+%# "latter specified rule wins"
+<& /Elements/Callback &>
+<%flags>
+inherit => undef
+</%flags>
+<%init>
+$r->content_type('text/css');
+$r->headers_out->{'Expires'} = '+30m';
+</%init>
diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css
index bc688ac1d..5da0f8310 100644
--- a/rt/html/NoAuth/webrt.css
+++ b/rt/html/NoAuth/webrt.css
@@ -1,3 +1,4 @@
+/*
%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
@@ -43,75 +44,80 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif;
+*/
+
+/* * {
+ font-family: Arial, Verdana, Helvetica, sans-serif;
+ font-size: 1.2em;
+} */
+
+SPAN.nav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 12px;
-%# color: #FFFFFF;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
.nav2 { font-size: 10px;
white-space: nowrap}
-.nav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.nav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 13px;
-%# font-weight: normal;
font-weight: bold;
-%# color: #FFFFFF;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-.currentnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.currentnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
color: #FFFF66;
text-decoration: none;
white-space: nowrap}
-.topnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.topnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 16px;
font-weight: normal;
-%# color: #FFFFFF;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
+/*
%# .topnav is the original RT class for the sidebar navigation tabs.
%# Font-sizing by level depth was originally hard-coded into Elements/Menu.
%# This modification sets a different class name for each level, allowing
%# style sheet control over the formats.
+*/
-a.topnav-0 { font-family: Verdana, sans-serif;
+a.topnav-0 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-a.topnav-1 { font-family: Verdana, sans-serif;
+a.topnav-1 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-a.topnav-2 { font-family: Verdana, sans-serif;
+a.topnav-2 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-a.topnav-3 { font-family: Verdana, sans-serif;
+a.topnav-3 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-a.topnav-4 { font-family: Verdana, sans-serif;
+a.topnav-4 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-a.topnav-5 { font-family: Verdana, sans-serif;
+a.topnav-5 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000;
+ color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
li.topnav-0-minor {
@@ -175,53 +181,54 @@ li.topnav-5-major {
padding-bottom: .5em;
}
-.currenttopnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.currenttopnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
-%# color: #FFFF66;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
+/*
%# .currenttopnav is the original RT class for the sidebar navigation tabs.
%# Font-sizing by level depth was originally hard-coded into Elements/Menu.
%# This modification sets a different class name for each level, allowing
%# style sheet control over the formats
+*/
-a.currenttopnav-0 { font-family: Verdana, sans-serif;
+a.currenttopnav-0 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
-a.currenttopnav-1 { font-family: Verdana, sans-serif;
+a.currenttopnav-1 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
-a.currenttopnav-2 { font-family: Verdana, sans-serif;
+a.currenttopnav-2 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: normal;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
-a.currenttopnav-3 { font-family: Verdana, sans-serif;
+a.currenttopnav-3 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
-a.currenttopnav-4 { font-family: Verdana, sans-serif;
+a.currenttopnav-4 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
-a.currenttopnav-5 { font-family: Verdana, sans-serif;
+a.currenttopnav-5 { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
- color: #000000; background-color: #cccccc;
+ color: #ffffff; background-color: #7e0079;
text-decoration: none;
white-space: nowrap}
li.currenttopnav-0-minor {
@@ -285,18 +292,18 @@ li.currenttopnav-5-major {
padding-bottom: .5em;
}
-.topactions { font-family: Verdana, Arial, Helvetica, sans-serif;
+.topactions { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 10px;
color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-.subnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.subnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 11px;
font-weight: normal;
color: #FFFFFF;
text-decoration: none;
white-space: nowrap}
-.currentsubnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.currentsubnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #FFFF66;
@@ -314,12 +321,12 @@ li.currenttopnav-5-major {
}
.blue {
background-color: #4682B4;
-%# background-color: #eeeeee;
+/* %# background-color: #eeeeee; */
background-position: left top;
vertical-align: top;
text-align: left;
}
-%# Actually the "topactions" section
+/* %# Actually the "topactions" section */
.blueright { background-color: #4682B4;
background-position: left top;
vertical-align: top;
@@ -355,6 +362,55 @@ li.currenttopnav-5-major {
vertical-align: top;
text-align: right;
}
+.black {
+ background-color: #000000;
+ color: #ffffff;
+ background-position: left top;
+ vertical-align: top;
+ text-align: left;
+ }
+.blackright {
+ background-color: #000000;
+ color: #ffffff;
+ background-position: left top;
+ vertical-align: center;
+ text-align: right;
+ font-size:16px;
+ padding-right:4px
+ }
+
+input.fsblackbutton {
+ background-color:#333333;
+ color: #ffffff;
+ border:1px solid;
+ border-top-color:#cccccc;
+ border-left-color:#cccccc;
+ border-right-color:#aaaaaa;
+ border-bottom-color:#aaaaaa;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left:12px;
+ padding-right:12px;
+ overflow:visible;
+ filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff333333',EndColorStr='#ff666666')
+}
+
+input.fsblackbuttonselected {
+ background-color:#7e0079;
+ color: #ffffff;
+ border:1px solid;
+ border-top-color:#cccccc;
+ border-left-color:#cccccc;
+ border-right-color:#aaaaaa;
+ border-bottom-color:#aaaaaa;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left:12px;
+ padding-right:12px;
+ overflow:visible;
+ filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0,StartColorStr='#ff330033',EndColorStr='#ff7e0079')
+}
+
.mediumgray {
background-color: #cccccc;
background-position: left top;
@@ -367,6 +423,30 @@ li.currenttopnav-5-major {
vertical-align: top;
text-align: right;
}
+.darkmediumgray {
+ background-color: #aaaaaa;
+ background-position: left top;
+ vertical-align: top;
+ text-align: left;
+ }
+.darkmediumgrayright {
+ background-color: #aaaaaa;
+ background-position: left top;
+ vertical-align: top;
+ text-align: right;
+ }
+.bggray {
+ background-color: #e8e8e8;
+ background-position: left top;
+ vertical-align: top;
+ text-align: left;
+ }
+.bggrayright {
+ background-color: #e8e8e8;
+ background-position: left top;
+ vertical-align: top;
+ text-align: right;
+ }
.white {
background-color: #ffffff;
background-position: left top;
@@ -396,26 +476,26 @@ div.downloadattachment {
}
-td { font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 11px;
+td { font-family: Arial, Verdana, Helvetica, sans-serif;
+ font-size: 12px;
background-position: left top;
}
.black { background-color: #000000;
background-position: left top;
}
-span.rtname { font-family: Verdana, Arial, Helvetica, sans-serif;
+span.rtname { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 18px;
font-weight: normal;
color: #ffffff}
-span.title { font-family: Verdana, Arial, Helvetica, sans-serif;
+span.title { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 20px;
font-weight: bold;
color: #ffffff}
-.header { font-family: Verdana, Arial, Helvetica, sans-serif;
+.header { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: #0066CC}
-.subheader { font-family: Verdana, Arial, Helvetica, sans-serif;
+.subheader { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 11px;
font-weight: bold;
color: #0066CC }
@@ -426,9 +506,9 @@ span.title { font-family: Verdana, Arial, Helvetica, sans-serif;
.labeltop { font-weight: normal;
text-align: right;
vertical-align: top }
-.productnav { font-family: Verdana, Arial, Helvetica, sans-serif;
+.productnav { font-family: Arial, Verdana, Helvetica, sans-serif;
font-size: 11px;
- color: #000000;
+ color: #FFFFFF;
text-align: center;
vertical-align: middle;
text-decoration: none}
@@ -450,6 +530,7 @@ TD.mainbody {
padding-right: 1em;
margin-left: 1em;
margin-right: 1em;
+ background-color: #e8e8e8;
}
td.boxcontainer + td.boxcontainer {
@@ -492,14 +573,14 @@ TD.titlebox {
SPAN.message {
font-size: 100%;
- font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-family: Arial, Verdana, Helvetica, sans-serif;
}
BODY {
color: #000;
background: #FFFFFF;
- font-family: "Helvetica", sans-serif;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 0px;
@@ -522,7 +603,7 @@ TR.evenline {
H1, H2, H3 {
margin-top: 0.2em;
color: #336699;
- font-family: "Helvetica", sans-serif;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
clear: both;
}
@@ -535,7 +616,7 @@ DIV.endmatter { margin-left: -7% }
}
-A { font-weight: bold; color: #000000;
+A { font-weight: bold; color: #000000
}
.currenttab { color: #ffffff;}
@@ -549,8 +630,9 @@ A:link IMG, A:visited IMG { border-style: none }
a:focus {text-decoration: underline }
A IMG { color: white } /* The only way to hide the border in NS 4.x */
-a:link { text-decoration: none}
-a:visited { text-decoration: none}
+/* a:link { text-decoration: none} */
+/* a:visited { text-decoration: none} */
+
a:hover { text-decoration: underline}
/* a:focus { background-color: #ccccee } */
@@ -563,7 +645,7 @@ SPAN.date { font-size: 0.8em }
span.title { font-size: 1.6em;
vertical-align: middle;
-%# color: #ffffff;
+/* %# color: #ffffff; */
color: #000000;
}
span.productname { font-size: 2em;
@@ -662,6 +744,7 @@ textarea.messagebox {
width: 100%;
}
+/*
%# Provide a callback for adding/modifying the style sheet.
%# http://www.w3.org/TR/REC-CSS1 - section 3.2, says:
%# "latter specified rule wins"
@@ -673,3 +756,4 @@ inherit => undef
$r->content_type('text/css');
#$r->headers_out->{'Expires'} = '+30m';
</%init>
+*/
diff --git a/rt/html/Search/Build.html b/rt/html/Search/Build.html
index cb6462651..5a66e02c9 100644
--- a/rt/html/Search/Build.html
+++ b/rt/html/Search/Build.html
@@ -256,237 +256,6 @@ if ( $ARGS{'LoadSavedSearch'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) {
# }}}
# {{{ Parse the query
-my $tree;
-ParseQuery( $Query, \$tree, \@actions );
-
-# if parsing went poorly, send them to the edit page to fix it
-if ( $actions[0] ) {
- $m->comp( "Edit.html", Query => $Query, actions => \@actions );
- $m->abort();
-}
-
-$Query = "";
-
-my @options = $tree->GetDisplayedNodes;
-
-my @current_values = grep { defined } @options[@clauses];
-
-# {{{ Try to find if we're adding a clause
-foreach my $arg ( keys %ARGS ) {
- if (
- $arg =~ m/^ValueOf(.+)/
- && ( ref $ARGS{$arg} eq "ARRAY"
- ? grep { $_ ne "" } @{ $ARGS{$arg} }
- : $ARGS{$arg} ne "" )
- )
- {
-
- # We're adding a $1 clause
- my $field = $1;
- my ( $keyword, $op, $value );
-
- #figure out if it's a grouping
- if ( $ARGS{ $field . "Field" } ) {
- $keyword = $ARGS{ $field . "Field" };
- }
- else {
- $keyword = $field;
- }
-
- my ( @ops, @values );
- if ( ref $ARGS{ 'ValueOf' . $field } eq "ARRAY" ) {
-
- # we have many keys/values to iterate over, because there is
- # more than one CF with the same name.
- @ops = @{ $ARGS{ $field . 'Op' } };
- @values = @{ $ARGS{ 'ValueOf' . $field } };
- }
- else {
- @ops = ( $ARGS{ $field . 'Op' } );
- @values = ( $ARGS{ 'ValueOf' . $field } );
- }
- $RT::Logger->error("Bad Parameters passed into Query Builder")
- unless @ops == @values;
-
- for my $i ( 0 .. @ops - 1 ) {
- my ( $op, $value ) = ( $ops[$i], $values[$i] );
- next if $value eq "";
-
- if ( $value eq 'NULL' && $op =~ /=/ ) {
- if ( $op eq '=' ) {
- $op = "IS";
- }
- elsif ( $op eq '!=' ) {
- $op = "IS NOT";
- }
-
- # This isn't "right", but...
- # It has to be this way until #5182 is fixed
- $value = "'NULL'";
- }
- else {
- $value = "'$value'";
- }
-
- my $clause = {
- Key => $keyword,
- Op => $op,
- Value => $value
- };
-
- my $newnode = RT::Interface::Web::QueryBuilder::Tree->new($clause);
- if (@current_values) {
- foreach my $value (@current_values) {
- my $newindex = $value->getIndex() + 1;
- $value->insertSibling( $newindex, $newnode );
- $value = $newnode;
- }
- }
- else {
- $tree->getChild(0)->addChild($newnode);
- @current_values = $newnode;
- }
- $newnode->getParent()->setNodeValue( $ARGS{'AndOr'} );
- }
- }
-}
-
-# }}}
-
-# {{{ Move things around
-if ( $ARGS{"Up"} ) {
- if (@current_values) {
- foreach my $value (@current_values) {
- my $index = $value->getIndex();
- if ( $value->getIndex() > 0 ) {
- my $parent = $value->getParent();
- $parent->removeChild($index);
- $parent->insertChild( $index - 1, $value );
- $value = $parent->getChild( $index - 1 );
- }
- else {
- push( @actions, [ loc("error: can't move up"), -1 ] );
- }
- }
- }
- else {
- push( @actions, [ loc("error: nothing to move"), -1 ] );
- }
-}
-elsif ( $ARGS{"Down"} ) {
- if (@current_values) {
- foreach my $value (@current_values) {
- my $index = $value->getIndex();
- my $parent = $value->getParent();
- if ( $value->getIndex() < ( $parent->getChildCount - 1 ) ) {
- $parent->removeChild($index);
- $parent->insertChild( $index + 1, $value );
- $value = $parent->getChild( $index + 1 );
- }
- else {
- push( @actions, [ loc("error: can't move down"), -1 ] );
- }
- }
- }
- else {
- push( @actions, [ loc("error: nothing to move"), -1 ] );
- }
-}
-elsif ( $ARGS{"Left"} ) {
- if (@current_values) {
- foreach my $value (@current_values) {
- my $parent = $value->getParent();
- my $grandparent = $parent->getParent();
- if ( !$grandparent->isRoot ) {
- my $index = $parent->getIndex();
- $parent->removeChild($value);
- $grandparent->insertChild( $index, $value );
- if ( $parent->isLeaf() ) {
- $grandparent->removeChild($parent);
- }
- }
- else {
- push( @actions, [ loc("error: can't move left"), -1 ] );
- }
- }
- }
- else {
- push( @actions, [ loc("error: nothing to move"), -1 ] );
- }
-}
-elsif ( $ARGS{"Right"} ) {
- if (@current_values) {
- foreach my $value (@current_values) {
- my $parent = $value->getParent();
- my $index = $value->getIndex();
- my $newparent;
- if ( $index > 0 ) {
- my $sibling = $parent->getChild( $index - 1 );
- if ( ref( $sibling->getNodeValue ) ) {
- $parent->removeChild($value);
- my $newtree = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent );
- $newtree->addChild($value);
- }
- else {
- $parent->removeChild($index);
- $sibling->addChild($value);
- }
- }
- else {
- $parent->removeChild($value);
- $newparent = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent );
- $newparent->addChild($value);
- }
- }
- }
- else {
- push( @actions, [ loc("error: nothing to move"), -1 ] );
- }
-}
-elsif ( $ARGS{"DeleteClause"} ) {
- if (@current_values) {
- $_->getParent()->removeChild($_) for @current_values;
- }
- else {
- push( @actions, [ loc("error: nothing to delete"), -1 ] );
- }
-}
-elsif ( $ARGS{"Toggle"} ) {
- my $ea;
- if (@current_values) {
- foreach my $value (@current_values) {
- my $parent = $value->getParent();
-
- if ( $parent->getNodeValue eq 'AND' ) {
- $parent->setNodeValue('OR');
- }
- else {
- $parent->setNodeValue('AND');
- }
- }
- }
- else {
- push( @actions, [ loc("error: nothing to toggle"), -1 ] );
- }
-}
-
-$tree->PruneChildlessAggregators;
-
-# }}}
-
-# {{{ Rebuild $Query based on the additions / movements
-$Query = "";
-my $optionlist_arrayref;
-
-($Query, $optionlist_arrayref) = $tree->GetQueryAndOptionList(\@current_values);
-
-my $optionlist = join "\n", map { qq(<option value="$_->{INDEX}" $_->{SELECTED}>)
- . ("&nbsp;" x (5 * $_->{DEPTH}))
- . $m->interp->apply_escapes($_->{TEXT}, 'h') . qq(</option>) } @$optionlist_arrayref;
-
-
-
-
use Regexp::Common qw /delimited/;
# States
@@ -496,7 +265,17 @@ use constant OP => 4;
use constant PAREN => 8;
use constant KEYWORD => 16;
-sub ParseQuery {
+my $_match = sub {
+
+ # Case insensitive equality
+ my ( $y, $x ) = @_;
+ return 1 if $x =~ /^$y$/i;
+
+ # return 1 if ((lc $x) eq (lc $y)); # Why isnt this equiv?
+ return 0;
+};
+
+my $ParseQuery = sub {
my $string = shift;
my $tree = shift;
my @actions = shift;
@@ -548,12 +327,12 @@ sub ParseQuery {
my $current = 0;
# Highest priority is last
- $current = OP if _match( $re_op, $val );
- $current = VALUE if _match( $re_value, $val );
+ $current = OP if $_match->( $re_op, $val );
+ $current = VALUE if $_match->( $re_value, $val );
$current = KEYWORD
- if _match( $re_keyword, $val ) && ( $want & KEYWORD );
- $current = AGGREG if _match( $re_aggreg, $val );
- $current = PAREN if _match( $re_paren, $val );
+ if $_match->( $re_keyword, $val ) && ( $want & KEYWORD );
+ $current = AGGREG if $_match->( $re_aggreg, $val );
+ $current = PAREN if $_match->( $re_paren, $val );
unless ( $current && $want & $current ) {
@@ -666,25 +445,242 @@ sub ParseQuery {
# This will never happen, because the parser will complain
push @actions, [ loc("Mismatched parentheses"), -1 ]
unless $depth == 1;
+};
+
+my $tree;
+$ParseQuery->( $Query, \$tree, \@actions );
+
+# if parsing went poorly, send them to the edit page to fix it
+if ( $actions[0] ) {
+ $m->comp( "Edit.html", Query => $Query, actions => \@actions );
+ $m->abort();
}
-sub _match {
+$Query = "";
- # Case insensitive equality
- my ( $y, $x ) = @_;
- return 1 if $x =~ /^$y$/i;
+my @options = $tree->GetDisplayedNodes;
- # return 1 if ((lc $x) eq (lc $y)); # Why isnt this equiv?
- return 0;
+my @current_values = grep { defined } @options[@clauses];
+
+# {{{ Move things around
+if ( $ARGS{"Up"} ) {
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $index = $value->getIndex();
+ if ( $value->getIndex() > 0 ) {
+ my $parent = $value->getParent();
+ $parent->removeChild($index);
+ $parent->insertChild( $index - 1, $value );
+ $value = $parent->getChild( $index - 1 );
+ }
+ else {
+ push( @actions, [ loc("error: can't move up"), -1 ] );
+ }
+ }
+ }
+ else {
+ push( @actions, [ loc("error: nothing to move"), -1 ] );
+ }
+}
+elsif ( $ARGS{"Down"} ) {
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $index = $value->getIndex();
+ my $parent = $value->getParent();
+ if ( $value->getIndex() < ( $parent->getChildCount - 1 ) ) {
+ $parent->removeChild($index);
+ $parent->insertChild( $index + 1, $value );
+ $value = $parent->getChild( $index + 1 );
+ }
+ else {
+ push( @actions, [ loc("error: can't move down"), -1 ] );
+ }
+ }
+ }
+ else {
+ push( @actions, [ loc("error: nothing to move"), -1 ] );
+ }
}
+elsif ( $ARGS{"Left"} ) {
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $parent = $value->getParent();
+ my $grandparent = $parent->getParent();
+ if ( !$grandparent->isRoot ) {
+ my $index = $parent->getIndex();
+ $parent->removeChild($value);
+ $grandparent->insertChild( $index, $value );
+ if ( $parent->isLeaf() ) {
+ $grandparent->removeChild($parent);
+ }
+ }
+ else {
+ push( @actions, [ loc("error: can't move left"), -1 ] );
+ }
+ }
+ }
+ else {
+ push( @actions, [ loc("error: nothing to move"), -1 ] );
+ }
+}
+elsif ( $ARGS{"Right"} ) {
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $parent = $value->getParent();
+ my $index = $value->getIndex();
+ my $newparent;
+ if ( $index > 0 ) {
+ my $sibling = $parent->getChild( $index - 1 );
+ if ( ref( $sibling->getNodeValue ) ) {
+ $parent->removeChild($value);
+ my $newtree = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent );
+ $newtree->addChild($value);
+ }
+ else {
+ $parent->removeChild($index);
+ $sibling->addChild($value);
+ }
+ }
+ else {
+ $parent->removeChild($value);
+ $newparent = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent );
+ $newparent->addChild($value);
+ }
+ }
+ }
+ else {
+ push( @actions, [ loc("error: nothing to move"), -1 ] );
+ }
+}
+elsif ( $ARGS{"DeleteClause"} ) {
+ if (@current_values) {
+ $_->getParent()->removeChild($_) for @current_values;
+ @current_values = ();
+ }
+ else {
+ push( @actions, [ loc("error: nothing to delete"), -1 ] );
+ }
+}
+elsif ( $ARGS{"Toggle"} ) {
+ my $ea;
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $parent = $value->getParent();
+
+ if ( $parent->getNodeValue eq 'AND' ) {
+ $parent->setNodeValue('OR');
+ }
+ else {
+ $parent->setNodeValue('AND');
+ }
+ }
+ }
+ else {
+ push( @actions, [ loc("error: nothing to toggle"), -1 ] );
+ }
+}
+
+# {{{ Try to find if we're adding a clause
+foreach my $arg ( keys %ARGS ) {
+ if (
+ $arg =~ m/^ValueOf(.+)/
+ && ( ref $ARGS{$arg} eq "ARRAY"
+ ? grep { $_ ne "" } @{ $ARGS{$arg} }
+ : $ARGS{$arg} ne "" )
+ )
+ {
+
+ # We're adding a $1 clause
+ my $field = $1;
+ my ( $keyword, $op, $value );
+
+ #figure out if it's a grouping
+ if ( $ARGS{ $field . "Field" } ) {
+ $keyword = $ARGS{ $field . "Field" };
+ }
+ else {
+ $keyword = $field;
+ }
+
+ my ( @ops, @values );
+ if ( ref $ARGS{ 'ValueOf' . $field } eq "ARRAY" ) {
+
+ # we have many keys/values to iterate over, because there is
+ # more than one CF with the same name.
+ @ops = @{ $ARGS{ $field . 'Op' } };
+ @values = @{ $ARGS{ 'ValueOf' . $field } };
+ }
+ else {
+ @ops = ( $ARGS{ $field . 'Op' } );
+ @values = ( $ARGS{ 'ValueOf' . $field } );
+ }
+ $RT::Logger->error("Bad Parameters passed into Query Builder")
+ unless @ops == @values;
+
+ for my $i ( 0 .. @ops - 1 ) {
+ my ( $op, $value ) = ( $ops[$i], $values[$i] );
+ next if $value eq "";
-sub debug {
- my $message = shift;
- $m->print( $message . "<br>" );
+ if ( $value eq 'NULL' && $op =~ /=/ ) {
+ if ( $op eq '=' ) {
+ $op = "IS";
+ }
+ elsif ( $op eq '!=' ) {
+ $op = "IS NOT";
+ }
+
+ # This isn't "right", but...
+ # It has to be this way until #5182 is fixed
+ $value = "'NULL'";
+ }
+ else {
+ $value = "'$value'";
+ }
+
+ my $clause = {
+ Key => $keyword,
+ Op => $op,
+ Value => $value
+ };
+
+ my $newnode = RT::Interface::Web::QueryBuilder::Tree->new($clause);
+ if (@current_values) {
+ foreach my $value (@current_values) {
+ my $newindex = $value->getIndex() + 1;
+ $value->insertSibling( $newindex, $newnode );
+ $value = $newnode;
+ }
+ }
+ else {
+ $tree->getChild(0)->addChild($newnode);
+ @current_values = $newnode;
+ }
+ $newnode->getParent()->setNodeValue( $ARGS{'AndOr'} );
+ }
+ }
}
# }}}
+$tree->PruneChildlessAggregators;
+
+# }}}
+
+# {{{ Rebuild $Query based on the additions / movements
+$Query = "";
+my $optionlist_arrayref;
+
+($Query, $optionlist_arrayref) = $tree->GetQueryAndOptionList(\@current_values);
+
+my $optionlist = join "\n", map { qq(<option value="$_->{INDEX}" $_->{SELECTED}>)
+ . ("&nbsp;" x (5 * $_->{DEPTH}))
+ . $m->interp->apply_escapes($_->{TEXT}, 'h') . qq(</option>) } @$optionlist_arrayref;
+
+
+
+
+# }}}
+
# }}}
my $queues = $tree->GetReferencedQueues;
diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html
index f9eef26b6..b7c64e3f8 100644
--- a/rt/html/Search/Bulk.html
+++ b/rt/html/Search/Bulk.html
@@ -68,7 +68,7 @@ $Tickets->RedoSearch();
while (my $Ticket = $Tickets->Next) {
$i++;
if ($i % 2) {
- $bgcolor = "#dddddd";
+ $bgcolor = "#d4d4d4";
}
else {
$bgcolor = "#ffffff";
diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString
index 639e62c29..cffb81a48 100644
--- a/rt/html/Search/Elements/BuildFormatString
+++ b/rt/html/Search/Elements/BuildFormatString
@@ -121,11 +121,7 @@ foreach my $id (keys %cfqueues) {
$CustomFields->LimitToGlobal;
while ( my $CustomField = $CustomFields->Next ) {
- my $queuestr;
- if ($CustomField->QueueObj && $CustomField->QueueObj->Id != 0) {
- $queuestr = $CustomField->QueueObj->Name . ".";
- }
- push @fields, "CustomField." . $queuestr . "{" . $CustomField->Name . "}";
+ push @fields, "CustomField.{" . $CustomField->Name . "}";
}
my ( @seen);
diff --git a/rt/html/Search/Results.rdf b/rt/html/Search/Results.rdf
index ee71fea94..7cc248306 100644
--- a/rt/html/Search/Results.rdf
+++ b/rt/html/Search/Results.rdf
@@ -75,7 +75,7 @@ $r->content_type('application/rdf+xml');
link => $RT::WebURL."/Ticket/Display.html?id=".$Ticket->id,
description => $Ticket->Transactions->First->Content,
dc => {
- subject => $Ticket->Subject,
+ subject => ($Ticket->Subject || loc('No subject')),
creator => $Ticket->CreatorObj->RealName . "<".$Ticket->CreatorObj->EmailAddress.">",
},
);
diff --git a/rt/html/Search/Results.tsv b/rt/html/Search/Results.tsv
index 17aa88ae1..e6b20481f 100644
--- a/rt/html/Search/Results.tsv
+++ b/rt/html/Search/Results.tsv
@@ -64,7 +64,7 @@ my @attrs = qw( id QueueObj->Name Subject Status TimeEstimated TimeWorked TimeLe
if ($@) {die "Failed to find $attr - ". $@};
}
- my $cfs = $Ticket->QueueObj->CustomFields();
+ my $cfs = $Ticket->QueueObj->TicketCustomFields();
while (my $cf = $cfs->Next) {
my @content;
my $values = $Ticket->CustomFieldValues($cf->Id);
diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields
index d566f4e71..6ae188fa7 100644
--- a/rt/html/Ticket/Elements/EditCustomFields
+++ b/rt/html/Ticket/Elements/EditCustomFields
@@ -91,7 +91,8 @@ if ($TicketObj) {
$NamePrefix = "Object-RT::Ticket--CustomField-";
}
-
+ $m->comp('/Elements/Callback', _CallbackName => 'MassageCustomFields',
+ CustomFields => $CustomFields);
</%INIT>
<%ARGS>
diff --git a/rt/html/Ticket/Elements/EditCustomers b/rt/html/Ticket/Elements/EditCustomers
index 47d1aa222..c5a6f708c 100644
--- a/rt/html/Ticket/Elements/EditCustomers
+++ b/rt/html/Ticket/Elements/EditCustomers
@@ -43,7 +43,7 @@
<&|/l&>Find customer</&><BR>
<input name="CustomerString">
<input type=submit name="OnlySearchForCustomers" value="<&|/l&>Go!</&>">
-<br><i>cust #, last name, or company</i>
+<br><i>cust #, name, company or phone</i>
<BR>
%#<BR>
%#<&|/l&>Find service</&><BR>
diff --git a/rt/html/Ticket/Elements/ShowTransactionAttachments b/rt/html/Ticket/Elements/ShowTransactionAttachments
index 8dabff421..d9e94ffa2 100644
--- a/rt/html/Ticket/Elements/ShowTransactionAttachments
+++ b/rt/html/Ticket/Elements/ShowTransactionAttachments
@@ -89,13 +89,13 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) {
<div class="messagebody">
<%perl>
# {{{ if it has a content-disposition: attachment, don't show inline
-unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) {
+unless ( ($message->GetHeader('Content-Disposition')||"") =~ /attachment/i ) {
my $content;
# If it's text
if ( $message->ContentType =~ m{^(text|message)}i
- && $size <= $RT::MaxInlineBody )
+ && $message->ContentLength <= $RT::MaxInlineBody )
{
if (
@@ -158,6 +158,11 @@ unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) {
. $message->Id
. '/">' );
}
+ elsif ( $message->ContentLength > 0 ) {
+ $m->out(
+ loc( 'Message body not shown because it is too large or is not plain text.' )
+ );
+ }
}
# }}}
diff --git a/rt/html/User/Elements/Tabs b/rt/html/User/Elements/Tabs
index 1d25fb926..625b30f93 100644
--- a/rt/html/User/Elements/Tabs
+++ b/rt/html/User/Elements/Tabs
@@ -61,6 +61,9 @@
},
};
+ # Now let callbacks add their extra tabs
+ $m->comp('/Elements/Callback', tabs => $tabs, %ARGS);
+
foreach my $tab (sort keys %{$tabs}) {
if ($tabs->{$tab}->{'path'} eq $current_tab) {
$tabs->{$tab}->{"subtabs"} = $subtabs;