From d4d0590bef31071e8809ec046717444b95b3f30a Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 15 Oct 2005 09:11:20 +0000 Subject: import rt 3.4.4 --- rt/html/Admin/CustomFields/GroupRights.html | 170 +++++ rt/html/Admin/CustomFields/Modify.html | 212 ++++++ rt/html/Admin/CustomFields/Objects.html | 145 ++++ rt/html/Admin/CustomFields/UserRights.html | 168 +++++ rt/html/Admin/CustomFields/index.html | 76 +++ rt/html/Admin/Elements/AddCustomFieldValue | 12 +- rt/html/Admin/Elements/CreateUserCalled | 6 +- rt/html/Admin/Elements/CustomFieldTabs | 116 ++++ rt/html/Admin/Elements/EditCustomField | 6 +- rt/html/Admin/Elements/EditCustomFieldValues | 50 +- rt/html/Admin/Elements/EditCustomFields | 222 +++--- rt/html/Admin/Elements/EditQueueWatchers | 9 +- rt/html/Admin/Elements/EditScrip | 6 +- rt/html/Admin/Elements/EditScrips | 10 +- rt/html/Admin/Elements/EditTemplates | 8 +- rt/html/Admin/Elements/EditUserComments | 6 +- rt/html/Admin/Elements/GlobalCustomFieldTabs | 93 +++ rt/html/Admin/Elements/GroupTabs | 10 +- rt/html/Admin/Elements/Header | 8 +- rt/html/Admin/Elements/ListGlobalCustomFields | 6 +- rt/html/Admin/Elements/ListGlobalScrips | 36 +- rt/html/Admin/Elements/ModifyTemplate | 6 +- rt/html/Admin/Elements/ObjectCustomFields | 109 +++ rt/html/Admin/Elements/PickCustomFields | 96 +++ rt/html/Admin/Elements/PickObjects | 80 +++ rt/html/Admin/Elements/QueueRightsForUser | 8 +- rt/html/Admin/Elements/QueueTabs | 17 +- rt/html/Admin/Elements/SelectCustomFieldLookupType | 58 ++ rt/html/Admin/Elements/SelectCustomFieldType | 12 +- rt/html/Admin/Elements/SelectGroups | 6 +- rt/html/Admin/Elements/SelectModifyGroup | 6 +- rt/html/Admin/Elements/SelectModifyQueue | 6 +- rt/html/Admin/Elements/SelectModifyUser | 6 +- rt/html/Admin/Elements/SelectNewGroupMembers | 6 +- rt/html/Admin/Elements/SelectRights | 19 +- rt/html/Admin/Elements/SelectScrip | 6 +- rt/html/Admin/Elements/SelectScripAction | 10 +- rt/html/Admin/Elements/SelectScripCondition | 10 +- rt/html/Admin/Elements/SelectSingleOrMultiple | 6 +- rt/html/Admin/Elements/SelectStage | 11 +- rt/html/Admin/Elements/SelectTemplate | 6 +- rt/html/Admin/Elements/SelectUsers | 6 +- rt/html/Admin/Elements/SystemTabs | 8 +- rt/html/Admin/Elements/Tabs | 13 +- rt/html/Admin/Elements/ToolTabs | 6 +- rt/html/Admin/Elements/UserTabs | 75 ++- rt/html/Admin/Global/CustomFields/Groups.html | 11 + .../Admin/Global/CustomFields/Queue-Tickets.html | 11 + .../Global/CustomFields/Queue-Transactions.html | 11 + rt/html/Admin/Global/CustomFields/Users.html | 11 + rt/html/Admin/Global/CustomFields/index.html | 91 +++ rt/html/Admin/Global/GroupRights.html | 6 +- rt/html/Admin/Global/Scrip.html | 6 +- rt/html/Admin/Global/Scrips.html | 6 +- rt/html/Admin/Global/Template.html | 6 +- rt/html/Admin/Global/Templates.html | 8 +- rt/html/Admin/Global/UserRights.html | 6 +- rt/html/Admin/Global/index.html | 10 +- rt/html/Admin/Groups/CustomFields.html | 46 ++ rt/html/Admin/Groups/GroupRights.html | 6 +- rt/html/Admin/Groups/History.html | 66 ++ rt/html/Admin/Groups/Members.html | 10 +- rt/html/Admin/Groups/Modify.html | 26 +- rt/html/Admin/Groups/UserRights.html | 6 +- rt/html/Admin/Groups/index.html | 54 +- rt/html/Admin/Queues/CustomField.html | 8 +- rt/html/Admin/Queues/CustomFields.html | 35 +- rt/html/Admin/Queues/GroupRights.html | 6 +- rt/html/Admin/Queues/Modify.html | 12 +- rt/html/Admin/Queues/People.html | 8 +- rt/html/Admin/Queues/Scrip.html | 6 +- rt/html/Admin/Queues/Scrips.html | 6 +- rt/html/Admin/Queues/Template.html | 6 +- rt/html/Admin/Queues/Templates.html | 6 +- rt/html/Admin/Queues/UserRights.html | 6 +- rt/html/Admin/Queues/index.html | 15 +- rt/html/Admin/Tools/Configuration.html | 8 +- rt/html/Admin/Tools/index.html | 6 +- rt/html/Admin/Users/CustomFields.html | 69 ++ rt/html/Admin/Users/History.html | 66 ++ rt/html/Admin/Users/Memberships.html | 65 ++ rt/html/Admin/Users/Modify.html | 174 +++-- rt/html/Admin/Users/index.html | 54 +- rt/html/Admin/autohandler | 51 ++ rt/html/Admin/index.html | 69 +- rt/html/Approvals/Display.html | 6 +- rt/html/Approvals/Elements/Approve | 6 +- rt/html/Approvals/Elements/PendingMyApproval | 6 +- rt/html/Approvals/Elements/ShowDependency | 6 +- rt/html/Approvals/Elements/Tabs | 6 +- rt/html/Approvals/index.html | 6 +- rt/html/Download/CustomFieldValue/dhandler | 75 +++ rt/html/Download/Tabular/dhandler | 74 ++ rt/html/Elements/BevelBoxRaisedEnd | 6 +- rt/html/Elements/BevelBoxRaisedStart | 6 +- rt/html/Elements/Callback | 56 +- rt/html/Elements/Checkbox | 8 +- rt/html/Elements/CollectionAsTable/Header | 100 ++- rt/html/Elements/CollectionAsTable/ParseFormat | 59 +- rt/html/Elements/CollectionAsTable/Row | 92 ++- rt/html/Elements/CreateTicket | 8 +- rt/html/Elements/EditCustomField | 89 +++ rt/html/Elements/EditCustomFieldBinary | 60 ++ rt/html/Elements/EditCustomFieldFreeform | 68 ++ rt/html/Elements/EditCustomFieldImage | 60 ++ rt/html/Elements/EditCustomFieldSelect | 71 ++ rt/html/Elements/EditCustomFieldText | 65 ++ rt/html/Elements/EditCustomFieldWikitext | 65 ++ rt/html/Elements/EditLinks | 25 +- rt/html/Elements/Error | 12 +- rt/html/Elements/Footer | 17 +- rt/html/Elements/GotoTicket | 6 +- rt/html/Elements/Header | 14 +- rt/html/Elements/ListActions | 6 +- rt/html/Elements/Login | 8 +- rt/html/Elements/Menu | 13 +- rt/html/Elements/MessageBox | 8 +- rt/html/Elements/MyRequests | 15 +- rt/html/Elements/MyTickets | 15 +- rt/html/Elements/PageLayout | 13 +- rt/html/Elements/QueryString | 6 +- rt/html/Elements/QuickCreate | 6 +- rt/html/Elements/Quicksearch | 44 +- rt/html/Elements/RT__Ticket/ColumnMap | 268 +++----- rt/html/Elements/Refresh | 6 +- rt/html/Elements/ScrubHTML | 6 +- rt/html/Elements/Section | 6 +- rt/html/Elements/SelectAttachmentField | 6 +- rt/html/Elements/SelectBoolean | 6 +- rt/html/Elements/SelectCustomFieldOperator | 6 +- rt/html/Elements/SelectCustomFieldValue | 6 +- rt/html/Elements/SelectDate | 6 +- rt/html/Elements/SelectDateRelation | 6 +- rt/html/Elements/SelectDateType | 6 +- rt/html/Elements/SelectEqualityOperator | 8 +- rt/html/Elements/SelectGroups | 19 +- rt/html/Elements/SelectLang | 6 +- rt/html/Elements/SelectLinkType | 6 +- rt/html/Elements/SelectMatch | 6 +- rt/html/Elements/SelectNewTicketQueue | 10 +- rt/html/Elements/SelectOwner | 65 +- rt/html/Elements/SelectQueue | 9 +- rt/html/Elements/SelectResultsPerPage | 6 +- rt/html/Elements/SelectSortOrder | 6 +- rt/html/Elements/SelectStatus | 8 +- rt/html/Elements/SelectTicketSortBy | 6 +- rt/html/Elements/SelectTicketTypes | 6 +- rt/html/Elements/SelectUsers | 21 +- rt/html/Elements/SelectWatcherType | 6 +- rt/html/Elements/SetupSessionCookie | 21 +- rt/html/Elements/ShowCustomFieldBinary | 49 ++ rt/html/Elements/ShowCustomFieldImage | 51 ++ rt/html/Elements/ShowCustomFieldWikitext | 55 ++ rt/html/Elements/ShowCustomFields | 77 +++ rt/html/Elements/ShowLink | 6 +- rt/html/Elements/ShowLinks | 6 +- rt/html/Elements/ShowMemberships | 86 +++ rt/html/Elements/SimpleSearch | 6 +- rt/html/Elements/Submit | 37 +- rt/html/Elements/Tabs | 26 +- rt/html/Elements/TicketList | 115 ++-- rt/html/Elements/TitleBox | 6 +- rt/html/Elements/TitleBoxEnd | 9 +- rt/html/Elements/TitleBoxStart | 8 +- rt/html/NoAuth/Logout.html | 6 +- rt/html/NoAuth/Reminder.html | 6 +- rt/html/NoAuth/images/autohandler | 7 +- rt/html/NoAuth/webrt.css | 278 +++++++- rt/html/REST/1.0/Forms/queue/default | 6 +- rt/html/REST/1.0/Forms/queue/ns | 6 +- rt/html/REST/1.0/Forms/ticket/attachments | 8 +- rt/html/REST/1.0/Forms/ticket/default | 6 +- rt/html/REST/1.0/Forms/ticket/history | 8 +- rt/html/REST/1.0/Forms/ticket/links | 6 +- rt/html/REST/1.0/Forms/user/default | 6 +- rt/html/REST/1.0/Forms/user/ns | 6 +- rt/html/REST/1.0/NoAuth/mail-gateway | 11 +- rt/html/REST/1.0/autohandler | 8 +- rt/html/REST/1.0/dhandler | 6 +- rt/html/REST/1.0/logout | 6 +- rt/html/REST/1.0/search/dhandler | 6 +- rt/html/REST/1.0/search/ticket | 8 +- rt/html/REST/1.0/ticket/comment | 6 +- rt/html/REST/1.0/ticket/link | 6 +- rt/html/REST/1.0/ticket/merge | 6 +- rt/html/Search/Build.html | 746 +++++++++++---------- rt/html/Search/Bulk.html | 75 +-- rt/html/Search/Edit.html | 6 +- rt/html/Search/Elements/BuildFormatString | 196 +++--- rt/html/Search/Elements/DisplayOptions | 17 +- rt/html/Search/Elements/EditFormat | 60 +- rt/html/Search/Elements/EditQuery | 65 ++ rt/html/Search/Elements/EditSearches | 18 +- rt/html/Search/Elements/NewListActions | 6 +- rt/html/Search/Elements/PickBasics | 189 +++--- rt/html/Search/Elements/PickCFs | 31 +- rt/html/Search/Elements/PickCriteria | 20 +- rt/html/Search/Elements/SearchPrivacy | 6 +- rt/html/Search/Elements/SelectAndOr | 12 +- rt/html/Search/Elements/SelectGroup | 65 ++ rt/html/Search/Elements/SelectLinks | 8 +- rt/html/Search/Elements/SelectPersonType | 22 +- rt/html/Search/Elements/SelectSearchObject | 6 +- rt/html/Search/Elements/SelectSearchesForObjects | 9 +- rt/html/Search/Results.html | 30 +- rt/html/Search/Results.rdf | 6 +- rt/html/Search/Results.tsv | 9 +- rt/html/SelfService/Attachment/dhandler | 6 +- rt/html/SelfService/Closed.html | 8 +- rt/html/SelfService/Create.html | 47 +- rt/html/SelfService/CreateTicketInQueue.html | 61 ++ rt/html/SelfService/Display.html | 183 ++--- rt/html/SelfService/Elements/GotoTicket | 6 +- rt/html/SelfService/Elements/Header | 6 +- rt/html/SelfService/Elements/MyRequests | 8 +- rt/html/SelfService/Elements/Tabs | 18 +- rt/html/SelfService/Error.html | 6 +- rt/html/SelfService/Prefs.html | 6 +- rt/html/SelfService/Update.html | 75 ++- rt/html/SelfService/index.html | 6 +- rt/html/Ticket/Attachment/dhandler | 6 +- rt/html/Ticket/Create.html | 22 +- rt/html/Ticket/Display.html | 14 +- rt/html/Ticket/Elements/AddWatchers | 6 +- rt/html/Ticket/Elements/BulkLinks | 6 +- rt/html/Ticket/Elements/EditBasics | 8 +- rt/html/Ticket/Elements/EditCustomField | 67 +- rt/html/Ticket/Elements/EditCustomFields | 20 +- rt/html/Ticket/Elements/EditDates | 6 +- rt/html/Ticket/Elements/EditPeople | 8 +- rt/html/Ticket/Elements/EditWatchers | 8 +- rt/html/Ticket/Elements/FindAttachments | 19 +- rt/html/Ticket/Elements/LoadTextAttachments | 14 +- rt/html/Ticket/Elements/PreviewScrips | 8 +- rt/html/Ticket/Elements/ShowAttachments | 12 +- rt/html/Ticket/Elements/ShowBasics | 6 +- rt/html/Ticket/Elements/ShowCustomFields | 27 +- rt/html/Ticket/Elements/ShowDates | 6 +- rt/html/Ticket/Elements/ShowDependencies | 6 +- rt/html/Ticket/Elements/ShowGroupMembers | 6 +- rt/html/Ticket/Elements/ShowHistory | 19 +- rt/html/Ticket/Elements/ShowMemberOf | 8 +- rt/html/Ticket/Elements/ShowMembers | 6 +- rt/html/Ticket/Elements/ShowMessageHeaders | 6 +- rt/html/Ticket/Elements/ShowMessageStanza | 8 +- rt/html/Ticket/Elements/ShowPeople | 8 +- rt/html/Ticket/Elements/ShowReferences | 10 +- rt/html/Ticket/Elements/ShowRequestor | 11 +- rt/html/Ticket/Elements/ShowSummary | 8 +- rt/html/Ticket/Elements/ShowTransaction | 13 +- rt/html/Ticket/Elements/ShowTransactionAttachments | 49 +- rt/html/Ticket/Elements/ShowUserEntry | 6 +- rt/html/Ticket/Elements/Tabs | 13 +- rt/html/Ticket/History.html | 6 +- rt/html/Ticket/Modify.html | 12 +- rt/html/Ticket/ModifyAll.html | 36 +- rt/html/Ticket/ModifyDates.html | 6 +- rt/html/Ticket/ModifyLinks.html | 6 +- rt/html/Ticket/ModifyPeople.html | 6 +- rt/html/Ticket/ShowEmailRecord.html | 6 +- rt/html/Ticket/Update.html | 29 +- rt/html/Tools/Elements/Tabs | 6 +- rt/html/Tools/MyDay.html | 8 +- rt/html/Tools/Offline.html | 6 +- rt/html/User/Delegation.html | 6 +- rt/html/User/Elements/DelegateRights | 8 +- rt/html/User/Elements/GroupTabs | 6 +- rt/html/User/Elements/Tabs | 6 +- rt/html/User/Groups/Members.html | 10 +- rt/html/User/Groups/Modify.html | 8 +- rt/html/User/Groups/index.html | 6 +- rt/html/User/Prefs.html | 13 +- rt/html/autohandler | 24 +- rt/html/index.html | 6 +- rt/html/l | 6 +- 275 files changed, 6003 insertions(+), 2433 deletions(-) create mode 100644 rt/html/Admin/CustomFields/GroupRights.html create mode 100644 rt/html/Admin/CustomFields/Modify.html create mode 100644 rt/html/Admin/CustomFields/Objects.html create mode 100644 rt/html/Admin/CustomFields/UserRights.html create mode 100644 rt/html/Admin/CustomFields/index.html create mode 100644 rt/html/Admin/Elements/CustomFieldTabs create mode 100755 rt/html/Admin/Elements/GlobalCustomFieldTabs create mode 100644 rt/html/Admin/Elements/ObjectCustomFields create mode 100644 rt/html/Admin/Elements/PickCustomFields create mode 100644 rt/html/Admin/Elements/PickObjects create mode 100644 rt/html/Admin/Elements/SelectCustomFieldLookupType create mode 100644 rt/html/Admin/Global/CustomFields/Groups.html create mode 100755 rt/html/Admin/Global/CustomFields/Queue-Tickets.html create mode 100755 rt/html/Admin/Global/CustomFields/Queue-Transactions.html create mode 100644 rt/html/Admin/Global/CustomFields/Users.html create mode 100644 rt/html/Admin/Global/CustomFields/index.html create mode 100644 rt/html/Admin/Groups/CustomFields.html create mode 100644 rt/html/Admin/Groups/History.html create mode 100644 rt/html/Admin/Users/CustomFields.html create mode 100644 rt/html/Admin/Users/History.html create mode 100644 rt/html/Admin/Users/Memberships.html create mode 100644 rt/html/Admin/autohandler create mode 100644 rt/html/Download/CustomFieldValue/dhandler create mode 100644 rt/html/Download/Tabular/dhandler create mode 100644 rt/html/Elements/EditCustomField create mode 100644 rt/html/Elements/EditCustomFieldBinary create mode 100644 rt/html/Elements/EditCustomFieldFreeform create mode 100644 rt/html/Elements/EditCustomFieldImage create mode 100644 rt/html/Elements/EditCustomFieldSelect create mode 100644 rt/html/Elements/EditCustomFieldText create mode 100644 rt/html/Elements/EditCustomFieldWikitext create mode 100644 rt/html/Elements/ShowCustomFieldBinary create mode 100644 rt/html/Elements/ShowCustomFieldImage create mode 100644 rt/html/Elements/ShowCustomFieldWikitext create mode 100644 rt/html/Elements/ShowCustomFields create mode 100644 rt/html/Elements/ShowMemberships create mode 100644 rt/html/Search/Elements/EditQuery create mode 100644 rt/html/Search/Elements/SelectGroup create mode 100755 rt/html/SelfService/CreateTicketInQueue.html (limited to 'rt/html') diff --git a/rt/html/Admin/CustomFields/GroupRights.html b/rt/html/Admin/CustomFields/GroupRights.html new file mode 100644 index 000000000..380fee479 --- /dev/null +++ b/rt/html/Admin/CustomFields/GroupRights.html @@ -0,0 +1,170 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/GroupRights.html?id=".$id, + Title => $title +&> +<& /Elements/ListActions, actions => \@results &> + +
+ + + +

<&|/l&>System groups

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

<&|/l&>User defined groups

+ +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
+ <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> +
+ + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
+ +<%INIT> + + + + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No CustomField defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load CustomField [_1]",$id)); + +my $Groups; + + my ( $ACL, @results ); + + foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", $object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right => $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", $object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => $right); + push (@results, $msg); + } +} + +my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name); + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/CustomFields/Modify.html b/rt/html/Admin/CustomFields/Modify.html new file mode 100644 index 000000000..4c3c92114 --- /dev/null +++ b/rt/html/Admin/CustomFields/Modify.html @@ -0,0 +1,212 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $CustomFieldObj->Id , + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + +
+ + + + + + + + + + + + + + + + + + + + + + +
<&|/l&>Name
<&|/l&>Description
<&|/l&>Type<& /Admin/Elements/SelectCustomFieldType, + Name => "TypeComposite", + Default => $CustomFieldObj->TypeComposite, &> +
<&|/l&>Applies to<& /Admin/Elements/SelectCustomFieldLookupType, + Name => "LookupType", + Default => $CustomFieldObj->LookupType, &> +
  + +> <&|/l&>Enabled (Unchecking this box disables this custom field) +
+
+% if ($CustomFieldObj->Id && $CustomFieldObj->Type =~ /^Select/i) { +

<&|/l&>Values

+
+<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +
+% } +<&/Elements/Submit&> +
+ + + +<%INIT> + + + +my $CustomFieldObj = RT::CustomField->new( $session{'CurrentUser'} ); +my ( $title, @results, $EnabledChecked, $Disabled); +$EnabledChecked = "CHECKED"; + +if ( !$id ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} +else { + + if ( $id eq 'new' ) { + my ( $val, $msg ) = $CustomFieldObj->Create(Name => $Name, + TypeComposite => $TypeComposite, + LookupType => $LookupType, + Description => $Description,); + $m->comp("/Elements/Error", Why => loc( "Could not create CustomField", $msg ) ) unless ($val); + push @results, $msg; + $title = loc( 'Created CustomField [_1]', $CustomFieldObj->Name() ); + } + else { + $CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc('No CustomField') ); + $title = loc( 'Editing CustomField [_1]', $CustomFieldObj->Name() ); + + my @attribs = qw( Name TypeComposite LookupType Description); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $CustomFieldObj, + ARGSRef => \%ARGS ); + + push @results, @aresults; + + #we're asking about enabled on the web page but really care about disabled. + if ($Enabled == 1) { + $Disabled = 0; + } + else { + $Disabled = 1; + } + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + } + + $id = $CustomFieldObj->id; +} + + + + +my $paramtag = "CustomField-".$CustomFieldObj->Id."-Value-"; +# Delete any fields that want to be deleted +foreach my $key (keys %ARGS) { + + next unless ($key =~ /^Delete-$paramtag(\d+)$/); + my ($val, $msg) = $CustomFieldObj->DeleteValue($1); + push (@results, $msg); + + +} +# Update any existing values +my $values = $CustomFieldObj->ValuesObj; +while (my $value = $values->Next) { + foreach my $attr qw(Name Description SortOrder) { + my $param = $paramtag.$value->Id."-".$attr; + + if ( $ARGS{$param} && ($value->$attr() ne $ARGS{$param})) { + my $mutator = "Set$attr"; + my ($id, $msg) = $value->$mutator($ARGS{$param}); + push (@results, $msg); + } + } + + +} + + + +# Add any new values +if ($ARGS{$paramtag."new-Name"}) { + my ($id, $msg) = $CustomFieldObj->AddValue ( Name => $ARGS{$paramtag."new-Name"}, + Description => $ARGS{$paramtag."new-Description"}, + SortOrder => $ARGS{$paramtag."new-SortOrder"}); + push (@results, $msg); +} + +my $current_tab; +if ($ARGS{'Create'}){ + $current_tab = "Admin/CustomFields/Modify.html?Create=1"; +} else { + $current_tab = "Admin/CustomFields/Modify.html?id=".$id; + } + + + +<%ARGS> +$id => undef +$TypeComposite => undef +$LookupType => undef +$MaxValues => undef +$SortOrder => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/html/Admin/CustomFields/Objects.html b/rt/html/Admin/CustomFields/Objects.html new file mode 100644 index 000000000..8f9e3657b --- /dev/null +++ b/rt/html/Admin/CustomFields/Objects.html @@ -0,0 +1,145 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/Objects.html?id=".$id, + Title => $title + &> + +<& /Elements/ListActions, actions => \@results &> + +
+ + + +

<&|/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'}); +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/html/Admin/CustomFields/UserRights.html b/rt/html/Admin/CustomFields/UserRights.html new file mode 100644 index 000000000..e2df3a058 --- /dev/null +++ b/rt/html/Admin/CustomFields/UserRights.html @@ -0,0 +1,168 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, id => $id, +current_tab => "Admin/CustomFields/UserRights.html?id=".$id, +Title => $title, &> +<& /Elements/ListActions, actions => \@results &> + +
+ + + + + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + + + + +% } +
+ <% $UserObj->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $CustomFieldObj &> +
+ + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
+ +<%INIT> + + #Update the acls. + my @results; +foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", +$object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : +($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right +=> $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", +$object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => +$right); + push (@results, $msg); + } +} + + +# {{{ Deal with setting up the display of current rights. + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No Class defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load Class [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + +my $title = loc('Modify user rights for custom field [_1]', $CustomFieldObj->Name); + +# }}} + + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/html/Admin/CustomFields/index.html b/rt/html/Admin/CustomFields/index.html new file mode 100644 index 000000000..9854fb0ec --- /dev/null +++ b/rt/html/Admin/CustomFields/index.html @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Select a Custom Field') &> +<& /Admin/Elements/CustomFieldTabs, + current_tab => 'Admin/CustomFields/', + Title => loc('Select a Custom Field') &> + +% my $prev_lookup = ''; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $CustomFieldObj->CurrentUserHasRight('AdminCustomField') or next; +% my $lookup = $CustomFieldObj->FriendlyLookupType; +% if ($lookup ne $prev_lookup) { +% if ($prev_lookup) { + +% } +

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

