X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FSearch%2FBulk.html;h=38ca642489017db444c0278fa6d27067911895a8;hp=a215eac8ed744baca95eca69650b8e6a3ade7c3c;hb=0ea23112cfa0d82738b0f08d60d90579721b7524;hpb=60dd95422a1ad4724e0c5d9dd7f8e8878cd96aa8 diff --git a/rt/share/html/Search/Bulk.html b/rt/share/html/Search/Bulk.html index a215eac8e..38ca64248 100755 --- a/rt/share/html/Search/Bulk.html +++ b/rt/share/html/Search/Bulk.html @@ -202,6 +202,13 @@ $cfs->LimitToQueue($_) for keys %$seen_queues; % } elsif ($cf->Type eq 'Text') { <& /Elements/EditCustomFieldText, @add &>   +% } elsif ($cf->Type eq 'Date') { +<& /Elements/EditCustomFieldDate, @add, Default => undef &> +<& /Elements/EditCustomFieldDate, @del, Default => undef &> +% } elsif ($cf->Type eq 'DateTime') { +% # Pass datemanip format to prevent another tz date conversion +<& /Elements/EditCustomFieldDateTime, @add, Default => undef, Format => 'datemanip' &> +<& /Elements/EditCustomFieldDateTime, @del, Default => undef, Format => 'datemanip' &> % } else { % $RT::Logger->crit("Unknown CustomField type: " . $cf->Type); % } @@ -372,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, @@ -411,6 +438,8 @@ unless ( $ARGS{'AddMoreAttach'} ) { # Cleanup WebUI delete $session{'Attachments'}; + + $Tickets->RedoSearch(); } my $TxnCFs = RT::CustomFields->new( $session{CurrentUser} );