[Rt-commit] rt branch, admin_ui, updated. 8adcc8ebaec80821db1bb0a1106c53c9e6d2429b
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Thu Jan 14 04:34:02 EST 2010
The branch, admin_ui has been updated
via 8adcc8ebaec80821db1bb0a1106c53c9e6d2429b (commit)
from a53cdfe14e009552047538ca0a00d01239b48733 (commit)
Summary of changes:
lib/RT/Dispatcher.pm | 18 +++++++++++++-----
lib/RT/View/CRUD.pm | 9 ++++++++-
2 files changed, 21 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 8adcc8ebaec80821db1bb0a1106c53c9e6d2429b
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Jan 14 17:33:44 2010 +0800
tweak links of /admin/custom_fields/values
diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index c976f2c..88ff4c8 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -425,7 +425,7 @@ before '/SelfService' => run {
before 'admin/' => run {
- my ( $id, $lookup_type, $queue );
+ my ( $id, $lookup_type, $queue, $custom_field );
my @monikers = qw/
global_select_cfs
user_edit_memberships user_select_cfs user_config_my_rt user_select_private_key
@@ -448,8 +448,15 @@ before 'admin/' => run {
$id = $action->argument('id');
}
}
-
- if ( grep { $action->moniker eq $_ } @monikers ) {
+ elsif ( Jifty->web->request->path =~ m{^/admin/custom_fields/values} ) {
+ if ( $action->argument('custom_field') ) {
+ $custom_field = $action->argument('custom_field');
+ }
+ if ( $action->argument('id') ) {
+ $id = $action->argument('id');
+ }
+ }
+ elsif ( grep { $action->moniker eq $_ } @monikers ) {
if ( $action->argument('record_id') ) {
$id = $action->argument('record_id');
}
@@ -467,9 +474,10 @@ before 'admin/' => run {
Jifty->web->request->argument( id => $id ) if $id;
Jifty->web->request->argument( lookup_type => $lookup_type ) if $lookup_type;
Jifty->web->request->argument( queue => $queue ) if $queue;
+ Jifty->web->request->argument( custom_field => $custom_field )
+ if $custom_field;
};
-
before 'admin/queues' => run {
if ( Jifty->web->current_user->has_right( object => RT->system, right => 'AdminQueue' ) ) {
page_nav->child( _('Select'), url => "/admin/queues/" );
@@ -565,7 +573,7 @@ before 'admin/custom_fields/' => run {
if ( $obj->is_selection_type && !$obj->is_external_values ) {
$tabs->child( _('Values'),
- url => "/admin/custom_fields/values?custom_field=" . $id );
+ url => "/admin/custom_fields/values/?custom_field=" . $id );
}
if ( $obj->lookup_type =~ /^RT::Model::Queue-/io ) {
diff --git a/lib/RT/View/CRUD.pm b/lib/RT/View/CRUD.pm
index 7794819..5d5bd2d 100644
--- a/lib/RT/View/CRUD.pm
+++ b/lib/RT/View/CRUD.pm
@@ -210,7 +210,7 @@ sub view_field {
# we just want to do this hyperlink thing for those specfic views
if (
- $self =~ /(Users|Groups|Queues|CustomFields|Templates)$/
+ $self =~ /(Users|Groups|Queues|CustomFields|Templates|Values)$/
&& $args{field} =~ /^(id|name)$/
)
{
@@ -226,6 +226,13 @@ sub view_field {
elsif ( $self eq 'RT::View::Admin::Global::Templates' ) {
$url .= 'edit?id=' . $args{id};
}
+ elsif ( $self eq 'RT::View::Admin::CustomFields::Values' ) {
+ $url .=
+ 'edit?id='
+ . $args{id}
+ . '&custom_field='
+ . get('custom_field');
+ }
else {
$url = "?id=" . $args{id};
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list