From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/Search/Bulk.html | 217 +++++++++++++++++++++++++++++++ rt/html/Search/Elements/PickRestriction | 141 ++++++++++++++++++++ rt/html/Search/Elements/TicketHeader | 40 ++++++ rt/html/Search/Elements/TicketHeaderCell | 55 ++++++++ rt/html/Search/Elements/TicketRow | 55 ++++++++ rt/html/Search/Listing.html | 112 ++++++++++++++++ 6 files changed, 620 insertions(+) create mode 100644 rt/html/Search/Bulk.html create mode 100644 rt/html/Search/Elements/PickRestriction create mode 100644 rt/html/Search/Elements/TicketHeader create mode 100644 rt/html/Search/Elements/TicketHeaderCell create mode 100644 rt/html/Search/Elements/TicketRow create mode 100644 rt/html/Search/Listing.html (limited to 'rt/html/Search') diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html new file mode 100644 index 000000000..df43cfa50 --- /dev/null +++ b/rt/html/Search/Bulk.html @@ -0,0 +1,217 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Bulk ticket update") &> +<& /Elements/Tabs, Title => loc("Bulk ticket update") &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + +%foreach my $col (@cols) { +% my $colalias = $col; +% $colalias =~ s/(Obj\-\>|)(Name|AsString)//; + + +%} + + +<%PERL> + +my $i; + + + +$session{'tickets'}->RedoSearch(); +while (my $Ticket = $session{'tickets'}->Next) { + $i++; + if ($i % 2) { + $bgcolor = "#dddddd"; + } + else { + $bgcolor = "#ffffff"; + } + + + +%# The ticket view is controlled by config.pm, WebOptions +%foreach my $col (@cols) { + +%} + +%} + + + +
<&|/l&>Update<% loc($colalias) %> 
+% if ($col eq 'id') { +<%$Ticket->Id()%> +% } +%else { +<% eval "\$Ticket->$col()" %>  +%} +
+ +
+ + +<& /Elements/TitleBoxStart, title => loc('Update selected tickets') &> + + + + + +
+ + + + + + + + + + + + + + + +
<&|/l&>Make Owner: <& /Elements/SelectOwner, Name => "Owner" &> ( <&|/l&>Force change)
<&|/l&>Add Requestor:
<&|/l&>Remove Requestor:
<&|/l&>Add Cc:
<&|/l&>Remove Cc:
<&|/l&>Add AdminCc:
<&|/l&>Remove AdminCc:
+
+ + + + + + + + + + + + + + + + + + + +
<&|/l&>Make subject:
<&|/l&>Make priority:
<&|/l&>Make queue: <& /Elements/SelectQueue, Name => "Queue" &>
<&|/l&>Make Status: <& /Elements/SelectStatus, Name => "Status" &>
<&|/l&>Make date Starts: <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Started: <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Told: <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Due: <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &>
<&|/l&>Make date Resolved: <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &>
+ +
+<& /Elements/TitleBoxEnd&> +<& /Elements/TitleBoxStart, title => loc('Add comments or replies to selected tickets') &> + + + + + + +
<&|/l&>Update Type: +
<&|/l&>Subject:
<&|/l&>Attach:
<&|/l&>Message: + <& /Elements/MessageBox, Name=>"UpdateContent"&> +
+<& /Elements/TitleBoxEnd &> + +<& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> +<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
+<& /Ticket/Elements/BulkLinks &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit &> + + +
+<%INIT> + +# Iterate through the ARGS hash and remove anything with a null value. +map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); + +my ($bgcolor, @results); +my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString ); + +Abort(loc("No search to operate on.")) unless ($session{'tickets'}); + + +my $do_comment_reply=0; +# Prepare for ticket updates +$ARGS{'UpdateContent'} =~ s/\r\n/\n/g; +chomp ($ARGS{'UpdateContent'}) ; + +if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature) { + $do_comment_reply=1; +} + +#Iterate through each ticket we've been handed +my @linkresults; + +while (my $Ticket = $session{'tickets'}->Next) { + $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); + next unless ($ARGS{"UpdateTicket".$Ticket->Id}); + $RT::Logger->debug ("Matched\n"); + #Update the basics. + my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); + my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); + #Update the watchers + my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); + + #Update the links + $ARGS{'id'} = $Ticket; + $ARGS{$Ticket->Id.'-MergeInto'} = $ARGS{'Ticket-MergeInto'}; + $ARGS{$Ticket->Id.'-DependsOn'} = $ARGS{'Ticket-DependsOn'}; + $ARGS{'DependsOn-'.$Ticket->Id} = $ARGS{'DependsOn-Ticket'}; + $ARGS{$Ticket->Id.'-MemberOf'} = $ARGS{'Ticket-MemberOf'}; + $ARGS{'MemberOf-'.$Ticket->Id} = $ARGS{'MemberOf-Ticket'}; + $ARGS{$Ticket->Id.'-RefersTo'} = $ARGS{'Ticket-RefersTo'}; + $ARGS{'RefersTo-'.$Ticket->Id} = $ARGS{'RefersTo-Ticket'}; + @linkresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + delete $ARGS{'id'}; + delete $ARGS{$Ticket->Id.'-MergeInto'}; + delete $ARGS{$Ticket->Id.'-DependsOn'}; + delete $ARGS{'DependsOn-'.$Ticket->Id}; + delete $ARGS{$Ticket->Id.'-MemberOf'}; + delete $ARGS{'MemberOf-'.$Ticket->Id}; + delete $ARGS{$Ticket->Id.'-RefersTo'}; + delete $ARGS{'RefersTo-'.$Ticket->Id}; + + my @updateresults; + if ($do_comment_reply) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); + } + my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults); + @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; + + @results = (@results, @tempresults); +} + + diff --git a/rt/html/Search/Elements/PickRestriction b/rt/html/Search/Elements/PickRestriction new file mode 100644 index 000000000..a6911df5a --- /dev/null +++ b/rt/html/Search/Elements/PickRestriction @@ -0,0 +1,141 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +
+ +<& /Elements/TitleBoxStart, title => loc('Refine search')&> + + +
    +
  • <&|/l&>Owner is <& /Elements/SelectBoolean, Name => "OwnerOp", + TrueVal=> '=', + FalseVal => '!=' +&> +<& /Elements/SelectOwner, Name => "ValueOfOwner" &> + +
  • +<&|/l&>Requestor email address +<& /Elements/SelectMatch, Name => "RequestorOp" &> + + +
  • +<&|/l&>Subject <& /Elements/SelectMatch, Name => "SubjectOp" &> + + +
  • <&|/l&>Queue <& /Elements/SelectBoolean, Name => "QueueOp" , + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> +<& /Elements/SelectQueue, Name => loc("ValueOfQueue") &> + + +
  • <&|/l&>Priority <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> + + + +
  • +<& /Elements/SelectDateType, Name => 'DateType' &> +<& /Elements/SelectDateRelation, Name=>"DateOp" &> +<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> + +
  • <&|/l&>Ticket attachment + +<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> +<& /Elements/SelectBoolean, Name => "AttachmentFieldOp", + True => loc("matches"), + False => loc("does not match"), + TrueVal => 'LIKE', + FalseVal => 'NOT LIKE' +&> + + +
  • <&|/l&>Status +<& /Elements/SelectBoolean, Name => "StatusOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' +&> +<& /Elements/SelectStatus, Name => "ValueOfStatus" &> + + +% while ( my $CustomField = $CustomFields->Next ) { + +
  • <% $CustomField->Name %> + <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id, + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', FalseVal => '!=' &> + +<& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id, + CustomField => $CustomField, + &> +% } + +
