From b4b0c7e72d7eaee2fbfc7022022c9698323203dd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 31 Dec 2009 13:16:41 +0000 Subject: import rt 3.8.7 --- rt/share/html/Admin/CustomFields/GroupRights.html | 114 ++++++ rt/share/html/Admin/CustomFields/Modify.html | 249 ++++++++++++ rt/share/html/Admin/CustomFields/Objects.html | 153 ++++++++ rt/share/html/Admin/CustomFields/UserRights.html | 110 ++++++ rt/share/html/Admin/CustomFields/index.html | 108 +++++ rt/share/html/Admin/Elements/AddCustomFieldValue | 86 ++++ rt/share/html/Admin/Elements/ConfigureMyRT | 82 ++++ rt/share/html/Admin/Elements/CreateUserCalled | 50 +++ rt/share/html/Admin/Elements/CustomFieldTabs | 118 ++++++ rt/share/html/Admin/Elements/EditCustomField | 159 ++++++++ rt/share/html/Admin/Elements/EditCustomFieldValues | 104 +++++ .../Admin/Elements/EditCustomFieldValuesSource | 82 ++++ rt/share/html/Admin/Elements/EditCustomFields | 205 ++++++++++ rt/share/html/Admin/Elements/EditQueueWatchers | 78 ++++ rt/share/html/Admin/Elements/EditScrip | 197 ++++++++++ rt/share/html/Admin/Elements/EditScrips | 124 ++++++ rt/share/html/Admin/Elements/EditTemplates | 127 ++++++ rt/share/html/Admin/Elements/EditUserComments | 56 +++ rt/share/html/Admin/Elements/GlobalCustomFieldTabs | 105 +++++ rt/share/html/Admin/Elements/GroupTabs | 102 +++++ rt/share/html/Admin/Elements/Header | 52 +++ .../html/Admin/Elements/ListGlobalCustomFields | 61 +++ rt/share/html/Admin/Elements/ListGlobalScrips | 71 ++++ rt/share/html/Admin/Elements/ModifyTemplate | 84 ++++ rt/share/html/Admin/Elements/ObjectCustomFields | 111 ++++++ rt/share/html/Admin/Elements/PickCustomFields | 98 +++++ rt/share/html/Admin/Elements/PickObjects | 81 ++++ rt/share/html/Admin/Elements/QueueRightsForUser | 64 +++ rt/share/html/Admin/Elements/QueueTabs | 123 ++++++ rt/share/html/Admin/Elements/SelectCustomField | 71 ++++ .../Admin/Elements/SelectCustomFieldLookupType | 60 +++ rt/share/html/Admin/Elements/SelectCustomFieldType | 60 +++ rt/share/html/Admin/Elements/SelectGroups | 62 +++ rt/share/html/Admin/Elements/SelectModifyGroup | 57 +++ rt/share/html/Admin/Elements/SelectModifyQueue | 57 +++ rt/share/html/Admin/Elements/SelectModifyUser | 73 ++++ rt/share/html/Admin/Elements/SelectNewGroupMembers | 108 +++++ rt/share/html/Admin/Elements/SelectRights | 121 ++++++ rt/share/html/Admin/Elements/SelectScrip | 72 ++++ rt/share/html/Admin/Elements/SelectScripAction | 73 ++++ rt/share/html/Admin/Elements/SelectScripCondition | 72 ++++ .../html/Admin/Elements/SelectSingleOrMultiple | 67 ++++ rt/share/html/Admin/Elements/SelectStage | 75 ++++ rt/share/html/Admin/Elements/SelectTemplate | 87 ++++ rt/share/html/Admin/Elements/SelectUsers | 66 ++++ rt/share/html/Admin/Elements/ShowKeyInfo | 91 +++++ rt/share/html/Admin/Elements/SystemTabs | 102 +++++ rt/share/html/Admin/Elements/Tabs | 95 +++++ rt/share/html/Admin/Elements/ToolTabs | 82 ++++ rt/share/html/Admin/Elements/UserTabs | 116 ++++++ .../html/Admin/Global/CustomFields/Groups.html | 58 +++ .../Admin/Global/CustomFields/Queue-Tickets.html | 58 +++ .../Global/CustomFields/Queue-Transactions.html | 58 +++ .../html/Admin/Global/CustomFields/Queues.html | 58 +++ rt/share/html/Admin/Global/CustomFields/Users.html | 58 +++ rt/share/html/Admin/Global/CustomFields/index.html | 99 +++++ rt/share/html/Admin/Global/GroupRights.html | 123 ++++++ rt/share/html/Admin/Global/MyRT.html | 112 ++++++ rt/share/html/Admin/Global/Scrip.html | 86 ++++ rt/share/html/Admin/Global/Scrips.html | 77 ++++ rt/share/html/Admin/Global/Template.html | 123 ++++++ rt/share/html/Admin/Global/Templates.html | 77 ++++ rt/share/html/Admin/Global/UserRights.html | 99 +++++ rt/share/html/Admin/Global/index.html | 86 ++++ rt/share/html/Admin/Groups/CustomFields.html | 48 +++ rt/share/html/Admin/Groups/GroupRights.html | 119 ++++++ rt/share/html/Admin/Groups/History.html | 68 ++++ rt/share/html/Admin/Groups/Members.html | 159 ++++++++ rt/share/html/Admin/Groups/Modify.html | 178 +++++++++ rt/share/html/Admin/Groups/UserRights.html | 112 ++++++ rt/share/html/Admin/Groups/index.html | 129 ++++++ rt/share/html/Admin/Queues/CustomField.html | 87 ++++ rt/share/html/Admin/Queues/CustomFields.html | 72 ++++ rt/share/html/Admin/Queues/GroupRights.html | 134 +++++++ rt/share/html/Admin/Queues/History.html | 68 ++++ rt/share/html/Admin/Queues/Modify.html | 214 ++++++++++ rt/share/html/Admin/Queues/People.html | 215 ++++++++++ rt/share/html/Admin/Queues/Scrip.html | 99 +++++ rt/share/html/Admin/Queues/Scrips.html | 87 ++++ rt/share/html/Admin/Queues/Template.html | 132 +++++++ rt/share/html/Admin/Queues/Templates.html | 81 ++++ rt/share/html/Admin/Queues/UserRights.html | 112 ++++++ rt/share/html/Admin/Queues/index.html | 126 ++++++ rt/share/html/Admin/Tools/Configuration.html | 170 ++++++++ rt/share/html/Admin/Tools/Shredder/Dumps/dhandler | 68 ++++ .../Admin/Tools/Shredder/Elements/DumpFileLink | 61 +++ .../Admin/Tools/Shredder/Elements/Error/NoRights | 55 +++ .../Admin/Tools/Shredder/Elements/Error/NoStorage | 59 +++ .../Tools/Shredder/Elements/Object/RT--Attachment | 53 +++ .../Tools/Shredder/Elements/Object/RT--Ticket | 53 +++ .../Admin/Tools/Shredder/Elements/Object/RT--User | 53 +++ .../Admin/Tools/Shredder/Elements/ObjectCheckBox | 66 ++++ .../Admin/Tools/Shredder/Elements/PluginArguments | 62 +++ .../html/Admin/Tools/Shredder/Elements/PluginHelp | 75 ++++ .../Admin/Tools/Shredder/Elements/SelectObjects | 67 ++++ .../Admin/Tools/Shredder/Elements/SelectPlugin | 73 ++++ rt/share/html/Admin/Tools/Shredder/autohandler | 60 +++ rt/share/html/Admin/Tools/Shredder/index.html | 186 +++++++++ rt/share/html/Admin/Tools/index.html | 55 +++ rt/share/html/Admin/Users/CustomFields.html | 71 ++++ rt/share/html/Admin/Users/GnuPG.html | 112 ++++++ rt/share/html/Admin/Users/History.html | 68 ++++ rt/share/html/Admin/Users/Memberships.html | 143 +++++++ rt/share/html/Admin/Users/Modify.html | 437 +++++++++++++++++++++ rt/share/html/Admin/Users/MyRT.html | 134 +++++++ rt/share/html/Admin/Users/index.html | 135 +++++++ rt/share/html/Admin/autohandler | 55 +++ rt/share/html/Admin/index.html | 95 +++++ 108 files changed, 10699 insertions(+) create mode 100644 rt/share/html/Admin/CustomFields/GroupRights.html create mode 100644 rt/share/html/Admin/CustomFields/Modify.html create mode 100644 rt/share/html/Admin/CustomFields/Objects.html create mode 100644 rt/share/html/Admin/CustomFields/UserRights.html create mode 100644 rt/share/html/Admin/CustomFields/index.html create mode 100755 rt/share/html/Admin/Elements/AddCustomFieldValue create mode 100644 rt/share/html/Admin/Elements/ConfigureMyRT create mode 100755 rt/share/html/Admin/Elements/CreateUserCalled create mode 100644 rt/share/html/Admin/Elements/CustomFieldTabs create mode 100755 rt/share/html/Admin/Elements/EditCustomField create mode 100755 rt/share/html/Admin/Elements/EditCustomFieldValues create mode 100644 rt/share/html/Admin/Elements/EditCustomFieldValuesSource create mode 100755 rt/share/html/Admin/Elements/EditCustomFields create mode 100755 rt/share/html/Admin/Elements/EditQueueWatchers create mode 100755 rt/share/html/Admin/Elements/EditScrip create mode 100755 rt/share/html/Admin/Elements/EditScrips create mode 100755 rt/share/html/Admin/Elements/EditTemplates create mode 100755 rt/share/html/Admin/Elements/EditUserComments create mode 100755 rt/share/html/Admin/Elements/GlobalCustomFieldTabs create mode 100755 rt/share/html/Admin/Elements/GroupTabs create mode 100755 rt/share/html/Admin/Elements/Header create mode 100755 rt/share/html/Admin/Elements/ListGlobalCustomFields create mode 100755 rt/share/html/Admin/Elements/ListGlobalScrips create mode 100755 rt/share/html/Admin/Elements/ModifyTemplate create mode 100644 rt/share/html/Admin/Elements/ObjectCustomFields create mode 100644 rt/share/html/Admin/Elements/PickCustomFields create mode 100644 rt/share/html/Admin/Elements/PickObjects create mode 100755 rt/share/html/Admin/Elements/QueueRightsForUser create mode 100755 rt/share/html/Admin/Elements/QueueTabs create mode 100644 rt/share/html/Admin/Elements/SelectCustomField create mode 100644 rt/share/html/Admin/Elements/SelectCustomFieldLookupType create mode 100755 rt/share/html/Admin/Elements/SelectCustomFieldType create mode 100755 rt/share/html/Admin/Elements/SelectGroups create mode 100755 rt/share/html/Admin/Elements/SelectModifyGroup create mode 100755 rt/share/html/Admin/Elements/SelectModifyQueue create mode 100755 rt/share/html/Admin/Elements/SelectModifyUser create mode 100755 rt/share/html/Admin/Elements/SelectNewGroupMembers create mode 100755 rt/share/html/Admin/Elements/SelectRights create mode 100755 rt/share/html/Admin/Elements/SelectScrip create mode 100755 rt/share/html/Admin/Elements/SelectScripAction create mode 100755 rt/share/html/Admin/Elements/SelectScripCondition create mode 100755 rt/share/html/Admin/Elements/SelectSingleOrMultiple create mode 100644 rt/share/html/Admin/Elements/SelectStage create mode 100755 rt/share/html/Admin/Elements/SelectTemplate create mode 100755 rt/share/html/Admin/Elements/SelectUsers create mode 100644 rt/share/html/Admin/Elements/ShowKeyInfo create mode 100755 rt/share/html/Admin/Elements/SystemTabs create mode 100755 rt/share/html/Admin/Elements/Tabs create mode 100755 rt/share/html/Admin/Elements/ToolTabs create mode 100755 rt/share/html/Admin/Elements/UserTabs create mode 100644 rt/share/html/Admin/Global/CustomFields/Groups.html create mode 100755 rt/share/html/Admin/Global/CustomFields/Queue-Tickets.html create mode 100755 rt/share/html/Admin/Global/CustomFields/Queue-Transactions.html create mode 100644 rt/share/html/Admin/Global/CustomFields/Queues.html create mode 100644 rt/share/html/Admin/Global/CustomFields/Users.html create mode 100644 rt/share/html/Admin/Global/CustomFields/index.html create mode 100755 rt/share/html/Admin/Global/GroupRights.html create mode 100644 rt/share/html/Admin/Global/MyRT.html create mode 100755 rt/share/html/Admin/Global/Scrip.html create mode 100755 rt/share/html/Admin/Global/Scrips.html create mode 100755 rt/share/html/Admin/Global/Template.html create mode 100755 rt/share/html/Admin/Global/Templates.html create mode 100755 rt/share/html/Admin/Global/UserRights.html create mode 100755 rt/share/html/Admin/Global/index.html create mode 100644 rt/share/html/Admin/Groups/CustomFields.html create mode 100755 rt/share/html/Admin/Groups/GroupRights.html create mode 100644 rt/share/html/Admin/Groups/History.html create mode 100755 rt/share/html/Admin/Groups/Members.html create mode 100755 rt/share/html/Admin/Groups/Modify.html create mode 100755 rt/share/html/Admin/Groups/UserRights.html create mode 100755 rt/share/html/Admin/Groups/index.html create mode 100755 rt/share/html/Admin/Queues/CustomField.html create mode 100755 rt/share/html/Admin/Queues/CustomFields.html create mode 100755 rt/share/html/Admin/Queues/GroupRights.html create mode 100644 rt/share/html/Admin/Queues/History.html create mode 100755 rt/share/html/Admin/Queues/Modify.html create mode 100755 rt/share/html/Admin/Queues/People.html create mode 100755 rt/share/html/Admin/Queues/Scrip.html create mode 100755 rt/share/html/Admin/Queues/Scrips.html create mode 100755 rt/share/html/Admin/Queues/Template.html create mode 100755 rt/share/html/Admin/Queues/Templates.html create mode 100755 rt/share/html/Admin/Queues/UserRights.html create mode 100755 rt/share/html/Admin/Queues/index.html create mode 100644 rt/share/html/Admin/Tools/Configuration.html create mode 100644 rt/share/html/Admin/Tools/Shredder/Dumps/dhandler create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/DumpFileLink create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/Error/NoRights create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/Error/NoStorage create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--User create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/PluginArguments create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/PluginHelp create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/SelectObjects create mode 100644 rt/share/html/Admin/Tools/Shredder/Elements/SelectPlugin create mode 100644 rt/share/html/Admin/Tools/Shredder/autohandler create mode 100644 rt/share/html/Admin/Tools/Shredder/index.html create mode 100644 rt/share/html/Admin/Tools/index.html create mode 100644 rt/share/html/Admin/Users/CustomFields.html create mode 100644 rt/share/html/Admin/Users/GnuPG.html create mode 100644 rt/share/html/Admin/Users/History.html create mode 100644 rt/share/html/Admin/Users/Memberships.html create mode 100755 rt/share/html/Admin/Users/Modify.html create mode 100644 rt/share/html/Admin/Users/MyRT.html create mode 100755 rt/share/html/Admin/Users/index.html create mode 100644 rt/share/html/Admin/autohandler create mode 100755 rt/share/html/Admin/index.html (limited to 'rt/share/html/Admin') diff --git a/rt/share/html/Admin/CustomFields/GroupRights.html b/rt/share/html/Admin/CustomFields/GroupRights.html new file mode 100644 index 000000000..4171f041e --- /dev/null +++ b/rt/share/html/Admin/CustomFields/GroupRights.html @@ -0,0 +1,114 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/GroupRights.html?id=".$id, + Title => $title +&> +<& /Elements/ListActions, actions => \@results &> + +
+ + + +

<&|/l&>System groups

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

<&|/l&>User defined groups

+ +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
+ <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> +
+ + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
+ +<%INIT> + +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 @results = ProcessACLChanges( \%ARGS ); + +my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name); + + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/CustomFields/Modify.html b/rt/share/html/Admin/CustomFields/Modify.html new file mode 100644 index 000000000..f75607a8d --- /dev/null +++ b/rt/share/html/Admin/CustomFields/Modify.html @@ -0,0 +1,249 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $CustomFieldObj->Id , + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + +
+ + + + + + + + + + + + + +% if ( $CustomFieldObj->Id and $CustomFieldObj->IsSelectionType and RT->Config->Get('CustomFieldValuesSources') and ( scalar(@{RT->Config->Get('CustomFieldValuesSources')}) > 0 ) ) { + +% } + + + + + + + + + + + +% if ( $CustomFieldObj->Id && $CustomFieldObj->IsSelectionType && !$CustomFieldObj->IsExternalValues ) { + +% } + + + +
<&|/l&>Name
<&|/l&>Description
<&|/l&>Type<& /Admin/Elements/SelectCustomFieldType, + Name => "TypeComposite", + Default => $CustomFieldObj->TypeComposite, &> +
<&|/l&>Field values source: +<& /Admin/Elements/EditCustomFieldValuesSource, CustomField => $CustomFieldObj &> +
<&|/l&>Applies to<& /Admin/Elements/SelectCustomFieldLookupType, + Name => "LookupType", + Default => $CustomFieldObj->LookupType, &> +
<&|/l&>Validation<& /Widgets/ComboBox, + Name => 'Pattern', + Default => $CustomFieldObj->Pattern, + Size => 20, + Values => \@CFvalidations, +&>
<&|/l&>Link values to + +
+<&|/l&>RT can make this custom field's values into hyperlinks to another service. +<&|/l&>Fill in this field with a URL. +<&|/l&>RT will replace __id__ and __CustomField__ with the record id and custom field value, respectively +
<&|/l&>Include page + +
+<&|/l&>RT can include content from another web service when showing this custom field. +<&|/l&>Fill in this field with a URL. +<&|/l&>RT will replace __id__ and __CustomField__ with the record id and custom field value, respectively +<&|/l&>Some browsers may only load content from the same domain as your RT server. +
<&|/l&>Categories are based on +<& /Admin/Elements/SelectCustomField, + Name => "BasedOn", + LookupType => $CustomFieldObj->LookupType, + Default => $CustomFieldObj->BasedOnObj, + Not => $CustomFieldObj->id, +&> +
  + + /> +<&|/l&>Enabled (Unchecking this box disables this custom field) +