+ +% } + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit(); +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); + diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue index 0e59fe320..3e3f414b3 100644 --- a/rt/html/Admin/Elements/AddCustomFieldValue +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,20 +42,20 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/l&>Add Value
<&|/l&>Sort:
- +
<&|/l&>Name:
- +
<&|/l&>Description:
- +
diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled index 01fa9fe94..0dc6ac792 100644 --- a/rt/html/Admin/Elements/CreateUserCalled +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
<&|/l&>New user called
diff --git a/rt/html/Admin/Elements/CustomFieldTabs b/rt/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..d7acf33cc --- /dev/null +++ b/rt/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + current_tab => 'Admin/CustomFields/', + subtabs => $tabs, + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ($id) { + my $cf = RT::CustomField->new( $session{'CurrentUser'} ); + $cf->Load($id); + $tabs = { + this => { + title => $cf->Name, + path => "Admin/CustomFields/Modify.html?id=" . $id, + current_subtab => $current_tab, + + subtabs => { + + C => { title => loc('Basics'), + path => "Admin/CustomFields/Modify.html?id=" . $id, + }, + F => { title => loc('Group Rights'), + path => "Admin/CustomFields/GroupRights.html?id=" + . $id, }, + G => { + title => loc('User Rights'), + path => "Admin/CustomFields/UserRights.html?id=" . $id, + }, + + } } + + }; + + + if ($cf->LookupType =~ /^RT::Queue/io) { + $tabs->{'this'}->{subtabs}->{D} = { + title => loc('Applies to'), + path => "Admin/CustomFields/Objects.html?id=" . $id, + }; + } +} + +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField')) { + $tabs->{"A"} = { title => loc('Select custom field'), + path => "Admin/CustomFields/", + }; + $tabs->{"B"} = { title => loc('New custom field'), + path => "Admin/CustomFields/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab (sort keys %{$tabs->{'this'}->{'subtabs'}}) { + if ($tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{'subtabs'} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{'current_subtab'} = $current_subtab; + } +} +if( $id ) { $current_tab = "Admin/CustomFields/Modify.html?id=" . $id } + +<%ARGS> +$Title => undef +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef + diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField index 5657d43fd..d8c5b29b2 100644 --- a/rt/html/Admin/Elements/EditCustomField +++ b/rt/html/Admin/Elements/EditCustomField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues index 79b6501e1..9cc3858b9 100644 --- a/rt/html/Admin/Elements/EditCustomFieldValues +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,22 +42,42 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<&|/l&>(Check box to delete) -
    -% while (my $v = $values->Next) { -
  • - - -<%$v->Name%> -% if ($v->Description) { -(<%$v->Description%>) +%# END BPS TAGGED BLOCK }}} +% if (!$values->Count) { +

    <&|/l&>(no values)

    +% return; % } -
  • +<&|/l&>(Check box to delete) + + + + + + + +% while (my $value = $values->Next) { + + + + + + % } - +
     <&|/l&>Sort<&|/l&>Name<&|/l&>Description
    + + + + + + + + + +
    <%init> -my $values = $CustomField->Values(); + +my $values = $CustomField->ValuesObj(); + <%args> $CustomField => undef diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields index d901b216e..1cd3df568 100644 --- a/rt/html/Admin/Elements/EditCustomFields +++ b/rt/html/Admin/Elements/EditCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,95 +42,64 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/ListActions, actions => \@actions &> - - - -
    -

    <%$caption%>

    -
    -% if ($CustomFields->Count == 0 ) { -

    <&|/l&>(No custom fields)

    -% } else { - -% my $count; -% while (my $CustomFieldObj = $CustomFields->Next) { - - - -% # show 'move up' unless it's the first item -% if ($count++) { - - +%# 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 &> -
    -% if ($CustomFieldObj->Name) { - <%$CustomFieldObj->Name%>
    -% } else { - (<%loc("no name")%>)
    -% } - <%$CustomFieldObj->Description%> -
    - <% $CustomFieldObj->FriendlyType %> - - <&|/l&>Move up -% } else { - -% } - -% # show 'move down' unless it's the last item -% if (!$CustomFields->IsLast) { -% $m->print(' | ') if $count > 1; - <&|/l&>Move down -% } -
    -% } - -% if ($id) { - -% } - <&|/l&>Include disabled custom fields in listing. - +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> <%INIT> my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); -my $QueueObj = RT::Queue->new($session{'CurrentUser'}); -my $caption; +my @results; +my (@GlobalCFs, @UnassignedCFs); -if ($id) { - $QueueObj->Load($id); +my $id = $Object->Id; +if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { + $m->out('

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

    '); + return; } -if ($QueueObj->id) { - $CustomFields->LimitToQueue($id); -} -else { - $CustomFields->LimitToGlobal(); -} - -if ($FindDisabledCustomFields) { - $caption = loc("All Custom Fields"); - $CustomFields->{'find_disabled_rows'} = 1; -} else { - $caption = loc("Enabled Custom Fields"); -} +my $lookup = $ObjectType; +$lookup .= "-$SubType" if $SubType; + +$CustomFields->LimitToLookupType($lookup); +$CustomFields->OrderBy( FIELD => 'Name' ); + + +my ($GlobalCFs, $ObjectCFs); +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); # {{{ deal with moving sortorder of custom fields if ($CustomField and $Move) { - my $SourceObj = RT::CustomField->new($session{'CurrentUser'}); - $SourceObj->Load($CustomField) || Abort(loc('No CustomField')); + my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); + $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); my $TargetObj; my $target_order = $SourceObj->SortOrder + $Move; - while (my $CustomFieldObj = $CustomFields->Next) { - my $this_order = $CustomFieldObj->SortOrder; + while (my $ObjectCF = $ObjectCFs->Next) { + my $this_order = $ObjectCF->SortOrder; # if we have an exact match, finish the loop now - ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order; + ($TargetObj = $ObjectCF, last) if $this_order == $target_order; # otherwise, we need to apropos toward the general direction # ... first, check the sign is correct @@ -144,7 +113,7 @@ if ($CustomField and $Move) { next if $orig_delta < $this_delta; } - $TargetObj = $CustomFieldObj; + $TargetObj = $ObjectCF; } if ($TargetObj) { @@ -153,83 +122,68 @@ if ($CustomField and $Move) { $TargetObj->SetSortOrder($s); $SourceObj->SetSortOrder($t); # because order changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; } - $CustomFields->GotoFirstItem; + $ObjectCFs->GotoFirstItem; } # }}} -# {{{ now process the 'copy queue' action -my @actions; -if ($Source and $Source ne $id) { - my $SourceQueue = RT::Queue->new($session{'CurrentUser'}); - $SourceQueue->Load($Source) || Abort(loc("Couldn't load queue")); - my $SourceCustomFields = RT::CustomFields->new($session{'CurrentUser'}); - $SourceCustomFields->LimitToQueue($SourceQueue->id); - - # delete old fields - foreach my $CustomFieldObj ( @{$CustomFields->ItemsArrayRef} ) { - $CustomFieldObj->Delete; - } +if ($id) { + $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); + $GlobalCFs->LimitToObjectId(0); + $GlobalCFs->LimitToLookupType($lookup); +} - # add new fields - while (my $SourceCustomFieldObj = $SourceCustomFields->Next) { - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - my ($val, $msg) = $CustomFieldObj->Create( - id => $SourceCustomFieldObj->id, - Queue => $id, - Name => $SourceCustomFieldObj->Name, - Type => $SourceCustomFieldObj->Type, - Description => $SourceCustomFieldObj->Description, - ); - Abort(loc("Could not create CustomField") . ": $msg") unless ($val); - push @actions, $msg; - - $CustomFieldObj->SetSortOrder($SourceCustomFieldObj->SortOrder); - - # add new values - my $values = $SourceCustomFieldObj->Values(); - while (my $v = $values->Next) { - my ( $addval, $addmsg ) = $CustomFieldObj->AddValue( - Name => $v->Name, - Description => $v->Description, - SortOrder => $v->SortOrder - ); - } - } +while (my $cf = $CustomFields->Next) { + my $cf_id = $cf->Id; - # because content changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; - $CustomFields->GotoFirstItem; -} -# }}} + if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { + push @GlobalCFs, $cf; + next; + } -# {{{ deal with deleting existing custom fields -foreach my $key (keys %ARGS) { - # {{{ if we're trying to delete the custom field - if ($key =~ /^DeleteCustomField-(\d+)/) { - my $id = $1; - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - $CustomFieldObj->Load($id); - my ($retval, $msg) = $CustomFieldObj->Delete; - if ($retval) { - push @actions, loc("Custom field deleted"); + if ($UpdateCFs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$id-CF-$cf_id"; + if ($ARGS{$key}) { + if (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->AddToObject($Object); + push (@results, $msg); + push @UnassignedCFs, $cf if !$val; + } + } + else { + push @UnassignedCFs, $cf; + if ($ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->RemoveFromObject($Object); + push (@results, $msg); + pop @UnassignedCFs if !$val; + } + } } - else { - push @actions, $msg; + elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + push @UnassignedCFs, $cf; } - } - # }}} + else { + } } -# }}} + +# redo search... +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); <%ARGS> -$id => 0 $title => undef $Move => undef $Source => undef $CustomField => undef $FindDisabledCustomFields => undef +$UpdateCFs => 0 +$Object +$ObjectType +$SubType => '' diff --git a/rt/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers index f6559e7ad..c93bf81f5 100644 --- a/rt/html/Admin/Elements/EditQueueWatchers +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %if ($Members->Count == 0 ) {
    • <&|/l&>none @@ -51,8 +51,7 @@
        % while (my $watcher=$Members->Next) {
      • - % if ($watcher->MemberObj->IsUser) { diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip index 4207114fd..907ae9a92 100644 --- a/rt/html/Admin/Elements/EditScrip +++ b/rt/html/Admin/Elements/EditScrip @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips index 8959f6c70..9526118b5 100644 --- a/rt/html/Admin/Elements/EditScrips +++ b/rt/html/Admin/Elements/EditScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &>
        -

        <&|/l&>Current Scrips:

        +

        <&|/l&>Current Scrips

        % if ($Scrips->Count == 0 ) {

        <&|/l&>(No scrips)

        % } else { @@ -58,7 +58,7 @@ % while (my $scrip = $Scrips->Next ) { - +
        <% $scrip->Description || "(".loc('no value').")" |n %>
        diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates index 6ac56c235..207ffd001 100644 --- a/rt/html/Admin/Elements/EditTemplates +++ b/rt/html/Admin/Elements/EditTemplates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> @@ -63,7 +63,7 @@ % while (my $TemplateObj = $Templates->Next) { - + diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments index bc23f77fe..fb96dc09a 100644 --- a/rt/html/Admin/Elements/EditUserComments +++ b/rt/html/Admin/Elements/EditUserComments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => "Comments about $name" &> <&|/l&>These comments aren't generally visible to the user:
        diff --git a/rt/html/Admin/Elements/GlobalCustomFieldTabs b/rt/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..8d4eaca23 --- /dev/null +++ b/rt/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/SystemTabs, subtabs => $tabs, + current_tab => 'Admin/Global/CustomFields/index.html', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> + + + my $tabs = { + + A => { title => loc('Users'), + text => loc('Modify scrips which apply to all queues'), + path => 'Admin/Global/CustomFields/Users.html', + }, + B => { title => loc('Groups'), + text => loc('Edit system templates'), + path => 'Admin/Global/CustomFields/Groups.html', + }, + + F => { title => loc('Tickets'), + text => loc('Modify global custom fields'), + path => 'Admin/Global/CustomFields/Queue-Tickets.html', + }, + + G => { title => loc('Ticket Transactions'), + text => loc('Modify global group rights'), + path => 'Admin/Global/CustomFields/Queue-Transactions.html', + }, + +}; + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs index de39ec117..60edda40e 100644 --- a/rt/html/Admin/Elements/GroupTabs +++ b/rt/html/Admin/Elements/GroupTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Groups/', @@ -67,6 +67,8 @@ $tabs->{"this"} = { class => "currentnav", path => "Admin/Groups/GroupRights.html?id=" . $GroupObj->id, }, G => { title => loc('User Rights'), path => "Admin/Groups/UserRights.html?id=" . $GroupObj->id, }, + H => { title => loc('History'), + path => "Admin/Groups/History.html?id=" . $GroupObj->id }, } } } @@ -74,7 +76,7 @@ $tabs->{"A"} = { title => loc('Select group'), path => "Admin/Groups/", }; $tabs->{"B"} = { title => loc('New group'), path => "Admin/Groups/Modify.html?Create=1", - separator => 1, }; + separator => 1, }; # Now let callbacks add their extra tabs $m->comp( '/Elements/Callback', tabs => $tabs, %ARGS ); diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header index 69a3ccd53..b80908094 100644 --- a/rt/html/Admin/Elements/Header +++ b/rt/html/Admin/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/Header, Title => $Title &> +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, %ARGS &> <%ARGS> $Title => undef diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields index abca29073..3df9d6292 100644 --- a/rt/html/Admin/Elements/ListGlobalCustomFields +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my $count = 0; % while (my $CustomFieldObj = $CustomFields->Next) { % $count++; diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips index cb3f89a9f..2e3791257 100644 --- a/rt/html/Admin/Elements/ListGlobalScrips +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,17 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -% my $count = 0; +%# END BPS TAGGED BLOCK }}} + +% if ($Scrips->Count == 0) { + +

        <&|/l&>(No scrips)

        + +% } else { + +
        + +% } + <%init> my $Scrips = new RT::Scrips ($session{'CurrentUser'}); $Scrips->LimitToGlobal(); diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate index acd87a73f..6749f3e65 100644 --- a/rt/html/Admin/Elements/ModifyTemplate +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} @@ -159,7 +159,7 @@ my @attribs= qw(Description CorrespondAddress CommentAddress Name } if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) { my ($code, $msg) = $QueueObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); } if ($QueueObj->Disabled()) { diff --git a/rt/html/Admin/Queues/People.html b/rt/html/Admin/Queues/People.html index 1a5caeec4..e29b9d34f 100644 --- a/rt/html/Admin/Queues/People.html +++ b/rt/html/Admin/Queues/People.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, @@ -79,7 +79,7 @@ <& /Elements/SelectUsers &>
        -<&|/l&>Find group whose
        +<&|/l&>Find groups whose
        <& /Elements/SelectGroups &> diff --git a/rt/html/Admin/Queues/Scrip.html b/rt/html/Admin/Queues/Scrip.html index be9226fac..1223fbfed 100644 --- a/rt/html/Admin/Queues/Scrip.html +++ b/rt/html/Admin/Queues/Scrip.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Scrips.html b/rt/html/Admin/Queues/Scrips.html index 5d10e442b..e7092fb22 100644 --- a/rt/html/Admin/Queues/Scrips.html +++ b/rt/html/Admin/Queues/Scrips.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Template.html b/rt/html/Admin/Queues/Template.html index 066e7dd25..c60a90900 100644 --- a/rt/html/Admin/Queues/Template.html +++ b/rt/html/Admin/Queues/Template.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $Queue, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Templates.html b/rt/html/Admin/Queues/Templates.html index e92184841..888fdbc8a 100644 --- a/rt/html/Admin/Queues/Templates.html +++ b/rt/html/Admin/Queues/Templates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, current_tab => 'Admin/Queues/Templates.html?id='.$id, diff --git a/rt/html/Admin/Queues/UserRights.html b/rt/html/Admin/Queues/UserRights.html index 6aaaab95a..399992ae2 100644 --- a/rt/html/Admin/Queues/UserRights.html +++ b/rt/html/Admin/Queues/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/index.html b/rt/html/Admin/Queues/index.html index 80998bd56..28adf531c 100644 --- a/rt/html/Admin/Queues/index.html +++ b/rt/html/Admin/Queues/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc("Admin queues") &> <& /Admin/Elements/QueueTabs, current_tab => 'Admin/Queues/', current_subtab => 'Admin/Queues/', @@ -50,18 +50,19 @@ -<%$caption%>:
        +

        <%$caption%>

        +

        <&|/l&>Select a queue:

          %if ($queues->Count == 0) { -
        • <&|/l&>No queues matching search criteria found. +
        • <&|/l&>No queues matching search criteria found.
        • % } %while ( $queue = $queues->Next) { -
        • <%$queue->Name%>
        • +
        • <%$queue->Name%>
        • %}

        - <&|/l&>Include disabled queues in listing. + <&|/l&>Include disabled queues in listing.
        diff --git a/rt/html/Admin/Tools/Configuration.html b/rt/html/Admin/Tools/Configuration.html index 24d9b7309..bc5ca69a1 100644 --- a/rt/html/Admin/Tools/Configuration.html +++ b/rt/html/Admin/Tools/Configuration.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> require Module::Versions::Report; my $title = loc('System Configuration'); @@ -80,7 +80,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super % next if (ref ${'RT::'.$key} );
        +
        diff --git a/rt/html/Admin/Elements/ObjectCustomFields b/rt/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..a87e1579d --- /dev/null +++ b/rt/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,109 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& $ObjectTabs, +$id ? ( + id => $Object->id, + current_tab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + current_subtab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + "${Type}Obj" => $Object, +) : ( + current_tab => "Admin/Global/CustomFields/${QualifiedType}s.html", +), + Title => $title + &> + +<& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object &> +<%INIT> +# XXX TODO: Validate here? +#$ObjectType =~ /^RT::(Queue|User|Group)$/ +# or Abort(loc("Object of type [_1] cannot take custom fields", $ObjectType)); + + + +my $Type = $1; +my $Types = $Type.'s'; +my $ObjectTabs; +my $Object = $ObjectType->new($session{'CurrentUser'}); + + +my $QualifiedType; +my $FriendlySubTypes; +if ($SubType =~/^RT::(.*)$/) { + $FriendlySubTypes = RT::CustomField->new($session{'CurrentUser'})->FriendlyLookupType($Object->CustomFieldLookupType); + $QualifiedType = "$Type-$1"; +} else { + $QualifiedType = $Type; +} + +if ($id) { + $Object->Load($id) || Abort(loc("Couldn't load object [_1]", $id)); + $ObjectTabs = "/Admin/Elements/${Type}Tabs"; +} else { + $ObjectTabs = "/Admin/Elements/GlobalCustomFieldTabs"; + +} + +my $title; +if ($id) { +$title = loc('Edit Custom Fields for [_1]', $Object->Name); +} +elsif ($SubType) { + + $title= loc("Modify Custom Fields which apply to [_1] for all [_2]", loc(lc($FriendlySubTypes)), loc(lc($Types))); +} else { + $title =loc("Modify Custom Fields which apply to all [_1]", loc(lc($Types))); + +} +my $sub_type_url; +$sub_type_url = "SubType=$SubType" if $SubType; + + +<%ARGS> +$id => undef +$ObjectType +$SubType => undef + diff --git a/rt/html/Admin/Elements/PickCustomFields b/rt/html/Admin/Elements/PickCustomFields new file mode 100644 index 000000000..c2a30f9a3 --- /dev/null +++ b/rt/html/Admin/Elements/PickCustomFields @@ -0,0 +1,96 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@CustomFields == 0) { +

        <&|/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/html/Admin/Elements/PickObjects b/rt/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..b07a88240 --- /dev/null +++ b/rt/html/Admin/Elements/PickObjects @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@Objects == 0) { +

        <&|/l&>(None)

        +% } else { + +% my $count; +% foreach my $Object (@Objects) { + +% if (!$ReadOnly) { + +% } + +%# + + +% } +
        + +> + +% if ($Object->Name) { + <%$Object->Name%>
        +% } else { + (<%loc("no name")%>)
        +% } + <%$Object->can('Description') && $Object->Description%> +
        +%# <% $CustomFieldObj->FriendlyTypeComposite %> +%#
        +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 + diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser index 57b5fd8b3..01f294a59 100644 --- a/rt/html/Admin/Elements/QueueRightsForUser +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
          %while(my $ACE = $ACL->Next) { -
        • <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) +
        • <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) %}
        diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs index 0eec1fc6f..93522d0a2 100644 --- a/rt/html/Admin/Elements/QueueTabs +++ b/rt/html/Admin/Elements/QueueTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Queues/', @@ -71,8 +71,12 @@ if ($id) { path => "Admin/Queues/Templates.html?id=".$id, }, - G => { title => loc('Custom Fields'), - path => 'Admin/Queues/CustomFields.html?id='.$id, + G1 => { title => loc('Ticket Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket&id='.$id, + }, + + G2 => { title => loc('Transaction Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id, }, H => { title => loc('Group Rights'), @@ -90,8 +94,7 @@ if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQue }; $tabs->{"B"} = { title => loc('New queue'), path => "Admin/Queues/Modify.html?Create=1", - separator => 1, - }; + separator => 1, }; } # Now let callbacks add their extra tabs diff --git a/rt/html/Admin/Elements/SelectCustomFieldLookupType b/rt/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..ec9f740b9 --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + + +<%ARGS> +$Default=>undef +$Name => 'LookupType' + diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType index 76606c412..3f25b8e71 100644 --- a/rt/html/Admin/Elements/SelectCustomFieldType +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,10 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> @@ -54,5 +54,5 @@ my $cf = RT::CustomField->new($session{'CurrentUser'}); <%ARGS> $Default=>undef -$Name => 'Type' +$Name => 'TypeComposite' diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups index 175ce0657..92bd47587 100644 --- a/rt/html/Admin/Elements/SelectGroups +++ b/rt/html/Admin/Elements/SelectGroups @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights index 61a9e42ec..3e61d5071 100644 --- a/rt/html/Admin/Elements/SelectRights +++ b/rt/html/Admin/Elements/SelectRights @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,27 +42,30 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} - + + - + +% my $CFs = $Group->CustomFields; +% while (my $CF = $CFs->Next) { + +% } + +<& /Elements/Callback, GroupObj => $Group, results => \@results, %ARGS &>
        +% my %current_rights;

        <&|/l&>Current rights

        -% if ($ACLObj->Count() > 0) { -(<&|/l&>Check box to revoke right)
        -% } else { +% if ($ACLObj->Count() == 0) { <&|/l&>No rights granted.
        -% } +% } else { +(<&|/l&>Check box to revoke right)
        % while (my $right = $ACLObj->Next()) { % if ($right->RightName) { +% $current_rights{$right->RightName} = 1; <% loc($right->RightName) %>
        % } % } +% }

        <&|/l&>New rights

        >
        <&|/l&>Description:
        +<% $CF->Name %>: + +<& /Elements/EditCustomField, CustomField => $CF, Object => $Group &> +
        > <&|/l&>Enabled (Unchecking this box disables this group)
        -<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> <%INIT> @@ -124,6 +135,7 @@ if ($id) { Object => $Group, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $Group ); } #we're asking about enabled on the web page but really care about disabled. diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html index 3f17baa41..5237b1578 100644 --- a/rt/html/Admin/Groups/UserRights.html +++ b/rt/html/Admin/Groups/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> <& /Admin/Elements/GroupTabs, GroupObj => $GroupObj, diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html index 7c2cd504c..073440696 100644 --- a/rt/html/Admin/Groups/index.html +++ b/rt/html/Admin/Groups/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,36 +42,66 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', current_subtab => 'Admin/Groups/', Title => $title &> - - -
          +<%$caption%>:
            +%if ($Groups->Count == 0) { +
          • <&|/l&>No groups matching search criteria found. +% } +%my @ids; %while ( my $Group = $Groups->Next) { +% push @ids, $Group->Id;
          • <%$Group->Name || loc('(empty)')%>
            %}
          +%if (my $ids = join(',', @ids)) { +(<&|/l&>Download as a tab-delimited file)
          +%}

          - <&|/l&>Include disabled groups in listing. + <&|/l&>Include disabled groups in listing.
          +

          +
          +<&|/l&>Find groups whose <& /Elements/SelectGroups &>
          +
          +
          <%INIT> my $Groups = RT::Groups->new($session{'CurrentUser'}); - -if ($FindDisabledGroups) { - $Groups->{'find_disabled_rows'} = 1; -} - $Groups->LimitToUserDefinedGroups(); my $title = loc('Select a group'); +my $caption; +if (length $GroupString) { + $caption = loc("Groups matching search criteria"); + if ($GroupField =~ /^CustomField-(\d+)/) { + $Groups->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } + else { + $Groups->Limit( + FIELD => $GroupField, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } +} +else { + $caption = loc("User-defined groups"); +} <%ARGS> +$GroupString => undef +$GroupOp => '=' +$GroupField => 'Name' $FindDisabledGroups => 0 diff --git a/rt/html/Admin/Queues/CustomField.html b/rt/html/Admin/Queues/CustomField.html index a865dba71..5beba58c8 100644 --- a/rt/html/Admin/Queues/CustomField.html +++ b/rt/html/Admin/Queues/CustomField.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, @@ -78,7 +78,7 @@ my $subtabs = { <%ARGS> $CustomField => undef -$Queue => undef +$Queue => 0 <%ATTR> AutoFlush => 0 diff --git a/rt/html/Admin/Queues/CustomFields.html b/rt/html/Admin/Queues/CustomFields.html index 507c02d79..4d7e08875 100644 --- a/rt/html/Admin/Queues/CustomFields.html +++ b/rt/html/Admin/Queues/CustomFields.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,29 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> -<& /Admin/Elements/QueueTabs, id => $Queue->id, - current_tab => 'Admin/Queues/CustomFields.html?id='.$id, - QueueObj => $Queue, - subtabs => $subtabs, +<& /Admin/Elements/QueueTabs, + id => $Object->id, + current_tab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + current_subtab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + QueueObj => $Object, Title => $title &> -<& /Admin/Elements/EditCustomFields, title => $title, %ARGS &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &> <%INIT> -my $Queue = new RT::Queue($session{'CurrentUser'}); -$Queue->Load($id) || Abort(loc("Couldn't load queue", $id)); +my $Object = RT::Queue->new( $session{'CurrentUser'} ); -my $CustomFields = RT::CustomFields->new($RT::SystemUser); -$CustomFields->LimitToQueue($Queue->Id); -my $subtabs = { - A => { title => loc('New custom field'), - path => "Admin/Queues/CustomField.html?create=1&Queue=".$id, - } - }; +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); -my $title= loc('Edit Custom Fields for [_1]', $Queue->Name); <%ARGS> $id => undef +$SubType => 'RT::Queue-RT::Ticket' diff --git a/rt/html/Admin/Queues/GroupRights.html b/rt/html/Admin/Queues/GroupRights.html index 5e0d5b919..c5a12bfa3 100644 --- a/rt/html/Admin/Queues/GroupRights.html +++ b/rt/html/Admin/Queues/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Modify.html b/rt/html/Admin/Queues/Modify.html index 717a83af4..5517a80c0 100644 --- a/rt/html/Admin/Queues/Modify.html +++ b/rt/html/Admin/Queues/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, @@ -72,13 +72,13 @@ <&|/l&>Reply Address:
        CorrespondAddress %>"> -
        <&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1] +
        <&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1])
        <&|/l&>Comment Address: CommentAddress %>"> -
        <&|/l , $RT::CommentAddress&>(If left blank, will default to [_1] +
        <&|/l , $RT::CommentAddress&>(If left blank, will default to [_1])
        RT::<%$key%> -% if ($key =~ /Password/i) { +% if ($key =~ /Password(?!Length)/i) { Password not printed % } else { <%${'RT::'.$key} %> diff --git a/rt/html/Admin/Tools/index.html b/rt/html/Admin/Tools/index.html index c9a587371..49cfac3ee 100644 --- a/rt/html/Admin/Tools/index.html +++ b/rt/html/Admin/Tools/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $title = loc('System Tools'); diff --git a/rt/html/Admin/Users/CustomFields.html b/rt/html/Admin/Users/CustomFields.html new file mode 100644 index 000000000..5662c6c16 --- /dev/null +++ b/rt/html/Admin/Users/CustomFields.html @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $Object->id, + current_tab => "Admin/Users/CustomFields.html?$id=".$id, + current_subtab => "Admin/Users/CustomFields.html?id=".$id, + UserObj => $Object, + Title => $title + &> + + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::User' &> +<%INIT> +my $Object = RT::User->new( $session{'CurrentUser'} ); + +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); + + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Users/History.html b/rt/html/Admin/Users/History.html new file mode 100644 index 000000000..024a90b00 --- /dev/null +++ b/rt/html/Admin/Users/History.html @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $UserObj, + ShowHeaderModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Users/History.html?id='.$id; +my $UserObj = new RT::User($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("History of the user [_1]", $UserObj->Name); + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Users/Memberships.html b/rt/html/Admin/Users/Memberships.html new file mode 100644 index 000000000..3e632393f --- /dev/null +++ b/rt/html/Admin/Users/Memberships.html @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +

        <&|/l&>Groups

        + +<& /Elements/ShowMemberships, UserObj => $UserObj &> + +<%INIT> +my $UserObj = RT::User->new($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("Memberships of the user [_1]", $UserObj->Name); +my $current_tab = 'Admin/Users/Memberships.html?id='.$id; + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Users/Modify.html b/rt/html/Admin/Users/Modify.html index efa1f80de..8a24f9c4a 100644 --- a/rt/html/Admin/Users/Modify.html +++ b/rt/html/Admin/Users/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/UserTabs, id => $id, @@ -52,7 +52,7 @@ <& /Elements/ListActions, actions => \@results &> -
        + %if ($Create) { % } else { @@ -91,6 +91,11 @@
        +<&|/l&>Language: + +<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &> +
        <&|/l&>Extra info: @@ -199,17 +204,30 @@
        +
        +<& /Elements/TitleBoxStart, title => loc('Custom Fields') &> + +% my $CFs = $UserObj->CustomFields; +% while (my $CF = $CFs->Next) { + +% } + + +
        +<% $CF->Name %>: + +<& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &> +
        +<& /Elements/TitleBoxEnd &> <& /Elements/TitleBoxStart, title => loc('Comments about this user') &> - + <& /Elements/TitleBoxEnd &> %if ($UserObj->Privileged) {
        <& /Elements/TitleBoxStart, title => loc('Signature') &> - + <& /Elements/TitleBoxEnd &> % } @@ -236,46 +254,44 @@ else { $current_tab = 'Admin/Users/Modify.html?id='.$id; if ($id eq 'new') { - ( $val, $msg ) = $UserObj->Create( - Name => $Name, - EmailAddress => $ARGS{'EmailAddress'}, - Name => $ARGS{'Name'}, - Comments => $ARGS{'Comments'}, - Signature => $ARGS{'Signature'}, - EmailAddress => $ARGS{'EmailAddress'}, - FreeformContactInfo => $ARGS{'FreeformContactInfo'}, - Organization => $ARGS{'Organization'}, - RealName => $ARGS{'RealName'}, - NickName => $ARGS{'NickName'}, - Lang => $ARGS{'Lang'}, - EmailEncoding => $ARGS{'EmailEncoding'}, - WebEncoding => $ARGS{'WebEncoding'}, - ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, - ContactInfoSystem => $ARGS{'ContactInfoSystem'}, - Gecos => $ARGS{'Gecos'}, - ExternalAuthId => $ARGS{'ExternalAuthId'}, - AuthSystem => $ARGS{'AuthSystem'}, - HomePhone => $ARGS{'HomePhone'}, - WorkPhone => $ARGS{'WorkPhone'}, - MobilePhone => $ARGS{'MobilePhone'}, - PagerPhone => $ARGS{'PagerPhone'}, - Address1 => $ARGS{'Address1'}, - Address2 => $ARGS{'Address2'}, - City => $ARGS{'City'}, - State => $ARGS{'State'}, - Zip => $ARGS{'Zip'}, - Country => $ARGS{'Country'}, - Privileged => $ARGS{'Privileged'}, - Disabled => ($ARGS{'Enabled'} ? 0 : 1) - ); + ( $val, $msg ) = $UserObj->Create( + Name => $Name, + EmailAddress => $ARGS{'EmailAddress'}, + Name => $ARGS{'Name'}, + Comments => $ARGS{'Comments'}, + Signature => $ARGS{'Signature'}, + EmailAddress => $ARGS{'EmailAddress'}, + FreeformContactInfo => $ARGS{'FreeformContactInfo'}, + Organization => $ARGS{'Organization'}, + RealName => $ARGS{'RealName'}, + NickName => $ARGS{'NickName'}, + Lang => $ARGS{'Lang'}, + EmailEncoding => $ARGS{'EmailEncoding'}, + WebEncoding => $ARGS{'WebEncoding'}, + ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, + ContactInfoSystem => $ARGS{'ContactInfoSystem'}, + Gecos => $ARGS{'Gecos'}, + ExternalAuthId => $ARGS{'ExternalAuthId'}, + AuthSystem => $ARGS{'AuthSystem'}, + HomePhone => $ARGS{'HomePhone'}, + WorkPhone => $ARGS{'WorkPhone'}, + MobilePhone => $ARGS{'MobilePhone'}, + PagerPhone => $ARGS{'PagerPhone'}, + Address1 => $ARGS{'Address1'}, + Address2 => $ARGS{'Address2'}, + City => $ARGS{'City'}, + State => $ARGS{'State'}, + Zip => $ARGS{'Zip'}, + Country => $ARGS{'Country'}, + Privileged => $ARGS{'Privileged'}, + Disabled => ($ARGS{'Enabled'} ? 0 : 1) + ); + if ($val) { push @results, $msg; } else { push @results, loc('User could not be created: [_1]', $msg); - } - - # set the id, so the the menu will have the right info - $id = $UserObj->Id; + } } else { $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); $val = $UserObj->Id(); @@ -283,14 +299,13 @@ else { if ($val) { $title = loc("Modify the user [_1]", $UserObj->Name); - } + } # If the create failed else { $title = loc("Create a new user"); $Create = 1; - } - + } } @@ -298,49 +313,55 @@ else { # If we have a user to modify, lets try. if ($UserObj->Id && $id ne 'new') { - + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo Organization RealName NickName Lang EmailEncoding WebEncoding ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 - Address2 City State Zip Country + Address2 City State Zip Country ); - + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); -# {{{ Deal with special fields: Privileged, Enabled and Password -if ( ($SetPrivileged) and ( $Privileged != $UserObj->Privileged) ) { -my ($code, $msg) = $UserObj->SetPrivileged($Privileged); - push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); -} + # {{{ Deal with special fields: Privileged, Enabled + if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) { + my ($code, $msg) = $UserObj->SetPrivileged($Privileged); + push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); + } -#we're asking about enabled on the web page but really care about disabled. -if ($Enabled == 1) { - $Disabled = 0; -} -else { - $Disabled = 1; -} -if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { - my ($code, $msg) = $UserObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); -} + #we're asking about enabled on the web page but really care about disabled. + $Disabled = $Enabled ? 0 : 1; + + if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { + my ($code, $msg) = $UserObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } -#TODO: make this report errors properly -if ((defined $Pass1) and ($Pass1 ne '') and ($Pass1 eq $Pass2) and (!$UserObj->IsPassword($Pass1))) { - my ($code, $msg); - ($code, $msg) = $UserObj->SetPassword($Pass1); - push @results, loc('Password: [_1]', loc_fuzzy($msg)); -} elsif ( $Pass1 && ($Pass1 ne $Pass2)) { - push @results, loc("Passwords do not match."); + # }}} } -# }}} +if ( $UserObj->Id ) { + my $password_not_set; + # Deal with Password field + if ( !$Pass1 and !$Pass2 ) { + $password_not_set = 1; + } elsif ( $Pass1 ne $Pass2 ) { + $password_not_set = 1; + push @results, loc("Passwords do not match."); + } elsif ( $Pass1 eq $Pass2 and !$UserObj->IsPassword($Pass1) ) { + my ($code, $msg) = $UserObj->SetPassword($Pass1); + push @results, loc_fuzzy($msg); + $password_not_set = 1 unless $code; + } + if ($id eq 'new' and $password_not_set) { + push @results, loc("A password was not set, so user won't be able to login."); + } } @@ -354,6 +375,11 @@ if ($UserObj->Privileged()) { } # }}} + +# set the id, so the the menu will have the right info, this needs to +# be done here to avoid creating and then modifying a user +$id = $UserObj->Id; + diff --git a/rt/html/Admin/Users/index.html b/rt/html/Admin/Users/index.html index f4cf2f0fc..1bbe867f7 100644 --- a/rt/html/Admin/Users/index.html +++ b/rt/html/Admin/Users/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Select a user') &> <& /Admin/Elements/UserTabs, current_tab => 'Admin/Users/', current_subtab => 'Admin/Users/', Title => loc('Select a user') &> - - - -<%$caption%>:
        -
          +

          <%$caption%>

          +

          <&|/l&>Select a user:

          +
            %if ($users->Count == 0) { -
          • <&|/l&>No users matching search criteria found. +
          • <&|/l&>No users matching search criteria found.
          • % } +%my @ids; %while ( $user = $users->Next) { +% push @ids, $user->Id;
          • <%$user->Name || loc('(no name listed)')%>
          • %} -
          +%if (my $ids = join(',', @ids)) { +(<&|/l&>Download as a tab-delimited file)
          +%} +

          <&|/l&>Find people whose <& /Elements/SelectUsers &>
          - <&|/l&>Include disabled users in search. + <&|/l&>Include disabled users in search.
          @@ -78,19 +81,26 @@ if ($FindDisabledUsers) { $users->{'find_disabled_rows'} = 1; } -unless (defined $UserString) { - $users->LimitToPrivileged(); - $caption = loc("Privileged users"); -} -else { +if (length $UserString) { $caption = loc("Users matching search criteria"); - - if ($UserString) { - $users->Limit( FIELD => $UserField, - OPERATOR => $UserOp, - VALUE => $UserString); - + if ($UserField =~ /^CustomField-(\d+)/) { + $users->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } + else { + $users->Limit( + FIELD => $UserField, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } } +else { + $caption = loc("Privileged users"); + $users->LimitToPrivileged; } <%ARGS> diff --git a/rt/html/Admin/autohandler b/rt/html/Admin/autohandler new file mode 100644 index 000000000..def61010a --- /dev/null +++ b/rt/html/Admin/autohandler @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +$m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight( + Right => 'ShowConfigTab', + Object => $RT::System, +); + \ No newline at end of file diff --git a/rt/html/Admin/index.html b/rt/html/Admin/index.html index 5aec88b9d..01ba24d2d 100644 --- a/rt/html/Admin/index.html +++ b/rt/html/Admin/index.html @@ -1,11 +1,11 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# -%# (Except where explicitly superseded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices), %# %# %# LICENSE: @@ -31,7 +31,7 @@ %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) +%# community by submitting them to Best Practical Solutions, LLC.), %# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with @@ -42,21 +42,58 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('RT Administration') &> <& /Admin/Elements/Tabs, Title => loc('RT Administration') &> +<%init> + + + +my $tabs = { + A => { + title => loc('Users'), + path => 'Admin/Users/index.html', + description => loc('Manage users and passwords'), + }, + B => { + title => loc('Groups'), + path => 'Admin/Groups/index.html', + description => loc('Manage groups and group membership'), + }, + C => { + title => loc('Queues'), + path => 'Admin/Queues/index.html', + description => loc('Manage queues and queue-specific properties'), + }, + D => { + 'title' => loc('Custom Fields'), + description => loc('Manage custom fields and custom field values'), + path => 'Admin/CustomFields/index.html', + }, + E => { + 'title' => loc('Global'), + path => 'Admin/Global/index.html', + description => + loc('Manage properties and configuration which apply to all queues'), + }, + F => { + 'title' => loc('Tools'), + path => 'Admin/Tools/index.html', + description => loc('Use other RT administrative tools') + }, +}; + + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + + + + diff --git a/rt/html/Approvals/Display.html b/rt/html/Approvals/Display.html index 8b5a6c33f..d9d6df582 100644 --- a/rt/html/Approvals/Display.html +++ b/rt/html/Approvals/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& Elements/Tabs, diff --git a/rt/html/Approvals/Elements/Approve b/rt/html/Approvals/Elements/Approve index f4f015f68..bf786fb03 100644 --- a/rt/html/Approvals/Elements/Approve +++ b/rt/html/Approvals/Elements/Approve @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <% loc("#[_1]: [_2]", $ticket->Id, $ticket->Subject) %> (<%loc($ticket->Status)%>) diff --git a/rt/html/Approvals/Elements/PendingMyApproval b/rt/html/Approvals/Elements/PendingMyApproval index abc76cc00..f13ddf0f3 100644 --- a/rt/html/Approvals/Elements/PendingMyApproval +++ b/rt/html/Approvals/Elements/PendingMyApproval @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my ($i, $class); % my %done; diff --git a/rt/html/Approvals/Elements/ShowDependency b/rt/html/Approvals/Elements/ShowDependency index b86709665..e8d0b00d5 100644 --- a/rt/html/Approvals/Elements/ShowDependency +++ b/rt/html/Approvals/Elements/ShowDependency @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my $approving = $Ticket->DependedOnBy(); % if ($approving->Count) {

          <&|/l&>Tickets which depend on this approval:

          diff --git a/rt/html/Approvals/Elements/Tabs b/rt/html/Approvals/Elements/Tabs index 99cdec8ef..03bdc262e 100644 --- a/rt/html/Approvals/Elements/Tabs +++ b/rt/html/Approvals/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Approvals/', diff --git a/rt/html/Approvals/index.html b/rt/html/Approvals/index.html index 93d979a59..88c277c1e 100644 --- a/rt/html/Approvals/index.html +++ b/rt/html/Approvals/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("My approvals") &> <& /Approvals/Elements/Tabs, Title => loc("My approvals") &> diff --git a/rt/html/Download/CustomFieldValue/dhandler b/rt/html/Download/CustomFieldValue/dhandler new file mode 100644 index 000000000..521968024 --- /dev/null +++ b/rt/html/Download/CustomFieldValue/dhandler @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%perl> +my $id; +my $arg = $m->dhandler_arg; # get rest of path +if ($arg =~ /^(\d+)\//) { + $id = $1; +} +else { + Abort("Corrupted customfieldvalue URL."); +} +my $OCFV = RT::ObjectCustomFieldValue->new($session{'CurrentUser'}); +$OCFV->Load($id) || Abort("OCFV '$id' could not be loaded"); + +unless ($OCFV->id) { + Abort("Bad OCFV id. Couldn't find OCFV '$id'\n"); +} + +my $content_type = $OCFV->ContentType || 'text/plain'; + +unless ($RT::TrustHTMLAttachments) { + $content_type = 'text/plain' if ($content_type =~ /^text\/html/i); +} + +$r->content_type( $content_type ); +$m->clear_buffer(); +$m->out($OCFV->LargeContent); +$m->abort; + +<%attr> +AutoFlush => 0 + diff --git a/rt/html/Download/Tabular/dhandler b/rt/html/Download/Tabular/dhandler new file mode 100644 index 000000000..3965a990e --- /dev/null +++ b/rt/html/Download/Tabular/dhandler @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%perl> +my ($class, $filename, @ids); +my $arg = $m->dhandler_arg; # get rest of path +if ($arg =~ /^(\w+)\/([,\d]+)(?:\/([^\/]+))?/) { + $class = "RT::$1"; + $filename = $3 || "$1s.tsv"; + @ids = sort split(/,+/, $2); +} +else { + Abort("Corrupted tabular URL."); +} + +my @cols = $class->BasicColumns or return; + +#$r->content_type( 'application/octet-stream' ); +$r->content_type( 'text/plain' ); +$r->headers_out->{'Content-Disposition'} = "attachment; filename=$filename"; +$m->clear_buffer(); +$m->out(join("\t", "Id", map $_->[1], @cols), "\n"); +foreach my $id (@ids) { + my $obj = $class->new; + $obj->Load($id) or next; + $m->out(join("\t", map $obj->$_, "Id", map $_->[0], @cols), "\n"); +} +$m->abort; + +<%attr> +AutoFlush => 0 + diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd index f1c794b37..e1d1edb7c 100644 --- a/rt/html/Elements/BevelBoxRaisedEnd +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
          diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart index ca504e4b2..6c5a6137e 100644 --- a/rt/html/Elements/BevelBoxRaisedStart +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} + <%perl> -my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page ); +my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString ); my $item = 0; -$$maxitems = 0; foreach my $col (@Format) { $item++; - $$maxitems = $item if $item > $$maxitems; if ( $col->{title} eq 'NEWLINE' ) { - $m->out(''); - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{\n}); + $item++; + } + + $item = 0; + $m->out(qq{\n}); } else { - $m->out('' ); +$m->out('' ); my $item; foreach my $column (@Format) { if ( $column->{title} eq 'NEWLINE' ) { - while ($item < $maxitems) { - $m->out("\n"); - $item++; - } - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{\n}); + $item++; + } + $item = 0; $m->out(''); - $m->out( '' ); + $m->out('' ); next; } $item++; - $m->out(''); diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket index 70c94e78f..bd60bbddf 100644 --- a/rt/html/Elements/CreateTicket +++ b/rt/html/Elements/CreateTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -
          +%# END BPS TAGGED BLOCK }}} + <&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&> [_1] diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField new file mode 100644 index 000000000..d2398c9da --- /dev/null +++ b/rt/html/Elements/EditCustomField @@ -0,0 +1,89 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my $Values; +if ($Object) { + $Values = $Object->CustomFieldValues($CustomField->id); + $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) ); + $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', ''); +} +my $Type = $CustomField->Type; + +return unless ($Type); # if we can't see the type, all hell will break loose. + +my $MaxValues = $CustomField->MaxValues; +if ($MaxValues == 1 and $Object and $Values) { + # what exactly is this doing? Without the "unless" it breaks RTFM + # transaction extraction into articles. + $Default = ($Values->First ? $Values->First->Content : '') unless $Default; + $Values->GotoFirstItem; +} +# The "Magic" hidden input causes RT to know that we were trying to edit the field, even if +# we don't see a value later, since browsers aren't compelled to submit empty form fields +$m->out("\n".''."\n"); + +return $m->comp( + "EditCustomField$Type", + %ARGS, + Rows => $Rows, + Cols => $Cols, + Default => $Default, + Object => $Object, + Values => $Values, + MaxValues => $MaxValues, + Multiple => ($MaxValues != 1), + NamePrefix => $NamePrefix, + CustomField => $CustomField, +); + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols => 15 +$Default => undef + diff --git a/rt/html/Elements/EditCustomFieldBinary b/rt/html/Elements/EditCustomFieldBinary new file mode 100644 index 000000000..002825660 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldBinary @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +%# XXX - let user download the file(s) here? +<% $value->Content %>
          +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef + diff --git a/rt/html/Elements/EditCustomFieldFreeform b/rt/html/Elements/EditCustomFieldFreeform new file mode 100644 index 000000000..c097ee0a9 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldFreeform @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Multiple) { + +% } else { + +% } +<%INIT> +if ($Multiple and $Values) { + $Default = ''; + while (my $value = $Values->Next ) { + $Default .= $value->Content."\n"; + } +} + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Cols +$Rows + diff --git a/rt/html/Elements/EditCustomFieldImage b/rt/html/Elements/EditCustomFieldImage new file mode 100644 index 000000000..b378ceae6 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldImage @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<& ShowCustomFieldImage, Object => $value &> +
          +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef + diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect new file mode 100644 index 000000000..db33a6839 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldSelect @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Cols +$Rows + diff --git a/rt/html/Elements/EditCustomFieldText b/rt/html/Elements/EditCustomFieldText new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldText @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +
          +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows + diff --git a/rt/html/Elements/EditCustomFieldWikitext b/rt/html/Elements/EditCustomFieldWikitext new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldWikitext @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +
          +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { + +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; + +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows + diff --git a/rt/html/Elements/EditLinks b/rt/html/Elements/EditLinks index b66291f30..68c08dd16 100755 --- a/rt/html/Elements/EditLinks +++ b/rt/html/Elements/EditLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
          diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback index cbec1883d..937e923a1 100644 --- a/rt/html/Elements/Callback +++ b/rt/html/Elements/Callback @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,43 +42,45 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%once> -my (%cache, $check); +my %cache; <%init> -# checks for inode change time for each callback directory -my $new_check = join( - $;, map { $_->[1] => (stat("$_->[1]/Callbacks"))[10] } $m->interp->resolver->comp_root_array -) or return; - $Page = $m->callers(1)->path unless ($Page); -my $callbacks; -if ($new_check eq $check) { - $callbacks = $cache{$Page,$_CallbackName}; -} -else { - $check = $new_check; -} +my $CacheKey = "Callback--$Page--$_CallbackName"; +my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey); if (!$callbacks) { - my $path = "/Callbacks/*$Page/$_CallbackName"; - $callbacks = [ $m->interp->resolver->glob_path($path) ]; - @$callbacks = grep !/^\.|~$/, @$callbacks; #skip backup files - - #skip files without a package - my $invalid_base = "/Callbacks/$Page/$_CallbackName"; - @$callbacks = grep !/^$invalid_base$/, @$callbacks; - - + my $path = "/Callbacks/*$Page/$_CallbackName"; - $cache{$Page,$_CallbackName} = $callbacks; + # Due to API changes after Mason 1.28, we have to check for which + # version we're running when getting the component roots + my @roots = map { $_->[1] } + $HTML::Mason::VERSION <= 1.28 + ? $m->interp->resolver->comp_root_array + : $m->interp->comp_root_array; + + my %seen; + + for my $root (@roots) { + push @$callbacks, + # Skip backup files, files without a leading package name, + # and files we've already seen + grep { !/^\.|~$/ + and $_ ne "/Callbacks/$Page/$_CallbackName" + and not $seen{$_}++ } + $m->interp->resolver->glob_path($path, $root); + } + + $m->notes($CacheKey => $callbacks); + $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode; } my @rv; foreach my $comp (sort @$callbacks) { - push @rv, $m->comp($comp, %ARGS) if $m->comp_exists($comp); + push @rv, $m->comp($comp, %ARGS); } return @rv; diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox index 146de6a7a..f2256fb78 100644 --- a/rt/html/Elements/Checkbox +++ b/rt/html/Elements/Checkbox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -> +%# END BPS TAGGED BLOCK }}} +> <%ARGS> $Name => undef diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header index 2d1574dea..9ed4be8ec 100644 --- a/rt/html/Elements/CollectionAsTable/Header +++ b/rt/html/Elements/CollectionAsTable/Header @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,16 +20,32 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# 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> @Format => undef +$FormatString => undef $AllowSorting => undef $Order=>undef $BaseURL => undef @@ -32,53 +54,63 @@ $Rows => undef $Page => undef $maxitems => undef -
           
          '); + $m->out(''); my $title = $col->{title}; $title =~ s/^__(.*)__$/$1/o; - $title = ( $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $title, - Attr => 'title' - ) - || $title - ); - if ( $AllowSorting + $title = ( + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $title, + Attr => 'title' + ) + || $title + ); + if ( + $AllowSorting && $col->{'attribute'} - && $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' ) - ) + && $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + ) { $m->out( - 'comp( '/Elements/QueryString', %generic_query_args, OrderBy => ( - $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' - ) + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) || $col->{'attribute'} ), Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' ) - ). - '">' . loc($title) . '' + ) + . '">' + . loc($title) . '' ); } else { diff --git a/rt/html/Elements/CollectionAsTable/ParseFormat b/rt/html/Elements/CollectionAsTable/ParseFormat index c7b709bff..57434efe2 100644 --- a/rt/html/Elements/CollectionAsTable/ParseFormat +++ b/rt/html/Elements/CollectionAsTable/ParseFormat @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,44 +20,59 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# 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> $Format <%init> -use Regexp::Common qw(delimited); +use Regexp::Common; my @Columns; -#my $quoted = qr[$RE{delimited}{-delim=>qq{\'\"}}|(?:\{|\}|\w|\.)+]; -my $justquoted = qr[$RE{delimited}{-delim=>qq{\'\"}}]; -#my $quoted = $RE{quoted}{-esc}; -my $word = qr [(?:\{|\}|\w|\.)+]; -while ($Format =~ /($justquoted|$word)/igx) { +while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) { my $col = $1; - if ($col =~ /^$RE{quoted}{-esc}$/) { + if ($col =~ /^$RE{quoted}$/o) { substr($col,0,1) = ""; substr($col,-1,1) = ""; } my $colref; - if ( $col =~ s/\/STYLE:(.*?)$//io ) { + + if ( $col =~ s!/STYLE:([^/]+)!!io ) { $colref->{'style'} = $1; } - if ( $col =~ s/\/CLASS:(.*?)$//io ) { + if ( $col =~ s!/CLASS:([^/]+)!!io ) { $colref->{'class'} = $1; } - if ( $col =~ s/\/TITLE:(.*?)$//io ) { + if ( $col =~ s!/TITLE:([^/]+)!!io ) { $colref->{'title'} = $1; } + if ( $col =~ s!/ALIGN:([^\/]+)!!io ) { + $colref->{'align'} = $1; + } if ( $col =~ /__(.*?)__/gio ) { my @subcols; while ( $col =~ s/^(.*?)__(.*?)__//o ) { diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 926317be9..3316bc027 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,14 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# 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> $i => undef @Format => undef @@ -32,35 +53,56 @@ $Warning => undef <%PERL> -$m->out( '
            
          '); + $m->out('out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); + $m->out('>'); foreach my $subcol ( @{ $column->{output} } ) { if ( $subcol =~ /^__(.*?)__$/o ) { - my $col = $1; - my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value'); + my $col = $1; + my $value = $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col, + Attr => 'value' + ); + my @out; + + if ( $value && ref($value) ) { + + # All HTML snippets are returned by the callback function + # as scalar references. Data fetched from the objects are + # plain scalars, and needs to be escaped properly. + @out = + map { + ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) + } &{$value}( $record, $i ) + ; + } + else { - if ( $value && ref($value)) { - $m->out( &{ $value } ( $record, $i ) ); - } else { - $m->out($value ); + # Simple value; just escape it. + @out = $m->interp->apply_escapes( $value => 'h' ); } + s/\n/
          /gs for @out; + $m->out( @out ); } else { - $m->out( Encode::decode_utf8($subcol) ); + $m->out($subcol); } } $m->out('
          @@ -67,7 +67,7 @@ @@ -76,7 +76,7 @@ @@ -85,7 +85,7 @@ @@ -94,7 +94,7 @@ @@ -103,7 +103,7 @@ @@ -114,9 +114,12 @@ @@ -51,20 +51,12 @@ % } <& /Elements/Callback, %ARGS &>
          -<&|/l, '»|«', - $RT::VERSION, - '2004', - 'Best Practical Solutions, LLC', -&>[_1] RT [_2] Copyright 1996-[_3] [_4].
          +<&|/l, '»|«', $RT::VERSION, '2005', 'Best Practical Solutions, LLC', &>[_1] RT [_2] Copyright 1996-[_3] [_4].
          % if (!$Menu) { <&|/l&>Distributed under version 2 of the GNU GPL.
          <&|/l, 'sales@bestpractical.com' &>To inquire about support, training, custom development or licensing, please contact [_1].
          % }
          -% if ($Debug) { -
          -<&|/l&>Time to display: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%> -% } % if ($Debug >= 2 ) { % require Data::Dumper; % my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); @@ -72,6 +64,7 @@ <%$d->Dump() %> % } +
          <&|/l&>Time to display: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%>
          % if ($Menu) { diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket index 393b28f89..869d57ef1 100644 --- a/rt/html/Elements/GotoTicket +++ b/rt/html/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 5d9bbb08b..8c3775bba 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# @@ -77,16 +77,18 @@ ONLOAD=" >
          @@ -57,7 +57,7 @@ <&|/l&>Depends on: % while (my $link = $Object->DependsOn->Next) { - + <& ShowLink, URI => $link->TargetURI &>
          % }
          % while (my $link = $Object->DependedOnBy->Next) { % my $member = $link->BaseObj; - + <& ShowLink, URI => $link->BaseURI &>
          % }
          <&|/l&>Parents: % while (my $link = $Object->MemberOf->Next) { - + <& ShowLink, URI => $link->TargetURI &>
          % }
          <&|/l&>Children: % while (my $link = $Object->Members->Next) { - + <& ShowLink, URI => $link->BaseURI &>
          % }
          <&|/l&>Refers to: % while (my $link = $Object->RefersTo->Next) { - + <& ShowLink, URI => $link->TargetURI &>
          %}
          <&|/l&>Referred to by: % while (my $link = $Object->ReferredToBy->Next) { - + <& ShowLink, URI => $link->BaseURI &>
          % }

          <&|/l&>New Links

          % if (ref($Object) eq 'RT::Ticket') { -<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
          +<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces. +<& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &> +
          % } elsif (ref($Object) eq 'RT::Queue') { -<&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.
          +<&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces. +
          % } else { <&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.
          % } diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error index 3aa77a51e..bc5a1880a 100644 --- a/rt/html/Elements/Error +++ b/rt/html/Elements/Error @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, %ARGS, error => $error &> <& /Elements/Header, Code => $Code, Why => $Why &> <& /Elements/Tabs &> @@ -53,9 +53,11 @@ <%$Details%> <& /Elements/TitleBoxEnd &> - - +<%cleanup> +$m->comp('/Elements/Footer'); +$m->abort(); + <%args> $Code => undef diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 213761e91..4c90acfa3 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Menu) {
          - +
          <%loc(" width="230" height="50">     % if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) { <&|/l&>Skip Menu | +%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { <&|/l&>Preferences +% } <& /Elements/Callback, %ARGS &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -| <&|/l&>Logout +| <&|/l&>Logout % }
          <&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] @@ -105,7 +107,7 @@ $r->headers_out->{'Cache-control'} = 'no-cache'; <%ARGS> $Prefs => '/User/Prefs.html' $Focus => 'focus' -$Title => undef +$Title => 'RT' $Code => undef $Refresh => 0 $Why => undef diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions index 344fe9e5a..8433d17e0 100644 --- a/rt/html/Elements/ListActions +++ b/rt/html/Elements/ListActions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { <& /Elements/TitleBoxStart, title => loc('Results') &>
            diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login index 25ded9ff3..1d4bfd5ec 100644 --- a/rt/html/Elements/Login +++ b/rt/html/Elements/Login @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { $r->content_type("text/plain"); @@ -67,7 +67,7 @@ if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { contentbg=>"#cccccc" &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -
            + diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index 0e57585c5..398e3ab07 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# font size depends on level % if ($level ge 3) { % $size = $basesize-(6); @@ -69,16 +69,17 @@ % } % my $style=""; % if ($sep) { -% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% $style="minor"; % } elsif ($level == 0 ) { -% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% $style="major"; % } % if ($toptabs->{$tab}->{'separator'}) { % $sep=1; % } else { % $sep=0; % } -
          • {$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; +
          • <% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%> %# Second-level items diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox index 5faa9575c..dd48bec9a 100644 --- a/rt/html/Elements/MessageBox +++ b/rt/html/Elements/MessageBox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK - +%# END BPS TAGGED BLOCK }}} + <%INIT> my ($message); diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests index 4e1bf3eaf..172b4a4fa 100644 --- a/rt/html/Elements/MyRequests +++ b/rt/html/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc("[_1] newest unowned tickets", $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,9 +61,10 @@ my $rows = $RT::MyRequestsLength; my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets index 9f30a893b..cf5225abc 100644 --- a/rt/html/Elements/MyTickets +++ b/rt/html/Elements/MyTickets @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc('[_1] highest priority tickets I own', $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,10 +61,11 @@ my $rows = $RT::MyTicketsLength; my $Query = " Owner = '".$session{'CurrentUser'}->Id."' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index 4670a8bb2..3d7241dad 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
          • <&|/l&>Username:
            @@ -76,7 +76,7 @@ % if ($actions->{"$action"}->{'html'}) { % push @actions, $actions->{"$action"}->{'html'}; % } else { -% push @actions, "{$action}->{'path'}."\">".$actions->{$action}->{'title'}.""; +% push @actions, qq|{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}.""; % } % } <% join(" | ", @actions) | n %> @@ -93,11 +93,12 @@
            <%$AppName%>
            - +<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> +%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; <%INIT> foreach my $tab (sort keys %{$toptabs}) { - if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; $toptabs->{$tab}->{"current_subtab"} = $current_tab; } diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString index cbec29a30..7d41f15e0 100644 --- a/rt/html/Elements/QueryString +++ b/rt/html/Elements/QueryString @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my @params; while ( (my $key, my $value) = each %ARGS ){ diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate index 10cfbd3c0..0d2489c61 100644 --- a/rt/html/Elements/QuickCreate +++ b/rt/html/Elements/QuickCreate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &> diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch index 103c760c7..d54f72e88 100644 --- a/rt/html/Elements/Quicksearch +++ b/rt/html/Elements/Quicksearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,42 +42,40 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> - - - + + + <%PERL> my $i; while (my $queue = $Queues->Next) { - my $new_q = "Queue = '".$queue->Name."' AND Status = 'new'"; - my $open_q = "Queue = '".$queue->Name."' AND Status = 'open'"; - my $all_q = "Queue = '".$queue->Name."' AND (Status = 'open' OR Status = 'new')"; + next unless ($queue->CurrentUserHasRight('ShowTicket')); + my $name = $queue->Name; + $name =~ s|(['\\])|\\$1|g; + + my $new_q = "Queue = '$name' AND Status = 'new'"; + my $open_q = "Queue = '$name' AND Status = 'open'"; + my $all_q = "Queue = '$name' AND (Status = 'open' OR Status = 'new')"; - $Tickets->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "open"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $open = $Tickets->Count(); - - $Tickets->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "new"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $new = $Tickets->Count(); - + $Tickets->FromSQL($open_q); + my $open = $Tickets->Count(); + $Tickets->FromSQL($new_q); + my $new = $Tickets->Count(); + $i++; -% $i++; - - - + + + % }
            <&|/l&>Queue<&|/l&>New<&|/l&>Open<&|/l&>Queue<&|/l&>New<&|/l&>Open
            <%$queue->Name%><%$new%><%$open%><%$queue->Name%><%$new%><%$open%>
            diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap index a6d387cae..dade91494 100644 --- a/rt/html/Elements/RT__Ticket/ColumnMap +++ b/rt/html/Elements/RT__Ticket/ColumnMap @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# %# -%# (Except where explictly superceded by other copyright notices) +%# (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 @@ -14,25 +20,37 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# 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> $Name => undef $Attr => undef -<%perl> -return ColumnMap($Name, $Attr); - -<%INIT> -our ( $COLUMN_MAP, $CUSTOM_FIELD_MAP ); +<%ONCE> +our ( $COLUMN_MAP ); sub ColumnMap { my $name = shift; @@ -45,46 +63,52 @@ sub ColumnMap { # now, let's deal with harder things, like Custom Fields - elsif ( $name =~ /^(?:CF|CustomField).(.*)$/ ) { + elsif ( $name =~ /^(?:CF|CustomField)\.\{(.+)\}$/ ) { my $field = $1; - my $cf; - if ( $CUSTOM_FIELD_MAP->{$field} ) { - $cf = $CUSTOM_FIELD_MAP->{$field}; - } - else { - - $cf = RT::CustomField->new( $session{'CurrentUser'} ); - - if ( $field =~ /^(.+?)\.{(.+)}$/ ) { - $cf->LoadByNameAndQueue( Queue => $1, Name => $2 ); - } - else { - $field = $1 if $field =~ /^{(.+)}$/; # trim { } - $cf->LoadByNameAndQueue( Queue => "0", Name => $field ); - } - $CUSTOM_FIELD_MAP->{$field} = $cf if ( $cf->id ); - } - - unless ( $cf->id ) { - return undef; - } if ( $attr eq 'attribute' ) { return (undef); } elsif ( $attr eq 'title' ) { - return ( $cf->Name ); + return ( $field ); } elsif ( $attr eq 'value' ) { - my $value = eval "sub { - my \$values = \$_[0]->CustomFieldValues('" . $cf->id . "'); - return ( join( ', ', map { \$_->Content } \@{ \$values->ItemsArrayRef } )) - }" || die $@; - return ($value); + # Display custom field contents, separated by newlines. + # For Image custom fields we also show a thumbnail here. + return sub { + my $values = $_[0]->CustomFieldValues($field); + return map { + ( + ($_->CustomFieldObj->Type eq 'Image') + ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) + : $_->Content + ), + \'
            ', + } @{ $values->ItemsArrayRef } + }; } } } +sub LinkCallback { + my $method = shift; + + my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type}; + my $mode_uri = $mode.'URI'; + my $local_type = 'Local'.$mode; + + return sub { + map { + \'', + ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ), + \'
            ', + } @{ $_[0]->Links($mode,$type)->ItemsArrayRef } + } +} + $COLUMN_MAP = { QueueName => { attribute => 'Queue', @@ -103,7 +127,7 @@ $COLUMN_MAP = { }, Status => { attribute => 'Status', - value => sub { return $_[0]->Status } + value => sub { return loc($_[0]->Status) } }, Subject => { attribute => 'Subject', @@ -119,10 +143,10 @@ $COLUMN_MAP = { if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' ) or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) { - return "" . loc('(pending approval)') . ""; + return \'', loc('(pending approval)'), \''; } else { - return "" . loc('(pending other Collection)') . ""; + return \'', loc('(pending other Collection)'), \''; } } else { @@ -137,10 +161,12 @@ $COLUMN_MAP = { }, InitialPriority => { attribute => 'InitialPriority', + name => 'Initial Priority', value => sub { return $_[0]->InitialPriority } }, FinalPriority => { attribute => 'FinalPriority', + name => 'Final Priority', value => sub { return $_[0]->FinalPriority } }, EffectiveId => { @@ -153,14 +179,17 @@ $COLUMN_MAP = { }, TimeWorked => { attribute => 'TimeWorked', + title => 'Time Worked', value => sub { return $_[0]->TimeWorked } }, TimeLeft => { attribute => 'TimeLeft', + title => 'Time Left', value => sub { return $_[0]->TimeLeft } }, TimeEstimated => { attribute => 'TimeEstimated', + title => 'Time Estimated', value => sub { return $_[0]->TimeEstimated } }, Requestors => { @@ -188,7 +217,7 @@ $COLUMN_MAP = { value => sub { return $_[0]->CreatedObj->AgeAsString } }, LastUpdatedRelative => { - title => 'LastUpdated', + title => 'Last Updated', attribute => 'LastUpdated', value => sub { return $_[0]->LastUpdatedObj->AgeAsString } }, @@ -203,7 +232,7 @@ $COLUMN_MAP = { value => sub { my $date = $_[0]->DueObj; if ($date && $date->Unix > 0 && $date->Unix < time()) { - return '' . $date->AgeAsString . ''; + return (\'' , $date->AgeAsString , \''); } else { return $date->AgeAsString; } @@ -228,14 +257,17 @@ $COLUMN_MAP = { }, CreatedBy => { attribute => 'CreatedBy', + title => 'Created By', value => sub { return $_[0]->CreatorObj->Name } }, LastUpdated => { attribute => 'LastUpdated', + title => 'Last Updated', value => sub { return $_[0]->LastUpdatedObj->AsString } }, LastUpdatedBy => { attribute => 'LastUpdatedBy', + title => 'Last Updated By', value => sub { return $_[0]->LastUpdatedByObj->Name } }, Told => { @@ -251,144 +283,18 @@ $COLUMN_MAP = { value => sub { return $_[0]->ResolvedObj->AsString } }, - DependedOnBy => { - value => sub { - my $links = $_[0]->DependedOnBy; - return ( - join( - "
            ", - map { - '' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Members => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "
            ", - map { - '' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Children => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "
            ", - map { - '' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - ReferredToBy => { - value => sub { - my $links = $_[0]->ReferredToBy; - return ( - join( - "
            ", - map { - '' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - - DependsOn => { - value => sub { - my $links = $_[0]->DependsOn; - return ( - join( - "
            ", - map { - '' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - MemberOf => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "
            ", - map { - '' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Parents => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "
            ", - map { - '' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - RefersTo => { - value => sub { - my $links = $_[0]->RefersTo; - return ( - join( - "
            ", - map { - '' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, + # Everything from LINKTYPEMAP + (map { + $_ => { value => LinkCallback( $_ ) } + } keys %RT::Ticket::LINKTYPEMAP), '_CLASS' => { value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } }, }; - - - -# }}} + +<%init> $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap'); - +return ColumnMap($Name, $Attr); + diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh index 3cfb7c663..9f241d279 100644 --- a/rt/html/Elements/Refresh +++ b/rt/html/Elements/Refresh @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField index cd16bbaee..ea1528c03 100644 --- a/rt/html/Elements/SelectAttachmentField +++ b/rt/html/Elements/SelectAttachmentField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator index 2264f2dcf..8f7ea618b 100644 --- a/rt/html/Elements/SelectCustomFieldOperator +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} > <%init> diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation index b3f3868b3..ccf0c1121 100644 --- a/rt/html/Elements/SelectDateRelation +++ b/rt/html/Elements/SelectDateRelation @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator index 5e5d1a4b9..0f8deea89 100644 --- a/rt/html/Elements/SelectEqualityOperator +++ b/rt/html/Elements/SelectEqualityOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} -
            +% #Manually flush the content buffer after each titlebox is displayed +% $m->flush_buffer(); + <%ARGS> $title => undef $content => undef diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart index a0c733543..804e5cfaa 100644 --- a/rt/html/Elements/TitleBoxStart +++ b/rt/html/Elements/TitleBoxStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} undef $bodyclass => undef $title_href => undef $title => undef -$title_class => undef +$title_class => '' $titleright_href => undef $titleright => undef diff --git a/rt/html/NoAuth/Logout.html b/rt/html/NoAuth/Logout.html index 85fbc9e57..b6a238bac 100644 --- a/rt/html/NoAuth/Logout.html +++ b/rt/html/NoAuth/Logout.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} RT: Logout diff --git a/rt/html/NoAuth/Reminder.html b/rt/html/NoAuth/Reminder.html index 90c282a8b..0793f6c96 100644 --- a/rt/html/NoAuth/Reminder.html +++ b/rt/html/NoAuth/Reminder.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, title => loc('Password Reminder') &> <&|/l&>Not yet implemented. diff --git a/rt/html/NoAuth/images/autohandler b/rt/html/NoAuth/images/autohandler index 86f3b2286..2e428c157 100644 --- a/rt/html/NoAuth/images/autohandler +++ b/rt/html/NoAuth/images/autohandler @@ -15,7 +15,10 @@ if ($file =~ /\.(gif|png|jpe?g)$/i) { die unless (-f $file && -r $file); $r->content_type($type); open (FILE, "<$file") || die; -$m->out($_) while (); -close(FILE); +{ + local $/ = \16384; + $m->out($_) while (); + close(FILE); +} $m->abort; diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css index 0c851aec5..ccdd49d60 100644 --- a/rt/html/NoAuth/webrt.css +++ b/rt/html/NoAuth/webrt.css @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; @@ -68,12 +68,218 @@ SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; text-decoration: none; white-space: nowrap} + +%# .topnav is the original RT class for the sidebar navigation tabs. +%# Font-sizing by level depth was originally hard-coded into Elements/Menu. +%# This modification sets a different class name for each level, allowing +%# style sheet control over the formats. + +a.topnav-0 { font-family: Verdana, sans-serif; + font-size: 16px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-1 { font-family: Verdana, sans-serif; + font-size: 14px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-2 { font-family: Verdana, sans-serif; + font-size: 12px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-3 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-4 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-5 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +li.topnav-0-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-1-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-2-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-3-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-4-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-5-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-0-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-1-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-2-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-3-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-4-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-5-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + .currenttopnav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #FFFF66; text-decoration: none; white-space: nowrap} + +%# .currenttopnav is the original RT class for the sidebar navigation tabs. +%# Font-sizing by level depth was originally hard-coded into Elements/Menu. +%# This modification sets a different class name for each level, allowing +%# style sheet control over the formats + +a.currenttopnav-0 { font-family: Verdana, sans-serif; + font-size: 16px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-1 { font-family: Verdana, sans-serif; + font-size: 14px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-2 { font-family: Verdana, sans-serif; + font-size: 12px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-3 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-4 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-5 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +li.currenttopnav-0-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-1-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-2-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-3-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-4-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-5-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-0-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-1-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-2-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-3-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-4-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-5-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + .topactions { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; @@ -106,10 +312,12 @@ SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; vertical-align: top; text-align: left; } +%# Actually the "topactions" section .blueright { background-color: #4682B4; background-position: left top; vertical-align: top; text-align: right; + padding-right: 1em; } .olddarkblue { background-color: #003399; background-position: left top; @@ -137,7 +345,7 @@ div.messagebody { div.downloadattachment { - font size: 10px; + font-size: 10px; text-align: right; } @@ -340,32 +548,21 @@ SPAN.attribution { SPAN.label { font-size: 0.8em; } -BLOCKQUOTE { - font-style: italic; - /* color: #990; */ -} +DIV.page-stats { font-size: 0.8em; + color: #cccccc; + text-align: right; + } -ADDRESS { - text-align: right; - font-weight: bold; - font-style: italic -} -BLOCKQUOTE P { /* Try to avoid space above the attribution */ - margin-bottom: 0; -} -BLOCKQUOTE ADDRESS { - margin: 0; +BLOCKQUOTE { + font-style: italic; } - .emphasized { font-weight: bold } -P.map-also { font-style: italic; margin-left: 15%; text-align: right } - .oddline { background-color : #ccccee; } @@ -381,6 +578,43 @@ ul.topnav { margin-bottom:0; } +.menu-major-separator { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + +.menu-minor-separator { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} + +TH.collection-as-table { text-align: center; + font-size: 0.8em; + padding-left: .5em; + padding-right: .5em; + color: #333333; + background-color: #cccccc; + white-space: nowrap; + } + +TD.collection-as-table { text-align: left; + padding-left: .5em; + padding-right: .5em; + } + +textarea.signature { + width: 100%; +} +textarea.comments { + width: 100%; +} + +textarea.messagebox { + width: 100%; +} + %# Provide a callback for adding/modifying the style sheet. %# http://www.w3.org/TR/REC-CSS1 - section 3.2, says: %# "latter specified rule wins" @@ -390,5 +624,5 @@ inherit => undef <%init> $r->content_type('text/css'); -$r->headers_out->{'Expires'} = '+30m'; +#$r->headers_out->{'Expires'} = '+30m'; diff --git a/rt/html/REST/1.0/Forms/queue/default b/rt/html/REST/1.0/Forms/queue/default index 1041684ec..c87c33cce 100644 --- a/rt/html/REST/1.0/Forms/queue/default +++ b/rt/html/REST/1.0/Forms/queue/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/queue/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/queue/ns b/rt/html/REST/1.0/Forms/queue/ns index bc722d81c..b0ba0036a 100644 --- a/rt/html/REST/1.0/Forms/queue/ns +++ b/rt/html/REST/1.0/Forms/queue/ns @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/queue/ns %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/ticket/attachments b/rt/html/REST/1.0/Forms/ticket/attachments index 944e1259b..ca75ce0d1 100644 --- a/rt/html/REST/1.0/Forms/ticket/attachments +++ b/rt/html/REST/1.0/Forms/ticket/attachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/attachments %# <%ARGS> @@ -80,7 +80,7 @@ if ($aid) { return [ "# Invalid attachment id: $aid", [], {}, 1 ]; } if ($content) { - $c = $attachment->Content; + $c = $attachment->OriginalContent; } else { my @data; push @data, [ id => $attachment->Id ]; diff --git a/rt/html/REST/1.0/Forms/ticket/default b/rt/html/REST/1.0/Forms/ticket/default index d231f7b4b..78f6c9562 100644 --- a/rt/html/REST/1.0/Forms/ticket/default +++ b/rt/html/REST/1.0/Forms/ticket/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/ticket/history b/rt/html/REST/1.0/Forms/ticket/history index f60615a43..4663e97ee 100644 --- a/rt/html/REST/1.0/Forms/ticket/history +++ b/rt/html/REST/1.0/Forms/ticket/history @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/history %# <%ARGS> @@ -97,8 +97,6 @@ if ($tid) { $t->Load($tid); push @data, [ id => $t->Id ]; - push @data, [ EffectiveTicket => $t->EffectiveTicket ] - if (!%$fields || exists $fields->{lc 'EffectiveTicket'}); push @data, [ Ticket => $t->Ticket ] if (!%$fields || exists $fields->{lc 'Ticket'}); push @data, [ TimeTaken => $t->TimeTaken ] diff --git a/rt/html/REST/1.0/Forms/ticket/links b/rt/html/REST/1.0/Forms/ticket/links index a3dab28b7..9f14da4e3 100644 --- a/rt/html/REST/1.0/Forms/ticket/links +++ b/rt/html/REST/1.0/Forms/ticket/links @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/links %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/user/default b/rt/html/REST/1.0/Forms/user/default index 3694416fc..ad2ebd57a 100644 --- a/rt/html/REST/1.0/Forms/user/default +++ b/rt/html/REST/1.0/Forms/user/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/user/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/user/ns b/rt/html/REST/1.0/Forms/user/ns index 8c7f16ef4..406156304 100644 --- a/rt/html/REST/1.0/Forms/user/ns +++ b/rt/html/REST/1.0/Forms/user/ns @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/user/ns %# <%ARGS> diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway index 09e3e3c49..5252c1968 100644 --- a/rt/html/REST/1.0/NoAuth/mail-gateway +++ b/rt/html/REST/1.0/NoAuth/mail-gateway @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,18 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%flags> inherit => undef # inhibit UTF8 conversion done in /autohandler <%ARGS> -$message $queue => 1 $action => "correspond" $ticket => undef <%init> use RT::Interface::Email; +$r->content_type('text/plain; charset=utf-8'); +$m->error_format('text'); my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway(\%ARGS); if ($status == -75 ) { $m->out("temporary failure - ". $error); @@ -71,4 +72,6 @@ $m->out('Requestor: '. $Ticket->Requestors->MemberEmailAddressesAsString ); } else { $m->out('not ok - '.$error); } + +$m->abort(); diff --git a/rt/html/REST/1.0/autohandler b/rt/html/REST/1.0/autohandler index c95231907..8e3fb164d 100644 --- a/rt/html/REST/1.0/autohandler +++ b/rt/html/REST/1.0/autohandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,12 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/autohandler %# <%INIT> use RT::Interface::REST; -$r->content_type('text/plain'); +$r->content_type('text/plain; charset=utf-8'); $m->error_format('text'); $m->call_next(); $m->abort(); diff --git a/rt/html/REST/1.0/dhandler b/rt/html/REST/1.0/dhandler index 725a61759..6cf45b000 100644 --- a/rt/html/REST/1.0/dhandler +++ b/rt/html/REST/1.0/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/dhandler %# <%ARGS> diff --git a/rt/html/REST/1.0/logout b/rt/html/REST/1.0/logout index 9f043769a..470cb0915 100644 --- a/rt/html/REST/1.0/logout +++ b/rt/html/REST/1.0/logout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%PERL> tied(%session)->delete if (defined %session); diff --git a/rt/html/REST/1.0/search/dhandler b/rt/html/REST/1.0/search/dhandler index 8c61f725c..1915a4644 100644 --- a/rt/html/REST/1.0/search/dhandler +++ b/rt/html/REST/1.0/search/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/search/dhandler %# <%INIT> diff --git a/rt/html/REST/1.0/search/ticket b/rt/html/REST/1.0/search/ticket index 6b52ac8b8..d0ab59e98 100644 --- a/rt/html/REST/1.0/search/ticket +++ b/rt/html/REST/1.0/search/ticket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/search/ticket %# <%ARGS> @@ -135,7 +135,7 @@ if ($n == 0 && $format ne "i") { $output = form_compose(\@output) if @output; OUTPUT: -$m->out("RT/". $RT::VERSION . " " . $status); +$m->out("RT/". $RT::VERSION . " " . $status ."\n\n"); $m->out($output ); diff --git a/rt/html/REST/1.0/ticket/comment b/rt/html/REST/1.0/ticket/comment index 4915c64f1..e27bfcc1e 100644 --- a/rt/html/REST/1.0/ticket/comment +++ b/rt/html/REST/1.0/ticket/comment @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/comment %# <%ARGS> diff --git a/rt/html/REST/1.0/ticket/link b/rt/html/REST/1.0/ticket/link index 7507c0779..6556a5ef7 100644 --- a/rt/html/REST/1.0/ticket/link +++ b/rt/html/REST/1.0/ticket/link @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/link %# <%ARGS> diff --git a/rt/html/REST/1.0/ticket/merge b/rt/html/REST/1.0/ticket/merge index 7cc8b4b78..3db52111b 100644 --- a/rt/html/REST/1.0/ticket/merge +++ b/rt/html/REST/1.0/ticket/merge @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/merge %# <%ARGS> diff --git a/rt/html/Search/Build.html b/rt/html/Search/Build.html index bbf2a1de9..cb6462651 100644 --- a/rt/html/Search/Build.html +++ b/rt/html/Search/Build.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,27 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} +%# +%# Data flow here: +%# The page receives a Query from the previous page, and maybe arguments +%# corresponding to actions. (If it doesn't get a Query argument, it pulls +%# one out of the session hash. Also, it could be getting just a raw query from +%# Build/Edit.html (Advanced).) +%# +%# After doing some stuff with default arguments and saved searches, the ParseQuery +%# function (which is similar to, but not the same as, _parser in RT/Tickets_Overlay_SQL) +%# converts the Query into a RT::Interface::Web::QueryBuilder::Tree. This mason file +%# then adds stuff to or modifies the tree based on the actions that had been requested +%# by clicking buttons. It then calls GetQueryAndOptionList on the tree to generate +%# the SQL query (which is saved as a hidden input) and the option list for the Clauses +%# box in the top right corner. +%# +%# Worthwhile refactoring: the tree manipulation code for the actions could use some cleaning +%# up. The node-adding code is different in the "add" actions from in ParseQuery, which leads +%# to things like ParseQuery correctly not quoting numbers in numerical fields, while the "add" +%# action does quote it (this breaks SQLite). +%# <& /Elements/Header, Title => $title &> <& /Ticket/Elements/Tabs, current_tab => "Search/Build.html".$QueryString, @@ -58,36 +78,28 @@ -
            - -
            -<& Elements/PickCriteria, query => $Query, cfqueues => \%queues &> + + + + - + + + + + + +
            +<& Elements/PickCriteria, query => $Query, cfqueues => $queues &> <& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&> + +<& Elements/EditQuery, + %ARGS, + actions => \@actions, + optionlist => $optionlist, + Description => $Description &> -<& /Elements/TitleBoxStart, title => loc("Query") . ": " .$Description &> -<& Elements/NewListActions, actions => \@actions &> - -
            -
            - - - - - -
            - - -%# -
            -<& /Elements/TitleBoxEnd &> -
            +
            <& Elements/EditSearches, CurrentSearch => $search_hash, Dirty => $dirty, SearchId => $SearchId &>
            @@ -95,27 +107,35 @@ AvailableColumns => $AvailableColumns, CurrentFormat => $CurrentFormat, RowsPerPage => $RowsPerPage, OrderBy => $OrderBy, Order => $Order &>
            +<& /Elements/Submit, Caption => loc("Do the Search"), Label => loc('Search'), Name => 'DoSearch'&> +
            <%INIT> -use Tree::Simple; +use RT::Interface::Web::QueryBuilder; +use RT::Interface::Web::QueryBuilder::Tree; my $search_hash = {}; my $search; my $title = loc("Query Builder"); # {{{ Clear out unwanted data -if ($NewQuery or $ARGS{'Delete'}) { +if ( $NewQuery or $ARGS{'Delete'} ) { + # Wipe all data-carrying variables clear if we want a new # search, or we're deleting an old one.. - $Query = ''; - $Format = ''; + $Query = ''; + $Format = ''; $Description = ''; - $SearchId = ''; - $Order = ''; - $OrderBy = ''; + $SearchId = ''; + $Order = ''; + $OrderBy = ''; $RowsPerPage = ''; + # ($search hasn't been set yet; no need to clear) # ..then wipe the session out.. @@ -124,6 +144,7 @@ if ($NewQuery or $ARGS{'Delete'}) { # ..and the search results. $session{'tickets'}->CleanSlate() if defined $session{'tickets'}; } + # }}} # {{{ Attempt to load what we can from the session, set defaults @@ -133,61 +154,71 @@ $search_hash = $session{'CurrentSearchHash'}; # These variables are what define a search_hash; this is also # where we give sane defaults. -$Query ||= $search_hash->{'Query'}; -$Format ||= $search_hash->{'Format'}; +$Query ||= $search_hash->{'Query'}; +$Format ||= $search_hash->{'Format'}; $Description ||= $search_hash->{'Description'}; -$SearchId ||= $search_hash->{'SearchId'} || 'new'; -$Order ||= $search_hash->{'Order'} || 'ASC'; -$OrderBy ||= $search_hash->{'OrderBy'} || 'id'; -$RowsPerPage = ($search_hash->{'RowsPerPage'} || 50) unless defined ($RowsPerPage); +$SearchId ||= $search_hash->{'SearchId'} || 'new'; +$Order ||= $search_hash->{'Order'} || 'ASC'; +$OrderBy ||= $search_hash->{'OrderBy'} || 'id'; +$RowsPerPage = ( $search_hash->{'RowsPerPage'} || 50 ) + unless defined($RowsPerPage); $search ||= $search_hash->{'Object'}; + # }}} my @actions = (); -my %queues; # Clean unwanted junk from the format -$Format = $m->comp('/Elements/ScrubHTML', Content => $Format) if ($Format); +$Format = $m->comp( '/Elements/ScrubHTML', Content => $Format ) if ($Format); # {{{ If we're asked to delete the current search, make it go away and reset the search parameters if ( $ARGS{'Delete'} ) { + # We set $SearchId to 'new' above already, so peek into the %ARGS if ( $ARGS{'SearchId'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { my $obj_type = $1; my $obj_id = $2; my $search_id = $3; - + my $container_object; - if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id) { - $container_object = $session{'CurrentUser'}->UserObj; + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { + $container_object = $session{'CurrentUser'}->UserObj; } - elsif ($obj_type eq 'RT::Group') { - $container_object = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); $container_object->Load($obj_id); } - if ($container_object->id ) { - # We have the object the entry is an attribute on; delete - # the entry.. - $container_object->Attributes->DeleteEntry( Name => 'SavedSearch', id => $search_id); - } + if ( $container_object->id ) { + + # We have the object the entry is an attribute on; delete + # the entry.. + $container_object->Attributes->DeleteEntry( + Name => 'SavedSearch', + id => $search_id + ); + } } } + # }}} # {{{ If the user wants to copy a search, uncouple from the one that this was based on, but don't erase the $Query or $Format if ( $ARGS{'CopySearch'} ) { - $SearchId = 'new'; - $search = undef; - $Description = loc("[_1] copy", $Description); + $SearchId = 'new'; + $search = undef; + $Description = loc( "[_1] copy", $Description ); } + # }}} # {{{ if we're asked to revert the current search, we just want to load it if ( $ARGS{'Revert'} ) { $ARGS{'LoadSavedSearch'} = $SearchId; } + # }}} # {{{ if we're asked to load a search, load it. @@ -196,15 +227,18 @@ if ( $ARGS{'LoadSavedSearch'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { my $obj_type = $1; my $obj_id = $2; my $search_id = $3; - + # We explicitly list out the available types (user and group) and # don't trust user input here - if ( ( $obj_type eq 'RT::User' ) && ( $obj_id == $session{'CurrentUser'}->id ) ) { - $search = $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); - + if ( ( $obj_type eq 'RT::User' ) + && ( $obj_id == $session{'CurrentUser'}->id ) ) + { + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + } - elsif ($obj_type eq 'RT::Group') { - my $group = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + my $group = RT::Group->new( $session{'CurrentUser'} ); $group->Load($obj_id); $search = $group->Attributes->WithId($search_id); } @@ -231,260 +265,227 @@ if ( $actions[0] ) { $m->abort(); } -my @options; -my $optionlist; $Query = ""; -%queues = (); -# Build the optionlist from the tree, so we can do additions and movements based on it -$optionlist = build_array( \$Query, $ARGS{clauses}, $tree, \@options, \%queues ); +my @options = $tree->GetDisplayedNodes; -my $currentkey; -$currentkey = $options[$ARGS{clauses}] if defined $ARGS{clauses}; +my @current_values = grep { defined } @options[@clauses]; # {{{ Try to find if we're adding a clause foreach my $arg ( keys %ARGS ) { - if ( $arg =~ m/ValueOf(.+)/ && $ARGS{$arg} ne "") { - # We're adding a $1 clause - my $field = $1; - my ($keyword, $op, $value); - - #figure out if it's a grouping - if ( $ARGS{ $field . "Field" } ) { - $keyword = $ARGS{ $field . "Field" }; - } - else { - $keyword = $field; - } - - $value = $ARGS{'ValueOf' . $field}; - $op = $ARGS{ $field . 'Op' }; - if ( $value eq 'NULL' && $op =~ /=/) { - if ($op eq '=') { - $op = "IS"; - } elsif ($op eq '!=') { - $op = "IS NOT"; - } + if ( + $arg =~ m/^ValueOf(.+)/ + && ( ref $ARGS{$arg} eq "ARRAY" + ? grep { $_ ne "" } @{ $ARGS{$arg} } + : $ARGS{$arg} ne "" ) + ) + { - # This isn't "right", but... - # It has to be this way until #5182 is fixed - $value = "'NULL'"; - } else { - $value = "'$value'"; + # We're adding a $1 clause + my $field = $1; + my ( $keyword, $op, $value ); + + #figure out if it's a grouping + if ( $ARGS{ $field . "Field" } ) { + $keyword = $ARGS{ $field . "Field" }; + } + else { + $keyword = $field; } - my $clause = { - Key => $keyword, - Op => $op, - Value => $value - }; - - my $newnode = Tree::Simple->new($clause); - if ($currentkey) { - my $newindex = $currentkey->getIndex() + 1; - if (!$currentkey->getParent->getParent()->isRoot()) { - } - $currentkey->insertSibling($newindex, $newnode); - $currentkey = $newnode; - } - else { - $tree->getChild(0)->addChild($newnode); - $currentkey = $newnode; - } - $newnode->getParent()->setNodeValue($ARGS{'AndOr'}); + my ( @ops, @values ); + if ( ref $ARGS{ 'ValueOf' . $field } eq "ARRAY" ) { + + # we have many keys/values to iterate over, because there is + # more than one CF with the same name. + @ops = @{ $ARGS{ $field . 'Op' } }; + @values = @{ $ARGS{ 'ValueOf' . $field } }; + } + else { + @ops = ( $ARGS{ $field . 'Op' } ); + @values = ( $ARGS{ 'ValueOf' . $field } ); + } + $RT::Logger->error("Bad Parameters passed into Query Builder") + unless @ops == @values; + + for my $i ( 0 .. @ops - 1 ) { + my ( $op, $value ) = ( $ops[$i], $values[$i] ); + next if $value eq ""; + + if ( $value eq 'NULL' && $op =~ /=/ ) { + if ( $op eq '=' ) { + $op = "IS"; + } + elsif ( $op eq '!=' ) { + $op = "IS NOT"; + } + + # This isn't "right", but... + # It has to be this way until #5182 is fixed + $value = "'NULL'"; + } + else { + $value = "'$value'"; + } + + my $clause = { + Key => $keyword, + Op => $op, + Value => $value + }; + + my $newnode = RT::Interface::Web::QueryBuilder::Tree->new($clause); + if (@current_values) { + foreach my $value (@current_values) { + my $newindex = $value->getIndex() + 1; + $value->insertSibling( $newindex, $newnode ); + $value = $newnode; + } + } + else { + $tree->getChild(0)->addChild($newnode); + @current_values = $newnode; + } + $newnode->getParent()->setNodeValue( $ARGS{'AndOr'} ); + } } } + # }}} # {{{ Move things around if ( $ARGS{"Up"} ) { - if ($currentkey) { - my $index = $currentkey->getIndex(); - if ( $currentkey->getIndex() > 0 ) { - my $parent = $currentkey->getParent(); - $parent->removeChild($index); - $parent->insertChild($index - 1, $currentkey); - $currentkey = $parent->getChild($index - 1); - } - else { - push( @actions, [ "error: can't move up", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $index = $value->getIndex(); + if ( $value->getIndex() > 0 ) { + my $parent = $value->getParent(); + $parent->removeChild($index); + $parent->insertChild( $index - 1, $value ); + $value = $parent->getChild( $index - 1 ); + } + else { + push( @actions, [ loc("error: can't move up"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Down"} ) { - if ($currentkey) { - my $index = $currentkey->getIndex(); - my $parent = $currentkey->getParent(); - if ( $currentkey->getIndex() < ($parent->getChildCount - 1) ) { - $parent->removeChild($index); - $parent->insertChild($index + 1, $currentkey); - $currentkey = $parent->getChild($index + 1); - } - else { - push( @actions, [ "error: can't move down", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $index = $value->getIndex(); + my $parent = $value->getParent(); + if ( $value->getIndex() < ( $parent->getChildCount - 1 ) ) { + $parent->removeChild($index); + $parent->insertChild( $index + 1, $value ); + $value = $parent->getChild( $index + 1 ); + } + else { + push( @actions, [ loc("error: can't move down"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Left"} ) { - if ($currentkey) { - my $parent = $currentkey->getParent(); - my $grandparent = $parent->getParent(); - if (!$grandparent->isRoot) { - my $index = $parent->getIndex(); - $parent->removeChild($currentkey); - $grandparent->insertChild($index, $currentkey); - if ($parent->isLeaf()) { - $grandparent->removeChild($parent); - } - } - else { - push( @actions, [ "error: can't move left", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + my $grandparent = $parent->getParent(); + if ( !$grandparent->isRoot ) { + my $index = $parent->getIndex(); + $parent->removeChild($value); + $grandparent->insertChild( $index, $value ); + if ( $parent->isLeaf() ) { + $grandparent->removeChild($parent); + } + } + else { + push( @actions, [ loc("error: can't move left"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Right"} ) { - if ($currentkey) { - my $parent = $currentkey->getParent(); - my $index = $currentkey->getIndex(); - my $newparent; - if ($index > 0 ) { - my $sibling = $parent->getChild($index - 1); - if (ref($sibling->getNodeValue)) { - $parent->removeChild($currentkey); - my $newtree = Tree::Simple->new('AND', $parent); - $newtree->addChild($currentkey); - } else { - $parent->removeChild($index); - $sibling->addChild($currentkey); - } - } - else { - $parent->removeChild($currentkey); - $newparent = Tree::Simple->new('AND', $parent); - $newparent->addChild($currentkey); - } - } else { - push( @actions, [ "error: nothing to move", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + my $index = $value->getIndex(); + my $newparent; + if ( $index > 0 ) { + my $sibling = $parent->getChild( $index - 1 ); + if ( ref( $sibling->getNodeValue ) ) { + $parent->removeChild($value); + my $newtree = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent ); + $newtree->addChild($value); + } + else { + $parent->removeChild($index); + $sibling->addChild($value); + } + } + else { + $parent->removeChild($value); + $newparent = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent ); + $newparent->addChild($value); + } + } + } + else { + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"DeleteClause"} ) { - if ($currentkey) { - $currentkey->getParent()->removeChild($currentkey); + if (@current_values) { + $_->getParent()->removeChild($_) for @current_values; } else { - push( @actions, [ "error: nothing to delete", -1 ] ); + push( @actions, [ loc("error: nothing to delete"), -1 ] ); } } elsif ( $ARGS{"Toggle"} ) { my $ea; - if ($currentkey) { - my $value = $currentkey->getNodeValue(); - my $parent = $currentkey->getParent(); - my $parentvalue = $parent->getNodeValue(); - - if ( $parentvalue eq 'AND') { - $parent->setNodeValue('OR'); - } - else { - $parent->setNodeValue('AND'); - } + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + + if ( $parent->getNodeValue eq 'AND' ) { + $parent->setNodeValue('OR'); + } + else { + $parent->setNodeValue('AND'); + } + } } else { - push( @actions, [ "error: nothing to toggle", -1 ] ); + push( @actions, [ loc("error: nothing to toggle"), -1 ] ); } } -elsif ( $ARGS{"Clear"} ) { - $tree = Tree::Simple->new(Tree::Simple->ROOT); -} + +$tree->PruneChildlessAggregators; + # }}} # {{{ Rebuild $Query based on the additions / movements -$Query = ""; -@options = (); -%queues = (); -$optionlist = build_array( \$Query, $currentkey, $tree, \@options, \%queues ); - -sub build_array { - my $Query = shift; - my $currentkey = shift; - my $tree = shift; - my ($keys, $queues) = @_; - my $i = 0; - my $optionlist; - my $depth = 0; - my %parens; - - $tree->traverse( sub { - my ($_tree) = @_; - - return if $_tree->getParent->isRoot(); - - push @$keys, $_tree; - my $clause = $_tree->getNodeValue(); - my $str; - my $ea = $_tree->getParent()->getNodeValue(); - if (ref($clause)) { - $str .= $ea . " " if $_tree->getIndex() > 0; - $str .= $clause->{Key} . " " . $clause->{Op} . " " . $clause->{Value}; - - if ( $clause->{Key} eq "Queue" ) { - $queues->{ $clause->{Value} } = 1; - } - } else { - $str = $ea if $_tree->getIndex() > 0; - } - - my $selected; - if ($_tree == $currentkey) { - $selected = "SELECTED"; - } - else { - $selected = ""; - } - - foreach my $p (keys %parens) { - if ($p > $_tree->getDepth) { - $$Query .= ')' x $parens{$p}; - $parens{$p}--; - } - } - - $optionlist .= "\n"; - my $parent = $_tree->getParent(); - if (!($parent->isRoot || $parent->getParent()->isRoot) && - !ref($parent->getNodeValue())) { - if ( $_tree->getIndex() == 0) { - $$Query .= '('; - $parens{$_tree->getDepth}++; - } - } - $$Query .= " " . $str . " "; - - if ($_tree->getDepth < $depth) { - $$Query .= ')'; - $parens{$depth}--; - } - - $i++; - }); - - foreach my $p (keys %parens) { - $$Query .= ") " x $parens{$p}; - } +$Query = ""; +my $optionlist_arrayref; + +($Query, $optionlist_arrayref) = $tree->GetQueryAndOptionList(\@current_values); + +my $optionlist = join "\n", map { qq() } @$optionlist_arrayref; + - return $optionlist; -} use Regexp::Common qw /delimited/; @@ -496,18 +497,18 @@ use constant PAREN => 8; use constant KEYWORD => 16; sub ParseQuery { - my $string = shift; - my $tree = shift; + my $string = shift; + my $tree = shift; my @actions = shift; - my $want = KEYWORD | PAREN; - my $last = undef; + my $want = KEYWORD | PAREN; + my $last = undef; my $depth = 1; # make a tree root - $$tree = Tree::Simple->new(Tree::Simple->ROOT); - my $root = Tree::Simple->new('AND', $$tree); - my $lastnode = $root; + $$tree = RT::Interface::Web::QueryBuilder::Tree->new; + my $root = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $$tree ); + my $lastnode = $root; my $parentnode = $root; # get the FIELDS from Tickets_Overlay @@ -521,17 +522,20 @@ sub ParseQuery { my $re_aggreg = qr[(?i:AND|OR)]; my $re_value = qr[$RE{delimited}{-delim=>qq{\'\"}}|\d+]; my $re_keyword = qr[$RE{delimited}{-delim=>qq{\'\"}}|(?:\{|\}|\w|\.)+]; - my $re_op = qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT LIKE)|(?i:LIKE)] ; # long to short + my $re_op = + qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT LIKE)|(?i:LIKE)] + ; # long to short my $re_paren = qr'\(|\)'; - # assume that $ea is AND if it's not set + # assume that $ea is AND if it is not set my ( $ea, $key, $op, $value ) = ( "AND", "", "", "" ); # order of matches in the RE is important.. op should come early, # because it has spaces in it. otherwise "NOT LIKE" might be parsed # as a keyword or value. - while ( $string =~ /( + while ( + $string =~ /( $re_aggreg |$re_op |$re_keyword @@ -556,7 +560,15 @@ sub ParseQuery { # Error # FIXME: I will only print out the highest $want value my $token = $tokens[ ( ( log $want ) / ( log 2 ) ) ]; - push @actions, [ "current: $current, want $want, Error near ->$val<- expecting a " . $token . " in '$string'\n", -1 ]; + push @actions, + [ + loc( +"current: $current, want $want, Error near ->$val<- expecting a " + . $token + . " in '$string'\n" + ), + -1 + ]; } # State Machine: @@ -565,20 +577,21 @@ sub ParseQuery { # Parens are highest priority if ( $current & PAREN ) { if ( $val eq "(" ) { - $depth++; - # make a new node that the clauses can be children of - $parentnode = Tree::Simple->new($ea, $parentnode); + $depth++; + + # make a new node that the clauses can be children of + $parentnode = RT::Interface::Web::QueryBuilder::Tree->new( $ea, $parentnode ); } else { - $depth--; - $parentnode = $parentnode->getParent(); - $lastnode = $parentnode; + $depth--; + $parentnode = $parentnode->getParent(); + $lastnode = $parentnode; } $want = KEYWORD | PAREN | AGGREG; } elsif ( $current & AGGREG ) { - $ea = $val; + $ea = $val; $want = KEYWORD | PAREN; } elsif ( $current & KEYWORD ) { @@ -616,27 +629,27 @@ sub ParseQuery { $val = "'$val'"; } - push @actions, [ "Unknown field: $key", -1 ] unless $class; + push @actions, [ loc("Unknown field: $key"), -1 ] unless $class; $want = PAREN | AGGREG; } else { - push @actions, [ "I'm lost", -1 ]; + push @actions, [ loc("I'm lost"), -1 ]; } if ( $current & VALUE ) { - if ( $key =~ /^CF./ ) { - $key = "'" . $key . "'"; - } + if ( $key =~ /^CF./ ) { + $key = "'" . $key . "'"; + } my $clause = { Key => $key, Op => $op, Value => $val }; - # explicity add a child to it - $lastnode = Tree::Simple->new($clause, $parentnode); - $lastnode->getParent()->setNodeValue($ea); + # explicity add a child to it + $lastnode = RT::Interface::Web::QueryBuilder::Tree->new( $clause, $parentnode ); + $lastnode->getParent()->setNodeValue($ea); ( $ea, $key, $op, $value ) = ( "", "", "", "" ); } @@ -644,14 +657,14 @@ sub ParseQuery { $last = $current; } # while - push @actions, [ "Incomplete query", -1 ] + push @actions, [ loc("Incomplete query"), -1 ] unless ( ( $want | PAREN ) || ( $want | KEYWORD ) ); - push @actions, [ "Incomplete Query", -1 ] + push @actions, [ loc("Incomplete Query"), -1 ] unless ( $last && ( $last | PAREN ) || ( $last || VALUE ) ); # This will never happen, because the parser will complain - push @actions, [ "Mismatched parentheses", -1 ] + push @actions, [ loc("Mismatched parentheses"), -1 ] unless $depth == 1; } @@ -667,24 +680,32 @@ sub _match { sub debug { my $message = shift; - $m->print($message . "
            "); + $m->print( $message . "
            " ); } # }}} # }}} +my $queues = $tree->GetReferencedQueues; + # {{{ Deal with format changes -my ($AvailableColumns, $CurrentFormat); -($Format, $AvailableColumns, $CurrentFormat) = $m->comp('Elements/BuildFormatString', cfqueues => \%queues, %ARGS, Format => $Format); +my ( $AvailableColumns, $CurrentFormat ); +( $Format, $AvailableColumns, $CurrentFormat ) = $m->comp( + 'Elements/BuildFormatString', + cfqueues => $queues, + %ARGS, Format => $Format +); + # }}} # {{{ if we're asked to save the current search, save it if ( $ARGS{'Save'} ) { - if ($search && $search->id) { - # This search is based on a previously loaded search -- so - # just update the current search object with new values + if ( $search && $search->id ) { + + # This search is based on a previously loaded search -- so + # just update the current search object with new values $search->SetSubValues( Format => $Format, Query => $Query, @@ -692,83 +713,102 @@ if ( $ARGS{'Save'} ) { OrderBy => $OrderBy, RowsPerPage => $RowsPerPage, ); - $search->SetDescription( $Description ); + $search->SetDescription($Description); } elsif ( $SearchId eq 'new' && $ARGS{'Owner'} =~ /^(.*?)-(\d+)$/ ) { - # We're saving a new search - my $obj_type = $1; - my $obj_id = $2; - - # Find out if we're saving on the user, or a group + # We're saving a new search + my $obj_type = $1; + my $obj_id = $2; + + # Find out if we're saving on the user, or a group my $container_object; - if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id) { + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { $container_object = $session{'CurrentUser'}->UserObj; } - elsif ($obj_type eq 'RT::Group') { - $container_object = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); $container_object->Load($obj_id); } - if ($container_object->id ) { - # If we got one or the other, add the saerch - my ( $search_id, $search_msg ) = $container_object->AddAttribute( - Name => 'SavedSearch', - Description => $Description, - Content => { - Format => $Format, - Query => $Query, - Order => $Order, - OrderBy => $OrderBy, - RowsPerPage => $RowsPerPage, - } - ); - $search = $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); - # Build new SearchId - $SearchId = ref( $session{'CurrentUser'}->UserObj ) . '-' - . $session{'CurrentUser'}->UserObj->Id . '-SavedSearch-' . $search->Id; - } - unless ($search->id) { - push @actions, [loc("Can't find a saved search to work with"), 0]; + if ( $container_object->id ) { + + # If we got one or the other, add the saerch + my ( $search_id, $search_msg ) = $container_object->AddAttribute( + Name => 'SavedSearch', + Description => $Description, + Content => { + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $RowsPerPage, + } + ); + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + + # Build new SearchId + $SearchId = + ref( $session{'CurrentUser'}->UserObj ) . '-' + . $session{'CurrentUser'}->UserObj->Id + . '-SavedSearch-' + . $search->Id; + } + unless ( $search->id ) { + push @actions, [ loc("Can't find a saved search to work with"), 0 ]; } } else { - push @actions, [loc("Can't save this search"), 0]; + push @actions, [ loc("Can't save this search"), 0 ]; } } + # }}} # {{{ If we're modifying an old query, check if it has changed my $dirty = 0; -$dirty = 1 if defined $search and - ($search->SubValue('Format') ne $Format or - $search->SubValue('Query') ne $Query or - $search->SubValue('Order') ne $Order or - $search->SubValue('OrderBy') ne $OrderBy or - $search->SubValue('RowsPerPage') ne $RowsPerPage); +$dirty = 1 + if defined $search + and ($search->SubValue('Format') ne $Format + or $search->SubValue('Query') ne $Query + or $search->SubValue('Order') ne $Order + or $search->SubValue('OrderBy') ne $OrderBy + or $search->SubValue('RowsPerPage') ne $RowsPerPage ); + # }}} # {{{ Push the updates into the session so we don't loose 'em -$search_hash->{'SearchId'} = $SearchId; -$search_hash->{'Format'} = $Format; -$search_hash->{'Query'} = $Query; +$search_hash->{'SearchId'} = $SearchId; +$search_hash->{'Format'} = $Format; +$search_hash->{'Query'} = $Query; $search_hash->{'Description'} = $Description; -$search_hash->{'Object'} = $search; -$search_hash->{'Order'} = $Order; -$search_hash->{'OrderBy'} = $OrderBy; +$search_hash->{'Object'} = $search; +$search_hash->{'Order'} = $Order; +$search_hash->{'OrderBy'} = $OrderBy; $search_hash->{'RowsPerPage'} = $RowsPerPage; $session{'CurrentSearchHash'} = $search_hash; + # }}} # {{{ Show the results, if we were asked. if ( $ARGS{"DoSearch"} ) { - $m->comp("Results.html" , Query => $Query, Format => $Format, Order => $Order, OrderBy => $OrderBy, Rows => $RowsPerPage); + $m->comp( + "Results.html", + Query => $Query, + Format => $Format, + Order => $Order, + OrderBy => $OrderBy, + Rows => $RowsPerPage + ); $m->abort(); } + # }}} # {{{ Build a querystring for the tabs @@ -776,14 +816,20 @@ if ( $ARGS{"DoSearch"} ) { my $QueryString; if ($NewQuery) { $QueryString = '?NewQuery=1'; -} else { - $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Order => $Order, - OrderBy => $OrderBy, - Rows => $RowsPerPage) if ($Query); } +else { + $QueryString = '?' + . $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Order => $Order, + OrderBy => $OrderBy, + Rows => $RowsPerPage + ) + if ($Query); +} + # }}} @@ -798,4 +844,6 @@ $Order => undef $OrderBy => undef $RowsPerPage => undef $HideResults => 0 +@clauses => () + diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html index f75934bf3..f9eef26b6 100644 --- a/rt/html/Search/Bulk.html +++ b/rt/html/Search/Bulk.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Bulk ticket update") &> <& /Elements/Tabs, Title => loc("Bulk ticket update") &> <& /Elements/ListActions, actions => \@results &> - -
            + + @@ -75,8 +75,7 @@ while (my $Ticket = $Tickets->Next) { } - -%# The ticket view is controlled by config.pm, WebOptions + %foreach my $col (@cols) { +% while (my $CF = $TxnCFs->Next()) { + + + + +% } # end if while
            <&|/l&>Update
            % if ($col eq 'id') { @@ -153,44 +152,26 @@ while (my $Ticket = $Tickets->Next) {
            <&|/l&>Subject:
            <% $CF->Name %>:<& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => "Object-RT::Transaction--CustomField-" + &><% $CF->FriendlyType %>
            <&|/l&>Attach:
            <&|/l&>Message: <& /Elements/MessageBox, Name=>"UpdateContent"&>
            - -% foreach (keys %allcfs) { - - - -% } -
            -% my $cf = $allcfs{$_}; -% my $pref; -% if ($cf->Queue == 0) { -% $pref = "[Global]"; -% } else { -% $pref = "[Queue: " . $cfqnames{$_} . "]"; -% } -<%$pref%> <% $cf->Name %>
            -<% $cf->FriendlyType %> -
            -% if ($cf->Type ne "FreeformMultiple") { -<& /Ticket/Elements/EditCustomField, CustomField => $cf &> -% } else { -Add Values
            - -
            -Delete Values
            - -% } -
            - <& /Elements/TitleBoxEnd &> + <& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&> -<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
            +<&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.
            <& /Ticket/Elements/BulkLinks &> <& /Elements/TitleBoxEnd &> @@ -223,7 +204,7 @@ while (my $Ticket = $Tickets->Next) { unless ( exists $cfqs{$cfqid} ) { $cfqs{$cfqid} = 1; $count++; - my $cfs = $cfq->CustomFields; + my $cfs = $cfq->TicketCustomFields; while (my $cf = $cfs->Next) { $allcfs{$cf->Id} = $cf; $cfqnames{$cf->Id} = $cfqn; @@ -245,9 +226,11 @@ if ($ARGS{'UpdateContent'} && #Iterate through each ticket we've been handed my @linkresults; +my %queues; $Tickets->RedoSearch(); while (my $Ticket = $Tickets->Next) { + $queues{$Ticket->QueueObj->Id}++; $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); next unless ($ARGS{"UpdateTicket".$Ticket->Id}); $RT::Logger->debug ("Matched\n"); @@ -262,16 +245,6 @@ while (my $Ticket = $Tickets->Next) { #Update the watchers my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); - #Update custom fields - my $pat = "^(\\d+)-(.*)\$"; - foreach (keys %ARGS) { - $ARGS{"Ticket-" . $Ticket->Id . "-CustomField-" . $1 . "-" . $2} = $ARGS{$_} if (/$pat/o); - } - my @cfresults = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); - foreach (keys %ARGS) { - delete $ARGS{"Ticket-" . $Ticket->Id . "-CustomField-" . $1 . "-" . $2} if (/$pat/o); - } - #Update the links $ARGS{'id'} = $Ticket; @@ -291,11 +264,15 @@ while (my $Ticket = $Tickets->Next) { delete $ARGS{'MemberOf-'.$Ticket->Id}; delete $ARGS{$Ticket->Id.'-RefersTo'}; delete $ARGS{'RefersTo-'.$Ticket->Id}; - - my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults, @cfresults); + my @tempresults = (@watchresults, @basicresults, @dateresults, + @updateresults, @linkresults); @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; @results = (@results, @tempresults); } +my $TxnCFs = RT::CustomFields->new($session{CurrentUser}); +$TxnCFs->LimitToLookupType("RT::Queue-RT::Ticket-RT::Transaction"); +$TxnCFs->LimitToGlobalOrObjectId(sort keys %queues); + diff --git a/rt/html/Search/Edit.html b/rt/html/Search/Edit.html index 769d38d9d..16e8a0e71 100755 --- a/rt/html/Search/Edit.html +++ b/rt/html/Search/Edit.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title&> <& /Ticket/Elements/Tabs, current_tab => "Search/Edit.html?".$QueryString, diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString index e5e131b6c..639e62c29 100644 --- a/rt/html/Search/Elements/BuildFormatString +++ b/rt/html/Search/Elements/BuildFormatString @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,45 +42,76 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Format => undef %cfqueues => undef +$Face => undef +$Size => undef +$Link => undef +$Title => undef +$AddCol => undef +$RemoveCol => undef +$ColUp => undef +$ColDown => undef +$SelectDisplayColumns => undef +$CurrentDisplayColumns => undef <%init> unless ($Format) { $Format = $RT::DefaultSearchResultFormat; } - -my @fields = ( - "QueueName", "OwnerName", - "id", "Status", - "Subject", "ExtendedStatus", - "Priority", "InitialPriority", - "FinalPriority", "EffectiveId", - "Type", "TimeWorked", - "TimeLeft", "TimeEstimated", - "Requestors", "Cc", - "AdminCc", "StartsRelative", - "StartedRelative", "CreatedRelative", - "LastUpdatedRelative", "ToldRelative", - "DueRelative", "ResolvedRelative", - "Starts", "Started", - "Created", "CreatedBy", - "LastUpdated", "LastUpdatedBy", - "Told", "Due", - "Resolved", "NEWLINE", - "RefersTo", "ReferredToBy", - "DependsOn", "DependedOnBy", - "MemberOf", "Members", - "Parents", "Children", - "-", + + +# All the things we can display in the format string by default +my @fields = qw( + id + Status + ExtendedStatus + Subject + QueueName + OwnerName + Priority + InitialPriority + FinalPriority + Type + TimeWorked + TimeLeft + TimeEstimated + CreatedBy + LastUpdatedBy + Requestors + Cc + AdminCc + Starts + StartsRelative + Started + StartedRelative + Created + CreatedRelative + LastUpdated + LastUpdatedRelative + Told + ToldRelative + Due + DueRelative + Resolved + ResolvedRelative + RefersTo + ReferredToBy + DependsOn + DependedOnBy + MemberOf + Members + Parents + Children + NEWLINE ); my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); -foreach (keys %cfqueues) { - my $id = $_; +foreach my $id (keys %cfqueues) { + # What does this _do_? What are the keys to cfqueues $id =~ s/^.'*(.*).'*$/$1/; # Gotta load up the $queue object, since queues get stored by name now. my $queue = RT::Queue->new($session{'CurrentUser'}); @@ -117,8 +148,8 @@ foreach my $field (@format) { push @seen, \%column; } -if ( $ARGS{"RemoveCol"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +if ( $RemoveCol ) { + my $index = $CurrentDisplayColumns; my $column = $seen[$index]; if ($index) { delete $seen[$index]; @@ -130,9 +161,9 @@ if ( $ARGS{"RemoveCol"} ) { } } } -elsif ( $ARGS{"AddCol"} ) { - if ( defined $ARGS{'SelectDisplayColumns'} ) { - my $selected = $ARGS{'SelectDisplayColumns'}; +elsif ( $AddCol ) { + if ( defined $SelectDisplayColumns ) { + my $selected = $SelectDisplayColumns; my @columns; if (ref($selected) eq 'ARRAY') { @columns = @$selected; @@ -141,74 +172,71 @@ elsif ( $ARGS{"AddCol"} ) { } foreach my $col (@columns) { my %column = (); - $column{Column} = $fields[ $col ]; - - if ( $ARGS{Face} eq "Bold" ) { - $column{Prefix} .= ""; - } - if ( $ARGS{Face} eq "Italic" ) { - $column{Prefix} .= ""; - } - if ( $ARGS{Size} ) { - $column{Prefix} .= "<" . $ARGS{Size} . ">"; - } - if ( $ARGS{Link} eq "Display" ) { - $column{Prefix} .= ""; - } - elsif ( $ARGS{Link} eq "Take" ) { - $column{Prefix} .= - ""; - } - - my $suffix; - if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) { - $column{Suffix} .= ""; - } - if ( $ARGS{Size} ) { - $column{Suffix} .= ""; - } - if ( $ARGS{Face} eq "Italic" ) { - $column{Suffix} .= ""; - } - if ( $ARGS{Face} eq "Bold" ) { - $column{Suffix} .= ""; - } - if ( $ARGS{Title} ) { - $column{Suffix} .= "/TITLE:" . $ARGS{Title}; - } - push @seen, \%column; - } + $column{Column} = $col; + + if ( $Face eq "Bold" ) { + $column{Prefix} .= ""; + $column{Suffix} .= ""; + } + if ( $Face eq "Italic" ) { + $column{Prefix} .= ""; + $column{Suffix} .= ""; + } + if ($Size) { + $column{Prefix} .= "<" . $m->interp->apply_escapes( $Size, 'h' ) . ">"; + $column{Suffix} .= "interp->apply_escapes( $Size, 'h' ) . ">"; + } + if ( $Link eq "Display" ) { + $column{Prefix} .= + ""; + $column{Suffix} .= ""; + } + elsif ( $Link eq "Take" ) { + $column{Prefix} .= ""; + $column{Suffix} .= ""; + } + + if ($Title) { + $column{Suffix} .= "/TITLE:" . $m->interp->apply_escapes( $Title, 'h' ); } + push @seen, \%column; +} +} } -elsif ( $ARGS{"ColUp"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +elsif ( $ColUp ) { + my $index = $CurrentDisplayColumns; if ( defined $index && ( $index - 1 ) >= 0 ) { my $column = $seen[$index]; $seen[$index] = $seen[ $index - 1 ]; $seen[ $index - 1 ] = $column; - $ARGS{CurrentDisplayColumns} = $index - 1; + $CurrentDisplayColumns = $index - 1; } } -elsif ( $ARGS{"ColDown"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +elsif ( $ColDown ) { + my $index = $CurrentDisplayColumns; if ( defined $index && ( $index + 1 ) < scalar @seen ) { my $column = $seen[$index]; $seen[$index] = $seen[ $index + 1 ]; $seen[ $index + 1 ] = $column; - $ARGS{CurrentDisplayColumns} = $index + 1; + $CurrentDisplayColumns = $index + 1; } } -$Format = ""; + +my @format_string; foreach my $field (@seen) { next unless $field; - $Format .= ", \n" if $Format; - $Format .= "'"; - $Format .= $field->{Prefix}; - $Format .= "__" . $field->{Column} . "__" if ( $field->{Column} ne "" ) ; - $Format .= $field->{Suffix}; - $Format .= "'"; + my $row = "'" . $field->{Prefix}; + $row .= "__" . $m->interp->apply_escapes( $field->{Column}, 'h' ) . "__" + unless ( $field->{Column} eq "" ); + $row .= $field->{Suffix} . "'"; + push( @format_string, $row ); } + +$Format = join(",\n", @format_string); + + return($Format, \@fields, \@seen); diff --git a/rt/html/Search/Elements/DisplayOptions b/rt/html/Search/Elements/DisplayOptions index 330948d32..43a9d9998 100644 --- a/rt/html/Search/Elements/DisplayOptions +++ b/rt/html/Search/Elements/DisplayOptions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc("Display Columns") &> @@ -54,15 +54,15 @@
            <&|/l&>Order by: - +
            <&|/l&>Rows per page: - + <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", Default => $RowsPerPage &> @@ -91,13 +91,14 @@ SELECTED
            -<& /Elements/Submit, Caption => "Do the Search", Label => loc('Search'), Name => 'DoSearch'&> <& /Elements/TitleBoxEnd &> <%INIT> my $tickets = new RT::Tickets($session{'CurrentUser'}); my %fields = %{$tickets->FIELDS}; map { $fields{$_}->[0] =~ /^(?:ENUM|INT|DATE|STRING)$/ || delete $fields{$_} } keys %fields; +delete $fields{'EffectiveId'}; + diff --git a/rt/html/Search/Elements/EditFormat b/rt/html/Search/Elements/EditFormat index 7d314aee6..dc8720f26 100644 --- a/rt/html/Search/Elements/EditFormat +++ b/rt/html/Search/Elements/EditFormat @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} + + + + + + + + + + + + + + + + + + -% } -% } else { -<&|/l&><%$field%> + + + + + + + + -% } -<& '/Elements/Callback', _CallbackName => 'EndOfList' &> <%INIT> -my @fields = ('Attachment', - 'Queue', - 'Status', - 'People', - 'Dates', - 'Time', - 'Priority', - 'Links', - 'id', - ); - my @people = ('Actor', 'Watcher', + 'WatcherGroup', ); diff --git a/rt/html/Search/Elements/PickCFs b/rt/html/Search/Elements/PickCFs index fb143ba57..435a07ad3 100644 --- a/rt/html/Search/Elements/PickCFs +++ b/rt/html/Search/Elements/PickCFs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,24 +42,17 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % while ( my $CustomField = $CustomFields->Next ) { - % } - <%INIT> my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); -foreach (keys %cfqueues) { - my $id = $_; +foreach my $id (keys %cfqueues) { $id =~ s/^.'*(.*).'*$/$1/; - # Gotta load up the $queue object, since queues get stored by name now. + # Gotta load up the $queue object, since queues get stored by name now. my $id my $queue = RT::Queue->new($session{'CurrentUser'}); $queue->Load($id); $CustomFields->LimitToQueue($queue->Id); diff --git a/rt/html/Search/Elements/PickCriteria b/rt/html/Search/Elements/PickCriteria index 344830e34..129344443 100644 --- a/rt/html/Search/Elements/PickCriteria +++ b/rt/html/Search/Elements/PickCriteria @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,26 +42,32 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Add Criteria')&>
            -<&|/l&>Available Columns: +<&|/l&>Add Columns: -Format: +<&|/l&>Format: @@ -58,50 +58,42 @@ Format:
            -Link: - - - + + -
            Title: -
            Size: - +
            <&|/l&>Size: + -
            Face: - - - + +
            - +% my $i=0; +% foreach my $field (@$CurrentFormat) { + % }
            diff --git a/rt/html/Search/Elements/EditQuery b/rt/html/Search/Elements/EditQuery new file mode 100644 index 000000000..783541a64 --- /dev/null +++ b/rt/html/Search/Elements/EditQuery @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& NewListActions, actions => $actions &> +<& /Elements/TitleBoxStart, title => join(': ', grep defined, loc("Query"), $Description) &> + +

            + + + + + + +%# +

            +<& /Elements/TitleBoxEnd &> +<%ARGS> +$Description +$optionlist +$actions + diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches index cd9f1ef3b..bc6b80e6f 100644 --- a/rt/html/Search/Elements/EditSearches +++ b/rt/html/Search/Elements/EditSearches @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Saved searches') &> +%# Hide all the save functionality if the user shouldn't see it. +% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch', +% Object=> $RT::System )) { <&|/l&>Privacy: % if ($CurrentSearch->{'Object'} && $CurrentSearch->{'Object'}->id) { <& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &>
            @@ -52,13 +55,14 @@ % } <&|/l&>Description:
            -
            + % if ($SearchId ne 'new') { % if ($Dirty) { % } + % } @@ -66,12 +70,18 @@ % }
            +% } <&|/l&>Load saved search:
            <& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&> <& /Elements/TitleBoxEnd &> <%init> + +unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', + Object=> $RT::System )) { + return; +} my @Objects; push @Objects, $session{CurrentUser}->UserObj; diff --git a/rt/html/Search/Elements/NewListActions b/rt/html/Search/Elements/NewListActions index 7b81d80b1..eb82544f3 100644 --- a/rt/html/Search/Elements/NewListActions +++ b/rt/html/Search/Elements/NewListActions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { <%loc('Results')%>
            % foreach my $action (@actions) { diff --git a/rt/html/Search/Elements/PickBasics b/rt/html/Search/Elements/PickBasics index d7e19788f..8a48f6b18 100644 --- a/rt/html/Search/Elements/PickBasics +++ b/rt/html/Search/Elements/PickBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,18 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -
            -% foreach my $field (@fields) { +%# END BPS TAGGED BLOCK }}} +
            +<&|/l&>id + +<& /Elements/SelectEqualityOperator, Name => "idOp" &> + + +
            -% if ($field eq "Attachment") { <& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> <& /Elements/SelectBoolean, Name => "AttachmentOp", @@ -57,44 +64,26 @@ &> -% } elsif ($field eq "Dates") { -<& /Elements/SelectDateType, Name=>"DateField" &> - -<& /Elements/SelectDateRelation, Name=>"DateOp" &> - -<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> -% } elsif ($field eq "Links") { -<& SelectLinks, Name=>"LinksField" &> - -<& /Elements/SelectBoolean, Name => "LinksOp", - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=' -&> - - -%} elsif ($field eq "Priority") { - - -<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> - - -%} elsif ($field =~ m/Time.*/) { - +
            +<&|/l&>Queue -<& /Elements/SelectEqualityOperator, Name => "TimeOp" &> +<& /Elements/SelectBoolean, Name => "QueueOp" , + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> - -% } elsif ($field eq "Status") { +<& /Elements/SelectQueue, + Name => "ValueOfQueue", + NamedValues => 1, + CheckQueueRight => 'ShowTicket' &> +
            <&|/l&>Status <& /Elements/SelectBoolean, Name => "StatusOp", @@ -105,32 +94,9 @@ &> <& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &> -%} elsif ($field =~ m/.*Priority/ || $field =~ m/Time.*/) { -<&|/l&><%$field%> - -<& /Elements/SelectEqualityOperator, Name => $field . "Op" &> - -" SIZE=5> -% } elsif ($field eq "Queue") { -<&|/l&>Queue - -<& /Elements/SelectBoolean, Name => "QueueOp" , - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=' &> - -<& /Elements/SelectQueue, Name => "ValueOfQueue", NamedValues => 1 &> -% } elsif ($field eq "id") { -<&|/l&>Id - -<& /Elements/SelectEqualityOperator, Name => "idOp" &> - - -% } elsif ($field eq "People") { -% foreach my $field (@people) { +
            -% if ($field eq "Actor") { -<& /Elements/SelectOwner, Name => "ValueOfActor" &> -% } elsif ($field eq 'Watcher') { +<& /Elements/SelectOwner, Name => "ValueOfActor", ValueAttribute => 'Name' &> +
            <& SelectPersonType, Name => 'WatcherField', Default => 'Requestor' &> <& /Elements/SelectMatch, Name => "WatcherOp" &> -% } else { -<&|/l&><%$field%> -<& /Elements/SelectMatch, Name => "$field" . "Op" &> -" value=""SIZE=20> -% } +
            +<& SelectPersonType, Name => 'WatcherGroupField', Default => 'RequestorGroup', Suffix => 'Group' &> + +<& /Elements/SelectBoolean, Name => "WatcherGroupOp", + True=> loc('belongs to'), + False=> loc('does not belong to'), + TrueVal=> '=', + FalseVal => '!=' +&> + +<& SelectGroup, Name => 'ValueOfWatcherGroup' &> +
            +<& /Elements/SelectDateType, Name=>"DateField" &> + +<& /Elements/SelectDateRelation, Name=>"DateOp" &> + +<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &>
            + + +<& /Elements/SelectEqualityOperator, Name => "TimeOp" &> -<& /Elements/SelectMatch, Name => "$field" . "Op" &> + +
            + + +<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> -" value="" SIZE=20> -% } + +
            +<& SelectLinks, Name=>"LinksField" &> + +<& /Elements/SelectBoolean, Name => "LinksOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> + +
            - -% my $name; -% if ($CustomField->QueueObj->id) { -% $name = "'CF." . $CustomField->QueueObj->Name . -% ".{" . $CustomField->Name . "}'"; -% } else { -% $name = "'CF." . $CustomField->Name . "'"; -% } +% my $name = "'CF.{" . $CustomField->Name . "}'"; +
            <% $CustomField->Name %> -<& /Elements/SelectCustomFieldOperator, Name => $name . "Op", - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', FalseVal => '!=' &> + <& /Elements/SelectCustomFieldOperator, Name => $name . "Op", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', FalseVal => '!=' &> <& /Elements/SelectCustomFieldValue, Name => "ValueOf" . $name, @@ -67,13 +60,11 @@ &>
            - - <& PickBasics &> - <& PickCFs, cfqueues => \%cfqueues &> + + +
            - Aggregator: + <&|/l&>Aggregator: <& SelectAndOr, Name => "AndOr" &>
            +
            + + <& PickBasics &> + <& PickCFs, cfqueues => \%cfqueues &> +
            +
             
            diff --git a/rt/html/Search/Elements/SearchPrivacy b/rt/html/Search/Elements/SearchPrivacy index 5f6f207fe..270e1baa3 100644 --- a/rt/html/Search/Elements/SearchPrivacy +++ b/rt/html/Search/Elements/SearchPrivacy @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Object => undef diff --git a/rt/html/Search/Elements/SelectAndOr b/rt/html/Search/Elements/SelectAndOr index 11df03ff1..2f3c70477 100644 --- a/rt/html/Search/Elements/SelectAndOr +++ b/rt/html/Search/Elements/SelectAndOr @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,10 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -AND -OR +%# END BPS TAGGED BLOCK }}} +<&|/l&>AND +<&|/l&>OR <%ARGS> $Name => "Operator" - \ No newline at end of file + diff --git a/rt/html/Search/Elements/SelectGroup b/rt/html/Search/Elements/SelectGroup new file mode 100644 index 000000000..edd53713f --- /dev/null +++ b/rt/html/Search/Elements/SelectGroup @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain); + + +<%ARGS> +$AllowNull => 1 +$Default=> '' +$Name => 'Group' +$Domain => 'UserDefined'; + diff --git a/rt/html/Search/Elements/SelectLinks b/rt/html/Search/Elements/SelectLinks index b814e3088..00ec80bd3 100644 --- a/rt/html/Search/Elements/SelectLinks +++ b/rt/html/Search/Elements/SelectLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($AllowNull) { % } -%for my $option (@types) { -%foreach my $subtype (@subtypes) { - +% for my $option (@types) { +% if ($Suffix) { + +% next; +% } +% foreach my $subtype (@subtypes) { + +% } % } -%} <%INIT> @@ -59,6 +63,9 @@ my @types; if ($Scope =~ 'queue') { @types = qw(Cc AdminCc); } +elsif ($Suffix eq 'Group') { + @types = qw(Requestor Cc AdminCc Watcher); +} else { @types = qw(Requestor Cc AdminCc Watcher Owner); } @@ -68,6 +75,7 @@ my @subtypes = qw(EmailAddress Name RealName Nickname Organization Address1 Addr <%ARGS> $AllowNull => 1 +$Suffix => '' $Default=>undef $Scope => 'ticket' $Name => 'WatcherType' diff --git a/rt/html/Search/Elements/SelectSearchObject b/rt/html/Search/Elements/SelectSearchObject index 6eaa680f8..e9df5179f 100644 --- a/rt/html/Search/Elements/SelectSearchObject +++ b/rt/html/Search/Elements/SelectSearchObject @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> @Objects => undef $Name => undef diff --git a/rt/html/Search/Elements/SelectSearchesForObjects b/rt/html/Search/Elements/SelectSearchesForObjects index 3f0c458cb..e6be66a58 100644 --- a/rt/html/Search/Elements/SelectSearchesForObjects +++ b/rt/html/Search/Elements/SelectSearchesForObjects @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> @Objects => undef $Name => undef @@ -57,6 +57,9 @@ $Name => undef % } % my @searches = $object->Attributes->Named('SavedSearch'); % foreach my $search (@searches) { +% # Skip it if it is not a ticket search. +% next if ($search->SubValue('SearchType') +% && $search->SubValue('SearchType') ne 'Ticket'); % } % } diff --git a/rt/html/Search/Results.html b/rt/html/Search/Results.html index dfcc7885c..5849378a8 100755 --- a/rt/html/Search/Results.html +++ b/rt/html/Search/Results.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> <& /Ticket/Elements/Tabs, current_tab => "Search/Results.html".$QueryString, @@ -52,7 +52,6 @@ Rows => $Rows, OrderBy => $OrderBy, Order => $Order &> -
            <& /Elements/TicketList, Query => $Query, AllowSorting => 1, @@ -81,24 +80,26 @@ <&|/l&>Update multiple tickets
            <&|/l&>Bookmarkable link
            <&|/l&>spreadsheet | -<&|/l&>RSS | -<&|/l&>Work offline
            +<&|/l&>RSS | +<&|/l&>Work offline
            <& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&> <%INIT> my ($title, $ticketcount); $session{'i'}++; -$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'}); +$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ; $session{'tickets'}->FromSQL($Query) if ($Query); $session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'} - or $Order ne $session{'CurrentSearchHash'}->{'Order'}) { - $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy; - $session{'CurrentSearchHash'}->{'Order'} = $Order; - # Invalidate the ordering cache - undef $session{'tickets'}->{'items_array'}; -} + +$session{'CurrentSearchHash'} = { + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $Rows + }; + if ( $session{'tickets'}->Query()) { @@ -116,6 +117,7 @@ my $QueryString = "?".$m->comp('/Elements/QueryString', Order => $Order, Page => $Page); +my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query); if ($ARGS{'TicketsRefreshInterval'}) { $session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'}; diff --git a/rt/html/Search/Results.rdf b/rt/html/Search/Results.rdf index 8054c8616..ee71fea94 100644 --- a/rt/html/Search/Results.rdf +++ b/rt/html/Search/Results.rdf @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $Tickets = RT::Tickets->new($session{'CurrentUser'}); diff --git a/rt/html/Search/Results.tsv b/rt/html/Search/Results.tsv index 631e299f0..17aa88ae1 100644 --- a/rt/html/Search/Results.tsv +++ b/rt/html/Search/Results.tsv @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $Tickets = RT::Tickets->new($session{'CurrentUser'}); @@ -84,7 +84,8 @@ my @attrs = qw( id QueueObj->Name Subject Status TimeEstimated TimeWorked TimeLe my @header; foreach my $attr (@attrs) { my $label = $attr; - $label =~ s'Obj-.(AsString|Name|ISO)''g; + $label =~ s'Obj-.(?:AsString|Name|ISO)''g; + $label =~ s'-\>MemberEmailAddressesAsString''g; push @header, $label; } foreach my $id (sort keys %known_cfs) { diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler index 698e345d3..f953c2486 100644 --- a/rt/html/SelfService/Attachment/dhandler +++ b/rt/html/SelfService/Attachment/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> $m->comp('/Ticket/Attachment/dhandler', %ARGS); $m->abort; diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html index 515879eeb..2d49a6897 100644 --- a/rt/html/SelfService/Closed.html +++ b/rt/html/SelfService/Closed.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title => loc('Closed Tickets') &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, Title => loc('Closed tickets') &> <& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => loc('closed') &> diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html index a2cfd9fee..d60ae267a 100644 --- a/rt/html/SelfService/Create.html +++ b/rt/html/SelfService/Create.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& Elements/Header, Title => loc("Create a ticket") &> @@ -50,43 +50,49 @@ - - + - - - - - - - - + + + + - @@ -100,3 +106,10 @@ +<%args> +$Queue => undef + +<%init> +my $queue_obj = RT::Queue->new($session{'CurrentUser'}); +$queue_obj->Load($Queue); + diff --git a/rt/html/SelfService/CreateTicketInQueue.html b/rt/html/SelfService/CreateTicketInQueue.html new file mode 100755 index 000000000..5e8973610 --- /dev/null +++ b/rt/html/SelfService/CreateTicketInQueue.html @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 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., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& Elements/Header, Title => loc("Create a ticket") &> + +

            <&|/l&>Select a queue for your new ticket

            + +
            +% while (my $queue = $queues->Next) { +% next unless $queue->CurrentUserHasRight('CreateTicket'); + +
            <%$queue->Name%>
            +
            <%$queue->Description%>
            +% } +
            +<%init> +my $queues = RT::Queues->new($session{'CurrentUser'}); +$queues->UnLimit; + diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index a94593e32..f7140df02 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> <& /Elements/ListActions, actions => \@results &> @@ -54,6 +54,7 @@ title_class=> 'inverse', color => "#993333" &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &>
            +% if ($TxnCFs->Count) { +% while (my $CF = $TxnCFs->Next()) { + + + + +% } +% } % if (exists $session{'Attachments'}) { @@ -228,7 +237,8 @@ $ARGS{Due}%>"> my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); -my $CFs = $QueueObj->CustomFields(); +my $CFs = $QueueObj->TicketCustomFields(); +my $TxnCFs = $QueueObj->TicketTransactionCustomFields(); # if no due date has been set explicitly, then use the # queue's default if it exists diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html index 745ed42d2..dd4c093dc 100644 --- a/rt/html/Ticket/Display.html +++ b/rt/html/Ticket/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> <& /Ticket/Elements/Tabs, @@ -58,6 +58,9 @@ <& /Elements/TitleBoxEnd &>
            + +<& /Elements/Callback, _CallbackName => 'BeforeShowHistory', Ticket => $TicketObj, %ARGS &> + <& /Ticket/Elements/ShowHistory , Ticket => $TicketObj, Tickets => $Tickets, @@ -124,10 +127,11 @@ if ($ARGS{'id'} eq 'new') { } } - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'}; if ( $ARGS{'UpdateTimeWorked'} || $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' + ( defined $ARGS{'UpdateContent'} + && $ARGS{'UpdateContent'} ne '' && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature )) { $ARGS{UpdateAttachments} = $session{'Attachments'}; diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers index f70e86a17..98314b9d2 100644 --- a/rt/html/Ticket/Elements/AddWatchers +++ b/rt/html/Ticket/Elements/AddWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            <%$msg%>
            diff --git a/rt/html/Ticket/Elements/BulkLinks b/rt/html/Ticket/Elements/BulkLinks index c071bd1cc..6a3859aa3 100644 --- a/rt/html/Ticket/Elements/BulkLinks +++ b/rt/html/Ticket/Elements/BulkLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            + <&|/l&>Queue: - -<& /Elements/SelectNewTicketQueue, Verbose => 'True' &> + + + <%$queue_obj->Name%> (<%$queue_obj->Description%>)
            + <&|/l&>Requestors: +
            + <&|/l&>Cc: +
            + <&|/l&>Subject: +
            +
            + <& /Ticket/Elements/EditCustomFields, QueueObj => $queue_obj &> +
            <&|/l&>Attach file: - + +
            @@ -69,7 +70,14 @@ %#!!pape: selfservice_find_attachments.patch {{ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment", Attachments => $attachments, UpdatePath => "Update.html" &> +<& /Ticket/Elements/ShowHistory, + Ticket => $Ticket, + URIFile => "Display.html", + ShowHeaders => $ARGS{'ShowHeaders'}, + AttachPath => "Attachment", + Attachments => $attachments, + UpdatePath => "Update.html" +&> %#!!pape: selfservice_find_attachments.patch }} @@ -85,6 +93,30 @@ my ( $field, @results ); my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id); my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); + +# store the uploaded attachment in session +if ( $ARGS{'Attach'} ) { # attachment? + $session{'Attachments'} = {} unless defined $session{'Attachments'}; + + my $subject = "$ARGS{'Attach'}"; + + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'Attach' + ); + + $session{'Attachments'} = + { %{ $session{'Attachments'} || {} }, + $ARGS{'Attach'} => $attachment }; +} + if ( $id[0] eq 'new' ) { # {{{ Create a new ticket @@ -97,108 +129,87 @@ if ( $id[0] eq 'new' ) { unless ( $Queue->CurrentUserHasRight('CreateTicket') ) { $m->comp( 'Error.html', - Why => - loc('You have no permission to create tickets in that queue.') ); + Why => + loc('You have no permission to create tickets in that queue.') ); $m->abort; } - my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} ); - my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} ); - - my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'}, - From => $ARGS{'From'}, - Cc => $ARGS{'Cc'}, - Body => $ARGS{'Content'}, - AttachmentFieldName => 'Attach' ); - - #TODO in Create_Details.html: priorities and due-date - my ( $id, $Trans, $ErrMsg ) = $Ticket->Create( Queue => $ARGS{Queue}, - Requestor => \@Requestors, - Cc => \@Cc, - Subject => $ARGS{Subject}, - MIMEObj => $MIMEObj ); - unless ( $id && $Trans ) { - $m->comp( 'Error.html', Why => $ErrMsg ); - $m->abort(); - } - push ( @results, $ErrMsg ); + ( $Ticket, @results ) = + CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' ); + + unless ( $Ticket->id ) { + $m->comp( 'Error.html', Why => join( "\n", @results )); + $m->abort(); + } + + # }}} + + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { + delete $session{'Attachments'}; + } + + # }}} + } + else { + unless ( $Ticket->Load( $id[0] ) ) { + $m->comp( 'Error.html', + Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + $m->abort(); + } + } # }}} -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} -} -else { - unless ( $Ticket->Load( $id[0] ) ) { + unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { $m->comp( 'Error.html', - Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + Why => loc("No permission to display that ticket") ); $m->abort(); } -} -# }}} + my ( $code, $msg ); -unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { - $m->comp( 'Error.html', - Why => loc("No permission to display that ticket") ); - $m->abort(); -} - -my ( $code, $msg ); - -#Update the status -if ( ( defined $ARGS{'Status'} ) and $ARGS{'Status'} - and ( $ARGS{'Status'} ne $Ticket->Status ) ) { - ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); - push @results, "$msg"; -} - -# {{{ store the uploaded attachment in session -if ($ARGS{'Attach'}) { # attachment? - $session{'Attachments'} = {} unless defined $session{'Attachments'}; + #Update the status + if ( ( defined $ARGS{'Status'} ) + and $ARGS{'Status'} + and ( $ARGS{'Status'} ne $Ticket->Status ) ) + { + ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); + push @results, "$msg"; + } - my $subject = "$ARGS{'Attach'}"; - # since CGI.pm deutf8izes the magic field, we need to add it back. - Encode::_utf8_on($subject); - # strip leading directories - $subject =~ s#^.*[\\/]##; + # }}} - my $attachment = MakeMIMEEntity( - Subject => $subject, - Body => "", - AttachmentFieldName => 'Attach' + if ( + $session{'Attachments'} + || ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) + ) + { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + } + ProcessUpdateMessage( + ARGSRef => \%ARGS, + Actions => \@results, + TicketObj => $Ticket ); - $session{'Attachments'} = { %{$session{'Attachments'} || {}}, - $ARGS{'Attach'} => $attachment }; -} -# }}} + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { + delete $session{'Attachments'}; + } -if ( $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature )) { - $ARGS{UpdateAttachments} = $session{'Attachments'}; -} -ProcessUpdateMessage( ARGSRef => \%ARGS, - Actions => \@results, - TicketObj => $Ticket ); + my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS); + push (@results, @cfupdates); -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} + # }}} -my $Transactions = $Ticket->Transactions; + my $Transactions = $Ticket->Transactions; -#!!pape: selfservice_find_attachments.patch {{ -my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); -#!!pape: selfservice_find_attachments.patch }} + my $attachments = + $m->comp( '/Ticket/Elements/FindAttachments', Ticket => $Ticket ); diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket index 265d69874..50efaa24e 100644 --- a/rt/html/SelfService/Elements/GotoTicket +++ b/rt/html/SelfService/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
             
            diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header index 6fe2133ea..c7e6a9167 100644 --- a/rt/html/SelfService/Elements/Header +++ b/rt/html/SelfService/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,6 +42,6 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> <& /SelfService/Elements/Tabs, %ARGS &> diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 026722a7f..2df8ce842 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => $title &> @@ -57,7 +57,7 @@ <%$Ticket->Id%>: <%$Ticket->Subject%> diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs index dbe2109ce..802fd6525 100644 --- a/rt/html/SelfService/Elements/Tabs +++ b/rt/html/SelfService/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -67,12 +67,16 @@ my $tabs = { A => { title => loc('Open tickets'), path => 'SelfService/Closed.html', }, C => { title => loc('New ticket'), - path => 'SelfService/Create.html' - }, - Z => { title => loc('Preferences'), - path => 'SelfService/Prefs.html' + path => 'SelfService/CreateTicketInQueue.html' } }; +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $tabs->{Z} = { title => loc('Preferences'), + path => 'SelfService/Prefs.html' + }; +} + my $actions = { B => { html => $m->scomp('GotoTicket') } diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html index b4cddee4f..8ac9f81ea 100644 --- a/rt/html/SelfService/Error.html +++ b/rt/html/SelfService/Error.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Error') &>

            <%loc('Error')%>

            <& /Elements/TitleBoxStart, title => $Title &> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index ce2165e22..3913203fb 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Preferences') &> <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index ef37684c9..816a610aa 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,35 +42,62 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, + Title =>loc('Update ticket #[_1]', $Ticket->id) +&>
            - -<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",$DefaultStatus) &>
            -<&|/l&>Subject:
            +
            -<%$Ticket->Status%> +<%loc($Ticket->Status)%> <%$Ticket->OwnerObj->Name%>
            - + + + + + + + + + % if (exists $session{'Attachments'}) { - - + + + - % } # end of if - + + + +
            + <&|/l&>Status + + <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",loc($DefaultStatus)) &> +
            + <&|/l&>Subject + + +
            -<&|/l&>Attached file: - -<&|/l&>Check box to delete
            +
            + <&|/l&>Attached file + + <&|/l&>Check box to delete
            % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
            + <%$attach_name%>
            % } # end of foreach -
            <&|/l&>Attach: -
            + <&|/l&>Attach + + + +
            -<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> -
            +<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/MessageBox, + Name => "UpdateContent", + QuoteTransaction => $ARGS{QuoteTransaction} + &> +
            <& /Elements/Submit &> @@ -82,14 +109,14 @@ my $Ticket = LoadTicket($id); -my $title = loc("Update ticket #[_1]", $Ticket->id); +my $title = loc( "Update ticket #[_1]", $Ticket->id ); $DefaultStatus = $Ticket->Status() unless ($DefaultStatus); -Abort(loc("No permission to view update ticket")) - unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or - $Ticket->CurrentUserHasRight('ModifyTicket') ); +Abort( loc("No permission to view update ticket") ) + unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') + or $Ticket->CurrentUserHasRight('ModifyTicket') ); diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html index 234568c81..f3ccb8555 100644 --- a/rt/html/SelfService/index.html +++ b/rt/html/SelfService/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => undef &> <& /SelfService/Elements/MyRequests &> diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler index 27b88bd14..584fd721d 100644 --- a/rt/html/Ticket/Attachment/dhandler +++ b/rt/html/Ticket/Attachment/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> my ($ticket, $trans,$attach, $filename); my $arg = $m->dhandler_arg; # get rest of path diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index fd2af45ff..b547242f2 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,12 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Create a new ticket") &> <& /Elements/Tabs, current_toptab => "Ticket/Create.html", Title => loc("Create a new ticket") &> - + @@ -113,6 +113,15 @@ <& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &>
            <% $CF->Name %>:<& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><% $CF->FriendlyType %>
            @@ -121,7 +130,7 @@ <&|/l&>Check box to delete
            % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
            +<%$attach_name%>
            % } # end of foreach
            diff --git a/rt/html/Ticket/Elements/EditBasics b/rt/html/Ticket/Elements/EditBasics index 7ad4a63b0..715685153 100644 --- a/rt/html/Ticket/Elements/EditBasics +++ b/rt/html/Ticket/Elements/EditBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            <&|/l&>Merge into:
            @@ -84,7 +84,7 @@ <%INIT> #It's hard to do this inline, so we'll preload the html of the selectstatus in here. -my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",$TicketObj->Status)); +my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",loc($TicketObj->Status))); my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField index 74e57ddf3..63687acd7 100644 --- a/rt/html/Ticket/Elements/EditCustomField +++ b/rt/html/Ticket/Elements/EditCustomField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,55 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -% my $Values; -% if ($TicketObj) { -% $Values = $TicketObj->CustomFieldValues($CustomField->id); -% } -% if ($CustomField->Type eq 'FreeformSingle') { - -% } elsif ($CustomField->Type eq 'FreeformMultiple') { -% my $content; -% if ($TicketObj) { -% while (my $value = $Values->Next ) { -% $content .= $value->Content; -% } -% } elsif ($Default) { - value="<%$Default ? $Default : ''%>" -% } - - -% } elsif ($CustomField->Type =~ /^Select/) { - - -% } -<%ARGS> -$TicketObj => undef -$CustomField => undef -$NamePrefix => undef -$Rows => 5 -$Cols=> 15 -$Default => undef - +%# END BPS TAGGED BLOCK }}} +<%init> + +# RT 3.2 API compatibility glue + +$RT::Logger->debug("Ticket/Elements/EditCustomField is deprecated in RT 3.4 and will be removed in 3.6."); + +$ARGS{'NamePrefix'} =~ s/^Ticket-/Object-RT::Ticket-/; +$ARGS{'NamePrefix'} =~ s/^CustomField-/Object-RT::Ticket--CustomField-/; +$m->comp('/Elements/EditCustomField', %ARGS, Object=> $ARGS{'TicketObj'}); + diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields index b049751ff..d566f4e71 100644 --- a/rt/html/Ticket/Elements/EditCustomFields +++ b/rt/html/Ticket/Elements/EditCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            <&|/l&>Subject:
            - + % }
            @@ -66,7 +66,11 @@ <%$CustomField->Name%>
            <%$CustomField->FriendlyType%>
            <& EditCustomField, TicketObj => $TicketObj, CustomField => $CustomField, NamePrefix => $NamePrefix &><& /Elements/EditCustomField, + Object => $TicketObj, + CustomField => $CustomField, + NamePrefix => $NamePrefix + &>
            @@ -79,12 +83,12 @@ my $CustomFields; my $NamePrefix; if ($TicketObj) { - $CustomFields = $TicketObj->QueueObj->CustomFields(); - $NamePrefix = "Ticket-".$TicketObj->Id."-CustomField-"; + $CustomFields = $TicketObj->CustomFields(); + $NamePrefix = "Object-RT::Ticket-".$TicketObj->Id."-CustomField-"; } else { - $CustomFields = $QueueObj->CustomFields(); - $NamePrefix = "CustomField-"; + $CustomFields = $QueueObj->TicketCustomFields(); + $NamePrefix = "Object-RT::Ticket--CustomField-"; } diff --git a/rt/html/Ticket/Elements/EditDates b/rt/html/Ticket/Elements/EditDates index 8e12f2534..a19774192 100644 --- a/rt/html/Ticket/Elements/EditDates +++ b/rt/html/Ticket/Elements/EditDates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople index 4b2a1ac81..055d7ba20 100644 --- a/rt/html/Ticket/Elements/EditPeople +++ b/rt/html/Ticket/Elements/EditPeople @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
            <&|/l&>Starts:
            @@ -52,7 +52,7 @@ <& /Elements/SelectUsers &>
            -<&|/l&>Find group whose
            +<&|/l&>Find groups whose
            <& /Elements/SelectGroups &> diff --git a/rt/html/Ticket/Elements/EditWatchers b/rt/html/Ticket/Elements/EditWatchers index 19c884bd8..0089932f4 100644 --- a/rt/html/Ticket/Elements/EditWatchers +++ b/rt/html/Ticket/Elements/EditWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
              %# Print out a placeholder if there are none. %if ($Members->Count == 0 ) { @@ -52,7 +52,7 @@ %while (my $watcher=$Members->Next) {
            • - + %if ($watcher->MemberObj->IsUser) { <%$watcher->MemberObj->Object->Name%> diff --git a/rt/html/Ticket/Elements/FindAttachments b/rt/html/Ticket/Elements/FindAttachments index a1e973f0e..017c77288 100755 --- a/rt/html/Ticket/Elements/FindAttachments +++ b/rt/html/Ticket/Elements/FindAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my %documents; @@ -63,11 +63,14 @@ $attachments->Join( ALIAS1 => 'main', my $tickets = $attachments->NewAlias('Tickets'); -$attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', - ALIAS2 => $tickets, - FIELD2 => 'id' ); - + $attachments->Join( ALIAS1 => $transactions, + FIELD1 => 'ObjectId', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); if ($Tickets) { while ($Ticket = $Tickets->Next) { $attachments->Limit( ALIAS => $tickets, diff --git a/rt/html/Ticket/Elements/LoadTextAttachments b/rt/html/Ticket/Elements/LoadTextAttachments index 370371b5a..943568fb3 100755 --- a/rt/html/Ticket/Elements/LoadTextAttachments +++ b/rt/html/Ticket/Elements/LoadTextAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); @@ -58,11 +58,17 @@ if ( $Ticket->CurrentUserHasRight('ShowTicket') ) { my $tickets = $attachments->NewAlias('Tickets'); + $attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', + FIELD1 => 'ObjectId', ALIAS2 => $tickets, FIELD2 => 'id' ); + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); + + $attachments->Limit( ALIAS => $tickets, FIELD => 'EffectiveId', VALUE => $Ticket->id() ); diff --git a/rt/html/Ticket/Elements/PreviewScrips b/rt/html/Ticket/Elements/PreviewScrips index 846c62c24..a3492b749 100755 --- a/rt/html/Ticket/Elements/PreviewScrips +++ b/rt/html/Ticket/Elements/PreviewScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $TicketObj => undef @@ -95,7 +95,7 @@ my @non_recipients = $TicketObj->SquelchMailTo; % foreach my $scrip (@{$Object->Scrips->Prepared}) { % next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail'); <%$scrip->Description%>
              -<&|/l, $scrip->ConditionObj->Name, $scrip->ActionObj->Name, $scrip->TemplateObj->Name&>[_1] [_2] with template [_3] +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]
              %foreach my $type qw(To Cc Bcc) { %my @addresses = $scrip->ActionObj->Action->$type(); diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments index 8a2a5cb3f..82028dd28 100644 --- a/rt/html/Ticket/Elements/ShowAttachments +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if (keys %documents) { <& /Elements/TitleBoxStart, title => loc('Attachments'), title_class=> 'inverse', @@ -82,8 +82,12 @@ if ($size) { % } <%INIT> -my %documents; +# If we haven't been passed in an Attachments object (through the precaching mechanism) +# then we need to find one +$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket); + +my %documents; while ( my $attach = $Attachments->Next() ) { next unless ($attach->Filename()); unshift( @{ $documents{ $attach->Filename } }, $attach ); diff --git a/rt/html/Ticket/Elements/ShowBasics b/rt/html/Ticket/Elements/ShowBasics index 55e923fa2..00ed3ccd1 100644 --- a/rt/html/Ticket/Elements/ShowBasics +++ b/rt/html/Ticket/Elements/ShowBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Ticket/Elements/ShowCustomFields b/rt/html/Ticket/Elements/ShowCustomFields index 895439e1b..eb49212c5 100644 --- a/rt/html/Ticket/Elements/ShowCustomFields +++ b/rt/html/Ticket/Elements/ShowCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,27 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -
              <&|/l&>Id:
              -% my @entry_fields; -% while (my $CustomField = $CustomFields->Next()) { -% my $Values = $Ticket->CustomFieldValues($CustomField->Id); - - - - -% } -
              <%$CustomField->Name%>: -% while (my $Value = $Values->Next()) { -<%$Value->Content%>
              -% } -% unless ($Values->Count()) { -<&|/l&>(no value) -% } -
              -<%INIT> -my $CustomFields = $Ticket->QueueObj->CustomFields(); - +%# END BPS TAGGED BLOCK }}} +<& /Elements/ShowCustomFields, Object => $Ticket &> <%ARGS> $Ticket => undef diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates index a22a02d5c..2ccbb3fea 100644 --- a/rt/html/Ticket/Elements/ShowDates +++ b/rt/html/Ticket/Elements/ShowDates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} diff --git a/rt/html/Ticket/Elements/ShowDependencies b/rt/html/Ticket/Elements/ShowDependencies index d3bdd59bc..f276bc949 100644 --- a/rt/html/Ticket/Elements/ShowDependencies +++ b/rt/html/Ticket/Elements/ShowDependencies @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/l&>Depends on:
              % while (my $Link = $Ticket->DependsOn->Next) { % my $member = $Link->TargetObj; diff --git a/rt/html/Ticket/Elements/ShowGroupMembers b/rt/html/Ticket/Elements/ShowGroupMembers index 1d6e71182..1fdb79aab 100644 --- a/rt/html/Ticket/Elements/ShowGroupMembers +++ b/rt/html/Ticket/Elements/ShowGroupMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# Released under the terms of version 2 of the GNU Public License % my $UserMembers = $Group->UserMembersObj; diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 37b670d82..75e34776f 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> if ($ShowDisplayModes or $ShowTitle) { my $title; @@ -104,8 +104,8 @@ while ( my $Transaction = $Transactions->Next ) { $m->comp( 'ShowTransaction', %ARGS, - AttachPath => $AttachPath, - UpdatePath => $UpdatePath, + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, @@ -116,6 +116,10 @@ while ( my $Transaction = $Transactions->Next ) { AttachmentContent => $trans_content, LastTransaction => $Transactions->IsLast ); + +# manually flush the content buffer after each txn, so the user sees +# some update +$m->flush_buffer(); } @@ -127,9 +131,7 @@ while ( my $Transaction = $Transactions->Next ) { my $Transactions = new RT::Transactions($session{'CurrentUser'}); if ($Tickets) { while (my $t = $Tickets->Next) { - $Transactions->Limit(FIELD => 'Ticket', - OPERATOR => '=', - VALUE => $t->Id); + $Transactions->LimitToTicket($t->id); } } else { $Transactions = $Ticket->Transactions; @@ -153,5 +155,4 @@ $ShowDisplayModes => 1 $ShowTitleBarCommands => 1 $AttachPath => $RT::WebPath."/Ticket/Attachment" $UpdatePath => $RT::WebPath."/Ticket/Update.html" - diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf index eb285d34b..e443132bc 100644 --- a/rt/html/Ticket/Elements/ShowMemberOf +++ b/rt/html/Ticket/Elements/ShowMemberOf @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
                % my $memberof = $Ticket->MemberOf; % while (my $member_of = $memberof->Next) { -
              • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] +
              • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] % }
              diff --git a/rt/html/Ticket/Elements/ShowMembers b/rt/html/Ticket/Elements/ShowMembers index 9802e8982..f4fec1c7c 100644 --- a/rt/html/Ticket/Elements/ShowMembers +++ b/rt/html/Ticket/Elements/ShowMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($members->Count) {
                % while (my $link = $members->Next) { diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders index 408b2c898..8dc76bae3 100644 --- a/rt/html/Ticket/Elements/ShowMessageHeaders +++ b/rt/html/Ticket/Elements/ShowMessageHeaders @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % use Data::Dumper;
              <&|/l&>Created:
              % foreach my $header (@headers) { diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza index 8b912612b..eaf551de9 100644 --- a/rt/html/Ticket/Elements/ShowMessageStanza +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if (ref($Message)) { <%perl> @@ -57,7 +57,7 @@ foreach my $stanza (@$Message) { my $content = $stanza->{raw}; RT::Interface::Web::EscapeUTF8(\$content); $m->comp('/Elements/Callback', content => \$content, %ARGS); - $content =~ s/\n/
              /gi; + $content =~ s/\n/
              /gi if defined $content; <%$content |n%>
              diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople index 597a991d5..dbec93928 100644 --- a/rt/html/Ticket/Elements/ShowPeople +++ b/rt/html/Ticket/Elements/ShowPeople @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
              - + diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences index e3639d01d..bb323f66c 100644 --- a/rt/html/Ticket/Elements/ShowReferences +++ b/rt/html/Ticket/Elements/ShowReferences @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
                % while (my $Link = $Ticket->RefersTo->Next) {
              • % if ($Link->TargetURI->IsLocal) { % my $member = $Link->TargetObj; -<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
                +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
                % } else { <%$Link->Target%> % } @@ -61,7 +61,7 @@
              • % if ($Link->BaseURI->IsLocal) { % my $member = $Link->BaseObj; -<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
                +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
                % } else { <%$Link->Base%> %} diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor index cb9d7a6cc..421d38e0a 100644 --- a/rt/html/Ticket/Elements/ShowRequestor +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%PERL> my $rows = 10; my $people = $Ticket->Requestors->UserMembersObj; @@ -73,6 +73,11 @@ $tickets->OrderBy(FIELD => 'Priority',
              • <%$w->Id%>: <%$w->Subject%> (<%$w->Status%>) %}
              + +<&|/l&>Groups this user belongs to:
              + +<& /Elements/ShowMemberships, UserObj => $requestor &> + <& /Elements/TitleBoxEnd &> % } diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 5540417c7..31571400e 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
              <&|/l&>Owner:<%$Ticket->OwnerObj->Name%><& ShowUserEntry, User => $Ticket->OwnerObj &>
              <&|/l&>Requestors:
              - + % my $desc = $Transaction->BriefDescription; @@ -56,6 +56,9 @@ @@ -67,6 +70,7 @@ $ShowHeaders => 0 $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 +$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id $AttachPath => $RT::WebPath."/Ticket/Attachment" $UpdatePath => $RT::WebPath."/Ticket/Update.html" $EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html" @@ -114,6 +118,7 @@ else { if ( $Ticket->Id != $Transaction->Ticket ) { $TicketString = "Ticket " . $Transaction->Ticket . ": "; } +$TicketString ||= ''; if ( $Transaction->TimeTaken != 0 ) { $TimeTaken = $Transaction->TimeTaken . " min"; diff --git a/rt/html/Ticket/Elements/ShowTransactionAttachments b/rt/html/Ticket/Elements/ShowTransactionAttachments index b01586deb..8dabff421 100644 --- a/rt/html/Ticket/Elements/ShowTransactionAttachments +++ b/rt/html/Ticket/Elements/ShowTransactionAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> # Find all the attachments which have parent $Parent # For each of these attachments @@ -79,21 +79,24 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { } -<&|/l&>Download<%$message->Filename || loc('(untitled)') %> +<&|/l&>Download <%$message->Filename || loc('(untitled)') %>
              <%$message->ContentType%> <% $size %>
              -%} - +% } % # }}}
              <%perl> -# {{{ if it's got content-disposition inline, show it inline +# {{{ if it has a content-disposition: attachment, don't show inline +unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { + my $content; # If it's text - if ( $message->ContentType =~ m{^(text|message)}i ) { + if ( $message->ContentType =~ m{^(text|message)}i + && $size <= $RT::MaxInlineBody ) + { if ( @@ -127,7 +130,7 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) { $content = $m->comp( '/Elements/ScrubHTML', Content => $content ); - $m->out( $content ); + $m->out($content); } # if it's a text/plain show the body @@ -146,22 +149,24 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { } } - # if it's an image, show it as an image - elsif ( $message->ContentType =~ /^image\//i ) { - $m->out('' ); - } - - # }}} + # if it's an image, show it as an image + elsif ( $message->ContentType =~ /^image\//i ) { + $m->out('' ); + } +} - $m->comp( 'ShowTransactionAttachments', %ARGS, - Parent => $message->id, - ParentObj => $message ); +# }}} +$m->comp( + 'ShowTransactionAttachments', %ARGS, + Parent => $message->id, + ParentObj => $message +); } diff --git a/rt/html/Ticket/Elements/ShowUserEntry b/rt/html/Ticket/Elements/ShowUserEntry index 38473fff9..163bcbdb1 100644 --- a/rt/html/Ticket/Elements/ShowUserEntry +++ b/rt/html/Ticket/Elements/ShowUserEntry @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# Released under the terms of version 2 of the GNU Public License <%$User->Name%> diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs index 4f17d1024..1a5058691 100644 --- a/rt/html/Ticket/Elements/Tabs +++ b/rt/html/Ticket/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, Ticket => $Ticket, actions=> $actions, tabs => $tabs, %ARGS &> <& /Elements/Tabs, tabs => $tabs, @@ -121,7 +121,7 @@ my $ticket_page_tabs = { path => "Ticket/ModifyLinks.html?id=" . $id, }, _F => { title => loc('Jumbo'), path => "Ticket/ModifyAll.html?id=" . $id, - seperator => 1 + separator => 1 }, }; @@ -187,6 +187,7 @@ my $args = "?" . $m->comp( Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'}, Rows => $ARGS{'Rows'}, ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'}); +$args ||= ''; $tabs->{"f"} = { path => "Search/Build.html?NewQuery=1", title => loc('New Query')}; @@ -211,7 +212,7 @@ if (defined $session{'tickets'} and $session{'tickets'}->Count) { <%ARGS> $Ticket => undef $subtabs => undef -$current_tab => undef -$current_subtab => undef +$current_tab => '' +$current_subtab => '' $Title => undef diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html index faa6a29d5..a80cd0002 100644 --- a/rt/html/Ticket/History.html +++ b/rt/html/Ticket/History.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Ticket History # [_1] [_2]", $Ticket->Id, $Ticket->Subject) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/History.html?id='.$Ticket->id, diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html index f567ff2b3..a6c316141 100644 --- a/rt/html/Ticket/Modify.html +++ b/rt/html/Ticket/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify ticket #[_1]', $TicketObj->Id) &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_subtab => "Ticket/Modify.html?id=".$TicketObj->Id, Title => loc('Modify ticket #[_1]', $TicketObj->Id) &> <& /Elements/ListActions, actions => \@results &> - + <& /Elements/TitleBoxStart, title => loc('Modify ticket #[_1]',$TicketObj->Id), color=> "#993333", width => "100%" &> @@ -62,13 +62,13 @@ <%INIT> my $TicketObj = LoadTicket($id); -my $CustomFields = $TicketObj->QueueObj->CustomFields(); +my $CustomFields = $TicketObj->QueueObj->TicketCustomFields(); # Now let callbacks have a chance at editing %ARGS $m->comp('/Elements/Callback', TicketObj => $TicketObj, CustomFields => $CustomFields, %ARGS); my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); -my @cf_results = ProcessTicketCustomFieldUpdates(TicketObj => $TicketObj, ARGSRef => \%ARGS); +my @cf_results = ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS); push (@results, @cf_results); # TODO: display the results, even if we can't display the ticket diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html index f78cddcf1..23cd93570 100644 --- a/rt/html/Ticket/ModifyAll.html +++ b/rt/html/Ticket/ModifyAll.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, @@ -100,6 +100,17 @@
              +% if (my $TxnCFs = $Ticket->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { + + + + +% } # end if while +% } # end of if @@ -112,7 +123,9 @@ <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +<& /Elements/Submit, + Label => loc('Save Changes'), + Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> <%INIT> @@ -136,8 +149,7 @@ my (@wresults, @results, @dresults, @lresults, @cf_results); unless ($OnlySearchForPeople) { @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); - @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); - @cf_results = ProcessTicketCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @cf_results = ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS); @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); @@ -159,15 +171,11 @@ unless ($OnlySearchForPeople) { $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g; - if ($ARGS{'UpdateAttachments'} || ( - $ARGS{'UpdateContent'} && - $ARGS{'UpdateContent'} ne "-- \n" . - $session{'CurrentUser'}->UserObj->Signature - )) { - ProcessUpdateMessage(TicketObj => $Ticket, - ARGSRef=>\%ARGS, - Actions=>\@results); + if ($ARGS{'UpdateAttachments'} || ( $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature)) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results); } + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); } push @results, @wresults; push @results, @dresults; diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html index bf4bc7993..a4f68f2f5 100644 --- a/rt/html/Ticket/ModifyDates.html +++ b/rt/html/Ticket/ModifyDates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify dates for #[_1]', $TicketObj->Id) &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html index 05d369d72..150597d89 100644 --- a/rt/html/Ticket/ModifyLinks.html +++ b/rt/html/Ticket/ModifyLinks.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Link ticket #[_1]", $Ticket->Id) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html index dde2d297d..61cbe6c27 100644 --- a/rt/html/Ticket/ModifyPeople.html +++ b/rt/html/Ticket/ModifyPeople.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify people related to ticket #[_1]', $Ticket->id) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, diff --git a/rt/html/Ticket/ShowEmailRecord.html b/rt/html/Ticket/ShowEmailRecord.html index 23eb6d5a0..38eddd3d2 100644 --- a/rt/html/Ticket/ShowEmailRecord.html +++ b/rt/html/Ticket/ShowEmailRecord.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Attachment => undef $Transaction => undef diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html index e26d98830..df739c9c7 100644 --- a/rt/html/Ticket/Update.html +++ b/rt/html/Ticket/Update.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, @@ -58,7 +58,7 @@ @@ -94,19 +94,33 @@ value="<% $ARGS{UpdateCc} %>">
              % } # end of if + +% if (my $TxnCFs = $TicketObj->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { + + + + +% } # end if while +% } # end of if + > + DefaultLabel => loc("[_1] (Unchanged)",loc($Ticket->Status())) &> % } diff --git a/rt/html/Tools/Offline.html b/rt/html/Tools/Offline.html index 0879c94fc..8b12784e8 100644 --- a/rt/html/Tools/Offline.html +++ b/rt/html/Tools/Offline.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Offline upload") &> <& Elements/Tabs, current_tab => "Tools/Offline.html", diff --git a/rt/html/User/Delegation.html b/rt/html/User/Delegation.html index 47a5d13a2..3347fda1f 100644 --- a/rt/html/User/Delegation.html +++ b/rt/html/User/Delegation.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Delegate rights") &> <& /User/Elements/Tabs, current_tab => 'User/Delegation.html', diff --git a/rt/html/User/Elements/DelegateRights b/rt/html/User/Elements/DelegateRights index 112f3f6df..79ecb5977 100644 --- a/rt/html/User/Elements/DelegateRights +++ b/rt/html/User/Elements/DelegateRights @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}

              <%$sectionheading%>

              <%perl> @@ -81,7 +81,7 @@ while ( my $delegation = $delegations->Next) { % while (my $pg = $personalgroups->Next) {
              @@ -53,7 +53,7 @@ <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &>
              -% if ($Ticket->QueueObj->CustomFields()->First) { +% if ($Ticket->QueueObj->TicketCustomFields->First) { <& /Elements/TitleBoxStart, title => loc('Custom Fields'), title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, title_class=> 'inverse', diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index f0b8326cf..8bf589d45 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,9 +42,9 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}}
              #<% $LastTransaction ? ' ' : ' ' |n %>#<% $LastTransaction ? ' ' : ' ' |n %>    <% $transdate|n %> <%$titlebar_commands|n%>
              +% if ($Transaction->CustomFieldValues->Count) { +<& /Elements/ShowCustomFields, Object => $Transaction &> +% } % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
              <&|/l&>Subject:
              <% $CF->Name %>:<& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => "Object-RT::Transaction--CustomField-" + &><% $CF->FriendlyType %>
              <&|/l&>Attach:
              <&|/l&>Status: -<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->Status), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&> +<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($TicketObj->Status)), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&> <&|/l&>Owner: <& /Elements/SelectOwner, Name=>"Owner", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj, Default => $ARGS{'Owner'} &> <&|/l&>Worked: <&|/l&>minutes
              <&|/l&>Check box to delete
              % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<%$attach_name%>
              +<%$attach_name%>
              % } # end of foreach
              <% $CF->Name %>:<& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><% $CF->FriendlyType %>
              <&|/l&>Attach:
              <&|/l&>Message: <& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> % if (exists $ARGS{UpdateContent}) { +% # preserve QuoteTransaction so we can use it to set up sane references/in/reply to +% my $temp = $ARGS{'QuoteTransaction'}; % delete $ARGS{'QuoteTransaction'}; <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> +% $ARGS{'QuoteTransaction'} = $temp; % } else { <& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> % } @@ -122,7 +136,6 @@ value="<% $ARGS{UpdateCc} %>">
              % } <%INIT> - my $CanRespond = 0; my $CanComment = 0; my $title; @@ -168,6 +181,7 @@ foreach my $key (keys %ARGS) { } $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; } +# }}} # {{{ store the uploaded attachment in session if ($ARGS{'Attach'}) { # attachment? @@ -180,7 +194,7 @@ if ($ARGS{'Attach'}) { # attachment? $subject =~ s#^.*[\\/]##; my $attachment = MakeMIMEEntity( - Subject => $subject, + Filename => $subject, Body => "", AttachmentFieldName => 'Attach' ); @@ -200,6 +214,7 @@ if ( exists $ARGS{SubmitTicket} ) { $m->comp('Display.html', TicketObj => $TicketObj, %ARGS); return; } + <%ARGS> diff --git a/rt/html/Tools/Elements/Tabs b/rt/html/Tools/Elements/Tabs index 39321f145..fc4153b98 100644 --- a/rt/html/Tools/Elements/Tabs +++ b/rt/html/Tools/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Tools/Offline.html', diff --git a/rt/html/Tools/MyDay.html b/rt/html/Tools/MyDay.html index 3fe2eda21..a20209c9b 100644 --- a/rt/html/Tools/MyDay.html +++ b/rt/html/Tools/MyDay.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, title => "What I did today" &> (displaying new and open tickets for <%$session{'CurrentUser'}->Name%>)
              @@ -62,7 +62,7 @@ HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: cols=60>
              Status: <& /Elements/SelectStatus, Name=> 'UpdateStatus-'.$Ticket->Id, - DefaultLabel => loc("[_1] (Unchanged)",$Ticket->Status()) &>
              - {$pg->PrincipalId} && 'CHECKED' %>> + {$pg->PrincipalId} && 'CHECKED' %>> % if ( $del_hash->{$pg->PrincipalId}) { % } diff --git a/rt/html/User/Elements/GroupTabs b/rt/html/User/Elements/GroupTabs index 26d8e8512..2e79df268 100644 --- a/rt/html/User/Elements/GroupTabs +++ b/rt/html/User/Elements/GroupTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /User/Elements/Tabs, subtabs => $tabs, current_tab => 'User/Groups/', diff --git a/rt/html/User/Elements/Tabs b/rt/html/User/Elements/Tabs index 6411be658..1d25fb926 100644 --- a/rt/html/User/Elements/Tabs +++ b/rt/html/User/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'User/Prefs.html', diff --git a/rt/html/User/Groups/Members.html b/rt/html/User/Groups/Members.html index 0b133b35b..2068e5a5b 100644 --- a/rt/html/User/Groups/Members.html +++ b/rt/html/User/Groups/Members.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, GroupObj => $Group, @@ -81,7 +81,7 @@ % $UserMembers->LimitToUsers();
                % while (my $member = $UserMembers->Next()) { -
              • +
              • <%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) % }
              @@ -90,7 +90,7 @@ % my $GroupMembers = $Group->MembersObj; % $GroupMembers->LimitToGroups(); % while (my $member = $GroupMembers->Next()) { -
            • +
            • <%$member->MemberObj->Object->Name%> % } % } diff --git a/rt/html/User/Groups/Modify.html b/rt/html/User/Groups/Modify.html index e744e104d..c0e9ce575 100644 --- a/rt/html/User/Groups/Modify.html +++ b/rt/html/User/Groups/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, @@ -74,7 +74,7 @@ > <&|/l&>Enabled (Unchecking this box disables this group)
            • -<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> <%INIT> diff --git a/rt/html/User/Groups/index.html b/rt/html/User/Groups/index.html index d4fa7dfb5..6d2e15d47 100644 --- a/rt/html/User/Groups/index.html +++ b/rt/html/User/Groups/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, current_subtab => 'User/Groups/index.html', diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index b5aa13db9..f1c755826 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title=>loc("Preferences") &> <& /User/Elements/Tabs, current_tab => 'User/Prefs.html', @@ -165,7 +165,7 @@ %if ($UserObj->Privileged) {
              <& /Elements/TitleBoxStart, title => loc('Signature') &> - <& /Elements/TitleBoxEnd &> % } @@ -210,9 +210,10 @@ if ($UserObj->Id) { Object => $UserObj, ARGSRef => \%ARGS ); if ($Lang) { - $session{'CurrentUser'}->LanguageHandle($Lang); - $session{'CurrentUser'}= $session{'CurrentUser'}; # Force writeback + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback } + push (@results,@fieldresults); diff --git a/rt/html/autohandler b/rt/html/autohandler index b21d26145..c854c2b33 100644 --- a/rt/html/autohandler +++ b/rt/html/autohandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> # Roll back any dangling transactions from a previous failed connection @@ -61,21 +61,15 @@ if ($m->request_comp->attr_exists('AutoFlush')) { # passed just one, a scalar whatever they are, mark them as utf8 my $type = ref($_); (!$type) - ? Encode::decode(utf8 => $_, Encode::FB_PERLQQ) : + ? Encode::is_utf8($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) : ($type eq 'ARRAY') - ? [ map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] : + ? [ map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] : ($type eq 'HASH') - ? { map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_ + ? { map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_ } %ARGS; -if ($ARGS{'Debug'}) { - require Time::HiRes; - $m->{'rt_base_time'} = [Time::HiRes::gettimeofday()]; +$m->{'rt_base_time'} = [Time::HiRes::gettimeofday()]; -} -else { - $m->{'rt_base_time'} = time; -} $m->comp('/Elements/SetupSessionCookie', %ARGS); unless ($session{'CurrentUser'} && $session{'CurrentUser'}->Id) { @@ -169,7 +163,7 @@ elsif ( $RT::WebExternalAuth ) { elsif ($RT::WebFallbackToInternalAuth) { unless (defined($session{'CurrentUser'})) { $m->comp('/Elements/Login', %ARGS, - Error=> loc('XXX CHANGEME You are not an authorized user')); + Error=> loc('You are not an authorized user')); $m->abort(); } } else { @@ -193,8 +187,8 @@ if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){ if (!$session{'CurrentUser'}->id() || !$session{'CurrentUser'}->IsPassword($pass)) { - $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}"); delete $session{'CurrentUser'}; + $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}"); $m->comp('/Elements/Login', %ARGS, Error => loc('Your username or password is incorrect')); $m->abort(); diff --git a/rt/html/index.html b/rt/html/index.html index 8c64b5aeb..04d48ece6 100644 --- a/rt/html/index.html +++ b/rt/html/index.html @@ -24,11 +24,11 @@ If you need commercial support, please contact us at sales@bestpractical.com.