diff options
Diffstat (limited to 'rt/html/Admin')
64 files changed, 4977 insertions, 0 deletions
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 <jesse@bestpractical.com> +%# +%# (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 +<b><&|/l&>Add Value</&></b></b></b></b> +<TABLE BORDER="0"> +<TR><TD><small> +<&|/l&>Sort</&>:<br> +<input name="CustomField-<% $CustomField->Id %>-AddValue-SortOrder" size="5"> +</TD> +<TD><small> +<&|/l&>Name</&>:<br> +<input size=20 name="CustomField-<% $CustomField->Id %>-AddValue-Name"> +</TD> +<TD><small> +<&|/l&>Description</&>:<br> +<input size="60" name="CustomField-<% $CustomField->Id %>-AddValue-Description"> +</TD></TR> +</TABLE> + +<%init> +</%init> +<%args> +$CustomField => undef +</%args> 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 <jesse@bestpractical.com> +%# +%# (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 +<FORM METHOD=get ACTION="<% $RT::WebPath %>/Admin/Users/Create.html"> +<&|/l&>New user called</&> <INPUT NAME="Name" size=10><input type=submit value="<&|/l&>Create</&>"> +</form> diff --git a/rt/html/Admin/Elements/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 <jesse@bestpractical.com> +%# +%# (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 &> + + +<FORM METHOD=GET ACTION="CustomField.html"> +<INPUT TYPE=HIDDEN NAME="CustomField" VALUE="<%$id %>"> +<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>"> + +<TABLE WIDTH="100%" BORDER="0"> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Name</&>: +</TD><TD> +<input name="Name" VALUE="<%$CustomFieldObj->Name%>" SIZE=20> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Description</&>: +</TD><TD> +<input name="Description" VALUE="<%$CustomFieldObj->Description%>" SIZE=80> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Type</&>: +</TD><TD> +<& /Admin/Elements/SelectCustomFieldType, Name => "Type", Default => $CustomFieldObj->Type &> +</TD></TR> +<TR><TD> +</TD><TD> +<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this custom field)</&> +</TD></TR> +</TABLE> + +<P> +% if ($CustomFieldObj->Id and $CustomFieldObj->Type =~ /Select/) { +<h2><&|/l&>Values</&></h2> +<font size=-1> +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +</font> +% } +<&/Elements/Submit&> +</FORM> + + + +<%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 =""; + } + +} + + +</%INIT> +<%ARGS> +$id => undef +$title => undef +$Queue => undef +$CustomField => undef +$Type => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<i><&|/l&>(Check box to delete)</&></i> +<ul> +% while (my $v = $values->Next) { +<li> +<font size=-1 color="#336699"><%$v->SortOrder%>:</font> +<input type="checkbox" name="CustomField-<%$CustomField->Id%>-DeleteValue" value="<%$v->id%>"> +<%$v->Name%> +% if ($v->Description) { +<i>(<%$v->Description%>)</i> +% } +</li> +% } +</ul> +<%init> +my $values = $CustomField->Values(); +</%init> +<%args> +$CustomField => undef +</%args> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<TABLE> +<TR> +<TD VALIGN=TOP> +<%$caption%>:<BR> +</TD></TR></TABLE> +% if ($CustomFields->Count == 0 ) { +<P><i><&|/l&>(No custom fields)</&></i></P> +% } else { +<TABLE> + +<TR> +<TD ROWSPAN="<% $CustomFields->Count %>"> +<UL> +% while (my $CustomFieldObj = $CustomFields->Next) { +<LI><A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><b><%$CustomFieldObj->Name%></b></a> (<% $CustomFieldObj->FriendlyType %>)<br> +<%$CustomFieldObj->Description%> +</LI> +% } +</UL> +</TD> + +% my $count; +% while (my $CustomFieldObj = $CustomFields->Next) { +% # show 'move up' unless it's the first item +% if ($count++) { +<TR><TD> +<a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a> +% } else { +<TD ALIGN=RIGHT> +% } + +% # show 'move down' unless it's the last item +% if (!$CustomFields->IsLast) { +% $m->print(' | ') if $count > 1; +<a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a> +% } +</TD></TR> +% } + +</TD> +</TR> +</TABLE> +% } +<FORM METHOD=GET ACTION="CustomFields.html"> +% if ($id) { +<INPUT TYPE="Hidden" NAME="id" VALUE="<%$id%>"> +% } +<input type="checkbox" name="FindDisabledCustomFields"> <&|/l&>Include disabled custom fields in listing.</&> +<input type=submit value="<&|/l&>Go!</&>"> +</FORM> + + +<%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; + } + } + # }}} +} +# }}} + +</%INIT> +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$CustomField => undef +$FindDisabledCustomFields => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 ) { +<ul> +<li><i><&|/l&>none</&></i> +% } else { +<i><&|/l&>(Check box to delete)</&></i><br><BR> +<ul> +% while (my $watcher=$Members->Next) { +<li> +<INPUT TYPE=CHECKBOX + NAME="Queue-<%$QueueObj->Id%>-DelWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" + UNCHECKED> +% if ($watcher->MemberObj->IsUser) { +<a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } else { +<a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> +% } +<%$watcher->MemberObj->Object->Name%></a> +% } +% } +</ul> + +<%INIT> +my $Members = $Watchers->MembersObj; +</%INIT> + +<%ARGS> +$QueueObj => undef +$Watchers => undef +</%ARGS> + + + 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 <jesse@bestpractical.com> +%# +%# (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 &> + + +<FORM METHOD=POST ACTION="Scrip.html"> +<input type="hidden" name="id" value="<%$id%>"> +<input type="hidden" name="Queue" value="<%$Queue%>"> +<TABLE> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>: +</TD> +<TD> +<input Name="Scrip-<%$id%>-Description" value="<%$scrip->Description%>"> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Condition</&>: +</TD> +<TD> +<& /Admin/Elements/SelectScripCondition, Name => "Scrip-$id-ScripCondition", Default => $scrip->ConditionObj->Id &><BR> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Custom condition</&>: +</TD> +<TD> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomIsApplicableCode"><%$scrip->CustomIsApplicableCode%></TEXTAREA> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Action</&>: +</TD> +<TD> +<& /Admin/Elements/SelectScripAction, Name => "Scrip-$id-ScripAction", Default => $scrip->ActionObj->Id &> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Custom action preparation code</&>: +</TD> +<TD> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomPrepareCode"><%$scrip->CustomPrepareCode%></TEXTAREA> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Custom action cleanup code</&>: +</TD> +<TD> +<TEXTAREA COLS=80 ROWS=5 NAME="Scrip-<%$id%>-CustomCommitCode"><%$scrip->CustomCommitCode%></TEXTAREA> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Template</&>: +</TD> +<TD> +<& /Admin/Elements/SelectTemplate, Name => "Scrip-$id-Template", Default => $scrip->TemplateObj->Id, Queue => $Queue &> +</TD> +</TR> + +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +</FORM> +<%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'; +} + +# }}} +</%init> + +<%ARGS> +$id => undef +$title => undef +$Queue => 0 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<form action="Scrips.html" method="post"> +<input type="hidden" name="id" value="<%$id%>"> + +<P><&|/l&>Current Scrips</&>:</P> +% if ($Scrips->Count == 0 ) { +<P><i><&|/l&>(No scrips)</&></i></P> +% } else { +<TABLE> +<P><i><&|/l&>(Check box to delete)</&></i></P> + +% while (my $scrip = $Scrips->Next ) { +<TR> +<TD> +<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>"> +</TD> +<TD> +<a href="Scrip.html?id=<%$scrip->Id%>&Queue=<%$id%>"><% $scrip->Description || "<i>(".loc('no value').")</i>" |n %></a><br> +<small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small> +</TD> +</TR> +% } + +</TABLE> + +% } +<& /Elements/Submit &> +</form> +<%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; + } + } + # }}} +} +# }}} +</%init> + +<%ARGS> +$id => undef +$title => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<FORM METHOD=GET ACTION="Templates.html"> +<INPUT TYPE="Hidden" NAME="id" VALUE="<%$id%>"> + +% if ($Templates->Count == 0 ) { +<P><i><&|/l&>(No templates)</&></i></P> +% } else { +<TABLE> +<TR> +<TH> +<i><&|/l&>(Check box to delete)</&></i> +</TH> +<TH> +</TH> +</TR> +% my $count; +% while (my $TemplateObj = $Templates->Next) { +<TR> +<TD> +<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>"> +</TD> +<TD> +<A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>"> +<B><% loc($TemplateObj->Name) %></B></A> +<br><% loc($TemplateObj->Description) %> +</TD> +</TR> + +% } +</TABLE> +% } + +<& /Elements/Submit &> +</FORM> + +<%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; + } + } + # }}} +} +# }}} +</%INIT> +<%ARGS> +$id => 0 +$title => undef +$Move => undef +$Source => undef +$Template => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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</&>:<br> +<input type="hidden" name="id" value="<%$id%>"> +<TEXTAREA COLS=60 ROWS=15 WRAP=SOFT NAME="Comments"><% $UserObj->Comments %></TEXTAREA> +</FORM> + +<%ARGS> +$UserObj => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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; + +</%INIT> +<%ARGS> +$GroupObj => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef +</%ARGS> + 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 <jesse@bestpractical.com> +%# +%# (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 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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++; +<font size="-1"><%$CustomFieldObj->id%>/<% loc($CustomFieldObj->Type) %>/<%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%></font> +<BR> +% } +% if (!$count) { +<font size="-1"><&|/l&>(No custom fields)</&></font> +% } + +<%init> +my $CustomFields = new RT::CustomFields ($session{'CurrentUser'}); +$CustomFields->LimitToGlobal(); +</%INIT> 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 <jesse@bestpractical.com> +%# +%# (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++; +<font size="-1"><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></font> +<BR> +% } +% if (!$count) { +<font size="-1"><&|/l&>(No scrips)</&></font> +% } + +<%init> +my $Scrips = new RT::Scrips ($session{'CurrentUser'}); +$Scrips->LimitToGlobal(); +</%INIT> 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 <jesse@bestpractical.com> +%# +%# (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) &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>"> +<TABLE> +<TR><TD ALIGN=RIGHT> +<&|/l&>Queue Name</&>: +</TD> +<TD><INPUT name="Name" value="<%$QueueObj->Name%>"></TD> +</TR><TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$QueueObj->Description%>" size=60></TD></TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Correspondence Address</&>: +</TD><TD> +<INPUT name="CorrespondAddress" value="<%$QueueObj->CorrespondAddress%>"> +</TD> +<TD ALIGN=RIGHT> + +<&|/l&>Comment Address</&>: </TD><TD> +<INPUT NAME="CommentAddress" value="<%$QueueObj->CommentAddress%>"> +</TD> +</TR><TR> + +<TD ALIGN=RIGHT> +<&|/l&>Priority starts at</&>: +</TD><TD><INPUT NAME="InitialPriority" value="<%$QueueObj->InitialPriority %>"> +</TD> +<TD ALIGN=RIGHT> +<&|/l&>Over time, priority moves toward</&>: +</TD><TD><INPUT NAME="FinalPriority" value="<%$QueueObj->FinalPriority %>"> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Requests should be due in</&>: +</TD><TD> +<INPUT NAME="DefaultDueIn" VALUE="<%$QueueObj->DefaultDueIn%>"> <&|/l&>days</&>. +</TD> +</TR> +</TABLE> +<& /Elements/Submit &> +</form> +<& /Elements/TitleBoxEnd &> + +<%INIT> + +</%INIT> + +<%ARGS> + + +$QueueObj => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<TABLE> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Name</&>: +</TD> +<TD> +<input name="Name" VALUE="<%$Name%>" SIZE=20><BR> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>: +</TD> +<TD> +<input name="Description" VALUE="<%$Description%>" SIZE=80><BR> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT VALIGN=TOP> +<&|/l&>Content</&>:<BR> +</TD> +<TD> +<TEXTAREA NAME=Content ROWS=25 COLS=80 WRAP=SOFT> +<%$Content%></TEXTAREA> +</TD> +</TR> +</TABLE> + +<%INIT> + +</%INIT> + +<%ARGS> +$Name => undef +$Description => undef +$Content => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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) &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>"> + +<&|/l&>Name</&>: <input name="Name" value="<%$UserObj->Name%>"> +<BR> +<&|/l&>New Password</&>: <input type=password name="Pass1"><BR> +<&|/l&>Retype Password</&>: <input type=password name="Pass2"><BR> + +<&|/l&>Comments</&>: <TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL> +<%$UserObj->Comments%></TEXTAREA> + +<BR> +<&|/l&>Signature</&>: <TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> +<%$UserObj->Signature%></TEXTAREA> +<BR> +<&|/l&>EmailAddress</&>: <input name="EmailAddress" value="<%$UserObj->EmailAddress%>"> +<BR> +<&|/l&>FreeformContactInfo</&>: <input name="FreeformContactInfo" value="<%$UserObj->FreeformContactInfo%>"> +<BR> +<&|/l&>Organization</&>: <input name="Organization" value="<%$UserObj->Organization%>"> +<BR> +<&|/l&>RealName</&>: <input name="RealName" value="<%$UserObj->RealName%>"> +<BR> +<&|/l&>NickName</&>: <input name="NickName" value="<%$UserObj->NickName%>"> +<BR> +<&|/l&>Lang</&>: <input name="Lang" value="<%$UserObj->Lang%>"> +<BR> +<&|/l&>EmailEncoding</&>: <input name="EmailEncoding" value="<%$UserObj->EmailEncoding%>"> +<BR> +<&|/l&>WebEncoding</&>: <input name="WebEncoding" value="<%$UserObj->WebEncoding%>"> +<BR> +<&|/l&>ExternalContactInfoId</&>: <input name="ExternalContactInfoId" value="<%$UserObj->ExternalContactInfoId%>"> +<BR> +<&|/l&>ContactInfoSystem</&>: <input name="ContactInfoSystem" value="<%$UserObj->ContactInfoSystem%>"> +<BR> +<&|/l&>UnixUsername</&>: <input name="Gecos" value="<%$UserObj->Gecos%>"> +<BR> +<&|/l&>ExternalAuthId</&>: <input name="ExternalAuthId" value="<%$UserObj->ExternalAuthId%>"> +<BR> +<&|/l&>AuthSystem</&>: <input name="AuthSystem" value="<%$UserObj->AuthSystem%>"> +<BR> +<&|/l&>HomePhone</&>: <input name="HomePhone" value="<%$UserObj->HomePhone%>"> +<BR> +<&|/l&>WorkPhone</&>: <input name="WorkPhone" value="<%$UserObj->WorkPhone%>"> +<BR> +<&|/l&>MobilePhone</&>: <input name="MobilePhone" value="<%$UserObj->MobilePhone%>"> +<BR> +<&|/l&>PagerPhone</&>: <input name="PagerPhone" value="<%$UserObj->PagerPhone%>"> +<BR> +<&|/l&>Address1</&>: <input name="Address1" value="<%$UserObj->Address1%>"> +<BR> +<&|/l&>Address2</&>: <input name="Address2" value="<%$UserObj->Address2%>"> +<BR> +<&|/l&>City</&>: <input name="City" value="<%$UserObj->City%>"> +<BR> +<&|/l&>State</&>: <input name="State" value="<%$UserObj->State%>"> +<BR> +<&|/l&>Zip</&>: <input name="Zip" value="<%$UserObj->Zip%>"> +<BR> +<&|/l&>Country</&>: <input name="Country" value="<%$UserObj->Country%>"> +<BR> +<& /Elements/Submit &> +</form> +<& /Elements/TitleBoxEnd &> + +<%INIT> + +</%INIT> + +<%ARGS> + + +$UserObj => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<UL> +%while(my $ACE = $ACL->Next) { + +<LI><checkbox name="delete_ace_<%$ACE->id%>"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) + +%} +</UL> + +<%INIT> +my $ACL = new RT::ACL($session{'CurrentUser'}); +$ACL->LimitToQueue($QueueObj->id); +$ACL->LimitPrincipalToUser($PrincipalId); +</%INIT> +<%ARGS> +$PrincipalId => undef +$QueueObj => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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; +</%INIT> + +<%ARGS> +$QueueObj => undef +$id => undef +$subtabs => undef +$current_subtab => undef +$current_tab => undef +$Title => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT NAME ="<%$Name%>"> +%for my $option ($cf->Types) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyType($option) %></OPTION> +%} +</SELECT> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'Type' +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> +%while (my $group = $groups->Next) { +<OPTION VALUE="<%$group->id%>"><%$group->Name%> +%} +</SELECT> + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => 'System'); + +</%INIT> +<%ARGS> +$Name => 'groups' +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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) { +<A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR> +%} +<%INIT> +my ($Group); +my $Groups = new RT::Groups($session{'CurrentUser'}); +$Groups->UnLimit; +</%INIT> +<%ARGS> +</%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 <jesse@bestpractical.com> +%# +%# (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) { +<A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR> +%} +<%INIT> +my ($queue); +my $queues = new RT::Queues($session{'CurrentUser'}); +$queues->UnLimit; +</%INIT> +<%ARGS> +</%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 <jesse@bestpractical.com> +%# +%# (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) { +<A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR> +%} +<%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'); + +} +</%INIT> +<%ARGS> +$IdLike => undef +$EmailLike => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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') { +<b><&|/l&>Users</&></b> +<SELECT MULTIPLE NAME="<%$Name%>Users" SIZE=10> +%while (my $user = $users->Next) { +<OPTION VALUE="User-<%$user->id%>"><%$user->Name%></OPTION> +%} +</SELECT> +<br> +% } +% if ($Show ne 'Users') { +<b><&|/l&>Groups</&></b> +<SELECT MULTIPLE NAME="<%$Name%>Groups" SIZE=10> +%while (my $group = $groups->Next) { +<OPTION VALUE="Group-<%$group->id%>"><%$group->Name%></OPTION> +%} +</SELECT> +% } + +<%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'); + + +</%INIT> +<%ARGS> +$Name => 'Users' +$Show => 'All' +$Group +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<INPUT TYPE=HIDDEN NAME="CheckACL" VALUE="<%$ACLDesc%>"> + <TABLE BORDER=0> +<TR> +<TD valign=top width="180"> +<h3><&|/l&>Current rights</&></h3> +% if ($ACLObj->Count() > 0) { +<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> +% } else { +<i><&|/l&>No rights granted.</&></i> <BR> +% } +% while (my $right = $ACLObj->Next()) { +% if ($right->RightName) { +<input type=checkbox value="<%$right->Id%>" name="RevokeRight-<%$ACLDesc%>-<%$right->RightName%>"> <% loc($right->RightName) %><br> +% } +% } +</TD> +<TD valign=top> +<h3><&|/l&>New rights</&></h3> +<SELECT SIZE=5 MULTIPLE NAME="GrantRight-<%$ACLDesc%>"> +% foreach $right (sort keys %Rights) { + <OPTION VALUE="<%$right%>" + ><% loc($right) %></OPTION> +% } +<OPTION VALUE="" SELECTED><&|/l&>(no value)</&></OPTION> +</SELECT> +</TD> +</TR> +</TABLE> +<%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; +</%INIT> + +<%ARGS> +$PrincipalType => undef +$PrincipalId => undef +$Object =>undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $Scrip = $Scrips->Next) { +<OPTION VALUE=<% $Scrip->Id %> +<% $Scrip->Id == $Default && 'SELECTED' %> +><% loc($Scrip->Name) %> +</OPTION> +%} +</SELECT> + +<%INIT> +my $Scrips = RT::Scrips->new($session{'CurrentUser'}); +$Scrips->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'Scrip' + +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $ScripAction = $ScripActions->Next) { +<OPTION VALUE=<%$ScripAction->Id%> +<% $ScripAction->Id == $Default && 'SELECTED' %> +><% loc($ScripAction->Name) %> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripActions = RT::ScripActions->new($session{'CurrentUser'}); +$ScripActions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripAction' + +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq undef && 'SELECTED' %> +>-</OPTION> +%while (my $ScripCondition = $ScripConditions->Next) { +<OPTION VALUE=<%$ScripCondition->Id%> +<% $ScripCondition->Id == $Default && 'SELECTED' %> +><% loc($ScripCondition->Name) %> +</OPTION> +%} +</SELECT> + +<%INIT> +my $ScripConditions = RT::ScripConditions->new($session{'CurrentUser'}); +$ScripConditions->UnLimit; + + + +</%INIT> +<%ARGS> + +$Default => undef +$Name => 'ScripCondition' + +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 + <select name="<%$Name%>"> + <option value="1" <%$SingleDefault%>><&|/l&>Single</&></option> + <option value="0" <%$MultipleDefault%>><&|/l&>Multiple</&></option> + </select> + + +<%INIT> +my ($SingleDefault, $MultipleDefault); +if ($Default == 1) { + $SingleDefault = "SELECTED"; +} +elsif ($Default == 0 ) { + $MultipleDefault = "SELECTED"; +} + +</%INIT> +<%ARGS> +$Name => 'Single' +$Default => 1 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT NAME=<%$Name%>> +<OPTION VALUE="" +<% $Default eq 'none' && 'SELECTED' %> +>-</OPTION> +%while (my $Template = $PrimaryTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED' %> +><% loc($Template->Name) %> +</OPTION> +%} +%while (my $Template = $OtherTemplates->Next) { +<OPTION VALUE=<%$Template->Id%> +<% ($Template->Id == $Default) && 'SELECTED'%> +><&|/l, loc($Template->Name) &>Global template: [_1]</&> +</OPTION> +%} +</SELECT> + +<%INIT> + + +my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'}); +if ($Queue != 0) { +$PrimaryTemplates->LimitToQueue($Queue); +} + +my $OtherTemplates = RT::Templates->new($session{'CurrentUser'}); +$OtherTemplates->LimitToGlobal($DefaultQueue); + +</%INIT> +<%ARGS> + +$Queue => undef +$Default => 'none' +$DefaultQueue => undef +$Name => 'Template' + +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> +%while (my $user = $users->Next) { +<OPTION VALUE="<%$user->id%>"><%$user->Name%> +%} +</SELECT> + +<%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(); + +</%INIT> +<%ARGS> +$Name => 'Users' +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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; + } + } + +</%INIT> + + +<%ARGS> +$subtabs => undef +$current_tab => undef +$current_subtab => undef +$Title => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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; + } +} +</%INIT> + + +<%ARGS> +$UserObj => undef +$id => undef +$current_tab => undef +$current_subtab => undef +$Title => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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" + }; +} +</%INIT> +<%ARGS> +$CustomField => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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"); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + +<& /Elements/TitleBoxStart, title => loc('Modify global group rights.')&> + +<h1><&|/l&>System groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object =>$RT::System &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>Roles</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToRolesForSystem(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $RT::System &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>User defined groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $Group->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $RT::System &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +my $Groups; + +</%INIT> + +<%ARGS> +</%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 <jesse@bestpractical.com> +%# +%# (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"); +} +</%init> 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 <jesse@bestpractical.com> +%# +%# (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 &> +</form> +<%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); + +</%init> + + + +<%ARGS> +$id => 0 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + +<FORM METHOD=POST ACTION="Template.html"> +%if ($Create ) { +<INPUT TYPE=HIDDEN NAME="Template" VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME="Template" VALUE="<%$TemplateObj->Id%>"> +% } + +%# hang onto the queue id +<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>"> + +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => $TemplateObj->Description, Content => $TemplateObj->Content &> + +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +</FORM> + + + +<%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; +} +</%INIT> +<%ARGS> +$Queue => undef +$Template => undef +$Create => undef +$Name => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> +</form> +<%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); + +</%init> + + + +<%ARGS> +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="UserRights.html"> + +<& /Elements/TitleBoxStart, title => loc('Modify global user rights.') &> + +<TABLE> + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $group->PrincipalId, + Object => $RT::System &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%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(); + + + +# }}} + +</%INIT> + +<%ARGS> +</%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 <jesse@bestpractical.com> +%# +%# (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') &> + +<ul> +% foreach my $key (sort keys %$tabs) { +<li><font size="+2"><a href="<% $tabs->{$key}{path} %>"><% $tabs->{$key}{title} %></a></font><br> +<% $tabs->{$key}{text} %> +</li> +% } +</ul> + +<%INIT> + my $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', + } + +}; +</%INIT> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $GroupObj->id %>"> + +<& /Elements/TitleBoxStart, title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> + +<h1><&|/l&>System groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>User defined groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $Group->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%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; + +</%INIT> + +<%ARGS> +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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) &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Members.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>"> +<TABLE WIDTH="100%"> +<TR> +<TD> +<h3><&|/l&>Current members</&></h3> +</TD> +<TD> +<h3><&|/l&>Add members</&></h3> +</TD> +</TR> + +<TR> +<TD VALIGN=TOP> + +% if ($Group->MembersObj->Count == 0 ) { +<i><&|/l&>(No members)</&></i> +% } else { +<i><&|/l&>(Check box to delete)</&></i> +<br> +<br> +<&|/l&>Users</&> +% my $UserMembers = $Group->MembersObj; +% $UserMembers->LimitToUsers(); +<UL> +% while (my $member = $UserMembers->Next()) { +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) +% } +</ul> +<&|/l&>Groups</&> +<ul> +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while (my $member = $GroupMembers->Next()) { +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<%$member->MemberObj->Object->Name%> +% } +% } +</UL> +</TD> +<TD VALIGN=TOP> +<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group &> +</TD> +</TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +</form> + + +<%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); +} + + +</%INIT> + +<%ARGS> +$AddMembersUsers => undef +$AddMembersGroups => undef +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + + +<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST> + +%unless ($Group->Id) { +<INPUT TYPE=HIDDEN NAME=id VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>"> +% } +<TABLE> +<TR><TD ALIGN=RIGHT> +<&|/l&>Name</&>: +</TD> +<TD><INPUT name="Name" value="<%$Group->Name%>"></TD> +</TR><TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD> +</TR><TR> +<TD COLSPAN=2> +<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> +</TR> +</TABLE> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +</form> +<%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"; +} + + +</%INIT> + + +<%ARGS> +$Create => undef +$Name => undef +$Description => undef +$SetEnabled => undef +$Enabled => undef +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="UserRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $GroupObj->id %>"> + +<& /Elements/TitleBoxStart, title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> + +<TABLE> + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Member->MemberObj->Id, + PrincipalType => 'User', + Object => $GroupObj &> + </TD> + </TR> +% } + </TABLE> + + <& /Elements/TitleBoxEnd &> + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%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(); + + + +# }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + +<UL> +%while ( my $Group = $Groups->Next) { +<LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><BR> +%} +</UL> + +<%INIT> +my $Groups = RT::Groups->new($session{'CurrentUser'}); +$Groups->LimitToUserDefinedGroups(); +my $title = loc('Select a group'); + +</%INIT> +<%ARGS> +</%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 <jesse@bestpractical.com> +%# +%# (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 + } + }; + +</%INIT> +<%ARGS> +$CustomField => undef +$Queue => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>"> + + +<h1><&|/l&>System groups</&></h1> +<TABLE> +<& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $QueueObj &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>Roles</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToRolesForQueue($QueueObj->Id); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $QueueObj &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>User defined groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $Group->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $QueueObj &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%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; + +</%INIT> + +<%ARGS> +$id => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + + +<FORM ACTION="<%$RT::WebPath%>/Admin/Queues/Modify.html" METHOD=POST> +%if ($Create ) { +<INPUT TYPE=HIDDEN NAME=id VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>"> +% } + +<TABLE> +<TR><TD ALIGN=RIGHT> +<&|/l&>Queue Name</&>: +</TD> +<TD><INPUT name="Name" value="<% ($Create) ? "" : $QueueObj->Name %>"></TD> +</TR><TR> +<TD ALIGN=RIGHT> +<&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<% ($Create) ? "" : $QueueObj->Description %>" size=60></TD></TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Correspondence Address</&>: +</TD><TD> +<INPUT name="CorrespondAddress" value="<% ($Create) ? "" : $QueueObj->CorrespondAddress %>"> +<BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1]</&></i></font> +</TD> +<TD ALIGN=RIGHT> + +<&|/l&>Comment Address</&>: </TD><TD> +<INPUT NAME="CommentAddress" value="<% ($Create) ? "" : $QueueObj->CommentAddress %>"> +<BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1]</&></i></font> +</TD> +</TR><TR> + +<TD ALIGN=RIGHT> +<&|/l&>Priority starts at</&>: +</TD><TD><INPUT NAME="InitialPriority" value="<% ($Create) ? "" : $QueueObj->InitialPriority %>"> +</TD> +<TD ALIGN=RIGHT> +<&|/l&>Over time, priority moves toward</&>: +</TD><TD><INPUT NAME="FinalPriority" value="<% ($Create) ? "" : $QueueObj->FinalPriority %>"> +</TD> +</TR> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>Requests should be due in</&>: +</TD><TD> +<INPUT NAME="DefaultDueIn" VALUE="<% ($Create) ? "" : $QueueObj->DefaultDueIn%>"> <&|/l&>days</&>. +</TD> +</TR> +<TR> +<TD> +</TD> +<TD COLSPAN=4><INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this queue)</&><BR> +<& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &> +</TD> +</TR> + +</TABLE> +<& /Elements/Submit &> +</form> + + + +<%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 =""; + } +} +</%INIT> + + +<%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 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + +<FORM METHOD=POST ACTION="People.html"> +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$QueueObj->Id%>"> + +<TABLE WIDTH=100%> +<TR> +<TD VALIGN=TOP > + +<h3><&|/l&>Current watchers</&></h3> + + +<&|/l&>Cc</&>: + +<& /Admin/Elements/EditQueueWatchers, QueueObj => $QueueObj, Watchers => $QueueObj->Cc &> + +<&|/l&>Administrative Cc</&>: + +<& /Admin/Elements/EditQueueWatchers, QueueObj => $QueueObj, Watchers => $QueueObj->AdminCc &> + + +</TD> +<TD VALIGN=TOP> +<h3><&|/l&>New watchers</&></h3> + +<&|/l&>Find people whose</&><BR> +<& /Elements/SelectUsers &> +<input type=submit name="OnlySearchForPeople" value="<&|/l&>Go!</&>"> +<BR> +<&|/l&>Find group whose</&><BR> +<& /Elements/SelectGroups &> +<input type=submit name="OnlySearchForGroup" value="<&|/l&>Go!</&>"> + +<p> +<&|/l&>Add new watchers</&>:<br> +<p> +<b><&|/l&>Users</&></b> +% if ($user_msg) { +<br> +<i><%$user_msg%></i> +% } elsif ($Users) { +<ul> +% while (my $u = $Users->Next ) { +<li><&/Elements/SelectWatcherType, Scope=>'queue', Name => +"Queue-AddWatcher-Principal-".$u->PrincipalId &> <%$u->Name%> +(<%$u->RealName%>) +% } +</ul> +% } + +<p> +<b><&|/l&>Groups</&></b> + +% if ($group_msg) { +<br> +<i><%$group_msg%></i> +% } elsif ($Groups) { +<ul> +% while (my $g = $Groups->Next ) { +<li><&/Elements/SelectWatcherType, Scope=>'queue', Name => +"Queue-AddWatcher-Principal-".$g->PrincipalId &> <%$g->Name%> +(<%$g->Description%>) +% } +</ul> +% } + +</TD> +</TR> +</TABLE> + + + + +<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), Reset => 1 &> +</form> + +<%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; +</%INIT> + +<%ARGS> +$UserField => 'Name' +$UserOp => '=' +$UserString => undef +$GroupField => 'Name' +$GroupOp => '=' +$GroupString => undef +$Type => undef +$id => undef +</%ARGS> + 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 <jesse@bestpractical.com> +%# +%# (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); +} + + +</%init> + +<%ARGS> +$id => undef +$Queue => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 +<h2><&|/l&>Scrips which apply to all queues</&></h2> +<& /Admin/Elements/ListGlobalScrips &> +<BR> +% } +<& /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, + } + }; +</%init> + +<%ARGS> +$id => undef #some identifier that a Queue could +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<FORM METHOD=POST ACTION="Template.html"> +%if ($Create ) { +<INPUT TYPE=HIDDEN NAME="Template" VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME="Template" VALUE="<%$TemplateObj->Id%>"> +% } + +%# hang onto the queue id +<INPUT TYPE=HIDDEN name="Queue" value="<%$Queue%>"> +<& /Admin/Elements/ModifyTemplate, Name => $TemplateObj->Name, Description => +$TemplateObj->Description, Content => $TemplateObj->Content &> +<& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> +</FORM> + + +<%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; +} + +</%INIT> +<%ARGS> +$Queue => undef +$Template => undef +$Create => undef +$Name => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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, + } + }; + +</%INIT> +<%ARGS> +$id => undef #some identifier that a Queue could +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + + <FORM METHOD=POST ACTION="UserRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>"> + + +<TABLE> +<& /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); + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $QueueObj &> + </TD> + </TR> +% } + </TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%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; +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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%>:<BR> +<UL> +%if ($queues->Count == 0) { +<LI> <i><&|/l&>No queues matching search criteria found.</&></i> +% } +%while ( $queue = $queues->Next) { +<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI> +%} +</UL> +<BR> +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Queues/"> +<input type="checkbox" name="FindDisabledQueues"> <&|/l&>Include disabled queues in listing.</&> +<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> +</FORM> + +<%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"); +} + +</%INIT> +<%ARGS> +$FindDisabledQueues => 0 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST> +%if ($Create) { +<INPUT TYPE=HIDDEN NAME=id VALUE="new"> +% } else { +<INPUT TYPE=HIDDEN NAME=id VALUE="<%$UserObj->Id%>"> +% } +<TABLE WIDTH=100% BORDER=0> +<TR> + +<TD VALIGN=TOP ROWSPAN=2> +<& /Elements/TitleBoxStart, title => loc('Identity') &> + +<TABLE> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Username</&>: +</TD><TD> +<input name="Name" value="<%$UserObj->Name%>"> <b><&|/l&>(required)</&></b> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Email</&>: +</TD><TD> +<input name="EmailAddress" value="<%$UserObj->EmailAddress%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Real Name</&>: +</TD><TD> +<input name="RealName" value="<%$UserObj->RealName%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Nickname</&>: +</TD><TD> +<input name="NickName" value="<%$UserObj->NickName%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Unix login</&>: +</TD><TD> +<input name="Gecos" value="<%$UserObj->Gecos%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Extra info</&>: +</TD><TD> +<textarea name="FreeformContactInfo" cols=20 rows=5><%$UserObj->FreeformContactInfo%></TEXTAREA> +</TD></TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<br> +<& /Elements/TitleBoxStart, title => loc('Access control') &> +<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> +<&|/l&>Let this user access RT</&><BR> + + +<INPUT TYPE=HIDDEN NAME="SetPrivileged" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Privileged" VALUE="1" <%$PrivilegedChecked%>> <&|/l&>Let this user be granted rights</&><BR> + +% unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { +<TABLE> +<TR> +<TD ALIGN=RIGHT> +<&|/l&>New Password</&>: +</TD> +<TD ALIGN=LEFT> +<input type=password name="Pass1"> +</TD> +</TR> +<TR><TD ALIGN=RIGHT> +<&|/l&>Retype Password</&>: +</TD> +<TD> +<input type=password name="Pass2"> +</TD> +</TR> +</TABLE> +% } +<& /Elements/TitleBoxEnd &> +</TD> +</TR> +<TR> + +<TD VALIGN=TOP> +<& /Elements/TitleBoxStart, title => loc('Location') &> +<TABLE> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Organization</&>: +</TD><TD> +<input name="Organization" value="<%$UserObj->Organization%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Address1</&>: +</TD><TD> +<input name="Address1" value="<%$UserObj->Address1%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Address2</&>: +</TD><TD> +<input name="Address2" value="<%$UserObj->Address2%>"> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>City</&>: +</TD><TD> +<input name="City" value="<%$UserObj->City%>" size=14> + +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>State</&>: +</TD><TD> +<input name="State" value="<%$UserObj->State%>" size=3> + +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Zip</&>: +</TD><TD> +<input name="Zip" value="<%$UserObj->Zip%>" size=9> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Country</&>: +</TD><TD> +<input name="Country" value="<%$UserObj->Country%>"> +</TD></TR> +</TABLE> +<& /Elements/TitleBoxEnd &> +<br> +<& /Elements/TitleBoxStart, title => loc('Phone numbers') &> +<TABLE> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Residence</&>: +</TD><TD> +<input name="HomePhone" value="<%$UserObj->HomePhone%>" size=13><br> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Work</&>: +</TD><TD> +<input name="WorkPhone" value="<%$UserObj->WorkPhone%>" size=13><br> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Mobile</&>: +</TD><TD> +<input name="MobilePhone" value="<%$UserObj->MobilePhone%>" size=13><br> +</TD></TR> +<TR><TD ALIGN="RIGHT"> +<&|/l&>Pager</&>: +</TD><TD> +<input name="PagerPhone" value="<%$UserObj->PagerPhone%>" size=13><br> +<& /Elements/TitleBoxEnd &> +</TD> + +<TR> +</TR> +</TABLE> +<TR> +<TD colspan="2"> +<& /Elements/TitleBoxStart, title => loc('Comments about this user') &> +<TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%> +</TEXTAREA> +<& /Elements/TitleBoxEnd &> +%if ($UserObj->Privileged) { +<BR> +<& /Elements/TitleBoxStart, title => loc('Signature') &> +<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> +<%$UserObj->Signature%></TEXTAREA> +<& /Elements/TitleBoxEnd &> +% } + +</TD> +</TR> +</TABLE> + +<& /Elements/Submit &> +</form> + +<%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"; +} + +# }}} +</%INIT> + + +<%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 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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 &> + +<h2 class="title"><%loc("User view")%></h2> + +%if ($session{CurrentUser} && ($session{CurrentUser}->Id == $id)) { + <& /Elements/TitleBoxStart, title => loc('Signature') &> +<form method=post> +<input type="hidden" name="id" value=<%$id%>> +<TEXTAREA COLS=72 ROWS=4 WRAP=HARD NAME="Signature"><% $u->Signature %></TEXTAREA><br><br> +<input type="submit" value="<&|/l&>Update signature</&>"> +</form> + <& /Elements/TitleBoxEnd &> + <form method=post> + <&|/l&>Open tickets (from listing) in another window</&>: <input type="checkbox" name="NewWindowOption" <%exists $session{NewWindowOption} && "CHECKED"%>><br> + <&|/l&>Open tickets (from listing) in a new window</&>: <input type="checkbox" name="AlwaysNewWindowOption" <%exists $session{AlwaysNewWindowOption} && "CHECKED"%>><br> + <input type="submit" name="NewWindowSetting" value="<&|/l&>New window setting</&>"> + </form> +%} + + <& /Elements/TitleBoxStart, title => loc('Email') &> +<form method=post> +<input type="hidden" name="id" value="<%$id%>"> +<input name="Email" value="<% $u->EmailAddress %>"><input type="submit" value="<&|/l&>Update email</&>"> +</form> + <& /Elements/TitleBoxEnd &> + <& /Elements/TitleBoxStart, title => loc('Real Name') &> +<form method=post> +<input type="hidden" name="id" value="<%$id%>"> +<input name="RealName" value="<% $u->RealName %>"><input type="submit" value="<&|/l&>Update name</&>"> +</form> + <& /Elements/TitleBoxEnd &> + + <& /Elements/TitleBoxStart, title => loc('User ID') &> +<form method=post> +<input type="hidden" name="id" value="<%$id%>"> +<input name="Name" value="<% $u->Name %>"><input type="submit" value="<&|/l&>Update ID</&>"> +</form> + <& /Elements/TitleBoxEnd &> + +%# TODO: alternative email addresses + merging users + +<%ARGS> +$id => $session{CurrentUser} ? $session{CurrentUser}->Id : 0 +$Signature => undef +$Email => undef +$RealName => undef +$Name => undef +</%ARGS> + +<%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}; +} +} + +</%INIT> + + + + + + + + + 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 <jesse@bestpractical.com> +%# +%# (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%>:<BR> +<UL> +%if ($users->Count == 0) { +<LI> <i><&|/l&>No users matching search criteria found.</&></i> +% } +%while ( $user = $users->Next) { +<LI><A HREF="Modify.html?id=<%$user->id%>"><%$user->Name || loc('(no name listed)')%></a></LI> +%} + +</UL> +<br><br> +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Users/"> + +<&|/l&>Find people whose</&> <& /Elements/SelectUsers &><BR> +<input type="checkbox" name="FindDisabledUsers"> <&|/l&>Include disabled users in search.</&> +<BR> +<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> +</FORM> + +<%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); + +} +} +</%INIT> +<%ARGS> +$UserString => undef +$UserOp => '=' +$UserField => 'Name' +$IdLike => undef +$EmailLike => undef +$FindDisabledUsers => 0 +</%ARGS> 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 <jesse@bestpractical.com> +%# +%# (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') &> + +<ul> +<li><font size="+2"><a href="Users/"><&|/l&>Users</&></a></font><br> +<&|/l&>Manage users and passwords</&> +</li> +<li><font size="+2"><a href="Groups/"><&|/l&>Groups</&></a></font><br> +<&|/l&>Manage groups and group membership</&> +</li> +<li><font size="+2"><a href="Queues/"><&|/l&>Queues</&></a></font><br> +<&|/l&>Manage queues and queue-specific properties</&> +</li> +<li><font size="+2"><a href="Global/"><&|/l&>Global</&></a></font><br> +<&|/l&>Manage properties and configuration which apply to all queues</&> +</li> +</ul> |