[Rt-commit] rt branch, 4.0/add-date-datetime-to-bulk-update, repushed

Jim Brandt jbrandt at bestpractical.com
Fri Jan 17 10:32:36 EST 2014


The branch 4.0/add-date-datetime-to-bulk-update was deleted and repushed:
       was dff134d8c888e92173d83a8b85a63eba1aba6be2
       now a5da1630751326fcad4d9bc06c63a5aa9404ef6a

1:  dff134d ! 1:  a5da163 Add Date and DateTime CFs to bulk update
    @@ -6,10 +6,14 @@
         in RT::CustomField calls CanonicalizeValue methods to handle
         conversion on add.
         
    -    Don't pass a Default value for Date and DateTime because the
    -    display in parens differs from the dates in the top section
    -    which puts values in the text box like other fields. This
    -    will ulimately be fixed for 4.4 via 4.2/date-input-keep-value.
    +    For Date and DateTime, pass undef for Default to assure that we
    +    don't incorrectly imply that there will be a default value set
    +    if the box is left empty. This inconsistency has been resolved in
    +    4.4 via 4.4/date-input-keep-value
    +    
    +    @values is checked for length, otherwise empty string values
    +    are submitted for empty fields resulting in update messages
    +    noting "Not set changed to Not set".
     
     diff --git a/share/html/Elements/EditCustomFieldDateTime b/share/html/Elements/EditCustomFieldDateTime
     --- a/share/html/Elements/EditCustomFieldDateTime
    @@ -34,34 +38,30 @@
     --- a/share/html/Search/Bulk.html
     +++ b/share/html/Search/Bulk.html
     @@
    - % my @del = (NamePrefix => 'Bulk-Delete-CustomField-', CustomField => $cf,
    - %   Rows => $rows, Multiple => 1, Cols => 25,
    - %   Default => $ARGS{"Bulk-Delete-CustomField-$cf_id-Values"} || $ARGS{"Bulk-Delete-CustomField-$cf_id-Value"}, );
    -+% # Remove Default for Date and DateTime CFs below.
    -+% my %add_params = @add;
    -+% delete $add_params{'Default'};
    -+% my %del_params = @del;
    -+% delete $del_params{'Default'};
    - % if ($cf->Type eq 'Select') {
    - <td><& /Elements/EditCustomFieldSelect, @add &></td>
    - <td><& /Elements/EditCustomFieldSelect, @del &></td>
    -@@
      % } elsif ($cf->Type eq 'Text') {
      <td><& /Elements/EditCustomFieldText, @add &></td>
      <td> </td>
     +% } elsif ($cf->Type eq 'Date') {
    -+<td><& /Elements/EditCustomFieldDate, %add_params &></td>
    -+<td><& /Elements/EditCustomFieldDate, %del_params &></td>
    ++<td><& /Elements/EditCustomFieldDate, @add, Default => undef &></td>
    ++<td><& /Elements/EditCustomFieldDate, @del, Default => undef &></td>
     +% } elsif ($cf->Type eq 'DateTime') {
     +% # Pass datemanip format to prevent another tz date conversion
    -+<td><& /Elements/EditCustomFieldDateTime, %add_params, Format => 'datemanip' &></td>
    -+<td><& /Elements/EditCustomFieldDateTime, %del_params, Format => 'datemanip' &></td>
    ++<td><& /Elements/EditCustomFieldDateTime, @add, Default => undef, Format => 'datemanip' &></td>
    ++<td><& /Elements/EditCustomFieldDateTime, @del, Default => undef, Format => 'datemanip' &></td>
      % } else {
      %   $RT::Logger->crit("Unknown CustomField type: " . $cf->Type);
      % }
     @@
    +                   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,



More information about the rt-commit mailing list