From 945721f48f74d5cfffef7c7cf3a3d6bc2521f5dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 15 Jul 2003 13:16:32 +0000 Subject: import of rt 3.0.4 --- rt/html/Admin/Elements/AddCustomFieldValue | 44 ++++ rt/html/Admin/Elements/CreateUserCalled | 26 ++ rt/html/Admin/Elements/EditCustomField | 127 ++++++++++ rt/html/Admin/Elements/EditCustomFieldValues | 42 ++++ rt/html/Admin/Elements/EditCustomFields | 214 ++++++++++++++++ rt/html/Admin/Elements/EditQueueWatchers | 55 ++++ rt/html/Admin/Elements/EditScrip | 149 +++++++++++ rt/html/Admin/Elements/EditScrips | 97 +++++++ rt/html/Admin/Elements/EditTemplates | 104 ++++++++ rt/html/Admin/Elements/EditUserComments | 32 +++ rt/html/Admin/Elements/GroupTabs | 76 ++++++ rt/html/Admin/Elements/Header | 28 +++ rt/html/Admin/Elements/ListGlobalCustomFields | 37 +++ rt/html/Admin/Elements/ListGlobalScrips | 37 +++ rt/html/Admin/Elements/ModifyQueue | 78 ++++++ rt/html/Admin/Elements/ModifyTemplate | 60 +++++ rt/html/Admin/Elements/ModifyUser | 99 ++++++++ rt/html/Admin/Elements/QueueRightsForUser | 40 +++ rt/html/Admin/Elements/QueueTabs | 93 +++++++ rt/html/Admin/Elements/SelectCustomFieldType | 36 +++ rt/html/Admin/Elements/SelectGroups | 37 +++ rt/html/Admin/Elements/SelectModifyGroup | 33 +++ rt/html/Admin/Elements/SelectModifyQueue | 33 +++ rt/html/Admin/Elements/SelectModifyUser | 49 ++++ rt/html/Admin/Elements/SelectNewGroupMembers | 61 +++++ rt/html/Admin/Elements/SelectRights | 90 +++++++ rt/html/Admin/Elements/SelectScrip | 48 ++++ rt/html/Admin/Elements/SelectScripAction | 48 ++++ rt/html/Admin/Elements/SelectScripCondition | 48 ++++ rt/html/Admin/Elements/SelectSingleOrMultiple | 43 ++++ rt/html/Admin/Elements/SelectTemplate | 61 +++++ rt/html/Admin/Elements/SelectUsers | 40 +++ rt/html/Admin/Elements/SystemTabs | 70 ++++++ rt/html/Admin/Elements/Tabs | 63 +++++ rt/html/Admin/Elements/UserTabs | 74 ++++++ rt/html/Admin/Global/CustomField.html | 61 +++++ rt/html/Admin/Global/CustomFields.html | 47 ++++ rt/html/Admin/Global/GroupRights.html | 99 ++++++++ rt/html/Admin/Global/Scrip.html | 56 +++++ rt/html/Admin/Global/Scrips.html | 53 ++++ rt/html/Admin/Global/Template.html | 101 ++++++++ rt/html/Admin/Global/Templates.html | 53 ++++ rt/html/Admin/Global/UserRights.html | 77 ++++++ rt/html/Admin/Global/index.html | 64 +++++ rt/html/Admin/Groups/GroupRights.html | 95 +++++++ rt/html/Admin/Groups/Members.html | 134 ++++++++++ rt/html/Admin/Groups/Modify.html | 134 ++++++++++ rt/html/Admin/Groups/UserRights.html | 92 +++++++ rt/html/Admin/Groups/index.html | 43 ++++ rt/html/Admin/Queues/CustomField.html | 60 +++++ rt/html/Admin/Queues/CustomFields.html | 48 ++++ rt/html/Admin/Queues/GroupRights.html | 110 ++++++++ rt/html/Admin/Queues/Modify.html | 163 ++++++++++++ rt/html/Admin/Queues/People.html | 186 ++++++++++++++ rt/html/Admin/Queues/Scrip.html | 67 +++++ rt/html/Admin/Queues/Scrips.html | 63 +++++ rt/html/Admin/Queues/Template.html | 101 ++++++++ rt/html/Admin/Queues/Templates.html | 57 +++++ rt/html/Admin/Queues/UserRights.html | 90 +++++++ rt/html/Admin/Queues/index.html | 61 +++++ rt/html/Admin/Users/Modify.html | 347 ++++++++++++++++++++++++++ rt/html/Admin/Users/Prefs.html | 122 +++++++++ rt/html/Admin/Users/index.html | 81 ++++++ rt/html/Admin/index.html | 40 +++ rt/html/Approvals/Display.html | 50 ++++ rt/html/Approvals/Elements/Approve | 56 +++++ rt/html/Approvals/Elements/PendingMyApproval | 87 +++++++ rt/html/Approvals/Elements/ShowDependency | 85 +++++++ rt/html/Approvals/Elements/Tabs | 34 +++ rt/html/Approvals/index.html | 66 +++++ rt/html/Elements/BevelBoxRaisedEnd | 26 ++ rt/html/Elements/BevelBoxRaisedStart | 26 ++ rt/html/Elements/Callback | 65 +++++ rt/html/Elements/Checkbox | 39 +++ rt/html/Elements/CreateTicket | 26 ++ rt/html/Elements/Error | 62 +++++ rt/html/Elements/Footer | 60 +++++ rt/html/Elements/GotoTicket | 24 ++ rt/html/Elements/Header | 82 ++++++ rt/html/Elements/ListActions | 43 ++++ rt/html/Elements/Login | 101 ++++++++ rt/html/Elements/Menu | 84 +++++++ rt/html/Elements/MessageBox | 47 ++++ rt/html/Elements/MyRequests | 78 ++++++ rt/html/Elements/MyTickets | 81 ++++++ rt/html/Elements/PageLayout | 99 ++++++++ rt/html/Elements/Quicksearch | 61 +++++ rt/html/Elements/Refresh | 45 ++++ rt/html/Elements/Section | 34 +++ rt/html/Elements/SelectAttachmentField | 31 +++ rt/html/Elements/SelectBoolean | 46 ++++ rt/html/Elements/SelectCustomFieldOperator | 40 +++ rt/html/Elements/SelectCustomFieldValue | 41 +++ rt/html/Elements/SelectDate | 48 ++++ rt/html/Elements/SelectDateRelation | 36 +++ rt/html/Elements/SelectDateType | 36 +++ rt/html/Elements/SelectEqualityOperator | 40 +++ rt/html/Elements/SelectGroups | 29 +++ rt/html/Elements/SelectLinkType | 37 +++ rt/html/Elements/SelectMatch | 53 ++++ rt/html/Elements/SelectNewTicketQueue | 56 +++++ rt/html/Elements/SelectOwner | 59 +++++ rt/html/Elements/SelectQueue | 59 +++++ rt/html/Elements/SelectResultsPerPage | 43 ++++ rt/html/Elements/SelectSortOrder | 41 +++ rt/html/Elements/SelectStatus | 37 +++ rt/html/Elements/SelectTicketSortBy | 38 +++ rt/html/Elements/SelectTicketTypes | 34 +++ rt/html/Elements/SelectUsers | 31 +++ rt/html/Elements/SelectWatcherType | 44 ++++ rt/html/Elements/SetupSessionCookie | 77 ++++++ rt/html/Elements/ShadedBox | 33 +++ rt/html/Elements/ShadedInputRow | 35 +++ rt/html/Elements/ShadedRow | 31 +++ rt/html/Elements/SimpleSearch | 27 ++ rt/html/Elements/Submit | 62 +++++ rt/html/Elements/Tabs | 82 ++++++ rt/html/Elements/TitleBoxEnd | 31 +++ rt/html/Elements/TitleBoxStart | 60 +++++ rt/html/Elements/ViewUser | 51 ++++ rt/html/NoAuth/Logout.html | 46 ++++ rt/html/NoAuth/Reminder.html | 26 ++ rt/html/NoAuth/images/back_home.gif | Bin 0 -> 330 bytes rt/html/NoAuth/images/bplogo.gif | Bin 0 -> 825 bytes rt/html/NoAuth/images/favicon.png | Bin 0 -> 335 bytes rt/html/NoAuth/images/head_requestracker.gif | Bin 0 -> 1233 bytes rt/html/NoAuth/images/rt.jpg | Bin 0 -> 917 bytes rt/html/NoAuth/images/space.gif | Bin 0 -> 43 bytes rt/html/NoAuth/images/spacer.gif | Bin 0 -> 43 bytes rt/html/NoAuth/images/squares_blue.gif | Bin 0 -> 219 bytes rt/html/NoAuth/webrt.css | 338 +++++++++++++++++++++++++ rt/html/REST/1.0/NoAuth/mail-gateway | 49 ++++ rt/html/Search/Bulk.html | 217 ++++++++++++++++ rt/html/Search/Elements/PickRestriction | 141 +++++++++++ rt/html/Search/Elements/TicketHeader | 40 +++ rt/html/Search/Elements/TicketHeaderCell | 55 ++++ rt/html/Search/Elements/TicketRow | 55 ++++ rt/html/Search/Listing.html | 112 +++++++++ rt/html/SelfService/Attachment/dhandler | 27 ++ rt/html/SelfService/Closed.html | 27 ++ rt/html/SelfService/Create.html | 80 ++++++ rt/html/SelfService/Display.html | 141 +++++++++++ rt/html/SelfService/Elements/GotoTicket | 24 ++ rt/html/SelfService/Elements/Header | 25 ++ rt/html/SelfService/Elements/MyRequests | 62 +++++ rt/html/SelfService/Elements/Tabs | 64 +++++ rt/html/SelfService/Error.html | 46 ++++ rt/html/SelfService/Prefs.html | 68 +++++ rt/html/SelfService/Update.html | 61 +++++ rt/html/SelfService/index.html | 26 ++ rt/html/Ticket/Attachment/dhandler | 68 +++++ rt/html/Ticket/Create.html | 257 +++++++++++++++++++ rt/html/Ticket/Display.html | 116 +++++++++ rt/html/Ticket/Elements/AddWatchers | 97 +++++++ rt/html/Ticket/Elements/BulkLinks | 53 ++++ rt/html/Ticket/Elements/EditBasics | 79 ++++++ rt/html/Ticket/Elements/EditCustomField | 70 ++++++ rt/html/Ticket/Elements/EditCustomFields | 74 ++++++ rt/html/Ticket/Elements/EditDates | 53 ++++ rt/html/Ticket/Elements/EditLinks | 150 +++++++++++ rt/html/Ticket/Elements/EditPeople | 68 +++++ rt/html/Ticket/Elements/EditWatchers | 52 ++++ rt/html/Ticket/Elements/ShowAttachments | 76 ++++++ rt/html/Ticket/Elements/ShowBasics | 54 ++++ rt/html/Ticket/Elements/ShowCustomFields | 46 ++++ rt/html/Ticket/Elements/ShowDates | 56 +++++ rt/html/Ticket/Elements/ShowDependencies | 41 +++ rt/html/Ticket/Elements/ShowHistory | 86 +++++++ rt/html/Ticket/Elements/ShowLink | 40 +++ rt/html/Ticket/Elements/ShowLinks | 87 +++++++ rt/html/Ticket/Elements/ShowMemberOf | 35 +++ rt/html/Ticket/Elements/ShowMembers | 45 ++++ rt/html/Ticket/Elements/ShowMessageHeaders | 32 +++ rt/html/Ticket/Elements/ShowMessageStanza | 51 ++++ rt/html/Ticket/Elements/ShowPeople | 45 ++++ rt/html/Ticket/Elements/ShowReferences | 50 ++++ rt/html/Ticket/Elements/ShowRequestor | 59 +++++ rt/html/Ticket/Elements/ShowSummary | 82 ++++++ rt/html/Ticket/Elements/ShowTransaction | 169 +++++++++++++ rt/html/Ticket/Elements/Tabs | 170 +++++++++++++ rt/html/Ticket/History.html | 52 ++++ rt/html/Ticket/Modify.html | 63 +++++ rt/html/Ticket/ModifyAll.html | 158 ++++++++++++ rt/html/Ticket/ModifyDates.html | 52 ++++ rt/html/Ticket/ModifyLinks.html | 54 ++++ rt/html/Ticket/ModifyPeople.html | 67 +++++ rt/html/Ticket/Update.html | 205 +++++++++++++++ rt/html/User/Delegation.html | 83 ++++++ rt/html/User/Elements/DelegateRights | 85 +++++++ rt/html/User/Elements/GroupTabs | 60 +++++ rt/html/User/Elements/Tabs | 56 +++++ rt/html/User/Groups/Members.html | 136 ++++++++++ rt/html/User/Groups/Modify.html | 133 ++++++++++ rt/html/User/Groups/index.html | 43 ++++ rt/html/User/Prefs.html | 218 ++++++++++++++++ rt/html/autohandler | 178 +++++++++++++ rt/html/index.html | 84 +++++++ rt/html/l | 26 ++ 198 files changed, 13650 insertions(+) create mode 100644 rt/html/Admin/Elements/AddCustomFieldValue create mode 100644 rt/html/Admin/Elements/CreateUserCalled create mode 100644 rt/html/Admin/Elements/EditCustomField create mode 100644 rt/html/Admin/Elements/EditCustomFieldValues create mode 100644 rt/html/Admin/Elements/EditCustomFields create mode 100644 rt/html/Admin/Elements/EditQueueWatchers create mode 100644 rt/html/Admin/Elements/EditScrip create mode 100644 rt/html/Admin/Elements/EditScrips create mode 100644 rt/html/Admin/Elements/EditTemplates create mode 100644 rt/html/Admin/Elements/EditUserComments create mode 100644 rt/html/Admin/Elements/GroupTabs create mode 100644 rt/html/Admin/Elements/Header create mode 100644 rt/html/Admin/Elements/ListGlobalCustomFields create mode 100644 rt/html/Admin/Elements/ListGlobalScrips create mode 100644 rt/html/Admin/Elements/ModifyQueue create mode 100644 rt/html/Admin/Elements/ModifyTemplate create mode 100644 rt/html/Admin/Elements/ModifyUser create mode 100644 rt/html/Admin/Elements/QueueRightsForUser create mode 100644 rt/html/Admin/Elements/QueueTabs create mode 100644 rt/html/Admin/Elements/SelectCustomFieldType create mode 100644 rt/html/Admin/Elements/SelectGroups create mode 100644 rt/html/Admin/Elements/SelectModifyGroup create mode 100644 rt/html/Admin/Elements/SelectModifyQueue create mode 100644 rt/html/Admin/Elements/SelectModifyUser create mode 100644 rt/html/Admin/Elements/SelectNewGroupMembers create mode 100644 rt/html/Admin/Elements/SelectRights create mode 100644 rt/html/Admin/Elements/SelectScrip create mode 100644 rt/html/Admin/Elements/SelectScripAction create mode 100644 rt/html/Admin/Elements/SelectScripCondition create mode 100644 rt/html/Admin/Elements/SelectSingleOrMultiple create mode 100644 rt/html/Admin/Elements/SelectTemplate create mode 100644 rt/html/Admin/Elements/SelectUsers create mode 100644 rt/html/Admin/Elements/SystemTabs create mode 100644 rt/html/Admin/Elements/Tabs create mode 100644 rt/html/Admin/Elements/UserTabs create mode 100644 rt/html/Admin/Global/CustomField.html create mode 100644 rt/html/Admin/Global/CustomFields.html create mode 100644 rt/html/Admin/Global/GroupRights.html create mode 100644 rt/html/Admin/Global/Scrip.html create mode 100644 rt/html/Admin/Global/Scrips.html create mode 100644 rt/html/Admin/Global/Template.html create mode 100644 rt/html/Admin/Global/Templates.html create mode 100644 rt/html/Admin/Global/UserRights.html create mode 100644 rt/html/Admin/Global/index.html create mode 100644 rt/html/Admin/Groups/GroupRights.html create mode 100644 rt/html/Admin/Groups/Members.html create mode 100644 rt/html/Admin/Groups/Modify.html create mode 100644 rt/html/Admin/Groups/UserRights.html create mode 100644 rt/html/Admin/Groups/index.html create mode 100644 rt/html/Admin/Queues/CustomField.html create mode 100644 rt/html/Admin/Queues/CustomFields.html create mode 100644 rt/html/Admin/Queues/GroupRights.html create mode 100644 rt/html/Admin/Queues/Modify.html create mode 100644 rt/html/Admin/Queues/People.html create mode 100644 rt/html/Admin/Queues/Scrip.html create mode 100644 rt/html/Admin/Queues/Scrips.html create mode 100644 rt/html/Admin/Queues/Template.html create mode 100644 rt/html/Admin/Queues/Templates.html create mode 100644 rt/html/Admin/Queues/UserRights.html create mode 100644 rt/html/Admin/Queues/index.html create mode 100644 rt/html/Admin/Users/Modify.html create mode 100644 rt/html/Admin/Users/Prefs.html create mode 100644 rt/html/Admin/Users/index.html create mode 100644 rt/html/Admin/index.html create mode 100644 rt/html/Approvals/Display.html create mode 100644 rt/html/Approvals/Elements/Approve create mode 100644 rt/html/Approvals/Elements/PendingMyApproval create mode 100644 rt/html/Approvals/Elements/ShowDependency create mode 100644 rt/html/Approvals/Elements/Tabs create mode 100644 rt/html/Approvals/index.html create mode 100644 rt/html/Elements/BevelBoxRaisedEnd create mode 100644 rt/html/Elements/BevelBoxRaisedStart create mode 100644 rt/html/Elements/Callback create mode 100644 rt/html/Elements/Checkbox create mode 100644 rt/html/Elements/CreateTicket create mode 100644 rt/html/Elements/Error create mode 100644 rt/html/Elements/Footer create mode 100644 rt/html/Elements/GotoTicket create mode 100644 rt/html/Elements/Header create mode 100644 rt/html/Elements/ListActions create mode 100644 rt/html/Elements/Login create mode 100644 rt/html/Elements/Menu create mode 100644 rt/html/Elements/MessageBox create mode 100644 rt/html/Elements/MyRequests create mode 100644 rt/html/Elements/MyTickets create mode 100644 rt/html/Elements/PageLayout create mode 100644 rt/html/Elements/Quicksearch create mode 100644 rt/html/Elements/Refresh create mode 100644 rt/html/Elements/Section create mode 100644 rt/html/Elements/SelectAttachmentField create mode 100644 rt/html/Elements/SelectBoolean create mode 100644 rt/html/Elements/SelectCustomFieldOperator create mode 100644 rt/html/Elements/SelectCustomFieldValue create mode 100644 rt/html/Elements/SelectDate create mode 100644 rt/html/Elements/SelectDateRelation create mode 100644 rt/html/Elements/SelectDateType create mode 100644 rt/html/Elements/SelectEqualityOperator create mode 100644 rt/html/Elements/SelectGroups create mode 100644 rt/html/Elements/SelectLinkType create mode 100644 rt/html/Elements/SelectMatch create mode 100644 rt/html/Elements/SelectNewTicketQueue create mode 100644 rt/html/Elements/SelectOwner create mode 100644 rt/html/Elements/SelectQueue create mode 100644 rt/html/Elements/SelectResultsPerPage create mode 100644 rt/html/Elements/SelectSortOrder create mode 100644 rt/html/Elements/SelectStatus create mode 100644 rt/html/Elements/SelectTicketSortBy create mode 100644 rt/html/Elements/SelectTicketTypes create mode 100644 rt/html/Elements/SelectUsers create mode 100644 rt/html/Elements/SelectWatcherType create mode 100644 rt/html/Elements/SetupSessionCookie create mode 100644 rt/html/Elements/ShadedBox create mode 100644 rt/html/Elements/ShadedInputRow create mode 100644 rt/html/Elements/ShadedRow create mode 100644 rt/html/Elements/SimpleSearch create mode 100644 rt/html/Elements/Submit create mode 100644 rt/html/Elements/Tabs create mode 100644 rt/html/Elements/TitleBoxEnd create mode 100644 rt/html/Elements/TitleBoxStart create mode 100644 rt/html/Elements/ViewUser create mode 100644 rt/html/NoAuth/Logout.html create mode 100644 rt/html/NoAuth/Reminder.html create mode 100644 rt/html/NoAuth/images/back_home.gif create mode 100644 rt/html/NoAuth/images/bplogo.gif create mode 100644 rt/html/NoAuth/images/favicon.png create mode 100644 rt/html/NoAuth/images/head_requestracker.gif create mode 100644 rt/html/NoAuth/images/rt.jpg create mode 100644 rt/html/NoAuth/images/space.gif create mode 100644 rt/html/NoAuth/images/spacer.gif create mode 100644 rt/html/NoAuth/images/squares_blue.gif create mode 100644 rt/html/NoAuth/webrt.css create mode 100644 rt/html/REST/1.0/NoAuth/mail-gateway create mode 100644 rt/html/Search/Bulk.html create mode 100644 rt/html/Search/Elements/PickRestriction create mode 100644 rt/html/Search/Elements/TicketHeader create mode 100644 rt/html/Search/Elements/TicketHeaderCell create mode 100644 rt/html/Search/Elements/TicketRow create mode 100644 rt/html/Search/Listing.html create mode 100644 rt/html/SelfService/Attachment/dhandler create mode 100644 rt/html/SelfService/Closed.html create mode 100644 rt/html/SelfService/Create.html create mode 100644 rt/html/SelfService/Display.html create mode 100644 rt/html/SelfService/Elements/GotoTicket create mode 100644 rt/html/SelfService/Elements/Header create mode 100644 rt/html/SelfService/Elements/MyRequests create mode 100644 rt/html/SelfService/Elements/Tabs create mode 100644 rt/html/SelfService/Error.html create mode 100644 rt/html/SelfService/Prefs.html create mode 100644 rt/html/SelfService/Update.html create mode 100644 rt/html/SelfService/index.html create mode 100644 rt/html/Ticket/Attachment/dhandler create mode 100644 rt/html/Ticket/Create.html create mode 100644 rt/html/Ticket/Display.html create mode 100644 rt/html/Ticket/Elements/AddWatchers create mode 100644 rt/html/Ticket/Elements/BulkLinks create mode 100644 rt/html/Ticket/Elements/EditBasics create mode 100644 rt/html/Ticket/Elements/EditCustomField create mode 100644 rt/html/Ticket/Elements/EditCustomFields create mode 100644 rt/html/Ticket/Elements/EditDates create mode 100644 rt/html/Ticket/Elements/EditLinks create mode 100644 rt/html/Ticket/Elements/EditPeople create mode 100644 rt/html/Ticket/Elements/EditWatchers create mode 100644 rt/html/Ticket/Elements/ShowAttachments create mode 100644 rt/html/Ticket/Elements/ShowBasics create mode 100644 rt/html/Ticket/Elements/ShowCustomFields create mode 100644 rt/html/Ticket/Elements/ShowDates create mode 100644 rt/html/Ticket/Elements/ShowDependencies create mode 100644 rt/html/Ticket/Elements/ShowHistory create mode 100644 rt/html/Ticket/Elements/ShowLink create mode 100644 rt/html/Ticket/Elements/ShowLinks create mode 100644 rt/html/Ticket/Elements/ShowMemberOf create mode 100644 rt/html/Ticket/Elements/ShowMembers create mode 100644 rt/html/Ticket/Elements/ShowMessageHeaders create mode 100644 rt/html/Ticket/Elements/ShowMessageStanza create mode 100644 rt/html/Ticket/Elements/ShowPeople create mode 100644 rt/html/Ticket/Elements/ShowReferences create mode 100644 rt/html/Ticket/Elements/ShowRequestor create mode 100644 rt/html/Ticket/Elements/ShowSummary create mode 100644 rt/html/Ticket/Elements/ShowTransaction create mode 100644 rt/html/Ticket/Elements/Tabs create mode 100644 rt/html/Ticket/History.html create mode 100644 rt/html/Ticket/Modify.html create mode 100644 rt/html/Ticket/ModifyAll.html create mode 100644 rt/html/Ticket/ModifyDates.html create mode 100644 rt/html/Ticket/ModifyLinks.html create mode 100644 rt/html/Ticket/ModifyPeople.html create mode 100644 rt/html/Ticket/Update.html create mode 100644 rt/html/User/Delegation.html create mode 100644 rt/html/User/Elements/DelegateRights create mode 100644 rt/html/User/Elements/GroupTabs create mode 100644 rt/html/User/Elements/Tabs create mode 100644 rt/html/User/Groups/Members.html create mode 100644 rt/html/User/Groups/Modify.html create mode 100644 rt/html/User/Groups/index.html create mode 100644 rt/html/User/Prefs.html create mode 100644 rt/html/autohandler create mode 100644 rt/html/index.html create mode 100644 rt/html/l (limited to 'rt/html') diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue new file mode 100644 index 000000000..8850734f2 --- /dev/null +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -0,0 +1,44 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<&|/l&>Add Value + + + + +
+<&|/l&>Sort:
+ +
+<&|/l&>Name:
+ +
+<&|/l&>Description:
+ +
+ +<%init> + +<%args> +$CustomField => undef + diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled new file mode 100644 index 000000000..8ceccca73 --- /dev/null +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
+<&|/l&>New user called +
diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField new file mode 100644 index 000000000..a09600ba7 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomField @@ -0,0 +1,127 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@results &> + + +
+ + + + + + + + +
+<&|/l&>Name: + + +
+<&|/l&>Description: + + +
+<&|/l&>Type: + +<& /Admin/Elements/SelectCustomFieldType, Name => "Type", Default => $CustomFieldObj->Type &> +
+ + +> <&|/l&>Enabled (Unchecking this box disables this custom field) +
+ +

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

<&|/l&>Values

+ +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> + +% } +<&/Elements/Submit&> +
+ + + +<%INIT> + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +my $EnabledChecked = "CHECKED"; +my (@results); + +if (! $CustomField ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} else { + + if ($CustomField eq 'new') { + my ($val, $msg) = $CustomFieldObj->Create(Queue => $Queue, + Name => $Name, + Type => $Type, + Description => $Description, + ); + Abort(loc("Could not create CustomField", $msg)) unless ($val); + push @results, $msg; + $CustomFieldObj->SetSortOrder($CustomFieldObj->id); + $title = loc('Created CustomField [_1]', $CustomFieldObj->Name()); + } else { + $CustomFieldObj->Load($CustomField) || Abort(loc('No CustomField')); + $title = loc('Editing CustomField [_1]', $CustomFieldObj->Name()); + + my @aresults = ProcessCustomFieldUpdates ( + CustomFieldObj => $CustomFieldObj, + ARGSRef => \%ARGS ); + push @results, @aresults; + } + + +$id = $CustomFieldObj->id; + + #we're asking about enabled on the web page but really care about disabled. + my $Disabled = ($Enabled ? 0 : 1); + + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + +} + + + +<%ARGS> +$id => undef +$title => undef +$Queue => undef +$CustomField => undef +$Type => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues new file mode 100644 index 000000000..64564adfb --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -0,0 +1,42 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<&|/l&>(Check box to delete) +
    +% while (my $v = $values->Next) { +
  • +<%$v->SortOrder%>: + +<%$v->Name%> +% if ($v->Description) { +(<%$v->Description%>) +% } +
  • +% } +
+<%init> +my $values = $CustomField->Values(); + +<%args> +$CustomField => undef + diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields new file mode 100644 index 000000000..a86b051d0 --- /dev/null +++ b/rt/html/Admin/Elements/EditCustomFields @@ -0,0 +1,214 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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++) { + +% } + + + +
+
    +% while (my $CustomFieldObj = $CustomFields->Next) { +
  • <%$CustomFieldObj->Name%> (<% $CustomFieldObj->FriendlyType %>)
    +<%$CustomFieldObj->Description%> +
  • +% } +
