[Rt-commit] r13210 - in rt/branches/3.8-TESTING: . share/html/Prefs

sartak at bestpractical.com sartak at bestpractical.com
Thu Jun 12 12:20:49 EDT 2008


Author: sartak
Date: Thu Jun 12 12:20:47 2008
New Revision: 13210

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/share/html/Admin/Users/MyRT.html
   rt/branches/3.8-TESTING/share/html/Prefs/MyRT.html
   rt/branches/3.8-TESTING/share/html/Prefs/Other.html
   rt/branches/3.8-TESTING/share/html/Prefs/Quicksearch.html
   rt/branches/3.8-TESTING/share/html/Prefs/Search.html
   rt/branches/3.8-TESTING/share/html/Prefs/SearchOptions.html

Log:
 r62267 at onn:  sartak | 2008-06-12 12:17:32 -0400
 Alert the user when preferences were not actually saved


Modified: rt/branches/3.8-TESTING/share/html/Admin/Users/MyRT.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Admin/Users/MyRT.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Admin/Users/MyRT.html	Thu Jun 12 12:20:47 2008
@@ -78,7 +78,8 @@
 my $title = loc("RT at a glance for the user [_1]", $UserObj->Name);
 
 if ($ARGS{Reset}) {
-    $UserObj->SetPreferences('HomepageSettings', {});
+    my ($ok, $msg) = $UserObj->SetPreferences('HomepageSettings', {});
+    push @actions, $ok ? loc('Preferences saved for user [_2].', $UserObj->Name) : $msg;
 }
 
 my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
@@ -119,8 +120,8 @@
     current_portlets => $portlets,
     OnSave => sub {
         my ( $conf, $pane ) = @_;
-        $UserObj->SetPreferences( 'HomepageSettings', $conf );
-        push @actions, loc( 'Preferences [_1] for user [_2] .', $pane, $UserObj->Name );
+        my ($ok, $msg) = $UserObj->SetPreferences( 'HomepageSettings', $conf );
+        push @actions, $ok ? loc('Preferences [_1] for user [_2].', $pane, $UserObj->Name) : $msg;
     }
 );
 

Modified: rt/branches/3.8-TESTING/share/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/MyRT.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/MyRT.html	Thu Jun 12 12:20:47 2008
@@ -90,14 +90,15 @@
         $ARGS{SummaryRows} = 0;
     }
     else {
-        $user->SetPreferences( 'SummaryRows', int $ARGS{SummaryRows} );
-        push @results, loc ('Preferences saved for [_1].', loc('summary rows'));
+        my ($ok, $msg) = $user->SetPreferences( 'SummaryRows', int $ARGS{SummaryRows} );
+        push @results, $ok ? loc('Preferences saved for [_1].', loc('summary rows')) : $msg;
     }
 }
 $ARGS{'SummaryRows'} ||= $user->Preferences('SummaryRows', RT->Config->Get('DefaultSummaryRows'));
 
 if ($ARGS{Reset}) {
-    $user->SetPreferences('HomepageSettings', {});
+    my ($ok, $msg) = $user->SetPreferences('HomepageSettings', {});
+    push @results, $ok ? loc('Preferences saved.') : $msg;
     delete $session{'my_rt_portlets'};
 }
 
@@ -144,8 +145,8 @@
     current_portlets => $portlets,
     OnSave => sub {
         my ( $conf, $pane ) = @_;
-        $user->SetPreferences( 'HomepageSettings', $conf );
-        push @results, loc( 'Preferences saved for [_1].', $pane );
+        my ($ok, $msg) = $user->SetPreferences( 'HomepageSettings', $conf );
+        push @results, $ok ? loc('Preferences saved for [_1].', $pane) : $msg;
         delete $session{'my_rt_portlets'};
     }
 );

Modified: rt/branches/3.8-TESTING/share/html/Prefs/Other.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/Other.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/Other.html	Thu Jun 12 12:20:47 2008
@@ -98,7 +98,9 @@
             DefaultValue => { map { $_ => RT->Config->Get($_) }
                 RT->Config->Options
             }, );
-    $UserObj->SetPreferences( $RT::System, $preferences );
+
+    my ($ok, $msg) = $UserObj->SetPreferences( $RT::System, $preferences );
+    push @results, $ok ? loc("Preferences saved.") : $msg;
 }
 my $finalize_meta = sub {
     my %meta = %{ shift() };

Modified: rt/branches/3.8-TESTING/share/html/Prefs/Quicksearch.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/Quicksearch.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/Quicksearch.html	Thu Jun 12 12:20:47 2008
@@ -87,8 +87,9 @@
         }
     }
 
-    $user->SetPreferences('QuickSearch', $unwanted);
-    push @actions, loc ('Preferences saved.');
+    my ($ok, $msg) = $user->SetPreferences('QuickSearch', $unwanted);
+    push @actions, $ok ? loc('Preferences saved.') : $msg;
+
     # Let QueueSummary rebuild the cache
     delete $session{'quick_search_queues'};
 }

Modified: rt/branches/3.8-TESTING/share/html/Prefs/Search.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/Search.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/Search.html	Thu Jun 12 12:20:47 2008
@@ -104,8 +104,8 @@
 
 if ($ARGS{'Save'}) {
     my $hash = {map { $_ => $ARGS{$_}} @fields};
-    my $pref = $user->SetPreferences ($search, $hash);
-    push @actions, loc ('Preferences saved.');
+    my ($ok, $msg) = $user->SetPreferences($search, $hash);
+    push @actions, $ok ? loc('Preferences saved.') : $msg;
 }
 
 </%INIT>

Modified: rt/branches/3.8-TESTING/share/html/Prefs/SearchOptions.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Prefs/SearchOptions.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Prefs/SearchOptions.html	Thu Jun 12 12:20:47 2008
@@ -50,6 +50,7 @@
     current_tab => "Prefs/SearchOptions.html",
     Title => loc("Search Preferences")
 &>
+<& /Elements/ListActions, actions => \@actions &>
 
 <form method="post" action="SearchOptions.html">
 <input type="hidden" class="hidden" name="Format" value="<%$Format%>" />
@@ -64,6 +65,7 @@
 <& /Elements/Submit, Name => 'SavePreferences', Label => loc('Save Changes') &>
 </form>
 <%INIT>
+my @actions;
 
 # {{{ If we're saving search preferences, do that now
 $Order = join '|', grep defined && /\S/, (ref $Order)? @{$Order}: $Order;
@@ -72,13 +74,14 @@
 $Order       = (ref $Order   ? join('|',grep {/\S/} @{$Order})   : $Order);
 $OrderBy     = (ref $OrderBy ? join('|',grep {/\S/} @{$OrderBy}) : $OrderBy);
 if ($ARGS{'SavePreferences'}) {
-    $session{'CurrentUser'}->UserObj->SetPreferences("SearchDisplay",
+    my ($ok, $msg) = $session{'CurrentUser'}->UserObj->SetPreferences("SearchDisplay",
     {
        Format      => $Format,
        Order       => $Order,
        OrderBy     => $OrderBy,
        RowsPerPage => $RowsPerPage,
     });
+    push @actions, $ok ? loc("Preferences saved.") : $msg;
 }
 
 # }}}


More information about the Rt-commit mailing list