[Rt-commit] rt branch, 5.0/custom-date-ranges-config-in-web-ui, repushed
Michel Rodriguez
michel at bestpractical.com
Wed Mar 18 07:18:32 EDT 2020
The branch 5.0/custom-date-ranges-config-in-web-ui was deleted and repushed:
was df9552e65884a3e9834b85d6a294ecadaed38919
now 85a3435142e3b0216f32f6309e0a1767dc85e432
1: dc5b10a7a = 1: dc5b10a7a Move CustomDateRanges to the Features section of the web config editor.
2: b0533ab24 = 2: b0533ab24 Hide the [Custom Data Ranges] menu entry for users who don't have the rights.
3: 4c8d1768a = 3: 4c8d1768a Use bootstrap for custom date ranges edit form.
4: 70a2c2bfd = 4: 70a2c2bfd Create option CustomDateRangesUI.
5: c7b5c8a65 = 5: c7b5c8a65 Added Custom Date Ranges as a user preference.
6: cf92b7c36 = 6: cf92b7c36 Added display of other users custom date ranges in user setting page.
7: df9552e65 ! 7: b9679cdbf Functioning version of Custom Date Ranges in UI.
@@ -2,7 +2,6 @@
Functioning version of Custom Date Ranges in UI.
- Emits quite a few warnings.
If a custom date range is already defined by an other user, doesn't
display the name of the user.
@@ -43,7 +42,8 @@
+ $config = MergeCustomDateRangesSpecs( $config, $db_config, @from_other_users );
+ }
+ if ( $include_level > 1 ) {
-+ my $user_cdr = $HTML::Mason::Commands::session{'CurrentUser'}->UserObj->Preferences("CustomDateRanges" );
++ 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 );
@@ -55,7 +55,7 @@
+sub CustomDateRangesFromOtherUsers {
+
-+ my $current_user = $HTML::Mason::Commands::session{'CurrentUser'} ;
++ my $current_user = $HTML::Mason::Commands::session{'CurrentUser'} || RT->SystemUser;
+
+ my $attributes = RT::Attributes->new( RT->SystemUser );
+ $attributes->Limit( FIELD => 'Name', VALUE => 'Pref-CustomDateRanges' );
@@ -115,6 +115,32 @@
}
+diff --git a/share/html/Elements/CustomDateRangesSpecs b/share/html/Elements/CustomDateRangesSpecs
+--- a/share/html/Elements/CustomDateRangesSpecs
++++ b/share/html/Elements/CustomDateRangesSpecs
+@@
+ </div>
+ % }
+ % else {
+- <p><&|/l&>No custom date ranges in <% $Location %></&></p>
++ <p><&|/l&>No custom date ranges in</&> <% $Location %></p>
+ % }
+ </&>
+
+
+diff --git a/share/html/Search/Elements/BuildFormatString b/share/html/Search/Elements/BuildFormatString
+--- a/share/html/Search/Elements/BuildFormatString
++++ b/share/html/Search/Elements/BuildFormatString
+@@
+
+ $Face => undef
+ $Size => undef
+-$Link => undef
++$Link => ''
+ $Title => undef
+
+ $AddCol => undef
+
diff --git a/share/html/Widgets/Form/CustomDateRange b/share/html/Widgets/Form/CustomDateRange
--- a/share/html/Widgets/Form/CustomDateRange
+++ b/share/html/Widgets/Form/CustomDateRange
@@ -132,3 +158,30 @@
$from_user = $session{'CurrentUser'}->UserObj->Preferences("CustomDateRanges" );
}
+@@
+ $UserPreferences => 0,
+
+ </%ARGS>
++
++<%METHOD Process>
++<%ARGS>
++$Name
++
++$Arguments => {},
++
++$Default => 0,
++$DefaultValue => '',
++</%ARGS>
++<%INIT>
++my $value = $Arguments->{ $Name };
++$value = '' unless defined $value;
++
++if ( $value eq '' ) {
++ return $DefaultValue unless $Default;
++ return undef;
++}
++return $value;
++</%INIT>
++</%METHOD>
++
+
-: ------- > 8: 85a343514 Remove [Custom Date Ranges] menu entry.
More information about the rt-commit
mailing list