[Rt-commit] r2694 - in rt/branches/PLATANO-EXPERIMENTAL-CSS: . etc etc/upgrade/QUEBEC html/Elements html/Widgets lib/RT lib/t/regression

jesse at bestpractical.com jesse at bestpractical.com
Sat Apr 16 04:15:08 EDT 2005


Author: jesse
Date: Sat Apr 16 04:15:07 2005
New Revision: 2694

Added:
   rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/upgrade/QUEBEC/
   rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/upgrade/QUEBEC/content
Modified:
   rt/branches/PLATANO-EXPERIMENTAL-CSS/   (props changed)
   rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/initialdata
   rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/ShowSearch
   rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox
   rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Queues_Overlay.pm
   rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/User_Overlay.pm
   rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/t/regression/18custom_frontpage.t
Log:
 r13083 at hualien:  jesse | 2005-04-16 03:01:40 -0400
  r12980 at hualien:  jesse | 2005-04-16 02:17:57 -0400
   r8728 at hualien:  jesse | 2005-03-14 12:29:07 -0500
    r8416 at hualien (orig r2349):  clkao | 2005-03-13 02:20:34 -0500
    Do SeeQueue permission filtering in AddRecord so both Next() and
    ItemsArrayRef work.
    r8452 at hualien (orig r2351):  jesse | 2005-03-14 01:32:53 -0500
     r8450 at hualien:  jesse | 2005-03-14 01:30:59 -0500
     Slight style cleanup to page actions. 
    
    r8454 at hualien (orig r2352):  jesse | 2005-03-14 01:37:23 -0500
     r8453 at hualien:  jesse | 2005-03-14 01:37:00 -0500
     Hilighted menu options are now the right size
    
    r8718 at hualien (orig r2465):  clkao | 2005-03-14 11:35:59 -0500
    Localise format in predefined search with __l{text}__.
    r8719 at hualien (orig r2466):  clkao | 2005-03-14 11:37:56 -0500
    Disable js for now.
    r8720 at hualien (orig r2467):  clkao | 2005-03-14 11:48:37 -0500
    * Rename "My Requests" => "Unowned Tickets".
    * __l{text}__ => __loc(text)__
    r8721 at hualien (orig r2468):  clkao | 2005-03-14 12:01:08 -0500
    Upgrade path to QUEBEC.
    r8722 at hualien (orig r2469):  clkao | 2005-03-14 12:17:02 -0500
    Allow AutoSave mode for SelectionBox.
   
  
 


Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/initialdata
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/initialdata	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/initialdata	Sat Apr 16 04:15:07 2005
@@ -597,12 +597,11 @@
         OrderBy => 'Priority',
         Order   => 'DESC' },
     },
