From 8103c1fc1b2c27a6855feadf26f91b980a54bc52 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 2 Mar 2008 04:11:51 +0000 Subject: import rt 3.6.6 --- rt/html/Admin/CustomFields/GroupRights.html | 44 ++++++++-------- rt/html/Admin/CustomFields/Modify.html | 82 ++++++++++++++++++++++------- rt/html/Admin/CustomFields/Objects.html | 14 ++--- rt/html/Admin/CustomFields/UserRights.html | 28 +++++----- rt/html/Admin/CustomFields/index.html | 35 ++++++++---- 5 files changed, 136 insertions(+), 67 deletions(-) (limited to 'rt/html/Admin/CustomFields') diff --git a/rt/html/Admin/CustomFields/GroupRights.html b/rt/html/Admin/CustomFields/GroupRights.html index 380fee479..a416327c5 100644 --- a/rt/html/Admin/CustomFields/GroupRights.html +++ b/rt/html/Admin/CustomFields/GroupRights.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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: @@ -51,46 +53,46 @@ &> <& /Elements/ListActions, actions => \@results &> -
- + +

<&|/l&>System groups

- +
% $Groups = RT::Groups->new($session{'CurrentUser'}); % $Groups->LimitToSystemInternalGroups(); % while (my $Group = $Groups->Next()) { - - + - + - + + % } -
+
<% loc($Group->Type) %> - + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, Object => $CustomFieldObj &> -
+

<&|/l&>User defined groups

- +
% $Groups = RT::Groups->new($session{'CurrentUser'}); % $Groups->LimitToUserDefinedGroups(); % while (my $Group = $Groups->Next()) { - - + - + - + + % } -
+
<% $Group->Name %> - + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, Object => $CustomFieldObj &> -
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> -
+ <%INIT> diff --git a/rt/html/Admin/CustomFields/Modify.html b/rt/html/Admin/CustomFields/Modify.html index 4c3c92114..0202f0ad6 100644 --- a/rt/html/Admin/CustomFields/Modify.html +++ b/rt/html/Admin/CustomFields/Modify.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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: @@ -51,15 +53,15 @@ <& /Elements/ListActions, actions => \@results &> -
- + + - + - + @@ -77,23 +79,64 @@ + + + + + + + + + + + + + + + + +
<&|/l&>Name
<&|/l&>Description
<&|/l&>Validation +<& /Widgets/ComboBox, + Name => 'Pattern', + Default => $CustomFieldObj->Pattern, + Size => 20, + Values => [ + '(?#Mandatory).', + '(?#Digits)^[\d.]+$', + '(?#Year)^[12]\d{3}$', + ], +&> +
  - -> <&|/l&>Enabled (Unchecking this box disables this custom field) + + /> <&|/l&>Enabled (Unchecking this box disables this custom field) +
