From d39d52aac8f38ea9115628039f0df5aa3ac826de Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 3 Dec 2004 20:40:48 +0000 Subject: import rt 3.2.2 --- rt/html/Search/Elements/BuildFormatString | 215 +++++++++++++++++++++++ rt/html/Search/Elements/DisplayOptions | 109 ++++++++++++ rt/html/Search/Elements/EditFormat | 122 +++++++++++++ rt/html/Search/Elements/EditSearches | 94 ++++++++++ rt/html/Search/Elements/NewListActions | 66 +++++++ rt/html/Search/Elements/PickBasics | 184 +++++++++++++++++++ rt/html/Search/Elements/PickCFs | 87 +++++++++ rt/html/Search/Elements/PickCriteria | 74 ++++++++ rt/html/Search/Elements/SearchPrivacy | 53 ++++++ rt/html/Search/Elements/SelectAndOr | 51 ++++++ rt/html/Search/Elements/SelectLinks | 64 +++++++ rt/html/Search/Elements/SelectPersonType | 74 ++++++++ rt/html/Search/Elements/SelectSearchObject | 58 ++++++ rt/html/Search/Elements/SelectSearchesForObjects | 63 +++++++ 14 files changed, 1314 insertions(+) create mode 100644 rt/html/Search/Elements/BuildFormatString create mode 100644 rt/html/Search/Elements/DisplayOptions create mode 100644 rt/html/Search/Elements/EditFormat create mode 100644 rt/html/Search/Elements/EditSearches create mode 100644 rt/html/Search/Elements/NewListActions create mode 100644 rt/html/Search/Elements/PickBasics create mode 100644 rt/html/Search/Elements/PickCFs create mode 100644 rt/html/Search/Elements/PickCriteria create mode 100644 rt/html/Search/Elements/SearchPrivacy create mode 100644 rt/html/Search/Elements/SelectAndOr create mode 100644 rt/html/Search/Elements/SelectLinks create mode 100644 rt/html/Search/Elements/SelectPersonType create mode 100644 rt/html/Search/Elements/SelectSearchObject create mode 100644 rt/html/Search/Elements/SelectSearchesForObjects (limited to 'rt/html/Search/Elements') diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString new file mode 100644 index 000000000..e5e131b6c --- /dev/null +++ b/rt/html/Search/Elements/BuildFormatString @@ -0,0 +1,215 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<%args> +$Format => undef +%cfqueues => undef + +<%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", + "-", +); + +my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); +foreach (keys %cfqueues) { + my $id = $_; + $id =~ s/^.'*(.*).'*$/$1/; + # Gotta load up the $queue object, since queues get stored by name now. + my $queue = RT::Queue->new($session{'CurrentUser'}); + $queue->Load($id); + $CustomFields->LimitToQueue($queue->Id); +} +$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 . "}"; +} + +my ( @seen); + +my @format = split( /,\s*/, $Format ); +foreach my $field (@format) { + my %column = (); + $field =~ s/'(.*)'/$1/; + my ( $prefix, $suffix ); + if ( $field =~ m/(.*)__(.*)__(.*)/ ) { + $prefix = $1; + $suffix = $3; + $field = $2; + } + $field = "" if !$field; + $column{Prefix} = $prefix; + $column{Suffix} = $suffix; + $field =~ s/\s*(.*)\s*/$1/; + $column{Column} = $field; + push @seen, \%column; +} + +if ( $ARGS{"RemoveCol"} ) { + my $index = $ARGS{'CurrentDisplayColumns'}; + my $column = $seen[$index]; + if ($index) { + delete $seen[$index]; + my @temp = @seen; + @seen = (); + foreach my $element (@temp) { + next unless $element; + push @seen, $element; + } + } +} +elsif ( $ARGS{"AddCol"} ) { + if ( defined $ARGS{'SelectDisplayColumns'} ) { + my $selected = $ARGS{'SelectDisplayColumns'}; + my @columns; + if (ref($selected) eq 'ARRAY') { + @columns = @$selected; + } else { + push @columns, $selected; + } + foreach my $col (@columns) { + my %column = (); + $column{Column} = $fields[ $col ]; + + if ( $ARGS{Face} eq "Bold" ) { + $column{Prefix} .= ""; + } + if ( $ARGS{Face} eq "Italic" ) { + $column{Prefix} .= ""; + } + if ( $ARGS{Size} ) { + $column{Prefix} .= "<" . $ARGS{Size} . ">"; + } + if ( $ARGS{Link} eq "Display" ) { + $column{Prefix} .= ""; + } + elsif ( $ARGS{Link} eq "Take" ) { + $column{Prefix} .= + ""; + } + + my $suffix; + if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) { + $column{Suffix} .= ""; + } + if ( $ARGS{Size} ) { + $column{Suffix} .= ""; + } + if ( $ARGS{Face} eq "Italic" ) { + $column{Suffix} .= ""; + } + if ( $ARGS{Face} eq "Bold" ) { + $column{Suffix} .= ""; + } + if ( $ARGS{Title} ) { + $column{Suffix} .= "/TITLE:" . $ARGS{Title}; + } + push @seen, \%column; + } + } +} +elsif ( $ARGS{"ColUp"} ) { + my $index = $ARGS{'CurrentDisplayColumns'}; + if ( defined $index && ( $index - 1 ) >= 0 ) { + my $column = $seen[$index]; + $seen[$index] = $seen[ $index - 1 ]; + $seen[ $index - 1 ] = $column; + $ARGS{CurrentDisplayColumns} = $index - 1; + } +} +elsif ( $ARGS{"ColDown"} ) { + my $index = $ARGS{'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; + } +} + +$Format = ""; +foreach my $field (@seen) { + next unless $field; + $Format .= ", \n" if $Format; + $Format .= "'"; + $Format .= $field->{Prefix}; + $Format .= "__" . $field->{Column} . "__" if ( $field->{Column} ne "" ) ; + $Format .= $field->{Suffix}; + $Format .= "'"; +} +return($Format, \@fields, \@seen); + + + diff --git a/rt/html/Search/Elements/DisplayOptions b/rt/html/Search/Elements/DisplayOptions new file mode 100644 index 000000000..330948d32 --- /dev/null +++ b/rt/html/Search/Elements/DisplayOptions @@ -0,0 +1,109 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<& /Elements/TitleBoxStart, title => loc("Display Columns") &> + + + + + +
+<& EditFormat, %ARGS &> + + + + + + + +
+<&|/l&>Order by: + + + +
+<&|/l&>Rows per page: + +<& /Elements/SelectResultsPerPage, + Name => "RowsPerPage", + Default => $RowsPerPage &> +
+
+<& /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; + + + +<%ARGS> +$Order => undef +$OrderBy => undef +$RowsPerPage => undef +$Format => undef + diff --git a/rt/html/Search/Elements/EditFormat b/rt/html/Search/Elements/EditFormat new file mode 100644 index 000000000..7d314aee6 --- /dev/null +++ b/rt/html/Search/Elements/EditFormat @@ -0,0 +1,122 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 + + + + + + + + + + + + + +
+<&|/l&>Available Columns: + +Format: + +<&|/l&>Show Columns: +
+ + +Link: + +
Title: +
Size: + +
Face: + +
+ + + +
+
+ + + +
+
+
+ +<%ARGS> +$CurrentFormat => undef +$AvailableColumns => undef + diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches new file mode 100644 index 000000000..cd9f1ef3b --- /dev/null +++ b/rt/html/Search/Elements/EditSearches @@ -0,0 +1,94 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<& /Elements/TitleBoxStart, title => loc('Saved searches') &> +<&|/l&>Privacy: +% if ($CurrentSearch->{'Object'} && $CurrentSearch->{'Object'}->id) { +<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &>
+% } else { +<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &>
+% } +<&|/l&>Description:
+ +
+% if ($SearchId ne 'new') { +% if ($Dirty) { + +% } + + + +% } + +% if ($Dirty or $SearchId eq 'new') { + +% } +
+<&|/l&>Load saved search:
+<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&> + +<& /Elements/TitleBoxEnd &> + +<%init> +my @Objects; + +push @Objects, $session{CurrentUser}->UserObj; + +my $groups = RT::Groups->new($session{'CurrentUser'}); + +$groups->LimitToUserDefinedGroups; +$groups->WithMember(PrincipalId => $session{'CurrentUser'}->Id, + Recursively => 1); + + push (@Objects, @{$groups->ItemsArrayRef()}); + + +<%ARGS> +$SearchId => undef +$CurrentSearch => undef +$Description => undef +$HideResults => 0 +$Dirty => 0 + diff --git a/rt/html/Search/Elements/NewListActions b/rt/html/Search/Elements/NewListActions new file mode 100644 index 000000000..7b81d80b1 --- /dev/null +++ b/rt/html/Search/Elements/NewListActions @@ -0,0 +1,66 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +% if ($actions[0] ) { +<%loc('Results')%>
+% foreach my $action (@actions) { +% next unless ($action); +% my @item = @$action; +% if ($item[1] < 0) { + +% } + <%$item[0]%>
+% if ($item[1] < 0) { +
+% } +% } +
+% } +<%init> +@actions = grep (/./,@actions); + +<%ARGS> +@actions => undef + diff --git a/rt/html/Search/Elements/PickBasics b/rt/html/Search/Elements/PickBasics new file mode 100644 index 000000000..d7e19788f --- /dev/null +++ b/rt/html/Search/Elements/PickBasics @@ -0,0 +1,184 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 + +% foreach my $field (@fields) { + +% if ($field eq "Attachment") { +<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> + +<& /Elements/SelectBoolean, Name => "AttachmentOp", + True => loc("matches"), + False => loc("does not match"), + TrueVal => 'LIKE', + FalseVal => 'NOT LIKE' +&> + + +% } elsif ($field eq "Dates") { +<& /Elements/SelectDateType, Name=>"DateField" &> + +<& /Elements/SelectDateRelation, Name=>"DateOp" &> + +<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> +% } elsif ($field eq "Links") { +<& SelectLinks, Name=>"LinksField" &> + +<& /Elements/SelectBoolean, Name => "LinksOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' +&> + + +%} elsif ($field eq "Priority") { + + +<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> + + +%} elsif ($field =~ m/Time.*/) { + + +<& /Elements/SelectEqualityOperator, Name => "TimeOp" &> + + +% } elsif ($field eq "Status") { +<&|/l&>Status + +<& /Elements/SelectBoolean, Name => "StatusOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' +&> + +<& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &> +%} elsif ($field =~ m/.*Priority/ || $field =~ m/Time.*/) { +<&|/l&><%$field%> + +<& /Elements/SelectEqualityOperator, Name => $field . "Op" &> + +" SIZE=5> +% } elsif ($field eq "Queue") { +<&|/l&>Queue + +<& /Elements/SelectBoolean, Name => "QueueOp" , + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> + +<& /Elements/SelectQueue, Name => "ValueOfQueue", NamedValues => 1 &> +% } elsif ($field eq "id") { +<&|/l&>Id + +<& /Elements/SelectEqualityOperator, Name => "idOp" &> + + +% } elsif ($field eq "People") { +% foreach my $field (@people) { + +% if ($field eq "Actor") { + + +<& /Elements/SelectBoolean, Name => "ActorOp", + TrueVal=> '=', + FalseVal => '!=' +&> + +<& /Elements/SelectOwner, Name => "ValueOfActor" &> +% } elsif ($field eq 'Watcher') { +<& SelectPersonType, Name => 'WatcherField', Default => 'Requestor' &> + +<& /Elements/SelectMatch, Name => "WatcherOp" &> + + +% } else { +<&|/l&><%$field%> +<& /Elements/SelectMatch, Name => "$field" . "Op" &> +" value=""SIZE=20> +% } + +% } +% } else { +<&|/l&><%$field%> + +<& /Elements/SelectMatch, Name => "$field" . "Op" &> + +" value="" SIZE=20> +% } + +% } +<& '/Elements/Callback', _CallbackName => 'EndOfList' &> +<%INIT> +my @fields = ('Attachment', + 'Queue', + 'Status', + 'People', + 'Dates', + 'Time', + 'Priority', + 'Links', + 'id', + ); + +my @people = ('Actor', + 'Watcher', + ); + diff --git a/rt/html/Search/Elements/PickCFs b/rt/html/Search/Elements/PickCFs new file mode 100644 index 000000000..fb143ba57 --- /dev/null +++ b/rt/html/Search/Elements/PickCFs @@ -0,0 +1,87 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +% while ( my $CustomField = $CustomFields->Next ) { + + +% my $name; +% if ($CustomField->QueueObj->id) { +% $name = "'CF." . $CustomField->QueueObj->Name . +% ".{" . $CustomField->Name . "}'"; +% } else { +% $name = "'CF." . $CustomField->Name . "'"; +% } +<% $CustomField->Name %> + + +<& /Elements/SelectCustomFieldOperator, Name => $name . "Op", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', FalseVal => '!=' &> + + +<& /Elements/SelectCustomFieldValue, Name => "ValueOf" . $name, + CustomField => $CustomField, + &> + +% } + +<%INIT> +my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); +foreach (keys %cfqueues) { + my $id = $_; + $id =~ s/^.'*(.*).'*$/$1/; + # Gotta load up the $queue object, since queues get stored by name now. + my $queue = RT::Queue->new($session{'CurrentUser'}); + $queue->Load($id); + $CustomFields->LimitToQueue($queue->Id); +} +$CustomFields->LimitToGlobal(); + + + +<%ARGS> +%cfqueues => undef + diff --git a/rt/html/Search/Elements/PickCriteria b/rt/html/Search/Elements/PickCriteria new file mode 100644 index 000000000..344830e34 --- /dev/null +++ b/rt/html/Search/Elements/PickCriteria @@ -0,0 +1,74 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<& /Elements/TitleBoxStart, title => loc('Add Criteria')&> + + + + + + + <& PickBasics &> + <& PickCFs, cfqueues => \%cfqueues &> + +
+ + + +
+ Aggregator: + <& SelectAndOr, Name => "AndOr" &> +
+
+
+
 
+ +<& /Elements/TitleBoxEnd &> + +<%ARGS> +$addquery => 0 +$query => undef +%cfqueues => undef + diff --git a/rt/html/Search/Elements/SearchPrivacy b/rt/html/Search/Elements/SearchPrivacy new file mode 100644 index 000000000..5f6f207fe --- /dev/null +++ b/rt/html/Search/Elements/SearchPrivacy @@ -0,0 +1,53 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<%args> +$Object => undef + +% if (ref($Object) eq 'RT::User' && $Object->id == $session{'CurrentUser'}->Id) { +<&|/l&>My saved searches +% } else { +<&|/l, $Object->Name&>[_1]'s saved searches +% } diff --git a/rt/html/Search/Elements/SelectAndOr b/rt/html/Search/Elements/SelectAndOr new file mode 100644 index 000000000..11df03ff1 --- /dev/null +++ b/rt/html/Search/Elements/SelectAndOr @@ -0,0 +1,51 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +AND +OR + +<%ARGS> +$Name => "Operator" + \ No newline at end of file diff --git a/rt/html/Search/Elements/SelectLinks b/rt/html/Search/Elements/SelectLinks new file mode 100644 index 000000000..b814e3088 --- /dev/null +++ b/rt/html/Search/Elements/SelectLinks @@ -0,0 +1,64 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 + +<%ARGS> +$Name => 'LinksField' + + +<%INIT> +my @fields = ('HasMember', + 'MemberOf', + 'DependsOn', + 'DependentOn', + 'RefersTo', + 'ReferredToBy', + 'LinkedTo', + ); + diff --git a/rt/html/Search/Elements/SelectPersonType b/rt/html/Search/Elements/SelectPersonType new file mode 100644 index 000000000..01f389304 --- /dev/null +++ b/rt/html/Search/Elements/SelectPersonType @@ -0,0 +1,74 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 + + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc Watcher Owner); +} + +my @subtypes = qw(EmailAddress Name RealName Nickname Organization Address1 Address2 WorkPhone HomePhone MobilePhone PagerPhone); + + +<%ARGS> +$AllowNull => 1 +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' + diff --git a/rt/html/Search/Elements/SelectSearchObject b/rt/html/Search/Elements/SelectSearchObject new file mode 100644 index 000000000..6eaa680f8 --- /dev/null +++ b/rt/html/Search/Elements/SelectSearchObject @@ -0,0 +1,58 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<%args> +@Objects => undef +$Name => undef + + diff --git a/rt/html/Search/Elements/SelectSearchesForObjects b/rt/html/Search/Elements/SelectSearchesForObjects new file mode 100644 index 000000000..3f0c458cb --- /dev/null +++ b/rt/html/Search/Elements/SelectSearchesForObjects @@ -0,0 +1,63 @@ +%# {{{ BEGIN BPS TAGGED BLOCK +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# +%# +%# (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 +<%args> +@Objects => undef +$Name => undef + + -- cgit v1.2.1