summaryrefslogtreecommitdiff
path: root/rt/html/Search/Elements
diff options
context:
space:
mode:
Diffstat (limited to 'rt/html/Search/Elements')
-rw-r--r--rt/html/Search/Elements/BuildFormatString196
-rw-r--r--rt/html/Search/Elements/DisplayOptions17
-rw-r--r--rt/html/Search/Elements/EditFormat60
-rw-r--r--rt/html/Search/Elements/EditQuery65
-rw-r--r--rt/html/Search/Elements/EditSearches18
-rw-r--r--rt/html/Search/Elements/NewListActions6
-rw-r--r--rt/html/Search/Elements/PickBasics189
-rw-r--r--rt/html/Search/Elements/PickCFs31
-rw-r--r--rt/html/Search/Elements/PickCriteria20
-rw-r--r--rt/html/Search/Elements/SearchPrivacy6
-rw-r--r--rt/html/Search/Elements/SelectAndOr12
-rw-r--r--rt/html/Search/Elements/SelectGroup65
-rw-r--r--rt/html/Search/Elements/SelectLinks8
-rw-r--r--rt/html/Search/Elements/SelectPersonType22
-rw-r--r--rt/html/Search/Elements/SelectSearchObject6
-rw-r--r--rt/html/Search/Elements/SelectSearchesForObjects9
16 files changed, 451 insertions, 279 deletions
diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString
index e5e131b6c..639e62c29 100644
--- a/rt/html/Search/Elements/BuildFormatString
+++ b/rt/html/Search/Elements/BuildFormatString
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,45 +42,76 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<%args>
$Format => undef
%cfqueues => undef
+$Face => undef
+$Size => undef
+$Link => undef
+$Title => undef
+$AddCol => undef
+$RemoveCol => undef
+$ColUp => undef
+$ColDown => undef
+$SelectDisplayColumns => undef
+$CurrentDisplayColumns => undef
</%args>
<%init>
unless ($Format) {
$Format = $RT::DefaultSearchResultFormat;
}
-
-my @fields = (
- "QueueName", "OwnerName",
- "id", "Status",
- "Subject", "ExtendedStatus",
- "Priority", "InitialPriority",
- "FinalPriority", "EffectiveId",
- "Type", "TimeWorked",
- "TimeLeft", "TimeEstimated",
- "Requestors", "Cc",
- "AdminCc", "StartsRelative",
- "StartedRelative", "CreatedRelative",
- "LastUpdatedRelative", "ToldRelative",
- "DueRelative", "ResolvedRelative",
- "Starts", "Started",
- "Created", "CreatedBy",
- "LastUpdated", "LastUpdatedBy",
- "Told", "Due",
- "Resolved", "NEWLINE",
- "RefersTo", "ReferredToBy",
- "DependsOn", "DependedOnBy",
- "MemberOf", "Members",
- "Parents", "Children",
- "-",
+
+
+# All the things we can display in the format string by default
+my @fields = qw(
+ id
+ Status
+ ExtendedStatus
+ Subject
+ QueueName
+ OwnerName
+ Priority
+ InitialPriority
+ FinalPriority
+ Type
+ TimeWorked
+ TimeLeft
+ TimeEstimated
+ CreatedBy
+ LastUpdatedBy
+ Requestors
+ Cc
+ AdminCc
+ Starts
+ StartsRelative
+ Started
+ StartedRelative
+ Created
+ CreatedRelative
+ LastUpdated
+ LastUpdatedRelative
+ Told
+ ToldRelative
+ Due
+ DueRelative
+ Resolved
+ ResolvedRelative
+ RefersTo
+ ReferredToBy
+ DependsOn
+ DependedOnBy
+ MemberOf
+ Members
+ Parents
+ Children
+ NEWLINE
);
my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
-foreach (keys %cfqueues) {
- my $id = $_;
+foreach my $id (keys %cfqueues) {
+ # What does this _do_? What are the keys to cfqueues
$id =~ s/^.'*(.*).'*$/$1/;
# Gotta load up the $queue object, since queues get stored by name now.
my $queue = RT::Queue->new($session{'CurrentUser'});
@@ -117,8 +148,8 @@ foreach my $field (@format) {
push @seen, \%column;
}
-if ( $ARGS{"RemoveCol"} ) {
- my $index = $ARGS{'CurrentDisplayColumns'};
+if ( $RemoveCol ) {
+ my $index = $CurrentDisplayColumns;
my $column = $seen[$index];
if ($index) {
delete $seen[$index];
@@ -130,9 +161,9 @@ if ( $ARGS{"RemoveCol"} ) {
}
}
}
-elsif ( $ARGS{"AddCol"} ) {
- if ( defined $ARGS{'SelectDisplayColumns'} ) {
- my $selected = $ARGS{'SelectDisplayColumns'};
+elsif ( $AddCol ) {
+ if ( defined $SelectDisplayColumns ) {
+ my $selected = $SelectDisplayColumns;
my @columns;
if (ref($selected) eq 'ARRAY') {
@columns = @$selected;
@@ -141,74 +172,71 @@ elsif ( $ARGS{"AddCol"} ) {
}
foreach my $col (@columns) {
my %column = ();
- $column{Column} = $fields[ $col ];
-
- if ( $ARGS{Face} eq "Bold" ) {
- $column{Prefix} .= "<B>";
- }
- if ( $ARGS{Face} eq "Italic" ) {
- $column{Prefix} .= "<I>";
- }
- if ( $ARGS{Size} ) {
- $column{Prefix} .= "<" . $ARGS{Size} . ">";
- }
- if ( $ARGS{Link} eq "Display" ) {
- $column{Prefix} .= "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?id=__id__\">";
- }
- elsif ( $ARGS{Link} eq "Take" ) {
- $column{Prefix} .=
- "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?Action=Take&id=__id__\">";
- }
-
- my $suffix;
- if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) {
- $column{Suffix} .= "</a>";
- }
- if ( $ARGS{Size} ) {
- $column{Suffix} .= "</" . $ARGS{Size} . ">";
- }
- if ( $ARGS{Face} eq "Italic" ) {
- $column{Suffix} .= "</I>";
- }
- if ( $ARGS{Face} eq "Bold" ) {
- $column{Suffix} .= "</B>";
- }
- if ( $ARGS{Title} ) {
- $column{Suffix} .= "/TITLE:" . $ARGS{Title};
- }
- push @seen, \%column;
- }
+ $column{Column} = $col;
+
+ if ( $Face eq "Bold" ) {
+ $column{Prefix} .= "<B>";
+ $column{Suffix} .= "</B>";
+ }
+ if ( $Face eq "Italic" ) {
+ $column{Prefix} .= "<I>";
+ $column{Suffix} .= "</I>";
+ }
+ if ($Size) {
+ $column{Prefix} .= "<" . $m->interp->apply_escapes( $Size, 'h' ) . ">";
+ $column{Suffix} .= "</" . $m->interp->apply_escapes( $Size, 'h' ) . ">";
+ }
+ if ( $Link eq "Display" ) {
+ $column{Prefix} .=
+ "<A HREF=\"" . $RT::WebPath . "/Ticket/Display.html?id=__id__\">";
+ $column{Suffix} .= "</a>";
+ }
+ elsif ( $Link eq "Take" ) {
+ $column{Prefix} .= "<A HREF=\"" . $RT::WebPath
+ . "/Ticket/Display.html?Action=Take&id=__id__\">";
+ $column{Suffix} .= "</a>";
+ }
+
+ if ($Title) {
+ $column{Suffix} .= "/TITLE:" . $m->interp->apply_escapes( $Title, 'h' );
}
+ push @seen, \%column;
+}
+}
}
-elsif ( $ARGS{"ColUp"} ) {
- my $index = $ARGS{'CurrentDisplayColumns'};
+elsif ( $ColUp ) {
+ my $index = $CurrentDisplayColumns;
if ( defined $index && ( $index - 1 ) >= 0 ) {
my $column = $seen[$index];
$seen[$index] = $seen[ $index - 1 ];
$seen[ $index - 1 ] = $column;
- $ARGS{CurrentDisplayColumns} = $index - 1;
+ $CurrentDisplayColumns = $index - 1;
}
}
-elsif ( $ARGS{"ColDown"} ) {
- my $index = $ARGS{'CurrentDisplayColumns'};
+elsif ( $ColDown ) {
+ my $index = $CurrentDisplayColumns;
if ( defined $index && ( $index + 1 ) < scalar @seen ) {
my $column = $seen[$index];
$seen[$index] = $seen[ $index + 1 ];
$seen[ $index + 1 ] = $column;
- $ARGS{CurrentDisplayColumns} = $index + 1;
+ $CurrentDisplayColumns = $index + 1;
}
}
-$Format = "";
+
+my @format_string;
foreach my $field (@seen) {
next unless $field;
- $Format .= ", \n" if $Format;
- $Format .= "'";
- $Format .= $field->{Prefix};
- $Format .= "__" . $field->{Column} . "__" if ( $field->{Column} ne "<blank>" ) ;
- $Format .= $field->{Suffix};
- $Format .= "'";
+ my $row = "'" . $field->{Prefix};
+ $row .= "__" . $m->interp->apply_escapes( $field->{Column}, 'h' ) . "__"
+ unless ( $field->{Column} eq "<blank>" );
+ $row .= $field->{Suffix} . "'";
+ push( @format_string, $row );
}
+
+$Format = join(",\n", @format_string);
+
+
return($Format, \@fields, \@seen);
</%init>
diff --git a/rt/html/Search/Elements/DisplayOptions b/rt/html/Search/Elements/DisplayOptions
index 330948d32..43a9d9998 100644
--- a/rt/html/Search/Elements/DisplayOptions
+++ b/rt/html/Search/Elements/DisplayOptions
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/TitleBoxStart, title => loc("Display Columns") &>
<table>
<tr>
@@ -54,15 +54,15 @@
<tr>
<td class=label>
<&|/l&>Order by</&>:
-</td><td class=label>
+</td><td class=value>
<select name="OrderBy">
% foreach my $field (keys %fields) {
% next unless $field;
<option value=<%$field%>
-% if ($field eq $OrderBy) {
+% if ($field =~ /^$OrderBy$/i) {
SELECTED
% }
-><%$field%></option>
+><&|/l&><%$field%></&></option>
% }
</select>
<select name="Order">
@@ -81,7 +81,7 @@ SELECTED
</tr>
<td class=label>
<&|/l&>Rows per page</&>:
-</td><td>
+</td><td class="value">
<& /Elements/SelectResultsPerPage,
Name => "RowsPerPage",
Default => $RowsPerPage &>
@@ -91,13 +91,14 @@ SELECTED
</td>
</tr>
</table>
-<& /Elements/Submit, Caption => "Do the Search", Label => loc('Search'), Name => 'DoSearch'&>
<& /Elements/TitleBoxEnd &>
<%INIT>
my $tickets = new RT::Tickets($session{'CurrentUser'});
my %fields = %{$tickets->FIELDS};
map { $fields{$_}->[0] =~ /^(?:ENUM|INT|DATE|STRING)$/ || delete $fields{$_} } keys %fields;
+delete $fields{'EffectiveId'};
+
</%INIT>
diff --git a/rt/html/Search/Elements/EditFormat b/rt/html/Search/Elements/EditFormat
index 7d314aee6..dc8720f26 100644
--- a/rt/html/Search/Elements/EditFormat
+++ b/rt/html/Search/Elements/EditFormat
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,14 +42,14 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<table>
<tr>
<td>
-<&|/l&>Available Columns</&>:
+<&|/l&>Add Columns</&>:
</td>
<td>
-Format:
+<&|/l&>Format</&>:
</td>
<td></td>
<td>
@@ -58,50 +58,42 @@ Format:
<tr>
<td valign=top>
<select size="6" name="SelectDisplayColumns" multiple>
-% my $i = 0;
-% while ($i < scalar @$AvailableColumns) {
-% my $field = $AvailableColumns->[$i];
-% if ($field) {
-<option value=<%$i%>
-><%$field%></option>
-% }
-% $i++;
+% foreach my $field ( @$AvailableColumns) {
+<option value="<%$field%>"><% loc( $field) %></option>
+%# $m->comp( '/Elements/RT__Ticket/ColumnMap', Name => $field, Attr => 'title') ||
% }
</select>
</td>
<td>
-Link:
-<select name=Link>
+<&|/l&>Link</&>:
+<select name="Link">
<option value="None">-</option>
-<option value="Display">Display</option>
-<option value="Take">Take</option>
+<option value="Display"><&|/l&>Display</&></option>
+<option value="Take"><&|/l&>Take</&></option>
</select>
-<br>Title: <input name="Title" size=10>
-<br>Size:
-<select name=Size>
+<br><&|/l&>Title</&>: <input name="Title" size=10>
+<br><&|/l&>Size</&>:
+<select name="Size">
<option value="">-</option>
-<option value="Small">Small</option>
-<option value="Large">Large</option>
+<option value="Small"><&|/l&>Small</&></option>
+<option value="Large"><&|/l&>Large</&></option>
</select>
-<br>Face:
-<select name=Face>
+<br><&|/l&>Style</&>:
+<select name="Face">
<option value="">-</option>
-<option value="Bold">Bold</option>
-<option value="Italic">Italic</option>
+<option value="Bold"><&|/l&>Bold</&></option>
+<option value="Italic"><&|/l&>Italic</&></option>
</select>
</td>
<td>
<input type=submit name="AddCol" value="->">
</td>
<td valign=top>
-<select size=4 name="CurrentDisplayColumns" style="width : 100%">
-% $i = 0;
-% while ($i < scalar @$CurrentFormat) {
-% my $field = $CurrentFormat->[$i];
-% if ($field) {
-<option value=<%$i%>><%$field->{Column}%></option>
-% }
-% $i++;
+<select size=4 name="CurrentDisplayColumns">
+% my $i=0;
+% foreach my $field (@$CurrentFormat) {
+<option value="<%$i++%>><%$field->{Column}%>">
+<%loc( $field->{Column}) %></option>
% }
</select>
<br>
diff --git a/rt/html/Search/Elements/EditQuery b/rt/html/Search/Elements/EditQuery
new file mode 100644
index 000000000..783541a64
--- /dev/null
+++ b/rt/html/Search/Elements/EditQuery
@@ -0,0 +1,65 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# <jesse@bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# 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 }}}
+<& NewListActions, actions => $actions &>
+<& /Elements/TitleBoxStart, title => join(': ', grep defined, loc("Query"), $Description) &>
+<select size="10" name="clauses" style="width: 100%" multiple>
+% $m->out($optionlist);
+</select>
+<p align="center">
+<input type=submit name="Up" value="^">
+<input type=submit name="Down" value="v">
+<input type=submit name="Left" value="<">
+<input type=submit name="Right" value=">">
+<input type=submit name="Toggle" value="<&|/l&>And/Or</&>">
+<input type=submit name="DeleteClause" value="<&|/l&>Delete</&>">
+%#<input type=submit name="EditQuery" value="Advanced">
+</p>
+<& /Elements/TitleBoxEnd &>
+<%ARGS>
+$Description
+$optionlist
+$actions
+</%ARGS>
diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches
index cd9f1ef3b..bc6b80e6f 100644
--- a/rt/html/Search/Elements/EditSearches
+++ b/rt/html/Search/Elements/EditSearches
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,8 +42,11 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/TitleBoxStart, title => loc('Saved searches') &>
+%# Hide all the save functionality if the user shouldn't see it.
+% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch',
+% Object=> $RT::System )) {
<&|/l&>Privacy:</&>
% if ($CurrentSearch->{'Object'} && $CurrentSearch->{'Object'}->id) {
<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &><br>
@@ -52,13 +55,14 @@
% }
<&|/l&>Description</&>:<br>
<font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}%>"></font>
-<br>
+<nobr>
% if ($SearchId ne 'new') {
% if ($Dirty) {
<input type="submit" name="Revert" value="<%loc('Revert')%>">
% }
<input type="submit" name="Delete" value="<%loc('Delete')%>">
<input type="submit" name="CopySearch" value="<%loc('Copy')%>">
+</nobr>
% }
@@ -66,12 +70,18 @@
<input type="submit" name="Save" value="<%loc('Save')%>">
% }
<hr>
+% }
<&|/l&>Load saved search:</&><br>
<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&>
<input value="<%loc('Load')%>" type="submit">
<& /Elements/TitleBoxEnd &>
<%init>
+
+unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
+ Object=> $RT::System )) {
+ return;
+}
my @Objects;
push @Objects, $session{CurrentUser}->UserObj;
diff --git a/rt/html/Search/Elements/NewListActions b/rt/html/Search/Elements/NewListActions
index 7b81d80b1..eb82544f3 100644
--- a/rt/html/Search/Elements/NewListActions
+++ b/rt/html/Search/Elements/NewListActions
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
% if ($actions[0] ) {
<b><%loc('Results')%></b><br>
% foreach my $action (@actions) {
diff --git a/rt/html/Search/Elements/PickBasics b/rt/html/Search/Elements/PickBasics
index d7e19788f..8a48f6b18 100644
--- a/rt/html/Search/Elements/PickBasics
+++ b/rt/html/Search/Elements/PickBasics
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,11 +42,18 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<tr><td>
-% foreach my $field (@fields) {
+%# END BPS TAGGED BLOCK }}}
+<tr>
+<td class="label">
+<&|/l&>id</&>
+</td><td>
+<& /Elements/SelectEqualityOperator, Name => "idOp" &>
+</td><td>
+<INPUT Name="ValueOfid" SIZE=5>
+</td>
+</tr>
+
<tr><td align=right>
-% if ($field eq "Attachment") {
<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &>
</td><td>
<& /Elements/SelectBoolean, Name => "AttachmentOp",
@@ -57,44 +64,26 @@
&>
</td><td>
<Input Name="ValueOfAttachment" Size=20>
-% } elsif ($field eq "Dates") {
-<& /Elements/SelectDateType, Name=>"DateField" &>
-</td><td>
-<& /Elements/SelectDateRelation, Name=>"DateOp" &>
-</td><td>
-<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
-% } elsif ($field eq "Links") {
-<& SelectLinks, Name=>"LinksField" &>
-</td><td>
-<& /Elements/SelectBoolean, Name => "LinksOp",
- True => loc("is"),
- False => loc("isn't"),
- TrueVal=> '=',
- FalseVal => '!='
-&>
-</td><td>
-<INPUT Name="ValueOfLinks" value="" SIZE=5>
-%} elsif ($field eq "Priority") {
-<SELECT NAME="PriorityField">
-<OPTION VALUE="Priority"><&|/l&>Priority</&></OPTION>
-<OPTION VALUE="InitialPriority"><&|/l&>Initial Priority</&></OPTION>
-<OPTION VALUE="FinalPriority"><&|/l&>Final Priority</&></OPTION>
-</SELECT>
-</td><td>
-<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
-</td><td>
-<INPUT Name="ValueOfPriority" SIZE=5>
-%} elsif ($field =~ m/Time.*/) {
-<SELECT NAME="TimeField">
-<OPTION VALUE="TimeWorked"><&|/l&>Time Worked</&></OPTION>
-<OPTION VALUE="TimeEstimated"><&|/l&>Time Estimated</&></OPTION>
-<OPTION VALUE="TimeLeft"><&|/l&>Time Left</&></OPTION>
-</SELECT>
+</td>
+</tr>
+<tr>
+<td class="label">
+<&|/l&>Queue</&>
</td><td>
-<& /Elements/SelectEqualityOperator, Name => "TimeOp" &>
+<& /Elements/SelectBoolean, Name => "QueueOp" ,
+ True => loc("is"),
+ False => loc("isn't"),
+ TrueVal=> '=',
+ FalseVal => '!=' &>
</td><td>
-<INPUT Name="ValueOfTime" SIZE=5>
-% } elsif ($field eq "Status") {
+<& /Elements/SelectQueue,
+ Name => "ValueOfQueue",
+ NamedValues => 1,
+ CheckQueueRight => 'ShowTicket' &>
+</td>
+</tr>
+<tr>
+<td class="label">
<&|/l&>Status</&>
</td><td>
<& /Elements/SelectBoolean, Name => "StatusOp",
@@ -105,32 +94,9 @@
&>
</td><td>
<& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &>
-%} elsif ($field =~ m/.*Priority/ || $field =~ m/Time.*/) {
-<&|/l&><%$field%></&>
-</td><td>
-<& /Elements/SelectEqualityOperator, Name => $field . "Op" &>
-</td><td>
-<INPUT Name="<%"ValueOf" . $field%>" SIZE=5>
-% } elsif ($field eq "Queue") {
-<&|/l&>Queue</&>
-</td><td>
-<& /Elements/SelectBoolean, Name => "QueueOp" ,
- True => loc("is"),
- False => loc("isn't"),
- TrueVal=> '=',
- FalseVal => '!=' &>
-</td><td>
-<& /Elements/SelectQueue, Name => "ValueOfQueue", NamedValues => 1 &>
-% } elsif ($field eq "id") {
-<&|/l&>Id</&>
-</td><td>
-<& /Elements/SelectEqualityOperator, Name => "idOp" &>
-</td><td>
-<INPUT Name="ValueOfid" SIZE=5>
-% } elsif ($field eq "People") {
-% foreach my $field (@people) {
+</td>
+</tr>
<tr><td class="label">
-% if ($field eq "Actor") {
<SELECT NAME="ActorField">
<OPTION VALUE="Owner"><&|/l&>Owner</&></OPTION>
<OPTION VALUE="Creator"><&|/l&>Creator</&></OPTION>
@@ -142,43 +108,80 @@
FalseVal => '!='
&>
</td><td>
-<& /Elements/SelectOwner, Name => "ValueOfActor" &>
-% } elsif ($field eq 'Watcher') {
+<& /Elements/SelectOwner, Name => "ValueOfActor", ValueAttribute => 'Name' &>
+</td>
+</tr>
+<tr>
+<td class="label">
<& SelectPersonType, Name => 'WatcherField', Default => 'Requestor' &>
</td><td>
<& /Elements/SelectMatch, Name => "WatcherOp" &>
</td><td>
<Input Name="ValueOfWatcher" Size=20>
-% } else {
-<&|/l&><%$field%></&>
-<& /Elements/SelectMatch, Name => "$field" . "Op" &>
-<INPUT Name="<%"ValueOf" . $field%>" value=""SIZE=20>
-% }
+</tr>
+<tr>
+<td class="label">
+<& SelectPersonType, Name => 'WatcherGroupField', Default => 'RequestorGroup', Suffix => 'Group' &>
+</td><td>
+<& /Elements/SelectBoolean, Name => "WatcherGroupOp",
+ True=> loc('belongs to'),
+ False=> loc('does not belong to'),
+ TrueVal=> '=',
+ FalseVal => '!='
+&>
+</td><td>
+<& SelectGroup, Name => 'ValueOfWatcherGroup' &>
+</td>
+</tr>
+<tr>
+<td class="label">
+<& /Elements/SelectDateType, Name=>"DateField" &>
+</td><td>
+<& /Elements/SelectDateRelation, Name=>"DateOp" &>
+</td><td>
+<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
</td></tr>
-% }
-% } else {
-<&|/l&><%$field%></&>
+<tr>
+<td class="label">
+<SELECT NAME="TimeField">
+<OPTION VALUE="TimeWorked"><&|/l&>Time Worked</&></OPTION>
+<OPTION VALUE="TimeEstimated"><&|/l&>Time Estimated</&></OPTION>
+<OPTION VALUE="TimeLeft"><&|/l&>Time Left</&></OPTION>
+</SELECT>
+</td><td>
+<& /Elements/SelectEqualityOperator, Name => "TimeOp" &>
</td><td>
-<& /Elements/SelectMatch, Name => "$field" . "Op" &>
+<INPUT Name="ValueOfTime" SIZE=5>
+</td>
+</tr>
+<tr>
+<td class="label">
+<SELECT NAME="PriorityField">
+<OPTION VALUE="Priority"><&|/l&>Priority</&></OPTION>
+<OPTION VALUE="InitialPriority"><&|/l&>Initial Priority</&></OPTION>
+<OPTION VALUE="FinalPriority"><&|/l&>Final Priority</&></OPTION>
+</SELECT>
+</td><td>
+<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &>
</td><td>
-<INPUT Name="<%"ValueOf" . $field%>" value="" SIZE=20>
-% }
+<INPUT Name="ValueOfPriority" SIZE=5>
+</td>
+</tr>
+<tr>
+<td class="label">
+<& SelectLinks, Name=>"LinksField" &>
+</td><td>
+<& /Elements/SelectBoolean, Name => "LinksOp",
+ True => loc("is"),
+ False => loc("isn't"),
+ TrueVal=> '=',
+ FalseVal => '!=' &>
+</td><td>
+<INPUT Name="ValueOfLinks" value="" SIZE=5>
</td></tr>
-% }
-<& '/Elements/Callback', _CallbackName => 'EndOfList' &>
<%INIT>
-my @fields = ('Attachment',
- 'Queue',
- 'Status',
- 'People',
- 'Dates',
- 'Time',
- 'Priority',
- 'Links',
- 'id',
- );
-
my @people = ('Actor',
'Watcher',
+ 'WatcherGroup',
);
</%INIT>
diff --git a/rt/html/Search/Elements/PickCFs b/rt/html/Search/Elements/PickCFs
index fb143ba57..435a07ad3 100644
--- a/rt/html/Search/Elements/PickCFs
+++ b/rt/html/Search/Elements/PickCFs
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,24 +42,17 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
% while ( my $CustomField = $CustomFields->Next ) {
-<tr><td class=label>
-
-% my $name;
-% if ($CustomField->QueueObj->id) {
-% $name = "'CF." . $CustomField->QueueObj->Name .
-% ".{" . $CustomField->Name . "}'";
-% } else {
-% $name = "'CF." . $CustomField->Name . "'";
-% }
+% my $name = "'CF.{" . $CustomField->Name . "}'";
+<tr><td class="label">
<% $CustomField->Name %>
</td>
<td>
-<& /Elements/SelectCustomFieldOperator, Name => $name . "Op",
- True => loc("is"),
- False => loc("isn't"),
- TrueVal=> '=', FalseVal => '!=' &>
+ <& /Elements/SelectCustomFieldOperator, Name => $name . "Op",
+ True => loc("is"),
+ False => loc("isn't"),
+ TrueVal=> '=', FalseVal => '!=' &>
</td>
<td>
<& /Elements/SelectCustomFieldValue, Name => "ValueOf" . $name,
@@ -67,13 +60,11 @@
&>
</td></tr>
% }
-
<%INIT>
my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'});
-foreach (keys %cfqueues) {
- my $id = $_;
+foreach my $id (keys %cfqueues) {
$id =~ s/^.'*(.*).'*$/$1/;
- # Gotta load up the $queue object, since queues get stored by name now.
+ # Gotta load up the $queue object, since queues get stored by name now. my $id
my $queue = RT::Queue->new($session{'CurrentUser'});
$queue->Load($id);
$CustomFields->LimitToQueue($queue->Id);
diff --git a/rt/html/Search/Elements/PickCriteria b/rt/html/Search/Elements/PickCriteria
index 344830e34..129344443 100644
--- a/rt/html/Search/Elements/PickCriteria
+++ b/rt/html/Search/Elements/PickCriteria
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,26 +42,32 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<& /Elements/TitleBoxStart, title => loc('Add Criteria')&>
<table width=100% cellspacing=0 cellpadding=0 border=0>
<tr>
<td>
<table cellspacing=0 border=0>
<tr><td class=label>
- Aggregator:
+ <&|/l&>Aggregator</&>:
</td>
<td><& SelectAndOr, Name => "AndOr" &>
</td></tr>
</table>
</td></tr>
<tr>
- <td colspan=3>
+ <td>
<hr>
</td>
</tr>
- <& PickBasics &>
- <& PickCFs, cfqueues => \%cfqueues &>
+ <tr>
+ <td valign=top>
+ <table cellspacing=0 border=0>
+ <& PickBasics &>
+ <& PickCFs, cfqueues => \%cfqueues &>
+ </table>
+ </td>
+ </tr>
<tr><td>&nbsp;</td></tr>
</table>
diff --git a/rt/html/Search/Elements/SearchPrivacy b/rt/html/Search/Elements/SearchPrivacy
index 5f6f207fe..270e1baa3 100644
--- a/rt/html/Search/Elements/SearchPrivacy
+++ b/rt/html/Search/Elements/SearchPrivacy
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<%args>
$Object => undef
</%args>
diff --git a/rt/html/Search/Elements/SelectAndOr b/rt/html/Search/Elements/SelectAndOr
index 11df03ff1..2f3c70477 100644
--- a/rt/html/Search/Elements/SelectAndOr
+++ b/rt/html/Search/Elements/SelectAndOr
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,10 +42,10 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
-<input type=radio NAME="<%$Name%>" CHECKED VALUE="AND">AND</input>
-<input type=radio NAME="<%$Name%>" VALUE="OR">OR</input>
+%# END BPS TAGGED BLOCK }}}
+<input type=radio NAME="<%$Name%>" CHECKED VALUE="AND"><&|/l&>AND</&></input>
+<input type=radio NAME="<%$Name%>" VALUE="OR"><&|/l&>OR</&></input>
<%ARGS>
$Name => "Operator"
-</%ARGS> \ No newline at end of file
+</%ARGS>
diff --git a/rt/html/Search/Elements/SelectGroup b/rt/html/Search/Elements/SelectGroup
new file mode 100644
index 000000000..edd53713f
--- /dev/null
+++ b/rt/html/Search/Elements/SelectGroup
@@ -0,0 +1,65 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
+%# <jesse@bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# 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 }}}
+<SELECT NAME="<%$Name%>">
+% if ($AllowNull) {
+<OPTION VALUE="">-</OPTION>
+% }
+%while (my $group = $groups->Next) {
+<OPTION VALUE="<%$group->id%>" <%$group->id eq $Default && "SELECTED"%>><%$group->Name%></OPTION>
+%}
+</SELECT>
+
+<%INIT>
+my $groups = new RT::Groups($session{'CurrentUser'});
+$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain);
+
+</%INIT>
+<%ARGS>
+$AllowNull => 1
+$Default=> ''
+$Name => 'Group'
+$Domain => 'UserDefined';
+</%ARGS>
diff --git a/rt/html/Search/Elements/SelectLinks b/rt/html/Search/Elements/SelectLinks
index b814e3088..00ec80bd3 100644
--- a/rt/html/Search/Elements/SelectLinks
+++ b/rt/html/Search/Elements/SelectLinks
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME="<%$Name%>">
% foreach (@fields) {
<OPTION VALUE="<%$_%>"><&|/l&><%$_%></&></OPTION>
@@ -56,7 +56,7 @@ $Name => 'LinksField'
my @fields = ('HasMember',
'MemberOf',
'DependsOn',
- 'DependentOn',
+ 'DependedOnBy',
'RefersTo',
'ReferredToBy',
'LinkedTo',
diff --git a/rt/html/Search/Elements/SelectPersonType b/rt/html/Search/Elements/SelectPersonType
index 01f389304..d4127c97b 100644
--- a/rt/html/Search/Elements/SelectPersonType
+++ b/rt/html/Search/Elements/SelectPersonType
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,16 +42,20 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<SELECT NAME ="<%$Name%>">
% if ($AllowNull) {
<OPTION VALUE="">-</OPTION>
% }
-%for my $option (@types) {
-%foreach my $subtype (@subtypes) {
-<OPTION VALUE="<%"$option.$subtype"%>" <%$option eq $Default && $subtype eq 'EmailAddress' && "SELECTED"%> ><%loc("[_1] [_2]",$option, $subtype)%></OPTION>
+% for my $option (@types) {
+% if ($Suffix) {
+<OPTION VALUE="<% $option %><% $Suffix %>" <%$option eq $Default && "SELECTED"%> ><%loc($option)%></OPTION>
+% next;
+% }
+% foreach my $subtype (@subtypes) {
+<OPTION VALUE="<%"$option.$subtype"%>" <%$option eq $Default && $subtype eq 'EmailAddress' && "SELECTED"%> ><% loc($option) %> <% loc($subtype) %></OPTION>
+% }
% }
-%}
</SELECT>
<%INIT>
@@ -59,6 +63,9 @@ my @types;
if ($Scope =~ 'queue') {
@types = qw(Cc AdminCc);
}
+elsif ($Suffix eq 'Group') {
+ @types = qw(Requestor Cc AdminCc Watcher);
+}
else {
@types = qw(Requestor Cc AdminCc Watcher Owner);
}
@@ -68,6 +75,7 @@ my @subtypes = qw(EmailAddress Name RealName Nickname Organization Address1 Addr
</%INIT>
<%ARGS>
$AllowNull => 1
+$Suffix => ''
$Default=>undef
$Scope => 'ticket'
$Name => 'WatcherType'
diff --git a/rt/html/Search/Elements/SelectSearchObject b/rt/html/Search/Elements/SelectSearchObject
index 6eaa680f8..e9df5179f 100644
--- a/rt/html/Search/Elements/SelectSearchObject
+++ b/rt/html/Search/Elements/SelectSearchObject
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<%args>
@Objects => undef
$Name => undef
diff --git a/rt/html/Search/Elements/SelectSearchesForObjects b/rt/html/Search/Elements/SelectSearchesForObjects
index 3f0c458cb..e6be66a58 100644
--- a/rt/html/Search/Elements/SelectSearchesForObjects
+++ b/rt/html/Search/Elements/SelectSearchesForObjects
@@ -1,8 +1,8 @@
-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -42,7 +42,7 @@
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
<%args>
@Objects => undef
$Name => undef
@@ -57,6 +57,9 @@ $Name => undef
% }
% my @searches = $object->Attributes->Named('SavedSearch');
% foreach my $search (@searches) {
+% # Skip it if it is not a ticket search.
+% next if ($search->SubValue('SearchType')
+% && $search->SubValue('SearchType') ne 'Ticket');
<option value="<%ref($object)%>-<%$object->id%>-SavedSearch-<%$search->Id%>"> -<%$search->Description||loc('Unnamed search')%></option>
% }
% }