diff options
author | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-10-15 09:11:20 +0000 |
commit | d4d0590bef31071e8809ec046717444b95b3f30a (patch) | |
tree | ee1236da50578390d2642114f28eaed99a5efb18 /rt/html/Admin | |
parent | d39d52aac8f38ea9115628039f0df5aa3ac826de (diff) |
import rt 3.4.4
Diffstat (limited to 'rt/html/Admin')
85 files changed, 2494 insertions, 546 deletions
diff --git a/rt/html/Admin/CustomFields/GroupRights.html b/rt/html/Admin/CustomFields/GroupRights.html new file mode 100644 index 000000000..380fee479 --- /dev/null +++ b/rt/html/Admin/CustomFields/GroupRights.html @@ -0,0 +1,170 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/GroupRights.html?id=".$id, + Title => $title +&> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $CustomFieldObj->id %>"> + + +<h1><&|/l&>System groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>User defined groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $Group->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%INIT> + + + + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No CustomField defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load CustomField [_1]",$id)); + +my $Groups; + + my ( $ACL, @results ); + + foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", $object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right => $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", $object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => $right); + push (@results, $msg); + } +} + +my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name); + +</%INIT> + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/Modify.html b/rt/html/Admin/CustomFields/Modify.html new file mode 100644 index 000000000..4c3c92114 --- /dev/null +++ b/rt/html/Admin/CustomFields/Modify.html @@ -0,0 +1,212 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $CustomFieldObj->Id , + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + +<FORM METHOD="POST" ACTION="Modify.html" NAME="ModifyCustomField"> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<%$id %>"> +<table> +<tr> +<td class="label"><&|/l&>Name</&></td> +<td><input name="Name" VALUE="<%$CustomFieldObj->Name%>" SIZE=20></td></tr> +<tr> +<td class="label"><&|/l&>Description</&></td> +<td><input name="Description" VALUE="<%$CustomFieldObj->Description%>" SIZE=80></td> +</tr> + +<tr> +<td class="label"><&|/l&>Type</&></td> +<td><& /Admin/Elements/SelectCustomFieldType, + Name => "TypeComposite", + Default => $CustomFieldObj->TypeComposite, &> +</td> +</tr> +<tr> +<td class="label"><&|/l&>Applies to</&></td> +<td><& /Admin/Elements/SelectCustomFieldLookupType, + Name => "LookupType", + Default => $CustomFieldObj->LookupType, &> +</td> +</tr> +<tr> +<td class="label"> </td> +<td> +<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this custom field)</&> +</td> +</tr> +</table> +<BR> +% if ($CustomFieldObj->Id && $CustomFieldObj->Type =~ /^Select/i) { +<H2><&|/l&>Values</&></H2> +<div> +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +</div> +% } +<&/Elements/Submit&> +</FORM> + + + +<%INIT> + + + +my $CustomFieldObj = RT::CustomField->new( $session{'CurrentUser'} ); +my ( $title, @results, $EnabledChecked, $Disabled); +$EnabledChecked = "CHECKED"; + +if ( !$id ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} +else { + + if ( $id eq 'new' ) { + my ( $val, $msg ) = $CustomFieldObj->Create(Name => $Name, + TypeComposite => $TypeComposite, + LookupType => $LookupType, + Description => $Description,); + $m->comp("/Elements/Error", Why => loc( "Could not create CustomField", $msg ) ) unless ($val); + push @results, $msg; + $title = loc( 'Created CustomField [_1]', $CustomFieldObj->Name() ); + } + 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 @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $CustomFieldObj, + ARGSRef => \%ARGS ); + + push @results, @aresults; + + #we're asking about enabled on the web page but really care about disabled. + if ($Enabled == 1) { + $Disabled = 0; + } + else { + $Disabled = 1; + } + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + } + + $id = $CustomFieldObj->id; +} + + + + +my $paramtag = "CustomField-".$CustomFieldObj->Id."-Value-"; +# Delete any fields that want to be deleted +foreach my $key (keys %ARGS) { + + next unless ($key =~ /^Delete-$paramtag(\d+)$/); + my ($val, $msg) = $CustomFieldObj->DeleteValue($1); + push (@results, $msg); + + +} +# Update any existing values +my $values = $CustomFieldObj->ValuesObj; +while (my $value = $values->Next) { + foreach my $attr qw(Name Description SortOrder) { + my $param = $paramtag.$value->Id."-".$attr; + + if ( $ARGS{$param} && ($value->$attr() ne $ARGS{$param})) { + my $mutator = "Set$attr"; + my ($id, $msg) = $value->$mutator($ARGS{$param}); + push (@results, $msg); + } + } + + +} + + + +# 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"}); + push (@results, $msg); +} + +my $current_tab; +if ($ARGS{'Create'}){ + $current_tab = "Admin/CustomFields/Modify.html?Create=1"; +} else { + $current_tab = "Admin/CustomFields/Modify.html?id=".$id; + } + + +</%INIT> +<%ARGS> +$id => undef +$TypeComposite => undef +$LookupType => undef +$MaxValues => undef +$SortOrder => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/Objects.html b/rt/html/Admin/CustomFields/Objects.html new file mode 100644 index 000000000..8f9e3657b --- /dev/null +++ b/rt/html/Admin/CustomFields/Objects.html @@ -0,0 +1,145 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/Objects.html?id=".$id, + Title => $title + &> + +<& /Elements/ListActions, actions => \@results &> + +<FORM ACTION="Objects.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $id %>"> +<INPUT TYPE=HIDDEN NAME="UpdateObjs" VALUE="1"> + +<h2><&|/l&>Selected objects</&></h2> +<& /Admin/Elements/PickObjects, Objects => \@AssignedObjs, id => $id, Checked => 1 &> +<h2><&|/l&>Unselected objects</&></h2> +<& /Admin/Elements/PickObjects, Objects => \@UnassignedObjs, id => $id &> + +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +</FORM> + +<%INIT> +my $CF = RT::CustomField->new($session{'CurrentUser'}); +$CF->Load($id) or Abort(loc("Could not load CustomField [_1]"), $id); +my $LookupType = $CF->LookupType; +$LookupType =~ /^(.*?)-/ || + Abort(loc("Object of type [_1] cannot take custom fields", $LookupType)); + +my $Class = $1; +my $CollectionClass; +if (UNIVERSAL::can($Class.'Collection', 'new') ) { +$CollectionClass = $Class.'Collection'; + +} elsif (UNIVERSAL::can($Class.'es', 'new') ) { + $CollectionClass = $Class.'es'; + +} elsif (UNIVERSAL::can($Class.'s', 'new') ) { + $CollectionClass = $Class.'s'; + +} else { + Abort(loc("Can't find a collection class for '[_1]'", $Class)); +} + + +my $title = loc('Modify associated objects for [_1]', $CF->Name); + +my $Objects = $CollectionClass->new($session{'CurrentUser'}); +my (@results); +my (@AssignedObjs, @UnassignedObjs); + +$Objects->UnLimit; +$Objects->OrderBy( FIELD => 'Name' ); + + +my $ObjectCFs; +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToCustomField($id); + +my %seen; +while (my $OCF = $ObjectCFs->Next) { + $seen{$OCF->ObjectId}++; +} + +while (my $obj = $Objects->Next) { + my $obj_id = $obj->Id; + + if ($UpdateObjs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$obj_id-CF-$id"; + if ($ARGS{$key}) { + if (!$seen{$obj_id}) { + my ($val, $msg) = $CF->AddToObject($obj); + push (@results, $msg); + push @UnassignedObjs, $obj if !$val; + } + } + else { + push @UnassignedObjs, $obj; + if ($seen{$obj_id}) { + my ($val, $msg) = $CF->RemoveFromObject($obj); + push (@results, $msg); + pop @UnassignedObjs if !$val; + } + } + } + elsif (!$seen{$obj_id}) { + push @UnassignedObjs, $obj; + } + next if @UnassignedObjs and $UnassignedObjs[-1] == $obj; + push @AssignedObjs, $obj; +} + +</%INIT> +<%ARGS> +$id => undef +$FindDisabledObjects => 0 +$UpdateObjs => 0 +</%ARGS> diff --git a/rt/html/Admin/CustomFields/UserRights.html b/rt/html/Admin/CustomFields/UserRights.html new file mode 100644 index 000000000..e2df3a058 --- /dev/null +++ b/rt/html/Admin/CustomFields/UserRights.html @@ -0,0 +1,168 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, id => $id, +current_tab => "Admin/CustomFields/UserRights.html?id=".$id, +Title => $title, &> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="UserRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $CustomFieldObj->id %>"> + + +<TABLE> + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } + </TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%INIT> + + #Update the acls. + my @results; +foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", +$object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : +($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right +=> $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", +$object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => +$right); + push (@results, $msg); + } +} + + +# {{{ Deal with setting up the display of current rights. + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No Class defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load Class [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + +my $title = loc('Modify user rights for custom field [_1]', $CustomFieldObj->Name); + +# }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/index.html b/rt/html/Admin/CustomFields/index.html new file mode 100644 index 000000000..9854fb0ec --- /dev/null +++ b/rt/html/Admin/CustomFields/index.html @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => loc('Select a Custom Field') &> +<& /Admin/Elements/CustomFieldTabs, + current_tab => 'Admin/CustomFields/', + Title => loc('Select a Custom Field') &> + +% 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) { +</UL> +% } +<H2><% loc("Custom Fields for [_1]", $lookup) %></H2> +<UL> +% $prev_lookup = $lookup; +% } +% +<LI> +<A HREF="Modify.html?id=<%$CustomFieldObj->id()%>"><%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%></a> +</LI> +% } +% if ($prev_lookup) { +</UL> +% } + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit(); +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); +</%INIT> diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue index 0e59fe320..3e3f414b3 100644 --- a/rt/html/Admin/Elements/AddCustomFieldValue +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,20 +42,20 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <b><&|/l&>Add Value</&></b></b></b></b> <TABLE BORDER="0"> <TR><TD><small> <&|/l&>Sort</&>:<br> -<input name="CustomField-<% $CustomField->Id %>-AddValue-SortOrder" size="5"> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-new-SortOrder" > </TD> <TD><small> <&|/l&>Name</&>:<br> -<input size=20 name="CustomField-<% $CustomField->Id %>-AddValue-Name"> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-new-Name" > </TD> <TD><small> <&|/l&>Description</&>:<br> -<input size="60" name="CustomField-<% $CustomField->Id %>-AddValue-Description"> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-new-Description"> </TD></TR> </TABLE> diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled index 01fa9fe94..0dc6ac792 100644 --- a/rt/html/Admin/Elements/CreateUserCalled +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <FORM METHOD=get ACTION="<% $RT::WebPath %>/Admin/Users/Create.html"> <&|/l&>New user called</&> <INPUT NAME="Name" size=10><input type=submit value="<&|/l&>Create</&>"> </form> diff --git a/rt/html/Admin/Elements/CustomFieldTabs b/rt/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..d7acf33cc --- /dev/null +++ b/rt/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Tabs, + current_tab => 'Admin/CustomFields/', + subtabs => $tabs, + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ($id) { + my $cf = RT::CustomField->new( $session{'CurrentUser'} ); + $cf->Load($id); + $tabs = { + this => { + title => $cf->Name, + path => "Admin/CustomFields/Modify.html?id=" . $id, + current_subtab => $current_tab, + + subtabs => { + + C => { title => loc('Basics'), + path => "Admin/CustomFields/Modify.html?id=" . $id, + }, + F => { title => loc('Group Rights'), + path => "Admin/CustomFields/GroupRights.html?id=" + . $id, }, + G => { + title => loc('User Rights'), + path => "Admin/CustomFields/UserRights.html?id=" . $id, + }, + + } } + + }; + + + if ($cf->LookupType =~ /^RT::Queue/io) { + $tabs->{'this'}->{subtabs}->{D} = { + title => loc('Applies to'), + path => "Admin/CustomFields/Objects.html?id=" . $id, + }; + } +} + +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField')) { + $tabs->{"A"} = { title => loc('Select custom field'), + path => "Admin/CustomFields/", + }; + $tabs->{"B"} = { title => loc('New custom field'), + path => "Admin/CustomFields/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab (sort keys %{$tabs->{'this'}->{'subtabs'}}) { + if ($tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{'subtabs'} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{'current_subtab'} = $current_subtab; + } +} +if( $id ) { $current_tab = "Admin/CustomFields/Modify.html?id=" . $id } +</%INIT> +<%ARGS> +$Title => undef +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField index 5657d43fd..d8c5b29b2 100644 --- a/rt/html/Admin/Elements/EditCustomField +++ b/rt/html/Admin/Elements/EditCustomField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues index 79b6501e1..9cc3858b9 100644 --- a/rt/html/Admin/Elements/EditCustomFieldValues +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,22 +42,42 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<i><&|/l&>(Check box to delete)</&></i> -<ul> -% while (my $v = $values->Next) { -<li> -<INPUT TYPE="text" SIZE="2" NAME="CustomField-<%$CustomField->Id%>-SortOrder<%$v->Id()%>" VALUE="<%$v->SortOrder()%>"> -<input type="checkbox" name="CustomField-<%$CustomField->Id%>-DeleteValue" value="<%$v->id%>"> -<%$v->Name%> -% if ($v->Description) { -<i>(<%$v->Description%>)</i> +%# END BPS TAGGED BLOCK }}} +% if (!$values->Count) { +<p><em><&|/l&>(no values)</&></em></p> +% return; % } -</li> +<i><&|/l&>(Check box to delete)</&></i> +<table> +<tr> +<td> </td> +<td><&|/l&>Sort</&></td> +<td><&|/l&>Name</&></td> +<td><&|/l&>Description</&></td> +</tr> +% while (my $value = $values->Next) { +<tr> +<td> +<input type="checkbox" name="Delete-CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>"> +</td> +<td> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-SortOrder" value="<%$value->SortOrder%>"> +</td> +<td> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Name" value="<%$value->Name%>"> +</td> +<td> +<font size="-1"> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Description" value="<%$value->Description%>"> +</font> +</td> +</tr> % } -</ul> +</table> <%init> -my $values = $CustomField->Values(); + +my $values = $CustomField->ValuesObj(); + </%init> <%args> $CustomField => undef diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields index d901b216e..1cd3df568 100644 --- a/rt/html/Admin/Elements/EditCustomFields +++ b/rt/html/Admin/Elements/EditCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,95 +42,64 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/ListActions, actions => \@actions &> - -<TABLE> -<TR> -<TD VALIGN=TOP> -<h2><%$caption%></h2> -</TD></TR></TABLE> -% if ($CustomFields->Count == 0 ) { -<P><i><&|/l&>(No custom fields)</&></i></P> -% } else { -<TABLE cellspacing=0 cellpadding=2> -% my $count; -% while (my $CustomFieldObj = $CustomFields->Next) { -<TR> - <TD valign="TOP"> -% if ($CustomFieldObj->Name) { - <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><b><%$CustomFieldObj->Name%></b></a><br> -% } else { - <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><i>(<%loc("no name")%>)</i></a><br> -% } - <%$CustomFieldObj->Description%> - </TD> - <TD valign="TOP"> - <i><% $CustomFieldObj->FriendlyType %></i> - </TD> -% # show 'move up' unless it's the first item -% if ($count++) { - <TD valign="TOP"> - <a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a> -% } else { - <TD valign="TOP" ALIGN=RIGHT> -% } - -% # show 'move down' unless it's the last item -% if (!$CustomFields->IsLast) { -% $m->print(' | ') if $count > 1; - <a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a> -% } -</TD> -</TR> +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@results &> + +<FORM ACTION="<%$RT::WebPath%><% $m->request_comp->path |n %>" METHOD="POST" NAME="EditCustomFields"> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $Object->Id %>"/> +<INPUT TYPE=HIDDEN NAME="ObjectType" VALUE="<% $ObjectType %>"/> +<INPUT TYPE=HIDDEN NAME="SubType" VALUE="<% $SubType %>"/> +<INPUT TYPE=HIDDEN NAME="UpdateCFs" VALUE="1"/> + +% if ($Object->Id) { +<h2><&|/l&>Global Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &> % } +<h2><&|/l&>Selected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &> +<h2><&|/l&>Unselected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &> -</TABLE> -% } -<FORM METHOD=GET ACTION="CustomFields.html"> -% if ($id) { -<INPUT TYPE="Hidden" NAME="id" VALUE="<%$id%>"> -% } -<input type="checkbox" name="FindDisabledCustomFields"> <&|/l&>Include disabled custom fields in listing.</&> -<input type=submit value="<&|/l&>Go!</&>"> +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> </FORM> <%INIT> my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); -my $QueueObj = RT::Queue->new($session{'CurrentUser'}); -my $caption; +my @results; +my (@GlobalCFs, @UnassignedCFs); -if ($id) { - $QueueObj->Load($id); +my $id = $Object->Id; +if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { + $m->out('<P><i>', loc('(No custom fields)'), '</i></P>'); + return; } -if ($QueueObj->id) { - $CustomFields->LimitToQueue($id); -} -else { - $CustomFields->LimitToGlobal(); -} - -if ($FindDisabledCustomFields) { - $caption = loc("All Custom Fields"); - $CustomFields->{'find_disabled_rows'} = 1; -} else { - $caption = loc("Enabled Custom Fields"); -} +my $lookup = $ObjectType; +$lookup .= "-$SubType" if $SubType; + +$CustomFields->LimitToLookupType($lookup); +$CustomFields->OrderBy( FIELD => 'Name' ); + + +my ($GlobalCFs, $ObjectCFs); +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); # {{{ deal with moving sortorder of custom fields if ($CustomField and $Move) { - my $SourceObj = RT::CustomField->new($session{'CurrentUser'}); - $SourceObj->Load($CustomField) || Abort(loc('No CustomField')); + my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); + $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); my $TargetObj; my $target_order = $SourceObj->SortOrder + $Move; - while (my $CustomFieldObj = $CustomFields->Next) { - my $this_order = $CustomFieldObj->SortOrder; + while (my $ObjectCF = $ObjectCFs->Next) { + my $this_order = $ObjectCF->SortOrder; # if we have an exact match, finish the loop now - ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order; + ($TargetObj = $ObjectCF, last) if $this_order == $target_order; # otherwise, we need to apropos toward the general direction # ... first, check the sign is correct @@ -144,7 +113,7 @@ if ($CustomField and $Move) { next if $orig_delta < $this_delta; } - $TargetObj = $CustomFieldObj; + $TargetObj = $ObjectCF; } if ($TargetObj) { @@ -153,83 +122,68 @@ if ($CustomField and $Move) { $TargetObj->SetSortOrder($s); $SourceObj->SetSortOrder($t); # because order changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; } - $CustomFields->GotoFirstItem; + $ObjectCFs->GotoFirstItem; } # }}} -# {{{ now process the 'copy queue' action -my @actions; -if ($Source and $Source ne $id) { - my $SourceQueue = RT::Queue->new($session{'CurrentUser'}); - $SourceQueue->Load($Source) || Abort(loc("Couldn't load queue")); - my $SourceCustomFields = RT::CustomFields->new($session{'CurrentUser'}); - $SourceCustomFields->LimitToQueue($SourceQueue->id); - - # delete old fields - foreach my $CustomFieldObj ( @{$CustomFields->ItemsArrayRef} ) { - $CustomFieldObj->Delete; - } +if ($id) { + $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); + $GlobalCFs->LimitToObjectId(0); + $GlobalCFs->LimitToLookupType($lookup); +} - # add new fields - while (my $SourceCustomFieldObj = $SourceCustomFields->Next) { - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - my ($val, $msg) = $CustomFieldObj->Create( - id => $SourceCustomFieldObj->id, - Queue => $id, - Name => $SourceCustomFieldObj->Name, - Type => $SourceCustomFieldObj->Type, - Description => $SourceCustomFieldObj->Description, - ); - Abort(loc("Could not create CustomField") . ": $msg") unless ($val); - push @actions, $msg; - - $CustomFieldObj->SetSortOrder($SourceCustomFieldObj->SortOrder); - - # add new values - my $values = $SourceCustomFieldObj->Values(); - while (my $v = $values->Next) { - my ( $addval, $addmsg ) = $CustomFieldObj->AddValue( - Name => $v->Name, - Description => $v->Description, - SortOrder => $v->SortOrder - ); - } - } +while (my $cf = $CustomFields->Next) { + my $cf_id = $cf->Id; - # because content changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; - $CustomFields->GotoFirstItem; -} -# }}} + if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { + push @GlobalCFs, $cf; + next; + } -# {{{ deal with deleting existing custom fields -foreach my $key (keys %ARGS) { - # {{{ if we're trying to delete the custom field - if ($key =~ /^DeleteCustomField-(\d+)/) { - my $id = $1; - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - $CustomFieldObj->Load($id); - my ($retval, $msg) = $CustomFieldObj->Delete; - if ($retval) { - push @actions, loc("Custom field deleted"); + if ($UpdateCFs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$id-CF-$cf_id"; + if ($ARGS{$key}) { + if (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->AddToObject($Object); + push (@results, $msg); + push @UnassignedCFs, $cf if !$val; + } + } + else { + push @UnassignedCFs, $cf; + if ($ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->RemoveFromObject($Object); + push (@results, $msg); + pop @UnassignedCFs if !$val; + } + } } - else { - push @actions, $msg; + elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + push @UnassignedCFs, $cf; } - } - # }}} + else { + } } -# }}} + +# redo search... +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); </%INIT> <%ARGS> -$id => 0 $title => undef $Move => undef $Source => undef $CustomField => undef $FindDisabledCustomFields => undef +$UpdateCFs => 0 +$Object +$ObjectType +$SubType => '' </%ARGS> diff --git a/rt/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers index f6559e7ad..c93bf81f5 100644 --- a/rt/html/Admin/Elements/EditQueueWatchers +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %if ($Members->Count == 0 ) { <ul> <li><i><&|/l&>none</&></i> @@ -51,8 +51,7 @@ <ul> % while (my $watcher=$Members->Next) { <li> -<INPUT TYPE=CHECKBOX - NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" +<INPUT TYPE=CHECKBOX NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" UNCHECKED> % if ($watcher->MemberObj->IsUser) { <a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip index 4207114fd..907ae9a92 100644 --- a/rt/html/Admin/Elements/EditScrip +++ b/rt/html/Admin/Elements/EditScrip @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips index 8959f6c70..9526118b5 100644 --- a/rt/html/Admin/Elements/EditScrips +++ b/rt/html/Admin/Elements/EditScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> <form action="Scrips.html" method="post"> <input type="hidden" name="id" value="<%$id%>"> -<P><&|/l&>Current Scrips</&>:</P> +<h2><&|/l&>Current Scrips</&></h2> % if ($Scrips->Count == 0 ) { <P><i><&|/l&>(No scrips)</&></i></P> % } else { @@ -58,7 +58,7 @@ % while (my $scrip = $Scrips->Next ) { <TR> <TD> -<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>"> +<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>" value="1"> </TD> <TD> <a href="Scrip.html?id=<%$scrip->Id%>&Queue=<%$id%>"><% $scrip->Description || "<i>(".loc('no value').")</i>" |n %></a><br> diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates index 6ac56c235..207ffd001 100644 --- a/rt/html/Admin/Elements/EditTemplates +++ b/rt/html/Admin/Elements/EditTemplates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> <FORM METHOD=GET ACTION="Templates.html"> @@ -63,7 +63,7 @@ % while (my $TemplateObj = $Templates->Next) { <TR> <TD> -<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>"> +<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>" value="1"> </TD> <TD> <A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>"> diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments index bc23f77fe..fb96dc09a 100644 --- a/rt/html/Admin/Elements/EditUserComments +++ b/rt/html/Admin/Elements/EditUserComments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => "Comments about $name" &> <&|/l&>These comments aren't generally visible to the user</&>:<br> <input type="hidden" name="id" value="<%$id%>"> diff --git a/rt/html/Admin/Elements/GlobalCustomFieldTabs b/rt/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..8d4eaca23 --- /dev/null +++ b/rt/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/SystemTabs, subtabs => $tabs, + current_tab => 'Admin/Global/CustomFields/index.html', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> + + + my $tabs = { + + A => { title => loc('Users'), + text => loc('Modify scrips which apply to all queues'), + path => 'Admin/Global/CustomFields/Users.html', + }, + B => { title => loc('Groups'), + text => loc('Edit system templates'), + path => 'Admin/Global/CustomFields/Groups.html', + }, + + F => { title => loc('Tickets'), + text => loc('Modify global custom fields'), + path => 'Admin/Global/CustomFields/Queue-Tickets.html', + }, + + G => { title => loc('Ticket Transactions'), + text => loc('Modify global group rights'), + path => 'Admin/Global/CustomFields/Queue-Transactions.html', + }, + +}; + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs index de39ec117..60edda40e 100644 --- a/rt/html/Admin/Elements/GroupTabs +++ b/rt/html/Admin/Elements/GroupTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Groups/', @@ -67,6 +67,8 @@ $tabs->{"this"} = { class => "currentnav", path => "Admin/Groups/GroupRights.html?id=" . $GroupObj->id, }, G => { title => loc('User Rights'), path => "Admin/Groups/UserRights.html?id=" . $GroupObj->id, }, + H => { title => loc('History'), + path => "Admin/Groups/History.html?id=" . $GroupObj->id }, } } } @@ -74,7 +76,7 @@ $tabs->{"A"} = { title => loc('Select group'), path => "Admin/Groups/", }; $tabs->{"B"} = { title => loc('New group'), path => "Admin/Groups/Modify.html?Create=1", - separator => 1, }; + separator => 1, }; # Now let callbacks add their extra tabs $m->comp( '/Elements/Callback', tabs => $tabs, %ARGS ); diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header index 69a3ccd53..b80908094 100644 --- a/rt/html/Admin/Elements/Header +++ b/rt/html/Admin/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/Header, Title => $Title &> +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, %ARGS &> <%ARGS> $Title => undef diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields index abca29073..3df9d6292 100644 --- a/rt/html/Admin/Elements/ListGlobalCustomFields +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my $count = 0; % while (my $CustomFieldObj = $CustomFields->Next) { % $count++; diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips index cb3f89a9f..2e3791257 100644 --- a/rt/html/Admin/Elements/ListGlobalScrips +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,17 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -% my $count = 0; +%# END BPS TAGGED BLOCK }}} + +% if ($Scrips->Count == 0) { + +<P><i><&|/l&>(No scrips)</&></i></P> + +% } else { + +<UL> + % while (my $scrip = $Scrips->Next ) { -% $count++; -<font size="-1"><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></font> -<BR> -% } -% if (!$count) { -<font size="-1"><&|/l&>(No scrips)</&></font> +<LI> +<a href="<%$RT::WebPath%>/Admin/Global/Scrip.html?id=<%$scrip->Id%>&Queue=<%0%>"> +% if ($scrip->Description) { +<% $scrip->Description %> +% } else { +<i>(<&|/l, $scrip->Id&>Scrip #[_1]</&>)</i> +% } +</a><br> +<small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small> +</LI> % } +</UL> + +% } + <%init> my $Scrips = new RT::Scrips ($session{'CurrentUser'}); $Scrips->LimitToGlobal(); diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate index acd87a73f..6749f3e65 100644 --- a/rt/html/Admin/Elements/ModifyTemplate +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD ALIGN=RIGHT> diff --git a/rt/html/Admin/Elements/ObjectCustomFields b/rt/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..a87e1579d --- /dev/null +++ b/rt/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,109 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& $ObjectTabs, +$id ? ( + id => $Object->id, + current_tab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + current_subtab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + "${Type}Obj" => $Object, +) : ( + current_tab => "Admin/Global/CustomFields/${QualifiedType}s.html", +), + Title => $title + &> + +<& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object &> +<%INIT> +# XXX TODO: Validate here? +#$ObjectType =~ /^RT::(Queue|User|Group)$/ +# or Abort(loc("Object of type [_1] cannot take custom fields", $ObjectType)); + + + +my $Type = $1; +my $Types = $Type.'s'; +my $ObjectTabs; +my $Object = $ObjectType->new($session{'CurrentUser'}); + + +my $QualifiedType; +my $FriendlySubTypes; +if ($SubType =~/^RT::(.*)$/) { + $FriendlySubTypes = RT::CustomField->new($session{'CurrentUser'})->FriendlyLookupType($Object->CustomFieldLookupType); + $QualifiedType = "$Type-$1"; +} else { + $QualifiedType = $Type; +} + +if ($id) { + $Object->Load($id) || Abort(loc("Couldn't load object [_1]", $id)); + $ObjectTabs = "/Admin/Elements/${Type}Tabs"; +} else { + $ObjectTabs = "/Admin/Elements/GlobalCustomFieldTabs"; + +} + +my $title; +if ($id) { +$title = loc('Edit Custom Fields for [_1]', $Object->Name); +} +elsif ($SubType) { + + $title= loc("Modify Custom Fields which apply to [_1] for all [_2]", loc(lc($FriendlySubTypes)), loc(lc($Types))); +} else { + $title =loc("Modify Custom Fields which apply to all [_1]", loc(lc($Types))); + +} +my $sub_type_url; +$sub_type_url = "SubType=$SubType" if $SubType; + +</%INIT> +<%ARGS> +$id => undef +$ObjectType +$SubType => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/PickCustomFields b/rt/html/Admin/Elements/PickCustomFields new file mode 100644 index 000000000..c2a30f9a3 --- /dev/null +++ b/rt/html/Admin/Elements/PickCustomFields @@ -0,0 +1,96 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% if (@CustomFields == 0) { +<p><i><&|/l&>(None)</&></i></p> +% } else { +<TABLE cellspacing=0 cellpadding=2> +% my $count; +% foreach my $CustomFieldObj (@CustomFields) { +<TR> +% if (!$ReadOnly) { + <TD valign="TOP"> +<input type="checkbox" name="Object-<%$id%>-CF-<%$CustomFieldObj->Id%>" value="1" <% $Checked ? 'CHECKED' : '' %> +> + </TD> +% } + <TD valign="TOP"> + <A HREF="<%$RT::WebPath%>/Admin/CustomFields/Modify.html?id=<%$CustomFieldObj->id()%>"> +% if ($CustomFieldObj->Name) { +<b><%$CustomFieldObj->Name%></b> +% } else { +<i>(<&|/l&>no name</&>)</i> +% } +</a><br> + <%$CustomFieldObj->Description%> + </TD> + <TD valign="TOP"> + <i><% $CustomFieldObj->FriendlyTypeComposite %></i> + </TD> +% # show 'move up' unless it's the first item +% if ($count++ and $Checked) { + <TD valign="TOP"> + [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>] +% } else { + <TD valign="TOP" ALIGN=RIGHT> +% } + +% # show 'move down' unless it's the last item +% if ($count != @CustomFields and $Checked) { +% $m->print(' | ') if $count > 1; + [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>] +% } + </TD> +</TR> +% } +</TABLE> +% } +<%ARGS> +@CustomFields +$id +$ReadOnly => 0 +$Checked => 0 +$SubType +</%ARGS> diff --git a/rt/html/Admin/Elements/PickObjects b/rt/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..b07a88240 --- /dev/null +++ b/rt/html/Admin/Elements/PickObjects @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +% if (@Objects == 0) { +<P><i><&|/l&>(None)</&></i></P> +% } else { +<TABLE cellspacing=0 cellpadding=2> +% my $count; +% foreach my $Object (@Objects) { +<TR> +% if (!$ReadOnly) { + <TD valign="TOP"> +<input type="checkbox" name="Object-<%$Object->id%>-CF-<%$id%>" value="1" <% $Checked ? 'CHECKED' : ''%> +> + </TD> +% } + <TD valign="TOP"> +% if ($Object->Name) { + <b><%$Object->Name%></b><br> +% } else { + <i>(<%loc("no name")%>)</i><br> +% } + <%$Object->can('Description') && $Object->Description%> + </TD> +%# <TD valign="TOP"> +%# <i><% $CustomFieldObj->FriendlyTypeComposite %></i> +%# </TD> + </TD> +</TR> +% } +</TABLE> +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 +</%ARGS> diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser index 57b5fd8b3..01f294a59 100644 --- a/rt/html/Admin/Elements/QueueRightsForUser +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <UL> %while(my $ACE = $ACL->Next) { -<LI><checkbox name="delete_ace_<%$ACE->id%>"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) +<LI><checkbox name="delete_ace_<%$ACE->id%>" value="1"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) %} </UL> diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs index 0eec1fc6f..93522d0a2 100644 --- a/rt/html/Admin/Elements/QueueTabs +++ b/rt/html/Admin/Elements/QueueTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Queues/', @@ -71,8 +71,12 @@ if ($id) { path => "Admin/Queues/Templates.html?id=".$id, }, - G => { title => loc('Custom Fields'), - path => 'Admin/Queues/CustomFields.html?id='.$id, + G1 => { title => loc('Ticket Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket&id='.$id, + }, + + G2 => { title => loc('Transaction Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id, }, H => { title => loc('Group Rights'), @@ -90,8 +94,7 @@ if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQue }; $tabs->{"B"} = { title => loc('New queue'), path => "Admin/Queues/Modify.html?Create=1", - separator => 1, - }; + separator => 1, }; } # Now let callbacks add their extra tabs diff --git a/rt/html/Admin/Elements/SelectCustomFieldLookupType b/rt/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..ec9f740b9 --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<SELECT NAME ="<%$Name%>"> +%for my $option ($cf->LookupTypes) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyLookupType($option) %></OPTION> +%} +</SELECT> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'LookupType' +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType index 76606c412..3f25b8e71 100644 --- a/rt/html/Admin/Elements/SelectCustomFieldType +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,10 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> -%for my $option ($cf->Types) { -<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyType($option) %></OPTION> +%for my $option ($cf->TypeComposites) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyTypeComposite($option) %></OPTION> %} </SELECT> <%INIT> @@ -54,5 +54,5 @@ my $cf = RT::CustomField->new($session{'CurrentUser'}); </%INIT> <%ARGS> $Default=>undef -$Name => 'Type' +$Name => 'TypeComposite' </%ARGS> diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups index 175ce0657..92bd47587 100644 --- a/rt/html/Admin/Elements/SelectGroups +++ b/rt/html/Admin/Elements/SelectGroups @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> %while (my $group = $groups->Next) { <OPTION VALUE="<%$group->id%>"><%$group->Name%> diff --git a/rt/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup index b33eaea44..272e1f0c7 100644 --- a/rt/html/Admin/Elements/SelectModifyGroup +++ b/rt/html/Admin/Elements/SelectModifyGroup @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $Group = $Groups->Next) { <A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue index 2ca6bd814..3a30d09c8 100644 --- a/rt/html/Admin/Elements/SelectModifyQueue +++ b/rt/html/Admin/Elements/SelectModifyQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $queue = $queues->Next) { <A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser index 97411c909..fc6c01205 100644 --- a/rt/html/Admin/Elements/SelectModifyUser +++ b/rt/html/Admin/Elements/SelectModifyUser @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $user = $users->Next) { <A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers index 90f9a0b91..95056aec9 100644 --- a/rt/html/Admin/Elements/SelectNewGroupMembers +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Show ne 'Groups') { <b><&|/l&>Users</&></b> <SELECT MULTIPLE NAME="<%$Name%>Users" SIZE=10> diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights index 61a9e42ec..3e61d5071 100644 --- a/rt/html/Admin/Elements/SelectRights +++ b/rt/html/Admin/Elements/SelectRights @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,27 +42,30 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <INPUT TYPE=HIDDEN NAME="CheckACL" VALUE="<%$ACLDesc%>"> <TABLE BORDER=0> <TR> <TD valign=top width="180" align="left"> +% my %current_rights; <h3><&|/l&>Current rights</&></h3> -% if ($ACLObj->Count() > 0) { -<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> -% } else { +% if ($ACLObj->Count() == 0) { <i><&|/l&>No rights granted.</&></i> <BR> -% } +% } else { +<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> % while (my $right = $ACLObj->Next()) { % if ($right->RightName) { +% $current_rights{$right->RightName} = 1; <input type=checkbox value="<%$right->Id%>" name="RevokeRight-<%$ACLDesc%>-<%$right->RightName%>"> <% loc($right->RightName) %><br> % } % } +% } </TD> <TD valign=top> <h3><&|/l&>New rights</&></h3> <SELECT SIZE=5 MULTIPLE NAME="GrantRight-<%$ACLDesc%>"> % foreach $right (sort keys %Rights) { +% next if $current_rights{$right}; <OPTION VALUE="<%$right%>" ><% loc($right) %></OPTION> % } @@ -100,7 +103,7 @@ } else { - %Rights = { loc('System Error') => loc("No rights found")}; + %Rights = ( loc('System Error') => loc("No rights found") ); } $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; diff --git a/rt/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip index 7fce6d54e..a9e979699 100644 --- a/rt/html/Admin/Elements/SelectScrip +++ b/rt/html/Admin/Elements/SelectScrip @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" <% $Default eq undef && 'SELECTED' %> diff --git a/rt/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction index 17cd6a199..8d88d6458 100644 --- a/rt/html/Admin/Elements/SelectScripAction +++ b/rt/html/Admin/Elements/SelectScripAction @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" -<% $Default eq undef && 'SELECTED' %> +<% ! defined $Default && 'SELECTED' %> >-</OPTION> %while (my $ScripAction = $ScripActions->Next) { <OPTION VALUE=<%$ScripAction->Id%> -<% $ScripAction->Id == $Default && 'SELECTED' %> +<% defined $Default && $ScripAction->Id == $Default && 'SELECTED' %> ><% loc($ScripAction->Name) %> </OPTION> %} diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition index 021132be7..faa99fda6 100644 --- a/rt/html/Admin/Elements/SelectScripCondition +++ b/rt/html/Admin/Elements/SelectScripCondition @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" -<% $Default eq undef && 'SELECTED' %> +<% ! defined $Default && 'SELECTED' %> >-</OPTION> %while (my $ScripCondition = $ScripConditions->Next) { <OPTION VALUE=<%$ScripCondition->Id%> -<% $ScripCondition->Id == $Default && 'SELECTED' %> +<% defined $Default && $ScripCondition->Id == $Default && 'SELECTED' %> ><% loc($ScripCondition->Name) %> </OPTION> %} diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple index 9b1982606..571695091 100644 --- a/rt/html/Admin/Elements/SelectSingleOrMultiple +++ b/rt/html/Admin/Elements/SelectSingleOrMultiple @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="<%$Name%>"> <option value="1" <%$SingleDefault%>><&|/l&>Single</&></option> <option value="0" <%$MultipleDefault%>><&|/l&>Multiple</&></option> diff --git a/rt/html/Admin/Elements/SelectStage b/rt/html/Admin/Elements/SelectStage index 0472d2fcd..0fbf5c609 100644 --- a/rt/html/Admin/Elements/SelectStage +++ b/rt/html/Admin/Elements/SelectStage @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,9 +42,9 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> -% foreach my $stage (qw(TransactionCreate TransactionBatch Disabled)) { +% foreach my $stage (@stages) { <OPTION VALUE=<%$stage%> <% ($stage eq $Default) && 'SELECTED' %> ><% loc($stage) %> @@ -54,6 +54,9 @@ if ($Default eq '') { $Default = 'TransactionCreate'; } +my @stages = 'TransactionCreate'; +push @stages, 'TransactionBatch' if $RT::UseTransactionBatch; +push @stages, 'Disabled'; </%INIT> <%ARGS> $Default => 'TransactionCreate' diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate index f48948387..7d83b6768 100644 --- a/rt/html/Admin/Elements/SelectTemplate +++ b/rt/html/Admin/Elements/SelectTemplate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" <% $Default eq 'none' && 'SELECTED' %> diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers index 31ac3e453..a88aa8ff7 100644 --- a/rt/html/Admin/Elements/SelectUsers +++ b/rt/html/Admin/Elements/SelectUsers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> %while (my $user = $users->Next) { <OPTION VALUE="<%$user->id%>"><%$user->Name%> diff --git a/rt/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs index 4409695d8..646f552f5 100644 --- a/rt/html/Admin/Elements/SystemTabs +++ b/rt/html/Admin/Elements/SystemTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Global/', current_subtab => $current_tab, @@ -59,7 +59,7 @@ }, F => { title => loc('Custom Fields'), - path => 'Admin/Global/CustomFields.html', + path => 'Admin/Global/CustomFields/index.html', }, G => { title => loc('Group Rights'), diff --git a/rt/html/Admin/Elements/Tabs b/rt/html/Admin/Elements/Tabs index 39eaa728b..f90a629a2 100644 --- a/rt/html/Admin/Elements/Tabs +++ b/rt/html/Admin/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Admin/', @@ -59,10 +59,13 @@ C => { title => loc('Queues'), path => 'Admin/Queues/', }, - D => { 'title' => loc('Global'), + D => { 'title' => loc('Custom Fields'), + path => 'Admin/CustomFields/', + }, + E => { 'title' => loc('Global'), path => 'Admin/Global/', }, - E => { 'title' => loc('Tools'), + F => { 'title' => loc('Tools'), path => 'Admin/Tools/', }, }; diff --git a/rt/html/Admin/Elements/ToolTabs b/rt/html/Admin/Elements/ToolTabs index 606bd1202..773b81099 100755 --- a/rt/html/Admin/Elements/ToolTabs +++ b/rt/html/Admin/Elements/ToolTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Tools/', current_subtab => $current_tab, diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs index 671bd6dd4..0ffd29b0f 100644 --- a/rt/html/Admin/Elements/UserTabs +++ b/rt/html/Admin/Elements/UserTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,52 +42,61 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Admin/Elements/Tabs, +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, subtabs => $tabs, - current_tab => 'Admin/Users/', - current_subtab => $current_tab, + current_tab => 'Admin/Users/', + current_subtab => $current_tab, Title => $Title &> <%INIT> my $tabs; if ($id) { - $tabs->{'this'} = { - title => eval { $UserObj->Name }, +$tabs->{'this'} = { title => eval { $UserObj->Name }, + path => "Admin/Users/Modify.html?id=".$id, - current_subtab => $current_tab, - subtabs => { - A => { title => loc('Basics'), +subtabs => { + Basics => { title => loc('Basics'), path => "Admin/Users/Modify.html?id=".$id }, - } + Memberships => { title => loc('Memberships'), + path => "Admin/Users/Memberships.html?id=".$id + }, + History => { title => loc('History'), + path => "Admin/Users/History.html?id=".$id + }, +# Scrips => { title => loc('Rights'), +# path => "Admin/Users/Rights.html?id=".$id +# } + } } - -if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers') ) { - $tabs->{"A"} = { - title => loc('Select user'), - path => "Admin/Users/", - }; - $tabs->{"B"} = { - title => loc('New user'), - path => "Admin/Users/Modify.html?Create=1", +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { + $tabs->{"A"} = { title => loc('Select user'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { title => loc('New user'), + path => "Admin/Users/Modify.html?Create=1", separator => 1, }; } -# Now let callbacks add their extra tabs -$m->comp('/Elements/Callback', tabs => $tabs, %ARGS); - -foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { - if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { - $tabs->{'this'}->{"current_subtab"} = $current_tab; - $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; - $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; - } -} - + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +#foreach my $tab ( sort keys %{$tabs} ) { +# if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { +# $tabs->{$tab}->{"current_subtab"} = $current_subtab; +# } +#} +foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { + if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} +$tabs->{'this'}->{"current_subtab"} = $current_tab; $current_tab = "Admin/Users/Modify.html?id=".$id if $id; - </%INIT> <%ARGS> $UserObj => undef diff --git a/rt/html/Admin/Global/CustomFields/Groups.html b/rt/html/Admin/Global/CustomFields/Groups.html new file mode 100644 index 000000000..bffde016f --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Groups.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Groups.html", + current_subtab => "Admin/Global/CustomFields/Groups.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Group', Object=> $object &> +<%INIT> + my $title = loc( 'Edit Custom Fields for all groups'); + my $object = RT::Group->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Queue-Tickets.html b/rt/html/Admin/Global/CustomFields/Queue-Tickets.html new file mode 100755 index 000000000..396559a17 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Queue-Tickets.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Queue-Tickets.html", + current_subtab => "Admin/Global/CustomFields/Queue-Tickets.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket' &> +<%INIT> + my $title = loc( 'Edit Custom Fields for tickets in all queues'); + my $object = RT::Queue->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Queue-Transactions.html b/rt/html/Admin/Global/CustomFields/Queue-Transactions.html new file mode 100755 index 000000000..63b4cfe6b --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Queue-Transactions.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Queue-Transactions.html", + current_subtab => "Admin/Global/CustomFields/Queue-Transactions.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket-RT::Transaction' &> +<%INIT> + my $title = loc( 'Edit Custom Fields for tickets in all queues'); + my $object = RT::Queue->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Users.html b/rt/html/Admin/Global/CustomFields/Users.html new file mode 100644 index 000000000..6b79743d2 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Users.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Users.html", + current_subtab => "Admin/Global/CustomFields/Users.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::User', Object=> $object &> +<%INIT> + my $title = loc( 'Edit Custom Fields for all users'); + my $object = RT::User->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/index.html b/rt/html/Admin/Global/CustomFields/index.html new file mode 100644 index 000000000..9cdcfd549 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/index.html @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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/Callback, tabs => $tabs, %ARGS &> +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, Title => $title &> + +<ul> +% foreach my $key (sort keys %$tabs) { +<li><font size="+2"><a href="<% $tabs->{$key}{path} %>"><% $tabs->{$key}{title} %></a></font><br> +<% $tabs->{$key}{text} %> +</li> +% } +</ul> + +<%INIT> +my $title = loc("Global custom field configuration"); + +my $tabs = { + + A => { + title => loc('Users'), + text => loc('Select custom fields for all users'), + path => 'Users.html', + }, + B => { + title => loc('Groups'), + text => loc('Select custom fields for all user groups'), + path => 'Groups.html', + }, + + F => { + title => loc('Tickets'), + text => loc('Select custom fields for tickets in all queues'), + path => 'Queue-Tickets.html', + }, + + G => { + title => loc('Ticket Transactions'), + text => + loc('Select custom fields for transactions on tickets in all queues'), + path => 'Queue-Transactions.html', + }, + +}; + + +$m->comp('/Elements/Callback', tabs => $tabs); +</%INIT> diff --git a/rt/html/Admin/Global/GroupRights.html b/rt/html/Admin/Global/GroupRights.html index 68718b9af..8d71432e0 100644 --- a/rt/html/Admin/Global/GroupRights.html +++ b/rt/html/Admin/Global/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify global group rights') &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/GroupRights.html', diff --git a/rt/html/Admin/Global/Scrip.html b/rt/html/Admin/Global/Scrip.html index 2e63fe7e2..4e0c1f466 100644 --- a/rt/html/Admin/Global/Scrip.html +++ b/rt/html/Admin/Global/Scrip.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Scrips.html', diff --git a/rt/html/Admin/Global/Scrips.html b/rt/html/Admin/Global/Scrips.html index 37bd2c722..dcfa6ff07 100644 --- a/rt/html/Admin/Global/Scrips.html +++ b/rt/html/Admin/Global/Scrips.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Scrips.html', diff --git a/rt/html/Admin/Global/Template.html b/rt/html/Admin/Global/Template.html index a289eb644..17da59b9e 100644 --- a/rt/html/Admin/Global/Template.html +++ b/rt/html/Admin/Global/Template.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc("Modify template [_1]", $TemplateObj->id) &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Templates.html', diff --git a/rt/html/Admin/Global/Templates.html b/rt/html/Admin/Global/Templates.html index da3395ab4..387326cd1 100644 --- a/rt/html/Admin/Global/Templates.html +++ b/rt/html/Admin/Global/Templates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Admin/Elements/Header, Title => $title &> +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title, FeedURI => 'templates' &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Templates.html', current_subtab => 'Admin/Global/Templates.html', diff --git a/rt/html/Admin/Global/UserRights.html b/rt/html/Admin/Global/UserRights.html index a65e7c216..14a4de368 100644 --- a/rt/html/Admin/Global/UserRights.html +++ b/rt/html/Admin/Global/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify global user rights') &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/UserRights.html', diff --git a/rt/html/Admin/Global/index.html b/rt/html/Admin/Global/index.html index 3a70e7c17..af7a9ddd9 100644 --- a/rt/html/Admin/Global/index.html +++ b/rt/html/Admin/Global/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, tabs => $tabs, %ARGS &> <& /Admin/Elements/Header, Title => loc('Admin/Global configuration') &> <& /Admin/Elements/SystemTabs, @@ -69,8 +69,8 @@ }, F => { title => loc('Custom Fields'), - text => loc('Modify Custom Fields which apply to all queues'), - path => 'CustomFields.html', + text => loc('Modify global custom fields'), + path => 'CustomFields/index.html', }, G => { title => loc('Group Rights'), diff --git a/rt/html/Admin/Groups/CustomFields.html b/rt/html/Admin/Groups/CustomFields.html new file mode 100644 index 000000000..c2336b042 --- /dev/null +++ b/rt/html/Admin/Groups/CustomFields.html @@ -0,0 +1,46 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &> diff --git a/rt/html/Admin/Groups/GroupRights.html b/rt/html/Admin/Groups/GroupRights.html index 55e2a6530..d95bdae07 100644 --- a/rt/html/Admin/Groups/GroupRights.html +++ b/rt/html/Admin/Groups/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> <& /Admin/Elements/GroupTabs, GroupObj => $GroupObj, diff --git a/rt/html/Admin/Groups/History.html b/rt/html/Admin/Groups/History.html new file mode 100644 index 000000000..40dab46e9 --- /dev/null +++ b/rt/html/Admin/Groups/History.html @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, + id => $id, + GroupObj => $GroupObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $GroupObj, + ShowHeaderModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Groups/History.html?id='.$id; +my $GroupObj = new RT::Group($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort("Couldn't load group '$id'"); +my $title = loc("History of the group [_1]", $GroupObj->Name); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html index 779df9567..fd25b2d7f 100644 --- a/rt/html/Admin/Groups/Members.html +++ b/rt/html/Admin/Groups/Members.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => "RT/Admin/Edit the group ". $Group->Name &> <& /Admin/Elements/GroupTabs, GroupObj => $Group, current_tab => 'Admin/Groups/Members.html?id='.$id, @@ -78,7 +78,7 @@ % $UserMembers->LimitToUsers(); <UL> % while (my $member = $UserMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) % } </ul> @@ -87,7 +87,7 @@ % my $GroupMembers = $Group->MembersObj; % $GroupMembers->LimitToGroups(); % while (my $member = $GroupMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> % } % } diff --git a/rt/html/Admin/Groups/Modify.html b/rt/html/Admin/Groups/Modify.html index 0140a57e1..94c0203b1 100644 --- a/rt/html/Admin/Groups/Modify.html +++ b/rt/html/Admin/Groups/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, @@ -53,7 +53,7 @@ -<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST> +<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST ENCTYPE="multipart/form-data"> %unless ($Group->Id) { <INPUT TYPE=HIDDEN NAME=id VALUE="new"> @@ -65,16 +65,27 @@ <&|/l&>Name</&>: </TD> <TD><INPUT name="Name" value="<%$Group->Name%>"></TD> -</TR><TR> +</TR> +<TR> <TD ALIGN=RIGHT> <&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD> -</TR><TR> +</TR> +% my $CFs = $Group->CustomFields; +% while (my $CF = $CFs->Next) { +<TR VALIGN="TOP"><TD ALIGN="RIGHT"> +<% $CF->Name %>: +</TD><TD> +<& /Elements/EditCustomField, CustomField => $CF, Object => $Group &> +</TD></TR> +% } +<TR> <TD COLSPAN=2> <INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> </TR> +<& /Elements/Callback, GroupObj => $Group, results => \@results, %ARGS &> </TABLE> -<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> </form> <%INIT> @@ -124,6 +135,7 @@ if ($id) { Object => $Group, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $Group ); } #we're asking about enabled on the web page but really care about disabled. diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html index 3f17baa41..5237b1578 100644 --- a/rt/html/Admin/Groups/UserRights.html +++ b/rt/html/Admin/Groups/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> <& /Admin/Elements/GroupTabs, GroupObj => $GroupObj, diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html index 7c2cd504c..073440696 100644 --- a/rt/html/Admin/Groups/index.html +++ b/rt/html/Admin/Groups/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,36 +42,66 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', current_subtab => 'Admin/Groups/', Title => $title &> - - -<UL> +<%$caption%>:<BR> <UL> +%if ($Groups->Count == 0) { +<LI> <i><&|/l&>No groups matching search criteria found.</&></i> +% } +%my @ids; %while ( my $Group = $Groups->Next) { +% push @ids, $Group->Id; <LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><BR> %} </UL> +%if (my $ids = join(',', @ids)) { +<em>(<a href="<%$RT::WebPath%>/Download/Tabular/Group/<% $ids %>/Groups.tsv"><&|/l&>Download as a tab-delimited file</&></a>)</em><br> +%} <br><br> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html"> -<input type="checkbox" name="FindDisabledGroups"> <&|/l&>Include disabled groups in listing.</&> +<input type="checkbox" name="FindDisabledGroups" value="1"> <&|/l&>Include disabled groups in listing.</&> <BR> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> +<br><br> +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html"> +<&|/l&>Find groups whose</&> <& /Elements/SelectGroups &><BR> +<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> +</FORM> <%INIT> my $Groups = RT::Groups->new($session{'CurrentUser'}); - -if ($FindDisabledGroups) { - $Groups->{'find_disabled_rows'} = 1; -} - $Groups->LimitToUserDefinedGroups(); my $title = loc('Select a group'); +my $caption; +if (length $GroupString) { + $caption = loc("Groups matching search criteria"); + if ($GroupField =~ /^CustomField-(\d+)/) { + $Groups->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } + else { + $Groups->Limit( + FIELD => $GroupField, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } +} +else { + $caption = loc("User-defined groups"); +} </%INIT> <%ARGS> +$GroupString => undef +$GroupOp => '=' +$GroupField => 'Name' $FindDisabledGroups => 0 </%ARGS> diff --git a/rt/html/Admin/Queues/CustomField.html b/rt/html/Admin/Queues/CustomField.html index a865dba71..5beba58c8 100644 --- a/rt/html/Admin/Queues/CustomField.html +++ b/rt/html/Admin/Queues/CustomField.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, @@ -78,7 +78,7 @@ my $subtabs = { </%INIT> <%ARGS> $CustomField => undef -$Queue => undef +$Queue => 0 </%ARGS> <%ATTR> AutoFlush => 0 diff --git a/rt/html/Admin/Queues/CustomFields.html b/rt/html/Admin/Queues/CustomFields.html index 507c02d79..4d7e08875 100644 --- a/rt/html/Admin/Queues/CustomFields.html +++ b/rt/html/Admin/Queues/CustomFields.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,29 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> -<& /Admin/Elements/QueueTabs, id => $Queue->id, - current_tab => 'Admin/Queues/CustomFields.html?id='.$id, - QueueObj => $Queue, - subtabs => $subtabs, +<& /Admin/Elements/QueueTabs, + id => $Object->id, + current_tab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + current_subtab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + QueueObj => $Object, Title => $title &> -<& /Admin/Elements/EditCustomFields, title => $title, %ARGS &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &> <%INIT> -my $Queue = new RT::Queue($session{'CurrentUser'}); -$Queue->Load($id) || Abort(loc("Couldn't load queue", $id)); +my $Object = RT::Queue->new( $session{'CurrentUser'} ); -my $CustomFields = RT::CustomFields->new($RT::SystemUser); -$CustomFields->LimitToQueue($Queue->Id); -my $subtabs = { - A => { title => loc('New custom field'), - path => "Admin/Queues/CustomField.html?create=1&Queue=".$id, - } - }; +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); -my $title= loc('Edit Custom Fields for [_1]', $Queue->Name); </%INIT> <%ARGS> $id => undef +$SubType => 'RT::Queue-RT::Ticket' </%ARGS> diff --git a/rt/html/Admin/Queues/GroupRights.html b/rt/html/Admin/Queues/GroupRights.html index 5e0d5b919..c5a12bfa3 100644 --- a/rt/html/Admin/Queues/GroupRights.html +++ b/rt/html/Admin/Queues/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Modify.html b/rt/html/Admin/Queues/Modify.html index 717a83af4..5517a80c0 100644 --- a/rt/html/Admin/Queues/Modify.html +++ b/rt/html/Admin/Queues/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, @@ -72,13 +72,13 @@ <&|/l&>Reply Address</&>: </TD><TD> <INPUT name="CorrespondAddress" value="<% ($Create) ? "" : $QueueObj->CorrespondAddress %>"> -<BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1]</&></i></font> +<BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1])</&></i></font> </TD> <TD ALIGN=RIGHT> <&|/l&>Comment Address</&>: </TD><TD> <INPUT NAME="CommentAddress" value="<% ($Create) ? "" : $QueueObj->CommentAddress %>"> -<BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1]</&></i></font> +<BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1])</&></i></font> </TD> </TR><TR> @@ -159,7 +159,7 @@ my @attribs= qw(Description CorrespondAddress CommentAddress Name } if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) { my ($code, $msg) = $QueueObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); } if ($QueueObj->Disabled()) { diff --git a/rt/html/Admin/Queues/People.html b/rt/html/Admin/Queues/People.html index 1a5caeec4..e29b9d34f 100644 --- a/rt/html/Admin/Queues/People.html +++ b/rt/html/Admin/Queues/People.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, @@ -79,7 +79,7 @@ <& /Elements/SelectUsers &> <input type=submit name="OnlySearchForPeople" value="<&|/l&>Go!</&>"> <BR> -<&|/l&>Find group whose</&><BR> +<&|/l&>Find groups whose</&><BR> <& /Elements/SelectGroups &> <input type=submit name="OnlySearchForGroup" value="<&|/l&>Go!</&>"> diff --git a/rt/html/Admin/Queues/Scrip.html b/rt/html/Admin/Queues/Scrip.html index be9226fac..1223fbfed 100644 --- a/rt/html/Admin/Queues/Scrip.html +++ b/rt/html/Admin/Queues/Scrip.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Scrips.html b/rt/html/Admin/Queues/Scrips.html index 5d10e442b..e7092fb22 100644 --- a/rt/html/Admin/Queues/Scrips.html +++ b/rt/html/Admin/Queues/Scrips.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Template.html b/rt/html/Admin/Queues/Template.html index 066e7dd25..c60a90900 100644 --- a/rt/html/Admin/Queues/Template.html +++ b/rt/html/Admin/Queues/Template.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $Queue, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Templates.html b/rt/html/Admin/Queues/Templates.html index e92184841..888fdbc8a 100644 --- a/rt/html/Admin/Queues/Templates.html +++ b/rt/html/Admin/Queues/Templates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, current_tab => 'Admin/Queues/Templates.html?id='.$id, diff --git a/rt/html/Admin/Queues/UserRights.html b/rt/html/Admin/Queues/UserRights.html index 6aaaab95a..399992ae2 100644 --- a/rt/html/Admin/Queues/UserRights.html +++ b/rt/html/Admin/Queues/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/index.html b/rt/html/Admin/Queues/index.html index 80998bd56..28adf531c 100644 --- a/rt/html/Admin/Queues/index.html +++ b/rt/html/Admin/Queues/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc("Admin queues") &> <& /Admin/Elements/QueueTabs, current_tab => 'Admin/Queues/', current_subtab => 'Admin/Queues/', @@ -50,18 +50,19 @@ -<%$caption%>:<BR> +<h1><%$caption%></h1> +<p><&|/l&>Select a queue</&>:</p> <UL> %if ($queues->Count == 0) { -<LI> <i><&|/l&>No queues matching search criteria found.</&></i> +<li><i><&|/l&>No queues matching search criteria found.</&></i></li> % } %while ( $queue = $queues->Next) { -<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI> +<li><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></li> %} </UL> <BR> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Queues/index.html"> -<input type="checkbox" name="FindDisabledQueues"> <&|/l&>Include disabled queues in listing.</&> +<input type="checkbox" name="FindDisabledQueues" value="1"> <&|/l&>Include disabled queues in listing.</&> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> diff --git a/rt/html/Admin/Tools/Configuration.html b/rt/html/Admin/Tools/Configuration.html index 24d9b7309..bc5ca69a1 100644 --- a/rt/html/Admin/Tools/Configuration.html +++ b/rt/html/Admin/Tools/Configuration.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> require Module::Versions::Report; my $title = loc('System Configuration'); @@ -80,7 +80,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super % next if (ref ${'RT::'.$key} ); <tr><td>RT::<%$key%></td> <td> -% if ($key =~ /Password/i) { +% if ($key =~ /Password(?!Length)/i) { <i>Password not printed</i> % } else { <%${'RT::'.$key} %> diff --git a/rt/html/Admin/Tools/index.html b/rt/html/Admin/Tools/index.html index c9a587371..49cfac3ee 100644 --- a/rt/html/Admin/Tools/index.html +++ b/rt/html/Admin/Tools/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $title = loc('System Tools'); </%init> diff --git a/rt/html/Admin/Users/CustomFields.html b/rt/html/Admin/Users/CustomFields.html new file mode 100644 index 000000000..5662c6c16 --- /dev/null +++ b/rt/html/Admin/Users/CustomFields.html @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $Object->id, + current_tab => "Admin/Users/CustomFields.html?$id=".$id, + current_subtab => "Admin/Users/CustomFields.html?id=".$id, + UserObj => $Object, + Title => $title + &> + + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::User' &> +<%INIT> +my $Object = RT::User->new( $session{'CurrentUser'} ); + +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); + +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/History.html b/rt/html/Admin/Users/History.html new file mode 100644 index 000000000..024a90b00 --- /dev/null +++ b/rt/html/Admin/Users/History.html @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $UserObj, + ShowHeaderModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Users/History.html?id='.$id; +my $UserObj = new RT::User($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("History of the user [_1]", $UserObj->Name); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/Memberships.html b/rt/html/Admin/Users/Memberships.html new file mode 100644 index 000000000..3e632393f --- /dev/null +++ b/rt/html/Admin/Users/Memberships.html @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<h2><&|/l&>Groups</&></h2> + +<& /Elements/ShowMemberships, UserObj => $UserObj &> + +<%INIT> +my $UserObj = RT::User->new($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("Memberships of the user [_1]", $UserObj->Name); +my $current_tab = 'Admin/Users/Memberships.html?id='.$id; +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/Modify.html b/rt/html/Admin/Users/Modify.html index efa1f80de..8a24f9c4a 100644 --- a/rt/html/Admin/Users/Modify.html +++ b/rt/html/Admin/Users/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/UserTabs, id => $id, @@ -52,7 +52,7 @@ <& /Elements/ListActions, actions => \@results &> -<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST> +<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST ENCTYPE="multipart/form-data"> %if ($Create) { <INPUT TYPE=HIDDEN NAME=id VALUE="new"> % } else { @@ -91,6 +91,11 @@ <input name="Gecos" value="<%$UserObj->Gecos%>"> </TD></TR> <TR><TD ALIGN="RIGHT"> +<&|/l&>Language</&>: +</TD><TD> +<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &> +</TD></TR> +<TR><TD ALIGN="RIGHT"> <&|/l&>Extra info</&>: </TD><TD> <textarea name="FreeformContactInfo" cols=20 rows=5><%$UserObj->FreeformContactInfo%></TEXTAREA> @@ -199,17 +204,30 @@ <TR> </TR> </TABLE> +<BR> +<& /Elements/TitleBoxStart, title => loc('Custom Fields') &> +<TABLE> +% my $CFs = $UserObj->CustomFields; +% while (my $CF = $CFs->Next) { +<TR VALIGN="TOP"><TD ALIGN="RIGHT"> +<% $CF->Name %>: +</TD><TD> +<& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &> +</TD></TR> +% } +<TR> +</TR> +</TABLE> +<& /Elements/TitleBoxEnd &> <TR> <TD colspan="2"> <& /Elements/TitleBoxStart, title => loc('Comments about this user') &> -<TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%> -</TEXTAREA> +<TEXTAREA class="comments" name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%></TEXTAREA> <& /Elements/TitleBoxEnd &> %if ($UserObj->Privileged) { <BR> <& /Elements/TitleBoxStart, title => loc('Signature') &> -<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> -<%$UserObj->Signature%></TEXTAREA> +<TEXTAREA class="signature" COLS=80 ROWS=5 name="Signature" WRAP=HARD><%$UserObj->Signature%></TEXTAREA> <& /Elements/TitleBoxEnd &> % } @@ -236,46 +254,44 @@ else { $current_tab = 'Admin/Users/Modify.html?id='.$id; if ($id eq 'new') { - ( $val, $msg ) = $UserObj->Create( - Name => $Name, - EmailAddress => $ARGS{'EmailAddress'}, - Name => $ARGS{'Name'}, - Comments => $ARGS{'Comments'}, - Signature => $ARGS{'Signature'}, - EmailAddress => $ARGS{'EmailAddress'}, - FreeformContactInfo => $ARGS{'FreeformContactInfo'}, - Organization => $ARGS{'Organization'}, - RealName => $ARGS{'RealName'}, - NickName => $ARGS{'NickName'}, - Lang => $ARGS{'Lang'}, - EmailEncoding => $ARGS{'EmailEncoding'}, - WebEncoding => $ARGS{'WebEncoding'}, - ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, - ContactInfoSystem => $ARGS{'ContactInfoSystem'}, - Gecos => $ARGS{'Gecos'}, - ExternalAuthId => $ARGS{'ExternalAuthId'}, - AuthSystem => $ARGS{'AuthSystem'}, - HomePhone => $ARGS{'HomePhone'}, - WorkPhone => $ARGS{'WorkPhone'}, - MobilePhone => $ARGS{'MobilePhone'}, - PagerPhone => $ARGS{'PagerPhone'}, - Address1 => $ARGS{'Address1'}, - Address2 => $ARGS{'Address2'}, - City => $ARGS{'City'}, - State => $ARGS{'State'}, - Zip => $ARGS{'Zip'}, - Country => $ARGS{'Country'}, - Privileged => $ARGS{'Privileged'}, - Disabled => ($ARGS{'Enabled'} ? 0 : 1) - ); + ( $val, $msg ) = $UserObj->Create( + Name => $Name, + EmailAddress => $ARGS{'EmailAddress'}, + Name => $ARGS{'Name'}, + Comments => $ARGS{'Comments'}, + Signature => $ARGS{'Signature'}, + EmailAddress => $ARGS{'EmailAddress'}, + FreeformContactInfo => $ARGS{'FreeformContactInfo'}, + Organization => $ARGS{'Organization'}, + RealName => $ARGS{'RealName'}, + NickName => $ARGS{'NickName'}, + Lang => $ARGS{'Lang'}, + EmailEncoding => $ARGS{'EmailEncoding'}, + WebEncoding => $ARGS{'WebEncoding'}, + ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, + ContactInfoSystem => $ARGS{'ContactInfoSystem'}, + Gecos => $ARGS{'Gecos'}, + ExternalAuthId => $ARGS{'ExternalAuthId'}, + AuthSystem => $ARGS{'AuthSystem'}, + HomePhone => $ARGS{'HomePhone'}, + WorkPhone => $ARGS{'WorkPhone'}, + MobilePhone => $ARGS{'MobilePhone'}, + PagerPhone => $ARGS{'PagerPhone'}, + Address1 => $ARGS{'Address1'}, + Address2 => $ARGS{'Address2'}, + City => $ARGS{'City'}, + State => $ARGS{'State'}, + Zip => $ARGS{'Zip'}, + Country => $ARGS{'Country'}, + Privileged => $ARGS{'Privileged'}, + Disabled => ($ARGS{'Enabled'} ? 0 : 1) + ); + if ($val) { push @results, $msg; } else { push @results, loc('User could not be created: [_1]', $msg); - } - - # set the id, so the the menu will have the right info - $id = $UserObj->Id; + } } else { $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); $val = $UserObj->Id(); @@ -283,14 +299,13 @@ else { if ($val) { $title = loc("Modify the user [_1]", $UserObj->Name); - } + } # If the create failed else { $title = loc("Create a new user"); $Create = 1; - } - + } } @@ -298,49 +313,55 @@ else { # If we have a user to modify, lets try. if ($UserObj->Id && $id ne 'new') { - + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo Organization RealName NickName Lang EmailEncoding WebEncoding ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 - Address2 City State Zip Country + Address2 City State Zip Country ); - + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); -# {{{ Deal with special fields: Privileged, Enabled and Password -if ( ($SetPrivileged) and ( $Privileged != $UserObj->Privileged) ) { -my ($code, $msg) = $UserObj->SetPrivileged($Privileged); - push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); -} + # {{{ Deal with special fields: Privileged, Enabled + if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) { + my ($code, $msg) = $UserObj->SetPrivileged($Privileged); + push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); + } -#we're asking about enabled on the web page but really care about disabled. -if ($Enabled == 1) { - $Disabled = 0; -} -else { - $Disabled = 1; -} -if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { - my ($code, $msg) = $UserObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); -} + #we're asking about enabled on the web page but really care about disabled. + $Disabled = $Enabled ? 0 : 1; + + if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { + my ($code, $msg) = $UserObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } -#TODO: make this report errors properly -if ((defined $Pass1) and ($Pass1 ne '') and ($Pass1 eq $Pass2) and (!$UserObj->IsPassword($Pass1))) { - my ($code, $msg); - ($code, $msg) = $UserObj->SetPassword($Pass1); - push @results, loc('Password: [_1]', loc_fuzzy($msg)); -} elsif ( $Pass1 && ($Pass1 ne $Pass2)) { - push @results, loc("Passwords do not match."); + # }}} } -# }}} +if ( $UserObj->Id ) { + my $password_not_set; + # Deal with Password field + if ( !$Pass1 and !$Pass2 ) { + $password_not_set = 1; + } elsif ( $Pass1 ne $Pass2 ) { + $password_not_set = 1; + push @results, loc("Passwords do not match."); + } elsif ( $Pass1 eq $Pass2 and !$UserObj->IsPassword($Pass1) ) { + my ($code, $msg) = $UserObj->SetPassword($Pass1); + push @results, loc_fuzzy($msg); + $password_not_set = 1 unless $code; + } + if ($id eq 'new' and $password_not_set) { + push @results, loc("A password was not set, so user won't be able to login."); + } } @@ -354,6 +375,11 @@ if ($UserObj->Privileged()) { } # }}} + +# set the id, so the the menu will have the right info, this needs to +# be done here to avoid creating and then modifying a user +$id = $UserObj->Id; + </%INIT> diff --git a/rt/html/Admin/Users/index.html b/rt/html/Admin/Users/index.html index f4cf2f0fc..1bbe867f7 100644 --- a/rt/html/Admin/Users/index.html +++ b/rt/html/Admin/Users/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Select a user') &> <& /Admin/Elements/UserTabs, current_tab => 'Admin/Users/', current_subtab => 'Admin/Users/', Title => loc('Select a user') &> - - - -<%$caption%>:<BR> -<UL> +<h1><%$caption%></h1> +<p><&|/l&>Select a user</&>:</p> +<ul> %if ($users->Count == 0) { -<LI> <i><&|/l&>No users matching search criteria found.</&></i> +<li><i><&|/l&>No users matching search criteria found.</&></i></li> % } +%my @ids; %while ( $user = $users->Next) { +% push @ids, $user->Id; <LI><A HREF="Modify.html?id=<%$user->id%>"><%$user->Name || loc('(no name listed)')%></a></LI> %} - </UL> +%if (my $ids = join(',', @ids)) { +<em>(<a href="<%$RT::WebPath%>/Download/Tabular/User/<% $ids %>/Users.tsv"><&|/l&>Download as a tab-delimited file</&></a>)</em><br> +%} + <br><br> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Users/index.html"> <&|/l&>Find people whose</&> <& /Elements/SelectUsers &><BR> -<input type="checkbox" name="FindDisabledUsers"> <&|/l&>Include disabled users in search.</&> +<input type="checkbox" name="FindDisabledUsers" value="1"> <&|/l&>Include disabled users in search.</&> <BR> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> @@ -78,19 +81,26 @@ if ($FindDisabledUsers) { $users->{'find_disabled_rows'} = 1; } -unless (defined $UserString) { - $users->LimitToPrivileged(); - $caption = loc("Privileged users"); -} -else { +if (length $UserString) { $caption = loc("Users matching search criteria"); - - if ($UserString) { - $users->Limit( FIELD => $UserField, - OPERATOR => $UserOp, - VALUE => $UserString); - + if ($UserField =~ /^CustomField-(\d+)/) { + $users->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } + else { + $users->Limit( + FIELD => $UserField, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } } +else { + $caption = loc("Privileged users"); + $users->LimitToPrivileged; } </%INIT> <%ARGS> diff --git a/rt/html/Admin/autohandler b/rt/html/Admin/autohandler new file mode 100644 index 000000000..def61010a --- /dev/null +++ b/rt/html/Admin/autohandler @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# 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 }}} +<%init> +$m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight( + Right => 'ShowConfigTab', + Object => $RT::System, +); +</%init>
\ No newline at end of file diff --git a/rt/html/Admin/index.html b/rt/html/Admin/index.html index 5aec88b9d..01ba24d2d 100644 --- a/rt/html/Admin/index.html +++ b/rt/html/Admin/index.html @@ -1,11 +1,11 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices), %# %# %# LICENSE: @@ -31,7 +31,7 @@ %# 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.) +%# 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 @@ -42,21 +42,58 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('RT Administration') &> <& /Admin/Elements/Tabs, Title => loc('RT Administration') &> <ul> -<li><font size="+2"><a href="Users/"><&|/l&>Users</&></a></font><br> -<&|/l&>Manage users and passwords</&> -</li> -<li><font size="+2"><a href="Groups/"><&|/l&>Groups</&></a></font><br> -<&|/l&>Manage groups and group membership</&> -</li> -<li><font size="+2"><a href="Queues/"><&|/l&>Queues</&></a></font><br> -<&|/l&>Manage queues and queue-specific properties</&> -</li> -<li><font size="+2"><a href="Global/"><&|/l&>Global</&></a></font><br> -<&|/l&>Manage properties and configuration which apply to all queues</&> +% foreach my $key (sort keys %$tabs) { +<li><font size="+2"><a href="<%$RT::WebPath%>/<%$tabs->{$key}->{'path'}|n %>"><%$tabs->{$key} ->{'title'}%></a></font><br> +<%$tabs->{$key}->{description}%> </li> +%} </ul> +<%init> + + + +my $tabs = { + A => { + title => loc('Users'), + path => 'Admin/Users/index.html', + description => loc('Manage users and passwords'), + }, + B => { + title => loc('Groups'), + path => 'Admin/Groups/index.html', + description => loc('Manage groups and group membership'), + }, + C => { + title => loc('Queues'), + path => 'Admin/Queues/index.html', + description => loc('Manage queues and queue-specific properties'), + }, + D => { + 'title' => loc('Custom Fields'), + description => loc('Manage custom fields and custom field values'), + path => 'Admin/CustomFields/index.html', + }, + E => { + 'title' => loc('Global'), + path => 'Admin/Global/index.html', + description => + loc('Manage properties and configuration which apply to all queues'), + }, + F => { + 'title' => loc('Tools'), + path => 'Admin/Tools/index.html', + description => loc('Use other RT administrative tools') + }, +}; + + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + + + +</%init> |