[Rt-commit] r6497 - rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Prefs

clkao at bestpractical.com clkao at bestpractical.com
Wed Nov 22 06:34:26 EST 2006


Author: clkao
Date: Wed Nov 22 06:33:42 2006
New Revision: 6497

Modified:
   rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Prefs/MyRT.html

Log:
Allow resetting myrt.

Modified: rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Prefs/MyRT.html
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Prefs/MyRT.html	(original)
+++ rt/branches/3.6-EXPERIMENTAL-LONDRES/html/Prefs/MyRT.html	Wed Nov 22 06:33:42 2006
@@ -54,6 +54,14 @@
 
 <& /Elements/ListActions, actions => \@actions &>
 <br />
+
+<form method="post" action="MyRT.html">
+<input type="hidden" name="Reset" value="1" />
+<input type="submit" class="button" value="<%loc('Reset to default')%>"
+</form>
+
+<br />
+
 % for my $pane (@panes) {
 <&|/Widgets/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &>
 <& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &></&>
@@ -70,11 +78,14 @@
 my $title = loc("Customize").' '.loc("RT at a glance");
 my $user = $session{'CurrentUser'}->UserObj;
 
+if ($ARGS{Reset}) {
+    $user->SetPreferences('HomepageSettings', {});
+    delete $session{'my_rt_portlets'};
+}
+
 unless (exists $session{'my_rt_portlets'}) {
-    my $portlets; 
-    
     my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings');
-    $portlets  = $default_portlets ? $default_portlets->Content  : {};
+    my $portlets  = $default_portlets ? $default_portlets->Content  : {};
     $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $portlets);
 }
 if ($ARGS{SummaryRows}) {


More information about the Rt-commit mailing list