+
+<&|/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. + +
+ + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +my $caption; + +if ($id) { + $QueueObj->Load($id); +} + +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"); +} + +# {{{ 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 $TargetObj; + my $target_order = $SourceObj->SortOrder + $Move; + while (my $CustomFieldObj = $CustomFields->Next) { + my $this_order = $CustomFieldObj->SortOrder; + + # if we have an exact match, finish the loop now + ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order; + + # otherwise, we need to apropos toward the general direction + # ... first, check the sign is correct + next unless ($this_order - $SourceObj->SortOrder) * $Move > 0; + + # ... next, see if we already have a candidate + if ($TargetObj) { + # ... if yes, compare the delta and choose the smaller one + my $orig_delta = abs($TargetObj->SortOrder - $target_order); + my $this_delta = abs($this_order - $target_order); + next if $orig_delta < $this_delta; + } + + $TargetObj = $CustomFieldObj; + } + + if ($TargetObj) { + # swap their sort order + my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder); + $TargetObj->SetSortOrder($s); + $SourceObj->SetSortOrder($t); + # because order changed, we must redo search for subsequent uses + $CustomFields->RedoSearch; + } + + $CustomFields->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; + } + + # 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 + ); + } + } + + # because content changed, we must redo search for subsequent uses + $CustomFields->RedoSearch; + $CustomFields->GotoFirstItem; +} +# }}} + +# {{{ 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"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + + +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$CustomField => undef +$FindDisabledCustomFields => undef + diff --git a/rt/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers new file mode 100644 index 000000000..db39bfb67 --- /dev/null +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%if ($Members->Count == 0 ) { +
    +
  • <&|/l&>none +% } else { +<&|/l&>(Check box to delete)

    + + +<%INIT> +my $Members = $Watchers->MembersObj; + + +<%ARGS> +$QueueObj => undef +$Watchers => undef + + + + diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip new file mode 100644 index 000000000..5393ebfde --- /dev/null +++ b/rt/html/Admin/Elements/EditScrip @@ -0,0 +1,149 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +<%init> +my (@actions); + + +my $scrip = new RT::Scrip($session{'CurrentUser'}); + +if ( $id eq 'new' ) { + + my ( $retval, $msg ) = $scrip->Create( + Queue => $Queue, + ScripAction => $ARGS{"Scrip-new-ScripAction"}, + ScripCondition => $ARGS{"Scrip-new-ScripCondition"}, + Template => $ARGS{"Scrip-new-Template"}, + Description => $ARGS{"Scrip-new-Description"}, + CustomPrepareCode => $ARGS{"Scrip-new-CustomPrepareCode"}, + CustomCommitCode => $ARGS{"Scrip-new-CustomCommitCode"}, + CustomIsApplicableCode => $ARGS{"Scrip-new-CustomIsApplicableCode"}, + ); + if ( defined $retval ) { + push @actions, $msg; + } + else { + Abort( $msg); + } +} +elsif ($id) { + my ($val,$msg) =$scrip->Load($id); + if ($val) { + $id = $scrip->id; + } else { + Abort ($msg); + } + my @attribs = qw ( + Queue + ScripAction + ScripCondition + Template + Description + CustomPrepareCode + CustomCommitCode + CustomIsApplicableCode + ); + my @results = UpdateRecordObject( AttributesRef => \@attribs, + AttributePrefix => 'Scrip-'.$scrip->Id, + Object => $scrip, + ARGSRef => \%ARGS ); + push (@actions, @results); +} + +elsif ($ARGS{'create'}) { + $id = 'new'; +} + +# }}} + + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 + diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips new file mode 100644 index 000000000..24515d8c1 --- /dev/null +++ b/rt/html/Admin/Elements/EditScrips @@ -0,0 +1,97 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + +
    + + +

    <&|/l&>Current Scrips:

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

    <&|/l&>(No scrips)

    +% } else { +
    +<&|/l&>Description: + + +
    +<&|/l&>Condition: + +<& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $scrip->ConditionObj->Id &>
    +
    +<&|/l&>Custom condition: + + +
    +<&|/l&>Action: + +<& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $scrip->ActionObj->Id &> +
    +<&|/l&>Custom action preparation code: + + +
    +<&|/l&>Custom action cleanup code: + + +
    +<&|/l&>Template: + +<& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $scrip->TemplateObj->Id, Queue => $Queue &> +
    +

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

    + +% while (my $scrip = $Scrips->Next ) { + + + + +% } + +
    + + +<% $scrip->Description || "(".loc('no value').")" |n %>
    +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3] +
    + +% } +<& /Elements/Submit &> + +<%init> +my (@actions); + +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); + + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $Scrips->LimitToQueue($id); +} +else { + $Scrips->LimitToGlobal(); +} + + + + +# {{{ deal with modifying and deleting existing scrips +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the scrip + if ($key =~ /^DeleteScrip-(\d+)/) { + my $id = $1; + my $scrip = new RT::Scrip($session{'CurrentUser'}); + $scrip->Load($id); + my ($retval, $msg) = $scrip->Delete; + if ($retval) { + push @actions, loc("Scrip deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + + +<%ARGS> +$id => undef +$title => undef + diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates new file mode 100644 index 000000000..12677ca78 --- /dev/null +++ b/rt/html/Admin/Elements/EditTemplates @@ -0,0 +1,104 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/ListActions, actions => \@actions &> + +
    + + +% if ($Templates->Count == 0 ) { +

    <&|/l&>(No templates)

    +% } else { + + + + + +% my $count; +% while (my $TemplateObj = $Templates->Next) { + + + + + +% } +
    +<&|/l&>(Check box to delete) + +
    + + + +<% loc($TemplateObj->Name) %> +
    <% loc($TemplateObj->Description) %> +
    +% } + +<& /Elements/Submit &> +
    + +<%INIT> +my $Templates = RT::Templates->new($session{'CurrentUser'}); +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +my @actions; + +if ($id) { + $QueueObj->Load($id); +} + +if ($QueueObj->id) { + $Templates->LimitToQueue($id); +} +else { + $Templates->LimitToGlobal(); +} + +# Now let callbacks add their extra limits +$m->comp('/Elements/Callback', Templates => $Templates, %ARGS); + +# {{{ deal with deleting existing templates +foreach my $key (keys %ARGS) { + # {{{ if we're trying to delete the template + if ($key =~ /^DeleteTemplate-(\d+)/) { + my $id = $1; + my $TemplateObj = RT::Template->new($session{'CurrentUser'}); + $TemplateObj->Load($id); + my ($retval, $msg) = $TemplateObj->Delete; + if ($retval) { + push @actions, loc("Template deleted"); + } + else { + push @actions, $msg; + } + } + # }}} +} +# }}} + +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$Template => undef + diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments new file mode 100644 index 000000000..f791876be --- /dev/null +++ b/rt/html/Admin/Elements/EditUserComments @@ -0,0 +1,32 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => "Comments about $name" &> +<&|/l&>These comments aren't generally visible to the user:
    + + + + +<%ARGS> +$UserObj => undef + diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs new file mode 100644 index 000000000..87377820c --- /dev/null +++ b/rt/html/Admin/Elements/GroupTabs @@ -0,0 +1,76 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Groups/', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ( $GroupObj and $GroupObj->id ) { +$tabs->{"this"} = { class => "currentnav", + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id, + title => $GroupObj->Name, + current_subtab => $current_subtab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Groups/Modify.html?id=" . $GroupObj->id }, + + D => { title => loc('Members'), + path => "Admin/Groups/Members.html?id=" . $GroupObj->id }, + + F => { title => loc('Group Rights'), + path => "Admin/Groups/GroupRights.html?id=" . $GroupObj->id, }, + G => { title => loc('User Rights'), + path => "Admin/Groups/UserRights.html?id=" . $GroupObj->id, }, + } +} +} +$tabs->{"A"} = { title => loc('Select group'), + path => "Admin/Groups/", }; +$tabs->{"B"} = { title => loc('New group'), + path => "Admin/Groups/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; + } +} + $tabs->{'this'}->{"current_subtab"} = $current_tab; + $current_tab = "Admin/Groups/Modify.html?id=".$GroupObj->id if $GroupObj; + + +<%ARGS> +$GroupObj => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + + diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header new file mode 100644 index 000000000..92a7c54ca --- /dev/null +++ b/rt/html/Admin/Elements/Header @@ -0,0 +1,28 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $Title &> + +<%ARGS> +$Title => undef + diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields new file mode 100644 index 000000000..032f680ee --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% my $count = 0; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $count++; +<%$CustomFieldObj->id%>/<% loc($CustomFieldObj->Type) %>/<%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%> +
    +% } +% if (!$count) { +<&|/l&>(No custom fields) +% } + +<%init> +my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +$CustomFields->LimitToGlobal(); + diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips new file mode 100644 index 000000000..8dba3b6c4 --- /dev/null +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% my $count = 0; +% while (my $scrip = $Scrips->Next ) { +% $count++; +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3] +
    +% } +% if (!$count) { +<&|/l&>(No scrips) +% } + +<%init> +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +$Scrips->LimitToGlobal(); + diff --git a/rt/html/Admin/Elements/ModifyQueue b/rt/html/Admin/Elements/ModifyQueue new file mode 100644 index 000000000..e5761df35 --- /dev/null +++ b/rt/html/Admin/Elements/ModifyQueue @@ -0,0 +1,78 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc('Editing Configuration for queue [_1]', $QueueObj->Id) &> + +
    + + + + + + + + + + + + + + + + + +
    +<&|/l&>Queue Name: +
    +<&|/l&>Description:
    +<&|/l&>Correspondence Address: + + + + +<&|/l&>Comment Address: + +
    +<&|/l&>Priority starts at: + + +<&|/l&>Over time, priority moves toward: + +
    +<&|/l&>Requests should be due in: + + <&|/l&>days. +
    +<& /Elements/Submit &> +
    +<& /Elements/TitleBoxEnd &> + +<%INIT> + + + +<%ARGS> + + +$QueueObj => undef + diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate new file mode 100644 index 000000000..5f75bac5f --- /dev/null +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + +
    +<&|/l&>Name: + +
    +
    +<&|/l&>Description: + +
    +
    +<&|/l&>Content:
    +
    + +
    + +<%INIT> + + + +<%ARGS> +$Name => undef +$Description => undef +$Content => undef + diff --git a/rt/html/Admin/Elements/ModifyUser b/rt/html/Admin/Elements/ModifyUser new file mode 100644 index 000000000..876e8a71b --- /dev/null +++ b/rt/html/Admin/Elements/ModifyUser @@ -0,0 +1,99 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc('Editing Configuration for user [_1]', $UserObj->Name) &> + +
    + + +<&|/l&>Name: +
    +<&|/l&>New Password:
    +<&|/l&>Retype Password:
    + +<&|/l&>Comments: + +
    +<&|/l&>Signature: +
    +<&|/l&>EmailAddress: +
    +<&|/l&>FreeformContactInfo: +
    +<&|/l&>Organization: +
    +<&|/l&>RealName: +
    +<&|/l&>NickName: +
    +<&|/l&>Lang: +
    +<&|/l&>EmailEncoding: +
    +<&|/l&>WebEncoding: +
    +<&|/l&>ExternalContactInfoId: +
    +<&|/l&>ContactInfoSystem: +
    +<&|/l&>UnixUsername: +
    +<&|/l&>ExternalAuthId: +
    +<&|/l&>AuthSystem: +
    +<&|/l&>HomePhone: +
    +<&|/l&>WorkPhone: +
    +<&|/l&>MobilePhone: +
    +<&|/l&>PagerPhone: +
    +<&|/l&>Address1: +
    +<&|/l&>Address2: +
    +<&|/l&>City: +
    +<&|/l&>State: +
    +<&|/l&>Zip: +
    +<&|/l&>Country: +
    +<& /Elements/Submit &> +
    +<& /Elements/TitleBoxEnd &> + +<%INIT> + + + +<%ARGS> + + +$UserObj => undef + diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser new file mode 100644 index 000000000..05bb51196 --- /dev/null +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
      +%while(my $ACE = $ACL->Next) { + +
    • <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) + +%} +
    + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); + +<%ARGS> +$PrincipalId => undef +$QueueObj => undef + diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs new file mode 100644 index 000000000..3b4805afc --- /dev/null +++ b/rt/html/Admin/Elements/QueueTabs @@ -0,0 +1,93 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Queues/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> +my $tabs; +if ($id) { + $tabs->{'this'} = { + title => $QueueObj->Name, + path => "Admin/Queues/Modify.html?id=".$id, + current_subtab => $current_tab, + subtabs => { + C => { title => loc('Basics'), + path => "Admin/Queues/Modify.html?id=".$id, + }, + D => { title => loc('Watchers'), + path => "Admin/Queues/People.html?id=".$id, + }, + + E => { title => loc('Scrips'), + path => "Admin/Queues/Scrips.html?id=".$id, + }, + F => { title => loc('Templates'), + path => "Admin/Queues/Templates.html?id=".$id, + }, + + G => { title => loc('Custom Fields'), + path => 'Admin/Queues/CustomFields.html?id='.$id, + }, + + H => { title => loc('Group Rights'), + path => "Admin/Queues/GroupRights.html?id=".$id, + }, + I => { title => loc('User Rights'), + path => "Admin/Queues/UserRights.html?id=".$id, + } + } + }; +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQueue')) { + $tabs->{"A"} = { title => loc('Select queue'), + path => "Admin/Queues/", + }; + $tabs->{"B"} = { title => loc('New queue'), + path => "Admin/Queues/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; + } +} + $current_tab = "Admin/Queues/Modify.html?id=".$id if $id; + + +<%ARGS> +$QueueObj => undef +$id => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType new file mode 100644 index 000000000..b5f4c079a --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + + +<%ARGS> +$Default=>undef +$Name => 'Type' + diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups new file mode 100644 index 000000000..5df49ad04 --- /dev/null +++ b/rt/html/Admin/Elements/SelectGroups @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'System'); + + +<%ARGS> +$Name => 'groups' + diff --git a/rt/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup new file mode 100644 index 000000000..47978d3bf --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyGroup @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%while ( $Group = $Groups->Next) { +<%$Group->id%>: <%$Group->Name%>
    +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; + +<%ARGS> + diff --git a/rt/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue new file mode 100644 index 000000000..c5152ac95 --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyQueue @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%while ( $queue = $queues->Next) { +<%$queue->id%>: <%$queue->Name%>
    +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; + +<%ARGS> + diff --git a/rt/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser new file mode 100644 index 000000000..9e7789b4c --- /dev/null +++ b/rt/html/Admin/Elements/SelectModifyUser @@ -0,0 +1,49 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%while ( $user = $users->Next) { +<%$user->id%>: <%$user->Name%>
    +%} +<%INIT> +my ($user); +my $users = new RT::Users($session{'CurrentUser'}); +$users->Limit(FIELD => 'id', + VALUE => $RT::SystemUser->id, + OPERATOR => '!=' ); + +if (defined $IdLike) { +$users->Limit(FIELD => 'Name', + VALUE => $IdLike, + OPERATOR => 'LIKE' ); +} +if (defined $EmailLike) { +$users->Limit(FIELD => 'EmailAddress', + VALUE => $EmailLike, + OPERATOR => 'LIKE'); + +} + +<%ARGS> +$IdLike => undef +$EmailLike => undef + diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers new file mode 100644 index 000000000..e5c28e909 --- /dev/null +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if ($Show ne 'Groups') { +<&|/l&>Users + +
    +% } +% if ($Show ne 'Users') { +<&|/l&>Groups + +% } + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + +my $groups = new RT::Groups($session{'CurrentUser'}); + +# self-recursive group membership considered harmful! +$groups->Limit(FIELD => 'id', VALUE => $Group->id, OPERATOR => '!=' ); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + + + +<%ARGS> +$Name => 'Users' +$Show => 'All' +$Group + diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights new file mode 100644 index 000000000..37a06dc4d --- /dev/null +++ b/rt/html/Admin/Elements/SelectRights @@ -0,0 +1,90 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + +
    +

    <&|/l&>Current rights

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

    <&|/l&>New rights

    + +
    +<%INIT> + my ($right, $ACLDesc, $AppliesTo, %Rights); + + # if the principal id points to a user, we really want to point + # to their ACL equivalence group. The machinations we're going through + # lead me to start to suspect that we really want users and groups + # to just be the same table. or _maybe_ that we want an object db. + my $princ = RT::Principal->new($RT::SystemUser); + $princ->Load($PrincipalId); + if ($princ->PrincipalType eq 'User') { + my $group = RT::Group->new($RT::SystemUser); + $group->LoadACLEquivalenceGroup($princ); + $PrincipalId = $group->PrincipalId; + } + + + my $ACLObj = new RT::ACL($session{'CurrentUser'}); + my $ACE = new RT::ACE($session{'CurrentUser'}); + + + $ACLObj->LimitToObject( $Object); + $ACLObj->LimitToPrincipal( Id => $PrincipalId); + + if (ref($Object) && UNIVERSAL::can($Object, 'AvailableRights')) { + %Rights = %{$Object->AvailableRights}; + } + + else { + %Rights = { loc('System Error') => loc("No rights found")}; + } + + $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; + + +<%ARGS> +$PrincipalType => undef +$PrincipalId => undef +$Object =>undef + diff --git a/rt/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip new file mode 100644 index 000000000..18e4098a0 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScrip @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'Scrip' + + diff --git a/rt/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction new file mode 100644 index 000000000..0d7f8ccfa --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripAction @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + + diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition new file mode 100644 index 000000000..aeb366a44 --- /dev/null +++ b/rt/html/Admin/Elements/SelectScripCondition @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; + + + + +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + + diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple new file mode 100644 index 000000000..98e9ee78c --- /dev/null +++ b/rt/html/Admin/Elements/SelectSingleOrMultiple @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = "SELECTED"; +} +elsif ($Default == 0 ) { + $MultipleDefault = "SELECTED"; +} + + +<%ARGS> +$Name => 'Single' +$Default => 1 + diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate new file mode 100644 index 000000000..70ff4d1cc --- /dev/null +++ b/rt/html/Admin/Elements/SelectTemplate @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); + + +<%ARGS> + +$Queue => undef +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + + diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers new file mode 100644 index 000000000..d4c8a85ad --- /dev/null +++ b/rt/html/Admin/Elements/SelectUsers @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $users = new RT::Users($session{'CurrentUser'}); + +$users->Limit(FIELD => 'id', VALUE => $RT::SystemUser->id, OPERATOR => '!=' ); +$users->Limit(FIELD => 'id', VALUE => $RT::Nobody->id, OPERATOR => '!=' ); +$users->LimitToPrivileged(); + + +<%ARGS> +$Name => 'Users' + diff --git a/rt/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs new file mode 100644 index 000000000..f38febdd7 --- /dev/null +++ b/rt/html/Admin/Elements/SystemTabs @@ -0,0 +1,70 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, subtabs => $tabs, + current_tab => 'Admin/Global/', + current_subtab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { + + A => { title => loc('Scrips'), + path => 'Admin/Global/Scrips.html', + }, + B => { title => loc('Templates'), + path => 'Admin/Global/Templates.html', + }, + + F => { title => loc('Custom Fields'), + path => 'Admin/Global/CustomFields.html', + }, + + G => { title => loc('Group Rights'), + path => 'Admin/Global/GroupRights.html', + }, + H => { title => loc('User Rights'), + path => 'Admin/Global/UserRights.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/Tabs b/rt/html/Admin/Elements/Tabs new file mode 100644 index 000000000..8fa2708fb --- /dev/null +++ b/rt/html/Admin/Elements/Tabs @@ -0,0 +1,63 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Tabs, + tabs => $tabs, + current_toptab => 'Admin/', + current_tab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { A => { title => loc('Users'), + path => 'Admin/Users/', + }, + B => { title => loc('Groups'), + path => 'Admin/Groups/', + }, + C => { title => loc('Queues'), + path => 'Admin/Queues/', + }, + D => { 'title' => loc('Global'), + path => 'Admin/Global/', + }, + }; + + # 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> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs new file mode 100644 index 000000000..764fdfcb5 --- /dev/null +++ b/rt/html/Admin/Elements/UserTabs @@ -0,0 +1,74 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Tabs, + subtabs => $tabs, + current_tab => 'Admin/Users/', + current_subtab => $current_subtab, + Title => $Title &> +<%INIT> +my $tabs; +my $subtabs; +if ($id) { +$tabs->{'this'} = { title => eval { $UserObj->Name }, + + path => "Admin/Users/Modify.html?id=".$id, +subtabs => { + Queues => { title => loc('Basics'), + path => "Admin/Users/Modify.html?id=".$id + }, +# Scrips => { title => loc('Rights'), +# path => "Admin/Users/Rights.html?id=".$id +# } + + } +} +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { + $tabs->{"A"} = { title => loc('Select user'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { title => loc('New user'), + path => "Admin/Users/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab ( sort keys %{$tabs} ) { + if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } +} + + + +<%ARGS> +$UserObj => undef +$id => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Admin/Global/CustomField.html b/rt/html/Admin/Global/CustomField.html new file mode 100644 index 000000000..0974af538 --- /dev/null +++ b/rt/html/Admin/Global/CustomField.html @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/CustomFields.html', + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditCustomField, title => $title, %ARGS &> + +<%INIT> +my ($title, $current_subtab); + +my $subtabs = { + A => { title => loc('Select custom field'), + path => "Admin/Global/CustomFields.html" + }, + B => { title => loc('New custom field'), + path => "Admin/Global/CustomField.html?create=1&Queue=0", + separator => 1, + } + }; +if ( $ARGS{'create'} ) { + $current_subtab = "Admin/Global/CustomField.html?create=1&Queue=0"; + $title = loc('Create a CustomField which applies to all queues'); +} +else { + $current_subtab = + "Admin/Global/CustomField.html?CustomField=" . $CustomField . "&Queue=0"; + $title = loc('Modify a CustomField which applies to all queues'); + $subtabs->{"C"} = { + title => loc( 'Custom Field #[_1]', $CustomField ), + path => "Admin/Global/CustomField.html?CustomField=" . $CustomField . "&Queue=0" + }; +} + +<%ARGS> +$CustomField => undef + diff --git a/rt/html/Admin/Global/CustomFields.html b/rt/html/Admin/Global/CustomFields.html new file mode 100644 index 000000000..f6bbddfed --- /dev/null +++ b/rt/html/Admin/Global/CustomFields.html @@ -0,0 +1,47 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/CustomFields.html', + current_subtab => 'Admin/Global/CustomFields.html', + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditCustomFields, title => $title, %ARGS &> + +<%INIT> +my $subtabs = { + A => { title => loc('Select custom field'), + path => "Admin/Global/CustomFields.html" + }, + B => { title => loc('New custom field'), + path => "Admin/Global/CustomField.html?create=1&Queue=0", + separator => 1, + } + }; +my $title = loc("Modify Custom Fields which apply to all queues"); + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Global/GroupRights.html b/rt/html/Admin/Global/GroupRights.html new file mode 100644 index 000000000..150e83f43 --- /dev/null +++ b/rt/html/Admin/Global/GroupRights.html @@ -0,0 +1,99 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify global group rights') &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/GroupRights.html', + Title => loc('Modify global group rights') &> +<& /Elements/ListActions, actions => \@results &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Modify global group rights.')&> + +

    <&|/l&>System groups

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

    <&|/l&>Roles

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $RT::System &> +
    + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +my $Groups; + + + +<%ARGS> + diff --git a/rt/html/Admin/Global/Scrip.html b/rt/html/Admin/Global/Scrip.html new file mode 100644 index 000000000..8b9cf6db6 --- /dev/null +++ b/rt/html/Admin/Global/Scrip.html @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Scrips.html', + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditScrip, title => $title, %ARGS &> + +<%init> +my ($title, $current_subtab); +my $subtabs = { + A => { title => loc('Select scrip'), + path => "Admin/Global/Scrips.html", + }, + B => { title => loc('New scrip'), + path => "Admin/Global/Scrip.html?create=1&Queue=0", + separator => 1, + } + }; + +if ($ARGS{'id'}) { + $current_subtab = "Admin/Global/Scrip.html?id=".$ARGS{'id'}."&Queue=0"; + $title = loc("Modify a scrip which applies to all queues"); + $subtabs->{"C"} = { title => loc('Scrip #[_1]', $ARGS{'id'}), + path => "Admin/Global/Scrip.html?id=".$ARGS{'id'}."&Queue=0" + } +} +else { + $current_subtab = "Admin/Global/Scrip.html?create=1&Queue=0"; + $title = loc("Add a scrip which will apply to all queues"); +} + diff --git a/rt/html/Admin/Global/Scrips.html b/rt/html/Admin/Global/Scrips.html new file mode 100644 index 000000000..763198015 --- /dev/null +++ b/rt/html/Admin/Global/Scrips.html @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Scrips.html', + current_subtab => 'Admin/Global/Scrips.html', + subtabs => $subtabs, + Title => $title &> +<& /Admin/Elements/EditScrips, title => $title, id => $id, %ARGS &> + +<%init> + +my $subtabs = { + A => { title => loc('Select scrip'), + path => "Admin/Global/Scrips.html", + }, + B => { title => loc('New scrip'), + path => "Admin/Global/Scrip.html?create=1&Queue=0", + separator => 1, + } + }; +my $title = loc("Modify scrips which apply to all queues"); + +my (@actions); + + + + + +<%ARGS> +$id => 0 + diff --git a/rt/html/Admin/Global/Template.html b/rt/html/Admin/Global/Template.html new file mode 100644 index 000000000..71f77e9dd --- /dev/null +++ b/rt/html/Admin/Global/Template.html @@ -0,0 +1,101 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc("Modify template [_1]", $TemplateObj->id) &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Templates.html', + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => loc("Modify template [_1]", $TemplateObj->id) &> +<& /Elements/ListActions, actions => \@results &> + + +
    +%if ($Create ) { + +% } else { + +% } + +%# hang onto the queue id + + +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => $TemplateObj->Description, Content => $TemplateObj->Content &> + +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +
    + + + +<%INIT> + +my $TemplateObj = new RT::Template($session{'CurrentUser'}); +my ($title, @results, $current_subtab); + +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Global/Templates.html" + }, + B => { title => loc('New template'), + path => "Admin/Global/Template.html?Create=1&Queue=0", + separator => 1, + } + }; + + +if ($Create) { + $current_subtab = "Admin/Global/Template.html?Create=1&Queue=0"; + $title = loc("Create a template"); +} + +else { + if ($Template eq 'new') { + my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); + Abort(loc("Could not create template: [_1]", $msg)) unless ($val); + push @results, $msg; + } + else { + $TemplateObj->Load($Template) || Abort(loc('No Template')); + } + $title = loc('Modify template [_1]', loc($TemplateObj->Name())); + + +} +if ($TemplateObj->Id()) { + my @attribs = qw( Description Content Queue Name); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $TemplateObj, + ARGSRef => \%ARGS); + $current_subtab = "Admin/Global/Template.html?Queue=0&Template=".$TemplateObj->Id(); + $subtabs->{"C"} = { title => loc('Template #[_1]', $TemplateObj->Id()), + path => "Admin/Global/Template.html?Queue=0&Template=".$TemplateObj->Id(), + }; + push @results, @aresults; +} + +<%ARGS> +$Queue => undef +$Template => undef +$Create => undef +$Name => undef + diff --git a/rt/html/Admin/Global/Templates.html b/rt/html/Admin/Global/Templates.html new file mode 100644 index 000000000..77aab0730 --- /dev/null +++ b/rt/html/Admin/Global/Templates.html @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/Templates.html', + current_subtab => 'Admin/Global/Templates.html', + subtabs => $subtabs, + Title => $title &> +<& /Admin/Elements/EditTemplates, title => $title, %ARGS &> + +<%init> + +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Global/Templates.html" + }, + B => { title => loc('New template'), + path => "Admin/Global/Template.html?Create=1&Queue=0", + separator => 1, + } + }; +my $title = loc("Modify templates which apply to all queues"); + +my (@actions); + + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Global/UserRights.html b/rt/html/Admin/Global/UserRights.html new file mode 100644 index 000000000..aee82d1f4 --- /dev/null +++ b/rt/html/Admin/Global/UserRights.html @@ -0,0 +1,77 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify global user rights') &> +<& /Admin/Elements/SystemTabs, + current_tab => 'Admin/Global/UserRights.html', + Title => loc('Modify global user rights') &> +<& /Elements/ListActions, actions => \@results &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Modify global user rights.') &> + + + +% 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 => $RT::System &> +
    + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + + +# }}} + + + +<%ARGS> + diff --git a/rt/html/Admin/Global/index.html b/rt/html/Admin/Global/index.html new file mode 100644 index 000000000..1749f4ffb --- /dev/null +++ b/rt/html/Admin/Global/index.html @@ -0,0 +1,64 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Callback, tabs => $tabs, %ARGS &> +<& /Admin/Elements/Header, Title => loc('Admin/Global configuration') &> +<& /Admin/Elements/SystemTabs, + Title => loc('Admin/Global configuration') &> + + + +<%INIT> + my $tabs = { + + A => { title => loc('Scrips'), + text => loc('Modify scrips which apply to all queues'), + path => 'Scrips.html', + }, + B => { title => loc('Templates'), + text => loc('Edit system templates'), + path => 'Templates.html', + }, + + F => { title => loc('Custom Fields'), + text => loc('Modify Custom Fields which apply to all queues'), + path => 'CustomFields.html', + }, + + G => { title => loc('Group Rights'), + text => loc('Modify global group rights'), + path => 'GroupRights.html', + }, + H => { title => loc('User Rights'), + text => loc('Modify global user rights'), + path => 'UserRights.html', + } + +}; + diff --git a/rt/html/Admin/Groups/GroupRights.html b/rt/html/Admin/Groups/GroupRights.html new file mode 100644 index 000000000..6220259d3 --- /dev/null +++ b/rt/html/Admin/Groups/GroupRights.html @@ -0,0 +1,95 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/GroupRights.html?id='.$id, + Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + +<& /Elements/TitleBoxStart, title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> + +

    <&|/l&>System groups

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> +
    + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id)); + +my $Groups; + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html new file mode 100644 index 000000000..6e669666f --- /dev/null +++ b/rt/html/Admin/Groups/Members.html @@ -0,0 +1,134 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => "RT/Admin/Edit the group ". $Group->Name &> +<& /Admin/Elements/GroupTabs, GroupObj => $Group, + current_tab => 'Admin/Groups/Members.html?id='.$id, + Title => "RT/Admin/Edit the group ". $Group->Name &> +<& /Elements/ListActions, actions => \@results &> + + +<& /Elements/TitleBoxStart, title => loc('Editing membership for group [_1]', $Group->Name) &> + +
    + + + + + + + + + + + +
    +

    <&|/l&>Current members

    +
    +

    <&|/l&>Add members

    +
    + +% if ($Group->MembersObj->Count == 0 ) { +<&|/l&>(No members) +% } else { +<&|/l&>(Check box to delete) +
    +
    +<&|/l&>Users +% my $UserMembers = $Group->MembersObj; +% $UserMembers->LimitToUsers(); +
      +% while (my $member = $UserMembers->Next()) { +
    • +<%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) +% } +
    +<&|/l&>Groups +
      +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while (my $member = $GroupMembers->Next()) { +
    • +<%$member->MemberObj->Object->Name%> +% } +% } +
    +
    +<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group &> +
    +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +
    + + +<%INIT> + +my $Group = new RT::Group($session{'CurrentUser'}); +$Group->Load($id) || Abort(loc('Could not load group')); + +my (@results); + +my $key; +foreach $key (keys %ARGS) { + +if ($key =~ /^DeleteMember-(\d+)$/) { + my $id = $1; + my ($val,$msg) = $Group->DeleteMember($id); + push (@results, $msg); +} +} + +# Make sure AddMembers is always an array +my @AddMembers = ( + ((ref $AddMembersUsers eq 'ARRAY') ? @{$AddMembersUsers} : ($AddMembersUsers)), + ((ref $AddMembersGroups eq 'ARRAY') ? @{$AddMembersGroups} : ($AddMembersGroups)), +); + +foreach my $member (@AddMembers) { + next unless ($member); + + my $principal; + + if ($member =~ /^Group-(\d+)$/) { + $principal = RT::Group->new($session{'CurrentUser'}); + $principal->Load($1); + } elsif ($member =~ /^User-(\d+)$/) { + $principal = RT::User->new($session{'CurrentUser'}); + $principal->Load($1); + } else { + next; + } + + + my ($val, $msg) = $Group->AddMember($principal->PrincipalId); + push (@results, $msg); +} + + + + +<%ARGS> +$AddMembersUsers => undef +$AddMembersGroups => undef +$id => undef + diff --git a/rt/html/Admin/Groups/Modify.html b/rt/html/Admin/Groups/Modify.html new file mode 100644 index 000000000..c5e91588e --- /dev/null +++ b/rt/html/Admin/Groups/Modify.html @@ -0,0 +1,134 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> + +<& /Admin/Elements/GroupTabs, + GroupObj => $Group, + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + + +
    + +%unless ($Group->Id) { + +% } else { + +% } + + + + + + + +
    +<&|/l&>Name: +
    +<&|/l&>Description:
    + +> <&|/l&>Enabled (Unchecking this box disables this group)
    +
    +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +
    +<%INIT> + +my $current_tab; +my ($title, @results, $Disabled, $EnabledChecked); + +my $Group = RT::Group->new($session{'CurrentUser'}); + +if ($Create) { + $current_tab = 'Admin/Groups/Modify.html?Create=1'; + $title = loc("Create a new group"); +} + +else { + $current_tab = 'Admin/Groups/Modify.html?id='.$id; + if ($id eq 'new' ) { + + my ($create_id, $create_msg) = $Group->CreateUserDefinedGroup(Name => + "$Name"); + unless ($create_id) { + Abort (loc("Group could not be created: [_1]", $create_msg)); + } + $id = $Group->Id; + } + else { + $Group->Load($id) || Abort('Could not load group'); + } + + + if ($id) { + $title = loc("Modify the group [_1]", $Group->Name); + + } + + # If the create failed + else { + $title = loc("Create a new group"); + $Create = 1; + } + +} + +if ($id) { + + my @fields = qw(Description Name ); + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $Group, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); +} + +#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 != $Group->Disabled) ) { + my ($code, $msg) = $Group->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); +} + +unless ($Group->Disabled()) { + $EnabledChecked ="CHECKED"; +} + + + + + +<%ARGS> +$Create => undef +$Name => undef +$Description => undef +$SetEnabled => undef +$Enabled => undef +$id => undef + diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html new file mode 100644 index 000000000..0a87ef860 --- /dev/null +++ b/rt/html/Admin/Groups/UserRights.html @@ -0,0 +1,92 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/UserRights.html?id='.$id, + Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + +<& /Elements/TitleBoxStart, title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> + + + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); + + + + +% } +
    + <% $UserObj->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Member->MemberObj->Id, + PrincipalType => 'User', + Object => $GroupObj &> +
    + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + +#Define vars used in html above + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + + +# }}} + + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html new file mode 100644 index 000000000..57c86c90e --- /dev/null +++ b/rt/html/Admin/Groups/index.html @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', + current_subtab => 'Admin/Groups/', + Title => $title &> + + + + +<%INIT> +my $Groups = RT::Groups->new($session{'CurrentUser'}); +$Groups->LimitToUserDefinedGroups(); +my $title = loc('Select a group'); + + +<%ARGS> + diff --git a/rt/html/Admin/Queues/CustomField.html b/rt/html/Admin/Queues/CustomField.html new file mode 100644 index 000000000..2515c3e94 --- /dev/null +++ b/rt/html/Admin/Queues/CustomField.html @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/CustomFields.html?id='.$QueueObj->id, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditCustomField, title => $title, %ARGS &> + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue); + +my ($title, $current_subtab); + +unless($QueueObj->id) { + Abort(loc("Queue [_1] not found", $Queue)); +} +if ($CustomField) { + $title = loc('Modify a CustomField for queue [_1]', $QueueObj->Name()); +}else { + $current_subtab = "Admin/Queues/CustomField.html?create=1&Queue=".$QueueObj->id; + $title = loc('Create a CustomField for queue [_1]', $QueueObj->Name()); +} + +my $subtabs = { + A => { title => loc('New custom field'), + path => "Admin/Queues/CustomField.html?create=1&Queue=".$QueueObj->id + } + }; + + +<%ARGS> +$CustomField => undef +$Queue => undef + diff --git a/rt/html/Admin/Queues/CustomFields.html b/rt/html/Admin/Queues/CustomFields.html new file mode 100644 index 000000000..78c6c2790 --- /dev/null +++ b/rt/html/Admin/Queues/CustomFields.html @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $Queue->id, + current_tab => 'Admin/Queues/CustomFields.html?id='.$id, + QueueObj => $Queue, + subtabs => $subtabs, + Title => $title + &> + +<& /Admin/Elements/EditCustomFields, title => $title, %ARGS &> +<%INIT> +my $Queue = new RT::Queue($session{'CurrentUser'}); +$Queue->Load($id); +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, + } + }; + +my $title= loc('Edit Custom Fields for [_1]', $Queue->Name); + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Queues/GroupRights.html b/rt/html/Admin/Queues/GroupRights.html new file mode 100644 index 000000000..a1ac709e1 --- /dev/null +++ b/rt/html/Admin/Queues/GroupRights.html @@ -0,0 +1,110 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + + +

    <&|/l&>System groups

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

    <&|/l&>Roles

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

    <&|/l&>User defined groups

    + +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + + + + +% } +
    + <% $Group->Name %> + + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $QueueObj &> +
    + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +if (!defined $id) { + Abort(loc("No Queue defined")); +} + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue [_1]",$id)); + +my $Groups; +my $current_tab; +$current_tab = 'Admin/Queues/GroupRights.html?id='.$QueueObj->id; + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Admin/Queues/Modify.html b/rt/html/Admin/Queues/Modify.html new file mode 100644 index 000000000..46608eba6 --- /dev/null +++ b/rt/html/Admin/Queues/Modify.html @@ -0,0 +1,163 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Admin/Queue/Basics') &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Admin/Queue/Basics') &> +<& /Elements/ListActions, actions => \@results &> + + + +
    +%if ($Create ) { + +% } else { + +% } + + + + + + + + + + + + + + + + + + + + + + +
    +<&|/l&>Queue Name: +Name %>">
    +<&|/l&>Description:Description %>" size=60>
    +<&|/l&>Correspondence Address: + +CorrespondAddress %>"> +
    <&|/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&>Priority starts at: +InitialPriority %>"> + +<&|/l&>Over time, priority moves toward: +FinalPriority %>"> +
    +<&|/l&>Requests should be due in: + +DefaultDueIn%>"> <&|/l&>days. +
    + +> <&|/l&>Enabled (Unchecking this box disables this queue)
    +<& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &> +
    +<& /Elements/Submit &> +
    + + + +<%INIT> +my $current_tab; +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); +my ($title, @results, $Disabled, $EnabledChecked); +$EnabledChecked = "CHECKED"; + +if ($Create) { + $current_tab = 'Admin/Queues/Modify.html?Create=1'; + $title = loc("Create a queue"); +} else { + if ($id eq 'new') { + my ($val, $msg) = $QueueObj->Create(Name => $Name); + delete $session{'create_in_queues'}; + if ($val == 0 ) { + Abort("$msg"); + } + else { + push @results, $msg; + } + } + else { + $QueueObj->Load($id) || $QueueObj->Load($Name) || Abort("Couldn't load queue '$Name'"); + } + $title = loc('Editing Configuration for queue [_1]', $QueueObj->Name); + + $current_tab = 'Admin/Queues/Modify.html?id='.$QueueObj->id; +} +if ($QueueObj->Id()) { + delete $session{'create_in_queues'}; +my @attribs= qw(Description CorrespondAddress CommentAddress Name + InitialPriority FinalPriority DefaultDueIn); + + @results = UpdateRecordObject( AttributesRef => \@attribs, + Object => $QueueObj, + ARGSRef => \%ARGS); + + #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 != $QueueObj->Disabled) ) { + my ($code, $msg) = $QueueObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } + + if ($QueueObj->Disabled()) { + $EnabledChecked =""; + } +} + + + +<%ARGS> +$id => undef +$result => undef +$Name => undef +$Create => undef +$Description => undef +$CorrespondAddress => undef +$CommentAddress => undef +$InitialPriority => undef +$FinalPriority => undef +$DefaultDueIn => undef +$SetEnabled => undef +$Enabled => undef + diff --git a/rt/html/Admin/Queues/People.html b/rt/html/Admin/Queues/People.html new file mode 100644 index 000000000..e0a7345c0 --- /dev/null +++ b/rt/html/Admin/Queues/People.html @@ -0,0 +1,186 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> + +<& /Elements/ListActions, actions => \@results &> + + +
    + + + + + + + +
    + +

    <&|/l&>Current watchers

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

    <&|/l&>New watchers

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

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

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

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

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

      +% while (my $g = $Groups->Next ) { +
    • <&/Elements/SelectWatcherType, Scope=>'queue', Name => +"Queue-AddWatcher-Principal-".$g->PrincipalId &> <%$g->Name%> +(<%$g->Description%>) +% } +
    +% } + +
    + + + + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), Reset => 1 &> +
    + +<%INIT> + +my $current_tab; +my ($field, @results, $User, $Users, $Groups, $watcher, $user_msg, $group_msg); + +# {{{ Load the queue +#If we get handed two ids, mason will make them an array. bleck. +# We want teh first one. Just because there's no other sensible way +# to deal + + + +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue", $id)); +# }}} + +# {{{ Delete deletable watchers + +foreach my $key (keys %ARGS) { + my $id = $QueueObj->Id; + + if (($key =~ /^Queue-$id-DelWatcher-Type-(.*?)-Principal-(\d*)$/)) {; + my ($code, $msg) = $QueueObj->DeleteWatcher(Type => $1, + PrincipalId => $2); + push @results, $msg; + } +} +# }}} + +# {{{ Add new watchers +foreach my $key (keys %ARGS) { + #They're in this order because otherwise $1 gets clobbered :/ + if ( ($ARGS{$key} =~ /^(AdminCc|Cc)$/) and + ($key =~ /^Queue-AddWatcher-Principal-(\d*)$/) ) { + $RT::Logger->debug("Adding a watcher $1 to ".$ARGS{$key}."\n"); + my ($code, $msg) = $QueueObj->AddWatcher(Type => $ARGS{$key}, + PrincipalId => $1); + push @results, $msg; + } +} + +# }}} + + + +if (!length $ARGS{'UserString'}) { +$user_msg = loc("No principals selected."); + } +else { + $Users = new RT::Users($session{'CurrentUser'}); + $Users->Limit(FIELD => $ARGS{'UserField'}, + VALUE => $ARGS{'UserString'}, + OPERATOR => $ARGS{'UserOp'}); + } + +if (!length $ARGS{'GroupString'}) { +$group_msg = loc("No principals selected."); + } +else { +$Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); +$Groups->Limit(FIELD => $ARGS{'GroupField'}, + VALUE => $ARGS{'GroupString'}, + OPERATOR => $ARGS{'GroupOp'}); + } + +$current_tab = 'Admin/Queues/People.html?id='.$QueueObj->id; + + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$Type => undef +$id => undef + + diff --git a/rt/html/Admin/Queues/Scrip.html b/rt/html/Admin/Queues/Scrip.html new file mode 100644 index 000000000..edbfcd66b --- /dev/null +++ b/rt/html/Admin/Queues/Scrip.html @@ -0,0 +1,67 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->Id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/Scrips.html?id='.$QueueObj->id, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditScrip, title => $title, %ARGS &> +<%init> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue); + +my ($title, $current_subtab); +my $subtabs = { + A => { title => loc('Select scrip'), + path => "Admin/Queues/Scrips.html?id=".$QueueObj->id, + }, + B => { title => loc('New scrip'), + path => "Admin/Queues/Scrip.html?create=1&Queue=".$QueueObj->id, + separator => 1, + }, + }; + +unless($QueueObj->id) { + Abort(loc("Queue [_1] not found",$id)); +} +if ($id) { + $current_subtab = "Admin/Queues/Scrip.html?id=".$id."&Queue=".$QueueObj->id; + $title = loc("Modify a scrip for queue [_1]", $QueueObj->Name); + $subtabs->{"C"} = { title => loc("Scrip #[_1]",$QueueObj->id), + path => "Admin/Queues/Scrip.html?id=$id&Queue=".$QueueObj->id }; +} else { + $current_subtab = "Admin/Queues/Scrip.html?create=1&Queue=".$QueueObj->id; + $title = loc("Create a scrip for queue [_1]", $QueueObj->Name); +} + + + + +<%ARGS> +$id => undef +$Queue => undef + diff --git a/rt/html/Admin/Queues/Scrips.html b/rt/html/Admin/Queues/Scrips.html new file mode 100644 index 000000000..60b28314f --- /dev/null +++ b/rt/html/Admin/Queues/Scrips.html @@ -0,0 +1,63 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + QueueObj => $QueueObj, + current_tab => 'Admin/Queues/Scrips.html?id='.$id, + current_subtab => 'Admin/Queues/Scrips.html?id='.$id, + subtabs => $subtabs, + Title => $title &> + +% if (!$QueueObj->Disabled) { # Global scrips does not apply to disabled queues +

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

    +<& /Admin/Elements/ListGlobalScrips &> +
    +% } +<& /Admin/Elements/EditScrips, title => $title, %ARGS &> +<%init> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +my $title; + +if ($QueueObj->id) { + $title = loc("Modify scrips for queue [_1]", $QueueObj->Name); +} else { + Abort(loc("Queue [_1] not found",$id)); +} + +my $subtabs = { + A => { title => loc('Select scrip'), + path => "Admin/Queues/Scrips.html?id=".$id, + }, + B => { title => loc('New scrip'), + path => "Admin/Queues/Scrip.html?create=1&Queue=".$id, + separator => 1, + } + }; + + +<%ARGS> +$id => undef #some identifier that a Queue could + diff --git a/rt/html/Admin/Queues/Template.html b/rt/html/Admin/Queues/Template.html new file mode 100644 index 000000000..994de6108 --- /dev/null +++ b/rt/html/Admin/Queues/Template.html @@ -0,0 +1,101 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $Queue, + QueueObj => $TemplateObj->QueueObj, + current_tab => 'Admin/Queues/Templates.html?id='.$Queue, + current_subtab => $current_subtab, + subtabs => $subtabs, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + +
    +%if ($Create ) { + +% } else { + +% } + +%# hang onto the queue id + +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => +$TemplateObj->Description, Content => $TemplateObj->Content &> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +
    + + +<%INIT> + +my $TemplateObj = new RT::Template($session{'CurrentUser'}); +my ($title, @results, $current_subtab); + +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Queues/Templates.html?id=$Queue" + }, + B => { title => loc('New template'), + path => "Admin/Queues/Template.html?Create=1&Queue=$Queue", + separator => 1, + } + }; + +if ($Create) { + $title = loc("Create a template"); + $current_subtab = "Admin/Queues/Template.html?create=1&Queue=".$Queue; +} + +else { + if ($Template eq 'new') { + my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); + Abort(loc("Could not create template: [_1]", $msg)) unless ($val); + push @results, $msg; + } + else { + $TemplateObj->Load($Template) || Abort(loc('No Template')); + } + $title = loc('Modify template [_1]', loc($TemplateObj->Name())); + + +} +if ($TemplateObj->Id()) { + $Queue = $TemplateObj->Queue; + + my @attribs = qw( Description Content Queue Name); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $TemplateObj, + ARGSRef => \%ARGS); + $current_subtab = "Admin/Queues/Template.html?Queue=$Queue&Template=".$TemplateObj->Id(); + $subtabs->{"C"} = { title => loc('Template #[_1]', $TemplateObj->Id()), + path => "Admin/Queues/Template.html?Queue=$Queue&Template=".$TemplateObj->Id(), + }; + push @results, @aresults; +} + + +<%ARGS> +$Queue => undef +$Template => undef +$Create => undef +$Name => undef + diff --git a/rt/html/Admin/Queues/Templates.html b/rt/html/Admin/Queues/Templates.html new file mode 100644 index 000000000..98bdf24c0 --- /dev/null +++ b/rt/html/Admin/Queues/Templates.html @@ -0,0 +1,57 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/QueueTabs, id => $QueueObj->id, + current_tab => 'Admin/Queues/Templates.html?id='.$id, + current_subtab => 'Admin/Queues/Templates.html?id='.$id, + QueueObj => $QueueObj, + subtabs => $subtabs, + Title => $title &> + +<& /Admin/Elements/EditTemplates, title => $title, %ARGS &> + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($id); + +my ($title, $current_subtab); + +if ($QueueObj->id) { + $title = loc("Edit Templates for queue [_1]", $QueueObj->Name); +} else { + Abort(loc("Queue [_1] not found",$id)); +} +my $subtabs = { + A => { title => loc('Select template'), + path => "Admin/Queues/Templates.html?id=".$id, + }, + B => { title => loc('New template'), + path => "Admin/Queues/Template.html?Create=1&Queue=".$id, + } + }; + + +<%ARGS> +$id => undef #some identifier that a Queue could + diff --git a/rt/html/Admin/Queues/UserRights.html b/rt/html/Admin/Queues/UserRights.html new file mode 100644 index 000000000..aeb55c70b --- /dev/null +++ b/rt/html/Admin/Queues/UserRights.html @@ -0,0 +1,90 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> +<& /Admin/Elements/QueueTabs, id => $id, + QueueObj => $QueueObj, + current_tab => $current_tab, + Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + +
    + + + + +<& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &> +% 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 => $QueueObj &> +
    + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + +
    + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + + +if (!defined $id) { + Abort(loc("No Queue defined")); +} + +my $QueueObj = RT::Queue->new($session{'CurrentUser'}); +$QueueObj->Load($id) || Abort(loc("Couldn't load queue [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + + +# }}} +my $current_tab; +$current_tab = 'Admin/Queues/UserRights.html?id='.$QueueObj->id; + + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef + diff --git a/rt/html/Admin/Queues/index.html b/rt/html/Admin/Queues/index.html new file mode 100644 index 000000000..f733c25d8 --- /dev/null +++ b/rt/html/Admin/Queues/index.html @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc("Admin queues") &> +<& /Admin/Elements/QueueTabs, current_tab => 'Admin/Queues/', + current_subtab => 'Admin/Queues/', + Title => loc("Admin queues") &> + + + +<%$caption%>:
    +
      +%if ($queues->Count == 0) { +
    • <&|/l&>No queues matching search criteria found. +% } +%while ( $queue = $queues->Next) { +
    • <%$queue->Name%>
    • +%} +
    +
    +
    + <&|/l&>Include disabled queues in listing. +
    +
    + +<%INIT> +my ($queue, $caption); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit(); + +if ($FindDisabledQueues) { + $caption = loc("All Queues"); + $queues->{'find_disabled_rows'} = 1; +} else { + $caption = loc("Enabled Queues"); +} + + +<%ARGS> +$FindDisabledQueues => 0 + diff --git a/rt/html/Admin/Users/Modify.html b/rt/html/Admin/Users/Modify.html new file mode 100644 index 000000000..370c2e82d --- /dev/null +++ b/rt/html/Admin/Users/Modify.html @@ -0,0 +1,347 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> + +
    +%if ($Create) { + +% } else { + +% } + + + + + + + + + + +
    +<& /Elements/TitleBoxStart, title => loc('Identity') &> + + + + + + + + +
    +<&|/l&>Username: + + <&|/l&>(required) +
    +<&|/l&>Email: + + +
    +<&|/l&>Real Name: + + +
    +<&|/l&>Nickname: + + +
    +<&|/l&>Unix login: + + +
    +<&|/l&>Extra info: + + +
    +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc('Access control') &> + +> +<&|/l&>Let this user access RT
    + + + +> <&|/l&>Let this user be granted rights
    + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { + + + + + + + + +
    +<&|/l&>New Password: + + +
    +<&|/l&>Retype Password: + + +
    +% } +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc('Location') &> + + + + + + + + +
    +<&|/l&>Organization: + + +
    +<&|/l&>Address1: + + +
    +<&|/l&>Address2: + + +
    +<&|/l&>City: + + + +
    +<&|/l&>State: + + + +
    +<&|/l&>Zip: + + +
    +<&|/l&>Country: + + +
    +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc('Phone numbers') &> + + + + + + + + +
    +<&|/l&>Residence: + +
    +
    +<&|/l&>Work: + +
    +
    +<&|/l&>Mobile: + +
    +
    +<&|/l&>Pager: + +
    +<& /Elements/TitleBoxEnd &> +
    +
    +<& /Elements/TitleBoxStart, title => loc('Comments about this user') &> + +<& /Elements/TitleBoxEnd &> +%if ($UserObj->Privileged) { +
    +<& /Elements/TitleBoxStart, title => loc('Signature') &> + +<& /Elements/TitleBoxEnd &> +% } + +
    + +<& /Elements/Submit &> +
    + +<%INIT> + +my $current_tab; +my $UserObj = new RT::User($session{'CurrentUser'}); +my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results); + +my ($val, $msg); + +if ($Create) { + $current_tab = 'Admin/Users/Modify.html?Create=1'; + $title = loc("Create a new user"); +} +else { + + $current_tab = 'Admin/Users/Modify.html?id='.$id; + if ($id eq 'new') { + ($val, $msg) = $UserObj->Create( Name => $Name, + EmailAddress => $ARGS{'EmailAddress'} + ); + if ($val) { + push @results, $msg; + } else { + push @results, loc('User could not be created: [_1]', $msg); + } + + } + else { + $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); + $val = $UserObj->Id(); + } + + if ($val) { + $title = loc("Modify the user [_1]", $UserObj->Name); + } + + # If the create failed + else { + $title = loc("Create a new user"); + $Create = 1; + } + + + +} + + + + +# If we have a user to modify, lets try. +if ($UserObj->Id) { + + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo + Organization RealName NickName Lang EmailEncoding WebEncoding + ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId + AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 + Address2 City State Zip Country + ); + + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $UserObj, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); + + +# {{{ 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)); +} + +#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)); +} + + +#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."); +} + +# }}} +} + + +# {{{ Do some setup for the ui +unless ($UserObj->Disabled()) { + $EnabledChecked ="CHECKED"; +} + +if ($UserObj->Privileged()) { + $PrivilegedChecked = "CHECKED"; +} + +# }}} + + + +<%ARGS> +$id => undef +$Name => undef +$Comments => undef +$Signature => undef +$EmailAddress => undef +$FreeformContactInfo => undef +$Organization => undef +$RealName => undef +$NickName => undef +$Privileged => undef +$SetPrivileged => undef +$Enabled => undef +$SetEnabled => undef +$Lang => undef +$EmailEncoding => undef +$WebEncoding => undef +$ExternalContactInfoId => undef +$ContactInfoSystem => undef +$Gecos => undef +$ExternalAuthId => undef +$AuthSystem => undef +$HomePhone => undef +$WorkPhone => undef +$MobilePhone => undef +$PagerPhone => undef +$Address1 => undef +$Address2 => undef +$City => undef +$State => undef +$Zip => undef +$Country => undef +$Pass1 => undef +$Pass2=> undef +$Create=> undef + diff --git a/rt/html/Admin/Users/Prefs.html b/rt/html/Admin/Users/Prefs.html new file mode 100644 index 000000000..0bba9fadd --- /dev/null +++ b/rt/html/Admin/Users/Prefs.html @@ -0,0 +1,122 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("User view") &> + +<& /Elements/ViewUser, User=>$u &> + +

    <%loc("User view")%>

    + +%if ($session{CurrentUser} && ($session{CurrentUser}->Id == $id)) { + <& /Elements/TitleBoxStart, title => loc('Signature') &> +
    +> +

    + +
    + <& /Elements/TitleBoxEnd &> +
    + <&|/l&>Open tickets (from listing) in another window: >
    + <&|/l&>Open tickets (from listing) in a new window: >
    + +
    +%} + + <& /Elements/TitleBoxStart, title => loc('Email') &> +
    + + +
    + <& /Elements/TitleBoxEnd &> + <& /Elements/TitleBoxStart, title => loc('Real Name') &> +
    + + +
    + <& /Elements/TitleBoxEnd &> + + <& /Elements/TitleBoxStart, title => loc('User ID') &> +
    + + +
    + <& /Elements/TitleBoxEnd &> + +%# TODO: alternative email addresses + merging users + +<%ARGS> +$id => $session{CurrentUser} ? $session{CurrentUser}->Id : 0 +$Signature => undef +$Email => undef +$RealName => undef +$Name => undef + + +<%INIT> +require RT::User; +my $u=RT::User->new($session{CurrentUser}); +$u->Load($id) || die loc("Couldn't load that user ([_1])", $id); +if ($Signature) { +my ($val, $msg)=$u->SetSignature($Signature); +$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg); +} + +if ($Email) { +my ($val, $msg)=$u->SetEmailAddress($Email); +$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg); +} + +if ($RealName) { +my ($val, $msg)=$u->SetRealName($RealName); +$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg); +} + +if ($Name) { +my ($val, $msg)=$u->SetName($Name); +$RT::Logger->log(level=>($val ? 'info' : 'error'), message=>$msg); +} + +if ($ARGS{NewWindowSetting}) { +if ($ARGS{NewWindowOption}) { +$session{NewWindowOption}=1; +} else { +delete $session{NewWindowOption}; +} +if ($ARGS{AlwaysNewWindowOption}) { +$session{NewWindowOption}=1; +$session{AlwaysNewWindowOption}=1; +} else { +delete $session{AlwaysNewWindowOption}; +} +} + + + + + + + + + + + diff --git a/rt/html/Admin/Users/index.html b/rt/html/Admin/Users/index.html new file mode 100644 index 000000000..a95d4117d --- /dev/null +++ b/rt/html/Admin/Users/index.html @@ -0,0 +1,81 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('Select a user') &> +<& /Admin/Elements/UserTabs, current_tab => 'Admin/Users/', + current_subtab => 'Admin/Users/', + Title => loc('Select a user') &> + + + + +<%$caption%>:
    + +

    +
    + +<&|/l&>Find people whose <& /Elements/SelectUsers &>
    + <&|/l&>Include disabled users in search. +
    +
    +
    + +<%INIT> +my ($user, $caption); +my $users = new RT::Users($session{'CurrentUser'}); + +if ($FindDisabledUsers) { + $users->{'find_disabled_rows'} = 1; +} + +unless (defined $UserString) { + $users->LimitToPrivileged(); + $caption = loc("Privileged users"); +} +else { + $caption = loc("Users matching search criteria"); + + if ($UserString) { + $users->Limit( FIELD => $UserField, + OPERATOR => $UserOp, + VALUE => $UserString); + +} +} + +<%ARGS> +$UserString => undef +$UserOp => '=' +$UserField => 'Name' +$IdLike => undef +$EmailLike => undef +$FindDisabledUsers => 0 + diff --git a/rt/html/Admin/index.html b/rt/html/Admin/index.html new file mode 100644 index 000000000..522ade876 --- /dev/null +++ b/rt/html/Admin/index.html @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Admin/Elements/Header, Title => loc('RT Administration') &> +<& /Admin/Elements/Tabs, Title => loc('RT Administration') &> + +
      +
    • <&|/l&>Users
      +<&|/l&>Manage users and passwords +
    • +
    • <&|/l&>Groups
      +<&|/l&>Manage groups and group membership +
    • +
    • <&|/l&>Queues
      +<&|/l&>Manage queues and queue-specific properties +
    • +
    • <&|/l&>Global
      +<&|/l&>Manage properties and configuration which apply to all queues +
    • +
    diff --git a/rt/html/Approvals/Display.html b/rt/html/Approvals/Display.html new file mode 100644 index 000000000..921c1e38f --- /dev/null +++ b/rt/html/Approvals/Display.html @@ -0,0 +1,50 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title &> + +<& Elements/Tabs, + current_tab => "Approvals/Display.html", + Title => $title &> +
    + +<& /Elements/TitleBoxStart, title => $title &> +<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, Collapsed => 0, ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0 &> +
    + +<& Elements/Approve, ticket => $Ticket, ShowApproving => 0 &> +
    +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit&> +
    +<& Elements/ShowDependency, Ticket => $Ticket &> + +<%init> +my $Ticket = LoadTicket($id); + +my $title = loc("Approval #[_1]: [_2]", $Ticket->Id, $Ticket->Subject); + + +<%ARGS> +$id => undef + diff --git a/rt/html/Approvals/Elements/Approve b/rt/html/Approvals/Elements/Approve new file mode 100644 index 000000000..6a7cfa37f --- /dev/null +++ b/rt/html/Approvals/Elements/Approve @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<% loc("#[_1]: [_2]", $ticket->Id, $ticket->Subject) %> (<%loc($ticket->Status)%>) + +% if ($ShowApproving) { +% foreach my $approving ( $ticket->AllDependedOnBy( Type => 'ticket' ) ) { + + +<&|/l, $approving->Id, $approving->Subject &>Originating ticket: #[_1] + + + +<& /Ticket/Elements/ShowCustomFields, Ticket => $approving &> +<& /Ticket/Elements/ShowHistory, Ticket => $approving, Collapsed => 0, ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0 &> + +% } +% } +> + +<&|/l&>Approve
    +<&|/l&>Deny
    +<&|/l&>No action + + +<&|/l&>Notes
    + + + +<%ARGS> +$ShowApproving => 1 +$ticket => undef +$class => undef + diff --git a/rt/html/Approvals/Elements/PendingMyApproval b/rt/html/Approvals/Elements/PendingMyApproval new file mode 100644 index 000000000..b5cf00788 --- /dev/null +++ b/rt/html/Approvals/Elements/PendingMyApproval @@ -0,0 +1,87 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +% my ($i, $class); +% my %done; +% foreach ($tickets, $group_tickets) { +% while (my $ticket = $_->Next() ) { +% next if !$ARGS{'ShowDependent'} and $ticket->HasUnresolvedDependencies( Type => 'approval' ); +% next if $done{$ticket->Id}++; # don't show duplicate tickets +% $i++; +% $class = ($i%2) ? "oddline" : "evenline"; +<& Approve, ticket => $ticket, class => $class &> +% } +% } +
    + +<& /Elements/TitleBoxStart, title => loc("Search for approvals") &> +> <&|/l&>Show pending requests
    +> <&|/l&>Show approved requests
    +> <&|/l&>Show denied requests
    +> <&|/l&>Show requests awaiting other approvals
    + +<&|/l,""&>Only show approvals for requests created before [_1]
    + +<&|/l, ""&>Only show approvals for requests created after [_1] +<& /Elements/TitleBoxEnd &> + +<%init> +my $tickets = RT::Tickets->new( $session{'CurrentUser'} ); +$tickets->LimitOwner( VALUE => $session{'CurrentUser'}->Id ); + +# also consider AdminCcs as potential approvers. +my $group_tickets = RT::Tickets->new( $session{'CurrentUser'} ); + +my $created_before = RT::Date->new( $session{'CurrentUser'} ); +my $created_after = RT::Date->new( $session{'CurrentUser'} ); + +foreach ($tickets, $group_tickets) { + $_->Limit( FIELD => 'Type', VALUE => 'approval' ); + + if ( $ARGS{'ShowResolved'} ) { + $_->LimitStatus( VALUE => 'resolved' ); + } + if ( $ARGS{'ShowRejected'} ) { + $_->LimitStatus( VALUE => 'rejected' ); + } + if ( $ARGS{'ShowPending'} || ( !$ARGS{'ShowRejected'} && !$ARGS{'Resolved'} ) ) { + $_->LimitStatus( VALUE => 'open' ); + $_->LimitStatus( VALUE => 'new' ); + $_->LimitStatus( VALUE => 'stalled' ); + } + + if ( $ARGS{'CreatedBefore'} ) { + $created_before->Set( Format => 'unknown', Value => $ARGS{'CreatedBefore'} ); + $_->LimitCreated( OPERATOR => "<=", VALUE => $created_before->ISO ); + } + if ( $ARGS{'CreatedAfter'} ) { + $created_after->Set( Format => 'unknown', Value => $ARGS{'CreatedAfter'} ); + $_->LimitCreated( OPERATOR => ">=", VALUE => $created_after->ISO ); + } +} + + diff --git a/rt/html/Approvals/Elements/ShowDependency b/rt/html/Approvals/Elements/ShowDependency new file mode 100644 index 000000000..417cad142 --- /dev/null +++ b/rt/html/Approvals/Elements/ShowDependency @@ -0,0 +1,85 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% my $approving = $Ticket->DependedOnBy(); +% if ($approving->Count) { +

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

    + + + + + +
      +<%PERL> +my %show; +while (my $link = $approving->Next()) { + next unless ($link->BaseURI->IsLocal()); + my $text = ''; + my $head = ''; + my $type = $link->BaseObj->Type; + my $dep = $m->scomp('ShowDependency', Ticket => $link->BaseObj, _seen => $_seen); + + if ($type eq 'approval') { + $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("Approval #[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject)); + $text .= $head; + $text .= $m->scomp('/Ticket/Elements/ShowCustomFields', Ticket => $link->BaseObj); + } elsif ($type eq 'ticket') { + $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("Ticket #[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject)); + $text .= $head; + $text .= $m->scomp('/Ticket/Elements/ShowSummary', Ticket => $link->BaseObj); + } else { + $head .= $m->scomp('/Elements/TitleBoxStart', title => loc("#[_1]: [_2]", $link->BaseObj->Id, $link->BaseObj->Subject)); + $text .= $head; + } + + $text .= $m->scomp('/Ticket/Elements/ShowHistory' , Ticket => $link->BaseObj, Collapsed => ($type ne 'ticket'), ShowTitle => 0, ShowHeaders => 0, ShowDisplayModes => 0, ShowTitleBarCommands => 0); + + $head .= $m->scomp('/Elements/TitleBoxEnd'); + $text .= $m->scomp('/Elements/TitleBoxEnd'); + $text .= $dep; + $text .= ''; + $show{$link->BaseObj->Id} = { + text => $text, + head => $head, + }; +} + +my $refer; +foreach my $id (sort keys %show) { + if ($_seen->{$id}++) { + $refer .= "" . $show{$id}{head} . ""; + next; + } + + $m->print($show{$id}{text}); +} +$m->print($refer); + + +
    + +% } +<%ARGS> +$Ticket +$_seen => {} + diff --git a/rt/html/Approvals/Elements/Tabs b/rt/html/Approvals/Elements/Tabs new file mode 100644 index 000000000..648ff7573 --- /dev/null +++ b/rt/html/Approvals/Elements/Tabs @@ -0,0 +1,34 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Tabs, + tabs => $tabs, + current_toptab => 'Approvals/', + current_tab => $current_tab, + Title => $Title &> + +<%ARGS> +$tabs => undef +$current_tab => undef +$Title => undef + diff --git a/rt/html/Approvals/index.html b/rt/html/Approvals/index.html new file mode 100644 index 000000000..b4156f344 --- /dev/null +++ b/rt/html/Approvals/index.html @@ -0,0 +1,66 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("My approvals") &> +<& /Approvals/Elements/Tabs, Title => loc("My approvals") &> + +<& /Elements/ListActions, actions => \@actions &> +
    +<& Elements/PendingMyApproval, %ARGS &> +<& /Elements/Submit &> +
    +<%init> + +my (@actions); +foreach my $arg ( keys %ARGS ) { + + next unless ( $arg =~ /Approval-(\d+)-Action/ ); + + my ( $notesval, $notesmsg ); + + my $ticket = LoadTicket($1); + + if ( $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ) { + my $notes = MIME::Entity->build( + Data => [ $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ] + ); + RT::I18N::SetMIMEEntityToUTF8($notes); # convert text parts into utf-8 + + my ( $notesval, $notesmsg ) = $ticket->Correspond( MIMEObj => $notes ); + if ($notesval) { + push ( @actions, loc("Approval #[_1]: Notes recorded",$ticket->Id )); + } else { + push ( @actions, loc("Approval #[_1]: Notes not recorded due to a system error",$ticket->Id )); + } + } + + my ($val, $msg); + if ( $ARGS{$arg} eq 'deny' ) { + ( $val, $msg ) = $ticket->SetStatus('rejected'); + } + elsif ( $ARGS{$arg} eq 'approve' ) { + ( $val, $msg ) = $ticket->SetStatus('resolved'); + } + push ( @actions, loc("Approval #[_1]: [_2]",$ticket->id, $msg )) if ($msg); +} + diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd new file mode 100644 index 000000000..ebf45df0f --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart new file mode 100644 index 000000000..c4e6c55bc --- /dev/null +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + +
    diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback new file mode 100644 index 000000000..93ac4c01b --- /dev/null +++ b/rt/html/Elements/Callback @@ -0,0 +1,65 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%once> +my (%cache, $check); + +<%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; +} + +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; + + + + $cache{$Page,$_CallbackName} = $callbacks; +} + +foreach my $comp (@$callbacks) { + $m->comp($comp, %ARGS) if $m->comp_exists($comp); +} +return(1); + +<%args> +$_CallbackName => 'Default' +$Page => undef + diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox new file mode 100644 index 000000000..ae3d765c2 --- /dev/null +++ b/rt/html/Elements/Checkbox @@ -0,0 +1,39 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +> + +<%ARGS> +$Name => undef +$Default => undef +$True => undef +$False => undef +$IsChecked => undef + + +<%INIT> +$IsChecked = + ($Default && $Default =~ /checked/i) + ? " CHECKED " : ""; +1; + diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket new file mode 100644 index 000000000..7e1025d0a --- /dev/null +++ b/rt/html/Elements/CreateTicket @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    +<&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&> [_1] +
    diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error new file mode 100644 index 000000000..dc44f125e --- /dev/null +++ b/rt/html/Elements/Error @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Callback, %ARGS, error => $error &> +<& /Elements/Header, Code => $Code, Why => $Why &> +<& /Elements/Tabs &> +<& /Elements/TitleBoxStart, class=> "error", title => $Title &> +<%$Why%> +
    + +<%$Details%> + +<& /Elements/TitleBoxEnd &> + + + + +<%args> +$Code => undef +$Details => undef +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why") + + +<%INIT> +my $error = "WebRT: $Why ($Details)"; + +# TODO: Log::Dispatch isn't UTF-8 safe. Autrijus needs to talk to dave rolsky about getting this fixed +if ($] >= 5.007001) { + require Encode; + Encode::_utf8_off($error); +} + +$RT::Logger->error($error); + +if ( $session{'SessionType'} eq 'REST' ) { + $r->content_type('text/plain'); + $m->out( "Error: " . $Why . "\n" ); + $m->out( $Details . "\n" ); + $m->abort(); +} + diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer new file mode 100644 index 000000000..5c833f886 --- /dev/null +++ b/rt/html/Elements/Footer @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if ($Menu) { +
    +% } +<& /Elements/Callback, %ARGS &> +
    +»|« <&|/l, $RT::VERSION &>RT [_1] from Best Practical Solutions, LLC. +
    +% 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)]); +
    +<%$d->Dump() %>
    +
    +% } +% if ($Menu) { +
    + + + +% } + + +% $m->abort(); + +<%ARGS> +$Debug => 0 +$Menu => 1 + diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket new file mode 100644 index 000000000..bb0c04dd1 --- /dev/null +++ b/rt/html/Elements/GotoTicket @@ -0,0 +1,24 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
     
    diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header new file mode 100644 index 000000000..0fd91a2e2 --- /dev/null +++ b/rt/html/Elements/Header @@ -0,0 +1,82 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + +<%$Title%> +% if ($Refresh > 0) { + +% } + + + + + + + + + + + + +
       +% if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) { +<&|/l&>Skip Menu | +<&|/l&>Preferences +<& /Elements/Callback, %ARGS &> +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +| <&|/l&>Logout +% } +
    +<&|/l, "".$session{'CurrentUser'}->Name."" &>Logged in as [_1] +% } else { +<&|/l&>Not logged in. +% } + +
    +<%INIT> + +$r->header_out('Pragma' => 'no-cache'); +$r->header_out('Cache-control' => 'no-cache'); + + +<%ARGS> +$Prefs => '/User/Prefs.html' +$Focus => 'focus' +$Title => undef +$Code => undef +$Refresh => 0 +$Why => undef +$BgColor => '#ffffff' +$ShowBar => 1 +$LoggedIn => 1 +$URL => undef + diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions new file mode 100644 index 000000000..ffa09e283 --- /dev/null +++ b/rt/html/Elements/ListActions @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if ($actions[0] ) { +<& /Elements/TitleBoxStart, title => loc('Results') &> +
      +% foreach my $action (@actions) { +% next unless ($action); +% my $skip = 0; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyRow', row => \$action, skip => \$skip, %ARGS); +% next if $skip; +
    • <%$action%>
    • +% } +
    +<& /Elements/TitleBoxEnd &> +
    +% } +<%init> +@actions = grep (/./,@actions); + +<%ARGS> +@actions => undef + diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login new file mode 100644 index 000000000..42c49c4af --- /dev/null +++ b/rt/html/Elements/Login @@ -0,0 +1,101 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%INIT> +if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { + $r->content_type("text/plain"); + $m->error_format("text"); + $m->out("RT/$RT::VERSION 401 Credentials required\n"); + $m->out("\n$Error\n") if $Error; + $m->abort; +} + + +<& /Elements/Callback, %ARGS, _CallbackName => 'Header' &> +<& /Elements/Header, Title => loc('Login'), Focus => 'user' &> + +
    +% if ($Error) { +<& /Elements/TitleBoxStart, title => loc('Error') &> +<% $Error %> +<& /Elements/TitleBoxEnd &> +% } +
    +<& /Elements/TitleBoxStart, width=> "40%", titleright => loc("RT [_1]", $RT::VERSION), title => loc('Login') , +contentbg=>"#cccccc" &> + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +
    + + + + + +
    <&|/l&>Username:
    <&|/l&>Password:
    + +
    + +%# Give callbacks a chance to add more control elements +<& /Elements/Callback, %ARGS &> + +<&/Elements/TitleBoxEnd&> +% # From mason 1.0.1 forward, this doesn't work. in fact, it breaks things. +% # But on Mason 1.15 it's fixed again, so we still use it. +% # The code below iterates through everything in the passed in arguments +% # Preserving all the old parameters +% # This would be easier, except mason is 'smart' and calls multiple values +% # arrays rather than multiple hash keys +% my $key; my $val; +% foreach $key (keys %ARGS) { +% if (($key ne 'user') and ($key ne 'pass')) { +% if (ref($ARGS{$key}) =~ /ARRAY/) { +% foreach $val (@{$ARGS{$key}}) { + +% } +% } +% else { + +% } +% } +% } +
    +% } +
    + +
    + +
    +
    +
    +
    +<&|/l, '2003'&>RT is © Copyright 1996-[_1] Jesse Vincent <jesse@bestpractical.com>. It is distributed under Version 2 of the GNU General Public License. + +<%ARGS> +$user => "" +$pass => undef +$goto => undef +$Error => undef + diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu new file mode 100644 index 000000000..963be13bf --- /dev/null +++ b/rt/html/Elements/Menu @@ -0,0 +1,84 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%# font size depends on level +% if ($level ge 3) { +% $size = $basesize-(6); +% } elsif ($level gt 0) { +% $size = $basesize-($level * 2); +% $padding = 2; +% } +% else { +% $size = $basesize; +% $padding = 5; +% } +
      +% my $sep=0; +% my $accesskey="1"; +% foreach $tab (sort keys %{$toptabs}) { +% my $current = $current_toptab || ""; +% my $path = $toptabs->{$tab}->{'path'} || ""; +% $path =~ s#/index.html$##gi; +% $current =~ s#/index.html$##gi; +% if ( $path eq $current) { +% $class="currenttopnav" +% } else { +% $class="topnav" +% } +% my $style=""; +% if ($sep) { +% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% } elsif ($level == 0 ) { +% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% } +% if ($toptabs->{$tab}->{'separator'}) { +% $sep=1; +% } else { +% $sep=0; +% } +
    • +<% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%> +%# Second-level items +%# if ($current_toptab eq $toptabs->{$tab}->{'path'}) { +%# commented out by jesse on 4 jan 2003 so that tickets/search and ticket/# can +%# both have menu items +% if ($toptabs->{$tab}->{'subtabs'}) { + <& /Elements/Menu, level => $level+1, + current_toptab => $toptabs->{$tab}->{'current_subtab'}, + toptabs => $toptabs->{$tab}->{'subtabs'} &>
    • +% } +%# } +% } +
    + +<%INIT> +my ($tab, $subtab, $class, $size, $padding); +my $basesize=16; + + +<%ARGS> +$current_toptab => "" +$toptabs => undef +$level => 0 + diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox new file mode 100644 index 000000000..64fdf38b7 --- /dev/null +++ b/rt/html/Elements/MessageBox @@ -0,0 +1,47 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%INIT> + +my ($message); + +if ($QuoteTransaction) { + my $transaction=RT::Transaction->new($session{'CurrentUser'}); + $transaction->Load($QuoteTransaction); + $message=$transaction->Content(Quote => 1); +} + +my $signature = ''; +if ($session{'CurrentUser'}->UserObj->Signature) { + $signature = "-- \n".$session{'CurrentUser'}->UserObj->Signature; +} + + +<%ARGS> +$QuoteTransaction => undef +$Name => 'Content' +$Default => '' +$Width => 72 + + diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests new file mode 100644 index 000000000..05ae62445 --- /dev/null +++ b/rt/html/Elements/MyRequests @@ -0,0 +1,78 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc("[_1] highest priority tickets I requested...", $rows), bodyclass=> '' &> + + + + + + + + +% my $i; +% while (my $Ticket = $MyTickets->Next) { +% $i++; + + + + + + + +% } +
    <&|/l&>#<&|/l&>Subject<&|/l&>Queue<&|/l&>Status<&|/l&>Owner
    +<%$Ticket->Id%> + + +<%$Ticket->Subject || loc('(no subject)')%> + + +<%$Ticket->QueueObj->Name%> + +% if ($Ticket->HasUnresolvedDependencies ) { +% if ($Ticket->HasUnresolvedDependencies( Type => 'approval' )) { +<&|/l&>(pending approval) +% } else { +<&|/l&>(pending other tickets) +% } +% } else { +<%loc($Ticket->Status)%> +% } + +<%$Ticket->OwnerObj->Name%> +
    +<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $rows = 10; +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->RowsPerPage($rows); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); + + diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets new file mode 100644 index 000000000..6e2ddc6c3 --- /dev/null +++ b/rt/html/Elements/MyTickets @@ -0,0 +1,81 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc("[_1] highest priority tickets I own...", $rows), bodyclass=> '' &> + + + + + + + + + +% my $i; +% while (my $Ticket = $MyTickets->Next) { +% next if $Ticket->HasUnresolvedDependencies( Type => 'approval' ); +% last if $i++ >= $rows; + + + + + + + +% } +
    <&|/l&>#<&|/l&>Subject<&|/l&>Queue<&|/l&>Status 
    +<%$Ticket->Id%> + + +<%$Ticket->Subject || loc('(no subject)')%> + + +<%$Ticket->QueueObj->Name%> + +% if ($Ticket->HasUnresolvedDependencies ) { +% if ($Ticket->HasUnresolvedDependencies( Type => 'approval' ) or +% $Ticket->HasUnresolvedDependencies( Type => 'code' )) { +<&|/l&>(pending approval) +% } else { +<&|/l&>(pending other tickets) +% } +% } else { +<%loc($Ticket->Status)%> +% } + +[<&|/l&>Update] +
    +<& /Elements/TitleBoxEnd &> + + +<%INIT> +my $rows = 10; +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitOwner(VALUE => $session{'CurrentUser'}->Id); +$MyTickets->LimitStatus(VALUE => "open"); +$MyTickets->LimitStatus(VALUE => "new"); +$MyTickets->RowsPerPage($rows); +$MyTickets->OrderBy(FIELD => 'Priority', ORDER => 'DESC'); + + diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout new file mode 100644 index 000000000..685317581 --- /dev/null +++ b/rt/html/Elements/PageLayout @@ -0,0 +1,99 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + +% foreach my $action (sort keys %{$topactions}) { + +% } + +
    <%$AppName%> + + <%$topactions->{"$action"}->{'html'} |n %> +
    + +%# Vertical menu + + + + +
    + <& /Elements/Menu, toptabs => $toptabs, current_toptab => $current_toptab &> + + + + + + + + + + + + + +<%ARGS> +$title => undef +$content => " " +$name => undef +$size => undef + diff --git a/rt/html/Elements/ShadedRow b/rt/html/Elements/ShadedRow new file mode 100644 index 000000000..8947fcd82 --- /dev/null +++ b/rt/html/Elements/ShadedRow @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + +<%ARGS> +$title => undef +$content => " " + diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch new file mode 100644 index 000000000..69541f801 --- /dev/null +++ b/rt/html/Elements/SimpleSearch @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    + +  + diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit new file mode 100644 index 000000000..2c35ca0f4 --- /dev/null +++ b/rt/html/Elements/Submit @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    + <%$title%> +
    + +% if ($actions) { +% my @actions; +% foreach my $action (sort keys %{$actions}) { +% if ($actions->{"$action"}->{'html'}) { +% push @actions, $actions->{"$action"}->{'html'}; +% } else { +% push @actions, "{$action}->{'path'}."\">".$actions->{$action}->{'title'}.""; +% } +% } +<% join(" | ", @actions) | n %> +% if ($subactions) { +% my @actions; +% foreach my $action (sort keys %{$subactions}) { +% push @actions, $subactions->{"$action"}->{'html'}; +% } +<% join(" | ", @actions) | n %> +% } +% } + +
    + +<%INIT> + + foreach my $tab (sort keys %{$toptabs}) { + if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + $toptabs->{$tab}->{"subtabs"} = $tabs; + $toptabs->{$tab}->{"current_subtab"} = $current_tab; + } + } + +if (! defined($AppName)) { + $AppName = loc("RT for [_1]", $RT::rtname); +} + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$title => $m->callers(-1)->path +$AppName => undef + diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch new file mode 100644 index 000000000..b1a67ab29 --- /dev/null +++ b/rt/html/Elements/Quicksearch @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> + + + + + + + + +<%PERL> +my $i; +while (my $queue = $Queues->Next) { + $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(); + + +% $i++; + + + + + +% } +
    <&|/l&>Queue<&|/l&>New<&|/l&>Open
    <%$queue->Name%><%$new%><%$open%>
    +<& /Elements/TitleBoxEnd &> + +<%INIT> +my $Queues = RT::Queues->new($session{'CurrentUser'}); +$Queues->UnLimit(); +my $Tickets = RT::Tickets->new($session{'CurrentUser'}); + diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh new file mode 100644 index 000000000..2b5376fee --- /dev/null +++ b/rt/html/Elements/Refresh @@ -0,0 +1,45 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my @refreshevery = qw(120 300 600 1200 3600 7200); + +<%ARGS> +$Name => undef +$Default => 0 + diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section new file mode 100644 index 000000000..691235846 --- /dev/null +++ b/rt/html/Elements/Section @@ -0,0 +1,34 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + +
    +<%$title%> +
    + +<%ARGS> +$title => undef + diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField new file mode 100644 index 000000000..47bc53211 --- /dev/null +++ b/rt/html/Elements/SelectAttachmentField @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%ARGS> +$Name => 'AttachmentField' + diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean new file mode 100644 index 000000000..8cf60dc33 --- /dev/null +++ b/rt/html/Elements/SelectBoolean @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => undef +$True => loc("is") +$Default => 'true' +$TrueVal => 1 +$FalseVal => 0 +$False => loc("isn't") + + +<%INIT> +my ($TrueDefault, $FalseDefault); +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +else { + $TrueDefault = "SELECTED"; +} + diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator new file mode 100644 index 000000000..e886cbe37 --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => undef +@Options => ( loc('contains'), loc("doesn't contain"), loc('is'), loc("isn't"), loc('less than'), loc('greater than')) +@Values => ('LIKE', 'NOT LIKE', '=', '!=', '<', '>') +$Default => undef + diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue new file mode 100644 index 000000000..60f65bcf2 --- /dev/null +++ b/rt/html/Elements/SelectCustomFieldValue @@ -0,0 +1,41 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Callback, %ARGS &> +% if ($CustomField->Type =~ /Select/i) { +% my $values = $CustomField->Values; + +% } +% else { + +% } +<%args> +$Name => undef +$CustomField =>undef + diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate new file mode 100644 index 000000000..5f169fc0a --- /dev/null +++ b/rt/html/Elements/SelectDate @@ -0,0 +1,48 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%init> +unless ((defined $Default) or + ($current <= 0)) { + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = + localtime($current); + $Default = sprintf("%04d-%02d-%02d %02d:%02d", + $year+1900,$mon+1,$mday, + $hour,$min); +} + +unless ($Name) { + $Name = $menu_prefix. "_Date"; +} + + +<%args> + +$ShowTime => undef +$menu_prefix=>'' +$current=>time +$Default => undef +$Name => undef + diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation new file mode 100644 index 000000000..ee26efeaa --- /dev/null +++ b/rt/html/Elements/SelectDateRelation @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => undef +$Default => undef +$Before => loc('Before') +$On => loc('On') +$After => loc('After') + diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType new file mode 100644 index 000000000..afb9a70e9 --- /dev/null +++ b/rt/html/Elements/SelectDateType @@ -0,0 +1,36 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%ARGS> +$Name => 'DateType' + diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator new file mode 100644 index 000000000..99c60d554 --- /dev/null +++ b/rt/html/Elements/SelectEqualityOperator @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => undef +@Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) +@Values => qw(< = > !=) +$Default => undef + diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups new file mode 100644 index 000000000..8f33c1eb3 --- /dev/null +++ b/rt/html/Elements/SelectGroups @@ -0,0 +1,29 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<& /Elements/SelectMatch, Name=> 'GroupOp' &> + diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType new file mode 100644 index 000000000..9ebefda14 --- /dev/null +++ b/rt/html/Elements/SelectLinkType @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => "LinkType" +$Default => undef + + +<%INIT> +# TODO handle Default + diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch new file mode 100644 index 000000000..d58a9633a --- /dev/null +++ b/rt/html/Elements/SelectMatch @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => undef +$Like => loc('contains') +$NotLike => loc("doesn't contain") +$True => loc('is') +$False => loc("isn't") +$Default => undef + +<%INIT> +my ($TrueDefault, $FalseDefault, $LikeDefault, $NotLikeDefault); +if ($Default && $Default !~ /true/i) { + $FalseDefault = "SELECTED"; +} +elsif ($Default && $Default !~ /false/i) { + $TrueDefault = "SELECTED"; +} +elsif ($Default && $Default !~ /notlike/i) { + $NotLikeDefault = "SELECTED"; +} +else { + $LikeDefault = "SELECTED"; +} + diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue new file mode 100644 index 000000000..a629b7bca --- /dev/null +++ b/rt/html/Elements/SelectNewTicketQueue @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +unless ($session{'create_in_queues'}) { + +@{$session{'create_in_queues'}} = (); +my $q=new RT::Queues($session{'CurrentUser'}); +$q->UnLimit; +while (my $queue=$q->Next) { + if ($queue->CurrentUserHasRight('CreateTicket')) { + my $ds = { Name => $queue->Name, Description => $queue->Description, id => $queue->id }; + push (@{$session{'create_in_queues'}}, $ds); + } +} +} + + + +<%ARGS> +$Name => 'Queue' +$Verbose => undef +$Default => undef + diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner new file mode 100644 index 000000000..04b078d20 --- /dev/null +++ b/rt/html/Elements/SelectOwner @@ -0,0 +1,59 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $Users = RT::Users->new($session{CurrentUser}); +my $object; + + +if ($TicketObj) { + $object = $TicketObj; +} +elsif ($QueueObj) { + $object = $QueueObj; +} +if ($object) { + $Users->WhoHaveRight(Right => 'OwnTicket', + Object => $object, + IncludeSystemRights => 1, + IncludeSuperusers => 1); +} else { + $Users->LimitToPrivileged; +} + + +<%ARGS> +$QueueObj => undef +$Name => undef +$Default => undef +$User => undef +$TicketObj => undef + diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue new file mode 100644 index 000000000..c45b9b532 --- /dev/null +++ b/rt/html/Elements/SelectQueue @@ -0,0 +1,59 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if ($Lite) { + +% } else { + +% } +<%ARGS> +$ShowNullOption => 1 +$ShowAllQueues => 1 +$Name => undef +$Verbose => undef +$Default => 0 +$Lite => 0 + + +<%INIT> + +my $q=new RT::Queues($session{'CurrentUser'}); +$q->UnLimit; + +my $d = new RT::Queue($session{'CurrentUser'}); +$d->Load($Default); + + diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage new file mode 100644 index 000000000..1bde71306 --- /dev/null +++ b/rt/html/Elements/SelectResultsPerPage @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +%# TODO: Better default handling + + + +<%INIT> +my @values = qw(0 10 25 50 100); +my @labels = (loc('Unlimited'), qw(10 25 50 100)); + +<%ARGS> + +$Name => undef +$Default => 50 + + diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder new file mode 100644 index 000000000..0ad999a7a --- /dev/null +++ b/rt/html/Elements/SelectSortOrder @@ -0,0 +1,41 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my @orders = qw (ASC DESC); +my @order_names = (loc('Ascending'), loc('Descending')); + + + +<%ARGS> +$Name => 'SortOrder' +$Default => 'ASC' + diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus new file mode 100644 index 000000000..2c1ffad39 --- /dev/null +++ b/rt/html/Elements/SelectStatus @@ -0,0 +1,37 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%ONCE> +my $queue = new RT::Queue($session{'CurrentUser'}); +my @status = $queue->StatusArray(); + +<%ARGS> +$Name => undef +$Default => undef + diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy new file mode 100644 index 000000000..1d0b3942a --- /dev/null +++ b/rt/html/Elements/SelectTicketSortBy @@ -0,0 +1,38 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my $tickets = new RT::Tickets($session{'CurrentUser'}); +my @sortfields = $tickets->SortFields(); + + +<%ARGS> +$Name => 'SortTicketsBy' +$Default => 'id' + diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes new file mode 100644 index 000000000..80aecac67 --- /dev/null +++ b/rt/html/Elements/SelectTicketTypes @@ -0,0 +1,34 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%ARGS> +$Name => 'TickType' +$Default => undef +@Types => qw(Approval Ticket) + diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers new file mode 100644 index 000000000..7ed3835b6 --- /dev/null +++ b/rt/html/Elements/SelectUsers @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<& /Elements/SelectMatch, Name=> 'UserOp' &> + diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType new file mode 100644 index 000000000..26de8f7b9 --- /dev/null +++ b/rt/html/Elements/SelectWatcherType @@ -0,0 +1,44 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +<%INIT> +my @types; +if ($Scope =~ 'queue') { + @types = qw(Cc AdminCc); +} +else { + @types = qw(Requestor Cc AdminCc); +} + +<%ARGS> +$Default=>undef +$Scope => 'ticket' +$Name => 'WatcherType' + diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie new file mode 100644 index 000000000..4d728ce70 --- /dev/null +++ b/rt/html/Elements/SetupSessionCookie @@ -0,0 +1,77 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%init> +my %cookies = CGI::Cookie->fetch(); +my %backends = ( + mysql => 'Apache::Session::MySQL', + Pg => 'Apache::Session::Postgres', + Oracle => 'Apache::Session::Oracle', +) unless $RT::WebSessionClass; +my $session_class = $RT::WebSessionClass || $backends{$RT::DatabaseType} || 'Apache::Session::File'; +my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm; + + eval { + tie %session, $session_class, + $SessionCookie || ( $cookies{'RT_SID'} ? $cookies{'RT_SID'}->value() : undef ), + $backends{$RT::DatabaseType} ? { + Handle => $RT::Handle->dbh, + LockHandle => $RT::Handle->dbh, + } : { + Directory => $RT::MasonSessionDir, + LockDirectory => $RT::MasonSessionDir, + }; + }; + if ($@) { + + # If the session is invalid, create a new session. + if ( $@ =~ /Object does not/i ) { + tie %session, $session_class, undef, + $backends{$RT::DatabaseType} ? { + Handle => $RT::Handle->dbh, + LockHandle => $RT::Handle->dbh, + } : { + Directory => $RT::MasonSessionDir, + LockDirectory => $RT::MasonSessionDir, + }; + undef $cookies{'RT_SID'}; + } + else { + die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; + } + } + + if ( !$cookies{'RT_SID'} ) { + my $cookie = new CGI::Cookie( + -name => 'RT_SID', + -value => $session{_session_id}, + -path => '/', + ); + $r->header_out('Set-Cookie', $cookie->as_string); + + } + return(); + +<%args> +$SessionCookie => '' + diff --git a/rt/html/Elements/ShadedBox b/rt/html/Elements/ShadedBox new file mode 100644 index 000000000..36b9cae7c --- /dev/null +++ b/rt/html/Elements/ShadedBox @@ -0,0 +1,33 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + +
    <%$title |n %>:<%$content |n %>
    +<%ARGS> +$title => undef +$content => " " + diff --git a/rt/html/Elements/ShadedInputRow b/rt/html/Elements/ShadedInputRow new file mode 100644 index 000000000..e9fb69e5f --- /dev/null +++ b/rt/html/Elements/ShadedInputRow @@ -0,0 +1,35 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    <%$title |n %>: + value="<%$content|h%>" SIZE=<%$size%>> +
    <%$title |n %>:<%$content |n %>
    + +% if ($Reset) { + +%} + + + +
    + + + + +  + +% if ($AlternateLabel) { +<%$AlternateCaption%> + +% } +<%$Caption%> +
    +<%ARGS> +$color => "#336699" +$Caption => undef +$AlternateCaption => undef +$AlternateLabel => undef +$Label => loc('Submit') +$Name => undef +$Reset => undef +$ResetLabel => loc('Reset') + diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs new file mode 100644 index 000000000..4db3849c6 --- /dev/null +++ b/rt/html/Elements/Tabs @@ -0,0 +1,82 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/PageLayout, + current_toptab => $current_toptab, + current_tab => $current_tab, + toptabs => $toptabs, + topactions => $topactions, + tabs => $tabs, + actions => $actions, + subactions => $subactions, + title => $Title +&> + +<%INIT> +my $action; +my $basetopactions = { + A => { html => $m->scomp('/Elements/CreateTicket') + }, + B => { html => $m->scomp('/Elements/SimpleSearch') + } + }; +my $basetabs = { A => { title => loc('Homepage'), + path => '', + }, + B => { title => loc('Tickets'), + path => 'Search/Listing.html' + }, + E => { title => loc('Configuration'), + path => 'Admin/' + }, + K => { title => loc('Preferences'), + path => 'User/Prefs.html' + }, + P => { title => loc('Approval'), + path => 'Approvals/' + }, + }; + +if (!defined $toptabs) { + $toptabs = $basetabs; +} +if (!defined $topactions) { + $topactions = $basetopactions; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', + topactions => $topactions, + toptabs => $toptabs, %ARGS); + + +<%ARGS> +$current_toptab => undef +$current_tab => undef +$toptabs => undef +$topactions => undef +$tabs => undef +$actions => undef +$subactions => undef +$Title => undef + diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd new file mode 100644 index 000000000..37f374466 --- /dev/null +++ b/rt/html/Elements/TitleBoxEnd @@ -0,0 +1,31 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    +<%ARGS> +$title => undef +$content => undef + + diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart new file mode 100644 index 000000000..02c76a75e --- /dev/null +++ b/rt/html/Elements/TitleBoxStart @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + +<& TicketHeaderCell , Attribute => 'id', Header => '#'&> +<& TicketHeaderCell , Attribute => 'Subject'&> +<& TicketHeaderCell , Attribute => 'Status'&> +<& TicketHeaderCell , Attribute => 'Queue'&> +<& TicketHeaderCell , Attribute => 'Owner'&> +<& TicketHeaderCell , Attribute => 'Priority'&> + + + +<& TicketHeaderCell , Attribute => 'Requestor(s)'&> +<& TicketHeaderCell , Attribute => 'Created'&> +<& TicketHeaderCell , Attribute => 'Told', Header => 'Last Contact'&> +<& TicketHeaderCell , Attribute => 'LastUpdated', Header => 'Last Updated'&> +<& TicketHeaderCell , Attribute => 'TimeLeft', Header => 'Left'&> + +%# loc('Last Notified'); diff --git a/rt/html/Search/Elements/TicketHeaderCell b/rt/html/Search/Elements/TicketHeaderCell new file mode 100644 index 000000000..5def9ea37 --- /dev/null +++ b/rt/html/Search/Elements/TicketHeaderCell @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%INIT> +my ($order,$curorder); + $Attribute =~ s/Obj->(Name|AsString|AgeAsString)//g; + if ($session{'tickets_sort_order'} =~ /^asc$/i) { + $order = 'DESC'; + $curorder = 'ASC'; + } else { + $order = 'ASC'; + $curorder = 'DESC'; + } +$Header = $Attribute unless ($Header); + + + +<%ARGS> +$Header => undef +$Attribute => undef + diff --git a/rt/html/Search/Elements/TicketRow b/rt/html/Search/Elements/TicketRow new file mode 100644 index 000000000..5d1ad209a --- /dev/null +++ b/rt/html/Search/Elements/TicketRow @@ -0,0 +1,55 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + +<%ARGS> +$Ticket => undef +$i => undef + diff --git a/rt/html/Search/Listing.html b/rt/html/Search/Listing.html new file mode 100644 index 000000000..508534549 --- /dev/null +++ b/rt/html/Search/Listing.html @@ -0,0 +1,112 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> +<& /Ticket/Elements/Tabs, + current_tab => 'Search/Listing.html', + Title => $title &> + +%if ($ticketcount && ! $ARGS{'HideResults'}) { +
    + <%$class ? "class=\"$class\"" : "class=\"titlebox\""|n%>> + + + <% $title_href && ""|n%><%$title |n %><% $title_href && "" |n%> + + + <%$class ? "class=\"$class\"": "class=\"titleboxright\""|n%>> + <%$titleright ? $titleright : ' ' |n %> +
    +<%ARGS> +$width => "100%" +$class => undef +$bodyclass => undef +$title_href => undef +$title => undef +$title_class => undef + +$titleright_href => undef +$titleright => undef +$contentbg => "#dddddd" +$color => "#336699" + diff --git a/rt/html/Elements/ViewUser b/rt/html/Elements/ViewUser new file mode 100644 index 000000000..657272496 --- /dev/null +++ b/rt/html/Elements/ViewUser @@ -0,0 +1,51 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, + title => "id."\">".loc("Tickets from [_1]", $name)."", + titleright=> "id."\">".loc("Comments about [_1]", $name)."" &> + + + + +
    +%while (my $w=$tickets->Next) { +<%$w->Id%>: <%$w->Subject%> (<%$w->Status%>)
    +%} +
    + <% ($User->Comments || loc("No comment entered about this user")) %> +
    +<& /Elements/TitleBoxEnd &> + +<%ARGS> +$User=>undef + + +<%INIT> +my $name=$User->RealName || $User->EmailAddress; + +my $tickets = new RT::Tickets($session{'CurrentUser'}); +$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $User->EmailAddress); + + + diff --git a/rt/html/NoAuth/Logout.html b/rt/html/NoAuth/Logout.html new file mode 100644 index 000000000..a4bb99772 --- /dev/null +++ b/rt/html/NoAuth/Logout.html @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + +RT: Logout + + + +

    <&|/l&>You have been logged out of RT. + +
    +
    +<&|/l&>You're welcome to login again + + +<%PERL> +if (defined %session) { + tied(%session)->delete; +} +$m->abort(); + + +<%ARGS> +$URL => $RT::WebPath."/" + diff --git a/rt/html/NoAuth/Reminder.html b/rt/html/NoAuth/Reminder.html new file mode 100644 index 000000000..35da66e61 --- /dev/null +++ b/rt/html/NoAuth/Reminder.html @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, title => loc('Password Reminder') &> + +<&|/l&>Not yet implemented. diff --git a/rt/html/NoAuth/images/back_home.gif b/rt/html/NoAuth/images/back_home.gif new file mode 100644 index 000000000..40b19c153 Binary files /dev/null and b/rt/html/NoAuth/images/back_home.gif differ diff --git a/rt/html/NoAuth/images/bplogo.gif b/rt/html/NoAuth/images/bplogo.gif new file mode 100644 index 000000000..e2cf49c42 Binary files /dev/null and b/rt/html/NoAuth/images/bplogo.gif differ diff --git a/rt/html/NoAuth/images/favicon.png b/rt/html/NoAuth/images/favicon.png new file mode 100644 index 000000000..ed1ee37ff Binary files /dev/null and b/rt/html/NoAuth/images/favicon.png differ diff --git a/rt/html/NoAuth/images/head_requestracker.gif b/rt/html/NoAuth/images/head_requestracker.gif new file mode 100644 index 000000000..73315e918 Binary files /dev/null and b/rt/html/NoAuth/images/head_requestracker.gif differ diff --git a/rt/html/NoAuth/images/rt.jpg b/rt/html/NoAuth/images/rt.jpg new file mode 100644 index 000000000..a137a932b Binary files /dev/null and b/rt/html/NoAuth/images/rt.jpg differ diff --git a/rt/html/NoAuth/images/space.gif b/rt/html/NoAuth/images/space.gif new file mode 100644 index 000000000..1d11fa9ad Binary files /dev/null and b/rt/html/NoAuth/images/space.gif differ diff --git a/rt/html/NoAuth/images/spacer.gif b/rt/html/NoAuth/images/spacer.gif new file mode 100644 index 000000000..5bfd67a2d Binary files /dev/null and b/rt/html/NoAuth/images/spacer.gif differ diff --git a/rt/html/NoAuth/images/squares_blue.gif b/rt/html/NoAuth/images/squares_blue.gif new file mode 100644 index 000000000..a28da5ce1 Binary files /dev/null and b/rt/html/NoAuth/images/squares_blue.gif differ diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css new file mode 100644 index 000000000..62c6d66ba --- /dev/null +++ b/rt/html/NoAuth/webrt.css @@ -0,0 +1,338 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +.nav2 { font-size: 10px; + white-space: nowrap} +.nav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +.currentnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 13px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +.topnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 16px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +.currenttopnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 16px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +.topactions { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +.subnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +.currentsubnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +.error { background-color: #ff0000; + background-position: left top; + vertical-align: top; + text-align: left; + } +.oldblue { background-color: #0066CC; + background-position: left top; + vertical-align: top; + text-align: left; + } +.blue { background-color: #4682B4; + background-position: left top; + vertical-align: top; + text-align: left; + } +.blueright { background-color: #4682B4; + background-position: left top; + vertical-align: top; + text-align: right; + } +.olddarkblue { background-color: #003399; + background-position: left top; + vertical-align: top; + text-align: left; + } +.darkblue { background-color: #000080; + background-position: left top; + vertical-align: top; + text-align: left; + } +.darkblueright { background-color: #000080; + background-position: left top; + vertical-align: top; + text-align: right; + } + +td { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + background-position: left top; + } +.black { background-color: #000000; + background-position: left top; + } +span.rtname { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 18px; + font-weight: normal; + color: #ffffff} +span.title { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 20px; + font-weight: bold; + color: #ffffff} +.header { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + font-weight: bold; + color: #0066CC} +.subheader { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + font-weight: bold; + color: #0066CC } +.value { font-weight: bold; } +.entry { font-weight: normal; } +.label { font-weight: normal; + text-align: right; } +.labeltop { font-weight: normal; + text-align: right; + vertical-align: top } +.productnav { font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 11px; + color: #000000; + text-align: center; + vertical-align: middle; + text-decoration: none} +.rtblue { background-color: #3399FF; + margin-top: 0.2em; + background-position: left top; + vertical-align: top } + + +.currenttab { margin: 0.2em; background: #336699; } +.othertab { margin: 0.2em; background: #efefef; } +.oddline { background-color : #ccccee; } + +UL.topnav LI :focus { text-decoration: underline; } + +TD.mainbody { + padding-top: 0.5em; + padding-left: 0em; + padding-right: 1em; + margin-left: 1em; + margin-right: 1em; +} + +th.ticketheader { font-size: 80%; + font-weight: bold; + color: #336699; + background: #cccccc; +} + +th.titlebox { + text-align: left; + padding-left: 0.5em; + padding-right: 0.5em; + margin-left: 0.5em; + margin-right: 0.5em; + border-top: solid black 1px; + border-bottom: solid black 1px; +} +th.titleboxright { + text-align: right; + padding-left: 0.5em; + padding-right: 0.5em; + margin-left: 0.5em; + margin-right: 0.5em; + border-top: solid black 1px; + border-bottom: solid black 1px; +} + +TD.titlebox { + padding-left: 1em; + padding-right: 1em; + padding-top: 1em; + padding-bottom: 1em; +} + +SPAN.message { + font-size: 100%; + font-family: Verdana, Arial, Helvetica, sans-serif; +} + + +BODY { + color: #000; + background: #FFFFFF; + font-family: "Helvetica", sans-serif; + margin-top: 0px; + margin-bottom: 0px; + margin-left: 0px; + margin-right: 0px; + border-top: 0px; + border-bottom: 0px; + border-left: 0px; + border-right: 0px; +} + + +TR.oddline { + background-color : #ffffff; +} + +TR.evenline { + background-color : #ccccee; +} + +H1, H2, H3 { + margin-top: 0.2em; + color: #336699; + font-family: "Helvetica", sans-serif; + + clear: both; +} + + +DIV.endmatter { margin-left: -7% } +.bpscredits {margin-top: 1em; + text-align: right; + color: #666666; + } + + +A { font-weight: bold; color: #000000; + } + +.currenttab { color: #ffffff;} +.othertab { color: #336699; } + +.inverse { color: #ffffff; } + + + +A:link IMG, A:visited IMG { border-style: none } +a:focus {text-decoration: underline } +A IMG { color: white } /* The only way to hide the border in NS 4.x */ + +a:link { text-decoration: none} +a:visited { text-decoration: none} +a:hover { text-decoration: underline} +/* a:focus { background-color: #ccccee } */ + +.hide { + display: none; + color: white; +} + +SPAN.date { font-size: 0.8em } + +span.title { font-size: 1.6em; + vertical-align: middle; + color: #ffffff;} +span.productname { font-size: 2em; + color: #0066cc;} +SPAN.titleboxtitle { + font-size: 1.1em; + color: #ffffff; + vertical-align: middle; + text-align: left; + } + +SPAN.titleboxright { + font-size: 0.8em; + color: #ffffff; + vertical-align: middle; + text-align: right; + } + +SPAN.attribution { + font-weight: bold; +} + +SPAN.label { font-size: 0.8em; +} + +BLOCKQUOTE { + font-style: italic; + /* color: #990; */ +} + +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; +} + + +.emphasized { + font-weight: bold +} + + +P.map-also { font-style: italic; margin-left: 15%; text-align: right } + +.oddline { + background-color : #ccccee; +} + +ul.topnav { + list-style: none; + margin-left: 0; + margin-right: 0.25em; + padding-left: 0.25em; + padding-bottom: 0; + padding-top:0; + margin-top: 0; + margin-bottom:0; +} + + +<%init> +$r->content_type('text/css'); +$r->header_out('Expires' ,'+30m'); + diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway new file mode 100644 index 000000000..8db80d5ff --- /dev/null +++ b/rt/html/REST/1.0/NoAuth/mail-gateway @@ -0,0 +1,49 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%ARGS> +$message +$queue => 1 +$action => "correspond" +$ticket => undef + +<%init> +use RT::Interface::Email; +my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway( %ARGS); + +<%flags> +inherit => undef # inhibit UTF8 conversion done in /autohandler + +% if ($status) { +ok +% if ( $Ticket->Id ) { +Ticket: <% $Ticket->Id %> +Queue: <% $Ticket->QueueObj->Name %> +Owner: <% $Ticket->OwnerObj->Name %> +Status: <% $Ticket->Status %> +Subject: <% $Ticket->Subject %> +Requestor: <% $Ticket->Requestors->MemberEmailAddressesAsString %> +% } +% } else { +not ok - <%$error%> +% } diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html new file mode 100644 index 000000000..df43cfa50 --- /dev/null +++ b/rt/html/Search/Bulk.html @@ -0,0 +1,217 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Bulk ticket update") &> +<& /Elements/Tabs, Title => loc("Bulk ticket update") &> + +<& /Elements/ListActions, actions => \@results &> + +

    + + + +%foreach my $col (@cols) { +% my $colalias = $col; +% $colalias =~ s/(Obj\-\>|)(Name|AsString)//; + + +%} + + +<%PERL> + +my $i; + + + +$session{'tickets'}->RedoSearch(); +while (my $Ticket = $session{'tickets'}->Next) { + $i++; + if ($i % 2) { + $bgcolor = "#dddddd"; + } + else { + $bgcolor = "#ffffff"; + } + + + +%# The ticket view is controlled by config.pm, WebOptions +%foreach my $col (@cols) { + +%} + +%} + + + +
    <&|/l&>Update<% loc($colalias) %> 
    +% if ($col eq 'id') { +<%$Ticket->Id()%> +% } +%else { +<% eval "\$Ticket->$col()" %>  +%} +
    + +
    + + +<& /Elements/TitleBoxStart, title => loc('Update selected tickets') &> + + + + + +
    + + + + + + + + + + + + + + + +
    <&|/l&>Make Owner: <& /Elements/SelectOwner, Name => "Owner" &> ( <&|/l&>Force change)
    <&|/l&>Add Requestor:
    <&|/l&>Remove Requestor:
    <&|/l&>Add Cc:
    <&|/l&>Remove Cc:
    <&|/l&>Add AdminCc:
    <&|/l&>Remove AdminCc:
    +
    + + + + + + + + + + + + + + + + + + + +
    <&|/l&>Make subject:
    <&|/l&>Make priority:
    <&|/l&>Make queue: <& /Elements/SelectQueue, Name => "Queue" &>
    <&|/l&>Make Status: <& /Elements/SelectStatus, Name => "Status" &>
    <&|/l&>Make date Starts: <& /Elements/SelectDate, Name => "Starts_Date", ShowTime => 0, Default => '' &>
    <&|/l&>Make date Started: <& /Elements/SelectDate, Name => "Started_Date", ShowTime => 0, Default => '' &>
    <&|/l&>Make date Told: <& /Elements/SelectDate, Name => "Told_Date", ShowTime => 0, Default => '' &>
    <&|/l&>Make date Due: <& /Elements/SelectDate, Name => "Due_Date", ShowTime => 0, Default => '' &>
    <&|/l&>Make date Resolved: <& /Elements/SelectDate, Name => "Resolved_Date", ShowTime => 0, Default => '' &>
    + +
    +<& /Elements/TitleBoxEnd&> +<& /Elements/TitleBoxStart, title => loc('Add comments or replies to selected tickets') &> + + + + + + +
    <&|/l&>Update Type: +
    <&|/l&>Subject:
    <&|/l&>Attach:
    <&|/l&>Message: + <& /Elements/MessageBox, Name=>"UpdateContent"&> +
    +<& /Elements/TitleBoxEnd &> + +<& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> +<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
    +<& /Ticket/Elements/BulkLinks &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit &> + + +
    +<%INIT> + +# Iterate through the ARGS hash and remove anything with a null value. +map ($ARGS{$_} =~ /^$/ && (delete $ARGS{$_}), keys %ARGS); + +my ($bgcolor, @results); +my @cols = qw(id Status Priority Subject QueueObj->Name OwnerObj->Name RequestorAddresses DueAsString ); + +Abort(loc("No search to operate on.")) unless ($session{'tickets'}); + + +my $do_comment_reply=0; +# Prepare for ticket updates +$ARGS{'UpdateContent'} =~ s/\r\n/\n/g; +chomp ($ARGS{'UpdateContent'}) ; + +if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature) { + $do_comment_reply=1; +} + +#Iterate through each ticket we've been handed +my @linkresults; + +while (my $Ticket = $session{'tickets'}->Next) { + $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); + next unless ($ARGS{"UpdateTicket".$Ticket->Id}); + $RT::Logger->debug ("Matched\n"); + #Update the basics. + my @basicresults = ProcessTicketBasics(TicketObj => $Ticket, ARGSRef => \%ARGS); + my @dateresults = ProcessTicketDates(TicketObj => $Ticket, ARGSRef => \%ARGS); + #Update the watchers + my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); + + #Update the links + $ARGS{'id'} = $Ticket; + $ARGS{$Ticket->Id.'-MergeInto'} = $ARGS{'Ticket-MergeInto'}; + $ARGS{$Ticket->Id.'-DependsOn'} = $ARGS{'Ticket-DependsOn'}; + $ARGS{'DependsOn-'.$Ticket->Id} = $ARGS{'DependsOn-Ticket'}; + $ARGS{$Ticket->Id.'-MemberOf'} = $ARGS{'Ticket-MemberOf'}; + $ARGS{'MemberOf-'.$Ticket->Id} = $ARGS{'MemberOf-Ticket'}; + $ARGS{$Ticket->Id.'-RefersTo'} = $ARGS{'Ticket-RefersTo'}; + $ARGS{'RefersTo-'.$Ticket->Id} = $ARGS{'RefersTo-Ticket'}; + @linkresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + delete $ARGS{'id'}; + delete $ARGS{$Ticket->Id.'-MergeInto'}; + delete $ARGS{$Ticket->Id.'-DependsOn'}; + delete $ARGS{'DependsOn-'.$Ticket->Id}; + delete $ARGS{$Ticket->Id.'-MemberOf'}; + delete $ARGS{'MemberOf-'.$Ticket->Id}; + delete $ARGS{$Ticket->Id.'-RefersTo'}; + delete $ARGS{'RefersTo-'.$Ticket->Id}; + + my @updateresults; + if ($do_comment_reply) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef => \%ARGS, Actions => \@updateresults); + } + my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults); + @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; + + @results = (@results, @tempresults); +} + + diff --git a/rt/html/Search/Elements/PickRestriction b/rt/html/Search/Elements/PickRestriction new file mode 100644 index 000000000..a6911df5a --- /dev/null +++ b/rt/html/Search/Elements/PickRestriction @@ -0,0 +1,141 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    + +<& /Elements/TitleBoxStart, title => loc('Refine search')&> + + +
      +
    • <&|/l&>Owner is <& /Elements/SelectBoolean, Name => "OwnerOp", + TrueVal=> '=', + FalseVal => '!=' +&> +<& /Elements/SelectOwner, Name => "ValueOfOwner" &> + +
    • +<&|/l&>Requestor email address +<& /Elements/SelectMatch, Name => "RequestorOp" &> + + +
    • +<&|/l&>Subject <& /Elements/SelectMatch, Name => "SubjectOp" &> + + +
    • <&|/l&>Queue <& /Elements/SelectBoolean, Name => "QueueOp" , + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> +<& /Elements/SelectQueue, Name => loc("ValueOfQueue") &> + + +
    • <&|/l&>Priority <& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> + + + +
    • +<& /Elements/SelectDateType, Name => 'DateType' &> +<& /Elements/SelectDateRelation, Name=>"DateOp" &> +<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> + +
    • <&|/l&>Ticket attachment + +<& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> +<& /Elements/SelectBoolean, Name => "AttachmentFieldOp", + True => loc("matches"), + False => loc("does not match"), + TrueVal => 'LIKE', + FalseVal => 'NOT LIKE' +&> + + +
    • <&|/l&>Status +<& /Elements/SelectBoolean, Name => "StatusOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' +&> +<& /Elements/SelectStatus, Name => "ValueOfStatus" &> + + +% while ( my $CustomField = $CustomFields->Next ) { + +
    • <% $CustomField->Name %> + <& /Elements/SelectCustomFieldOperator, Name => "CustomFieldOp". $CustomField->id, + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', FalseVal => '!=' &> + +<& /Elements/SelectCustomFieldValue, Name => "CustomField".$CustomField->id, + CustomField => $CustomField, + &> +% } + +
    + +<& /Elements/TitleBoxEnd &> + +<& /Elements/TitleBoxStart, title => loc('Ordering and sorting')&> + +
      + +
    • <&|/l&>Results per page <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", + Default => $session{'tickets_rows_per_page'} || '50' +&> + +
    • <&|/l&>Sort results by <& /Elements/SelectTicketSortBy, Name => "TicketsSortBy", + Default => $session{'tickets_sort_by'} +&> +<& /Elements/SelectSortOrder, Name => 'TicketsSortOrder', Default => $session{'tickets_sort_order'} &> + +
    • > <&|/l&>Don't show search results +
    • <& /Elements/Refresh, Name => 'RefreshSearchInterval' , Default => $session{'tickets_refresh_interval'} &> + +
    + + + + + + +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => loc('Search'), Name => 'Action'&> + +
    + + + <%INIT> +my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); + foreach ( $session{'tickets'}->RestrictionValues('Queue') ) { + # Gotta load up the $queue object, since queues get stored by name now. + my $queue = RT::Queue->new($session{'CurrentUser'}); + $queue->Load($_); + $CustomFields->LimitToQueue($queue->Id); + } + + $CustomFields->LimitToGlobal(); + + diff --git a/rt/html/Search/Elements/TicketHeader b/rt/html/Search/Elements/TicketHeader new file mode 100644 index 000000000..ed2f60e4e --- /dev/null +++ b/rt/html/Search/Elements/TicketHeader @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
     
    +% if (grep (/^$Attribute$/i, $session{'tickets'}->SortFields)) { + +% } else { +HREF="<% $RT::WebPath%>/Search/Listing.html?Bookmark=<%$session{'tickets'}->FreezeLimits()|u%>&TicketsSortBy=<%$Attribute%>&TicketsSortOrder=<%$curorder%>&RowsPerPage=<%$session{'tickets_rows_per_page'}%>"> +% } +<% loc($Header) %> + +% } else { +<% loc($Header) %> +% } +
    <%$Ticket->id%><%$Ticket->Subject%><%loc($Ticket->Status)%><%$Ticket->QueueObj->Name%><%$Ticket->Owner == $RT::Nobody->Id ? loc('Nobody') : $Ticket->OwnerObj->Name%><%$Ticket->Priority%>
    <%$Ticket->Requestors->MemberEmailAddressesAsString%><%$Ticket->CreatedObj->AgeAsString || '-'%><%$Ticket->ToldObj->AgeAsString || '-'%><%$Ticket->LastUpdatedObj->AgeAsString || '-'%><%$Ticket->TimeLeft%>
    +<& Elements/TicketHeader, %ARGS &> +% my $i; +%while (my $Ticket = $session{'tickets'}->Next) { +% $i++; +<& Elements/TicketRow, Ticket => $Ticket, i=> $i, %ARGS &> +%} +
    +
    + +<&|/l&>First page +   +% if ( $session{'tickets'}->FirstRow >= $session{'tickets_rows_per_page'}-1 ) { +<<&|/l&>Previous page +   +% } +% if ( $session{'tickets'}->FirstRow + $session{'tickets_rows_per_page'} < $ticketcount ) { +<&|/l&>Next page> +% } +%#  
    <&|/l&>Goto page
    +
    +
    + + + + + + +
    +(<&|/l, ($session{'tickets'}->FirstRow+1), ($session{'tickets'}->FirstRow() + $session{'tickets'}->RowsPerPage() ) &>[_1] - [_2] shown) + + +<&|/l&>Update all these tickets at once + +
    + +% } + + + + + +
    +<& /Elements/TitleBoxStart, title => loc('Current search criteria')&> + +%my %restrictions=$session{'tickets'}->DescribeRestrictions(); +%foreach my $row (keys %restrictions){ +<%$restrictions{"$row"}%> [<&|/l&>delete]
    +%} +
    +
    +<&|/l&>Bookmarkable URL for this search +<& /Elements/TitleBoxEnd&> +
    + +<& Elements/PickRestriction, %ARGS &> + +
    + +<%INIT> + +my ($title, $ticketcount); +$session{'i'}++; +if ($session{'tickets'}) { + if ($ARGS{'DeleteRestriction'}) { + $session{'tickets'}->DeleteRestriction($ARGS{'DeleteRestriction'}); + } + if ( ($ARGS{'ClearRestrictions'}) || ($ARGS{'NewSearch'}) ) { + $session{'tickets'}->ClearRestrictions; + } +} + ProcessSearchQuery(ARGS=>\%ARGS); + $session{'tickets'}->RedoSearch(); + if ( $session{'tickets'}->DescribeRestrictions()) { + $ticketcount = $session{tickets}->CountAll(); + $title = loc('Found [quant,_1,ticket]', $ticketcount); + } else { + $title = loc("Find tickets"); + } + +<%CLEANUP> +$session{'tickets'}->PrepForSerialization(); + diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler new file mode 100644 index 000000000..4bebbe565 --- /dev/null +++ b/rt/html/SelfService/Attachment/dhandler @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%init> +$m->comp('/Ticket/Attachment/dhandler', %ARGS); +$m->abort; + diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html new file mode 100644 index 000000000..b9b2ac672 --- /dev/null +++ b/rt/html/SelfService/Closed.html @@ -0,0 +1,27 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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 new file mode 100644 index 000000000..7bbc88a65 --- /dev/null +++ b/rt/html/SelfService/Create.html @@ -0,0 +1,80 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& Elements/Header, Title => loc("Create a ticket") &> + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +<&|/l&>Queue: + +<& /Elements/SelectNewTicketQueue, Verbose => 'True' &> +
    +<&|/l&>Requestors: + + +
    +<&|/l&>Cc: + + +
    +<&|/l&>Subject: + + +
    +<&|/l&>Attach file: + + +
    +<&|/l&>Describe the issue below:
    +<& /Elements/MessageBox &> +
    +<& /Elements/Submit, Label => loc("Create ticket")&> + + +
    diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html new file mode 100644 index 000000000..fc3fcb289 --- /dev/null +++ b/rt/html/SelfService/Display.html @@ -0,0 +1,141 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@results &> + + + + + + +
    + <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + + <& /Elements/TitleBoxStart, title => loc("Dates"), + title_class=> 'inverse', + color => "#663366" &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
    + + + +<& /Ticket/Elements/ShowHistory, Ticket => $Ticket&> + + + +<%INIT> + +my ( $field, @results ); + +# {{{ Load the ticket +#If we get handed two ids, mason will make them an array. bleck. +# We want teh first one. Just because there's no other sensible way +# to deal +my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id); + +my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); +if ( $id[0] eq 'new' ) { + + # {{{ Create a new ticket + + my $Queue = new RT::Queue( $session{'CurrentUser'} ); + unless ( $Queue->Load( $ARGS{'Queue'} ) ) { + $m->comp( 'Error.html', Why => loc('Queue not found') ); + $m->abort; + } + + unless ( $Queue->CurrentUserHasRight('CreateTicket') ) { + $m->comp( 'Error.html', + 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 ); + + # }}} +} +else { + unless ( $Ticket->Load( $id[0] ) ) { + $m->comp( 'Error.html', + Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + $m->abort(); + } +} + +# }}} + +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'} ne $Ticket->Status ) ) { + ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); + push @results, "$msg"; +} + +ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@results, + TicketObj => $Ticket ); + +my $Transactions = $Ticket->Transactions; + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket new file mode 100644 index 000000000..71da8c115 --- /dev/null +++ b/rt/html/SelfService/Elements/GotoTicket @@ -0,0 +1,24 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
     
    diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header new file mode 100644 index 000000000..6ad137999 --- /dev/null +++ b/rt/html/SelfService/Elements/Header @@ -0,0 +1,25 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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 new file mode 100644 index 000000000..95ede0811 --- /dev/null +++ b/rt/html/SelfService/Elements/MyRequests @@ -0,0 +1,62 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/TitleBoxStart, title => $title &> + + + + + + + +% while (my $Ticket = $MyTickets->Next) { + + + +% } +
    <&|/l&>Subject<&|/l&>Status<&|/l&>Owner
    +<%$Ticket->Id%>: <%$Ticket->Subject%> + +<%$Ticket->Status%> + +<%$Ticket->OwnerObj->Name%> +
    +<& /Elements/TitleBoxEnd &> + + +<%INIT> +$title ||= loc("My [_1] tickets", $friendly_status); +my $MyTickets; +$MyTickets = new RT::Tickets ($session{'CurrentUser'}); +$MyTickets->LimitWatcher(TYPE => 'Requestor', VALUE => $session{'CurrentUser'}->EmailAddress); + +foreach my $status (@status) { + + $MyTickets->LimitStatus(VALUE => $status); +} + +<%ARGS> +$title => undef +$friendly_status => loc('open') +@status => ('open', 'new', 'stalled') + diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs new file mode 100644 index 000000000..efab86676 --- /dev/null +++ b/rt/html/SelfService/Elements/Tabs @@ -0,0 +1,64 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/PageLayout, + current_toptab => $current_toptab, + current_tab => $current_tab, + toptabs => $tabs, + topactions => $actions, + title => $Title +&> + +<%INIT> + +if ($Title) { +$Title = loc ("RT Self Service") . " / " . $Title; +} else { +$Title = loc ("RT Self Service"); + +} +my ($tab); +my $tabs = { A => { title => loc('Open tickets'), + path => 'SelfService/', + }, + B => { title => loc('Closed tickets'), + path => 'SelfService/Closed.html', + }, + C => { title => loc('New ticket'), + path => 'SelfService/Create.html' + }, + Z => { title => loc('Preferences'), + path => 'SelfService/Prefs.html' + } + }; +my $actions = { + B => { html => $m->scomp('GotoTicket') + } + }; + +<%ARGS> +$Title => undef +$current_toptab => undef +$current_tab => undef + + diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html new file mode 100644 index 000000000..ac93aceff --- /dev/null +++ b/rt/html/SelfService/Error.html @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('Error') &> +

    <%loc('Error')%>

    +<& /Elements/TitleBoxStart, title => $Title &> +<%$Why%> +
    + +<%$Details%> + +<& /Elements/TitleBoxEnd &> + + + + +<%args> +$Code => undef +$Details => undef +$Title => loc("RT Error") +$Why => loc("the calling component did not specify why") + + +<%INIT> +$RT::Logger->error("WebRT: $Why ($Details)"); + diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html new file mode 100644 index 000000000..3bbb9b913 --- /dev/null +++ b/rt/html/SelfService/Prefs.html @@ -0,0 +1,68 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => loc('Preferences') &> + +<& /Elements/ListActions, actions => \@results &> +
    + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<& /Elements/TitleBoxStart, title => loc('Change password') &> +<&|/l&>New password: +<&|/l&>Confirm: +<& /Elements/TitleBoxEnd &> +
    +% } +<& /Elements/Submit &> +
    + + +<%INIT> +my @results; + +if ($NewPass1) { + if ($NewPass1 ne $NewPass2) { + push (@results, "Passwords did not match."); + } + else { + my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetPassword($NewPass1); + push (@results, "Password: ".$msg); + } +} +if ($Signature) { + $Signature =~ s/(\r\n|\r)/\n/g; + if ($Signature ne $session{'CurrentUser'}->UserObj->Signature) { + my ($val, $msg)=$session{'CurrentUser'}->UserObj->SetSignature($Signature); + push (@results, "Signature: ".$msg); + } +} +#A hack to make sure that session gets rewritten. + +$session{'i'}++; + + +<%ARGS> +$Signature => undef +$NewPass1 => undef +$NewPass2 => undef + diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html new file mode 100644 index 000000000..9ff31775f --- /dev/null +++ b/rt/html/SelfService/Update.html @@ -0,0 +1,61 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &> + + +
    + + +<&|/l&>Status: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
    +<&|/l&>Subject:
    +<&|/l&>Attach:
    +<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> +
    + + +<& /Elements/Submit &> +
    + + + +<%INIT> + +my $Ticket = LoadTicket($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') ); + + + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef + diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html new file mode 100644 index 000000000..71dc1156e --- /dev/null +++ b/rt/html/SelfService/index.html @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /SelfService/Elements/Header, Title => undef &> + +<& /SelfService/Elements/MyRequests &> diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler new file mode 100644 index 000000000..e0f00f57a --- /dev/null +++ b/rt/html/Ticket/Attachment/dhandler @@ -0,0 +1,68 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%perl> + my ($ticket, $trans,$attach, $filename); + my $arg = $m->dhandler_arg; # get rest of path + if ($arg =~ '^(\d+)/(\d+)') { + $trans = $1; + $attach = $2; + } + else { + Abort("Corrupted attachment URL."); + } + my $AttachmentObj = new RT::Attachment($session{'CurrentUser'}); + $AttachmentObj->Load($attach) || Abort("Attachment '$attach' could not be loaded"); + + + unless ($AttachmentObj->id) { + Abort("Bad attachment id. Couldn't find attachment '$attach'\n"); + } + unless ($AttachmentObj->TransactionId() == $trans ) { + Abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->TransactionId() ."\n"); + + } + + my $content_type = $AttachmentObj->ContentType || 'text/plain'; + + unless ($RT::TrustHTMLAttachments) { + $content_type = 'text/plain' if ($content_type =~ /^text\/html/i); + } + + if (my $enc = $AttachmentObj->OriginalEncoding) { + # normalize Encode.pm convention with IANA ones + $enc = 'big5' if $enc eq 'big5-eten'; + $enc = 'utf-8' if $enc eq 'utf8'; + $content_type .= ";charset=$enc"; + } + + # unless ($RT::TrustMIMEAttachments) { + # $content_type = 'application/octet-stream'; + # } + + $r->content_type( $content_type ); + $m->clear_buffer(); + $m->out($AttachmentObj->OriginalContent); + $m->abort; + + diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html new file mode 100644 index 000000000..5b8c908a1 --- /dev/null +++ b/rt/html/Ticket/Create.html @@ -0,0 +1,257 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Create a new ticket") &> +<& /Elements/Tabs, + current_toptab => "Ticket/Create.html", + Title => loc("Create a new ticket") &> +
    + + + + +[<&|/l&>Show basics] [<&|/l&>Show details] +
    +<& /Elements/TitleBoxStart, contentbg => "#cccccc", title => loc("Create a new ticket") &> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +% if (exists $session{'Attachments'}) { + + + + +% } # end of if + + + + + + + + + +
    <&|/l&>Queue<% $QueueObj->Name %> + +<&|/l&>Status: + +<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new' &> + +<&|/l&>Owner: + +<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &> +
    +<&|/l&>Requestors: + + +
    +<&|/l&>Cc: + +>
    + +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people will receive future updates.) +
    +<&|/l&>Admin Cc: + +>
    + +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people will receive future updates.) +
    +<&|/l&>Subject: + + +
    +<& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &> +
    +<&|/l&>Attached file: + +<&|/l&>Check box to delete
    +% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<%$attach_name%>
    +% } # end of foreach +
    +<&|/l&>Attach file: + + + +
    +<&|/l&>Describe the issue below:
    +% if (exists $ARGS{Content}) { +<& /Elements/MessageBox, Default => $ARGS{Content} &> +% } else { +<& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> +%} + +
    +
    +
    +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc("Create")&> + +










    +










    +










    +










    +










    + + + [<&|/l&>Show basics] [<&|/l&>Show details] +
    + + + + + + +
    + + <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_class=> 'inverse', + color => "#993333" &> + + + + + +
    <&|/l&>Priority:
    <&|/l&>Final Priority:
    <&|/l&>Time Worked:>
    <&|/l&>Time Left:>
    +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc("Dates"), + title_class=> 'inverse', + color => "#663366" &> + + + + +
    <&|/l&>Starts:>
    <&|/l&>Due:>
    +<& /Elements/TitleBoxEnd &> +
    +
    +<& /Elements/TitleBoxStart, title => loc('Relationships'), + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + +<&|/l&>(Enter ticket ids or URLs, seperated with spaces) + + + + + + + + + +
    <&|/l&>Depends on>
    <&|/l&>Depended on by>
    <&|/l&>Parents>
    <&|/l&>Children>
    <&|/l&>Refers to>
    <&|/l&>Referred to by>
    +<& /Elements/TitleBoxEnd &> +
    + +
    +<& /Elements/Submit, Label => loc("Create") &> +
    +









    +










    +










    +










    +










    + +<%INIT> +my $QueueObj = new RT::Queue($session{'CurrentUser'}); +$QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); +my $CFs = $QueueObj->CustomFields(); + +# {{{ deal with deleting uploaded attachments +foreach my $key (keys %ARGS) { + if ($key =~ m/^DeleteAttach-(.+)$/) { + delete $session{'Attachments'}{$1}; + } + $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; +} + +# {{{ 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 }; +} +# }}} + +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'id'} eq 'new') { + delete $session{'Attachments'}; +} + + +# }}} + +if ((!exists $ARGS{'AddMoreAttach'}) && ($ARGS{'id'} eq 'new')) { # new ticket? + $m->comp('Display.html', %ARGS); + $m->abort(); +} + + +<%ARGS> +$DependsOn => undef +$DependedOnBy => undef +$MemberOf => undef +$QuoteTransaction => undef +$Queue => undef + diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html new file mode 100644 index 000000000..cf32dce9d --- /dev/null +++ b/rt/html/Ticket/Display.html @@ -0,0 +1,116 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, + Title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => 'Ticket/Display.html?id='.$Ticket->id, + Title => loc("#[_1]: [_2]", $Ticket->Id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@Actions &> + +<& /Ticket/Elements/ShowSummary, Ticket => $Ticket &> + + +
    +<& /Ticket/Elements/ShowHistory , + Ticket => $Ticket, + Collapsed => $ARGS{'Collapsed'}, + ShowHeaders => $ARGS{'ShowHeaders'} &> + + +<%ARGS> +$id => undef +$Create => undef +$ShowHeaders => undef +$Collapsed => undef + + +<%INIT> + my ($linkid, $message, $tid, $Ticket, @Actions); + +$Ticket = new RT::Ticket($session{'CurrentUser'}); + +unless ($id) { + Abort('No ticket specified'); +} + +if ($ARGS{'id'} eq 'new') { + # {{{ Create a new ticket + + my $Queue = new RT::Queue($session{'CurrentUser'}); + unless ($Queue->Load($ARGS{'Queue'})) { + Abort('Queue not found'); + } + + unless ($Queue->CurrentUserHasRight('CreateTicket')) { + Abort('You have no permission to create tickets in that queue.'); + } + ($Ticket, @Actions) = + CreateTicket(Attachments => $session{'Attachments'}, %ARGS); + delete $session{'Attachments'}; + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view newly created ticket #".$Ticket->id."."); + } + # }}} +} + +else { + $Ticket = LoadTicket($ARGS{'id'}); + unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); + } + + +if (defined $ARGS{'Action'}) { + if ($ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/) { + my $action = $1; + my ($res, $msg)=$Ticket->$action(); + push(@Actions, $msg); + } +} + + if ( $ARGS{'UpdateContent'} ) { + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + if ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + ProcessUpdateMessage( ARGSRef => \%ARGS, + Actions => \@Actions, + TicketObj => $Ticket ); + delete $session{'Attachments'}; + } + } +#Process status updates +my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$Ticket); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + +push (@Actions, @BasicActions, @results); +} + + + + + diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers new file mode 100644 index 000000000..e9f651593 --- /dev/null +++ b/rt/html/Ticket/Elements/AddWatchers @@ -0,0 +1,97 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
    +<%$msg%>
    + +<&|/l&>Add new watchers:
    + + +% if ($Users and $Users->Count) { + +% while (my $u = $Users->Next ) { + +% } +% } + +% if ($Groups and $Groups->Count) { + +% while (my $g = $Groups->Next ) { + +% } +% } + + + + + +
    +<&|/l&>Type + +<&|/l&>Username +
    <&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$u->PrincipalId &><%$u->Name%> (<%$u->RealName%>)
    +<&|/l&>Type + +<&|/l&>Group +
    <&/Elements/SelectWatcherType, Name => "Ticket-AddWatcher-Principal-".$g->PrincipalId, Scope => 'queue' &><%$g->Name%> (<%$g->Description%>)
    +<&|/l&>Type + +<&|/l&>Email +
    +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail1" &> + + +
    +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail2" &> + + +
    +<&/Elements/SelectWatcherType, Name => "WatcherTypeEmail3" &> + + +
    + +<%INIT> +my ($msg, $Users, $Groups); + +if ($UserString) { + $Users = RT::Users->new($session{'CurrentUser'}); + $Users->Limit(FIELD => $UserField, VALUE => $UserString, OPERATOR => $UserOp); + } + +if ($GroupString) { + $Groups = RT::Groups->new($session{'CurrentUser'}); + $Groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'UserDefined'); + $Groups->Limit(FIELD => $GroupField, VALUE => $GroupString, OPERATOR => $GroupOp); + } + + + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef + diff --git a/rt/html/Ticket/Elements/BulkLinks b/rt/html/Ticket/Elements/BulkLinks new file mode 100644 index 000000000..e6b9cd54f --- /dev/null +++ b/rt/html/Ticket/Elements/BulkLinks @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <&|/l&>Merge into: <&|/l&>(only one ticket)
    <&|/l&>Depends on:
    <&|/l&>Depended on by:
    <&|/l&>Parents:
    <&|/l&>Children:
    <&|/l&>Refers to:
    <&|/l&>Referred to by:
    diff --git a/rt/html/Ticket/Elements/EditBasics b/rt/html/Ticket/Elements/EditBasics new file mode 100644 index 000000000..5d66b1fc1 --- /dev/null +++ b/rt/html/Ticket/Elements/EditBasics @@ -0,0 +1,79 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + +
    + + + +
    <&|/l&>Subject: + +
    +
    + + + + + + + +
    + <& /Elements/ShadedBox, + title => loc('Status'), + content => $SelectStatus &> + + <& /Elements/ShadedBox, + title => loc('Time Worked'), + content => "TimeWorked."\" SIZE=5>" &> + + <& /Elements/ShadedBox, + title => loc('Time Left'), + content => "TimeLeft."\" SIZE=5>" +&> + + <& /Elements/ShadedBox, + title => loc('Priority'), + content => "Priority."\" SIZE=3>" &> + + <& /Elements/ShadedBox, + title => loc('Final Priority'), + content => "FinalPriority."\" SIZE=3>" &> + + <& /Elements/ShadedBox, + title => loc('Queue'), + content => "$SelectQueue" &> +
    +
    + +<%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', Default=> $TicketObj->Status); +my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); + + +<%ARGS> + +$TicketObj => undef + diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField new file mode 100644 index 000000000..1fc7d4388 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomField @@ -0,0 +1,70 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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 ($CustomField->Type =~ /^Select/) { + + +% } +<%ARGS> +$TicketObj => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols=> 15 +$Default => undef + diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields new file mode 100644 index 000000000..6b2738965 --- /dev/null +++ b/rt/html/Ticket/Elements/EditCustomFields @@ -0,0 +1,74 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + +
    + + +% my @entry_fields; +% my $i; +% my $cfcount = $CustomFields->Count; +% $cfcount++ if ($cfcount % 2) ; # if we have an odd number of +% #custom fields, fudge it so we know where to put in the table break +% while (my $CustomField = $CustomFields->Next()) { +% if ($cfcount == 2 * $i) { +
    +
    + +% } +% $i++; + + + + +% } +
    + <%$CustomField->Name%>
    + <%$CustomField->FriendlyType%> +
    <& EditCustomField, TicketObj => $TicketObj, CustomField => $CustomField, NamePrefix => $NamePrefix &>
    +
    + +<%INIT> +my $CustomFields; +my $NamePrefix; + +if ($TicketObj) { + $CustomFields = $TicketObj->QueueObj->CustomFields(); + $NamePrefix = "Ticket-".$TicketObj->Id."-CustomField-"; + +} else { + $CustomFields = $QueueObj->CustomFields(); + $NamePrefix = "CustomField-"; +} + + + + +<%ARGS> +$TicketObj => undef +$QueueObj => undef + diff --git a/rt/html/Ticket/Elements/EditDates b/rt/html/Ticket/Elements/EditDates new file mode 100644 index 000000000..1f3bf1b49 --- /dev/null +++ b/rt/html/Ticket/Elements/EditDates @@ -0,0 +1,53 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + + +
    <&|/l&>Starts:<& /Elements/SelectDate, menu_prefix => 'Starts', current => 0 &> + (<% $TicketObj->StartsObj->AsString %>)
    <&|/l&>Started:<& /Elements/SelectDate, menu_prefix => 'Started', current => 0 &> (<%$TicketObj->StartedObj->AsString %>)
    + <&|/l&>Last Contact: + + <& /Elements/SelectDate, menu_prefix => 'Told', current => 0 &> (<% $TicketObj->ToldObj->AsString %>) +
    <&|/l&>Due: + <& /Elements/SelectDate, menu_prefix => 'Due', current => 0 &> (<% $TicketObj->DueObj->AsString %>) +
    +<%ARGS> +$TicketObj => undef + + diff --git a/rt/html/Ticket/Elements/EditLinks b/rt/html/Ticket/Elements/EditLinks new file mode 100644 index 000000000..7a522dda6 --- /dev/null +++ b/rt/html/Ticket/Elements/EditLinks @@ -0,0 +1,150 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + +
    +

    <&|/l&>Current Relationships

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <&|/l&>(Check box to delete)
    <&|/l&>Depends on: +% while (my $link = $Ticket->DependsOn->Next) { +% my $member = $link->TargetObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
    +% } +
    <&|/l&>Depended on by: +% while (my $link = $Ticket->DependedOnBy->Next) { +% my $member = $link->BaseObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
    +% } +
    <&|/l&>Parents: +% while (my $link = $Ticket->MemberOf->Next) { +% my $member = $link->TargetObj; + + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
    +% } +
    <&|/l&>Children: +% while (my $link = $Ticket->Members->Next) { + +% my $member = $link->BaseObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> + [<%$member->Status%>]
    +% } +
    <&|/l&>Refers to: +% while (my $link = $Ticket->RefersTo->Next) { + +% if ($link->TargetURI->IsLocal) { +% my $member = $link->TargetObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { + <%$link->TargetURI->Resolver->AsString%>
    +% } +%} +
    <&|/l&>Referred to by: +% while (my $link = $Ticket->ReferredToBy->Next) { + +% if ($link->BaseURI->IsLocal) { +% my $member = $link->BaseObj; + <%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
    +% } else { + <%$link->BaseURI->Resolver->AsString%>
    +%} +% } +
    + +
    +

    <&|/l&>New Relationships

    +<&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <&|/l&>Merge into: <&|/l&>(only one ticket)
    <&|/l&>Depends on:
    <&|/l&>Depended on by:
    <&|/l&>Parents:
    <&|/l&>Children:
    <&|/l&>Refers to:
    <&|/l&>Referred to by:
    +
    + + + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople new file mode 100644 index 000000000..1ab8f4ace --- /dev/null +++ b/rt/html/Ticket/Elements/EditPeople @@ -0,0 +1,68 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + +
    + +

    <&|/l&>New watchers

    +<&|/l&>Find people whose
    +<& /Elements/SelectUsers &> + +
    +<&|/l&>Find group whose
    +<& /Elements/SelectGroups &> + + +<& AddWatchers, Ticket => $Ticket, UserString => $UserString, + UserOp => $UserOp, UserField => $UserField, + GroupString => $GroupString, GroupOp => $GroupOp, + GroupField => $GroupField &> +
    +

    <&|/l&>Owner

    +<&|/l&>Owner: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id &> +

    <&|/l&>Current watchers

    +<&|/l&>(Check box to delete)
    + +<&|/l&>Requestors: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Requestors &> + +<&|/l&>Cc: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->Cc &> + +<&|/l&>Administrative Cc: +<& EditWatchers, TicketObj => $Ticket, Watchers => $Ticket->AdminCc &> + +
    + +<%ARGS> +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/EditWatchers b/rt/html/Ticket/Elements/EditWatchers new file mode 100644 index 000000000..145071cec --- /dev/null +++ b/rt/html/Ticket/Elements/EditWatchers @@ -0,0 +1,52 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +<%INIT> +my $Members = $Watchers->MembersObj; + +<%ARGS> +$TicketObj => undef +$Watchers => undef + + + + diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments new file mode 100644 index 000000000..22b60d11b --- /dev/null +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -0,0 +1,76 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if (keys %documents) { +<& /Elements/TitleBoxStart, title => loc('Attachments'), + title_class=> 'inverse', + color => "#336699" &> + +% foreach my $key (keys %documents) { +% my $fontsize='size="-1"'; + +<%$key%>
    +
      +% foreach my $rev (@{$documents{$key}}) { + +<%PERL> +my $size = $rev->ContentLength; + +if ($size) { + if ($size > 1024) { + $size = int($size/102.4)/10 . "k"; + } + else { + $size = $size ."b"; + } + + + +
    • > + <%$rev->CreatedAsString%> (<% $size %>)
    • +% } +% $fontsize='size="-2"'; +% } +
    + +% } +<& /Elements/TitleBoxEnd &> +
    +% } + +<%INIT> +my %documents; +my $transactions = $Ticket->Transactions(); +while (my $trans = $transactions->Next()) { + my $attachments = $trans->Attachments(); + while (my $attach = $attachments->Next()) { + next unless ($attach->Filename()); + # most recent at the top + unshift (@{$documents{$attach->Filename}}, $attach); + } +} + +<%ARGS> +$Ticket => undef + + diff --git a/rt/html/Ticket/Elements/ShowBasics b/rt/html/Ticket/Elements/ShowBasics new file mode 100644 index 000000000..ad23e8c8c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowBasics @@ -0,0 +1,54 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + + + + + +
    <&|/l&>Id:<%$Ticket->Id %>
    <&|/l&>Status:<&|/l&><% $Ticket->Status%>
    <&|/l&>Worked:<&|/l, $TimeWorked &>[_1] min
    <&|/l&>Priority:<%$Ticket->Priority%>/<%$Ticket->FinalPriority %>
    <&|/l&>Queue:<%$Ticket->QueueObj->Name%>
    +<%INIT> +my $TimeWorked = $Ticket->TimeWorked; +if ($Ticket->TimeLeft > 0 ) { + $TimeWorked = $Ticket->TimeWorked."/".$Ticket->TimeLeft; +} + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowCustomFields b/rt/html/Ticket/Elements/ShowCustomFields new file mode 100644 index 000000000..50d28f0d1 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowCustomFields @@ -0,0 +1,46 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +% 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(); + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates new file mode 100644 index 000000000..da7f75bb6 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDates @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    <&|/l&>Created:<% $Ticket->CreatedObj->AsString %>
    <&|/l&>Starts:<% $Ticket->StartsObj->AsString %>
    <&|/l&>Started:<% $Ticket->StartedObj->AsString %>
    <&|/l&>Last Contact:<% $Ticket->ToldObj->AsString %>
    <&|/l&>Due:<% $Ticket->DueObj->AsString %>
    <&|/l&>Closed:<% $Ticket->ResolvedObj->AsString %>
    <&|/l&>Updated:<% $Ticket->LastUpdated ? (loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name)) : loc("Never") | h %>
    +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowDependencies b/rt/html/Ticket/Elements/ShowDependencies new file mode 100644 index 000000000..b7f396871 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowDependencies @@ -0,0 +1,41 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<&|/l&>Depends on:
    +% while (my $Link = $Ticket->DependsOn->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
    +% } +<&|/l&>Depended on by:
    +% while (my $Link = $Ticket->DependedOnBy->Next) { +% my $member = $Link->TargetObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> +[<%$member->Status%>] +
    +% } + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory new file mode 100644 index 000000000..2958f8706 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowHistory @@ -0,0 +1,86 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%perl> + if ($ShowDisplayModes or $ShowTitle) { +my $title; +my $titleright; +if ($ShowTitle) { + $title = loc('History'); +} +else { + $title = ' '; +} +$titleright = loc('Display mode') . ":"; +if ($ShowHeaders && $ShowHeaders == $Ticket->Id ) { + $titleright .= "[" + . loc("Brief headers") + . "] [" + . loc("Full headers") . "]"; +} +else { + $titleright .= "[" + . loc("Brief headers") + . "] [" + . loc("Full headers") . "]"; +} + +<& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&> +% } + + +% while (my $Transaction = $Transactions->Next) { +% my $skip = 0; +% $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS); +% next if $skip; +% $i++; +% if ($Transactions->IsLast) { + +% } + <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands &> +% } +
    +% if ($ShowDisplayModes or $ShowTitle) { +<& /Elements/TitleBoxEnd &> +% } +<%INIT> + +my $Transactions = $Ticket->Transactions; +my $i; + + + +<%ARGS> +$URIFile => 'Display.html' +$Ticket => undef +$ShowHeaders => undef +$Collapsed => undef +$ShowTitle => 1 +$ShowDisplayModes => 1 +$ShowTitleBarCommands => 1 + diff --git a/rt/html/Ticket/Elements/ShowLink b/rt/html/Ticket/Elements/ShowLink new file mode 100644 index 000000000..493fd95a5 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowLink @@ -0,0 +1,40 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +% if ($URI->IsLocal) { +% my $member = $URI->Object; +% if (UNIVERSAL::isa($member, "RT::Ticket")) { +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<% loc($member->Status) %>] +% } elsif ( UNIVERSAL::can($member, 'Name')) { +<%$URI->Resolver->AsString%>: <%$member->Name%> +% } else { +<%$URI->Resolver->AsString%> +% } +% } else { +<%$URI->Resolver->AsString%> +% } + +<%ARGS> +$URI => undef + diff --git a/rt/html/Ticket/Elements/ShowLinks b/rt/html/Ticket/Elements/ShowLinks new file mode 100644 index 000000000..f88a6008d --- /dev/null +++ b/rt/html/Ticket/Elements/ShowLinks @@ -0,0 +1,87 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + + + + + + + + + + +% # Allow people to add more rows to the table +% $m->comp('/Elements/Callback', %ARGS ); + +
    <&|/l&>Depends on: +
      +% while (my $Link = $Ticket->DependsOn->Next) { +
    • <& ShowLink, URI => $Link->TargetURI &> +% } +
    +
    <&|/l&>Depended on by: +
      +% while (my $Link = $Ticket->DependedOnBy->Next) { +
    • <& ShowLink, URI => $Link->BaseURI &> +% } +
    +
    <&|/l&>Parents: +
      +% while (my $Link = $Ticket->MemberOf->Next) { +
    • <& ShowLink, URI => $Link->TargetURI &> +% } +
    +
    <&|/l&>Children:<& /Ticket/Elements/ShowMembers, Ticket => $Ticket &>
    <&|/l&>Refers to: +
      +% while (my $Link = $Ticket->RefersTo->Next) { +
    • <& ShowLink, URI => $Link->TargetURI &> +% } +
    +
    <&|/l&>Referred to by: +
      +% while (my $Link = $Ticket->ReferredToBy->Next) { +
    • <& ShowLink, URI => $Link->BaseURI &> +% } +
    +
    + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf new file mode 100644 index 000000000..79e0a3ba2 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMemberOf @@ -0,0 +1,35 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
      +% my $memberof = $Ticket->MemberOf; +% while (my $member_of = $memberof->Next) { +
    • <%$member_of->Id%>: <%$member_of->Subject%> [<%$member_of->Status%>] +% } +
    + +<%INIT> + +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowMembers b/rt/html/Ticket/Elements/ShowMembers new file mode 100644 index 000000000..e1016626a --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMembers @@ -0,0 +1,45 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% if ($members->Count) { +
      +% while (my $link = $members->Next) { +% my $member= $link->BaseObj; +
    • <%$member->Id%>: <%$member->Subject%> [<%loc($member->Status)%>]
      +% if ($depth < 8) { +<&/Ticket/Elements/ShowMembers, Ticket => $member, depth => ($depth+1) &> +% } +% } +
    +% } + +<%INIT> + +my $members = $Ticket->Members; + + + +<%ARGS> +$Ticket => undef +$depth => 1 + diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders new file mode 100644 index 000000000..11d873c3e --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageHeaders @@ -0,0 +1,32 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%$content |n%> +<%INIT> +my $content = $Headers; +RT::Interface::Web::EscapeUTF8(\$content); +$m->comp('/Elements/Callback', content => \$content, %ARGS); + +<%ARGS> +$Headers => undef + diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza new file mode 100644 index 000000000..b0998068f --- /dev/null +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -0,0 +1,51 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%perl> +foreach my $stanza (@$Message) { + if ( ref $stanza eq "ARRAY" ) { + $m->comp( 'ShowMessageStanza', + Depth => $Depth + 1, + Transaction => $Transaction, + Message => $stanza ); + } + elsif ( ref $stanza eq "HASH" ) { + my $content = $stanza->{raw}; + RT::Interface::Web::EscapeUTF8(\$content); + $m->comp('/Elements/Callback', content => \$content, %ARGS); + $content =~ s/\n/
    /gi; + + +<%$content |n%>
    +% } +% } +<%INIT> +use URI::URL; +my $server = 'fsck.com'; +my @colors = ('#000000', '#660000', '#006600', '#000066', '#cc0000', '#00cc00', '#0000cc', '#ff0000', '#00ff00', '#0000ff'); + +<%ARGS> +$Message => undef +$Depth => 0 +$Transaction => undef + diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople new file mode 100644 index 000000000..0b8026949 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowPeople @@ -0,0 +1,45 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + + + + + + + + + + + + + +
    <&|/l&>Owner:<%$Ticket->OwnerObj->Name%>
    <&|/l&>Requestors:<%$Ticket->RequestorAddresses%>
    <&|/l&>Cc:<%$Ticket->CcAddresses%>
    <&|/l&>AdminCc:<%$Ticket->AdminCcAddresses%>
    +<%ARGS> +$Ticket => undef + + diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences new file mode 100644 index 000000000..831923b2b --- /dev/null +++ b/rt/html/Ticket/Elements/ShowReferences @@ -0,0 +1,50 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +
      +% while (my $Link = $Ticket->RefersTo->Next) { +
    • +% if ($Link->TargetURI->IsLocal) { +% my $member = $Link->TargetObj; + +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
      +% } else { +<%$Link->Target%> +% } +%} + + + +% while (my $Link = $Ticket->ReferredToBy->Next) { +
    • +% if ($Link->BaseURI->IsLocal) { +% my $member = $Link->BaseObj; +<%$member->Id%>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]
      +% } else { +<%$Link->Base%> +%} +% } +
    +<%ARGS> +$Ticket => undef + diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor new file mode 100644 index 000000000..cc91f590f --- /dev/null +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -0,0 +1,59 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%PERL> +my $rows = 10; +my $people = $Ticket->Requestors->MembersObj; +while (my $member=$people->Next) { +my $requestor = $member->MemberObj->Object; +my $name=$requestor->RealName || $requestor->EmailAddress; +my $tickets = RT::Tickets->new($session{'CurrentUser'}); +$tickets->LimitWatcher(TYPE => 'Requestor', VALUE => $requestor->EmailAddress ); +$tickets->LimitStatus( VALUE => 'open'); +$tickets->LimitStatus( VALUE => 'new'); +$tickets->RowsPerPage($rows); +$tickets->OrderBy(FIELD => 'Priority', + ORDER => 'DESC'); + + +% unless ($requestor->Privileged) { +<& /Elements/TitleBoxStart, + title => "id."\">".loc("More about [_1]", $name)."" &> + +<&|/l&>Comments about this user:
    +<% ($requestor->Comments || loc("No comment entered about this user")) %>
    + +<&|/l, $rows &>This user's [_1] highest priority tickets:
    + +<& /Elements/TitleBoxEnd &> + +% } +%} +<%ARGS> +$Ticket=>undef +$DisplayPath => "/Ticket/Display.html" + diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary new file mode 100644 index 000000000..6ae875832 --- /dev/null +++ b/rt/html/Ticket/Elements/ShowSummary @@ -0,0 +1,82 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + + + + + +
    + <& /Elements/TitleBoxStart, title => loc('The Basics'), + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
    +% if ($Ticket->QueueObj->CustomFields()->First) { + <& /Elements/TitleBoxStart, title => loc('Custom Fields'), + title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#993333" &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> + +
    +% } + <& /Elements/TitleBoxStart, title => loc('People'), + title_href =>"$RT::WebPath/Ticket/ModifyPeople.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#333399" &> + <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
    +
    + + <& /Elements/TitleBoxStart, title => loc("Dates"), + title_href =>"$RT::WebPath/Ticket/ModifyDates.html?id=".$Ticket->Id, + title_class=> 'inverse', + color => "#663366" &> + <& /Ticket/Elements/ShowDates, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
    + <& /Elements/TitleBoxStart, title => loc('Relationships'), + title_href => "$RT::WebPath/Ticket/ModifyLinks.html?id=".$Ticket->Id, + title_class=> 'inverse', + titleright => '', color=> "#336633" &> + <& /Ticket/Elements/ShowLinks, Ticket => $Ticket &> + <& /Elements/TitleBoxEnd &> +
    + <& /Ticket/Elements/ShowAttachments, Ticket => $Ticket &> + + <& /Ticket/Elements/ShowRequestor, Ticket => $Ticket &> + + +
    +<%ARGS> +$Ticket => undef + + + + + diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction new file mode 100644 index 000000000..f2f89d35c --- /dev/null +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -0,0 +1,169 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK + +#  +   +<% $transdate|n %>  +% my $desc = $Transaction->BriefDescription; +% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS); +<%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%> + + +<%$TimeTaken%>  +<%$titlebar_commands|n%> + +<%PERL> + +unless ($Collapsed) { + $attachments->GotoFirstItem; + while (my $message=$attachments->Next) { + #we don't want to show any empty transactions, unless they have kids + next unless ($message->ContentLength || $message->Children->Count); + + my ($headers, $quoted); + if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) { + $headers = $message->Headers; + } else { + $headers = $message->NiceHeaders; + } + chomp $headers; + if ($headers) { + # localize the common headers (like 'Subject:'), too. + eval {$headers =~ s/^([^:]+)(?=:)/loc($1)/em; } # we eval here to catch errors when 5.6 panics + } + # 13456 is a random # of about the biggest size we want to see inline text + my $MAX_INLINE_BODY = 13456; + if ($message->ContentType =~ m{^(text/plain|message|text$)}i && + $message->ContentLength < $MAX_INLINE_BODY ) { + require Text::Quoted; + $quoted = Text::Quoted::extract($message->Content); + } + + + +    +    + + +
    +<& ShowMessageHeaders, Headers => $headers, Transaction => $Transaction &>
    +
    +<& ShowMessageStanza, Depth => 0, Message => $quoted, Transaction => $Transaction &> +
    + + + +% if ($message->Parent == 0 ) { +
    +% } +<%PERL> +my $size = $message->ContentLength; + +if ($size) { + if ($size > 1024) { + $size = loc("[_1]k", int($size/102.4)/10); + } + else { + $size = loc("[_1]b", $size); + } + +<&|/l&>Download <% $message->Filename|| loc('(untitled)') %> <% $size %> +% } + + +% } +% } + + + +<%ARGS> +$Ticket => undef +$Transaction => undef +$ShowHeaders => 0 +$Collapsed => undef +$ShowTitleBarCommands => 1 +$RowNum => 1 + + +<%INIT> + + +my ($TimeTaken, $TicketString, $bgcolor); + +my $transdate = $Transaction->CreatedAsString(); +$transdate =~ s/\s/ /g; + +if ($Transaction->Type =~ /^(Create|Correspond|Comment$)/) { + if ($Transaction->IsInbound) { + $bgcolor="#336699"; + } + else { + $bgcolor="#339999"; + } +} elsif (($Transaction->Field =~ /^Owner$/) or + ($Transaction->Type =~ /^(AddWatcher|DelWatcher)$/)) { + $bgcolor="#333399"; + +} elsif ($Transaction->Type =~ /^(AddLink|DeleteLink)$/) { + $bgcolor="#336633"; +} elsif ($Transaction->Type =~ /^(Status|Set|Told)$/) { + if ($Transaction->Field =~ /^(Told|Starts|Started|Due)$/) { + $bgcolor="#663366"; + } + else { + $bgcolor="#993333"; + } +} +else { + $bgcolor="#cccccc"; +} + +if ($Ticket->Id != $Transaction->Ticket) { + $TicketString = "Ticket ".$Transaction->Ticket .": "; +} + +if ($Transaction->TimeTaken > 0) { + $TimeTaken = $Transaction->TimeTaken." min" +} +my $attachments = $Transaction->Attachments; + +my $titlebar_commands=' '; + +# If the transaction has anything attached to it at all +if ($Transaction->Attachments->First && $ShowTitleBarCommands) { + if ($Transaction->TicketObj->CurrentUserHasRight('ReplyToTicket')) { + $titlebar_commands .= + "[Ticket . "&QuoteTransaction=".$Transaction->Id. + "&Action=Respond\">". loc('Reply') ."] "; + } + if ($Transaction->TicketObj->CurrentUserHasRight('CommentOnTicket')) { + $titlebar_commands .= + "[Ticket. + "&QuoteTransaction=".$Transaction->Id. + "&Action=Comment\">". loc('Comment') ."]"; + } +} + + diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs new file mode 100644 index 000000000..81c92e8c2 --- /dev/null +++ b/rt/html/Ticket/Elements/Tabs @@ -0,0 +1,170 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Callback, Ticket => $Ticket, actions=> $actions, tabs => $tabs, %ARGS &> +<& /Elements/Tabs, + tabs => $tabs, + actions => $actions, + current_tab => $current_tab, + current_toptab => $current_toptab, + Title => $Title &> +<%INIT> + +my $tabs = {}; +my $current_toptab = "Search/Listing.html", + my $searchtabs = { new => { title => loc('New Search'), + path => 'Search/Listing.html?ClearRestrictions=1'} + + +} ; +my $actions; + +if ( $Ticket) { + +my $id = $Ticket->id(); + +if ( defined $session{'tickets'} ) { + + +my $item_map = $session{'tickets'}->ItemMap; + + # Don't $current_toptab = display prev links if we're on the first ticket + + if ($item_map->{$Ticket->Id}->{prev}) { + $searchtabs->{'_a'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{first}, + title => '<< ' . loc('First') }; + $searchtabs->{"_b"} = { class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{$Ticket->Id}->{prev}, + title => '< ' . loc('Prev') }; + } + + + # Don't display next links if we're on the last ticket + if ($item_map->{$Ticket->Id}->{next}) { + $searchtabs->{'d'} = { class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{$Ticket->Id}->{next}, + title => loc('Next') . ' >' }; + $searchtabs->{'e'} = { + class => "nav", + path => "Ticket/Display.html?id=" . $item_map->{last}, + title => loc('Last') . ' >>' }; + } +} + + + +$tabs->{"this"} = { class => "currentnav", + path => "Ticket/Display.html?id=" . $Ticket->id, + title => "#" . $id, + current_subtab => $current_subtab }; + +my $ticket_page_tabs = { + _A => { title => loc('Display'), + path => "Ticket/Display.html?id=" . $id, }, + + _Ab => { title => loc('History'), + path => "Ticket/History.html?id=" . $id, }, + _B => { title => loc('Basics'), + path => "Ticket/Modify.html?id=" . $id, }, + + _C => { title => loc('Dates'), + path => "Ticket/ModifyDates.html?id=" . $id, }, + _D => + { title => loc('People'), path => "Ticket/ModifyPeople.html?id=" . $id, }, + _E => { title => loc('Links'), + path => "Ticket/ModifyLinks.html?id=" . $id, }, + _F => { title => loc('Jumbo'), + path => "Ticket/ModifyAll.html?id=" . $id, + seperator => 1 + }, + +}; + +foreach my $tab ( sort keys %{$ticket_page_tabs} ) { + if ( $ticket_page_tabs->{$tab}->{'path'} eq $current_tab ) { + $ticket_page_tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{"current_subtab"} = + $ticket_page_tabs->{$tab}->{"path"}; + } +} +$tabs->{'this'}->{"subtabs"} = $ticket_page_tabs; +$current_tab = "Ticket/Display.html?id=" . $id; + + + + + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') + or $Ticket->CurrentUserHasRight('ReplyToTicket') ) { + $actions->{'A'} = { title => loc('Reply'), + path => "Ticket/Update.html?Action=Respond&id=" . $id, + }; +} + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) { + if ( $Ticket->Status ne 'resolved' ) { + $actions->{'B'} = { + + path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id, + title => loc('Resolve') }; + } + if ( $Ticket->Status ne 'open' ) { + $actions->{'C'} = { path => "Ticket/Display.html?Status=open&id=" . $id, + title => loc('Open it') }; + } +} + +if ( $Ticket->CurrentUserHasRight('OwnTicket') ) { + if ( $Ticket->OwnerObj->id == $RT::Nobody->id ) { + $actions->{'D'} = { path => "Ticket/Display.html?Action=Take&id=" . $id, + title => loc('Take') }; + } + elsif ( $Ticket->OwnerObj->id != $session{CurrentUser}->id ) { + $actions->{'E'} = {path => "Ticket/Display.html?Action=Steal&id=" . $id, + title => loc('Steal') }; + } +} + +if ( $Ticket->CurrentUserHasRight('ModifyTicket') + or $Ticket->CurrentUserHasRight('CommentOnTicket') ) { + $actions->{'F'} = { title => loc('Comment'), + path => "Ticket/Update.html?Action=Comment&id=" . $id, + }; +} +} +$tabs->{"g"} = { path => 'Search/Listing.html', + title => loc('Search'), + separator => 1, + subtabs => $searchtabs }; + + + +<%ARGS> +$Ticket => undef +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html new file mode 100644 index 000000000..cb02f1c75 --- /dev/null +++ b/rt/html/Ticket/History.html @@ -0,0 +1,52 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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, + Title => loc("Ticket History # [_1] [_2]", $Ticket->Id, $Ticket->Subject) &> + +
    + +<& /Ticket/Elements/ShowHistory , Ticket => $Ticket, ShowHeaders => $ARGS{'ShowHeaders'}, URIFile => 'History.html' &> + + +<%ARGS> +$id => undef + + +<%INIT> + + + +my $Ticket = LoadTicket ($id); + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html new file mode 100644 index 000000000..c97fd0994 --- /dev/null +++ b/rt/html/Ticket/Modify.html @@ -0,0 +1,63 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE 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%" &> +<& Elements/EditBasics, TicketObj => $TicketObj &> +<& Elements/EditCustomFields, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#993333" &> +
    +<%INIT> + +my $TicketObj = LoadTicket($id); +my $CustomFields = $TicketObj->QueueObj->CustomFields(); + +# 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(ARGSRef => \%ARGS); +push (@results, @cf_results); + +# TODO: display the results, even if we can't display the ticket + +unless ($TicketObj->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html new file mode 100644 index 000000000..a50689398 --- /dev/null +++ b/rt/html/Ticket/ModifyAll.html @@ -0,0 +1,158 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyAll.html?id=".$Ticket->Id, + Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> + +<& /Elements/ListActions, actions => \@results &> + +
    + + + +<& /Elements/TitleBoxStart, title => loc('Modify ticket # [_1]', $Ticket->Id), color=> "#993333", width => "100%" &> +<& Elements/EditBasics, TicketObj => $Ticket &> +<& Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Dates'), width => "100%", color => "#663366" &> +<& Elements/EditDates, TicketObj => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
    + + +<& /Elements/TitleBoxStart, title => loc('People'),width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp &> +<& /Elements/TitleBoxEnd &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Relationships'), color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Update ticket') &> + + + + + + + + + + + + + + + + + +
    <&|/l&>Update Type: + +
    <&|/l&>Subject:
    <&|/l&>Attach:
    <&|/l&>Content:<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &>
    +<& /Elements/TitleBoxEnd &> + + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +
    + +<%INIT> + + + +my $Ticket = LoadTicket($id); + +my $CanRespond = 0; +my $CanComment = 0; + + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + +my (@wresults, @results, @dresults, @lresults, @cf_results); + +unless ($OnlySearchForPeople) { + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @cf_results = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); + @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + + if ($ARGS{'UpdateContent'} && + $ARGS{'UpdateContent'} ne '' && + $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature + ) { + ProcessUpdateMessage(TicketObj => $Ticket, + ARGSRef=>\%ARGS, + Actions=>\@results); + } +} +push @results, @wresults; +push @results, @dresults; +push @results, @lresults; +push @results, @cf_results; + +# If they've gone and moved the ticket to somewhere they can't see, etc... +# TODO: display the results, even if we can't display the ticket. + +unless ($Ticket->CurrentUserHasRight('ShowTicket')) { + Abort("No permission to view ticket"); +} + + + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$id => undef + + diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html new file mode 100644 index 000000000..3ccae4431 --- /dev/null +++ b/rt/html/Ticket/ModifyDates.html @@ -0,0 +1,52 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc('Modify dates for #[_1]', $TicketObj->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $TicketObj, + current_tab => "Ticket/ModifyDates.html?id=".$TicketObj->Id, + Title => loc('Modify dates for #[_1]', $TicketObj->Id) &> + +<& /Elements/ListActions, actions => \@results &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Modify dates for ticket # [_1]', $TicketObj->Id), width => "100%", color => "#663366" &> + +<& Elements/EditDates, TicketObj => $TicketObj &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#663366" &> +
    + + +<%INIT> + +my $TicketObj = LoadTicket($id); +my @results = ProcessTicketDates( TicketObj => $TicketObj, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html new file mode 100644 index 000000000..1d050088b --- /dev/null +++ b/rt/html/Ticket/ModifyLinks.html @@ -0,0 +1,54 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Link ticket #[_1]", $Ticket->Id) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyLinks.html?id=".$Ticket->Id, + Title => loc("Link ticket #[_1]", $Ticket->Id) &> + +<& /Elements/ListActions, actions => \@results &> + +
    + + +<& /Elements/TitleBoxStart, title => loc('Edit Relationships'), color => "#336633"&> +<& Elements/EditLinks, Ticket => $Ticket &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, color => "#336633", Caption=> loc('Save Changes') &> +
    + + + + +<%INIT> + +my $Ticket = LoadTicket($id); +my @results = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); + + + + +<%ARGS> +$id => undef + diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html new file mode 100644 index 000000000..2e41664d9 --- /dev/null +++ b/rt/html/Ticket/ModifyPeople.html @@ -0,0 +1,67 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc('Modify people related to ticket #[_1]', $Ticket->id) &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket, + current_tab => "Ticket/ModifyPeople.html?id=".$Ticket->Id, + Title => loc('Modify people related to ticket #[_1]', $Ticket->id) &> + +<& /Elements/ListActions, actions => \@results &> + +
    + +<& /Elements/TitleBoxStart, title => loc('Modify people related to ticket #[_1]', $Ticket->Id), width => "100%", color=> "#333399" &> +<& Elements/EditPeople, Ticket => $Ticket, UserField => $UserField, UserString => $UserString, UserOp => $UserOp, GroupString => $GroupString, GroupOp => $GroupOp, GroupField => $GroupField &> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +
    + +<%INIT> + +my (@results, @wresults); + +my $Ticket = LoadTicket($id); + +# if we're trying to search for watchers and nothing else +unless ($OnlySearchForPeople) { + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); + @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); +} + +push @results, @wresults; + + + + +<%ARGS> +$OnlySearchForPeople => undef +$UserField => undef +$UserOp => undef +$UserString => undef +$GroupField => undef +$GroupOp => undef +$GroupString => undef +$id => undef + + diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html new file mode 100644 index 000000000..e19aacf6a --- /dev/null +++ b/rt/html/Ticket/Update.html @@ -0,0 +1,205 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title &> +<& /Ticket/Elements/Tabs, + Ticket => $Ticket , + Title=> $title &> + +
    + + + + + + + + + + +
    +<&|/l&>Ticket watchers +<&|/l&>Requestor: + +<% $Ticket->RequestorAddresses %> +
      +<&|/l&>Cc: + +<% $Ticket->CcAddresses %> +
      +<&|/l&>AdminCc: + +<% $Ticket->AdminCcAddresses %> +
    +
    + + + + + + + + + + +% if (exists $session{'Attachments'}) { + + + + +% } # end of if + + +
    +
    <&|/l&>Status: +<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &> +<&|/l&>Owner: +<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $Ticket->OwnerObj->Id()), QueueObj => $Ticket->QueueObj, TicketObj => $Ticket &> +<&|/l&>Worked: <&|/l&>minutes
    <&|/l&>Update Type: +
    <&|/l&>Subject:
    <&|/l&>Cc: >
    + +<&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. Does not change who will receive future updates.) +
    <&|/l&>Bcc:
    + +<&|/l&>(Sends a blind carbon-copy of this update to a comma-delimited list of email addresses. Does not change who will receive future updates.) +
    +<&|/l&>Attached file: + +<&|/l&>Check box to delete
    +% foreach my $attach_name (keys %{$session{'Attachments'}}) { +<%$attach_name%>
    +% } # end of foreach +
    <&|/l&>Attach: +
    <&|/l&>Message: +<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> +% if (exists $ARGS{UpdateContent}) { +% delete $ARGS{'QuoteTransaction'}; +<& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, %ARGS&> +% } else { +<& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> +% } +
    + + + + +<& /Elements/Submit, Name => 'SubmitTicket' &> + + + + +<%INIT> + +my $CanRespond = 0; +my $CanComment = 0; +my $title; + +my $Ticket = LoadTicket($id); + +unless($DefaultStatus){ + $DefaultStatus=($ARGS{'Status'} ||$Ticket->Status()); +} + +if ($DefaultStatus =~ '^new$'){ + $DefaultStatus='open'; +} + +if ($DefaultStatus eq 'resolved') { + $title = loc("Resolve ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); +} else { + $title = loc("Update ticket #[_1] ([_2])", $Ticket->id, $Ticket->Subject); +} + +# Things needed in the template - we'll do the processing here, just +# for the convenience: + +my ($CommentDefault, $ResponseDefault); +if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) { + $CommentDefault = "SELECTED"; +} else { + $ResponseDefault = "SELECTED"; +} + + +$CanRespond = 1 if ( $Ticket->CurrentUserHasRight('ReplyToTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + +$CanComment = 1 if ( $Ticket->CurrentUserHasRight('CommentOnTicket') or + $Ticket->CurrentUserHasRight('ModifyTicket') ); + + +# {{{ deal with deleting uploaded attachments +foreach my $key (keys %ARGS) { + if ($key =~ m/^DeleteAttach-(.+)$/) { + delete $session{'Attachments'}{$1}; + } + $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; +} + +# {{{ 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 }; +} +# }}} + +# delete temporary storage entry to make WebUI clean +unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { + delete $session{'Attachments'}; +} +# }}} + +if ( exists $ARGS{SubmitTicket} ) { + $m->comp('Display.html', %ARGS); + return; +} + + +<%ARGS> +$id => undef +$Action => undef +$DefaultStatus => undef + diff --git a/rt/html/User/Delegation.html b/rt/html/User/Delegation.html new file mode 100644 index 000000000..c036f78ec --- /dev/null +++ b/rt/html/User/Delegation.html @@ -0,0 +1,83 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => loc("Delegate rights") &> +<& /User/Elements/Tabs, + current_tab => 'User/Delegation.html', + Title => loc("Delegate rights") &> + +<& /Elements/ListActions, actions => \@results &> + +
    +<& Elements/DelegateRights, personalgroups => $personalgroups, objects => $objects, ObjectType => 'RT::System' &> +<& Elements/DelegateRights, personalgroups => $personalgroups, objects => $objects, ObjectType => 'RT::Queue' &> +<& Elements/DelegateRights, personalgroups => $personalgroups, objects => $objects, ObjectType => 'RT::Group' &> + +<& /Elements/Submit &> +
    +<%INIT> + +my (@results, $arg); +foreach $arg (keys %ARGS) { + next unless ($arg =~ /^Delegate-Existing-ACE-(\d+)-to-(\d+)-as-(\d+)$/); + my $parent = $1; + my $principal = $2; + my $delegation = $3; + unless ($ARGS{"Delegate-ACE-$1-to-$2"}) { + my $ace_to_del = RT::ACE->new($session{'CurrentUser'}); + $ace_to_del->Load($delegation); + my ($delval, $delmsg) = $ace_to_del->Delete(); + push (@results, $delmsg); + } +} + +foreach $arg (keys %ARGS) { + next unless ($arg =~ /^Delegate-ACE-(\d+)-to-(\d+)$/); + my $parent = $1; + my $principal = $2; + # if we already delegate it, we just don't care + next if (grep /^Delegate-Existing-ACE-$parent-to-$principal-/, keys %ARGS); + my $ace = RT::ACE->new($session{'CurrentUser'}); + $ace->Load($1); + unless ($ace->Id) { + push (@results, loc('Right not found')); + next; + } + my ($delid, $delmsg) = $ace->Delegate(PrincipalId => $principal); + push (@results, $delmsg); +} + +my $personalgroups = RT::Groups->new($session{'CurrentUser'}); +$personalgroups->LimitToPersonalGroupsFor($session{'CurrentUser'}->PrincipalId); + +my $objects; +my $acl = RT::ACL->new ($session{'CurrentUser'}); +$acl->ExcludeDelegatedRights(); +$acl->LimitToPrincipal(Id => $session{'CurrentUser'}->PrincipalId, + IncludeGroupMembership => 1 + ); + +while(my $right = $acl->Next) { + push @{$objects->{$right->ObjectType}{$right->ObjectId}},$right; +} + diff --git a/rt/html/User/Elements/DelegateRights b/rt/html/User/Elements/DelegateRights new file mode 100644 index 000000000..7ff83280f --- /dev/null +++ b/rt/html/User/Elements/DelegateRights @@ -0,0 +1,85 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +

    <%$sectionheading%>

    +<%perl> + +foreach my $object (keys %{$objects->{$ObjectType}}) { +unless ($ObjectType eq 'RT::System') { +my $object_obj = @{$objects->{$ObjectType}{$object}}[0]->Object; + + +

    <% $object_obj->Name %>

    +% } + + + +% while (my $pg = $personalgroups->Next) { + +% } + +<%perl> +my $i; +foreach my $right (@{$objects->{$ObjectType}{$object}}) { +my $delegations = RT::ACL->new($session{'CurrentUser'}); +$delegations->DelegatedBy( Id => $session{'CurrentUser'}->PrincipalId); +$delegations->DelegatedFrom ( Id => $right->Id); + +my $del_hash = {}; +while ( my $delegation = $delegations->Next) { + $del_hash->{$delegation->PrincipalId} = $delegation; +} + +% $i++; +% + + +% while (my $pg = $personalgroups->Next) { + +% } + + +%} +
    <&|/l&>Personal groups:<%$pg->Name%>
    +<% loc($right->RightName) %>
    +
    <&|/l, $right->PrincipalObj->Object->SelfDescription &>as granted to [_1]
    +
    + {$pg->PrincipalId} && 'CHECKED' %>> +% if ( $del_hash->{$pg->PrincipalId}) { + +% } + 
    +% } +<%init> + +my $sectionheading = loc("[_1] rights", loc($ObjectType =~ /^RT::(.*)$/)); +# 'System' # loc +# 'Group' # loc +# 'Queue' # loc + + +<%args> +$ObjectType => undef +$objects => undef +$personalgroups => undef + diff --git a/rt/html/User/Elements/GroupTabs b/rt/html/User/Elements/GroupTabs new file mode 100644 index 000000000..89d7125b9 --- /dev/null +++ b/rt/html/User/Elements/GroupTabs @@ -0,0 +1,60 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /User/Elements/Tabs, + subtabs => $tabs, + current_tab => 'User/Groups/', + current_subtab => $current_subtab, + Title => $Title &> + +<%INIT> +my $tabs; +if ( $GroupObj and $GroupObj->id ) { + $tabs->{"this"} = { + title => $GroupObj->Name, + path => "User/Groups/Modify.html?id=" . $GroupObj->id, + subtabs => { + Basics => { title => loc('Basics'), + path => "User/Groups/Modify.html?id=" . $GroupObj->id + }, + + Members => { title => loc('Members'), + path => "User/Groups/Members.html?id=" . $GroupObj->id + }, + + } }; + $tabs->{'this'}->{'current_subtab'} = $current_subtab; + $current_subtab = "User/Groups/Modify.html?id=" . $GroupObj->id, +} +$tabs->{"A"} = { title => loc('Select group'), + path => "User/Groups/index.html" }; +$tabs->{"B"} = { title => loc('New group'), + path => "User/Groups/Modify.html?Create=1", + separator => 1 }; + + +<%ARGS> +$GroupObj => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/User/Elements/Tabs b/rt/html/User/Elements/Tabs new file mode 100644 index 000000000..195cf1c60 --- /dev/null +++ b/rt/html/User/Elements/Tabs @@ -0,0 +1,56 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Tabs, + tabs => $tabs, + current_toptab => 'User/Prefs.html', + current_tab => $current_tab, + Title => $Title &> + +<%INIT> + my $tabs = { a => { title => loc('About me'), + path => 'User/Prefs.html', + }, + g => { title => loc('Personal Groups'), + path => 'User/Groups/', + }, + h => { title => loc('Delegation'), + path => 'User/Delegation.html', + }, + }; + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } + + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef + diff --git a/rt/html/User/Groups/Members.html b/rt/html/User/Groups/Members.html new file mode 100644 index 000000000..db83b8c0f --- /dev/null +++ b/rt/html/User/Groups/Members.html @@ -0,0 +1,136 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title &> +<& /User/Elements/GroupTabs, + GroupObj => $Group, + current_subtab => "User/Groups/Members.html?id=".$Group->id, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + + +
    + + + + + + + + + + + +
    +<&|/l&>Add members + +<&|/l&>Current members +
    +<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group &> + + +% if ($Group->MembersObj->Count == 0 ) { +<&|/l&>(No members) +% } else { +<&|/l&>(Check box to delete) +
    +
    +<&|/l&>Users +% my $UserMembers = $Group->MembersObj; +% $UserMembers->LimitToUsers(); +
      +% while (my $member = $UserMembers->Next()) { +
    • +<%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) +% } +
    +<&|/l&>Groups +
      +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while (my $member = $GroupMembers->Next()) { +
    • +<%$member->MemberObj->Object->Name%> +% } +% } +
    +
    +<& /Elements/Submit &> +
    + + +<%INIT> + +my $Group = new RT::Group($session{'CurrentUser'}); +$Group->Load($id) ; + +unless ($Group->id) { + Abort(loc('Could not load group')); +} + +my (@results); + +foreach my $key (keys %ARGS) { + +if ($key =~ /^DeleteMember-(\d+)$/) { + my $mem_id = $1; + my ($val,$msg) = $Group->DeleteMember($mem_id); + push (@results, $msg); +} +} + +# Make sure AddMembers is always an array +my @AddMembersUsers = (ref $AddMembersUsers eq 'ARRAY') ? @{$AddMembersUsers} : ($AddMembersUsers); +my @AddMembersGroups = (ref $AddMembersGroups eq 'ARRAY') ? @{$AddMembersGroups} : ($AddMembersGroups); + +foreach my $member (@AddMembersUsers, @AddMembersGroups) { + next unless ($member); + + my $principal; + + if ($member =~ /^Group-(\d+)$/) { + $principal = RT::Group->new($session{'CurrentUser'}); + $principal->Load($1); + } elsif ($member =~ /^User-(\d+)$/) { + $principal = RT::User->new($session{'CurrentUser'}); + $principal->Load($1); + } else { + next; + } + + + my ($val, $msg) = $Group->AddMember($principal->PrincipalId); + push (@results, $msg); +} + + +my $title = loc('Editing membership for personal group [_1]', $Group->Name); + + + +<%ARGS> +$AddMembersUsers => undef +$AddMembersGroups => undef +$id => undef + diff --git a/rt/html/User/Groups/Modify.html b/rt/html/User/Groups/Modify.html new file mode 100644 index 000000000..f731e1a82 --- /dev/null +++ b/rt/html/User/Groups/Modify.html @@ -0,0 +1,133 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title &> + +<& /User/Elements/GroupTabs, + GroupObj => $Group, + current_subtab => $current_tab, + Title => $title &> + +<& /Elements/ListActions, actions => \@results &> + + +
    + +%unless ($Group->Id) { + +% } else { + +% } + + + + + + + +
    +<&|/l&>Name: +
    +<&|/l&>Description:
    + +> <&|/l&>Enabled (Unchecking this box disables this group)
    +
    +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +
    +<%INIT> + +my $current_tab; +my ($title, @results, $Disabled, $EnabledChecked); + +my $Group = RT::Group->new($session{'CurrentUser'}); + +if ($Create) { + $current_tab = 'User/Groups/Modify.html?Create=1'; + $title = loc("Create a new personal group"); +} +else { + if ( $id eq 'new' ) { + + my ( $id, $msg ) = $Group->CreatePersonalGroup( + Name => "$Name", + PrincipalId => $session{'CurrentUser'}->PrincipalId + ); + unless ($id) { + Abort( loc("Could not create group") ); + } + $id = $Group->Id; + } + else { + $Group->Load($id) || Abort( loc('Could not load group') ); + } + + if ($id) { + $title = loc( "Modify the group [_1]", $Group->Name ); + + } + + # If the create failed + else { + $title = loc("Create a new personal group"); + $Create = 1; + } + + $current_tab = 'User/Groups/Modify.html?id=' . $Group->Id; +} + +if ($id) { + + my @fields = qw(Description Name ); + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $Group, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); +} + +#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 != $Group->Disabled) ) { + my ($code, $msg) = $Group->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); +} + +unless ($Group->Disabled()) { + $EnabledChecked ="CHECKED"; +} + + + + +<%ARGS> +$Create => undef +$Name => undef +$Description => undef +$SetEnabled => undef +$Enabled => undef +$id => undef + diff --git a/rt/html/User/Groups/index.html b/rt/html/User/Groups/index.html new file mode 100644 index 000000000..12b43b409 --- /dev/null +++ b/rt/html/User/Groups/index.html @@ -0,0 +1,43 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title => $title &> +<& /User/Elements/GroupTabs, + current_subtab => 'User/Groups/index.html', + Title => $title &> + +<&|/l&>Personal groups:
    + + +<%INIT> +my $Groups = RT::Groups->new($session{'CurrentUser'}); +$Groups->LimitToPersonalGroupsFor($session{'CurrentUser'}->PrincipalId()); +my $title = loc('Personal groups'); + + +<%ARGS> + diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html new file mode 100644 index 000000000..b89fc40ae --- /dev/null +++ b/rt/html/User/Prefs.html @@ -0,0 +1,218 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title=>loc("Preferences") &> +<& /User/Elements/Tabs, + current_tab => 'User/Prefs.html', + Title=>loc("Preferences") &> + +<& /Elements/ListActions, actions => \@results &> + +
    + + + + + + + + + + + + + + + + + + +
    +<& /Elements/TitleBoxStart, title => loc('Identity') &> + + +<&|/l&>Email: +
    +<&|/l&>Real Name: +
    +<&|/l&>Nickname: +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc('Phone numbers') &> +<&|/l&>Residence: +
    +<&|/l&>Work: +
    +<&|/l&>Mobile: +
    +<&|/l&>Pager: +<& /Elements/TitleBoxEnd &> +
    +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<& /Elements/TitleBoxStart, title => loc('Password') &> + + + + + + + + +
    +<&|/l&>New Password: + + +
    +<&|/l&>Retype Password: + + +
    +% } +<& /Elements/TitleBoxEnd &> +
    +<& /Elements/TitleBoxStart, title => loc('Location') &> +<&|/l&>Organization: +
    +<&|/l&>Address1: +
    +<&|/l&>Address2: +
    +<&|/l&>City: + +<&|/l&>State: + +<&|/l&>Zip: +
    +<&|/l&>Country: +
    + + +<& /Elements/TitleBoxEnd &> +
    +%if ($UserObj->Privileged) { +
    +<& /Elements/TitleBoxStart, title => loc('Signature') &> + +<& /Elements/TitleBoxEnd &> +% } + +
    + + +<& /Elements/Submit &> +
    + + +<%INIT> + +my $UserObj = new RT::User($session{'CurrentUser'}); +my ($title, $PrivilegedChecked, $EnabledChecked, $Disabled, $result, @results); + +my ($val, $msg); + + + $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); + $val = $UserObj->Id(); + + + + + + +# If we have a user to modify, lets try. +if ($UserObj->Id) { + + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo + Organization RealName NickName Lang EmailEncoding WebEncoding + ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId + AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 + Address2 City State Zip Country + ); + + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $UserObj, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); + + +# {{{ 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)); +} + + + +#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. Your password has not been changed"); +} + +# }}} +} + + + + + +<%ARGS> +$id => $session{'CurrentUser'}->Id +$Name => undef +$Comments => undef +$Signature => undef +$EmailAddress => undef +$FreeformContactInfo => undef +$Organization => undef +$RealName => undef +$NickName => undef +$Privileged => undef +$SetPrivileged => undef +$Enabled => undef +$SetEnabled => undef +$Lang => undef +$EmailEncoding => undef +$WebEncoding => undef +$ExternalContactInfoId => undef +$ContactInfoSystem => undef +$Gecos => undef +$ExternalAuthId => undef +$AuthSystem => undef +$HomePhone => undef +$WorkPhone => undef +$MobilePhone => undef +$PagerPhone => undef +$Address1 => undef +$Address2 => undef +$City => undef +$State => undef +$Zip => undef +$Country => undef +$Pass1 => undef +$Pass2=> undef +$Create=> undef + diff --git a/rt/html/autohandler b/rt/html/autohandler new file mode 100644 index 000000000..ce8b7569e --- /dev/null +++ b/rt/html/autohandler @@ -0,0 +1,178 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<%INIT> + +# Roll back any dangling transactions from a previous failed connection +$RT::Handle->ForceRollback() if $RT::Handle->TransactionDepth; + + +local *session; +%ARGS = map { + # if they've passed multiple values, they'll be an array. if they've passed just one, a scalar + # whatever they are, mark them as utf8 + my $type = ref($_); + (!$type) + ? Encode::decode(utf8 => $_, Encode::FB_PERLQQ) : + ($type eq 'ARRAY') + ? [ map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] : + ($type eq 'HASH') + ? { map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_ +} %ARGS; + +if ($ARGS{'Debug'}) { + require Time::HiRes; + $m->{'rt_base_time'} = [Time::HiRes::gettimeofday()]; + +} +else { + $m->{'rt_base_time'} = time; +} +$m->comp('/Elements/SetupSessionCookie', %ARGS); + +unless ($session{'CurrentUser'} && $session{'CurrentUser'}->Id) { + $session{'CurrentUser'} = RT::CurrentUser->new(); +} + +# Set the proper encoding for the current language handle +$r->content_type("text/html; charset=utf-8"); + +# If it's a noauth file, don't ask for auth. +if ($m->base_comp->path =~ '^/+NoAuth/' || + $m->base_comp->path =~ '^/+REST/\d+\.\d+/NoAuth/') +{ + $m->call_next(%ARGS); + $m->abort(); +} + +# If RT is configured for external auth, let's get REMOTE_USER +elsif ($RT::WebExternalAuth and length($ENV{'REMOTE_USER'})) { + my $orig_user = $user; + + $user = $ENV{'REMOTE_USER'}; + $session{'CurrentUser'} = RT::CurrentUser->new(); + my $load_method = $RT::WebExternalGecos ? 'LoadByGecos' : 'Load'; + + if ($^O eq 'MSWin32' and $RT::WebExternalGecos) { + my $NodeName = Win32::NodeName(); + $user =~ s/^\Q$NodeName\E\\//i; + } + + $session{'CurrentUser'}->$load_method($user); + + if ($RT::WebExternalAuto and !$session{'CurrentUser'}->Id() ) { + # Create users on-the-fly with default attributes + + my $UserObj = RT::User->new(RT::CurrentUser->new('root')); + + my ($val, $msg) = $UserObj->Create( + %{ref($RT::AutoCreate) ? $RT::AutoCreate : {}}, + Name => $user, + Gecos => $user, + ); + + if ($val) { + $UserObj->SetPrivileged(1); + + if ($^O !~ /^(?:riscos|MacOS|MSWin32|dos|os2)$/) { + # Populate fields with information from Unix /etc/passwd + + my ($comments, $realname) = (getpwnam($user))[5, 6]; + $UserObj->SetComments($comments) if defined $comments; + $UserObj->SetRealName($realname) if defined $realname; + } + elsif ($^O eq 'MSWin32' and eval 'use Net::AdminMisc; 1') { + # Populate fields with information from NT domain controller + } + + $session{'CurrentUser'}->Load($user); + } + else { + delete $session{'CurrentUser'}; + $m->abort() unless $RT::WebFallbackToInternalAuth; + $m->comp('/Elements/Login', %ARGS, Error=> loc('Cannot create user: [_1]', $msg)); + } + } + + unless ( $session{'CurrentUser'}->Id() ) { + delete $session{'CurrentUser'}; + $user = $orig_user; + + if ( $RT::WebExternalOnly ) { + $m->comp('/Elements/Login', %ARGS, Error=> loc('You are not an authorized user')); + $m->abort(); + } + } +} + +delete $session{'CurrentUser'} + unless $session{'CurrentUser'} and defined $session{'CurrentUser'}->Id; + +# Process per-page authentication callbacks +$m->comp('/Elements/Callback', %ARGS, _CallbackName => 'Auth'); + +# If the user is logging in, let's authenticate +if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){ + $session{'CurrentUser'} = RT::CurrentUser->new(); + $session{'CurrentUser'}->Load($user); + + if (!$session{'CurrentUser'}->id() || + !$session{'CurrentUser'}->IsPassword($pass)) + { + delete $session{'CurrentUser'}; + $m->comp('/Elements/Login', %ARGS, + Error => loc('Your username or password is incorrect')); + $m->abort(); + } +} + +# If we've got credentials, let's serve the file up. +if ( (defined $session{'CurrentUser'}) and + ( $session{'CurrentUser'}->Id) ) { + + # Process per-page global callbacks + $m->comp('/Elements/Callback', %ARGS); + + # If the user isn't privileged, they can only see SelfService + if ((! $session{'CurrentUser'}->Privileged) and + ($m->base_comp->path !~ '^(/+)SelfService/') ) { + $m->comp('/SelfService/index.html'); + $m->abort(); + } + else { + $m->call_next(%ARGS); + } +} + +# If we have no credentials +else { + $m->comp('/Elements/Login', %ARGS); + $m->abort(); +} + +<& /Elements/Footer, %ARGS &> +<%ARGS> +$user => undef +$pass => undef +$menu => undef + diff --git a/rt/html/index.html b/rt/html/index.html new file mode 100644 index 000000000..39eac8d61 --- /dev/null +++ b/rt/html/index.html @@ -0,0 +1,84 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +<& /Elements/Header, Title=>loc("RT at a glance"), Refresh => $session{'home_refresh_interval'} &> +<& /Elements/Tabs, + current_toptab => '', + Title=>loc("RT at a glance") &> + + + + + +
    +<& /Elements/MyTickets &> +
    +<& /Elements/MyRequests &> +
    +<& /Elements/Quicksearch &> +
    +
    +<& /Elements/Refresh, Name => 'HomeRefreshInterval', Default => $session {'home_refresh_interval'} &> +
    +
    +
    +<%init> +if ( $ARGS{'q'} ) { + my $query = $ARGS{'q'}; + + if ( $query =~ m/^\s*(\d+)\s*$/ ) { + $m->redirect("$RT::WebPath/Ticket/Display.html?id=$1"); + } + + $session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} ); + + if ( $query =~ m/\@/ ) { + $session{'tickets'}->LimitRequestor( VALUE => $query, + OPERATOR => '=', ); + $m->redirect("$RT::WebPath/Search/Listing.html"); + } + + # + # Any search on queue name or subject will be for new/open tickets + # only. + # + $session{'tickets'}->LimitStatus( VALUE => $_, + OPERATOR => '=', ) for qw(open new); + + my $queue = RT::Queue->new( $session{'CurrentUser'} ); + if ( $queue->Load($query) && $queue->Id ) { + $session{'tickets'}->LimitQueue( VALUE => $queue->Id, + OPERATOR => '=', ); + $m->redirect("$RT::WebPath/Search/Listing.html"); + } + $session{'tickets'}->LimitSubject( VALUE => $query, + OPERATOR => 'LIKE' ); + + $m->redirect("$RT::WebPath/Search/Listing.html"); +} + +if ($ARGS{'HomeRefreshInterval'}) { + $session{'home_refresh_interval'} = $ARGS{'HomeRefreshInterval'}; +} + + diff --git a/rt/html/l b/rt/html/l new file mode 100644 index 000000000..712e38d71 --- /dev/null +++ b/rt/html/l @@ -0,0 +1,26 @@ +%# BEGIN LICENSE BLOCK +%# +%# Copyright (c) 1996-2003 Jesse Vincent +%# +%# (Except where explictly superceded by other copyright notices) +%# +%# 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. +%# +%# 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. +%# +%# +%# END LICENSE BLOCK +% my $hand = ($session{'CurrentUser'} ||= RT::CurrentUser->new)->LanguageHandle; +% $m->print($hand->maketext($m->content,@_)); +% return(1); -- cgit v1.2.1