[Rt-commit] r2583 - in rtfm/branches/2.1-TESTING/html:
Admin/RTFM/Classes RTFM/Article RTFM/Article/Elements
tla at bestpractical.com
tla at bestpractical.com
Mon Apr 4 04:16:44 EDT 2005
Author: tla
Date: Mon Apr 4 04:16:44 2005
New Revision: 2583
Modified:
rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html
rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditLinks
rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowLinks
rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
Log:
More on proper link display, and Classes admin now hides classes which
the user does not have permission to admin.
Modified: rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html
==============================================================================
--- rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html (original)
+++ rtfm/branches/2.1-TESTING/html/Admin/RTFM/Classes/index.html Mon Apr 4 04:16:44 2005
@@ -24,11 +24,11 @@
<TD>
<%$caption%>:<BR>
<UL>
-%if ($Classes->Count == 0) {
+% if (scalar @allowed_classes == 0) {
<LI> <i><&|/l&>No Classes matching search criteria found.</&></i>
% }
-%while ( $Class = $Classes->Next) {
-<LI><A HREF="Modify.html?id=<%$Class->id%>"><%$Class->Name%></a></LI>
+% foreach my $class ( @allowed_classes ) {
+<LI><A HREF="Modify.html?id=<%$class->id%>"><%$class->Name%></a></LI>
%}
</UL>
@@ -48,10 +48,9 @@
</TABLE>
<%INIT>
-my ($Class, $caption);
+my $caption;
my $Classes = new RT::FM::ClassCollection($session{'CurrentUser'});
-
-
+my @allowed_classes;
if ($FindDisabledClasses) {
$caption = loc("All Classes");
@@ -62,6 +61,10 @@
$Classes->LimitToEnabled();
}
+# Limit to only those classes that the user may admin.
+while (my $class = $Classes->Next()) {
+ push(@allowed_classes, $class) if $session{'CurrentUser'}->UserObj->HasRight(Right => 'AdminClass', Object => $class);
+}
</%INIT>
<%ARGS>
Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditLinks
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditLinks (original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/EditLinks Mon Apr 4 04:16:44 2005
@@ -30,9 +30,7 @@
<LI>
<INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>">
% if ($link->TargetURI->IsLocal) {
-% my $type = ref($member->Object);
-% $type =~ s/^.*::(\w+)$/$1/;
-<a href="<%$member->Resolver->HREF%>"><% loc($type) %> <%$member->Object->Id%></a>:
+<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%></a>:
% if (UNIVERSAL::can($member->Object, 'Name')) {
<%$member->Object->Name%>
% } elsif (UNIVERSAL::can($member->Object, 'Subject')) {
@@ -56,9 +54,7 @@
<LI>
<INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-">
% if ($link->BaseURI->IsLocal) {
-% my $type = ref($member->Object);
-% $type =~ s/^.*::(\w+)$/$1/;
-<a href="<%$member->Resolver->HREF%>"><% loc($type) %> <%$member->Object->Id%></a>:
+<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%></a>:
% if (UNIVERSAL::can($member->Object, 'Name')) {
<%$member->Object->Name%>
% } elsif (UNIVERSAL::can($member->Object, 'Subject')) {
Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowLinks
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowLinks (original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Elements/ShowLinks Mon Apr 4 04:16:44 2005
@@ -28,9 +28,7 @@
% my $member = $link->TargetURI;
<LI>
% if ($link->TargetURI->IsLocal) {
-% my $type = ref($member->Object);
-% $type =~ s/^.*::(\w+)$/$1/;
-<a href="<%$member->Resolver->HREF%>"><% loc($type) %> <%$member->Object->Id%></a>:
+<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%></a>:
% if (UNIVERSAL::can($member->Object, 'Name')) {
<%$member->Object->Name%>
% } elsif (UNIVERSAL::can($member->Object, 'Subject')) {
@@ -51,7 +49,7 @@
% my $member = $link->BaseURI;
<LI>
% if ($member->IsLocal) {
-<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectType) %> <%$member->Object->Id%></a>:
+<a href="<%$member->Resolver->HREF%>"><% loc($member->Object->ObjectTypeStr) %> <%$member->Object->Id%></a>:
% if (UNIVERSAL::can($member->Object, 'Name')) {
<%$member->Object->Name%>
% } elsif (UNIVERSAL::can($member->Object, 'Subject')) {
Modified: rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html
==============================================================================
--- rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html (original)
+++ rtfm/branches/2.1-TESTING/html/RTFM/Article/Search.html Mon Apr 4 04:16:44 2005
@@ -40,8 +40,9 @@
}
else {
$customfields->LimitToGlobalOrObjectId();
-
}
+$customfields->GroupByCols({FIELD => 'id'});
+
my %dates;
foreach my $date qw(Created< Created> LastUpdated< LastUpdated>) {
More information about the Rt-commit
mailing list