+ +% if ( $CustomFieldObj->Id && $CustomFieldObj->IsSelectionType && !$CustomFieldObj->IsExternalValues ) { +

<&|/l&>Values

+
+<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +
+% } + +<& /Elements/Submit, Name => 'Update', Label => $id eq 'new'? loc('Create'): loc('Save Changes') &> + +
+<%INIT> +my ($title, @results, $Disabled); + +my $CustomFieldObj = RT::CustomField->new( $session{'CurrentUser'} ); +my $current_tab = 'Admin/CustomFields/Modify.html'; + +unless ( $id ) { + $title = loc("Create a CustomField"); + $id = 'new'; + $current_tab .= '?Create=1'; +} +else { + if ( $id eq 'new' ) { + my ( $val, $msg ) = $CustomFieldObj->Create( + Name => $Name, + TypeComposite => $TypeComposite, + LookupType => $LookupType, + Description => $Description, + Pattern => $Pattern, + LinkValueTo => $LinkValueTo, + IncludeContentForValue => $IncludeContentForValue, + BasedOn => $BasedOn, + ); + $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 ); + } + $current_tab .= "?id=$id"; +} + +if ( $ARGS{'Update'} && $id ne 'new' ) { + + #we're asking about enabled on the web page but really care about disabled. + $ARGS{'Disabled'} = $Disabled = $Enabled? 0 : 1; + + my @attribs = qw(Disabled Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue); + push @results, UpdateRecordObject( + AttributesRef => \@attribs, + Object => $CustomFieldObj, + ARGSRef => \%ARGS + ); + $CustomFieldObj->SetValuesClass( $ValuesClass ); + + $CustomFieldObj->SetBasedOn( $BasedOn ); + + 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+)$/o; + 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 Category) { + my $param = join("-", $paramtag, $value->Id, $attr); + next unless exists $ARGS{$param}; + next if ($value->$attr()||'') eq ($ARGS{$param}||''); + + my $mutator = "Set$attr"; + my ($id, $msg) = $value->$mutator( $ARGS{$param} ); + push (@results, $msg); + } + } + + # Add any new values + if ( defined $ARGS{ $paramtag ."-new-Name" } && length $ARGS{ $paramtag ."-new-Name" } ) { + my ($id, $msg) = $CustomFieldObj->AddValue( + map { $_ => $ARGS{ $paramtag ."-new-$_" } } + qw( Name Description SortOrder Category ) + ); + push (@results, $msg); + } +} + +$id = $CustomFieldObj->id if $CustomFieldObj->id; + +my $EnabledChecked = qq[checked="checked"]; +$EnabledChecked = '' if $CustomFieldObj->Disabled; + +my @CFvalidations = ( + '(?#Mandatory).', + '(?#Digits)^[\d.]+$', + '(?#Year)^[12]\d{3}$', +); + +$m->callback(CallbackName => 'ValidationPatterns', Values => \@CFvalidations); + + +<%ARGS> +$id => undef +$TypeComposite => undef +$LookupType => undef +$MaxValues => undef +$SortOrder => undef +$Description => undef +$Pattern => undef +$Name => undef +$SetEnabled => undef +$Enabled => 0 +$ValuesClass => 'RT::CustomFieldValues' +$LinkValueTo => undef +$IncludeContentForValue => undef +$BasedOn => undef + diff --git a/rt/share/html/Admin/CustomFields/Objects.html b/rt/share/html/Admin/CustomFields/Objects.html new file mode 100644 index 000000000..20d79b294 --- /dev/null +++ b/rt/share/html/Admin/CustomFields/Objects.html @@ -0,0 +1,153 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/Objects.html?id=".$id, + Title => $title + &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + +

<&|/l&>Selected objects

+<& /Admin/Elements/PickObjects, Objects => \@AssignedObjs, id => $id, Checked => 1 &> +

<&|/l&>Unselected objects

+<& /Admin/Elements/PickObjects, Objects => \@UnassignedObjs, id => $id &> + +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +
+ +<%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'}); + +# If CF is a Group CF, only display user-defined groups +if ($Class eq 'RT::Group') { + $Objects->LimitToUserDefinedGroups; +} + +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; +} + + +<%ARGS> +$id => undef +$FindDisabledObjects => 0 +$UpdateObjs => 0 + diff --git a/rt/share/html/Admin/CustomFields/UserRights.html b/rt/share/html/Admin/CustomFields/UserRights.html new file mode 100644 index 000000000..9efd9acdb --- /dev/null +++ b/rt/share/html/Admin/CustomFields/UserRights.html @@ -0,0 +1,110 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, id => $id, +current_tab => "Admin/CustomFields/UserRights.html?id=".$id, +Title => $title, &> +<& /Elements/ListActions, actions => \@results &> + +
+ + + + + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + + + + +% } +
<& /Elements/ShowUser, User => $UserObj &> + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $CustomFieldObj &> +
+ + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
+ +<%INIT> + +#Update the acls. +my @results = ProcessACLChanges( \%ARGS ); + +# {{{ 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); + +# }}} + + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/share/html/Admin/CustomFields/index.html b/rt/share/html/Admin/CustomFields/index.html new file mode 100644 index 000000000..139b8ebd6 --- /dev/null +++ b/rt/share/html/Admin/CustomFields/index.html @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Select a Custom Field') &> +<& /Admin/Elements/CustomFieldTabs, + current_tab => 'Admin/CustomFields/', + Title => loc('Select a Custom Field') &> + +% my @types; +% my $prev_lookup = ''; +% while (my $CustomFieldObj = $CustomFields->Next) { +% next unless $CustomFieldObj->CurrentUserHasRight('AdminCustomField'); +% my $lookup = $CustomFieldObj->FriendlyLookupType; +% if ($lookup ne $prev_lookup) { +% if ($prev_lookup) { + +% } +

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

+ +% } + +
+<&|/l&>Only show custom fields for: + +
+ /> +<&|/l&>Include disabled custom fields in listing. +
+ + +
+ +<%args> +$Type => '' +$ShowDisabled => 0 + +<%INIT> +$Type ||= $ARGS{'type'} || ''; +if ( !$Type && $ARGS{'type'} ) { + $Type ||= $ARGS{'type'}; + $RT::Logger->warning("'type' argument is deprecated use 'Type' instead"); +} + +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit; +$CustomFields->{'find_disabled_rows'} = 1 if $ShowDisabled; +$CustomFields->LimitToLookupType( $Type ) if $Type; +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); + diff --git a/rt/share/html/Admin/Elements/AddCustomFieldValue b/rt/share/html/Admin/Elements/AddCustomFieldValue new file mode 100755 index 000000000..9fe464a5d --- /dev/null +++ b/rt/share/html/Admin/Elements/AddCustomFieldValue @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +

<&|/l&>Add Value