+ +<& /Elements/TitleBoxEnd &> + +<& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&> + +
    + +
  • <&|/l&>Results per page <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", + Default => $session{'tickets_rows_per_page'} || '50' +&> + +
  • <&|/l&>Sort results by <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", + Default => $session{'tickets_sort_by'} +&> +<& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &> + +
  • > <&|/l&>Don't show search results +
  • <& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &> + +
+ + + + + + +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => loc('Search'), Name => 'Action'&> + +
+ + + <%INIT> +my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); + foreach ( $session{'tickets'}->RestrictionValues('Queue') ) { + # Gotta load up the $queue object, since queues get stored by name now. + my $queue = RT::Queue->new($session{'CurrentUser'}); + $queue->Load($_); + $CustomFields->LimitToQueue($queue->Id); + } + + $CustomFields->LimitToGlobal(); + + diff --git a/rt/html/Search/Elements/TicketHeader b/rt/html/Search/Elements/TicketHeader new file mode 100644 index 000000000..ed2f60e4e --- /dev/null +++ b/rt/html/Search/Elements/TicketHeader @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + +<& TicketHeaderCell , Attribute => 'id', Header => '#'&> +<& TicketHeaderCell , Attribute => 'Subject'&> +<& TicketHeaderCell , Attribute => 'Status'&> +<& TicketHeaderCell , Attribute => 'Queue'&> +<& TicketHeaderCell , Attribute => 'Owner'&> +<& TicketHeaderCell , Attribute => 'Priority'&> + + +  +<& TicketHeaderCell , Attribute => 'Requestor(s)'&> +<& TicketHeaderCell , Attribute => 'Created'&> +<& TicketHeaderCell , Attribute => 'Told', Header => 'Last Contact'&> +<& TicketHeaderCell , Attribute => 'LastUpdated', Header => 'Last Updated'&> +<& TicketHeaderCell , Attribute => 'TimeLeft', Header => 'Left'&> + +%# loc('Last Notified'); diff --git a/rt/html/Search/Elements/TicketHeaderCell b/rt/html/Search/Elements/TicketHeaderCell new file mode 100644 index 000000000..5def9ea37 --- /dev/null +++ b/rt/html/Search/Elements/TicketHeaderCell @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<%INIT> +my ($order,$curorder); + $Attribute =~ s/Obj->(Name|AsString|AgeAsString)//g; + if ($session{'tickets_sort_order'} =~ /^asc$/i) { + $order = 'DESC'; + $curorder = 'ASC'; + } else { + $order = 'ASC'; + $curorder = 'DESC'; + } +$Header = $Attribute unless ($Header); + + + +% if (grep (/^$Attribute$/i, $session{'tickets'}->SortFields)) { + +% } else { +HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$Attribute%>&TicketsSortOrder=<%$curorder%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"> +% } +<% loc($Header) %> + +% } else { +<% loc($Header) %> +% } + +<%ARGS> +$Header => undef +$Attribute => undef + diff --git a/rt/html/Search/Elements/TicketRow b/rt/html/Search/Elements/TicketRow new file mode 100644 index 000000000..5d1ad209a --- /dev/null +++ b/rt/html/Search/Elements/TicketRow @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK + + +<%$Ticket->id%> +<%$Ticket->Subject%> +<%loc($Ticket->Status)%> +<%$Ticket->QueueObj->Name%> +<%$Ticket->Owner == $RT::Nobody->Id ? loc('Nobody') : $Ticket->OwnerObj->Name%> +<%$Ticket->Priority%> + +<%$Ticket->Requestors->MemberEmailAddressesAsString%> +<%$Ticket->CreatedObj->AgeAsString || '-'%> +<%$Ticket->ToldObj->AgeAsString || '-'%> +<%$Ticket->LastUpdatedObj->AgeAsString || '-'%> +<%$Ticket->TimeLeft%> + + +<%ARGS> +$Ticket => undef +$i => undef + diff --git a/rt/html/Search/Listing.html b/rt/html/Search/Listing.html new file mode 100644 index 000000000..508534549 --- /dev/null +++ b/rt/html/Search/Listing.html @@ -0,0 +1,112 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# Unless otherwise specified, all modifications, corrections or +%# extensions to this work which alter its source code become the +%# property of Best Practical Solutions, LLC when submitted for +%# inclusion in the work. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> +<& /Ticket/Elements/Tabs, + current_tab => 'Search/Listing.html', + Title => $title &> + +%if ($ticketcount && ! $ARGS{'HideResults'}) { + +<& Elements/TicketHeader, %ARGS &> +% my $i; +%while (my $Ticket = $session{'tickets'}->Next) { +% $i++; +<& Elements/TicketRow, Ticket => $Ticket, i=> $i, %ARGS &> +%} +
+
+ +<&|/l&>First page +   +% if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) { +<<&|/l&>Previous page +   +% } +% if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) { +<&|/l&>Next page> +% } +%#  
<&|/l&>Goto page
+
+
+ + + + + + +
+(<&|/l, ($session{'tickets'}->FirstRow+1), ($session{'tickets'}->FirstRow() + $session{'tickets'}->RowsPerPage() ) &>[_1] - [_2] shown) + + +<&|/l&>Update all these tickets at once + +
+ +% } + + + + + +
+<& /Elements/TitleBoxStart, title => loc('Current search criteria')&> + +%my %restrictions=$session{'tickets'}->DescribeRestrictions(); +%foreach my $row (keys %restrictions){ +<%$restrictions{"$row"}%> [<&|/l&>delete]
+%} +
+
+<&|/l&>Bookmarkable URL for this search +<& /Elements/TitleBoxEnd&> +
+ +<& Elements/PickRestriction, %ARGS &> + +
+ +<%INIT> + +my ($title, $ticketcount); +$session{'i'}++; +if ($session{'tickets'}) { + if ($ARGS{'DeleteRestriction'}) { + $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'}); + } + if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) { + $session{'tickets'}->ClearRestrictions; + } +} + ProcessSearchQuery(ARGS=>\%ARGS); + $session{'tickets'}->RedoSearch(); + if ( $session{'tickets'}->DescribeRestrictions()) { + $ticketcount = $session{tickets}->CountAll(); + $title = loc('Found [quant,_1,ticket]', $ticketcount); + } else { + $title = loc("Find tickets"); + } + +<%CLEANUP> +$session{'tickets'}->PrepForSerialization(); + -- cgit v1.2.1