[Rt-commit] rt branch, 4.2/admin-cf-ui-tweak, created. rt-4.0.0rc7-251-g69e2ec6
? sunnavy
sunnavy at bestpractical.com
Mon May 23 07:05:47 EDT 2011
The branch, 4.2/admin-cf-ui-tweak has been created
at 69e2ec6767dbc8991b1ebf1810f3fcb11ec0bb83 (commit)
- Log -----------------------------------------------------------------
commit 69e2ec6767dbc8991b1ebf1810f3fcb11ec0bb83
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon May 23 18:09:07 2011 +0800
hide cf Objects page for User/Group as Enable/Disable is enough in this case.
diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index 44a2f67..d22c28c 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -263,6 +263,20 @@ CustomFieldObj => $CustomFieldObj, CustomFieldValueObj => $cfv, ARGSRef => \%ARG
}
}
+if ( $CustomFieldObj->id && $CustomFieldObj->LookupType =~ /^RT::(?:User|Group)$/ ) {
+ my ( $ret, $msg );
+ my $object = $CustomFieldObj->RecordClassFromLookupType->new( $session{'CurrentUser'} );
+
+ if ( $CustomFieldObj->Disabled && $CustomFieldObj->IsApplied(0) ) {
+ ( $ret, $msg ) = $CustomFieldObj->RemoveFromObject($object);
+ }
+ elsif ( !$CustomFieldObj->Disabled && !$CustomFieldObj->IsApplied(0) ) {
+ ( $ret, $msg ) = $CustomFieldObj->AddToObject($object);
+ }
+
+ # successful msg("object created" or "object deleted ) is useless here
+ push @results, $msg unless $ret;
+}
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 7a3299f..4d856b2 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -354,7 +354,10 @@ my $build_admin_menu = sub {
$tabs->child( 'group-rights' => title => loc('Group Rights') => path => "/Admin/CustomFields/GroupRights.html?id=" . $id );
$tabs->child( 'user-rights' => title => loc('User Rights') => path => "/Admin/CustomFields/UserRights.html?id=" . $id );
- $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id );
+
+ unless ( $obj->LookupType =~ /^RT::(?:User|Group)$/ ) {
+ $tabs->child( 'applies-to' => title => loc('Applies to'), path => "/Admin/CustomFields/Objects.html?id=" . $id );
+ }
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list