From 9c68254528b6f2c7d8c1921b452fa56064783782 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 2 Mar 2008 04:06:06 +0000 Subject: import rt 3.4.6 --- rt/html/Search/Build.html | 313 ++++++++------- rt/html/Search/Bulk.html | 482 +++++++++-------------- rt/html/Search/Edit.html | 12 +- rt/html/Search/Elements/BuildFormatString | 27 +- rt/html/Search/Elements/DisplayOptions | 71 +--- rt/html/Search/Elements/EditFormat | 30 +- rt/html/Search/Elements/EditQuery | 24 +- rt/html/Search/Elements/EditSearches | 57 +-- rt/html/Search/Elements/NewListActions | 14 +- rt/html/Search/Elements/PickBasics | 65 +-- rt/html/Search/Elements/PickCFs | 6 +- rt/html/Search/Elements/PickCriteria | 20 +- rt/html/Search/Elements/SearchPrivacy | 6 +- rt/html/Search/Elements/SelectAndOr | 10 +- rt/html/Search/Elements/SelectGroup | 14 +- rt/html/Search/Elements/SelectLinks | 12 +- rt/html/Search/Elements/SelectPersonType | 16 +- rt/html/Search/Elements/SelectSearchObject | 6 +- rt/html/Search/Elements/SelectSearchesForObjects | 11 +- rt/html/Search/Results.html | 89 ++--- rt/html/Search/Results.rdf | 8 +- rt/html/Search/Results.tsv | 109 +++-- 22 files changed, 592 insertions(+), 810 deletions(-) (limited to 'rt/html/Search') diff --git a/rt/html/Search/Build.html b/rt/html/Search/Build.html index ba5f7a1dd..5a66e02c9 100644 --- a/rt/html/Search/Build.html +++ b/rt/html/Search/Build.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -76,15 +74,15 @@ Rows => $RowsPerPage &> -
- - - - + + + + +
@@ -104,15 +101,19 @@ - + + +
<& Elements/PickCriteria, query => $Query, cfqueues => $queues &> -<& /Elements/Submit, Caption => loc('Add these terms to your search'), Label => loc('Add'), Name => 'AddClause'&> +<& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&> @@ -93,7 +91,6 @@ actions => \@actions, optionlist => $optionlist, Description => $Description &> -<& /Elements/Submit, Label => loc('Add and Search'), Name => 'DoSearch'&>
+ <& Elements/DisplayOptions, %ARGS, Format=> $Format, AvailableColumns => $AvailableColumns, CurrentFormat => $CurrentFormat, RowsPerPage => $RowsPerPage, OrderBy => $OrderBy, Order => $Order &> -<& /Elements/Submit, Label => loc('Add and Search'), Name => 'DoSearch'&> +
+<& /Elements/Submit, Caption => loc("Do the Search"), Label => loc('Search'), Name => 'DoSearch'&>
-
+ <%INIT> use RT::Interface::Web::QueryBuilder; @@ -133,7 +134,7 @@ if ( $NewQuery or $ARGS{'Delete'} ) { $SearchId = ''; $Order = ''; $OrderBy = ''; - $RowsPerPage = undef; + $RowsPerPage = ''; # ($search hasn't been set yet; no need to clear) @@ -146,43 +147,22 @@ if ( $NewQuery or $ARGS{'Delete'} ) { # }}} -if (ref $OrderBy eq "ARRAY") { - $OrderBy = join("|", @$OrderBy); -} -if (ref $Order eq "ARRAY") { - $Order = join("|", @$Order); -} - # {{{ Attempt to load what we can from the session, set defaults # We don't read or write to the session again until the end $search_hash = $session{'CurrentSearchHash'}; -# Read from user preferences -my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}; - # These variables are what define a search_hash; this is also # where we give sane defaults. $Query ||= $search_hash->{'Query'}; -$Format ||= $search_hash->{'Format'} || $prefs->{'Format'}; +$Format ||= $search_hash->{'Format'}; $Description ||= $search_hash->{'Description'}; $SearchId ||= $search_hash->{'SearchId'} || 'new'; -$Order ||= $search_hash->{'Order'} || $prefs->{'Order'} || 'ASC'; -$OrderBy ||= $search_hash->{'OrderBy'} || $prefs->{'OrderBy'} || 'id'; - -unless ( defined $RowsPerPage ) { - if ( defined $search_hash->{'RowsPerPage'} ) { - $RowsPerPage = $search_hash->{'RowsPerPage'}; - } - elsif ( defined $prefs->{'RowsPerPage'} ) { - $RowsPerPage = $prefs->{'RowsPerPage'}; - } - else { - $RowsPerPage = 50; - } -} - - $search ||= $search_hash->{'Object'}; +$Order ||= $search_hash->{'Order'} || 'ASC'; +$OrderBy ||= $search_hash->{'OrderBy'} || 'id'; +$RowsPerPage = ( $search_hash->{'RowsPerPage'} || 50 ) + unless defined($RowsPerPage); +$search ||= $search_hash->{'Object'}; # }}} @@ -195,14 +175,31 @@ $Format = $m->comp( '/Elements/ScrubHTML', Content => $Format ) if ($Format); if ( $ARGS{'Delete'} ) { # We set $SearchId to 'new' above already, so peek into the %ARGS - my ($container_object, $search_id) = _parse_saved_search ($ARGS{'SearchId'}); - if ($container_object && $container_object->id) { - # We have the object the entry is an attribute on; delete the - # entry.. - $container_object->Attributes->DeleteEntry( - Name => 'SavedSearch', - id => $search_id + if ( $ARGS{'SearchId'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { + my $obj_type = $1; + my $obj_id = $2; + my $search_id = $3; + + my $container_object; + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { + $container_object = $session{'CurrentUser'}->UserObj; + } + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); + $container_object->Load($obj_id); + } + + if ( $container_object->id ) { + + # We have the object the entry is an attribute on; delete + # the entry.. + $container_object->Attributes->DeleteEntry( + Name => 'SavedSearch', + id => $search_id ); + } + } } @@ -226,8 +223,25 @@ if ( $ARGS{'Revert'} ) { # {{{ if we're asked to load a search, load it. -if ( my ($container_object, $search_id ) = _parse_saved_search ($ARGS{'LoadSavedSearch'})) { - $search = $container_object->Attributes->WithId($search_id); +if ( $ARGS{'LoadSavedSearch'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { + my $obj_type = $1; + my $obj_id = $2; + my $search_id = $3; + + # We explicitly list out the available types (user and group) and + # don't trust user input here + if ( ( $obj_type eq 'RT::User' ) + && ( $obj_id == $session{'CurrentUser'}->id ) ) + { + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + + } + elsif ( $obj_type eq 'RT::Group' ) { + my $group = RT::Group->new( $session{'CurrentUser'} ); + $group->Load($obj_id); + $search = $group->Attributes->WithId($search_id); + } # We have a $search and now; import the others $SearchId = $ARGS{'LoadSavedSearch'}; @@ -241,62 +255,6 @@ if ( my ($container_object, $search_id ) = _parse_saved_search ($ARGS{'LoadSaved # }}} -# {{{ if we're asked to save the current search, save it -if ( $ARGS{'Save'} ) { - if ( $search && $search->id ) { - # permission check - if ($search->Object->isa('RT::System')) { - unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) { - Abort("No permission to save system-wide searches"); - } - } - - # This search is based on a previously loaded search -- so - # just update the current search object with new values - $search->SetSubValues( - Format => $Format, - Query => $Query, - Order => $Order, - OrderBy => $OrderBy, - RowsPerPage => $RowsPerPage, - ); - $search->SetDescription($Description); - - } - elsif ( $SearchId eq 'new' ) { - my $saved_search = RT::SavedSearch->new( $session{'CurrentUser'} ); - my ( $ok, $search_msg ) = $saved_search->Save( - Privacy => $ARGS{'Owner'}, - Name => $Description, - SearchParams => { - Format => $Format, - Query => $Query, - Order => $Order, - OrderBy => $OrderBy, - RowsPerPage => $RowsPerPage } ); - - if ($ok) { - $search = $session{'CurrentUser'}->UserObj->Attributes->WithId($saved_search->Id); - # Build new SearchId - $SearchId = - ref( $session{'CurrentUser'}->UserObj ) . '-' - . $session{'CurrentUser'}->UserObj->Id - . '-SavedSearch-' - . $search->Id; - } - else { - push @actions, [ loc("Can't find a saved search to work with").': '.loc($search_msg), 0 ]; - } - } - else { - push @actions, [ loc("Can't save this search"), 0 ]; - } - -} - -# }}} - - # {{{ Parse the query use Regexp::Common qw /delimited/; @@ -320,7 +278,7 @@ my $_match = sub { my $ParseQuery = sub { my $string = shift; my $tree = shift; - my $actions = shift; + my @actions = shift; my $want = KEYWORD | PAREN; my $last = undef; @@ -329,12 +287,9 @@ my $ParseQuery = sub { # make a tree root $$tree = RT::Interface::Web::QueryBuilder::Tree->new; my $root = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $$tree ); + my $lastnode = $root; my $parentnode = $root; - # on new searches, we're passed undef but still need to construct the - # RT::Interface::Web::QueryBuilder::Tree. Quiet warning - return unless defined $string; - # get the FIELDS from Tickets_Overlay my $tickets = new RT::Tickets( $session{'CurrentUser'} ); my %FIELDS = %{ $tickets->FIELDS }; @@ -384,10 +339,13 @@ my $ParseQuery = sub { # Error # FIXME: I will only print out the highest $want value my $token = $tokens[ ( ( log $want ) / ( log 2 ) ) ]; - push @$actions, + push @actions, [ - loc("Error near ->[_1]<- expecting a [_2] in '[_3]'", - $val, $token, $string ), + loc( +"current: $current, want $want, Error near ->$val<- expecting a " + . $token + . " in '$string'\n" + ), -1 ]; } @@ -406,13 +364,13 @@ my $ParseQuery = sub { else { $depth--; $parentnode = $parentnode->getParent(); + $lastnode = $parentnode; } $want = KEYWORD | PAREN | AGGREG; } elsif ( $current & AGGREG ) { $ea = $val; - $parentnode->setNodeValue($ea); $want = KEYWORD | PAREN; } elsif ( $current & KEYWORD ) { @@ -442,28 +400,20 @@ my $ParseQuery = sub { $val =~ s!\\(.)!$1!g; my $class; - - my ($key_base, $subkey) = split(/\./,$key,2); - $key_base =~ s/\..*$//; # Strip off .EmailAddress, for example - - if ( exists $lcfields{lc $key_base } ) { - $key = $lcfields{lc $key_base } . (defined $subkey ? '.'.$subkey : ''); - $class = $FIELDS{$key_base}->[0]; - } - elsif ( $key =~ /^C(?:ustom)?F(?:ield)?\.{(.*)}$/i ) { - $class = $FIELDS{'CF'}->[0]; + if ( exists $lcfields{ lc $key } ) { + $key = $lcfields{ lc $key }; + $class = $FIELDS{$key}->[0]; } - if ( $class ne 'INT' ) { $val = "'$val'"; } - push @$actions, [ loc("Unknown field: $key"), -1 ] unless $class; + push @actions, [ loc("Unknown field: $key"), -1 ] unless $class; $want = PAREN | AGGREG; } else { - push @$actions, [ loc("I'm lost"), -1 ]; + push @actions, [ loc("I'm lost"), -1 ]; } if ( $current & VALUE ) { @@ -477,40 +427,33 @@ my $ParseQuery = sub { }; # explicity add a child to it - RT::Interface::Web::QueryBuilder::Tree->new( $clause, $parentnode ); + $lastnode = RT::Interface::Web::QueryBuilder::Tree->new( $clause, $parentnode ); + $lastnode->getParent()->setNodeValue($ea); ( $ea, $key, $op, $value ) = ( "", "", "", "" ); - } $last = $current; } # while - push @$actions, [ loc("Incomplete query"), -1 ] + push @actions, [ loc("Incomplete query"), -1 ] unless ( ( $want | PAREN ) || ( $want | KEYWORD ) ); - push @$actions, [ loc("Incomplete Query"), -1 ] + push @actions, [ loc("Incomplete Query"), -1 ] unless ( $last && ( $last | PAREN ) || ( $last || VALUE ) ); # This will never happen, because the parser will complain - push @$actions, [ loc("Mismatched parentheses"), -1 ] + push @actions, [ loc("Mismatched parentheses"), -1 ] unless $depth == 1; }; my $tree; -{ - my @parsing_errors; - $ParseQuery->( $Query, \$tree, \@parsing_errors ); - - # if parsing went poorly, send them to the edit page - # to fix it - if ( @parsing_errors ) { - return $m->comp( - "Edit.html", - Query => $Query, - actions => \@parsing_errors - ); - } +$ParseQuery->( $Query, \$tree, \@actions ); + +# if parsing went poorly, send them to the edit page to fix it +if ( $actions[0] ) { + $m->comp( "Edit.html", Query => $Query, actions => \@actions ); + $m->abort(); } $Query = ""; @@ -640,7 +583,7 @@ elsif ( $ARGS{"Toggle"} ) { # {{{ Try to find if we're adding a clause foreach my $arg ( keys %ARGS ) { if ( - $arg =~ m/^ValueOf(\w+|'CF.{.*?}')$/ + $arg =~ m/^ValueOf(.+)/ && ( ref $ARGS{$arg} eq "ARRAY" ? grep { $_ ne "" } @{ $ARGS{$arg} } : $ARGS{$arg} ne "" ) @@ -752,6 +695,77 @@ my ( $AvailableColumns, $CurrentFormat ); # }}} +# {{{ if we're asked to save the current search, save it +if ( $ARGS{'Save'} ) { + + if ( $search && $search->id ) { + + # This search is based on a previously loaded search -- so + # just update the current search object with new values + $search->SetSubValues( + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $RowsPerPage, + ); + $search->SetDescription($Description); + + } + elsif ( $SearchId eq 'new' && $ARGS{'Owner'} =~ /^(.*?)-(\d+)$/ ) { + + # We're saving a new search + my $obj_type = $1; + my $obj_id = $2; + + # Find out if we're saving on the user, or a group + my $container_object; + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { + $container_object = $session{'CurrentUser'}->UserObj; + } + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); + $container_object->Load($obj_id); + } + + if ( $container_object->id ) { + + # If we got one or the other, add the saerch + my ( $search_id, $search_msg ) = $container_object->AddAttribute( + Name => 'SavedSearch', + Description => $Description, + Content => { + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $RowsPerPage, + } + ); + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + + # Build new SearchId + $SearchId = + ref( $session{'CurrentUser'}->UserObj ) . '-' + . $session{'CurrentUser'}->UserObj->Id + . '-SavedSearch-' + . $search->Id; + } + unless ( $search->id ) { + push @actions, [ loc("Can't find a saved search to work with"), 0 ]; + } + + } + else { + push @actions, [ loc("Can't save this search"), 0 ]; + } + +} + +# }}} + # {{{ If we're modifying an old query, check if it has changed my $dirty = 0; $dirty = 1 @@ -779,7 +793,7 @@ $session{'CurrentSearchHash'} = $search_hash; # }}} # {{{ Show the results, if we were asked. -if ( $ARGS{"DoSearch"}) { +if ( $ARGS{"DoSearch"} ) { $m->comp( "Results.html", Query => $Query, @@ -788,7 +802,6 @@ if ( $ARGS{"DoSearch"}) { OrderBy => $OrderBy, Rows => $RowsPerPage ); - $m->comp('/Elements/Footer'); $m->abort(); } diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html index 9742df5ae..f9eef26b6 100644 --- a/rt/html/Search/Bulk.html +++ b/rt/html/Search/Bulk.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,220 +43,185 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Elements/Header, Title => $title &> -<& /Ticket/Elements/Tabs, - current_tab => "Search/Bulk.html", - Title => $title, - Format => $ARGS{'Format'}, # we don't want the locally modified one - Query => $Query, - Rows => $Rows, - OrderBy => $OrderBy, - Order => $Order &> +<& /Elements/Header, Title => loc("Bulk ticket update") &> +<& /Elements/Tabs, Title => loc("Bulk ticket update") &> <& /Elements/ListActions, actions => \@results &> -
-% foreach my $var qw(Query Format OrderBy Order Rows Page) { - + + + + + +%foreach my $col (@cols) { +% my $colalias = $col; +% $colalias =~ s/(Obj\-\>|)(Name|AsString)//; + + %} -<& /Elements/TicketList, Query => $Query, - DisplayFormat => $Format, - Format => $ARGS{'Format'}, - Verbatim => 1, - AllowSorting => 1, - OrderBy => $OrderBy, - Order => $Order, - Rows => $Rows, - Page => $Page, - BaseURL => $RT::WebPath."/Search/Bulk.html?" - &> - -
- -<& /Elements/Submit, Label => loc('Update'), CheckAll => 1, ClearAll => 1 &> -
-<&|/Widgets/TitleBox, title => $title &> -
<&|/l&>Update<% loc($colalias) %> 
- - + +<%PERL> + +my $i; + +$Tickets->RedoSearch(); +while (my $Ticket = $Tickets->Next) { + $i++; + if ($i % 2) { + $bgcolor = "#dddddd"; + } + else { + $bgcolor = "#ffffff"; + } + + + +%foreach my $col (@cols) { + +%} + +%} + + + +
+
+% 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 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 => '' &>
<&|/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 => '' &>
-
- -<&| /Widgets/TitleBox, title => loc('Add comments or replies to selected tickets') &> +<& /Elements/TitleBoxEnd&> +<& /Elements/TitleBoxStart, title => loc('Add comments or replies to selected tickets') &> - + - + % while (my $CF = $TxnCFs->Next()) { - - - + + - + &><% $CF->FriendlyType %> + % } # end if while - - +
<&|/l&>Update Type:
<&|/l&>Update Type:
<&|/l&>Subject:
<&|/l&>Subject:
<% $CF->Name %>:<& /Elements/EditCustomField, +
<% $CF->Name %>:<& /Elements/EditCustomField, CustomField => $CF, NamePrefix => "Object-RT::Transaction--CustomField-" - &><% $CF->FriendlyType %>
<&|/l&>Attach:
<&|/l&>Message: +
<&|/l&>Attach:
<&|/l&>Message: <& /Elements/MessageBox, Name=>"UpdateContent"&>
- -<&|/Widgets/TitleBox, title => loc('Edit Custom Fields'), color => "#336633"&> -<%perl> -my $cfs = RT::CustomFields->new($session{'CurrentUser'}); -$cfs->LimitToGlobal(); -$cfs->LimitToQueue($_) for keys %$seen_queues; - - - - - - - -% while (my $cf = $cfs->Next()) { - - -% my $rows = 5; -% my @add = (NamePrefix => 'Bulk-Add-CustomField-', CustomField => $cf, Rows => $rows, Multiple => ($cf->MaxValues ==1 ? 0 : 1) , Cols => 25); -% my @del = (NamePrefix => 'Bulk-Delete-CustomField-', CustomField => $cf, Rows => $rows, Multiple => 1, Cols => 25); -% if ($cf->Type eq 'Select') { - - -% } elsif ($cf->Type eq 'Combobox') { - - -% } elsif ($cf->Type eq 'Freeform') { - - -% } elsif ($cf->Type eq 'Text') { - - -% } else { -% $RT::Logger->crit("Unknown CustomField type: " . $cf->Type); -% } - -% } -
<&|/l&>Name<&|/l&>Add values<&|/l&>Delete values
<%$cf->Name%>
-(<%$cf->FriendlyType%>)
<& /Elements/EditCustomFieldSelect, @add &><& /Elements/EditCustomFieldSelect, @del &><& /Elements/EditCustomFieldCombobox, @add &><& /Elements/EditCustomFieldCombobox, @del &><& /Elements/EditCustomFieldFreeform, @add &><& /Elements/EditCustomFieldFreeform, @del &><& /Elements/EditCustomFieldText, @add &> 
- +<& /Elements/TitleBoxEnd &> -<&|/Widgets/TitleBox, title => loc('Edit Links'), color => "#336633"&> -<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
-<& /Ticket/Elements/BulkLinks &> - - -<& /Elements/Submit, Label => loc('Update') &> +<& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&> +<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
+<& /Ticket/Elements/BulkLinks &> +<& /Elements/TitleBoxEnd &> -
+<& /Elements/Submit, Label => loc('Update All') &> + <%INIT> -my $title = loc("Update multiple tickets"); # Iterate through the ARGS hash and remove anything with a null value. -map ( $ARGS{$_} =~ /^$/ && ( delete $ARGS{$_} ), keys %ARGS ); - -my (@results); - -$Page ||= 1; - -$Format ||= $RT::DefaultSearchResultFormat; - -# inject _CHECKBOX to the first field. -$Format =~ s/'?([^']+)'?,/'___CHECKBOX__$1',/; - -my $Tickets = RT::Tickets->new( $session{'CurrentUser'} ); -$Tickets->FromSQL($Query); -if ( $OrderBy =~ /\|/ ) { - - # Multiple Sorts - my @OrderBy = split /\|/, $OrderBy; - my @Order = split /\|/, $Order; - $Tickets->OrderByCols( - map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } - ( 0 .. $#OrderBy ) ); -} -else { - $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order ); -} - -$Tickets->RowsPerPage($Rows) if ($Rows); -$Tickets->GotoPage( $Page - 1 ); # SB uses page 0 as the first page - -Abort( loc("No search to operate on.") ) unless ($Tickets); - -# build up a list of all custom fields for tickets that we're displaying, so -# we can display sane edit widgets. - -my $fields = {}; -my $seen_queues = {}; -while ( my $ticket = $Tickets->Next ) { - next if $seen_queues->{ $ticket->Queue }++; - - my $custom_fields = $ticket->QueueObj->TicketCustomFields; - while ( my $field = $custom_fields->Next ) { - $fields->{ $field->id } = $field; +map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); + +my ($bgcolor, @results); +my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString ); + + +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); +$Tickets->FromSQL($ARGS{'Query'}); + +Abort(loc("No search to operate on.")) unless ($Tickets); + +my %allcfs; +my %cfqnames; +my %cfqs; +my $count = 0; +while (my $Ticket = $Tickets->Next) { + my $cfq = $Ticket->QueueObj; + my $cfqid = $cfq->Id; + my $cfqn = $cfq->Name; + unless ( exists $cfqs{$cfqid} ) { + $cfqs{$cfqid} = 1; + $count++; + my $cfs = $cfq->TicketCustomFields; + while (my $cf = $cfs->Next) { + $allcfs{$cf->Id} = $cf; + $cfqnames{$cf->Id} = $cfqn; + } } } -my $do_comment_reply = 0; - +my $do_comment_reply=0; # Prepare for ticket updates -if ($ARGS{'UpdateContent'}) { - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; - chomp( $ARGS{'UpdateContent'} ); - - if ($ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature ) { - $do_comment_reply = 1; - } +$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 @@ -266,131 +229,50 @@ my @linkresults; my %queues; $Tickets->RedoSearch(); - -# pull out the labels for any custom fields we want to update - -my $cf_del_keys; -@$cf_del_keys = grep { /^Bulk-Delete-CustomField/ } keys %ARGS; -my $cf_add_keys; -@$cf_add_keys = grep { /^Bulk-Add-CustomField/ } keys %ARGS; - - -while ( my $Ticket = $Tickets->Next ) { - next unless ( $ARGS{ "UpdateTicket" . $Ticket->Id } ); - - #Update the links - $ARGS{'id'} = $Ticket->id; - $queues{ $Ticket->QueueObj->Id }++; - - my @updateresults; +while (my $Ticket = $Tickets->Next) { + $queues{$Ticket->QueueObj->Id}++; + $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); + next unless ($ARGS{"UpdateTicket".$Ticket->Id}); + $RT::Logger->debug ("Matched\n"); + my @updateresults; if ($do_comment_reply) { - ProcessUpdateMessage( - TicketObj => $Ticket, - ARGSRef => \%ARGS, - Actions => \@updateresults - ); + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); } #Update the basics. - my @basicresults = - ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS ); - my @dateresults = - ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS ); - + my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); + my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); #Update the watchers - my @watchresults = - ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS ); + my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); - foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) { - $ARGS{ $Ticket->id . "-" . $type } = $ARGS{"Ticket-$type"}; - $ARGS{ $type . "-" . $Ticket->id } = $ARGS{"$type-Ticket"}; - } - @linkresults = - ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS ); - foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) { - delete $ARGS{ $type . "-" . $Ticket->id }; - delete $ARGS{ $Ticket->id . "-" . $type }; - } - - my @cfresults; - - foreach my $list ( $cf_add_keys, $cf_del_keys ) { - next unless $list->[0]; - - - my $op; - if ( $list->[0] =~ /Add/ ) { - $op = 'add'; - - } - elsif ( $list->[0] =~ /Del/ ) { - $op = 'del'; - } - else { - $RT::Logger->crit( - "Got an op that was neither add nor delete. can never happen" - . $list->[0] ); - last; - } - - foreach my $key (@$list) { - my ( $cfid, $cf ); - if ( $key =~ /CustomField-(\d+)-/ ) { - $cfid = $1; - $cf = RT::CustomField->new( $session{'CurrentUser'} ); - $cf->Load($cfid); - } - else {next} - my @values = - ref( $ARGS{$key} ) eq 'ARRAY' - ? @{ $ARGS{$key} } - : ( $ARGS{$key} ); - map { s/(\r\n|\r)/\n/g; } @values; # fix the newlines - # now break the multiline values into multivalues - @values = map { split( /\n/, $_ ) } @values - unless ( $cf->SingleValue ); - - my $current_values = $Ticket->CustomFieldValues($cfid); - foreach my $value (@values) { - if ( $op eq 'del' && $current_values->HasEntry($value) ) { - my ( $id, $msg ) = $Ticket->DeleteCustomFieldValue( - Field => $cfid, - Value => $value - ); - push @cfresults, $msg; - } - - elsif ( $op eq 'add' && !$current_values->HasEntry($value) ) { - my ( $id, $msg ) = $Ticket->AddCustomFieldValue( - Field => $cfid, - Value => $value - ); - push @cfresults, $msg; - } - } - } - } - my @tempresults = ( - @watchresults, @basicresults, @dateresults, - @updateresults, @linkresults, @cfresults - ); - - @tempresults = - map { loc( "Ticket [_1]: [_2]", $Ticket->Id, $_ ) } @tempresults; - @results = ( @results, @tempresults ); + #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 @tempresults = (@watchresults, @basicresults, @dateresults, + @updateresults, @linkresults); + @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; + + @results = (@results, @tempresults); } -my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} ); -$TxnCFs->LimitToLookupType( RT::Transaction->CustomFieldLookupType ); -$TxnCFs->LimitToGlobalOrObjectId( sort keys %queues ); +my $TxnCFs = RT::CustomFields->new($session{CurrentUser}); +$TxnCFs->LimitToLookupType("RT::Queue-RT::Ticket-RT::Transaction"); +$TxnCFs->LimitToGlobalOrObjectId(sort keys %queues); -<%args> -$Format => undef -$Page => 1 -$Rows => undef -$Order => 'ASC' -$OrderBy => 'id' -$Query => undef - diff --git a/rt/html/Search/Edit.html b/rt/html/Search/Edit.html index 21df0db97..16e8a0e71 100755 --- a/rt/html/Search/Edit.html +++ b/rt/html/Search/Edit.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -58,11 +56,11 @@ <& Elements/NewListActions, actions => \@actions &>
- + -
+
-
+
<& /Elements/Submit, Label => loc("Apply"), Reset => 1, Caption => loc("Apply your changes")&>
diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString index 3bd39b5c2..cffb81a48 100644 --- a/rt/html/Search/Elements/BuildFormatString +++ b/rt/html/Search/Elements/BuildFormatString @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -173,12 +171,12 @@ elsif ( $AddCol ) { $column{Column} = $col; if ( $Face eq "Bold" ) { - $column{Prefix} .= ""; - $column{Suffix} .= ""; + $column{Prefix} .= ""; + $column{Suffix} .= ""; } if ( $Face eq "Italic" ) { - $column{Prefix} .= ""; - $column{Suffix} .= ""; + $column{Prefix} .= ""; + $column{Suffix} .= ""; } if ($Size) { $column{Prefix} .= "<" . $m->interp->apply_escapes( $Size, 'h' ) . ">"; @@ -186,11 +184,11 @@ elsif ( $AddCol ) { } if ( $Link eq "Display" ) { $column{Prefix} .= - ""; + ""; $column{Suffix} .= ""; } elsif ( $Link eq "Take" ) { - $column{Prefix} .= ""; $column{Suffix} .= ""; } @@ -225,13 +223,10 @@ elsif ( $ColDown ) { my @format_string; foreach my $field (@seen) { next unless $field; - my $row = "'"; - $row .= $field->{Prefix} if $field->{Prefix}; - $row .= "__" . ($field->{Column} =~ m/\(/ ? $field->{Column} # func, don't escape - : $m->interp->apply_escapes( $field->{Column}, 'h' )) . "__" + my $row = "'" . $field->{Prefix}; + $row .= "__" . $m->interp->apply_escapes( $field->{Column}, 'h' ) . "__" unless ( $field->{Column} eq "" ); - $row .= $field->{Suffix} if $field->{Suffix}; - $row .= "'"; + $row .= $field->{Suffix} . "'"; push( @format_string, $row ); } diff --git a/rt/html/Search/Elements/DisplayOptions b/rt/html/Search/Elements/DisplayOptions index 4bed0902b..43a9d9998 100644 --- a/rt/html/Search/Elements/DisplayOptions +++ b/rt/html/Search/Elements/DisplayOptions @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,53 +43,43 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => loc("Display Columns") &> +<& /Elements/TitleBoxStart, title => loc("Display Columns") &> - - @@ -99,11 +97,11 @@ + + @@ -166,7 +177,7 @@ TrueVal=> '=', FalseVal => '!=' &> <%INIT> my @people = ('Actor', diff --git a/rt/html/Search/Elements/PickCFs b/rt/html/Search/Elements/PickCFs index 734f5f871..435a07ad3 100644 --- a/rt/html/Search/Elements/PickCFs +++ b/rt/html/Search/Elements/PickCFs @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/Search/Elements/PickCriteria b/rt/html/Search/Elements/PickCriteria index 58b29fb57..129344443 100644 --- a/rt/html/Search/Elements/PickCriteria +++ b/rt/html/Search/Elements/PickCriteria @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,12 +43,12 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => loc('Add Criteria')&> -
<& EditFormat, %ARGS &> - - -% for my $o (0..3) { + - - -
+ - - -% } - -
-% if ($o == 0) { + <&|/l&>Order by: -% } - +
+ <&|/l&>Rows per page: <& /Elements/SelectResultsPerPage, @@ -103,34 +91,14 @@ selected
- +<& /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'}; -$fields{ $_ . '.EmailAddress' } = 1 foreach( qw(Requestor Cc AdminCc) ); - -# Add all available CustomFields to the list of sortable columns. -my @cfs = grep /^CustomField/, @{$ARGS{AvailableColumns}}; -$fields{$_}=1 for @cfs; - -# Add PAW sort -$fields{'Custom.Ownership'} = 1; -my @Order; -my @OrderBy; -if ($OrderBy =~ /\|/) { - @OrderBy = split /\|/, $OrderBy; -} else { - @OrderBy = ( $OrderBy ); -} -if ($Order =~ /\|/) { - @Order = split /\|/, $Order; -} else { - @Order = ( $Order ); -} @@ -139,5 +107,4 @@ $Order => undef $OrderBy => undef $RowsPerPage => undef $Format => undef -$GroupBy => 'id' diff --git a/rt/html/Search/Elements/EditFormat b/rt/html/Search/Elements/EditFormat index fa0ac96e0..dc8720f26 100644 --- a/rt/html/Search/Elements/EditFormat +++ b/rt/html/Search/Elements/EditFormat @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -58,7 +56,7 @@ <&|/l&>Show Columns:
+ -
<&|/l&>Title: -
<&|/l&>Size: +
<&|/l&>Title: +
<&|/l&>Size: -
<&|/l&>Style: +
<&|/l&>Style:
- + - + -
+
- - - + + +
+
diff --git a/rt/html/Search/Elements/EditQuery b/rt/html/Search/Elements/EditQuery index 5c40c2573..783541a64 100644 --- a/rt/html/Search/Elements/EditQuery +++ b/rt/html/Search/Elements/EditQuery @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -46,20 +44,20 @@ %# %# END BPS TAGGED BLOCK }}} <& NewListActions, actions => $actions &> -<&|/Widgets/TitleBox, title => join(': ', grep defined, loc("Current search"), $Description) &> +<& /Elements/TitleBoxStart, title => join(': ', grep defined, loc("Query"), $Description) &>

- - - - - - -%# + + + + + + +%#

- +<& /Elements/TitleBoxEnd &> <%ARGS> $Description $optionlist diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches index 9ab9f944d..bc6b80e6f 100644 --- a/rt/html/Search/Elements/EditSearches +++ b/rt/html/Search/Elements/EditSearches @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,59 +43,62 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => loc($Title)&> +<& /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 &>
+<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &>
% } else { -<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &>
+<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &>
% } <&|/l&>Description:
- + % if ($SearchId ne 'new') { % if ($Dirty) { - -% } - -% if ($AllowCopy) { - + % } + + % } - -
+ +% if ($Dirty or $SearchId eq 'new') { + +% } +
% } -<&|/l&>Load saved search:
-<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects, SearchType => $SearchType &> - - +<&|/l&>Load saved search:
+<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&> + +<& /Elements/TitleBoxEnd &> <%init> + unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', - Object=> $RT::System )) { + Object=> $RT::System )) { return; } +my @Objects; + +push @Objects, $session{CurrentUser}->UserObj; + +my $groups = RT::Groups->new($session{'CurrentUser'}); -use RT::SavedSearches; -my @Objects = RT::SavedSearches->new($session{CurrentUser})->_PrivacyObjects; -push @Objects, RT::System->new($session{'CurrentUser'}) - if $session{'CurrentUser'}->HasRight( Object=> $RT::System, - Right => 'SuperUser'); +$groups->LimitToUserDefinedGroups; +$groups->WithMember(PrincipalId => $session{'CurrentUser'}->Id, + Recursively => 1); + push (@Objects, @{$groups->ItemsArrayRef()}); <%ARGS> -$SearchType => 'Ticket' $SearchId => undef $CurrentSearch => undef $Description => undef $HideResults => 0 $Dirty => 0 -$AllowCopy => 1 -$Title => 'Saved searches' diff --git a/rt/html/Search/Elements/NewListActions b/rt/html/Search/Elements/NewListActions index 535ac8cb9..eb82544f3 100644 --- a/rt/html/Search/Elements/NewListActions +++ b/rt/html/Search/Elements/NewListActions @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -46,19 +44,19 @@ %# %# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { -<%loc('Results')%>
+<%loc('Results')%>
% foreach my $action (@actions) { % next unless ($action); % my @item = @$action; % if ($item[1] < 0) { - + % } - <%$item[0]%>
+ <%$item[0]%>
% if ($item[1] < 0) {
% } % } -
+
% } <%init> @actions = grep (/./,@actions); diff --git a/rt/html/Search/Elements/PickBasics b/rt/html/Search/Elements/PickBasics index 44a378c14..8a48f6b18 100644 --- a/rt/html/Search/Elements/PickBasics +++ b/rt/html/Search/Elements/PickBasics @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -51,11 +49,11 @@
<& /Elements/SelectEqualityOperator, Name => "idOp" &> - +
+
<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> <& /Elements/SelectBoolean, Name => "AttachmentOp", @@ -65,7 +63,7 @@ FalseVal => 'NOT LIKE' &> - +
- + <& /Elements/SelectBoolean, Name => "ActorOp", TrueVal=> '=', @@ -119,7 +117,21 @@ <& /Elements/SelectMatch, Name => "WatcherOp" &> - + +
+<& SelectPersonType, Name => 'WatcherGroupField', Default => 'RequestorGroup', Suffix => 'Group' &> + +<& /Elements/SelectBoolean, Name => "WatcherGroupOp", + True=> loc('belongs to'), + False=> loc('does not belong to'), + TrueVal=> '=', + FalseVal => '!=' +&> + +<& SelectGroup, Name => 'ValueOfWatcherGroup' &> +
@@ -131,29 +143,28 @@
- + <& /Elements/SelectEqualityOperator, Name => "TimeOp" &> - -<& /Elements/SelectTimeUnits, Name =>'ValueOfTime' &> +
- + <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> - +
- +
+<& /Elements/TitleBoxStart, title => loc('Add Criteria')&> +
- -
+ + -
<&|/l&>Aggregator: <& SelectAndOr, Name => "AndOr" &> @@ -63,8 +61,8 @@
- +
+ <& PickBasics &> <& PickCFs, cfqueues => \%cfqueues &>
@@ -73,7 +71,7 @@
 
- +<& /Elements/TitleBoxEnd &> <%ARGS> $addquery => 0 diff --git a/rt/html/Search/Elements/SearchPrivacy b/rt/html/Search/Elements/SearchPrivacy index 745ba62ac..270e1baa3 100644 --- a/rt/html/Search/Elements/SearchPrivacy +++ b/rt/html/Search/Elements/SearchPrivacy @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/Search/Elements/SelectAndOr b/rt/html/Search/Elements/SelectAndOr index c8122660a..2f3c70477 100644 --- a/rt/html/Search/Elements/SelectAndOr +++ b/rt/html/Search/Elements/SelectAndOr @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,8 +43,8 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&|/l&>AND -<&|/l&>OR +<&|/l&>AND +<&|/l&>OR <%ARGS> $Name => "Operator" diff --git a/rt/html/Search/Elements/SelectGroup b/rt/html/Search/Elements/SelectGroup index 3f78d3964..edd53713f 100644 --- a/rt/html/Search/Elements/SelectGroup +++ b/rt/html/Search/Elements/SelectGroup @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,14 +43,14 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - % if ($AllowNull) { - + % } %while (my $group = $groups->Next) { - + %} - + <%INIT> my $groups = new RT::Groups($session{'CurrentUser'}); diff --git a/rt/html/Search/Elements/SelectLinks b/rt/html/Search/Elements/SelectLinks index f3586528d..00ec80bd3 100644 --- a/rt/html/Search/Elements/SelectLinks +++ b/rt/html/Search/Elements/SelectLinks @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,11 +43,11 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - % foreach (@fields) { - + % } - + <%ARGS> $Name => 'LinksField' diff --git a/rt/html/Search/Elements/SelectPersonType b/rt/html/Search/Elements/SelectPersonType index bc631dbb0..d4127c97b 100644 --- a/rt/html/Search/Elements/SelectPersonType +++ b/rt/html/Search/Elements/SelectPersonType @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,20 +43,20 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} - % if ($AllowNull) { - + % } % for my $option (@types) { % if ($Suffix) { - + % next; % } % foreach my $subtype (@subtypes) { - + % } % } - + <%INIT> my @types; diff --git a/rt/html/Search/Elements/SelectSearchObject b/rt/html/Search/Elements/SelectSearchObject index f52a83372..e9df5179f 100644 --- a/rt/html/Search/Elements/SelectSearchObject +++ b/rt/html/Search/Elements/SelectSearchObject @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: diff --git a/rt/html/Search/Elements/SelectSearchesForObjects b/rt/html/Search/Elements/SelectSearchesForObjects index dc8368577..e6be66a58 100644 --- a/rt/html/Search/Elements/SelectSearchesForObjects +++ b/rt/html/Search/Elements/SelectSearchesForObjects @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -48,7 +46,6 @@ <%args> @Objects => undef $Name => undef -$SearchType => 'Ticket', -%} +
+
+ + + + + + + <& /Elements/Refresh, Name => 'TicketsRefreshInterval', Default => $session {'tickets_refresh_interval'} &> - +
-
-<&|/l&>Update multiple tickets
-<&|/l&>Bookmarkable link
+
+<&|/l&>Update multiple tickets
+<&|/l&>Bookmarkable link
<&|/l&>spreadsheet | -<&|/l&>RSS | -<&|/l&>Work offline
-
<&|/l&>chart -% %hiddens = (Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order); -%foreach my $key (keys(%hiddens)) { - -%} -<&|/l, $m->scomp('Elements/SelectGroupBy', Name => 'PrimaryGroupBy', Query => $Query) &>grouped by [_1] -<&|/l, $m->scomp('Elements/SelectChartType', Name => 'ChartStyle') &>style: [_1] - -
+<&|/l&>RSS | +<&|/l&>Work offline
<& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&>
<%INIT> -# Read from user preferences -my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}; - -# These variables are what define a search_hash; this is also -# where we give sane defaults. -$Format ||= $prefs->{'Format'}; -$Order ||= $prefs->{'Order'} || 'ASC'; -$OrderBy ||= $prefs->{'OrderBy'} || 'id'; - -# Some forms pass in "RowsPerPage" rather than "Rows" -# We call it RowsPerPage everywhere else. - -if ( !defined($Rows) ) { - if ( $ARGS{'RowsPerPage'} ) { - $Rows = $ARGS{'RowsPerPage'}; - } elsif ( defined $prefs->{'RowsPerPage'} ) { - $Rows = $prefs->{'RowsPerPage'}; - } else { - $Rows = 50; - } -} - my ($title, $ticketcount); $session{'i'}++; $session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ; $session{'tickets'}->FromSQL($Query) if ($Query); +$session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -if ($OrderBy =~ /\|/) { - # Multiple Sorts - my @OrderBy = split /\|/,$OrderBy; - my @Order = split /\|/,$Order; - $session{'tickets'}->OrderByCols( - map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } ( 0 - .. $#OrderBy ) );; -} else { - $session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -} $session{'CurrentSearchHash'} = { Format => $Format, Query => $Query, - Page => $Page, Order => $Order, OrderBy => $OrderBy, RowsPerPage => $Rows }; + if ( $session{'tickets'}->Query()) { $ticketcount = $session{tickets}->CountAll(); $title = loc('Found [quant,_1,ticket]', $ticketcount); @@ -156,12 +116,13 @@ my $QueryString = "?".$m->comp('/Elements/QueryString', OrderBy => $OrderBy, Order => $Order, Page => $Page); + my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query); -my $RSSFeedURL = "$RT::WebPath/Search/Results.rdf$ShortQueryString"; if ($ARGS{'TicketsRefreshInterval'}) { $session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'}; } + <%CLEANUP> $session{'tickets'}->PrepForSerialization(); @@ -170,8 +131,8 @@ $session{'tickets'}->PrepForSerialization(); $Query => undef $Format => undef $HideResults => 0 -$Rows => undef +$Rows => 50 $Page => 1 -$OrderBy => undef -$Order => undef +$OrderBy => 'id' +$Order => 'ASC' diff --git a/rt/html/Search/Results.rdf b/rt/html/Search/Results.rdf index fe97a314c..7cc248306 100644 --- a/rt/html/Search/Results.rdf +++ b/rt/html/Search/Results.rdf @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -49,7 +47,7 @@ my $Tickets = RT::Tickets->new($session{'CurrentUser'}); $Tickets->FromSQL($ARGS{'Query'}); -$r->content_type('application/rss+xml'); +$r->content_type('application/rdf+xml'); diff --git a/rt/html/Search/Results.tsv b/rt/html/Search/Results.tsv index bb1907317..e6b20481f 100644 --- a/rt/html/Search/Results.tsv +++ b/rt/html/Search/Results.tsv @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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., 51 Franklin Street, Fifth Floor, Boston, MA -%# 02110-1301 or visit their web page on the internet at -%# http://www.gnu.org/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,64 +43,45 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<%ARGS> -$OrderBy => 'id' -$Order => 'ASC' - <%INIT> -my $Tickets = RT::Tickets->new( $session{'CurrentUser'} ); -$Tickets->FromSQL( $ARGS{'Query'} ); -if ( $OrderBy =~ /\|/ ) { - - # Multiple Sorts - my @OrderBy = split /\|/, $OrderBy; - my @Order = split /\|/, $Order; - $Tickets->OrderByCols( - map { { FIELD => $OrderBy[$_], ORDER => $Order[$_] } } - ( 0 .. $#OrderBy ) ); -} -else { - $Tickets->OrderBy( FIELD => $OrderBy, ORDER => $Order ); -} +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); +$Tickets->FromSQL($ARGS{'Query'}); my @rows; my %known_cfs; my @attrs = qw( id QueueObj->Name Subject Status TimeEstimated TimeWorked TimeLeft Priority FinalPriority OwnerObj->Name - Requestors->MemberEmailAddressesAsString Cc->MemberEmailAddressesAsString AdminCc->MemberEmailAddressesAsString - DueObj->ISO ToldObj->ISO CreatedObj->ISO ResolvedObj->ISO LastUpdatedObj->ISO); + Requestors->MemberEmailAddressesAsString DueObj->ISO ToldObj->ISO + CreatedObj->ISO ResolvedObj->ISO ); -$r->content_type('application/vnd.ms-excel'); -while ( my $Ticket = $Tickets->Next()) { - my $row; - foreach my $attr (@attrs) { - if ($attr =~ /(.*)->ISO$/ and $Ticket->$1->Unix <= 0) { - $row->{$attr} = ""; - } else { - my $method = '$Ticket->'.$attr.'()'; - $row->{$attr} = eval $method; + $r->content_type('application/vnd.ms-excel'); + while ( my $Ticket = $Tickets->Next()) { + my $row; + foreach my $attr (@attrs) { + my $method = '$Ticket->'.$attr.'()'; + $row->{$attr} = eval $method; if ($@) {die "Failed to find $attr - ". $@}; - } - } + } - my $cfs = $Ticket->QueueObj->TicketCustomFields(); - while (my $cf = $cfs->Next) { - my @content; - my $values = $Ticket->CustomFieldValues($cf->Id); - while (my $value = $values->Next) { - push @content, $value->Content; - } - $row->{'CustomField-'.$cf->Id} = join(', ',@content); - if ($row->{'CustomField-'.$cf->Id}) { - $known_cfs{$cf->Id} = $cf->Name; + my $cfs = $Ticket->QueueObj->TicketCustomFields(); + while (my $cf = $cfs->Next) { + my @content; + my $values = $Ticket->CustomFieldValues($cf->Id); + while (my $value = $values->Next) { + push @content, $value->Content; + } + $row->{'CustomField-'.$cf->Id} = join(', ',@content); + if ($row->{'CustomField-'.$cf->Id}) { + $known_cfs{$cf->Id} = $cf->Name; + } } - } - push @rows, $row; -} + push @rows, $row; + + } { - my @header; +my @header; foreach my $attr (@attrs) { my $label = $attr; $label =~ s'Obj-.(?:AsString|Name|ISO)''g; @@ -110,25 +89,27 @@ while ( my $Ticket = $Tickets->Next()) { push @header, $label; } foreach my $id (sort keys %known_cfs) { - push @header, "CF-".$known_cfs{$id}; + push @header, $known_cfs{$id}; } - $m->out(join("\t", @header)); - $m->out("\n"); -} +$m->out(join("\t", @header)); +$m->out("\n"); +} foreach my $row (@rows) { - my @row; - foreach my $attr(@attrs) { - push @row, $row->{"$attr"}; - } - foreach my $id (sort keys %known_cfs) { - my $val = $row->{'CustomField-'.$id}; - $val =~ s/(\n|\r)//g; - push @row, $val; - } - $m->out(join("\t",@row)); - $m->out("\n"); + my @row; + foreach my $attr(@attrs) { + push @row, $row->{"$attr"}; + } + foreach my $id (sort keys %known_cfs) { + my $val = $row->{'CustomField-'.$id}; + $val =~ s/(\n|\r)//g; + push @row, $val; + } + + $m->out(join("\t",@row)); + $m->out("\n"); } + $m->abort(); -- cgit v1.2.1