X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FBulk.html;h=38ca642489017db444c0278fa6d27067911895a8;hb=0ea23112cfa0d82738b0f08d60d90579721b7524;hp=4a510ce97cf07d23d2e4242bfe11da3e40ad5bc1;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/rt/share/html/Search/Bulk.html b/rt/share/html/Search/Bulk.html index 4a510ce97..38ca64248 100755 --- a/rt/share/html/Search/Bulk.html +++ b/rt/share/html/Search/Bulk.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -46,21 +46,11 @@ %# %# 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, - SavedSearchId => $SavedSearchId, - SavedChartSearchId => $SavedChartSearchId, - &> +<& /Elements/Tabs &> <& /Elements/ListActions, actions => \@results &> -
-% foreach my $var qw(Query Format OrderBy Order Rows Page SavedChartSearchId) { + +% foreach my $var (qw(Query Format OrderBy Order Rows Page SavedChartSearchId)) { %} <& /Elements/CollectionList, @@ -81,7 +71,7 @@
-<& /Elements/Submit, Label => loc('Update'), CheckAll => 1, ClearAll => 1 &> +<& /Elements/Submit, Label => loc('Update'), CheckboxNameRegex => '/^UpdateTicket\d+$/', CheckAll => 1, ClearAll => 1 &>
<&|/Widgets/TitleBox, title => $title &> @@ -121,17 +111,17 @@ - + - + - + - + - + - +
<&|/l&>Make queue: <& /Elements/SelectQueue, Name => "Queue", Default => $ARGS{Queue} &>
<&|/l&>Make Status: <& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status} &>
<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}, Queues => $seen_queues &>
<&|/l&>Make date Starts: <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => $ARGS{Starts_Date} || '' &>
<& /Elements/SelectDate, Name => "Starts_Date", Default => $ARGS{Starts_Date} || '' &>
<&|/l&>Make date Started: <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => $ARGS{Started_Date} || '' &>
<& /Elements/SelectDate, Name => "Started_Date", Default => $ARGS{Started_Date} || '' &>
<&|/l&>Make date Told: <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => $ARGS{Tole_Date} || '' &>
<& /Elements/SelectDate, Name => "Told_Date", Default => $ARGS{Told_Date} || '' &>
<&|/l&>Make date Due: <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => $ARGS{Due_Date} || '' &>
<& /Elements/SelectDate, Name => "Due_Date", Default => $ARGS{Due_Date} || '' &>
<&|/l&>Make date Resolved: <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => $ARGS{Resolved_Date} || '' &>
<& /Elements/SelectDate, Name => "Resolved_Date", Default => $ARGS{Resolved_Date} || '' &>
@@ -142,7 +132,7 @@ @@ -159,20 +149,9 @@ size="60" value="<% $ARGS{UpdateSubject} || "" %>" /> &><% $CF->FriendlyType %> % } # end if while -% if (exists $session{'Attachments'}) { - - - -% } # end of if - +<& /Ticket/Elements/AddAttachments, %ARGS &> + +% } elsif ($cf->Type eq 'Date') { + + +% } elsif ($cf->Type eq 'DateTime') { +% # Pass datemanip format to prevent another tz date conversion + + % } else { % $RT::Logger->crit("Unknown CustomField type: " . $cf->Type); % } @@ -255,34 +241,7 @@ map ( $ARGS{$_} =~ /^$/ && ( delete $ARGS{$_} ), keys %ARGS ); my (@results); -# {{{ deal with deleting uploaded attachments -foreach my $key (keys %ARGS) { - if ($key =~ m/^DeleteAttach-(.+)$/) { - delete $session{'Attachments'}{$1}; - } - $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; -} -# }}} - -# {{{ store the uploaded attachment in session -if ($ARGS{'Attach'}) { # attachment? - my $attachment = MakeMIMEEntity( - AttachmentFieldName => 'Attach' - ); - - my $file_path = Encode::decode_utf8("$ARGS{'Attach'}"); - $session{'Attachments'} = { - %{$session{'Attachments'} || {}}, - $file_path => $attachment, - }; -} -# }}} - -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} +ProcessAttachments(ARGSRef => \%ARGS); $Page ||= 1; @@ -327,7 +286,6 @@ while ( my $ticket = $Tickets->Next ) { #Iterate through each ticket we've been handed my @linkresults; -my %queues; $Tickets->RedoSearch(); @@ -354,7 +312,6 @@ unless ( $ARGS{'AddMoreAttach'} ) { #Update the links $ARGS{'id'} = $Ticket->id; - $queues{ $Ticket->QueueObj->Id }++; my @updateresults = ProcessUpdateMessage( TicketObj => $Ticket, @@ -371,13 +328,13 @@ unless ( $ARGS{'AddMoreAttach'} ) { my @watchresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS ); - foreach my $type qw(MergeInto DependsOn MemberOf RefersTo) { + 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) { + foreach my $type (qw(MergeInto DependsOn MemberOf RefersTo)) { delete $ARGS{ $type . "-" . $Ticket->id }; delete $ARGS{ $Ticket->id . "-" . $type }; } @@ -422,7 +379,27 @@ unless ( $ARGS{'AddMoreAttach'} ) { unless ( $cf->SingleValue ); my $current_values = $Ticket->CustomFieldValues($cfid); + + if ( $cf->Type eq 'DateTime' || $cf->Type eq 'Date' ){ + # Clear out empty string submissions to avoid + # Not set changed to Not set + @values = grep length, @values; + } + foreach my $value (@values) { + + # Convert for timezone. Without converstion, + # HasEntry and DeleteCustomFieldValue fail because + # the value in the DB is converted. + if ( $op eq 'del' + && ($cf->Type eq 'DateTime' || $cf->Type eq 'Date') ){ + my $DateObj = RT::Date->new( $session{'CurrentUser'} ); + $DateObj->Set( Format => 'unknown', + Value => $value ); + $value = $cf->Type eq 'DateTime' ? $DateObj->ISO + : $DateObj->ISO(Time => 0, Seconds => 0); + } + if ( $op eq 'del' && $current_values->HasEntry($value) ) { my ( $id, $msg ) = $Ticket->DeleteCustomFieldValue( Field => $cfid, @@ -461,11 +438,13 @@ unless ( $ARGS{'AddMoreAttach'} ) { # Cleanup WebUI delete $session{'Attachments'}; + + $Tickets->RedoSearch(); } my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} ); $TxnCFs->LimitToLookupType( RT::Transaction->CustomFieldLookupType ); -$TxnCFs->LimitToGlobalOrObjectId( sort keys %queues ); +$TxnCFs->LimitToGlobalOrObjectId( keys %$seen_queues ); <%args>
<&|/l&>Update Type:
<&|/l&>Attached file: -<&|/l&>Check box to delete
-% foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
-% } # end of foreach -
<&|/l&>Attach: - -
<&|/l&>Message: %# Currently, bulk update always starts with Comment not Reply selected, so we check this unconditionally % my $IncludeSignature = RT->Config->Get('MessageBoxIncludeSignatureOnComment'); @@ -223,6 +202,13 @@ $cfs->LimitToQueue($_) for keys %$seen_queues; % } elsif ($cf->Type eq 'Text') { <& /Elements/EditCustomFieldText, @add &>  <& /Elements/EditCustomFieldDate, @add, Default => undef &><& /Elements/EditCustomFieldDate, @del, Default => undef &><& /Elements/EditCustomFieldDateTime, @add, Default => undef, Format => 'datemanip' &><& /Elements/EditCustomFieldDateTime, @del, Default => undef, Format => 'datemanip' &>