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

Jim Brandt jbrandt at bestpractical.com
Fri Jan 3 13:57:56 EST 2014


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

1:  eebb99d ! 1:  dff134d Add Date and DateTime CFs to bulk update
    @@ -5,6 +5,11 @@
         Date conversion is needed only for delete because AddValueForObject
         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.
     
     diff --git a/share/html/Elements/EditCustomFieldDateTime b/share/html/Elements/EditCustomFieldDateTime
     --- a/share/html/Elements/EditCustomFieldDateTime
    @@ -29,16 +34,28 @@
     --- 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 &></td>
    -+<td><& /Elements/EditCustomFieldDate, @del &></td>
    ++<td><& /Elements/EditCustomFieldDate, %add_params &></td>
    ++<td><& /Elements/EditCustomFieldDate, %del_params &></td>
     +% } elsif ($cf->Type eq 'DateTime') {
     +% # Pass datemanip format to prevent another tz date conversion
    -+<td><& /Elements/EditCustomFieldDateTime, @add, Format => 'datemanip' &></td>
    -+<td><& /Elements/EditCustomFieldDateTime, @del, Format => 'datemanip' &></td>
    ++<td><& /Elements/EditCustomFieldDateTime, %add_params, Format => 'datemanip' &></td>
    ++<td><& /Elements/EditCustomFieldDateTime, %del_params, Format => 'datemanip' &></td>
      % } else {
      %   $RT::Logger->crit("Unknown CustomField type: " . $cf->Type);
      % }
    @@ -50,11 +67,13 @@
     +                    # 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' ){
    ++                    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 = $DateObj->ISO;
    ++                        $value = $cf->Type eq 'DateTime' ? $DateObj->ISO
    ++                            : $DateObj->ISO(Time => 0, Seconds => 0);
     +                    }
     +
                          if ( $op eq 'del' && $current_values->HasEntry($value) ) {



More information about the rt-commit mailing list