[Rt-commit] r2355 - in rt/branches/PLATANO-EXPERIMENTAL: .
html/Elements
jesse at bestpractical.com
jesse at bestpractical.com
Mon Mar 14 02:29:54 EST 2005
Author: jesse
Date: Mon Mar 14 02:29:54 2005
New Revision: 2355
Modified:
rt/branches/PLATANO-EXPERIMENTAL/ (props changed)
rt/branches/PLATANO-EXPERIMENTAL/html/Elements/SelectOwner
Log:
r8458 at hualien: jesse | 2005-03-14 02:24:54 -0500
r4075 at hualien: jesse | 2005-02-03 12:27:08 -0500
SelectOwner was displaying "Nobody" twice due to smarter backend code that broke the not-so-smart frontend. Fixed the frontend.
Modified: rt/branches/PLATANO-EXPERIMENTAL/html/Elements/SelectOwner
==============================================================================
--- rt/branches/PLATANO-EXPERIMENTAL/html/Elements/SelectOwner (original)
+++ rt/branches/PLATANO-EXPERIMENTAL/html/Elements/SelectOwner Mon Mar 14 02:29:54 2005
@@ -47,12 +47,10 @@
%if ($DefaultValue) {
<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION>
%}
-<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION>
%foreach my $User ( @users) {
<OPTION <% ($User->Id == $Default) && "SELECTED" %> VALUE="<%$User->Id()%>"><%$User->Name()%></OPTION>
%}
</SELECT>
-
<%INIT>
my @objects;
my @users;
@@ -73,14 +71,22 @@
}
my %user_uniq_hash;
+
+
foreach my $object (@objects) {
my $Users = RT::Users->new($session{CurrentUser});
$Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0);
while (my $User = $Users->Next()) {
+ next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later
$user_uniq_hash{$User->Id()} = $User;
}
}
+
@users = sort { uc($a->Name) cmp uc($b->Name) } values %user_uniq_hash;
+unshift(@users, $RT::Nobody);
+
+
+
</%INIT>
<%ARGS>
More information about the Rt-commit
mailing list