]> git.uio.no Git - usit-rt.git/blobdiff - lib/RT/Templates.pm
Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / lib / RT / Templates.pm
index b4da636281ef94100989d6d25e670c5e22acde4d..551d3ea2541e5df199cd960bdf2a49bc0e8623c7 100644 (file)
@@ -68,10 +68,10 @@ package RT::Templates;
 use strict;
 use warnings;
 
-use RT::Template;
-
 use base 'RT::SearchBuilder';
 
+use RT::Template;
+
 sub Table { 'Templates'}
 
 
@@ -130,46 +130,34 @@ sub LimitToQueue {
 Returns the next template that this user can see.
 
 =cut
-  
+
 sub Next {
     my $self = shift;
-    
-    
+
+
     my $templ = $self->SUPER::Next();
     if ((defined($templ)) and (ref($templ))) {
-        
+
         # If it's part of a queue, and the user can read templates in
         # that queue, or the user can globally read templates, show it
         if ($templ->Queue && $templ->CurrentUserHasQueueRight('ShowTemplate') or
             $templ->CurrentUser->HasRight(Object => $RT::System, Right => 'ShowTemplate') or
             $templ->CurrentUser->HasRight(Object => $RT::System, Right => 'ShowGlobalTemplates')) {
-           return($templ);
-       }
-       
-       #If the user doesn't have the right to show this template
-       else {  
-           return($self->Next());
-       }
+            return($templ);
+        }
+
+        #If the user doesn't have the right to show this template
+        else {
+            return($self->Next());
+        }
     }
     #if there never was any template
     else {
-       return(undef);
-    }  
-    
-}
-
-=head2 NewItem
-
-Returns an empty new RT::Template item
-
-=cut
+        return(undef);
+    }
 
-sub NewItem {
-    my $self = shift;
-    return(RT::Template->new($self->CurrentUser));
 }
 
-
 RT::Base->_ImportOverlays();
 
 1;