-    { Name => 'Search - My Requests',
+    { Name => 'Search - Unowned Tickets',
       Description => '[_1] newest unowned tickets', # loc
       Content     =>
-# take care of the loc here for 'Take'
-      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"__WebPath__/Ticket/Display.html?Action=Take&id=__id__\">Take</a>/TITLE:&nbsp;' ",
-
+# 'Take' #loc
+      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"__WebPath__/Ticket/Display.html?Action=Take&id=__id__\">__loc(Take)__</a>/TITLE:&nbsp;' ",
         Query   => " Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')",
         OrderBy => 'Created',
         Order   => 'DESC' },
@@ -612,7 +611,7 @@
       Content =>
       { 'body' => # loc
 	[ { type => 'system', name => 'My Tickets' },
-	  { type => 'system', name => 'My Requests' },
+	  { type => 'system', name => 'Unowned Tickets' },
 	  { type => 'component',  name => 'QuickCreate'},
 	],
         'summary' => # loc

Added: rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/upgrade/QUEBEC/content
==============================================================================
--- (empty file)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/etc/upgrade/QUEBEC/content	Sat Apr 16 04:15:07 2005
@@ -0,0 +1,36 @@
+ at Attributes = (
+    { Name => 'Search - My Tickets',
+      Description => '[_1] highest priority tickets I own',
+      Content     =>
+      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"$RT::WebPath/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', Priority, QueueName, ExtendedStatus",
+        Query   => " Owner = '__CurrentUser__' AND ( Status = 'new' OR Status = 'open')",
+        OrderBy => 'Priority',
+        Order   => 'DESC' },
+    },
+    { Name => 'Search - Unowned Tickets',
+      Description => '[_1] newest unowned tickets',
+      Content     =>
+      { Format => "'<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__id__</a>/TITLE:#', '<a href=\"__WebPath__/Ticket/Display.html?id=__id__\">__Subject__</a>/TITLE:Subject', QueueName, ExtendedStatus, CreatedRelative, '<A HREF=\"__WebPath__/Ticket/Display.html?Action=Take&id=__id__\">__loc(Take)__</a>/TITLE:&nbsp;' ",
+        Query   => " Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')",
+        OrderBy => 'Created',
+        Order   => 'DESC' },
+    },
+    { Name => 'HomepageSettings',
+      Description => 'HomepageSettings',
+      Content =>
+      { 'body' =>
+	[ { type => 'system', name => 'My Tickets' },
+	  { type => 'system', name => 'Unowned Tickets' },
+	  { type => 'component',  name => 'QuickCreate'},
+	],
+        'summary' =>
+	[ { type => 'component', name => 'Quicksearch' },
+	  { type => 'component', name => 'MySupportQueues' },
+	  { type => 'component', name => 'MyAdminQueues' },
+	  { type => 'component', name => 'RefreshHomepage' },
+	]
+    },
+}
+);
+
+1;

Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/ShowSearch
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/ShowSearch	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Elements/ShowSearch	Sat Apr 16 04:15:07 2005
@@ -83,6 +83,7 @@
 my $rows = $user->Preferences('SummaryRows', $RT::DefaultSummaryRows);
 $SearchArg->{'Query'} =~ s/__CurrentUser__/$session{'CurrentUser'}->Id/ge;
 $SearchArg->{'Format'} =~ s/__WebPath__/$RT::WebPath/g;
+$SearchArg->{'Format'} =~ s/__loc\(["']?(\w+)["']?\)__/loc("$1")/ge;
 my $QueryString = '?' . $m->comp('/Elements/QueryString',
 	    map { $_ => $SearchArg->{$_} } qw(Query Order OrderBy));
 

Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/html/Widgets/SelectionBox	Sat Apr 16 04:15:07 2005
@@ -68,7 +68,9 @@
 %#
 %# and in html:
 %# <& /Widgets/SelectionBox:sow, self => $sel &>
-%# 
+%#
+%# if the SelectionBox is created with AutoSave option, OnSubmit will be called
+%# on every button clicked in non-js mode.
 <%method header>
 % if (0) {
 % # no javascript for now. it's broken in ie
@@ -147,7 +149,7 @@
 
 @{$self->{Current}} = grep { exists $self->{_item_map}{$_} } @{$self->{Current}};
 
-if ($ARGS{$self->{Name}.'-Save'}) {
+if ($self->{AutoSave} or $ARGS{$self->{Name}.'-Save'}) {
     $self->{OnSubmit}->($self);
     delete $self->{Modified};
 }
@@ -172,7 +174,7 @@
 </%method>
 
 <%method show>
-<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>" onSubmit="list_<% $name %>.selectAll();">
+<FORM METHOD="POST" ACTION="<%$self->{Action}%>" name="SelectionBox-<% $name %>" id="SelectionBox-<% $name %>" onSubmit="//list_<% $name %>.selectAll();">
 <input type="hidden" name="<% $self->{Name} %>-Submit" value="1">
 <& SelectionBox:current, self => $self &>
 <input type="hidden" name="fromjs" value="0">
@@ -206,7 +208,7 @@
 </form>
 
 <script type="text/javascript">
-var list_<%$name%> = new list(document.getElementById("SelectionBox-<% $name %>"), 0, "list_<%$name%>");
+//var list_<%$name%> = new list(document.getElementById("SelectionBox-<% $name %>"), 0, "list_<%$name%>");
 </script>
 <%ARGS>
 $self => undef

Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Queues_Overlay.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Queues_Overlay.pm	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/Queues_Overlay.pm	Sat Apr 16 04:15:07 2005
@@ -119,35 +119,22 @@
 }
 # }}}
 
-# {{{ sub Next 
+# {{{ sub AddRecord
 
-=head2 Next
+=head2 AddRecord
 
-Returns the next queue that this user can see.
+Adds a record object to this collection if this user can see.
+This is used for filtering objects for both Next and ItemsArrayRef.
 
 =cut
-  
-sub Next {
+
+sub AddRecord {
     my $self = shift;
-    
-    
-    my $Queue = $self->SUPER::Next();
-    if ((defined($Queue)) and (ref($Queue))) {
-
-	if ($Queue->CurrentUserHasRight('SeeQueue')) {
-	    return($Queue);
-	}
-	
-	#If the user doesn't have the right to show this queue
-	else {	
-	    return($self->Next());
-	}
-    }
-    #if there never was any queue
-    else {
-	return(undef);
-    }	
-    
+    my $Queue = shift;
+    return unless $Queue->CurrentUserHasRight('SeeQueue');
+
+    push @{$self->{'items'}}, $Queue;
+    $self->{'rows'}++;
 }
 # }}}
 

Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/RT/User_Overlay.pm	Sat Apr 16 04:15:07 2005
@@ -1626,6 +1626,30 @@
 
 # }}}
 
+# {{{ sub SetPreferences
+
+=head2 SetPreferences NAME/OBJ VALUE
+
+  Set user preferences associated with given object or name.
+
+=cut
+
+sub SetPreferences {
+    my $self  = shift;
+    my $name = _PrefName (shift);
+    my $value = shift;
+    my $attr = RT::Attribute->new ($self->CurrentUser);
+    $attr->LoadByNameAndObject (Object => $self, Name => $name);
+    if ($attr->Id) {
+	return $attr->SetContent ($value);
+    }
+    else {
+	return $self->AddAttribute ( Name => $name, Content => $value );
+    }
+}
+
+# }}}
+
 # {{{ sub _CleanupInvalidDelegations
 
 =head2 sub _CleanupInvalidDelegations { InsideTransaction => undef }

Modified: rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/t/regression/18custom_frontpage.t
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/t/regression/18custom_frontpage.t	(original)
+++ rt/branches/PLATANO-EXPERIMENTAL-CSS/lib/t/regression/18custom_frontpage.t	Sat Apr 16 04:15:07 2005
@@ -23,7 +23,7 @@
 $m->get ( BaseURL.'Prefs/MyRT.html' );
 $m->form_name ('SelectionBox-body');
 # can't use submit form for mutli-valued select as it uses set_fields
-$m->field ('body-Selected' => ['component-QuickCreate', 'system-My Requests', 'system-My Tickets']);
+$m->field ('body-Selected' => ['component-QuickCreate', 'system-Unowned Tickets', 'system-My Tickets']);
 $m->click_button (name => 'remove');
 $m->form_name ('SelectionBox-body');
 $m->click_button (name => 'body-Save');
@@ -32,7 +32,7 @@
 
 $m->get ( BaseURL.'Prefs/MyRT.html' );
 $m->form_name ('SelectionBox-body');
-$m->field ('body-Available' => ['component-QuickCreate', 'system-My Requests', 'system-My Tickets']);
+$m->field ('body-Available' => ['component-QuickCreate', 'system-Unowned Tickets', 'system-My Tickets']);
 $m->click_button (name => 'add');
 
 $m->form_name ('SelectionBox-body');


More information about the Rt-commit mailing list