[Rt-commit] r7747 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Wed May 2 17:33:10 EDT 2007


Author: ruz
Date: Wed May  2 17:33:09 2007
New Revision: 7747

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditTemplates

Log:
 r5209 at cubic-pc:  cubic | 2007-05-02 23:47:44 +0400
 * minor, no functional changes


Modified: rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditTemplates
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditTemplates	(original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Admin/Elements/EditTemplates	Wed May  2 17:33:09 2007
@@ -1,56 +1,9 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC 
-%#                                          <jesse at bestpractical.com>
-%# 
-%# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
-%# LICENSE:
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/copyleft/gpl.html.
-%# 
-%# 
-%# CONTRIBUTION SUBMISSION POLICY:
-%# 
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%# 
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%# 
-%# END BPS TAGGED BLOCK }}}
 <& /Elements/ListActions, actions => \@actions &>
 
 <form method="get" action="Templates.html">
-<input type="hidden" class="hidden" name="id" value="<%$id%>" />
+<input type="hidden" class="hidden" name="id" value="<% $id %>" />
 
-% if ($Templates->Count == 0 ) {
+% unless ( $Templates->Count ) {
 <p><i><&|/l&>(No templates)</&></i></p>
 % } else {
 <table>
@@ -62,7 +15,7 @@
 </th>
 </tr>
 % my $count;
-% while (my $TemplateObj = $Templates->Next) { 
+% while ( my $TemplateObj = $Templates->Next ) {
 <tr>
 <td>
 <input type="checkbox" class="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>" value="1" />
@@ -82,29 +35,26 @@
 </form>
 
 <%INIT>
-my $Templates = RT::Templates->new($session{'CurrentUser'});
-my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-my @actions;
+my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
+$QueueObj->Load( $id ) if $id;
 
-if ($id)  {
-        $QueueObj->Load($id);                        
+my $Templates = RT::Templates->new($session{'CurrentUser'});
+if ( $QueueObj->id ) {
+    $Templates->LimitToQueue( $id );
+}
+else {
+    $Templates->LimitToGlobal;
 }
-
-if ($QueueObj->id) {
-	$Templates->LimitToQueue($id);
-}                                            
-else {                                       
-        $Templates->LimitToGlobal();
-}                                           
 
 # Now let callbacks add their extra limits
 $m->callback( %ARGS, Templates => $Templates );
 $Templates->RedoSearch;
 
-# {{{ deal with deleting existing templates
+# deal with deleting existing templates
+my @actions;
 foreach my $key (keys %ARGS) {
-  # {{{ if we're trying to delete the template
-  if ($key =~ /^DeleteTemplate-(\d+)/) {
+    next unless $key =~ /^DeleteTemplate-(\d+)/;
+
     my $id = $1;
     my $TemplateObj = RT::Template->new( $session{'CurrentUser'} );
     $TemplateObj->Load( $id );
@@ -114,16 +64,13 @@
     }
 
     my ($retval, $msg) = $TemplateObj->Delete;
-    if ($retval) {
-      push @actions, loc("Template deleted");
+    if ( $retval ) {
+        push @actions, loc("Template deleted");
     }
     else {
-      push @actions, $msg;
+        push @actions, $msg;
     }
-  }
-  # }}}
 }
-# }}}
 </%INIT>
 <%ARGS>
 $id => 0


More information about the Rt-commit mailing list