<&|/l&>Link values to +
+<&|/l&>RT can make this custom field's values into hyperlinks to another service. +<&|/l&>Fill in this field with a URL. +<&|/l&>RT will replace __id__ and __CustomField__ with the record id and custom field value, respectively +
<&|/l&>Include page +
+<&|/l&>RT can include content from another web service when showing this custom field. +<&|/l&>Fill in this field with a URL. +<&|/l&>RT will replace __id__ and __CustomField__ with the record id and custom field value, respectively +<&|/l&>Some browsers may only load content from the same domain as your RT server. +
+
-
-% if ($CustomFieldObj->Id && $CustomFieldObj->Type =~ /^Select/i) { -

<&|/l&>Values

+
+% if ($CustomFieldObj->Id && $CustomFieldObj->IsSelectionType) { +

<&|/l&>Values

<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> <& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &>
% } <&/Elements/Submit&> -
+ @@ -115,7 +158,8 @@ else { my ( $val, $msg ) = $CustomFieldObj->Create(Name => $Name, TypeComposite => $TypeComposite, LookupType => $LookupType, - Description => $Description,); + Description => $Description, + Pattern => $Pattern,); $m->comp("/Elements/Error", Why => loc( "Could not create CustomField", $msg ) ) unless ($val); push @results, $msg; $title = loc( 'Created CustomField [_1]', $CustomFieldObj->Name() ); @@ -124,7 +168,7 @@ else { $CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc('No CustomField') ); $title = loc( 'Editing CustomField [_1]', $CustomFieldObj->Name() ); - my @attribs = qw( Name TypeComposite LookupType Description); + my @attribs = qw( Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue); my @aresults = UpdateRecordObject( AttributesRef => \@attribs, Object => $CustomFieldObj, ARGSRef => \%ARGS ); @@ -167,7 +211,7 @@ foreach my $key (keys %ARGS) { # Update any existing values my $values = $CustomFieldObj->ValuesObj; while (my $value = $values->Next) { - foreach my $attr qw(Name Description SortOrder) { + foreach my $attr qw(Name Description SortOrder Category) { my $param = $paramtag.$value->Id."-".$attr; if ( $ARGS{$param} && ($value->$attr() ne $ARGS{$param})) { @@ -184,9 +228,10 @@ while (my $value = $values->Next) { # Add any new values if ($ARGS{$paramtag."new-Name"}) { - my ($id, $msg) = $CustomFieldObj->AddValue ( Name => $ARGS{$paramtag."new-Name"}, - Description => $ARGS{$paramtag."new-Description"}, - SortOrder => $ARGS{$paramtag."new-SortOrder"}); + my ($id, $msg) = $CustomFieldObj->AddValue ( + map { $_ => $ARGS{$paramtag."new-$_"} } + qw( Name Description SortOrder Category ) + ); push (@results, $msg); } @@ -206,6 +251,7 @@ $LookupType => undef $MaxValues => undef $SortOrder => undef $Description => undef +$Pattern => undef $Name => undef $SetEnabled => undef $Enabled => undef diff --git a/rt/html/Admin/CustomFields/Objects.html b/rt/html/Admin/CustomFields/Objects.html index 8f9e3657b..d829a0da3 100644 --- a/rt/html/Admin/CustomFields/Objects.html +++ b/rt/html/Admin/CustomFields/Objects.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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: @@ -52,9 +54,9 @@ <& /Elements/ListActions, actions => \@results &> -
- - + + +

<&|/l&>Selected objects

<& /Admin/Elements/PickObjects, Objects => \@AssignedObjs, id => $id, Checked => 1 &> @@ -62,7 +64,7 @@ <& /Admin/Elements/PickObjects, Objects => \@UnassignedObjs, id => $id &> <& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> -
+ <%INIT> my $CF = RT::CustomField->new($session{'CurrentUser'}); diff --git a/rt/html/Admin/CustomFields/UserRights.html b/rt/html/Admin/CustomFields/UserRights.html index e2df3a058..a7145977c 100644 --- a/rt/html/Admin/CustomFields/UserRights.html +++ b/rt/html/Admin/CustomFields/UserRights.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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: @@ -49,31 +51,31 @@ current_tab => "Admin/CustomFields/UserRights.html?id=".$id, Title => $title, &> <& /Elements/ListActions, actions => \@results &> -
- + + - +
% while (my $Member = $Users->Next()) { % my $UserObj = $Member->MemberObj->Object(); % my $group = RT::Group->new($session{'CurrentUser'}); % $group->LoadACLEquivalenceGroup($Member->MemberObj); - - + - + - + + % } -
+
<% $UserObj->Name %> - + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, Object => $CustomFieldObj &> -
+ <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> -
+ <%INIT> diff --git a/rt/html/Admin/CustomFields/index.html b/rt/html/Admin/CustomFields/index.html index 9854fb0ec..badee95a7 100644 --- a/rt/html/Admin/CustomFields/index.html +++ b/rt/html/Admin/CustomFields/index.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# 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: @@ -48,29 +50,44 @@ current_tab => 'Admin/CustomFields/', Title => loc('Select a Custom Field') &> +% my @types; % my $prev_lookup = ''; % while (my $CustomFieldObj = $CustomFields->Next) { % $CustomFieldObj->CurrentUserHasRight('AdminCustomField') or next; % my $lookup = $CustomFieldObj->FriendlyLookupType; % if ($lookup ne $prev_lookup) { % if ($prev_lookup) { - + % } -

<% loc("Custom Fields for [_1]", $lookup) %>

- % } +
+<&|/l&>Only show custom fields for: + +
+ +<%args> +$type => undef + <%INIT> my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); $CustomFields->UnLimit(); +$CustomFields->LimitToLookupType($type) if defined $type; $CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); -- cgit v1.2.1