[Rt-commit] rt branch, admin_ui, updated. 7e93ec148f8b0949f90d289e1126acdb98ee5792

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Dec 10 21:41:30 EST 2009


The branch, admin_ui has been updated
       via  7e93ec148f8b0949f90d289e1126acdb98ee5792 (commit)
      from  49f5f078a4ee08c01c1c312cc5f93a3aa44ed46a (commit)

Summary of changes:
 lib/RT/View/Admin/Global.pm                        |    3 ++
 .../View/Admin/{Groups.pm => Global/Templates.pm}  |   37 ++++++++++++-------
 2 files changed, 26 insertions(+), 14 deletions(-)
 copy lib/RT/View/Admin/{Groups.pm => Global/Templates.pm} (77%)

- Log -----------------------------------------------------------------
commit 7e93ec148f8b0949f90d289e1126acdb98ee5792
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Dec 11 10:41:19 2009 +0800

    add /admin/view/global/templates

diff --git a/lib/RT/View/Admin/Global.pm b/lib/RT/View/Admin/Global.pm
index 40e1378..5594867 100644
--- a/lib/RT/View/Admin/Global.pm
+++ b/lib/RT/View/Admin/Global.pm
@@ -51,6 +51,9 @@ use strict;
 package RT::View::Admin::Global;
 use Jifty::View::Declare -base;
 
+require RT::View::Admin::Global::Templates;
+alias RT::View::Admin::Global::Templates under 'templates/';
+
 template 'system' => page { title => _('Configure RT') } content {
     my $self    = shift;
     my $section = get('section');
diff --git a/lib/RT/View/Admin/Global/Templates.pm b/lib/RT/View/Admin/Global/Templates.pm
new file mode 100644
index 0000000..110baad
--- /dev/null
+++ b/lib/RT/View/Admin/Global/Templates.pm
@@ -0,0 +1,94 @@
+# 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 }}}
+use warnings;
+use strict;
+
+package RT::View::Admin::Global::Templates;
+use Jifty::View::Declare -base;
+use base 'RT::View::CRUD';
+
+use constant page_title      => 'Global Templates Management';
+use constant object_type     => 'Template';
+
+use constant display_columns => qw(id name description type);
+use constant edit_columns => qw(name description type content queue);
+use constant create_columns => qw(name description type content queue);
+
+private template view_item_controls => sub {
+    my $self   = shift;
+    my $record = shift;
+
+    if ( $record->current_user_can('update') ) {
+        hyperlink(
+            label   => _("Edit"),
+            class   => "editlink",
+            onclick => {
+                popout => $self->fragment_for('update'),
+                args   => { id => $record->id },
+            },
+        );
+    }
+};
+
+sub _current_collection {
+    my $self = shift; 
+    my $collection = $self->SUPER::_current_collection( @_ );
+    $collection->limit_to_global;
+    return $collection;    
+}
+
+
+sub create_field_queue {
+    my $self = shift;
+    my %args = @_;
+    my $action = $args{action};
+    render_param($action, 'queue', render_as => 'hidden', default_value => 0 );
+}
+
+1;
+

-----------------------------------------------------------------------


More information about the Rt-commit mailing list