+ + + + + + + +% if ( $CustomField->Type ne 'Combobox' ) { + +% } + + +% my $paramtag = "CustomField-". $CustomField->Id ."-Value-new"; + + + + +% if ( $CustomField->Type ne 'Combobox' ) { + +% } + + +
<&|/l&>Sort<&|/l&>Name<&|/l&>Description<&|/l&>Category
+% my $BasedOnObj = $CustomField->BasedOnObj; +% if ( $BasedOnObj and $BasedOnObj->id ) { +% my $Categories = $BasedOnObj->Values; + +% } +
+<%args> +$CustomField => undef + diff --git a/rt/share/html/Admin/Elements/ConfigureMyRT b/rt/share/html/Admin/Elements/ConfigureMyRT new file mode 100644 index 000000000..35c01bc52 --- /dev/null +++ b/rt/share/html/Admin/Elements/ConfigureMyRT @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%args> +$Action +$OnSave +$items +$panes +$current_portlets +$ReadOnly => 0 + +<%init> +my $portlets = $current_portlets; +my @panes; +for my $pane (@$panes) { + push @panes, $m->comp( + '/Widgets/SelectionBox:new', + Action => $Action, + Name => $pane, + Available => $items, + AutoSave => 1, + ReadOnly => $ReadOnly, + OnSubmit => sub { + my $sel = shift; + $portlets->{$pane} = [ + map { m/(\w+)-(.*)$/; + { type => $1, + name => $2 } } @{ $sel->{Current} } + ]; + $OnSave->( $portlets, $pane ); + }, + Selected => [ map { join( '-', @{$_}{qw/type name/} ) } + @{ $portlets->{$pane} } ] + ); +} + +return @panes; + diff --git a/rt/share/html/Admin/Elements/CreateUserCalled b/rt/share/html/Admin/Elements/CreateUserCalled new file mode 100755 index 000000000..78eb82c02 --- /dev/null +++ b/rt/share/html/Admin/Elements/CreateUserCalled @@ -0,0 +1,50 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+<&|/l&>New user called +
diff --git a/rt/share/html/Admin/Elements/CustomFieldTabs b/rt/share/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..30f5adf11 --- /dev/null +++ b/rt/share/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,118 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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|Group)(?:\Z|-)/i) { + $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'), + path => "Admin/CustomFields/", + }; + $tabs->{"B"} = { title => loc('Create'), + path => "Admin/CustomFields/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + +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 } + +<%ARGS> +$Title => undef +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef + diff --git a/rt/share/html/Admin/Elements/EditCustomField b/rt/share/html/Admin/Elements/EditCustomField new file mode 100755 index 000000000..368ea2d68 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomField @@ -0,0 +1,159 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@results &> + + +
+ + + + + + + + +
+<&|/l&>Name: + + +
+<&|/l&>Description: + + +
+<&|/l&>Type: + +<& /Admin/Elements/SelectCustomFieldType, Name => "Type", Default => $CustomFieldObj->Type &> +
+ + + /> <&|/l&>Enabled (Unchecking this box disables this custom field) +
+ +

+% if ($CustomFieldObj->Id and $CustomFieldObj->Type =~ /Select/) { +

<&|/l&>Values

+ +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> + +% } +<&/Elements/Submit, Label => loc('Create') &> +
+ + + +<%INIT> + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +my $EnabledChecked = 'checked="checked"'; +my (@results); + +if (! $CustomField ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} else { + + if ($CustomField eq 'new') { + my ($val, $msg) = $CustomFieldObj->Create(Queue => $Queue, + Name => $Name, + Type => $Type, + Description => $Description, + ); + + # if there is an error, then abort. But since at this point there's + # stuff already printed, clear it out. + # (This only works in conjunction with temporarily turning autoflush + # off in the files that use this component.) + unless ($val) { + $m->clear_buffer; + Abort(loc("Could not create CustomField: [_1]", $msg), SuppressHeader => 1); + } + push @results, $msg; + $CustomFieldObj->SetSortOrder($CustomFieldObj->id); + $title = loc('Created CustomField [_1]', $CustomFieldObj->Name()); + } else { + $CustomFieldObj->Load($CustomField) || Abort(loc('No CustomField'), SuppressHeader => 1); + $title = loc('Editing CustomField [_1]', $CustomFieldObj->Name()); + + my @aresults = ProcessCustomFieldUpdates ( + CustomFieldObj => $CustomFieldObj, + ARGSRef => \%ARGS ); + push @results, @aresults; + } + + +$id = $CustomFieldObj->id; + + #we're asking about enabled on the web page but really care about disabled. + my $Disabled = ($Enabled ? 0 : 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 =""; + } + +} + + + +<%ARGS> +$id => undef +$title => undef +$Queue => undef +$CustomField => undef +$Type => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValues b/rt/share/html/Admin/Elements/EditCustomFieldValues new file mode 100755 index 000000000..96610b2b5 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFieldValues @@ -0,0 +1,104 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% unless ( $values->Count ) { +

<&|/l&>(no values)

+% return; +% } + + + + + + + + +% if ($CustomField->Type ne 'Combobox') { + +% } + + +% while ( my $value = $values->Next ) { +% my $paramtag = "CustomField-". $CustomField->Id ."-Value-". $value->Id; + + + + + +% if ( $CustomField->Type ne 'Combobox' ) { + +% } + +% } + +
 <&|/l&>Sort<&|/l&>Name<&|/l&>Description<&|/l&>Category
+% if ( $Categories ) { +% my $selected = $value->Category; +% $selected = '' unless defined $selected; + +% } +
+<&|/l&>(Check box to delete) +<%init> + +my $values = $CustomField->ValuesObj(); + +my $BasedOnObj = $CustomField->BasedOnObj; +my $Categories; +if ($BasedOnObj and $BasedOnObj->Id) { + $Categories = $BasedOnObj->Values; +} + +<%args> +$CustomField => undef + diff --git a/rt/share/html/Admin/Elements/EditCustomFieldValuesSource b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource new file mode 100644 index 000000000..c4b41114d --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFieldValuesSource @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
+ +
+ +<%INIT> +return unless $CustomField->IsSelectionType; + +my @sources; +foreach my $class( 'RT::CustomFieldValues', RT->Config->Get('CustomFieldValuesSources') ) { + next unless $class; + + local $@; + eval "require $class"; + if( $@ ) { + $RT::Logger->crit("Couldn't load class '$class': $@"); + next; + } + + my %res = ( Class => $class ); + $res{'Description'} = $class->SourceDescription if $class->can('SourceDescription'); + $res{'Description'} ||= $class; + $res{'Description'} = 'Provide list of values below' if $class eq 'RT::CustomFieldValues'; + push @sources, \%res; +} + +return unless grep $_->{'Class'} ne 'RT::CustomFieldValues', @sources; + + +<%ARGS> +$CustomField => undef + diff --git a/rt/share/html/Admin/Elements/EditCustomFields b/rt/share/html/Admin/Elements/EditCustomFields new file mode 100755 index 000000000..89c6d0f65 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditCustomFields @@ -0,0 +1,205 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@results &> + +
+ + + + + +% if ($Object->Id) { +

<&|/l&>Global Custom Fields

+<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &> +% } +

<&|/l&>Selected Custom Fields

+<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &> +

<&|/l&>Unselected Custom Fields

+<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &> + +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +
+ + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +my @results; +my (@GlobalCFs, @UnassignedCFs); + +my $id = $Object->Id; +if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { + $m->out('

', loc('(No custom fields)'), '

'); + return; +} + +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); + +# Check sanity of SortOrders +my %SortOrders; +$SortOrders{ $_->SortOrder }++ + while ($_ = $ObjectCFs->Next); + +# If there are duplicates, run though and squash them +if (grep $_ > 1, values %SortOrders) { + my $i = 1; + while ( my $ObjectCF = $ObjectCFs->Next ) { + $ObjectCF->SetSortOrder( $i++ ); + } + $ObjectCFs->GotoFirstItem; +} + +# {{{ deal with moving sortorder of custom fields +if ($CustomField and $Move) { + my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); + $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); + + my $TargetObj; + my $target_order = $SourceObj->SortOrder + $Move; + while (my $ObjectCF = $ObjectCFs->Next) { + my $this_order = $ObjectCF->SortOrder; + + # if we have an exact match, finish the loop now + ($TargetObj = $ObjectCF, last) if $this_order == $target_order; + + # otherwise, we need to apropos toward the general direction + # ... first, check the sign is correct + next unless ($this_order - $SourceObj->SortOrder) * $Move > 0; + + # ... next, see if we already have a candidate + if ($TargetObj) { + # ... if yes, compare the delta and choose the smaller one + my $orig_delta = abs($TargetObj->SortOrder - $target_order); + my $this_delta = abs($this_order - $target_order); + next if $orig_delta < $this_delta; + } + + $TargetObj = $ObjectCF; + } + + if ($TargetObj) { + # swap their sort order + my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder); + $TargetObj->SetSortOrder($s); + $SourceObj->SetSortOrder($t); + # because order changed, we must redo search for subsequent uses + } + + $ObjectCFs->GotoFirstItem; +} +# }}} + +if ($id) { + $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); + $GlobalCFs->LimitToObjectId(0); + $GlobalCFs->LimitToLookupType($lookup); +} + +while (my $cf = $CustomFields->Next) { + my $cf_id = $cf->Id; + + if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { + push @GlobalCFs, $cf; + next; + } + + 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; + } + } + } + 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); + + +<%ARGS> +$title => undef +$Move => undef +$Source => undef +$CustomField => undef +$FindDisabledCustomFields => undef +$UpdateCFs => 0 +$Object +$ObjectType +$SubType => '' + diff --git a/rt/share/html/Admin/Elements/EditQueueWatchers b/rt/share/html/Admin/Elements/EditQueueWatchers new file mode 100755 index 000000000..56ffb0e0f --- /dev/null +++ b/rt/share/html/Admin/Elements/EditQueueWatchers @@ -0,0 +1,78 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%if ($Members->Count == 0 ) { +
    +
  • <&|/l&>none +% } else { + +<&|/l&>(Check box to delete)

    + +<%INIT> +my $Members = $Watchers->MembersObj; + + +<%ARGS> +$QueueObj => undef +$Watchers => undef + + + + diff --git a/rt/share/html/Admin/Elements/EditScrip b/rt/share/html/Admin/Elements/EditScrip new file mode 100755 index 000000000..29ec71cd7 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditScrip @@ -0,0 +1,197 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@actions &> + +
    + + + +<&| /Widgets/TitleBox, title => loc('Scrip Fields') &> + + + + + + + + + + + + +
    <&|/l&>Description: +Description || '' %>" /> +
    <&|/l&>Condition: +<& /Admin/Elements/SelectScripCondition, + Name => "Scrip-$id-ScripCondition", + Default => $ARGS{"Scrip-$id-ScripCondition"} || $scrip->ConditionObj->Id, +&>
    <&|/l&>Action: +<& /Admin/Elements/SelectScripAction, + Name => "Scrip-$id-ScripAction", + Default => $ARGS{"Scrip-$id-ScripAction"} || $scrip->ActionObj->Id, +&>
    <&|/l&>Template: +<& /Admin/Elements/SelectTemplate, + Name => "Scrip-$id-Template", + Default => $ARGS{"Scrip-$id-Template"} || $scrip->TemplateObj->Id, + Queue => $Queue, +&>
    <&|/l&>Stage: +<& /Admin/Elements/SelectStage, + Name => "Scrip-$id-Stage", + Default => $ARGS{"Scrip-$id-Stage"} || $scrip->Stage, +&>
    + + +<& /Elements/Submit, + Label => $SubmitLabel, + Reset => 1, +&>
    + +<&| /Widgets/TitleBox, title => loc('User Defined conditions and actions') &> + + + + + + + + + +
    +<&|/l&>(Use these fields when you choose 'User Defined' for a condition or action) +
    <&|/l&>Custom condition: +% my $code = $ARGS{"Scrip-$id-CustomIsApplicableCode"} || $scrip->CustomIsApplicableCode || ''; +% my $lines = @{[ $code =~ /\n/gs ]} + 3; +% $lines = $min_lines if $lines < $min_lines; + +
    <&|/l&>Custom action preparation code: +% $code = $ARGS{"Scrip-$id-CustomPrepareCode"} || $scrip->CustomPrepareCode || ''; +% $lines = @{[ $code =~ /\n/gs ]} + 3; +% $lines = $min_lines if $lines < $min_lines; + +
    <&|/l&>Custom action cleanup code: +% $code = $ARGS{"Scrip-$id-CustomCommitCode"} || $scrip->CustomCommitCode || ''; +% $lines = @{[ $code =~ /\n/gs ]} + 3; +% $lines = $min_lines if $lines < $min_lines; + +
    + + +<& /Elements/Submit, + Label => $SubmitLabel, + Reset => 1, +&> + +
    +<%init> + +my (@actions, $SubmitLabel); +my $scrip = RT::Scrip->new( $session{'CurrentUser'} ); + +if ( $id ) { + $scrip->Load( $id ); + unless ( $id = $scrip->id ) { + push @actions, loc("Couldn't load scrip #[_1]", $id); + } + $SubmitLabel = loc('Save Changes'); +} + +unless ( $id ) { + $id = 'new'; + $SubmitLabel = loc('Create'); +} + +my $min_lines = 10; + + + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 + + +<%METHOD Process> +<%ARGS> +$id => undef +$Queue => undef + +<%INIT> +return ($id) unless $id; + +my $scrip = RT::Scrip->new( $session{'CurrentUser'} ); +if ( $id eq 'new' ) { + return $scrip->Create( + Queue => $Queue, + ScripAction => $ARGS{"Scrip-new-ScripAction"}, + ScripCondition => $ARGS{"Scrip-new-ScripCondition"}, + Template => $ARGS{"Scrip-new-Template"}, + Description => $ARGS{"Scrip-new-Description"}, + CustomPrepareCode => $ARGS{"Scrip-new-CustomPrepareCode"}, + CustomCommitCode => $ARGS{"Scrip-new-CustomCommitCode"}, + CustomIsApplicableCode => $ARGS{"Scrip-new-CustomIsApplicableCode"}, + Stage => $ARGS{"Scrip-new-Stage"}, + ); +} +else { + $scrip->Load( $id ); + return (undef, loc("Couldn't load scrip #[_1]", $id)) + unless $scrip->id; + + my @attribs = qw(Queue ScripAction ScripCondition Template Stage + Description CustomPrepareCode CustomCommitCode CustomIsApplicableCode); + my @results = UpdateRecordObject( + AttributesRef => \@attribs, + AttributePrefix => 'Scrip-'.$scrip->Id, + Object => $scrip, + ARGSRef => \%ARGS + ); + return ($scrip->id, @results); +} + + diff --git a/rt/share/html/Admin/Elements/EditScrips b/rt/share/html/Admin/Elements/EditScrips new file mode 100755 index 000000000..df349e1b9 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditScrips @@ -0,0 +1,124 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@actions &> + +
    + + +

    <&|/l&>Current Scrips

    +<& /Elements/CollectionList, + OrderBy => 'Description', + Order => 'ASC', + Rows => 100, + %ARGS, + Format => $Format, + DisplayFormat => "__CheckBox.{DeleteScrip}__, $Format", + Collection => $Scrips, + AllowSorting => 1, + PassArguments => [ qw(Query Format Rows Page Order OrderBy id) ], +&> + +% if ( $Scrips->Count ) { +

    <&|/l&>(Check box to delete)

    +% } else { +

    <&|/l&>(No scrips)

    +% } +<& /Elements/Submit, + Caption => loc("Delete selected scrips"), + Label => loc("Delete") +&> +
    + +<%init> +my (@actions); + +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +if ( $id ) { + $QueueObj->Load( $id ); + unless ( $QueueObj->id ) { + push @actions, loc("Couldn't load queue #[_1]", $id) + } +} + +if ($QueueObj->id) { + $Scrips->LimitToQueue($id); +} +else { + $Scrips->LimitToGlobal(); +} + +# {{{ deal with modifying and deleting existing scrips +# we still support DeleteScrip-id format but array is preferred +foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) { + my $scrip = RT::Scrip->new($session{'CurrentUser'}); + $scrip->Load( $id ); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, loc("Scrip deleted"); + } + else { + push @actions, $msg; + } +} +# }}} + +my $dir_path = $m->request_comp->dir_path; +$Format ||= qq{'__id__/TITLE:#'} + .qq{,'__Description__/TITLE:Description'} + .q{,__Stage__, __Condition__, __Action__, __Template__}; + + + +<%ARGS> +$id => undef +$title => undef +$Format => undef +@DeleteScrip => () + diff --git a/rt/share/html/Admin/Elements/EditTemplates b/rt/share/html/Admin/Elements/EditTemplates new file mode 100755 index 000000000..0bd68c2c0 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditTemplates @@ -0,0 +1,127 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@actions &> + +
    + + +% unless ( $Templates->Count ) { +

    <&|/l&>(No templates)

    +% } else { + + +<& /Elements/CollectionList, + OrderBy => 'id', + Order => 'ASC', + %ARGS, + DisplayFormat => '__CheckBox.{DeleteTemplates}__,'. $Format, + Format => $Format, + Collection => $Templates, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy FindDisabledQueues)], +&> + +<&|/l&>(Check box to delete) +% } + +<& /Elements/Submit, Label => loc('Delete Template') &> +
    + +<%INIT> +my $dir_path = $m->request_comp->dir_path; +$Format ||= qq{'__id__/TITLE:#'} + .qq{,'__Name__/TITLE:Name'} + .qq{,'__Description__'}; + +my $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); +$QueueObj->Load( $id ) if $id; + +my $Templates = RT::Templates->new($session{'CurrentUser'}); +if ( $QueueObj->id ) { + $Templates->LimitToQueue( $id ); +} +else { + $Templates->LimitToGlobal; +} + +# Now let callbacks add their extra limits +$m->callback( %ARGS, Templates => $Templates ); +$Templates->RedoSearch; + +# deal with deleting existing templates +my @actions; +# backwards compatibility, use DeleteTemplates array for this +foreach my $key (keys %ARGS) { + next unless $key =~ /^DeleteTemplate-(\d+)/; + push @DeleteTemplates, $1; +} + +foreach my $id( @DeleteTemplates ) { + my $TemplateObj = RT::Template->new( $session{'CurrentUser'} ); + $TemplateObj->Load( $id ); + unless ( $TemplateObj->id ) { + push @actions, loc("Couldn't load template #[_1]", $id); + next; + } + + my ($retval, $msg) = $TemplateObj->Delete; + if ( $retval ) { + push @actions, loc("Template #[_1] deleted", $id); + } + else { + push @actions, $msg; + } +} + +<%ARGS> +$id => 0 + +$Format => undef + +@DeleteTemplates => () + diff --git a/rt/share/html/Admin/Elements/EditUserComments b/rt/share/html/Admin/Elements/EditUserComments new file mode 100755 index 000000000..21bad8209 --- /dev/null +++ b/rt/share/html/Admin/Elements/EditUserComments @@ -0,0 +1,56 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, Title => "Comments about $name" &> +<&|/l&>These comments aren't generally visible to the user:
    + + + + +<%ARGS> +$UserObj => undef + diff --git a/rt/share/html/Admin/Elements/GlobalCustomFieldTabs b/rt/share/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..a53d7f24b --- /dev/null +++ b/rt/share/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,105 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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('Select custom fields for all users'), + path => 'Admin/Global/CustomFields/Users.html', + }, + + B => { + title => loc('Groups'), + text => loc('Select custom fields for all user groups'), + path => 'Admin/Global/CustomFields/Groups.html', + }, + + C => { + title => loc('Queues'), + text => loc('Select custom fields for all queues'), + path => 'Admin/Global/CustomFields/Queues.html', + }, + + F => { + title => loc('Tickets'), + text => loc('Select custom fields for tickets in all queues'), + path => 'Admin/Global/CustomFields/Queue-Tickets.html', + }, + + G => { + title => loc('Ticket Transactions'), + text => loc('Select custom fields for transactions on tickets in all queues'), + path => 'Admin/Global/CustomFields/Queue-Transactions.html', + }, + +}; + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + + + +<%ARGS> +$id => undef +$current_tab => '' +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Elements/GroupTabs b/rt/share/html/Admin/Elements/GroupTabs new file mode 100755 index 000000000..2b5bb6540 --- /dev/null +++ b/rt/share/html/Admin/Elements/GroupTabs @@ -0,0 +1,102 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Groups/', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ( $GroupObj and $GroupObj->id ) { +$tabs->{"this"} = { class => "currentnav", + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id, + title => $GroupObj->Name, + current_subtab => $current_subtab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id }, + + D => { title => loc('Members'), + path => "Admin/Groups/Members.html?id=" . $GroupObj->id }, + + F => { title => loc('Group Rights'), + 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 }, + } +} +} +$tabs->{"A"} = { title => loc('Select'), + path => "Admin/Groups/", }; +$tabs->{"B"} = { title => loc('Create'), + path => "Admin/Groups/Modify.html?Create=1", + separator => 1, }; + +# Now let callbacks add their extra tabs +$m->callback( %ARGS, tabs => $tabs ); +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/Groups/Modify.html?id=".$GroupObj->id if $GroupObj; + + +<%ARGS> +$GroupObj => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + + diff --git a/rt/share/html/Admin/Elements/Header b/rt/share/html/Admin/Elements/Header new file mode 100755 index 000000000..659c40b01 --- /dev/null +++ b/rt/share/html/Admin/Elements/Header @@ -0,0 +1,52 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, %ARGS &> + +<%ARGS> +$Title => undef + diff --git a/rt/share/html/Admin/Elements/ListGlobalCustomFields b/rt/share/html/Admin/Elements/ListGlobalCustomFields new file mode 100755 index 000000000..d3777217c --- /dev/null +++ b/rt/share/html/Admin/Elements/ListGlobalCustomFields @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $count = 0; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $count++; +<%$CustomFieldObj->id%>/<% loc($CustomFieldObj->Type) %>/<%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%> +
    +% } +% if (!$count) { +<&|/l&>(No custom fields) +% } + +<%init> +my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +$CustomFields->LimitToGlobal(); + diff --git a/rt/share/html/Admin/Elements/ListGlobalScrips b/rt/share/html/Admin/Elements/ListGlobalScrips new file mode 100755 index 000000000..e03224a2d --- /dev/null +++ b/rt/share/html/Admin/Elements/ListGlobalScrips @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% unless ( $Scrips->Count ) { +

    <&|/l&>(No scrips)

    +% } else { + +<& /Elements/CollectionList, + OrderBy => 'Description', + Order => 'ASC', + Rows => 0, + %ARGS, + Format => $Format, + Collection => $Scrips, + ShowHeader => 0, +&> + +% } + +<%init> +my $Format = q{'__id__/TITLE:#'} + .q{,'__AutoDescription__/TITLE:Condition, Action and Template'} + .q{__NEWLINE__,'','__Description__'}; + +my $Scrips = RT::Scrips->new( $session{'CurrentUser'} ); +$Scrips->LimitToGlobal; + diff --git a/rt/share/html/Admin/Elements/ModifyTemplate b/rt/share/html/Admin/Elements/ModifyTemplate new file mode 100755 index 000000000..a0057617b --- /dev/null +++ b/rt/share/html/Admin/Elements/ModifyTemplate @@ -0,0 +1,84 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + +
    +<&|/l&>Name: + +
    +
    +<&|/l&>Description: + +
    +
    +<&|/l&>Content:
    +
    + +
    + +<%INIT> + + + +<%ARGS> +$Name => undef +$Description => undef +$Content => undef + diff --git a/rt/share/html/Admin/Elements/ObjectCustomFields b/rt/share/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..d3fc28b8e --- /dev/null +++ b/rt/share/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,111 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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), SuppressHeader => 1); + + + +my $Type = $1; +my $Types = $Type.'s'; +my $ObjectTabs; +my $Object = $ObjectType->new($session{'CurrentUser'}); + + +my $QualifiedType; +my $FriendlySubTypes; +if (defined $SubType && $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), SuppressHeader => 1); + $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; + + +<%ARGS> +$id => undef +$ObjectType +$SubType => undef + diff --git a/rt/share/html/Admin/Elements/PickCustomFields b/rt/share/html/Admin/Elements/PickCustomFields new file mode 100644 index 000000000..b27227990 --- /dev/null +++ b/rt/share/html/Admin/Elements/PickCustomFields @@ -0,0 +1,98 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@CustomFields == 0) { +

    <&|/l&>(None)

    +% } else { + +% my $count; +% foreach my $CustomFieldObj (@CustomFields) { + +% if (!$ReadOnly) { + +% } + + +% # show 'move up' unless it's the first item +% if ($count++ and $Checked) { + + +% } +
    + +/> + + +% if ($CustomFieldObj->Name) { +<%$CustomFieldObj->Name%> +% } else { +(<&|/l&>no name) +% } +
    + <%$CustomFieldObj->Description%> +
    + <% $CustomFieldObj->FriendlyTypeComposite %> + + [<&|/l&>Move up] +% } else { + +% } + +% # show 'move down' unless it's the last item +% if ($count != @CustomFields and $Checked) { +% $m->print(' | ') if $count > 1; + [<&|/l&>Move down] +% } +
    +% } +<%ARGS> +@CustomFields +$id +$ReadOnly => 0 +$Checked => 0 +$SubType + diff --git a/rt/share/html/Admin/Elements/PickObjects b/rt/share/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..74e02c94f --- /dev/null +++ b/rt/share/html/Admin/Elements/PickObjects @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@Objects == 0) { +

    <&|/l&>(None)

    +% } else { + +% my $count; +% foreach my $Object (@Objects) { + +% my $id = "Object-".$Object->id."-CF-".$id; +% if (!$ReadOnly) { + +% } + + +% } +
    + +/> + + +
    +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 + diff --git a/rt/share/html/Admin/Elements/QueueRightsForUser b/rt/share/html/Admin/Elements/QueueRightsForUser new file mode 100755 index 000000000..60651ee97 --- /dev/null +++ b/rt/share/html/Admin/Elements/QueueRightsForUser @@ -0,0 +1,64 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +
      +%while(my $ACE = $ACL->Next) { + +
    • <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) + +%} +
    + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); + +<%ARGS> +$PrincipalId => undef +$QueueObj => undef + diff --git a/rt/share/html/Admin/Elements/QueueTabs b/rt/share/html/Admin/Elements/QueueTabs new file mode 100755 index 000000000..b4f2d1f27 --- /dev/null +++ b/rt/share/html/Admin/Elements/QueueTabs @@ -0,0 +1,123 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Queues/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> +my $tabs; +if ($id) { + $tabs->{'this'} = { + title => $QueueObj->Name, + path => "Admin/Queues/Modify.html?id=".$id, + current_subtab => $current_tab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Queues/Modify.html?id=".$id, + }, + D => { title => loc('Watchers'), + path => "Admin/Queues/People.html?id=".$id, + }, + + E => { title => loc('Scrips'), + path => "Admin/Queues/Scrips.html?id=".$id, + }, + F => { title => loc('Templates'), + path => "Admin/Queues/Templates.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'), + path => "Admin/Queues/GroupRights.html?id=".$id, + }, + I => { title => loc('User Rights'), + path => "Admin/Queues/UserRights.html?id=".$id, + }, + J => { title => loc('History'), + path => "Admin/Queues/History.html?id=" . $QueueObj->id + }, + } + }; +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) { + $tabs->{"A"} = { title => loc('Select'), + path => "Admin/Queues/", + }; + $tabs->{"B"} = { title => loc('Create'), + path => "Admin/Queues/Modify.html?Create=1", + separator => 1, }; +} + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); +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; + } +} + $current_tab = "Admin/Queues/Modify.html?id=".$id if $id; + + +<%ARGS> +$QueueObj => undef +$id => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Elements/SelectCustomField b/rt/share/html/Admin/Elements/SelectCustomField new file mode 100644 index 000000000..1eb1f63c4 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomField @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit; +$CustomFields->LimitToLookupType( $LookupType ) if $LookupType; +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); + +$Default = $Default->id || 0 if ref $Default; + +<%ARGS> +$None => 1 +$Name => 'BasedOn' +$Default => 0 +$LookupType => 'RT::Queue-RT::Ticket' +$OnlySelectionType => 1 +$Not => 0 + diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldLookupType b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..c4e7a56a4 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + + +<%ARGS> +$Default=> '' +$Name => 'LookupType' + diff --git a/rt/share/html/Admin/Elements/SelectCustomFieldType b/rt/share/html/Admin/Elements/SelectCustomFieldType new file mode 100755 index 000000000..a37b80020 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectCustomFieldType @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + + +<%ARGS> +$Default=>undef +$Name => 'TypeComposite' + diff --git a/rt/share/html/Admin/Elements/SelectGroups b/rt/share/html/Admin/Elements/SelectGroups new file mode 100755 index 000000000..b6250251c --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectGroups @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain); + + +<%ARGS> +$Name => 'groups' +$Domain => 'UserDefined'; + diff --git a/rt/share/html/Admin/Elements/SelectModifyGroup b/rt/share/html/Admin/Elements/SelectModifyGroup new file mode 100755 index 000000000..1bf4d22a7 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyGroup @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%while ( $Group = $Groups->Next) { +<%$Group->id%>: <%$Group->Name%>
    +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; + +<%ARGS> + diff --git a/rt/share/html/Admin/Elements/SelectModifyQueue b/rt/share/html/Admin/Elements/SelectModifyQueue new file mode 100755 index 000000000..f5ba69296 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyQueue @@ -0,0 +1,57 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%while ( $queue = $queues->Next) { +<%$queue->id%>: <%$queue->Name%>
    +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; + +<%ARGS> + diff --git a/rt/share/html/Admin/Elements/SelectModifyUser b/rt/share/html/Admin/Elements/SelectModifyUser new file mode 100755 index 000000000..32a60ba36 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectModifyUser @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +%while ( $user = $users->Next) { +<%$user->id%>: <& /Elements/ShowUser, User => $user &>
    +%} +<%INIT> +my ($user); +my $users = new RT::Users($session{'CurrentUser'}); +$users->Limit(FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=' ); + +if (defined $IdLike) { +$users->Limit(FIELD => 'Name', + VALUE => $IdLike, + OPERATOR => 'LIKE' ); +} +if (defined $EmailLike) { +$users->Limit(FIELD => 'EmailAddress', + VALUE => $EmailLike, + OPERATOR => 'LIKE'); + +} + +<%ARGS> +$IdLike => undef +$EmailLike => undef + diff --git a/rt/share/html/Admin/Elements/SelectNewGroupMembers b/rt/share/html/Admin/Elements/SelectNewGroupMembers new file mode 100755 index 000000000..1083b4359 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectNewGroupMembers @@ -0,0 +1,108 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ( $Show ne 'Groups' ) { +<&|/l&>Users +
    + +
    +% } + +% if ( $Show ne 'Users' ) { +<&|/l&>Groups +
    + +% } + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit( + FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=', + ENTRYAGGREGATOR => 'AND' +); +$users->Limit( + FIELD => 'id', + VALUE => $RT::Nobody->id, + OPERATOR => '!=', + ENTRYAGGREGATOR => 'AND' +); +$users->LimitToPrivileged(); + +my $groups = new RT::Groups($session{'CurrentUser'}); + +# self-recursive group membership considered harmful! +$groups->Limit(FIELD => 'id', VALUE => $Group->id, OPERATOR => '!=' ); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + + + +<%ARGS> +$Name => 'Users' +$Show => 'All' +$Group +$SkipUsers => {} +$SkipGroups => {} + diff --git a/rt/share/html/Admin/Elements/SelectRights b/rt/share/html/Admin/Elements/SelectRights new file mode 100755 index 000000000..4c1940acc --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectRights @@ -0,0 +1,121 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + + + + +
    +<%PERL> +my %current_rights; +my @pairs; +while ( my $ace = $ACLObj->Next ) { + my $right = $ace->RightName; + $current_rights{ $right } = 1; + push @pairs, [$right, loc($right)]; +} +@pairs = sort { $a->[1] cmp $b->[1] } @pairs; + +

    <&|/l&>Current rights

    +% unless ( @pairs ) { +<&|/l&>No rights granted.
    +% } else { +(<&|/l&>Check box to revoke right)
    +% foreach my $pair ( @pairs ) { + <% $pair->[1] %>
    +% } } +
    +

    <&|/l&>New rights

    + +
    +<%INIT> + my ($ACLDesc, $AppliesTo, %Rights); + + # if the principal id points to a user, we really want to point + # to their ACL equivalence group. The machinations we're going through + # lead me to start to suspect that we really want users and groups + # to just be the same table. or _maybe_ that we want an object db. + my $princ = RT::Principal->new($RT::SystemUser); + $princ->Load($PrincipalId); + if ($princ->PrincipalType eq 'User') { + my $group = RT::Group->new($RT::SystemUser); + $group->LoadACLEquivalenceGroup($princ); + $PrincipalId = $group->PrincipalId; + } + + + my $ACLObj = new RT::ACL($session{'CurrentUser'}); + my $ACE = new RT::ACE($session{'CurrentUser'}); + + + $ACLObj->LimitToObject( $Object); + $ACLObj->LimitToPrincipal( Id => $PrincipalId); + $ACLObj->OrderBy(FIELD=>'RightName'); + + if (ref($Object) && UNIVERSAL::can($Object, 'AvailableRights')) { + %Rights = %{$Object->AvailableRights}; + } + + else { + %Rights = ( loc('System Error') => loc("No rights found") ); + } + + $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; + + +<%ARGS> +$PrincipalType => undef +$PrincipalId => undef +$Object =>undef + diff --git a/rt/share/html/Admin/Elements/SelectScrip b/rt/share/html/Admin/Elements/SelectScrip new file mode 100755 index 000000000..b5f6e639d --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScrip @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'Scrip' + + diff --git a/rt/share/html/Admin/Elements/SelectScripAction b/rt/share/html/Admin/Elements/SelectScripAction new file mode 100755 index 000000000..f6d5bb23f --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScripAction @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; +$ScripActions->OrderBy(FIELD => 'Name'); + + + + +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + + diff --git a/rt/share/html/Admin/Elements/SelectScripCondition b/rt/share/html/Admin/Elements/SelectScripCondition new file mode 100755 index 000000000..34e700d9e --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectScripCondition @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; +$ScripConditions->OrderBy(FIELD => 'Name'); + + + +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + + diff --git a/rt/share/html/Admin/Elements/SelectSingleOrMultiple b/rt/share/html/Admin/Elements/SelectSingleOrMultiple new file mode 100755 index 000000000..07d224b50 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = qq[ selected="selected"]; +} +elsif ($Default == 0 ) { + $MultipleDefault = qq[ selected="selected"]; +} + + +<%ARGS> +$Name => 'Single' +$Default => 1 + diff --git a/rt/share/html/Admin/Elements/SelectStage b/rt/share/html/Admin/Elements/SelectStage new file mode 100644 index 000000000..3188d0ecc --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectStage @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +%while (my $Template = $PrimaryTemplates->Next) { + +%} +%while (my $Template = $OtherTemplates->Next) { + +%} + + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +$PrimaryTemplates->OrderBy(FIELD => 'Name'); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); +$OtherTemplates->OrderBy(FIELD => 'Name'); + + +<%ARGS> + +$Queue => undef +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + + diff --git a/rt/share/html/Admin/Elements/SelectUsers b/rt/share/html/Admin/Elements/SelectUsers new file mode 100755 index 000000000..6ae6a1c52 --- /dev/null +++ b/rt/share/html/Admin/Elements/SelectUsers @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + + +<%ARGS> +$Name => 'Users' + diff --git a/rt/share/html/Admin/Elements/ShowKeyInfo b/rt/share/html/Admin/Elements/ShowKeyInfo new file mode 100644 index 000000000..35d38a718 --- /dev/null +++ b/rt/share/html/Admin/Elements/ShowKeyInfo @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<&| /Widgets/TitleBox, title => $title &> +% if ( $res{'exit_code'} || !keys %{ $res{'info'} } ) { +<% loc('No keys for this address') %> +% } else { + + +% unless ( $Type eq 'private' ) { + +% } + + + + + + + +% foreach my $uinfo( @{ $res{'info'}{'User'} } ) { + + +% } + +
    <% loc('Trust') %>: <% loc( $res{'info'}{'Trust'} ) %>
    <% loc('Created') %>:<% $res{'info'}{'Created'}? $res{'info'}{'Created'}->AsString( Time => 0 ): loc('never') %>
    <% loc('Expire') %>:<% $res{'info'}{'Expire'}? $res{'info'}{'Expire'}->AsString( Time => 0 ): loc('never') %>
    <% loc('User (created - expire)') %>:<% $uinfo->{'String'} %>\ +(<% $uinfo->{'Created'}? $uinfo->{'Created'}->AsString( Time => 0 ): loc('never') %> - \ +<% $uinfo->{'Expire'}? $uinfo->{'Expire'}->AsString( Time => 0 ): loc('never') %>) +
    +% } + + +<%ARGS> +$EmailAddress +$Type => 'public' + +<%INIT> +require RT::Crypt::GnuPG; +my %res = RT::Crypt::GnuPG::GetKeyInfo( $EmailAddress, $Type ); + +my $title; +unless ( $Type eq 'private' ) { + $title = loc('GnuPG public key(s) for [_1]', $EmailAddress); +} else { + $title = loc('GnuPG private key(s) for [_1]', $EmailAddress); +} + + diff --git a/rt/share/html/Admin/Elements/SystemTabs b/rt/share/html/Admin/Elements/SystemTabs new file mode 100755 index 000000000..4a20dab58 --- /dev/null +++ b/rt/share/html/Admin/Elements/SystemTabs @@ -0,0 +1,102 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, subtabs => $tabs, + current_tab => 'Admin/Global/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { + + A => { title => loc('Scrips'), + path => 'Admin/Global/Scrips.html', + }, + B => { title => loc('Templates'), + path => 'Admin/Global/Templates.html', + }, + + F => { title => loc('Custom Fields'), + path => 'Admin/Global/CustomFields/index.html', + }, + + G => { title => loc('Group Rights'), + path => 'Admin/Global/GroupRights.html', + }, + H => { title => loc('User Rights'), + path => 'Admin/Global/UserRights.html', + }, + I => { title => loc('RT at a glance'), + path => 'Admin/Global/MyRT.html', + }, + +}; + +# Use current $tabs as $subtabs if there is no $subtabs for this tab +$subtabs = ($subtabs) ? $subtabs : $tabs; + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + + if ($current_tab) { + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + } + + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Elements/Tabs b/rt/share/html/Admin/Elements/Tabs new file mode 100755 index 000000000..f7b0ad7ef --- /dev/null +++ b/rt/share/html/Admin/Elements/Tabs @@ -0,0 +1,95 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Tabs, + tabs => $tabs, + current_toptab => 'Admin/', + current_tab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { A => { title => loc('Users'), + path => 'Admin/Users/', + }, + B => { title => loc('Groups'), + path => 'Admin/Groups/', + }, + C => { title => loc('Queues'), + path => 'Admin/Queues/', + }, + D => { 'title' => loc('Custom Fields'), + path => 'Admin/CustomFields/', + }, + E => { 'title' => loc('Global'), + path => 'Admin/Global/', + }, + F => { 'title' => loc('Tools'), + path => 'Admin/Tools/', + }, + }; + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + + if( defined $current_tab ) { + foreach my $tab (keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + } + + + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Elements/ToolTabs b/rt/share/html/Admin/Elements/ToolTabs new file mode 100755 index 000000000..d8be841b9 --- /dev/null +++ b/rt/share/html/Admin/Elements/ToolTabs @@ -0,0 +1,82 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + Title => $Title, + current_tab => 'Admin/Tools/', + subtabs => $tabs, + current_subtab => $current_tab, +&> + +<%INIT> + my $tabs = { + A => { title => loc('System Configuration'), + path => 'Admin/Tools/Configuration.html', + }, + E => { title => loc('Shredder'), + path => 'Admin/Tools/Shredder/', + }, + }; + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + + foreach my $tab ( values %{$tabs} ) { + next unless $tab->{'path'} eq $current_tab; + + $tab->{"subtabs"} = $subtabs; + $tab->{"current_subtab"} = $current_subtab; + } + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Elements/UserTabs b/rt/share/html/Admin/Elements/UserTabs new file mode 100755 index 000000000..a5c3d9a2b --- /dev/null +++ b/rt/share/html/Admin/Elements/UserTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Users/', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; +if ($id) { +$tabs->{'this'} = { title => eval { $UserObj->Name }, + + path => "Admin/Users/Modify.html?id=".$id, +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 + }, + 'MyRT' => { title => loc('RT at a glance'), + path => "Admin/Users/MyRT.html?id=".$id + }, + } +}; + if ( RT->Config->Get('GnuPG')->{'Enable'} ) { + $tabs->{'this'}{'subtabs'}{'GnuPG'} = { + title => loc('GnuPG'), + path => "Admin/Users/GnuPG.html?id=".$id, + }; + } +} + +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { + $tabs->{"A"} = { title => loc('Select'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { title => loc('Create'), + path => "Admin/Users/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->callback( %ARGS, tabs => $tabs ); + +#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; + +<%ARGS> +$UserObj => undef +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/share/html/Admin/Global/CustomFields/Groups.html b/rt/share/html/Admin/Global/CustomFields/Groups.html new file mode 100644 index 000000000..3b26aabfa --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/Groups.html @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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'}); + diff --git a/rt/share/html/Admin/Global/CustomFields/Queue-Tickets.html b/rt/share/html/Admin/Global/CustomFields/Queue-Tickets.html new file mode 100755 index 000000000..3ed3f3631 --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/Queue-Tickets.html @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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'}); + diff --git a/rt/share/html/Admin/Global/CustomFields/Queue-Transactions.html b/rt/share/html/Admin/Global/CustomFields/Queue-Transactions.html new file mode 100755 index 000000000..ea037a42b --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/Queue-Transactions.html @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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'}); + diff --git a/rt/share/html/Admin/Global/CustomFields/Queues.html b/rt/share/html/Admin/Global/CustomFields/Queues.html new file mode 100644 index 000000000..72c9489e0 --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/Queues.html @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Queues.html", + current_subtab => "Admin/Global/CustomFields/Queues.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object &> +<%INIT> + my $title = loc( 'Edit Custom Fields for all queues'); + my $object = RT::Queue->new($session{'CurrentUser'}); + diff --git a/rt/share/html/Admin/Global/CustomFields/Users.html b/rt/share/html/Admin/Global/CustomFields/Users.html new file mode 100644 index 000000000..a8fbd7c74 --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/Users.html @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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'}); + diff --git a/rt/share/html/Admin/Global/CustomFields/index.html b/rt/share/html/Admin/Global/CustomFields/index.html new file mode 100644 index 000000000..e6ea0d688 --- /dev/null +++ b/rt/share/html/Admin/Global/CustomFields/index.html @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( %ARGS, tabs => $tabs ); +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, Title => $title &> + + + +<%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', + }, + + C => { + title => loc('Queues'), + text => loc('Select custom fields for all queues'), + path => 'Queues.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->callback( tabs => $tabs ); + diff --git a/rt/share/html/Admin/Global/GroupRights.html b/rt/share/html/Admin/Global/GroupRights.html new file mode 100755 index 000000000..cec1d9044 --- /dev/null +++ b/rt/share/html/Admin/Global/GroupRights.html @@ -0,0 +1,123 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify global group rights') &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/GroupRights.html', + Title => loc('Modify global group rights') &> +<& /Elements/ListActions, actions => \@results &> + +
    + +<&| /Widgets/TitleBox, title => loc('Modify global group rights.')&> + +

    <&|/l&>System groups

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

    <&|/l&>Roles

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $RT::System &> +
    + + + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +my $Groups; + + + +<%ARGS> + diff --git a/rt/share/html/Admin/Global/MyRT.html b/rt/share/html/Admin/Global/MyRT.html new file mode 100644 index 000000000..1511173a3 --- /dev/null +++ b/rt/share/html/Admin/Global/MyRT.html @@ -0,0 +1,112 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc("RT at a glance") &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/MyRT.html', + Title => loc("RT at a glance"), +&> + +<& /Widgets/SelectionBox:header, nojs => 1 &> + +<& /Elements/ListActions, actions => \@actions &> +
    +% for my $pane (@panes) { +<&|/Widgets/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &> +<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &> +
    +% } +<%init> +my @actions; + +my @items = map { [ "component-$_", $_ ] } sort @{ RT->Config->Get('HomepageComponents') }; +my $sys = RT::System->new( $session{'CurrentUser'} ); +# XXX: put this in savedsearches_to_portlet_items +for ( $m->comp( "/Search/Elements/SearchesForObject", + Object => $sys )) { + my ( $desc, $search ) = @$_; + my $SearchType = $search->Content->{'SearchType'} || 'Ticket'; + if ( $SearchType eq 'Ticket' ) { + push @items, [ "system-$desc", $desc ]; + } else { + my $oid = ref($sys) . '-' . $sys->Id . '-SavedSearch-' . $search->Id; + my $type = + ( $SearchType eq 'Ticket' ) + ? 'Saved Search' : $SearchType; # loc + push @items, [ "saved-$oid", loc($type) . ": $desc" ]; + } +} + +my ($default_portlets) = $sys->Attributes->Named('HomepageSettings'); + +my $has_right = $session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser'); + +my @panes = $m->comp( + '/Admin/Elements/ConfigureMyRT', + panes => ['body', 'summary'], + Action => 'MyRT.html', + items => \@items, + ReadOnly => !$has_right, + current_portlets => $default_portlets->Content, + OnSave => sub { + my ( $conf, $pane ) = @_; + if (!$has_right) { + push @actions, loc( 'Permission denied' ); + } + else { + $default_portlets->SetContent( $conf ); + push @actions, loc( 'Global portlet [_1] saved.', $pane ); + } + } +); + +$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1 ) + for @panes; + + + + diff --git a/rt/share/html/Admin/Global/Scrip.html b/rt/share/html/Admin/Global/Scrip.html new file mode 100755 index 000000000..e2fc7414b --- /dev/null +++ b/rt/share/html/Admin/Global/Scrip.html @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Scrips.html', + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> +<& /Admin/Elements/EditScrip, title => $title, %ARGS, id => $id &> + +<%init> +my $subtabs = { + A => { + title => loc('Select'), + path => "Admin/Global/Scrips.html", + }, + B => { + title => loc('New'), + path => "Admin/Global/Scrip.html?create=1&Queue=0", + separator => 1, + }, +}; + +my ($id, @results) = $m->comp( '/Admin/Elements/EditScrip:Process', %ARGS ); + +my ($title, $current_subtab); +if ( $id ) { + $current_subtab = "Admin/Global/Scrip.html?id=$id&Queue=0"; + $title = loc("Modify a scrip that applies to all queues"); + $subtabs->{"C"} = { + title => loc('Scrip #[_1]', $id), + path => "Admin/Global/Scrip.html?id=$id&Queue=0", + }; +} +else { + $current_subtab = "Admin/Global/Scrip.html?create=1&Queue=0"; + $title = loc("Add a scrip which will apply to all queues"); +} + diff --git a/rt/share/html/Admin/Global/Scrips.html b/rt/share/html/Admin/Global/Scrips.html new file mode 100755 index 000000000..da72e8f77 --- /dev/null +++ b/rt/share/html/Admin/Global/Scrips.html @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Scrips.html', + current_subtab => 'Admin/Global/Scrips.html', + subtabs => $subtabs, + Title => $title &> +<& /Admin/Elements/EditScrips, title => $title, id => $id, %ARGS &> + +<%init> + +my $subtabs = { + A => { title => loc('Select'), + path => "Admin/Global/Scrips.html", + }, + B => { title => loc('New'), + path => "Admin/Global/Scrip.html?create=1&Queue=0", + separator => 1, + } + }; +my $title = loc("Modify scrips which apply to all queues"); + +my (@actions); + + + + + +<%ARGS> +$id => 0 + diff --git a/rt/share/html/Admin/Global/Template.html b/rt/share/html/Admin/Global/Template.html new file mode 100755 index 000000000..f833f8ee0 --- /dev/null +++ b/rt/share/html/Admin/Global/Template.html @@ -0,0 +1,123 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Templates.html', + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + +
    +%if ($Create ) { + +% } else { + +% } + +%# hang onto the queue id + +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => +$TemplateObj->Description, Content => $TemplateObj->Content &> +<& /Elements/Submit, Label => $SubmitLabel, Reset => 1 &> +
    + + +<%INIT> + +my $TemplateObj = new RT::Template($session{'CurrentUser'}); +my ($title, @results, $current_subtab, $SubmitLabel); + +my $subtabs = { + A => { title => loc('Select'), + path => "Admin/Global/Templates.html" + }, + B => { title => loc('New'), + path => "Admin/Global/Template.html?Create=1&Queue=0", + separator => 1, + } + }; + +if ($Create) { + $title = loc("Create a template"); + $current_subtab = "Admin/Global/Template.html?Create=1&Queue=0"; + $SubmitLabel = loc('Create'); +} + +else { + if (defined ($Template) && $Template eq 'new') { + my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); + Abort(loc("Could not create template: [_1]", $msg)) unless ($val); + push @results, $msg; + } + else { + $TemplateObj->Load($Template) || Abort(loc('No Template')); + } + $title = loc('Modify template [_1]', loc($TemplateObj->Name())); + $SubmitLabel = loc('Save Changes'); + +} +if ($TemplateObj->Id()) { + my @attribs = qw( Description Content Queue Name); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $TemplateObj, + ARGSRef => \%ARGS); + $current_subtab = "Admin/Global/Template.html?Queue=0&Template=".$TemplateObj->Id(); + $subtabs->{"C"} = { title => loc('Template #[_1]', $TemplateObj->Id()), + path => "Admin/Global/Template.html?Queue=0&Template=".$TemplateObj->Id(), + }; + push @results, @aresults; +} + + +<%ARGS> +$Queue => undef +$Template => undef +$Create => undef +$Name => undef + diff --git a/rt/share/html/Admin/Global/Templates.html b/rt/share/html/Admin/Global/Templates.html new file mode 100755 index 000000000..b918e145b --- /dev/null +++ b/rt/share/html/Admin/Global/Templates.html @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title, FeedURI => 'templates' &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Templates.html', + current_subtab => 'Admin/Global/Templates.html', + subtabs => $subtabs, + Title => $title &> +<& /Admin/Elements/EditTemplates, title => $title, %ARGS &> + +<%init> + +my $subtabs = { + A => { title => loc('Select'), + path => "Admin/Global/Templates.html" + }, + B => { title => loc('New'), + path => "Admin/Global/Template.html?Create=1&Queue=0", + separator => 1, + } + }; +my $title = loc("Modify templates which apply to all queues"); + +my (@actions); + + + + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/Global/UserRights.html b/rt/share/html/Admin/Global/UserRights.html new file mode 100755 index 000000000..7a56592ec --- /dev/null +++ b/rt/share/html/Admin/Global/UserRights.html @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify global user rights') &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/UserRights.html', + Title => loc('Modify global user rights') &> +<& /Elements/ListActions, actions => \@results &> + +
    + +<&| /Widgets/TitleBox, title => loc('Modify global user rights.') &> + + +% while ( my $UserObj = $Users->Next ) { +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup( $UserObj ); + + + + +% } +
    <& /Elements/ShowUser, User => $UserObj &><& /Admin/Elements/SelectRights, + PrincipalId => $group->PrincipalId, + Object => $RT::System, + &>
    + + +<& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> + +
    +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->UserMembersObj(); +$Users->OrderBy( FIELD => $UserOrderBy, ORDER => $UserOrder ); + + + +# }}} + + + +<%ARGS> +$UserOrderBy => 'Name' +$UserOrder => 'ASC' + diff --git a/rt/share/html/Admin/Global/index.html b/rt/share/html/Admin/Global/index.html new file mode 100755 index 000000000..4ddd5c4ab --- /dev/null +++ b/rt/share/html/Admin/Global/index.html @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% $m->callback( %ARGS, tabs => $tabs ); +<& /Admin/Elements/Header, Title => loc('Admin/Global configuration') &> +<& /Admin/Elements/SystemTabs, + Title => loc('Admin/Global configuration') &> + <& /Elements/ListMenu, items => $tabs &> +<%INIT> + my $tabs = { + + A => { title => loc('Scrips'), + text => loc('Modify scrips which apply to all queues'), + path => '/Admin/Global/Scrips.html', + }, + B => { title => loc('Templates'), + text => loc('Edit system templates'), + path => '/Admin/Global/Templates.html', + }, + + F => { title => loc('Custom Fields'), + text => loc('Modify global custom fields'), + path => '/Admin/Global/CustomFields/index.html', + }, + + G => { title => loc('Group Rights'), + text => loc('Modify global group rights'), + path => '/Admin/Global/GroupRights.html', + }, + H => { title => loc('User Rights'), + text => loc('Modify global user rights'), + path => '/Admin/Global/UserRights.html', + }, + I => { title => loc('RT at a glance'), + text => loc('Modify the default "RT at a glance" view'), + path => '/Admin/Global/MyRT.html', + }, + + + +}; + diff --git a/rt/share/html/Admin/Groups/CustomFields.html b/rt/share/html/Admin/Groups/CustomFields.html new file mode 100644 index 000000000..af76dcfb1 --- /dev/null +++ b/rt/share/html/Admin/Groups/CustomFields.html @@ -0,0 +1,48 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &> diff --git a/rt/share/html/Admin/Groups/GroupRights.html b/rt/share/html/Admin/Groups/GroupRights.html new file mode 100755 index 000000000..0c11751cb --- /dev/null +++ b/rt/share/html/Admin/Groups/GroupRights.html @@ -0,0 +1,119 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/GroupRights.html?id='.$id, + Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + +<&| /Widgets/TitleBox, title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> + +

    <&|/l&>System groups

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> +
    + + + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id)); + +my $Groups; + + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/Groups/History.html b/rt/share/html/Admin/Groups/History.html new file mode 100644 index 000000000..cde7c3f0c --- /dev/null +++ b/rt/share/html/Admin/Groups/History.html @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, + id => $id, + GroupObj => $GroupObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $GroupObj, + ShowDisplayModes => 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); + +<%ARGS> +$id => '' unless defined $id + diff --git a/rt/share/html/Admin/Groups/Members.html b/rt/share/html/Admin/Groups/Members.html new file mode 100755 index 000000000..62bd8c843 --- /dev/null +++ b/rt/share/html/Admin/Groups/Members.html @@ -0,0 +1,159 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('RT/Admin/Edit the group [_1]', $Group->Name) &> +<& /Admin/Elements/GroupTabs, GroupObj => $Group, + current_tab => 'Admin/Groups/Members.html?id='.$id, + Title => "RT/Admin/Edit the group ". $Group->Name &> +<& /Elements/ListActions, actions => \@results &> + +
    + + +<&| /Widgets/TitleBox, title => loc('Editing membership for group [_1]', $Group->Name) &> + + + + + + + + + + + +
    +

    <&|/l&>Current members

    +
    +

    <&|/l&>Add members

    +
    + +% if ($Group->MembersObj->Count == 0 ) { +<&|/l&>(No members) +% } else { +<&|/l&>Users +% my $Users = $Group->UserMembersObj( Recursively => 0 ); +<%perl> +my @users = sort { lc($a->[0]) cmp lc($b->[0]) } + map { [$m->scomp("/Elements/ShowUser", User => $_), $_] } + @{ $Users->ItemsArrayRef }; + +
      +% for (@users) { +% my ($rendered, $user) = @$_; +% $UsersSeen{ $user->id } = 1 if $SkipSeenUsers; +
    • +<% $rendered |n%>
    • +% } +
    +<&|/l&>Groups +
      +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while ( my $member = $GroupMembers->Next ) { +% $GroupsSeen{ $member->MemberId } = 1 if $SkipSeenGroups; +
    • +<% $member->MemberObj->Object->Name %> +% } +
    +% } +
    +<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group, + SkipUsers => \%UsersSeen, SkipGroups => \%GroupsSeen &> +
    + +<&|/l&>(Check box to delete) +<& /Elements/Submit, Label => loc('Modify Members'), Reset => 1 &> +
    + + +<%INIT> + +my $Group = new RT::Group($session{'CurrentUser'}); +$Group->Load($id) || Abort(loc('Could not load group')); + +my (%UsersSeen, %GroupsSeen); +$GroupsSeen{ $Group->id } = 1; # can't be a member of ourself + +my (@results); + +# XXX: safe member id in value instead of name +foreach my $key (keys %ARGS) { + next unless $key =~ /^DeleteMember-(\d+)$/; + + my ($val,$msg) = $Group->DeleteMember($1); + push (@results, $msg); +} + +foreach my $member (grep $_, @AddMembersUsers, @AddMembersGroups) { + + my $principal; + + if ($member =~ /^Group-(\d+)$/) { + $principal = RT::Group->new($session{'CurrentUser'}); + $principal->Load($1); + } elsif ($member =~ /^User-(\d+)$/) { + $principal = RT::User->new($session{'CurrentUser'}); + $principal->Load($1); + } else { + next; + } + + + my ($val, $msg) = $Group->AddMember($principal->PrincipalId); + push (@results, $msg); +} + + + +<%ARGS> +@AddMembersUsers => () +@AddMembersGroups => () +$id => undef +$SkipSeenUsers => 1 +$SkipSeenGroups => 1 + diff --git a/rt/share/html/Admin/Groups/Modify.html b/rt/share/html/Admin/Groups/Modify.html new file mode 100755 index 000000000..81b8ca740 --- /dev/null +++ b/rt/share/html/Admin/Groups/Modify.html @@ -0,0 +1,178 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> + +<& /Admin/Elements/GroupTabs, + GroupObj => $Group, + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + + +
    + +%unless ($Group->Id) { + +% } else { + +% } + + + + + + + +% my $CFs = $Group->CustomFields; +% while (my $CF = $CFs->Next) { + +% } + + + +% $m->callback( %ARGS, GroupObj => $Group, results => \@results ); +
    +<&|/l&>Name: +
    +<&|/l&>Description:
    +<% loc($CF->Name) %>: + +<& /Elements/EditCustomField, CustomField => $CF, + Object => $Group, + ($Create ? (NamePrefix => 'Object-RT::Group--CustomField-') + : () )&> +
    + + /> <&|/l&>Enabled (Unchecking this box disables this group)
    +
    +% if ( $Create ) { +<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +% } else { +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> +% } +
    +<%INIT> + +my $current_tab; +my ($title, @results, $Disabled, $EnabledChecked); + +my $Group = RT::Group->new($session{'CurrentUser'}); + +if ($Create) { + $current_tab = 'Admin/Groups/Modify.html?Create=1'; + $title = loc("Create a new group"); +} + +else { + $current_tab = 'Admin/Groups/Modify.html?id='.$id; + if ($id eq 'new' ) { + + my ($create_id, $create_msg) = $Group->CreateUserDefinedGroup(Name => + "$Name"); + unless ($create_id) { + Abort (loc("Group could not be created: [_1]", $create_msg)); + } + $id = $Group->Id; + } + else { + $Group->Load($id) || Abort('Could not load group'); + } + + + if ($id) { + $title = loc("Modify the group [_1]", $Group->Name); + + } + + # If the create failed + else { + $title = loc("Create a new group"); + $Create = 1; + } + +} + +if ($id) { + + my @fields = qw(Description Name ); + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + 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. +if (defined $Enabled && $Enabled == 1) { + $Disabled = 0; +} +else { + $Disabled = 1; +} +if ( ($SetEnabled) and ( $Disabled != $Group->Disabled) ) { + my ($code, $msg) = $Group->SetDisabled($Disabled); + push @results, $msg; +} + +unless ($Group->Disabled()) { + $EnabledChecked ='checked="checked"'; +} + + + + + +<%ARGS> +$Create => undef +$Name => undef +$Description => undef +$SetEnabled => undef +$Enabled => undef +$id => '' unless defined $id + diff --git a/rt/share/html/Admin/Groups/UserRights.html b/rt/share/html/Admin/Groups/UserRights.html new file mode 100755 index 000000000..619a076d0 --- /dev/null +++ b/rt/share/html/Admin/Groups/UserRights.html @@ -0,0 +1,112 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/UserRights.html?id='.$id, + Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + +<&| /Widgets/TitleBox, title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> + +% while ( my $Member = $Users->Next ) { +% my $UserObj = $Member->MemberObj->Object; + + + + +% } +
    <& /Elements/ShowUser, User => $UserObj &><& /Admin/Elements/SelectRights, + PrincipalId => $Member->MemberObj->Id, + PrincipalType => 'User', + Object => $GroupObj, + &>
    + + +<& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + +#Define vars used in html above + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_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(); + + + +# }}} + + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/share/html/Admin/Groups/index.html b/rt/share/html/Admin/Groups/index.html new file mode 100755 index 000000000..078f51bd9 --- /dev/null +++ b/rt/share/html/Admin/Groups/index.html @@ -0,0 +1,129 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', + current_subtab => 'Admin/Groups/', + Title => $title &> +<% $caption %>:
    + +% unless ( $Groups->Count ) { +<&|/l&>No groups matching search criteria found. +% } else { + +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + Rows => 100, + %ARGS, + Format => $Format, + Collection => $Groups, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy GroupString GroupOp GroupField FindDisabledGroups)], +&> + +% my $ids = join ',', map $_->id, @{ $Groups->ItemsArrayRef }; +% if ( $ids ) { + +% } + +

    +% } + +
    + /> <&|/l&>Include disabled groups in listing.
    +<&|/l&>Find groups whose <& /Elements/SelectGroups &>
    +
    +
    +<%INIT> +my $Groups = RT::Groups->new($session{'CurrentUser'}); +$Groups->LimitToUserDefinedGroups(); +my $title = loc('Select a group'); +my $caption; + +if ($FindDisabledGroups) { + $Groups->FindAllRows(); +} + +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"); +} + + +$Format ||= q{'__id__/TITLE:#'} + .q{,'__Name__/TITLE:Name'} + .q{,'__Description__'}; + + +<%ARGS> +$Format => undef, + +$GroupString => '' unless defined $GroupString +$GroupOp => '=' +$GroupField => 'Name' +$FindDisabledGroups => 0 + diff --git a/rt/share/html/Admin/Queues/CustomField.html b/rt/share/html/Admin/Queues/CustomField.html new file mode 100755 index 000000000..0dd530d2c --- /dev/null +++ b/rt/share/html/Admin/Queues/CustomField.html @@ -0,0 +1,87 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/CustomFields.html?id='.$QueueObj->id, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditCustomField, title => $title, %ARGS &> + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue); + +my ($title, $current_subtab); + +unless($QueueObj->id) { + Abort(loc("Queue [_1] not found", $Queue)); +} +if ($CustomField) { + $title = loc('Modify a CustomField for queue [_1]', $QueueObj->Name()); +}else { + $current_subtab = "Admin/Queues/CustomField.html?create=1&Queue=".$QueueObj->id; + $title = loc('Create a CustomField for queue [_1]', $QueueObj->Name()); +} + +my $subtabs = { + A => { title => loc('New custom field'), + path => "Admin/Queues/CustomField.html?create=1&Queue=".$QueueObj->id + } + }; + + +<%ARGS> +$CustomField => undef +$Queue => 0 + +<%ATTR> +AutoFlush => 0 + diff --git a/rt/share/html/Admin/Queues/CustomFields.html b/rt/share/html/Admin/Queues/CustomFields.html new file mode 100755 index 000000000..9db9c4221 --- /dev/null +++ b/rt/share/html/Admin/Queues/CustomFields.html @@ -0,0 +1,72 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /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, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &> +<%INIT> +my $Object = RT::Queue->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 ); + + +<%ARGS> +$id => undef +$SubType => 'RT::Queue-RT::Ticket' + diff --git a/rt/share/html/Admin/Queues/GroupRights.html b/rt/share/html/Admin/Queues/GroupRights.html new file mode 100755 index 000000000..467b14987 --- /dev/null +++ b/rt/share/html/Admin/Queues/GroupRights.html @@ -0,0 +1,134 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + + +

    <&|/l&>System groups

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

    <&|/l&>Roles

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $QueueObj &> +
    + + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +if (!defined $id) { + Abort(loc("No Queue defined")); +} + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue [_1]",$id)); + +my $Groups; +my $current_tab; +$current_tab = 'Admin/Queues/GroupRights.html?id='.$QueueObj->id; + + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/Queues/History.html b/rt/share/html/Admin/Queues/History.html new file mode 100644 index 000000000..b0634c50e --- /dev/null +++ b/rt/share/html/Admin/Queues/History.html @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, + id => $id, + QueueObj => $QueueObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $QueueObj, + ShowDisplayModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Queues/History.html?id='.$id; +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort("Couldn't load queue '$id'"); +my $title = loc("History of the queue [_1]", $QueueObj->Name); + +<%ARGS> +$id => '' unless defined $id + diff --git a/rt/share/html/Admin/Queues/Modify.html b/rt/share/html/Admin/Queues/Modify.html new file mode 100755 index 000000000..df97a68c7 --- /dev/null +++ b/rt/share/html/Admin/Queues/Modify.html @@ -0,0 +1,214 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% my $CFs = $QueueObj->CustomFields; +% while (my $CF = $CFs->Next) { + +% } + +% if ( RT->Config->Get('GnuPG')->{'Enable'} ) { + + + + + +% } + + + + +% if ( RT->Config->Get('GnuPG')->{'Enable'} ) { +% if ( my $email = $QueueObj->CorrespondAddress || RT->Config->Get('CorrespondAddress') ) { + +% } +% if ( my $email = $QueueObj->CommentAddress || RT->Config->Get('CommentAddress') ) { + +% } +% } + +
    <&|/l&>Queue Name:Name %>" />
    <&|/l&>Description:Description %>" size="60" />
    <&|/l&>Subject Tag:SubjectTag || '' ) %>" size="60" />
    <&|/l&>Reply Address:CorrespondAddress %>" /> +
    <&|/l , RT->Config->Get('CorrespondAddress')&>(If left blank, will default to [_1])
    <&|/l&>Comment Address:CommentAddress %>" /> +
    <&|/l , RT->Config->Get('CommentAddress')&>(If left blank, will default to [_1])
    <&|/l&>Priority starts at:<& /Elements/SelectPriority, + Name => "InitialPriority", + Default => $Create? 0: $QueueObj->InitialPriority, +&><&|/l&>Over time, priority moves toward:<& /Elements/SelectPriority, + Name => "FinalPriority", + Default => $Create? 0: $QueueObj->FinalPriority, +&>
    <&|/l&>Requests should be due in:DefaultDueIn%>" /> <&|/l&>days.
    +<% loc($CF->Name) %>: + +<& /Elements/EditCustomField, CustomField => $CF, + Object => $QueueObj, + ($Create ? (NamePrefix => 'Object-RT::Queue--CustomField-') + : () )&> +
    Sign? 'checked="checked"': '' |n%> /><&|/l&>Sign by defaultEncrypt? 'checked="checked"': '' |n%> /><&|/l&>Encrypt by default
    /><&|/l&>Enabled (Unchecking this box disables this queue)
    +% $m->callback( %ARGS, QueueObj => $QueueObj, results => \@results ); +
    <& /Admin/Elements/ShowKeyInfo, Type => 'private', EmailAddress => $email &>
    <& /Admin/Elements/ShowKeyInfo, Type => 'private', EmailAddress => $email &>
    +% if ( $Create ) { +<& /Elements/Submit, Label => loc('Create') &> +% } else { +<& /Elements/Submit, Label => loc('Save Changes') &> +% } +
    + + + +<%INIT> +my ($title, $current_tab, @results, $Disabled, $EnabledChecked); +my $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); +$QueueObj->Load( $id ) if !$id || $id eq 'new'; + +$EnabledChecked = 'checked="checked"'; + +if ($Create) { + $current_tab = 'Admin/Queues/Modify.html?Create=1'; + $title = loc("Create a queue"); +} else { + if ( defined $id && $id eq 'new' ) { + my ($val, $msg) = $QueueObj->Create( Name => $Name ); + Abort("$msg") unless $val; + delete $session{'create_in_queues'}; + push @results, $msg; + } + else { + $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort(loc("Couldn't load queue '[_1]'", $Name)); + } + $title = loc('Editing Configuration for queue [_1]', $QueueObj->Name); + + $current_tab = 'Admin/Queues/Modify.html?id='.$QueueObj->id; +} +if ( $QueueObj->Id ) { + delete $session{'create_in_queues'}; + my @attribs= qw(Description CorrespondAddress CommentAddress Name + InitialPriority FinalPriority DefaultDueIn Sign Encrypt SubjectTag Disabled); + + # we're asking about enabled on the web page but really care about disabled + if ( $SetEnabled ) { + $Disabled = $ARGS{'Disabled'} = $Enabled? 0: 1; + $ARGS{$_} = 0 foreach grep !defined $ARGS{$_} || !length $ARGS{$_}, + qw(Sign Encrypt Disabled); + } + + push @results, UpdateRecordObject( + AttributesRef => \@attribs, + Object => $QueueObj, + ARGSRef => \%ARGS + ); + + $Disabled = $ARGS{'Disabled'} = $Enabled? 0: 1; + + $EnabledChecked = "" if $QueueObj->Disabled; + + my @linkresults; + $m->callback( + results => \@linkresults, + RecordObj => $QueueObj, + ARGSRef => \%ARGS, + CallbackName => 'ProcessLinks' + ); + push @results, @linkresults; + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $QueueObj ); +} + + + +<%ARGS> +$id => undef +$result => undef +$Name => undef +$Create => undef +$Description => undef +$CorrespondAddress => undef +$CommentAddress => undef +$InitialPriority => undef +$FinalPriority => undef +$DefaultDueIn => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/share/html/Admin/Queues/People.html b/rt/share/html/Admin/Queues/People.html new file mode 100755 index 000000000..0a2ab0de2 --- /dev/null +++ b/rt/share/html/Admin/Queues/People.html @@ -0,0 +1,215 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> + +<& /Elements/ListActions, actions => \@results &> + + +
    + + + + + + + +
    + +

    <&|/l&>Current watchers

    + + +<&|/l&>Cc: + +<& /Admin/Elements/EditQueueWatchers, QueueObj => $QueueObj, Watchers => $QueueObj->Cc &> + +<&|/l&>Administrative Cc: + +<& /Admin/Elements/EditQueueWatchers, QueueObj => $QueueObj, Watchers => $QueueObj->AdminCc &> + + +
    +

    <&|/l&>New watchers

    + +<&|/l&>Find people whose
    +<& /Elements/SelectUsers &> + +
    +<&|/l&>Find groups whose
    +<& /Elements/SelectGroups &> + + +

    +<&|/l&>Add new watchers:
    +

    +<&|/l&>Users +% if ($user_msg) { +
    +<%$user_msg%> +% } elsif ($Users) { +

      +% while (my $u = $Users->Next ) { +
    • <& /Elements/SelectWatcherType, + Scope => 'queue', + Name => "Queue-AddWatcher-Principal-". $u->PrincipalId, +&> +<& /Elements/ShowUser, User => $u &>
    • +% } +
    +% } + +

    +<&|/l&>Groups + +% if ($group_msg) { +
    +<%$group_msg%> +% } elsif ($Groups) { +

      +% while (my $g = $Groups->Next ) { +
    • <&/Elements/SelectWatcherType, Scope=>'queue', Name => +"Queue-AddWatcher-Principal-".$g->PrincipalId &> <%$g->Name%> +(<%$g->Description%>) +% } +
    +% } + +
    + + + + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), Reset => 1 &> +
    + +<%INIT> + +my $current_tab; +my ($field, @results, $User, $Users, $Groups, $watcher, $user_msg, $group_msg); + +# {{{ Load the queue +#If we get handed two ids, mason will make them an array. bleck. +# We want teh first one. Just because there's no other sensible way +# to deal + + + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue", $id)); +# }}} + +unless ($OnlySearchForPeople or $OnlySearchForGroup) { +# {{{ Delete deletable watchers + + foreach my $key (keys %ARGS) { + my $id = $QueueObj->Id; + + if (($key =~ /^Queue-$id-DeleteWatcher-Type-(.*?)-Principal-(\d*)$/)) {; + my ($code, $msg) = $QueueObj->DeleteWatcher(Type => $1, + PrincipalId => $2); + push @results, $msg; + } + } +# }}} + +# {{{ Add new watchers + foreach my $key (keys %ARGS) { + #They're in this order because otherwise $1 gets clobbered :/ + if ( ($ARGS{$key} =~ /^(AdminCc|Cc)$/) and + ($key =~ /^Queue-AddWatcher-Principal-(\d*)$/) ) { + $RT::Logger->debug("Adding a watcher $1 to ".$ARGS{$key}."\n"); + my ($code, $msg) = $QueueObj->AddWatcher(Type => $ARGS{$key}, + PrincipalId => $1); + push @results, $msg; + } + } + +# }}} +} + + +if (!length $ARGS{'UserString'}) { +$user_msg = loc("No principals selected."); + } +else { + $Users = new RT::Users($session{'CurrentUser'}); + $Users->Limit(FIELD => $ARGS{'UserField'}, + VALUE => $ARGS{'UserString'}, + OPERATOR => $ARGS{'UserOp'}); + } + +if (!length $ARGS{'GroupString'}) { +$group_msg = loc("No principals selected."); + } +else { +$Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); +$Groups->Limit(FIELD => $ARGS{'GroupField'}, + VALUE => $ARGS{'GroupString'}, + OPERATOR => $ARGS{'GroupOp'}); + } + +$current_tab = 'Admin/Queues/People.html?id='.$QueueObj->id; + + +<%ARGS> +$OnlySearchForPeople => undef +$OnlySearchForGroup => undef +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$Type => undef +$id => undef + + diff --git a/rt/share/html/Admin/Queues/Scrip.html b/rt/share/html/Admin/Queues/Scrip.html new file mode 100755 index 000000000..96c492a94 --- /dev/null +++ b/rt/share/html/Admin/Queues/Scrip.html @@ -0,0 +1,99 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/Scrips.html?id='.$QueueObj->id, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> +<& /Admin/Elements/EditScrip, title => $title, %ARGS, id => $id &> + +<%init> +my $QueueObj = RT::Queue->new( $session{'CurrentUser'} ); +$QueueObj->Load( $Queue ); +unless( $QueueObj->id ) { + Abort(loc("Queue [_1] not found", $id)); +} + +my ($title, $current_subtab); +my $subtabs = { + A => { + title => loc('Select scrip'), + path => "Admin/Queues/Scrips.html?id=".$QueueObj->id, + }, + B => { + title => loc('New scrip'), + path => "Admin/Queues/Scrip.html?create=1&Queue=".$QueueObj->id, + separator => 1, + }, +}; + +($id, my @results) = $m->comp( '/Admin/Elements/EditScrip:Process', %ARGS ); + +if ( $id ) { + $current_subtab = "Admin/Queues/Scrip.html?id=$id&Queue=". $QueueObj->id; + $title = loc("Modify a scrip for queue [_1]", $QueueObj->Name); + $subtabs->{"C"} = { + title => loc("Scrip #[_1]",$id), + path => "Admin/Queues/Scrip.html?id=$id&Queue=".$QueueObj->id + }; +} else { + $current_subtab = "Admin/Queues/Scrip.html?create=1&Queue=".$QueueObj->id; + $title = loc("Create a scrip for queue [_1]", $QueueObj->Name); +} + + + + +<%ARGS> +$id => undef +$Queue => undef + diff --git a/rt/share/html/Admin/Queues/Scrips.html b/rt/share/html/Admin/Queues/Scrips.html new file mode 100755 index 000000000..e6347b6d2 --- /dev/null +++ b/rt/share/html/Admin/Queues/Scrips.html @@ -0,0 +1,87 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/Scrips.html?id='.$id, + current_subtab => 'Admin/Queues/Scrips.html?id='.$id, + subtabs => $subtabs, + Title => $title &> + +% unless ( $QueueObj->Disabled ) { # Global scrips does not apply to disabled queues +

    <&|/l&>Scrips which apply to all queues

    +<& /Admin/Elements/ListGlobalScrips &> +
    +% } +<& /Admin/Elements/EditScrips, title => $title, %ARGS &> +<%init> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +my $title; + +if ($QueueObj->id) { + $title = loc("Modify scrips for queue [_1]", $QueueObj->Name); +} else { + Abort(loc("Queue [_1] not found",$id)); +} + +my $subtabs = { + A => { title => loc('Select scrip'), + path => "Admin/Queues/Scrips.html?id=".$id, + }, + B => { title => loc('New scrip'), + path => "Admin/Queues/Scrip.html?create=1&Queue=".$id, + separator => 1, + } + }; + + +<%ARGS> +$id => undef #some identifier that a Queue could + diff --git a/rt/share/html/Admin/Queues/Template.html b/rt/share/html/Admin/Queues/Template.html new file mode 100755 index 000000000..54ba8177b --- /dev/null +++ b/rt/share/html/Admin/Queues/Template.html @@ -0,0 +1,132 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $Queue, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/Templates.html?id='.$Queue, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + +
    +%if ($Create ) { + +% } else { + +% } + +%# hang onto the queue id + +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => +$TemplateObj->Description, Content => $TemplateObj->Content &> +<& /Elements/Submit, Label => $SubmitLabel, Reset => 1 &> +
    + + +<%INIT> + +my $TemplateObj = new RT::Template($session{'CurrentUser'}); +my ($title, @results, $current_subtab, $SubmitLabel); + +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Queues/Templates.html?id=$Queue" + }, + B => { title => loc('New template'), + path => "Admin/Queues/Template.html?Create=1&Queue=$Queue", + separator => 1, + } + }; + +if ($Create) { + $title = loc("Create a template"); + $current_subtab = "Admin/Queues/Template.html?Create=1&Queue=".$Queue; + $SubmitLabel = loc('Create'); +} + +else { + if ($Template eq 'new') { + my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); + Abort(loc("Could not create template: [_1]", $msg)) unless ($val); + push @results, $msg; + } + else { + $TemplateObj->Load($Template) || Abort(loc('No Template')); + } + $title = loc('Modify template [_1]', loc($TemplateObj->Name())); + $SubmitLabel = loc('Save Changes'); + + +} +my $QueueObj; +if ($TemplateObj->Id()) { + $Queue = $TemplateObj->Queue; + $QueueObj = $TemplateObj->QueueObj; + + my @attribs = qw( Description Content Queue Name); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $TemplateObj, + ARGSRef => \%ARGS); + $current_subtab = "Admin/Queues/Template.html?Queue=$Queue&Template=".$TemplateObj->Id(); + $subtabs->{"C"} = { title => loc('Template #[_1]', $TemplateObj->Id()), + path => "Admin/Queues/Template.html?Queue=$Queue&Template=".$TemplateObj->Id(), + }; + push @results, @aresults; +} else { + $QueueObj = RT::Queue->new($session{'CurrentUser'}); + $QueueObj->Load($Queue); +} + + +<%ARGS> +$Queue => '' +$Template => '' +$Create => undef +$Name => undef + diff --git a/rt/share/html/Admin/Queues/Templates.html b/rt/share/html/Admin/Queues/Templates.html new file mode 100755 index 000000000..deb19ff89 --- /dev/null +++ b/rt/share/html/Admin/Queues/Templates.html @@ -0,0 +1,81 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + current_tab => 'Admin/Queues/Templates.html?id='.$id, + current_subtab => 'Admin/Queues/Templates.html?id='.$id, + QueueObj => $QueueObj, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditTemplates, title => $title, %ARGS &> + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +my ($title, $current_subtab); + +if ($QueueObj->id) { + $title = loc("Edit Templates for queue [_1]", $QueueObj->Name); +} else { + Abort(loc("Queue [_1] not found",$id)); +} +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Queues/Templates.html?id=".$id, + }, + B => { title => loc('New template'), + path => "Admin/Queues/Template.html?Create=1&Queue=".$id, + } + }; + + +<%ARGS> +$id => undef #some identifier that a Queue could + diff --git a/rt/share/html/Admin/Queues/UserRights.html b/rt/share/html/Admin/Queues/UserRights.html new file mode 100755 index 000000000..31d748acc --- /dev/null +++ b/rt/share/html/Admin/Queues/UserRights.html @@ -0,0 +1,112 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + + + +% $m->callback( %ARGS, QueueObj => $QueueObj, results => \@results ); +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + + + + +% } +
    <& /Elements/ShowUser, User => $UserObj &> + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $QueueObj &> +
    + + <& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + + +if (!defined $id) { + Abort(loc("No Queue defined")); +} + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue [_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 $current_tab; +$current_tab = 'Admin/Queues/UserRights.html?id='.$QueueObj->id; + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/share/html/Admin/Queues/index.html b/rt/share/html/Admin/Queues/index.html new file mode 100755 index 000000000..52e7b3bfd --- /dev/null +++ b/rt/share/html/Admin/Queues/index.html @@ -0,0 +1,126 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc("Admin queues") &> +<& /Admin/Elements/QueueTabs, current_tab => 'Admin/Queues/', + current_subtab => 'Admin/Queues/', + Title => loc("Admin queues") &> + + + +

    <%$caption%>

    +

    <&|/l&>Select a queue:

    +% unless ( $queues->Count ) { +<&|/l&>No queues matching search criteria found. +% } else { +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + %ARGS, + Format => $Format, + Collection => $queues, + AllowSorting => 1, + PassArguments => [qw( + Format Rows Page Order OrderBy + FindDisabledQueues QueueString QueueOp QueueField + )], +&> +% } +
    +% foreach my $field( qw(Format Rows Page Order OrderBy) ) { +% next unless defined $ARGS{ $field } && length $ARGS{ $field }; + +% } + + +<& /Elements/SelectMatch, Name => 'QueueOp', Default => $QueueOp &> + +
    + + /> +<&|/l&>Include disabled queues in listing. +
    +
    + +<%INIT> +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->{'find_disabled_rows'} = 1 if $FindDisabledQueues; + +my ($caption); +if ( defined $QueueString && length $QueueString ) { + $caption = $FindDisabledQueues + ? loc("All queues matching search criteria") + : loc("Enabled queues matching search criteria"); + $queues->Limit( + FIELD => $QueueField, + OPERATOR => $QueueOp, + VALUE => $QueueString, + ); +} else { + $queues->UnLimit; + $caption = $FindDisabledQueues + ? loc("All Queues") + : loc("Enabled Queues"); +} + +$Format ||= q{'__id__/TITLE:#'} + .q{,'__Name__/TITLE:Name'} + .q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__}; + + +<%ARGS> +$FindDisabledQueues => 0 +$Format => undef + +$QueueField => 'Name' +$QueueOp => '=' +$QueueString => '' + diff --git a/rt/share/html/Admin/Tools/Configuration.html b/rt/share/html/Admin/Tools/Configuration.html new file mode 100644 index 000000000..eb48af19c --- /dev/null +++ b/rt/share/html/Admin/Tools/Configuration.html @@ -0,0 +1,170 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +require Module::Versions::Report; +my $title = loc('System Configuration'); +unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) { + Abort(loc('This feature is only available to system administrators')); +} + + + +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/ToolTabs, + current_tab => 'Admin/Tools/Configuration.html', + current_subtab => 'Admin/Tools/Configuration.html', + Title => $title &> + + + +

    <&|/l&>Loaded perl modules

    +% my $report = Module::Versions::Report::report(); +% my @report = grep /v\d/, split("\n",$report); +
    +<% join('
    ', @report) |n %> +
    + +

    <&|/l&>RT Config

    + +<%PERL> +foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) { + my $val = RT->Config->Get( $key ); + next unless defined $val; + + my $meta = RT->Config->Meta( $key ); + my $description = ''; + if ( $meta->{'Source'}{'Extension'} && $meta->{'Source'}{'SiteConfig'} ) { + $description = loc("[_1] site config", $meta->{'Source'}{'Extension'}); + } + elsif ( $meta->{'Source'}{'Extension'} ) { + $description = loc("[_1] core config", $meta->{'Source'}{'Extension'}); + } + elsif ( $meta->{'Source'}{'SiteConfig'} ) { + $description = loc("site config"); + } + else { + $description = loc("core config"); + } + + + + +% } +
    <% $key %>\ +% if ( $key =~ /Password(?!Length)/i ) { +Password not printed\ +% } elsif ( !ref $val ) { +<% "$val" %>\ +% } elsif ( ref $val eq 'ARRAY' ) { +<% join ', ', @$val %>\ +% } elsif ( ref $val eq 'HASH' ) { +<% join ', ', %$val %>\ +% } else { +<% ref $val %>\ +% } +
    <% $description %>
    + +

    <&|/l&>RT Variables

    + +% { no strict qw/refs/; +% my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef ); +% foreach my $key ( sort keys %{*RT::} ) { +% next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key }; + + + +% } +% } +
    RT::<% $key %> +% if ( $key =~ /Password(?!Length)/i ) { +Password not printed +% } else { +<% ${'RT::'.$key} %> +% } +
    + +

    <&|/l&>RT Size

    + +<%PERL> +for my $type (qw/Ticket Queue Transaction Group/) { + my $class = 'RT::' . $type . 's'; + my $collection = $class->new($RT::SystemUser); + $collection->UnLimit; + my $count = $collection->CountAll; + + + +% } + +<%PERL> +my $users = RT::Users->new($RT::SystemUser); +$users->UnLimit; +my $user_count = $users->CountAll; + +$users->LimitToPrivileged; +my $privileged_count = $users->CountAll; +my $unprivileged_count = $user_count - $privileged_count; + + + + + +
    <% $type %>s<% $count %>
    Privileged Users<% $privileged_count %>
    Unprivileged Users<% $unprivileged_count %>
    + +

    <&|/l&>Perl configuration

    +% require Config; +
    +<% Config::myconfig() %>
    +
    + +

    <&|/l&>Perl Include Paths (@INC)

    +
    +% foreach my $inc (@INC) {
    +<% $inc %>
    +% }
    +
    diff --git a/rt/share/html/Admin/Tools/Shredder/Dumps/dhandler b/rt/share/html/Admin/Tools/Shredder/Dumps/dhandler new file mode 100644 index 000000000..f316f2218 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Dumps/dhandler @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ATTR> +AutoFlush => 0 + +<%FLAGS> +inherit => undef + +<%INIT> +my $arg = $m->dhandler_arg; +$m->abort(404) if $arg =~ m{\.\.|/|\\}; + +use File::Spec (); +use RT::Shredder (); +my $File = File::Spec->catfile( RT::Shredder->StoragePath, $arg ); +$r->content_type('application/octets-stream'); +open my $fh, "<:raw", $File or $m->abort(404); +my $buf; +while( read $fh, $buf, 1024*1024 ) { + $m->out($buf); +} +return 0; + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/DumpFileLink b/rt/share/html/Admin/Tools/Shredder/Elements/DumpFileLink new file mode 100644 index 000000000..ba0aeb85f --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/DumpFileLink @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$File => '' + +<%INIT> +return unless $File; +use File::Spec (); +use RT::Shredder (); + +$File = File::Spec->abs2rel( $File, RT::Shredder->StoragePath ) + if File::Spec->file_name_is_absolute($File); + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoRights b/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoRights new file mode 100644 index 000000000..0665c076b --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoRights @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => 'Error' &> +<& /Admin/Elements/ToolTabs, + current_tab => 'Admin/Tools/Shredder', + current_subtab => 'Admin/Tools/Shredder', + Title => 'Error', +&> +
    <% loc("You don't have SuperUser right.") |n%>
    + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoStorage b/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoStorage new file mode 100644 index 000000000..5d857ca56 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/Error/NoStorage @@ -0,0 +1,59 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Path => '' + +<& /Admin/Elements/Header, Title => 'Error' &> +<& /Admin/Elements/ToolTabs, + current_tab => 'Admin/Tools/Shredder', + current_subtab => 'Admin/Tools/Shredder', + Title => 'Error', +&> +
    +<% loc('Shredder needs a directory to write dumps to. Please check that you have [_1] and it is writable by your web server.', $m->interp->apply_escapes( $Path ) ) |n%> +
    diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment new file mode 100644 index 000000000..b7067b703 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Object => undef + + +<% loc('Attachment') %>(<% loc('id') %>:<% $Object->id %>, <% loc('FileName') %>: <% $Object->Filename || loc('(no value)') %>) + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket new file mode 100644 index 000000000..43307873d --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Object => undef + + +<% loc('Ticket') %>(<% loc('id') %>:<% $Object->id %>, <% loc('Subject') %>: <% substr($Object->Subject, 0, 30) %>...) + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--User b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--User new file mode 100644 index 000000000..d852f5a74 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/Object/RT--User @@ -0,0 +1,53 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Object => undef + + +<% loc('User') %>(<% loc('id') %>:<% $Object->id %>, <% loc('Name') %>: <% $Object->Name %>) + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox b/rt/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox new file mode 100644 index 000000000..fa487f691 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/ObjectCheckBox @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Object => undef + + + +% if( $m->comp_exists( $path ) ) { +% $m->comp( $path, Object => $Object ); +% } else { +<% $Object->_AsString %> +% } +
    +<%ONCE> +require File::Spec; + +<%INIT> +my $path = ref $Object; +$path =~ s/:/-/g; +$path = File::Spec->catfile( 'Object', $path ); + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/PluginArguments b/rt/share/html/Admin/Tools/Shredder/Elements/PluginArguments new file mode 100644 index 000000000..59c6df359 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/PluginArguments @@ -0,0 +1,62 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Plugin => '' + +
    +<% loc('Fill arguments') %>:
    +% foreach my $a( $plugin_obj->SupportArgs ) { +<% loc($a) %>:" value="<% $ARGS{ "$Plugin:$a" } || '' %>" />
    +% } +
    +<%INIT> +use RT::Shredder::Plugin; +my $plugin_obj = new RT::Shredder::Plugin; +my ($status, $msg) = $plugin_obj->LoadByName( $Plugin ); +die $msg unless $status; + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/PluginHelp b/rt/share/html/Admin/Tools/Shredder/Elements/PluginHelp new file mode 100644 index 000000000..70336bd4d --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/PluginHelp @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Plugin => '' + +
    +<% $text |n%> +
    +<%ONCE> +use RT::Shredder::Plugin; +my $plugin_obj = new RT::Shredder::Plugin; +my %plugins = $plugin_obj->List; + +<%INIT> +my $file = $plugins{ $Plugin }; +unless( $file ) { + $RT::Logger->error( "Couldn't find plugin '$Plugin'" ); + return; +} + +use RT::Shredder::POD qw(); +my $text = ''; +open my $io_handle, ">:scalar", \$text or die "Can't open scalar for write: $!"; +RT::Shredder::POD::plugin_html( $file, $io_handle ); +if ( $Plugin eq 'Base' ) { + $file =~ s/\.pm$/\/Search.pm/; + RT::Shredder::POD::plugin_html( $file, $io_handle ); +} +close $io_handle; + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/SelectObjects b/rt/share/html/Admin/Tools/Shredder/Elements/SelectObjects new file mode 100644 index 000000000..52743ff80 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/SelectObjects @@ -0,0 +1,67 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +@Objects => () + +
    +% unless( @Objects ) { +<& /Elements/ListActions, actions => [loc("Objects list is empty")] &> +% } else { +
    + +<% loc("click to check/uncheck all objects at once") %> +
    +% foreach my $o( @Objects ) { +<& ObjectCheckBox, Object => $o &> +% } +
    +<& /Elements/Submit, Name => 'Wipeout', Label => loc('Wipeout') &> +% } +
    +<%INIT> + diff --git a/rt/share/html/Admin/Tools/Shredder/Elements/SelectPlugin b/rt/share/html/Admin/Tools/Shredder/Elements/SelectPlugin new file mode 100644 index 000000000..f9ece67d2 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/Elements/SelectPlugin @@ -0,0 +1,73 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Plugin => '' + +<& PluginHelp, %ARGS, Plugin => 'Base' &> +
    +Select plugin: + +
    +
    +% foreach my $p( keys %plugins ) { +
    +<& PluginHelp, %ARGS, Plugin => $p &> +<& PluginArguments, %ARGS, Plugin => $p &> +
    +% } +
    +<%ONCE> +use RT::Shredder::Plugin; +my $plugin_obj = new RT::Shredder::Plugin; +my %plugins = $plugin_obj->List('Search'); + diff --git a/rt/share/html/Admin/Tools/Shredder/autohandler b/rt/share/html/Admin/Tools/Shredder/autohandler new file mode 100644 index 000000000..26094525a --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/autohandler @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +unless( $session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => $RT::System ) ) { + return $m->comp( 'Elements/Error/NoRights' ); +} + +use RT::Shredder (); +my $path = RT::Shredder->StoragePath; +unless( -d $path && -w _ ) { + return $m->comp( 'Elements/Error/NoStorage', Path => $path ); +} + +$m->call_next(%ARGS); + diff --git a/rt/share/html/Admin/Tools/Shredder/index.html b/rt/share/html/Admin/Tools/Shredder/index.html new file mode 100644 index 000000000..15c20dfd5 --- /dev/null +++ b/rt/share/html/Admin/Tools/Shredder/index.html @@ -0,0 +1,186 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%ARGS> +$Plugin => '' +$Search => '' +$Wipeout => '' +@WipeoutObject => () + +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/ToolTabs, + current_tab => 'Admin/Tools/Shredder', + current_subtab => 'Admin/Tools/Shredder', + Title => $title, +&> +
    +
    +<& /Elements/ListActions, actions => $messages{'Errors'} &> +<& /Elements/ListActions, actions => $messages{'Success'} &> +<& Elements/DumpFileLink, File => $dump_file &> +<& Elements/SelectPlugin, Plugin => $Plugin, %ARGS &> +
    +<& /Elements/Submit, Name => 'Search', Label => loc('Search') &> +
    +
    +
    +% if( $Search || $Wipeout ) { +<& Elements/SelectObjects, Objects => \@objs &> +% } +
    +<%INIT> + +require RT::Shredder; +my $title = loc('Shredder'); +my %messages = ( Errors => [], Success => [] ); +my ($plugin_obj, @objs); + +my $catch_non_fatals = sub { + require RT::Shredder::Exceptions; + if ( my $e = RT::Shredder::Exception::Info->caught ) { + push @{ $messages{Errors} }, "$e"; + $Search = ''; @objs = (); + return 1; + } + if ( UNIVERSAL::isa( $@, 'Class::Exception' ) ) { + $@->rethrow; + } else { + die $@; + } +}; + + +if( $Plugin ) { { # use additional block({}) to effectively exit block on errors + use RT::Shredder::Plugin; + $plugin_obj = new RT::Shredder::Plugin; + my( $status, $msg ) = $plugin_obj->LoadByName( $Plugin ); + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; + last; + } + + my %args; + foreach my $k( keys %ARGS ) { + next unless $k =~ /^\Q$Plugin\E:(.*)$/; + $args{ $1 } = $ARGS{$k}; + } + ( $status, $msg ) = $plugin_obj->HasSupportForArgs( keys %args ); + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; + last; + } + + ($status, $msg) = eval { $plugin_obj->TestArgs( %args ) }; + $catch_non_fatals->() && last if $@; + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; + last; + } +} } + +my $dump_file = ''; + +if( $Plugin && $Wipeout ) { { # use additional block({}) to effectively exit block on errors + my $shredder = new RT::Shredder( force => 1 ); + my $backup_plugin = new RT::Shredder::Plugin; + my ($status, $msg) = $backup_plugin->LoadByName('SQLDump'); + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; @objs = (); + last; + } + ($status, $msg) = $backup_plugin->TestArgs; + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; @objs = (); + last; + } + + ($dump_file) = $backup_plugin->FileName; + push @{ $messages{'Success'} }, "SQL dump file is '$dump_file'"; + + $shredder->AddDumpPlugin( Object => $backup_plugin ); + + $shredder->PutObjects( Objects => \@WipeoutObject ); + ($status, $msg) = $plugin_obj->SetResolvers( Shredder => $shredder ); + unless( $status ) { + push @{ $messages{Errors} }, $msg; + $Search = ''; @objs = (); + last; + } + eval { $shredder->WipeoutAll }; + $catch_non_fatals->() && last if $@; + + push @{ $messages{Success} }, loc('objects were successfuly removed'); +} } + +if( $Plugin && ( $Search || $Wipeout ) ) { { # use additional block({}) to effectively exit block on errors + my $status; + ($status, @objs) = eval { $plugin_obj->Run }; + $catch_non_fatals->() && last if $@; + unless( $status ) { + push @{ $messages{Errors} }, $objs[0]; + $Search = ''; @objs = (); + last; + } + push @{ $messages{Success} }, loc('executed plugin successfuly'); + + my $shredder = new RT::Shredder; + foreach my $o( grep defined, splice @objs ) { + eval { push @objs, $shredder->CastObjectsToRecords( Objects => $o ) }; + $catch_non_fatals->() && last if $@; + } + unless( @objs ) { + push @{ $messages{Success} }, loc('plugin returned empty list'); + } else { + push @{ $messages{Success} }, loc('see object list below'); + } +} } + diff --git a/rt/share/html/Admin/Tools/index.html b/rt/share/html/Admin/Tools/index.html new file mode 100644 index 000000000..78b1ed853 --- /dev/null +++ b/rt/share/html/Admin/Tools/index.html @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +my $title = loc('System Tools'); + +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/ToolTabs, + current_tab => 'Admin/Tools/index.html', + current_subtab => 'Admin/Tools/Configuration.html', + Title => $title &> diff --git a/rt/share/html/Admin/Users/CustomFields.html b/rt/share/html/Admin/Users/CustomFields.html new file mode 100644 index 000000000..42d825450 --- /dev/null +++ b/rt/share/html/Admin/Users/CustomFields.html @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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 ); + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/Users/GnuPG.html b/rt/share/html/Admin/Users/GnuPG.html new file mode 100644 index 000000000..dd0d05a8d --- /dev/null +++ b/rt/share/html/Admin/Users/GnuPG.html @@ -0,0 +1,112 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => 'Admin/Users/GnuPG.html?id='. $id, + Title => $title, +&> + +<& /Elements/ListActions, actions => \@results &> + +% if ( $email ) { +<& /Admin/Elements/ShowKeyInfo, EmailAddress => $email &> +% } else { +

    <% loc("User has empty email address") %>

    +% } + +
    + + +<& /Widgets/Form/Select, + Name => 'PrivateKey', + Description => loc('Private Key'), + Values => [ map $_->{'Key'}, @{ $keys_meta{'info'} } ], + CurrentValue => $UserObj->PrivateKey, + DefaultLabel => loc('No private key'), +&> + +<& /Elements/Submit, Name => 'Update', Label => loc('Save Changes') &> +
    + +<%ARGS> +$id => undef +$Update => undef + +<%INIT> +return unless RT->Config->Get('GnuPG')->{'Enable'}; + +require RT::Crypt::GnuPG; + +my @results; + +my $UserObj = RT::User->new( $session{'CurrentUser'} ); +$UserObj->Load( $id ); +unless ( $UserObj->id ) { + Abort( loc("Couldn't load user #[_1]", $id) ); +} +$id = $ARGS{'id'} = $UserObj->id; + +my $email = $UserObj->EmailAddress; +my %keys_meta = RT::Crypt::GnuPG::GetKeysForSigning( $email, 'force' ); + +$ARGS{'PrivateKey'} = $m->comp('/Widgets/Form/Select:Process', + Name => 'PrivateKey', + Arguments => \%ARGS, + Default => 1, +); + +if ( $Update ) { + my ($status, $msg) = $UserObj->SetPrivateKey( $ARGS{'PrivateKey'} ); + push @results, $msg; +} + +my $title = loc("User's GnuPG keys"); + + diff --git a/rt/share/html/Admin/Users/History.html b/rt/share/html/Admin/Users/History.html new file mode 100644 index 000000000..601751c42 --- /dev/null +++ b/rt/share/html/Admin/Users/History.html @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $UserObj, + ShowDisplayModes => 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); + +<%ARGS> +$id => '' + diff --git a/rt/share/html/Admin/Users/Memberships.html b/rt/share/html/Admin/Users/Memberships.html new file mode 100644 index 000000000..ea5dd258b --- /dev/null +++ b/rt/share/html/Admin/Users/Memberships.html @@ -0,0 +1,143 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> + +
    + + +

    <&|/l&>Groups the user is member of (check box to delete)

    + +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + Rows => 0, + %ARGS, + DisplayFormat => "__CheckBox.{Delete}__,$Format", + Format => $Format, + Collection => $is_member, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy id)], +&> + +

    <&|/l&>Groups the user is not member of (check box to add)

    + +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + Rows => 100, + %ARGS, + DisplayFormat => "__CheckBox.{Add}__,'__HasMemberRecursively.{$id}__/TITLE:Recursive',$Format", + Format => $Format, + Collection => $is_not_member, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy id)], +&> + +<& /Elements/Submit, Label => loc('Update'), Name => 'Update' &> + +
    + +<%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; + +my @results; +if ( $Update ) { + foreach my $gid( @Add ) { + my $group = RT::Group->new( $session{'CurrentUser'} ); + $group->LoadUserDefinedGroup( $gid ); + unless ( $group->id ) { + push @results, loc( "Couldn't load group #[_1]", $gid ); + next; + } + my ($status, $msg) = $group->AddMember( $id ); + push @results, $msg; + } + foreach my $gid( @Delete ) { + my $group = RT::Group->new( $session{'CurrentUser'} ); + $group->LoadUserDefinedGroup( $gid ); + unless ( $group->id ) { + push @results, loc( "Couldn't load group #[_1]", $gid ); + next; + } + my ($status, $msg) = $group->DeleteMember( $id ); + push @results, $msg; + } +} + +my $is_member = RT::Groups->new( $session{'CurrentUser'} ); +$is_member->LimitToUserDefinedGroups; +$is_member->WithMember( PrincipalId => $UserObj->Id ); + +my $is_not_member = RT::Groups->new( $session{'CurrentUser'} ); +$is_not_member->LimitToUserDefinedGroups; +$is_not_member->WithoutMember( PrincipalId => $UserObj->Id ); + +$Format ||= q{'__id__/TITLE:#'} + .q{,'__Name__/TITLE:Name'} + .q{,'__Description__'}; + +<%ARGS> +$id => undef + +$Update => 0, +@Add => (), +@Delete => (), + +$Format => undef + diff --git a/rt/share/html/Admin/Users/Modify.html b/rt/share/html/Admin/Users/Modify.html new file mode 100755 index 000000000..aae38b173 --- /dev/null +++ b/rt/share/html/Admin/Users/Modify.html @@ -0,0 +1,437 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> + +
    +%if ($Create) { + +% } else { + +% } + + + + + + + + + +
    +<&| /Widgets/TitleBox, title => loc('Identity') &> + + + + + + + + + +
    +<&|/l&>Username: + + <&|/l&>(required) +
    +<&|/l&>Email: + + +
    +<&|/l&>Real Name: + + +
    +<&|/l&>Nickname: + + +
    +<&|/l&>Unix login: + + +
    +<&|/l&>Language: + +<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &> +
    +<&|/l&>Extra info: + + +
    + +
    +<&| /Widgets/TitleBox, title => loc('Access control') &> + + /> +<&|/l&>Let this user access RT
    + + + + /> <&|/l&>Let this user be granted rights
    + +% unless (RT->Config->Get('WebExternalAuth') and !RT->Config->Get('WebFallbackToInternalAuth')) { + + + + + + + + +
    +<&|/l&>New Password: + + +
    +<&|/l&>Retype Password: + + +
    +% } + +% $m->callback( %ARGS, CallbackName => 'LeftColumnBottom', UserObj => $UserObj ); +
    +<&| /Widgets/TitleBox, title => loc('Location') &> + + + + + + + + +
    +<&|/l&>Organization: + + +
    +<&|/l&>Address1: + + +
    +<&|/l&>Address2: + + +
    +<&|/l&>City: + + + +
    +<&|/l&>State: + + + +
    +<&|/l&>Zip: + + +
    +<&|/l&>Country: + + +
    + +
    +<&| /Widgets/TitleBox, title => loc('Phone numbers') &> + + + + + + +
    +<&|/l&>Residence: + +
    +
    +<&|/l&>Work: + +
    +
    +<&|/l&>Mobile: + +
    +
    +<&|/l&>Pager: + +
    +
    + +
    +<&| /Widgets/TitleBox, title => loc('Custom Fields') &> + +% my $CFs = $UserObj->CustomFields; +% while (my $CF = $CFs->Next) { + +% } +
    +<% loc($CF->Name) %>: + +% if ($UserObj->id) { +<& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &> +% } else { +<& /Elements/EditCustomField, %ARGS, NamePrefix => 'Object-RT::User-new-CustomField-', CustomField => $CF &> +% } +
    + +% $m->callback( %ARGS, CallbackName => 'RightColumnBottom', UserObj => $UserObj ); +
    +<&| /Widgets/TitleBox, title => loc('Comments about this user') &> + + +%if (!$Create && $UserObj->Privileged) { +
    +<&| /Widgets/TitleBox, title => loc('Signature') &> + + +% } + +
    + +% if ( $Create ) { +<& /Elements/Submit, Label => loc('Create') &> +% } else { +<& /Elements/Submit, Label => loc('Save Changes') &> +% } +
    + +<%INIT> + +my $current_tab; +my $UserObj = new RT::User($session{'CurrentUser'}); +my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results); + +my ($val, $msg); + +if ($Create) { + $current_tab = 'Admin/Users/Modify.html?Create=1'; + $title = loc("Create a new user"); +} +else { + + $current_tab = 'Admin/Users/Modify.html?id='.$id if $id; + + if ( defined $id && $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) + ); + + if ($val) { + push @results, $msg; + foreach my $key ( keys %ARGS) { + # Convert custom fields on the "new" object to custom fields on the one we've just created + if ($key =~ /^Object-RT::User-new-CustomField-(.*)$/) { + $ARGS{'Object-RT::User-'.$val.'-CustomField-'.$1} = delete $ARGS{$key}; + } + } + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); + } else { + push @results, loc('User could not be created: [_1]', $msg); + } + } else { + $UserObj->Load($id) || $UserObj->Load($Name) + || Abort("Couldn't load user '" . ( $Name || '') . "'"); + $val = $UserObj->Id(); + } + + if ($val) { + $title = loc("Modify the user [_1]", $UserObj->Name); + } + + # If the create failed + else { + $title = loc("Create a new user"); + $Create = 1; + } +} + + + + +# 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 + ); + + 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 + 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. + $Disabled = $Enabled ? 0 : 1; + + if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { + my ($code, $msg) = $UserObj->SetDisabled($Disabled); + push @results, $msg; + } + + + # }}} +} + +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."); + } +} + + +# Do some setup for the ui +unless ( $UserObj->id && $UserObj->Disabled ) { + $EnabledChecked = 'checked="checked"'; +} + +if (!$Create && $UserObj->Privileged()) { + $PrivilegedChecked = 'checked="checked"'; +} + +# 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; + + + + +<%ARGS> +$id => undef +$Name => undef +$Comments => undef +$Signature => undef +$EmailAddress => undef +$FreeformContactInfo => undef +$Organization => undef +$RealName => undef +$NickName => undef +$Privileged => undef +$SetPrivileged => undef +$Enabled => undef +$SetEnabled => undef +$Lang => undef +$EmailEncoding => undef +$WebEncoding => undef +$ExternalContactInfoId => undef +$ContactInfoSystem => undef +$Gecos => undef +$ExternalAuthId => undef +$AuthSystem => undef +$HomePhone => undef +$WorkPhone => undef +$MobilePhone => undef +$PagerPhone => undef +$Address1 => undef +$Address2 => undef +$City => undef +$State => undef +$Zip => undef +$Country => undef +$Pass1 => undef +$Pass2=> undef +$Create=> undef + diff --git a/rt/share/html/Admin/Users/MyRT.html b/rt/share/html/Admin/Users/MyRT.html new file mode 100644 index 000000000..20e612328 --- /dev/null +++ b/rt/share/html/Admin/Users/MyRT.html @@ -0,0 +1,134 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Widgets/SelectionBox:header, nojs => 1 &> + +<& /Elements/ListActions, actions => \@actions &> + +
    + + + +
    + +
    + +% for my $pane (@panes) { +<&|/Widgets/TitleBox, title => loc('RT at a glance').': '.loc($pane->{Name}), bodyclass => "" &> +<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &> +
    +% } + +<%init> +my @actions; +my $current_tab; +$current_tab = 'Admin/Users/MyRT.html?id='.$id if $id; +my $UserObj = new RT::User($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '" . ($id || '') . "'"); +my $title = loc("RT at a glance for the user [_1]", $UserObj->Name); + +if ($ARGS{Reset}) { + my ($ok, $msg) = $UserObj->SetPreferences('HomepageSettings', {}); + push @actions, $ok ? loc('Preferences saved for user [_1].', $UserObj->Name) : $msg; +} + +my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings'); +my $portlets = $UserObj->Preferences('HomepageSettings', $default_portlets ? $default_portlets->Content : {}); + +my %allowed_components = map {$_ => 1} @{ RT->Config->Get('HomepageComponents') }; + +my @items; +push @items, map {["component-$_", $_]} sort keys %allowed_components; + +my $sys = RT::System->new( RT::CurrentUser->new($UserObj) ); +my @objs = ($sys); + +push @objs, RT::SavedSearches->new( RT::CurrentUser->new( $UserObj ) )->_PrivacyObjects; + +for my $object (@objs) { + for ($m->comp("/Search/Elements/SearchesForObject", Object => $object)) { + my ($desc, $search) = @$_; + my $SearchType = $search->Content->{'SearchType'} || 'Ticket'; + if ($object eq $sys && $SearchType eq 'Ticket') { + push @items, ["system-$desc", $desc]; + } + else { + my $oid = ref($object).'-'.$object->Id.'-SavedSearch-'.$search->Id; + my $type = ($SearchType eq 'Ticket') + ? 'Saved Search' : $SearchType; # loc + push @items, ["saved-$oid", loc($type).": $desc"]; + } + } +} + +my @panes = $m->comp( + '/Admin/Elements/ConfigureMyRT', + panes => ['body', 'summary'], + Action => "MyRT.html?id=$id", + items => \@items, + current_portlets => $portlets, + OnSave => sub { + my ( $conf, $pane ) = @_; + my ($ok, $msg) = $UserObj->SetPreferences( 'HomepageSettings', $conf ); + push @actions, $ok ? loc('Preferences [_1] for user [_2].', $pane, $UserObj->Name) : $msg; + } +); + +$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1 ) + for @panes; + + +<%ARGS> +$id => undef + diff --git a/rt/share/html/Admin/Users/index.html b/rt/share/html/Admin/Users/index.html new file mode 100755 index 000000000..e9a58183d --- /dev/null +++ b/rt/share/html/Admin/Users/index.html @@ -0,0 +1,135 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /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 %>

    +

    <&|/l&>Select a user:

    +% unless ( $users->Count ) { +<&|/l&>No users matching search criteria found. +% } else { + +<& /Elements/CollectionList, + OrderBy => 'Name', + Order => 'ASC', + Rows => 100, + %ARGS, + Format => $Format, + Collection => $users, + AllowSorting => 1, + PassArguments => [qw(Format Rows Page Order OrderBy UserString UserOp UserField IdLike EmailLike FindDisabledUsers)], +&> + +% my $ids = join ',', map $_->id, @{ $users->ItemsArrayRef }; +% if ( $ids ) { + +% } + +

    +% } + +
    +% foreach my $field( qw(Format Rows Page Order OrderBy) ) { +% next unless defined $ARGS{ $field } && length $ARGS{ $field }; + +% } +<&|/l&>Find all users whose <& /Elements/SelectUsers, %ARGS &>
    + /> +<&|/l&>Include disabled users in search. +
    +
    +
    + +<%INIT> +my $caption; +my $users = RT::Users->new( $session{'CurrentUser'} ); +$users->{'find_disabled_rows'} = 1 if $FindDisabledUsers; + +if ( defined($UserString) && length $UserString ) { + $caption = loc("Users matching search criteria"); + 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; +} + +$Format ||= q{'__id__/TITLE:#'} + .q{,'__Name__/TITLE:Name'} + .q{,__RealName__, __EmailAddress__}; + + +<%ARGS> +$Format => undef, + +$UserString => undef +$UserOp => '=' +$UserField => 'Name' +$IdLike => undef +$EmailLike => undef + +$FindDisabledUsers => 0 + diff --git a/rt/share/html/Admin/autohandler b/rt/share/html/Admin/autohandler new file mode 100644 index 000000000..230b0b51f --- /dev/null +++ b/rt/share/html/Admin/autohandler @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +return $m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight( + Right => 'ShowConfigTab', + Object => $RT::System, +); + +$m->clear_and_abort(403); + diff --git a/rt/share/html/Admin/index.html b/rt/share/html/Admin/index.html new file mode 100755 index 000000000..a24ecd956 --- /dev/null +++ b/rt/share/html/Admin/index.html @@ -0,0 +1,95 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& //Admin/Elements/Header, Title => loc('RT Administration') &> +<& //Admin/Elements/Tabs, Title => loc('RT Administration') &> + +<& /Elements/ListMenu, items => $tabs &> +<%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->callback( %ARGS, tabs => $tabs ); + + + + + -- cgit v1.2.1