[Rt-commit] rt branch, 5.0/custom-date-ranges-config-in-web-ui, repushed

Michel Rodriguez michel at bestpractical.com
Fri May 1 13:42:53 EDT 2020


The branch 5.0/custom-date-ranges-config-in-web-ui was deleted and repushed:
       was 18dd00fa7c23e2d69a3c3a095d3f1aad79ae3974
       now 2a64b99c942fe4126c3bfaccce16c41b413076c4

1: dc5b10a7a8 = 1: dc5b10a7a8 Move CustomDateRanges to the Features section of the web config editor.
2: b0533ab24a = 2: b0533ab24a Hide the [Custom Data Ranges] menu entry for users who don't have the rights.
3: 4c8d1768ab = 3: 4c8d1768ab Use bootstrap for custom date ranges edit form.
4: 70a2c2bfd4 = 4: 70a2c2bfd4 Create option CustomDateRangesUI.
5: c7b5c8a651 ! 5: 3b36c93bb0 Add Custom Date Ranges as a user preference.
    @@ -1,6 +1,6 @@
     Author: michel <michel at bestpractical.com>
     
    -    Added Custom Date Ranges as a user preference.
    +    Add Custom Date Ranges as a user preference.
     
     diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
     --- a/lib/RT/Config.pm
6: cf92b7c36b ! 6: bfba738672 Add display of other users custom date ranges in user setting page.
    @@ -1,6 +1,6 @@
     Author: michel <michel at bestpractical.com>
     
    -    Added display of other users custom date ranges in user setting page.
    +    Add display of other users custom date ranges in user setting page.
     
     diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
     --- a/lib/RT/Config.pm
7: b9679cdbf5 ! 7: 6d9a390d41 Display Custom Date Ranges in UI.
    @@ -1,9 +1,12 @@
     Author: michel <michel at bestpractical.com>
     
    -    Functioning version of Custom Date Ranges in UI.
    +    Display Custom Date Ranges in UI.
         
    -    If a custom date range is already defined by an other user, doesn't
    -    display the name of the user.
    +    The user preference page displays CDRs from the config files,
    +    from the DB, from other users, and from the current user.
    +    
    +    Note: if a custom date range is already defined by an other user,
    +    the error message doesn't display the name of the user.
     
     diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
     --- a/lib/RT/Config.pm
    @@ -40,21 +43,24 @@
     +            _CustomDateRangesSpecOrigin( $cdr, 'other user config', $cdr_origin );
     +        }
     +        $config = MergeCustomDateRangesSpecs( $config, $db_config,  @from_other_users );
    -+    }
    +     }
     +    if ( $include_level > 1 ) {
     +        my $current_user = $HTML::Mason::Commands::session{'CurrentUser'} || RT->SystemUser;
    -+        my $user_cdr = $current_user->UserObj->Preferences("CustomDateRanges" );
    -+        if($user_cdr ) {
    -+            _CustomDateRangesSpecOrigin( $user_cdr, 'user', $cdr_origin );
    -+            $config = MergeCustomDateRangesSpecs( $config, $user_cdr );
    ++        if( $current_user ) {
    ++            my $user_cdr = $current_user->UserObj->Preferences("CustomDateRanges" );
    ++            if($user_cdr ) {
    ++                _CustomDateRangesSpecOrigin( $user_cdr, 'user', $cdr_origin );
    ++                $config = MergeCustomDateRangesSpecs( $config, $user_cdr );
    ++            }
     +        }
    -     }
    ++    }
     +
          return ( $config, $cdr_origin );
      }
      
     +sub CustomDateRangesFromOtherUsers {
     +
    ++    return {} unless RT->SystemUser;
     +    my $current_user = $HTML::Mason::Commands::session{'CurrentUser'} || RT->SystemUser;
     +
     +    my $attributes = RT::Attributes->new( RT->SystemUser );
8: 85a3435142 = 8: 7670d88224 Remove [Custom Date Ranges] menu entry.
9: 18dd00fa7c = 9: 2a64b99c94 Add initial check on custom date ranges.



More information about the rt-commit mailing list