diff options
Diffstat (limited to 'rt/html')
275 files changed, 6003 insertions, 2433 deletions
diff --git a/rt/html/Admin/CustomFields/GroupRights.html b/rt/html/Admin/CustomFields/GroupRights.html new file mode 100644 index 000000000..380fee479 --- /dev/null +++ b/rt/html/Admin/CustomFields/GroupRights.html @@ -0,0 +1,170 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/GroupRights.html?id=".$id, + Title => $title +&> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="GroupRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $CustomFieldObj->id %>"> + + +<h1><&|/l&>System groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% loc($Group->Type) %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } +</TABLE> +<h1><&|/l&>User defined groups</&></h1> +<TABLE> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $Group->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } +</TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%INIT> + + + + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No CustomField defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load CustomField [_1]",$id)); + +my $Groups; + + my ( $ACL, @results ); + + foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", $object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : ($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right => $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", $object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => $right); + push (@results, $msg); + } +} + +my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name); + +</%INIT> + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/Modify.html b/rt/html/Admin/CustomFields/Modify.html new file mode 100644 index 000000000..4c3c92114 --- /dev/null +++ b/rt/html/Admin/CustomFields/Modify.html @@ -0,0 +1,212 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $CustomFieldObj->Id , + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + +<FORM METHOD="POST" ACTION="Modify.html" NAME="ModifyCustomField"> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<%$id %>"> +<table> +<tr> +<td class="label"><&|/l&>Name</&></td> +<td><input name="Name" VALUE="<%$CustomFieldObj->Name%>" SIZE=20></td></tr> +<tr> +<td class="label"><&|/l&>Description</&></td> +<td><input name="Description" VALUE="<%$CustomFieldObj->Description%>" SIZE=80></td> +</tr> + +<tr> +<td class="label"><&|/l&>Type</&></td> +<td><& /Admin/Elements/SelectCustomFieldType, + Name => "TypeComposite", + Default => $CustomFieldObj->TypeComposite, &> +</td> +</tr> +<tr> +<td class="label"><&|/l&>Applies to</&></td> +<td><& /Admin/Elements/SelectCustomFieldLookupType, + Name => "LookupType", + Default => $CustomFieldObj->LookupType, &> +</td> +</tr> +<tr> +<td class="label"> </td> +<td> +<INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> +<INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this custom field)</&> +</td> +</tr> +</table> +<BR> +% if ($CustomFieldObj->Id && $CustomFieldObj->Type =~ /^Select/i) { +<H2><&|/l&>Values</&></H2> +<div> +<& /Admin/Elements/EditCustomFieldValues, CustomField => $CustomFieldObj &> +<& /Admin/Elements/AddCustomFieldValue, CustomField => $CustomFieldObj &> +</div> +% } +<&/Elements/Submit&> +</FORM> + + + +<%INIT> + + + +my $CustomFieldObj = RT::CustomField->new( $session{'CurrentUser'} ); +my ( $title, @results, $EnabledChecked, $Disabled); +$EnabledChecked = "CHECKED"; + +if ( !$id ) { + $title = loc("Create a CustomField"); + $id = 'new'; +} +else { + + if ( $id eq 'new' ) { + my ( $val, $msg ) = $CustomFieldObj->Create(Name => $Name, + TypeComposite => $TypeComposite, + LookupType => $LookupType, + Description => $Description,); + $m->comp("/Elements/Error", Why => loc( "Could not create CustomField", $msg ) ) unless ($val); + push @results, $msg; + $title = loc( 'Created CustomField [_1]', $CustomFieldObj->Name() ); + } + else { + $CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc('No CustomField') ); + $title = loc( 'Editing CustomField [_1]', $CustomFieldObj->Name() ); + + my @attribs = qw( Name TypeComposite LookupType Description); + my @aresults = UpdateRecordObject( AttributesRef => \@attribs, + Object => $CustomFieldObj, + ARGSRef => \%ARGS ); + + push @results, @aresults; + + #we're asking about enabled on the web page but really care about disabled. + if ($Enabled == 1) { + $Disabled = 0; + } + else { + $Disabled = 1; + } + if ( ($SetEnabled) and ( $Disabled != $CustomFieldObj->Disabled) ) { + my ($code, $msg) = $CustomFieldObj->SetDisabled($Disabled); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); + } + + if ($CustomFieldObj->Disabled()) { + $EnabledChecked =""; + } + } + + $id = $CustomFieldObj->id; +} + + + + +my $paramtag = "CustomField-".$CustomFieldObj->Id."-Value-"; +# Delete any fields that want to be deleted +foreach my $key (keys %ARGS) { + + next unless ($key =~ /^Delete-$paramtag(\d+)$/); + my ($val, $msg) = $CustomFieldObj->DeleteValue($1); + push (@results, $msg); + + +} +# Update any existing values +my $values = $CustomFieldObj->ValuesObj; +while (my $value = $values->Next) { + foreach my $attr qw(Name Description SortOrder) { + my $param = $paramtag.$value->Id."-".$attr; + + if ( $ARGS{$param} && ($value->$attr() ne $ARGS{$param})) { + my $mutator = "Set$attr"; + my ($id, $msg) = $value->$mutator($ARGS{$param}); + push (@results, $msg); + } + } + + +} + + + +# Add any new values +if ($ARGS{$paramtag."new-Name"}) { + my ($id, $msg) = $CustomFieldObj->AddValue ( Name => $ARGS{$paramtag."new-Name"}, + Description => $ARGS{$paramtag."new-Description"}, + SortOrder => $ARGS{$paramtag."new-SortOrder"}); + push (@results, $msg); +} + +my $current_tab; +if ($ARGS{'Create'}){ + $current_tab = "Admin/CustomFields/Modify.html?Create=1"; +} else { + $current_tab = "Admin/CustomFields/Modify.html?id=".$id; + } + + +</%INIT> +<%ARGS> +$id => undef +$TypeComposite => undef +$LookupType => undef +$MaxValues => undef +$SortOrder => undef +$Description => undef +$Name => undef +$SetEnabled => undef +$Enabled => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/Objects.html b/rt/html/Admin/CustomFields/Objects.html new file mode 100644 index 000000000..8f9e3657b --- /dev/null +++ b/rt/html/Admin/CustomFields/Objects.html @@ -0,0 +1,145 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, + id => $id, + current_tab => "Admin/CustomFields/Objects.html?id=".$id, + Title => $title + &> + +<& /Elements/ListActions, actions => \@results &> + +<FORM ACTION="Objects.html" METHOD=POST> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $id %>"> +<INPUT TYPE=HIDDEN NAME="UpdateObjs" VALUE="1"> + +<h2><&|/l&>Selected objects</&></h2> +<& /Admin/Elements/PickObjects, Objects => \@AssignedObjs, id => $id, Checked => 1 &> +<h2><&|/l&>Unselected objects</&></h2> +<& /Admin/Elements/PickObjects, Objects => \@UnassignedObjs, id => $id &> + +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> +</FORM> + +<%INIT> +my $CF = RT::CustomField->new($session{'CurrentUser'}); +$CF->Load($id) or Abort(loc("Could not load CustomField [_1]"), $id); +my $LookupType = $CF->LookupType; +$LookupType =~ /^(.*?)-/ || + Abort(loc("Object of type [_1] cannot take custom fields", $LookupType)); + +my $Class = $1; +my $CollectionClass; +if (UNIVERSAL::can($Class.'Collection', 'new') ) { +$CollectionClass = $Class.'Collection'; + +} elsif (UNIVERSAL::can($Class.'es', 'new') ) { + $CollectionClass = $Class.'es'; + +} elsif (UNIVERSAL::can($Class.'s', 'new') ) { + $CollectionClass = $Class.'s'; + +} else { + Abort(loc("Can't find a collection class for '[_1]'", $Class)); +} + + +my $title = loc('Modify associated objects for [_1]', $CF->Name); + +my $Objects = $CollectionClass->new($session{'CurrentUser'}); +my (@results); +my (@AssignedObjs, @UnassignedObjs); + +$Objects->UnLimit; +$Objects->OrderBy( FIELD => 'Name' ); + + +my $ObjectCFs; +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToCustomField($id); + +my %seen; +while (my $OCF = $ObjectCFs->Next) { + $seen{$OCF->ObjectId}++; +} + +while (my $obj = $Objects->Next) { + my $obj_id = $obj->Id; + + if ($UpdateObjs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$obj_id-CF-$id"; + if ($ARGS{$key}) { + if (!$seen{$obj_id}) { + my ($val, $msg) = $CF->AddToObject($obj); + push (@results, $msg); + push @UnassignedObjs, $obj if !$val; + } + } + else { + push @UnassignedObjs, $obj; + if ($seen{$obj_id}) { + my ($val, $msg) = $CF->RemoveFromObject($obj); + push (@results, $msg); + pop @UnassignedObjs if !$val; + } + } + } + elsif (!$seen{$obj_id}) { + push @UnassignedObjs, $obj; + } + next if @UnassignedObjs and $UnassignedObjs[-1] == $obj; + push @AssignedObjs, $obj; +} + +</%INIT> +<%ARGS> +$id => undef +$FindDisabledObjects => 0 +$UpdateObjs => 0 +</%ARGS> diff --git a/rt/html/Admin/CustomFields/UserRights.html b/rt/html/Admin/CustomFields/UserRights.html new file mode 100644 index 000000000..e2df3a058 --- /dev/null +++ b/rt/html/Admin/CustomFields/UserRights.html @@ -0,0 +1,168 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/CustomFieldTabs, id => $id, +current_tab => "Admin/CustomFields/UserRights.html?id=".$id, +Title => $title, &> +<& /Elements/ListActions, actions => \@results &> + + <FORM METHOD=POST ACTION="UserRights.html"> + <INPUT TYPE=HIDDEN NAME=id VALUE="<% $CustomFieldObj->id %>"> + + +<TABLE> + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); +% my $group = RT::Group->new($session{'CurrentUser'}); +% $group->LoadACLEquivalenceGroup($Member->MemberObj); + <TR ALIGN=RIGHT> + <TD VALIGN=TOP> + <% $UserObj->Name %> + </TD> + <TD> + <& /Admin/Elements/SelectRights, PrincipalId=> $group->PrincipalId, + Object => $CustomFieldObj &> + </TD> + </TR> +% } + </TABLE> + + <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &> + + </FORM> + +<%INIT> + + #Update the acls. + my @results; +foreach my $arg (keys %ARGS) { + if ($arg =~ /GrantRight-(\d+)-(.*?)-(\d+)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $rights = $ARGS{$arg}; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + + } else { + push (@results, loc("System Error"). + loc("Rights could not be granted for [_1]", +$object_type)); + next; + } + + my @rights = ref($ARGS{$arg}) eq 'ARRAY' ? @{$ARGS{$arg}} : +($ARGS{$arg}); + foreach my $right (@rights) { + next unless ($right); + my ($val, $msg) = $principal->GrantRight(Object => $obj, Right +=> $right); + push (@results, $msg); + } + } + elsif ($arg =~ /RevokeRight-(\d+)-(.*?)-(\d+)-(.*?)$/) { + my $principal_id = $1; + my $object_type = $2; + my $object_id = $3; + my $right = $4; + + my $principal = RT::Principal->new($session{'CurrentUser'}); + $principal->Load($principal_id); + next unless ($right); + my $obj; + + if ($object_type eq 'RT::CustomField') { + $obj = RT::CustomField->new($session{'CurrentUser'}); + $obj->Load($object_id); + } else { + push (@results, loc("System Error"). + loc("Rights could not be revoked for [_1]", +$object_type)); + next; + } + my ($val, $msg) = $principal->RevokeRight(Object => $obj, Right => +$right); + push (@results, $msg); + } +} + + +# {{{ Deal with setting up the display of current rights. + + + +if (!defined $id) { + $m->comp("/Elements/Error", Why => loc("No Class defined")); +} + +my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); +$CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load Class [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + +my $title = loc('Modify user rights for custom field [_1]', $CustomFieldObj->Name); + +# }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +</%ARGS> diff --git a/rt/html/Admin/CustomFields/index.html b/rt/html/Admin/CustomFields/index.html new file mode 100644 index 000000000..9854fb0ec --- /dev/null +++ b/rt/html/Admin/CustomFields/index.html @@ -0,0 +1,76 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Select a Custom Field') &> +<& /Admin/Elements/CustomFieldTabs, + current_tab => 'Admin/CustomFields/', + Title => loc('Select a Custom Field') &> + +% my $prev_lookup = ''; +% while (my $CustomFieldObj = $CustomFields->Next) { +% $CustomFieldObj->CurrentUserHasRight('AdminCustomField') or next; +% my $lookup = $CustomFieldObj->FriendlyLookupType; +% if ($lookup ne $prev_lookup) { +% if ($prev_lookup) { +</UL> +% } +<H2><% loc("Custom Fields for [_1]", $lookup) %></H2> +<UL> +% $prev_lookup = $lookup; +% } +% +<LI> +<A HREF="Modify.html?id=<%$CustomFieldObj->id()%>"><%$CustomFieldObj->Name%>: <%$CustomFieldObj->Description%></a> +</LI> +% } +% if ($prev_lookup) { +</UL> +% } + +<%INIT> +my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$CustomFields->UnLimit(); +$CustomFields->OrderByCols( { FIELD => 'LookupType' }, { FIELD => 'Name' } ); +</%INIT> diff --git a/rt/html/Admin/Elements/AddCustomFieldValue b/rt/html/Admin/Elements/AddCustomFieldValue index 0e59fe320..3e3f414b3 100644 --- a/rt/html/Admin/Elements/AddCustomFieldValue +++ b/rt/html/Admin/Elements/AddCustomFieldValue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,20 +42,20 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <b><&|/l&>Add Value</&></b></b></b></b> <TABLE BORDER="0"> <TR><TD><small> <&|/l&>Sort</&>:<br> -<input name="CustomField-<% $CustomField->Id %>-AddValue-SortOrder" size="5"> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-new-SortOrder" > </TD> <TD><small> <&|/l&>Name</&>:<br> -<input size=20 name="CustomField-<% $CustomField->Id %>-AddValue-Name"> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-new-Name" > </TD> <TD><small> <&|/l&>Description</&>:<br> -<input size="60" name="CustomField-<% $CustomField->Id %>-AddValue-Description"> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-new-Description"> </TD></TR> </TABLE> diff --git a/rt/html/Admin/Elements/CreateUserCalled b/rt/html/Admin/Elements/CreateUserCalled index 01fa9fe94..0dc6ac792 100644 --- a/rt/html/Admin/Elements/CreateUserCalled +++ b/rt/html/Admin/Elements/CreateUserCalled @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <FORM METHOD=get ACTION="<% $RT::WebPath %>/Admin/Users/Create.html"> <&|/l&>New user called</&> <INPUT NAME="Name" size=10><input type=submit value="<&|/l&>Create</&>"> </form> diff --git a/rt/html/Admin/Elements/CustomFieldTabs b/rt/html/Admin/Elements/CustomFieldTabs new file mode 100644 index 000000000..d7acf33cc --- /dev/null +++ b/rt/html/Admin/Elements/CustomFieldTabs @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, + current_tab => 'Admin/CustomFields/', + subtabs => $tabs, + current_subtab => $current_tab, + Title => $Title &> +<%INIT> +my $tabs; + +if ($id) { + my $cf = RT::CustomField->new( $session{'CurrentUser'} ); + $cf->Load($id); + $tabs = { + this => { + title => $cf->Name, + path => "Admin/CustomFields/Modify.html?id=" . $id, + current_subtab => $current_tab, + + subtabs => { + + C => { title => loc('Basics'), + path => "Admin/CustomFields/Modify.html?id=" . $id, + }, + F => { title => loc('Group Rights'), + path => "Admin/CustomFields/GroupRights.html?id=" + . $id, }, + G => { + title => loc('User Rights'), + path => "Admin/CustomFields/UserRights.html?id=" . $id, + }, + + } } + + }; + + + if ($cf->LookupType =~ /^RT::Queue/io) { + $tabs->{'this'}->{subtabs}->{D} = { + title => loc('Applies to'), + path => "Admin/CustomFields/Objects.html?id=" . $id, + }; + } +} + +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminCustomField')) { + $tabs->{"A"} = { title => loc('Select custom field'), + path => "Admin/CustomFields/", + }; + $tabs->{"B"} = { title => loc('New custom field'), + path => "Admin/CustomFields/Modify.html?Create=1", + separator => 1, + }; +} + + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +foreach my $tab (sort keys %{$tabs->{'this'}->{'subtabs'}}) { + if ($tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{'subtabs'} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{'current_subtab'} = $current_subtab; + } +} +if( $id ) { $current_tab = "Admin/CustomFields/Modify.html?id=" . $id } +</%INIT> +<%ARGS> +$Title => undef +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/EditCustomField b/rt/html/Admin/Elements/EditCustomField index 5657d43fd..d8c5b29b2 100644 --- a/rt/html/Admin/Elements/EditCustomField +++ b/rt/html/Admin/Elements/EditCustomField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/Admin/Elements/EditCustomFieldValues b/rt/html/Admin/Elements/EditCustomFieldValues index 79b6501e1..9cc3858b9 100644 --- a/rt/html/Admin/Elements/EditCustomFieldValues +++ b/rt/html/Admin/Elements/EditCustomFieldValues @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,22 +42,42 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<i><&|/l&>(Check box to delete)</&></i> -<ul> -% while (my $v = $values->Next) { -<li> -<INPUT TYPE="text" SIZE="2" NAME="CustomField-<%$CustomField->Id%>-SortOrder<%$v->Id()%>" VALUE="<%$v->SortOrder()%>"> -<input type="checkbox" name="CustomField-<%$CustomField->Id%>-DeleteValue" value="<%$v->id%>"> -<%$v->Name%> -% if ($v->Description) { -<i>(<%$v->Description%>)</i> +%# END BPS TAGGED BLOCK }}} +% if (!$values->Count) { +<p><em><&|/l&>(no values)</&></em></p> +% return; % } -</li> +<i><&|/l&>(Check box to delete)</&></i> +<table> +<tr> +<td> </td> +<td><&|/l&>Sort</&></td> +<td><&|/l&>Name</&></td> +<td><&|/l&>Description</&></td> +</tr> +% while (my $value = $values->Next) { +<tr> +<td> +<input type="checkbox" name="Delete-CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>"> +</td> +<td> +<input size=3 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-SortOrder" value="<%$value->SortOrder%>"> +</td> +<td> +<input type="text" size=30 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Name" value="<%$value->Name%>"> +</td> +<td> +<font size="-1"> +<input type="text" size=50 name="CustomField-<%$CustomField->Id%>-Value-<%$value->Id%>-Description" value="<%$value->Description%>"> +</font> +</td> +</tr> % } -</ul> +</table> <%init> -my $values = $CustomField->Values(); + +my $values = $CustomField->ValuesObj(); + </%init> <%args> $CustomField => undef diff --git a/rt/html/Admin/Elements/EditCustomFields b/rt/html/Admin/Elements/EditCustomFields index d901b216e..1cd3df568 100644 --- a/rt/html/Admin/Elements/EditCustomFields +++ b/rt/html/Admin/Elements/EditCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,95 +42,64 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/ListActions, actions => \@actions &> - -<TABLE> -<TR> -<TD VALIGN=TOP> -<h2><%$caption%></h2> -</TD></TR></TABLE> -% if ($CustomFields->Count == 0 ) { -<P><i><&|/l&>(No custom fields)</&></i></P> -% } else { -<TABLE cellspacing=0 cellpadding=2> -% my $count; -% while (my $CustomFieldObj = $CustomFields->Next) { -<TR> - <TD valign="TOP"> -% if ($CustomFieldObj->Name) { - <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><b><%$CustomFieldObj->Name%></b></a><br> -% } else { - <A HREF="CustomField.html?Queue=<%$id%>&CustomField=<%$CustomFieldObj->id()%>"><i>(<%loc("no name")%>)</i></a><br> -% } - <%$CustomFieldObj->Description%> - </TD> - <TD valign="TOP"> - <i><% $CustomFieldObj->FriendlyType %></i> - </TD> -% # show 'move up' unless it's the first item -% if ($count++) { - <TD valign="TOP"> - <a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a> -% } else { - <TD valign="TOP" ALIGN=RIGHT> -% } - -% # show 'move down' unless it's the last item -% if (!$CustomFields->IsLast) { -% $m->print(' | ') if $count > 1; - <a href="CustomFields.html?id=<%$id%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a> -% } -</TD> -</TR> +%# END BPS TAGGED BLOCK }}} +<& /Elements/ListActions, actions => \@results &> + +<FORM ACTION="<%$RT::WebPath%><% $m->request_comp->path |n %>" METHOD="POST" NAME="EditCustomFields"> +<INPUT TYPE=HIDDEN NAME="id" VALUE="<% $Object->Id %>"/> +<INPUT TYPE=HIDDEN NAME="ObjectType" VALUE="<% $ObjectType %>"/> +<INPUT TYPE=HIDDEN NAME="SubType" VALUE="<% $SubType %>"/> +<INPUT TYPE=HIDDEN NAME="UpdateCFs" VALUE="1"/> + +% if ($Object->Id) { +<h2><&|/l&>Global Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &> % } +<h2><&|/l&>Selected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &> +<h2><&|/l&>Unselected Custom Fields</&></h2> +<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &> -</TABLE> -% } -<FORM METHOD=GET ACTION="CustomFields.html"> -% if ($id) { -<INPUT TYPE="Hidden" NAME="id" VALUE="<%$id%>"> -% } -<input type="checkbox" name="FindDisabledCustomFields"> <&|/l&>Include disabled custom fields in listing.</&> -<input type=submit value="<&|/l&>Go!</&>"> +<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &> </FORM> <%INIT> my $CustomFields = RT::CustomFields->new($session{'CurrentUser'}); -my $QueueObj = RT::Queue->new($session{'CurrentUser'}); -my $caption; +my @results; +my (@GlobalCFs, @UnassignedCFs); -if ($id) { - $QueueObj->Load($id); +my $id = $Object->Id; +if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) { + $m->out('<P><i>', loc('(No custom fields)'), '</i></P>'); + return; } -if ($QueueObj->id) { - $CustomFields->LimitToQueue($id); -} -else { - $CustomFields->LimitToGlobal(); -} - -if ($FindDisabledCustomFields) { - $caption = loc("All Custom Fields"); - $CustomFields->{'find_disabled_rows'} = 1; -} else { - $caption = loc("Enabled Custom Fields"); -} +my $lookup = $ObjectType; +$lookup .= "-$SubType" if $SubType; + +$CustomFields->LimitToLookupType($lookup); +$CustomFields->OrderBy( FIELD => 'Name' ); + + +my ($GlobalCFs, $ObjectCFs); +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); # {{{ deal with moving sortorder of custom fields if ($CustomField and $Move) { - my $SourceObj = RT::CustomField->new($session{'CurrentUser'}); - $SourceObj->Load($CustomField) || Abort(loc('No CustomField')); + my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'}); + $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField ); my $TargetObj; my $target_order = $SourceObj->SortOrder + $Move; - while (my $CustomFieldObj = $CustomFields->Next) { - my $this_order = $CustomFieldObj->SortOrder; + while (my $ObjectCF = $ObjectCFs->Next) { + my $this_order = $ObjectCF->SortOrder; # if we have an exact match, finish the loop now - ($TargetObj = $CustomFieldObj, last) if $this_order == $target_order; + ($TargetObj = $ObjectCF, last) if $this_order == $target_order; # otherwise, we need to apropos toward the general direction # ... first, check the sign is correct @@ -144,7 +113,7 @@ if ($CustomField and $Move) { next if $orig_delta < $this_delta; } - $TargetObj = $CustomFieldObj; + $TargetObj = $ObjectCF; } if ($TargetObj) { @@ -153,83 +122,68 @@ if ($CustomField and $Move) { $TargetObj->SetSortOrder($s); $SourceObj->SetSortOrder($t); # because order changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; } - $CustomFields->GotoFirstItem; + $ObjectCFs->GotoFirstItem; } # }}} -# {{{ now process the 'copy queue' action -my @actions; -if ($Source and $Source ne $id) { - my $SourceQueue = RT::Queue->new($session{'CurrentUser'}); - $SourceQueue->Load($Source) || Abort(loc("Couldn't load queue")); - my $SourceCustomFields = RT::CustomFields->new($session{'CurrentUser'}); - $SourceCustomFields->LimitToQueue($SourceQueue->id); - - # delete old fields - foreach my $CustomFieldObj ( @{$CustomFields->ItemsArrayRef} ) { - $CustomFieldObj->Delete; - } +if ($id) { + $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); + $GlobalCFs->LimitToObjectId(0); + $GlobalCFs->LimitToLookupType($lookup); +} - # add new fields - while (my $SourceCustomFieldObj = $SourceCustomFields->Next) { - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - my ($val, $msg) = $CustomFieldObj->Create( - id => $SourceCustomFieldObj->id, - Queue => $id, - Name => $SourceCustomFieldObj->Name, - Type => $SourceCustomFieldObj->Type, - Description => $SourceCustomFieldObj->Description, - ); - Abort(loc("Could not create CustomField") . ": $msg") unless ($val); - push @actions, $msg; - - $CustomFieldObj->SetSortOrder($SourceCustomFieldObj->SortOrder); - - # add new values - my $values = $SourceCustomFieldObj->Values(); - while (my $v = $values->Next) { - my ( $addval, $addmsg ) = $CustomFieldObj->AddValue( - Name => $v->Name, - Description => $v->Description, - SortOrder => $v->SortOrder - ); - } - } +while (my $cf = $CustomFields->Next) { + my $cf_id = $cf->Id; - # because content changed, we must redo search for subsequent uses - $CustomFields->RedoSearch; - $CustomFields->GotoFirstItem; -} -# }}} + if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) { + push @GlobalCFs, $cf; + next; + } -# {{{ deal with deleting existing custom fields -foreach my $key (keys %ARGS) { - # {{{ if we're trying to delete the custom field - if ($key =~ /^DeleteCustomField-(\d+)/) { - my $id = $1; - my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'}); - $CustomFieldObj->Load($id); - my ($retval, $msg) = $CustomFieldObj->Delete; - if ($retval) { - push @actions, loc("Custom field deleted"); + if ($UpdateCFs) { + # Go through and delete all the custom field relationships that this object + # no longer has + my $key = "Object-$id-CF-$cf_id"; + if ($ARGS{$key}) { + if (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->AddToObject($Object); + push (@results, $msg); + push @UnassignedCFs, $cf if !$val; + } + } + else { + push @UnassignedCFs, $cf; + if ($ObjectCFs->HasEntryForCustomField($cf_id)) { + my ($val, $msg) = $cf->RemoveFromObject($Object); + push (@results, $msg); + pop @UnassignedCFs if !$val; + } + } } - else { - push @actions, $msg; + elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) { + push @UnassignedCFs, $cf; } - } - # }}} + else { + } } -# }}} + +# redo search... +$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'}); +$ObjectCFs->UnLimit; +$ObjectCFs->LimitToObjectId($id); +$ObjectCFs->LimitToLookupType($lookup); </%INIT> <%ARGS> -$id => 0 $title => undef $Move => undef $Source => undef $CustomField => undef $FindDisabledCustomFields => undef +$UpdateCFs => 0 +$Object +$ObjectType +$SubType => '' </%ARGS> diff --git a/rt/html/Admin/Elements/EditQueueWatchers b/rt/html/Admin/Elements/EditQueueWatchers index f6559e7ad..c93bf81f5 100644 --- a/rt/html/Admin/Elements/EditQueueWatchers +++ b/rt/html/Admin/Elements/EditQueueWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %if ($Members->Count == 0 ) { <ul> <li><i><&|/l&>none</&></i> @@ -51,8 +51,7 @@ <ul> % while (my $watcher=$Members->Next) { <li> -<INPUT TYPE=CHECKBOX - NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" +<INPUT TYPE=CHECKBOX NAME="Queue-<%$QueueObj->Id%>-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" UNCHECKED> % if ($watcher->MemberObj->IsUser) { <a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->ObjectId%>"> diff --git a/rt/html/Admin/Elements/EditScrip b/rt/html/Admin/Elements/EditScrip index 4207114fd..907ae9a92 100644 --- a/rt/html/Admin/Elements/EditScrip +++ b/rt/html/Admin/Elements/EditScrip @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> diff --git a/rt/html/Admin/Elements/EditScrips b/rt/html/Admin/Elements/EditScrips index 8959f6c70..9526118b5 100644 --- a/rt/html/Admin/Elements/EditScrips +++ b/rt/html/Admin/Elements/EditScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> <form action="Scrips.html" method="post"> <input type="hidden" name="id" value="<%$id%>"> -<P><&|/l&>Current Scrips</&>:</P> +<h2><&|/l&>Current Scrips</&></h2> % if ($Scrips->Count == 0 ) { <P><i><&|/l&>(No scrips)</&></i></P> % } else { @@ -58,7 +58,7 @@ % while (my $scrip = $Scrips->Next ) { <TR> <TD> -<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>"> +<input type="checkbox" name="DeleteScrip-<%$scrip->Id%>" value="1"> </TD> <TD> <a href="Scrip.html?id=<%$scrip->Id%>&Queue=<%$id%>"><% $scrip->Description || "<i>(".loc('no value').")</i>" |n %></a><br> diff --git a/rt/html/Admin/Elements/EditTemplates b/rt/html/Admin/Elements/EditTemplates index 6ac56c235..207ffd001 100644 --- a/rt/html/Admin/Elements/EditTemplates +++ b/rt/html/Admin/Elements/EditTemplates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/ListActions, actions => \@actions &> <FORM METHOD=GET ACTION="Templates.html"> @@ -63,7 +63,7 @@ % while (my $TemplateObj = $Templates->Next) { <TR> <TD> -<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>"> +<input type="checkbox" name="DeleteTemplate-<%$TemplateObj->Id%>" value="1"> </TD> <TD> <A HREF="Template.html?Queue=<%$id%>&Template=<%$TemplateObj->id()%>"> diff --git a/rt/html/Admin/Elements/EditUserComments b/rt/html/Admin/Elements/EditUserComments index bc23f77fe..fb96dc09a 100644 --- a/rt/html/Admin/Elements/EditUserComments +++ b/rt/html/Admin/Elements/EditUserComments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => "Comments about $name" &> <&|/l&>These comments aren't generally visible to the user</&>:<br> <input type="hidden" name="id" value="<%$id%>"> diff --git a/rt/html/Admin/Elements/GlobalCustomFieldTabs b/rt/html/Admin/Elements/GlobalCustomFieldTabs new file mode 100755 index 000000000..8d4eaca23 --- /dev/null +++ b/rt/html/Admin/Elements/GlobalCustomFieldTabs @@ -0,0 +1,93 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/SystemTabs, subtabs => $tabs, + current_tab => 'Admin/Global/CustomFields/index.html', + current_subtab => $current_tab, + Title => $Title &> +<%INIT> + + + my $tabs = { + + A => { title => loc('Users'), + text => loc('Modify scrips which apply to all queues'), + path => 'Admin/Global/CustomFields/Users.html', + }, + B => { title => loc('Groups'), + text => loc('Edit system templates'), + path => 'Admin/Global/CustomFields/Groups.html', + }, + + F => { title => loc('Tickets'), + text => loc('Modify global custom fields'), + path => 'Admin/Global/CustomFields/Queue-Tickets.html', + }, + + G => { title => loc('Ticket Transactions'), + text => loc('Modify global group rights'), + path => 'Admin/Global/CustomFields/Queue-Transactions.html', + }, + +}; + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + foreach my $tab (sort keys %{$tabs}) { + if ($tabs->{$tab}->{'path'} eq $current_tab) { + $tabs->{$tab}->{"subtabs"} = $subtabs; + $tabs->{$tab}->{"current_subtab"} = $current_subtab; + } + } +</%INIT> + + +<%ARGS> +$id => undef +$current_tab => undef +$subtabs => undef +$current_subtab => undef +$Title => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/GroupTabs b/rt/html/Admin/Elements/GroupTabs index de39ec117..60edda40e 100644 --- a/rt/html/Admin/Elements/GroupTabs +++ b/rt/html/Admin/Elements/GroupTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Groups/', @@ -67,6 +67,8 @@ $tabs->{"this"} = { class => "currentnav", path => "Admin/Groups/GroupRights.html?id=" . $GroupObj->id, }, G => { title => loc('User Rights'), path => "Admin/Groups/UserRights.html?id=" . $GroupObj->id, }, + H => { title => loc('History'), + path => "Admin/Groups/History.html?id=" . $GroupObj->id }, } } } @@ -74,7 +76,7 @@ $tabs->{"A"} = { title => loc('Select group'), path => "Admin/Groups/", }; $tabs->{"B"} = { title => loc('New group'), path => "Admin/Groups/Modify.html?Create=1", - separator => 1, }; + separator => 1, }; # Now let callbacks add their extra tabs $m->comp( '/Elements/Callback', tabs => $tabs, %ARGS ); diff --git a/rt/html/Admin/Elements/Header b/rt/html/Admin/Elements/Header index 69a3ccd53..b80908094 100644 --- a/rt/html/Admin/Elements/Header +++ b/rt/html/Admin/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Elements/Header, Title => $Title &> +%# END BPS TAGGED BLOCK }}} +<& /Elements/Header, %ARGS &> <%ARGS> $Title => undef diff --git a/rt/html/Admin/Elements/ListGlobalCustomFields b/rt/html/Admin/Elements/ListGlobalCustomFields index abca29073..3df9d6292 100644 --- a/rt/html/Admin/Elements/ListGlobalCustomFields +++ b/rt/html/Admin/Elements/ListGlobalCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my $count = 0; % while (my $CustomFieldObj = $CustomFields->Next) { % $count++; diff --git a/rt/html/Admin/Elements/ListGlobalScrips b/rt/html/Admin/Elements/ListGlobalScrips index cb3f89a9f..2e3791257 100644 --- a/rt/html/Admin/Elements/ListGlobalScrips +++ b/rt/html/Admin/Elements/ListGlobalScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,17 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -% my $count = 0; +%# END BPS TAGGED BLOCK }}} + +% if ($Scrips->Count == 0) { + +<P><i><&|/l&>(No scrips)</&></i></P> + +% } else { + +<UL> + % while (my $scrip = $Scrips->Next ) { -% $count++; -<font size="-1"><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></font> -<BR> -% } -% if (!$count) { -<font size="-1"><&|/l&>(No scrips)</&></font> +<LI> +<a href="<%$RT::WebPath%>/Admin/Global/Scrip.html?id=<%$scrip->Id%>&Queue=<%0%>"> +% if ($scrip->Description) { +<% $scrip->Description %> +% } else { +<i>(<&|/l, $scrip->Id&>Scrip #[_1]</&>)</i> +% } +</a><br> +<small><&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name) &>[_1] [_2] with template [_3]</&></small> +</LI> % } +</UL> + +% } + <%init> my $Scrips = new RT::Scrips ($session{'CurrentUser'}); $Scrips->LimitToGlobal(); diff --git a/rt/html/Admin/Elements/ModifyTemplate b/rt/html/Admin/Elements/ModifyTemplate index acd87a73f..6749f3e65 100644 --- a/rt/html/Admin/Elements/ModifyTemplate +++ b/rt/html/Admin/Elements/ModifyTemplate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD ALIGN=RIGHT> diff --git a/rt/html/Admin/Elements/ObjectCustomFields b/rt/html/Admin/Elements/ObjectCustomFields new file mode 100644 index 000000000..a87e1579d --- /dev/null +++ b/rt/html/Admin/Elements/ObjectCustomFields @@ -0,0 +1,109 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& $ObjectTabs, +$id ? ( + id => $Object->id, + current_tab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + current_subtab => "Admin/$Types/CustomFields.html?$sub_type_url&id=".$id, + "${Type}Obj" => $Object, +) : ( + current_tab => "Admin/Global/CustomFields/${QualifiedType}s.html", +), + Title => $title + &> + +<& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object &> +<%INIT> +# XXX TODO: Validate here? +#$ObjectType =~ /^RT::(Queue|User|Group)$/ +# or Abort(loc("Object of type [_1] cannot take custom fields", $ObjectType)); + + + +my $Type = $1; +my $Types = $Type.'s'; +my $ObjectTabs; +my $Object = $ObjectType->new($session{'CurrentUser'}); + + +my $QualifiedType; +my $FriendlySubTypes; +if ($SubType =~/^RT::(.*)$/) { + $FriendlySubTypes = RT::CustomField->new($session{'CurrentUser'})->FriendlyLookupType($Object->CustomFieldLookupType); + $QualifiedType = "$Type-$1"; +} else { + $QualifiedType = $Type; +} + +if ($id) { + $Object->Load($id) || Abort(loc("Couldn't load object [_1]", $id)); + $ObjectTabs = "/Admin/Elements/${Type}Tabs"; +} else { + $ObjectTabs = "/Admin/Elements/GlobalCustomFieldTabs"; + +} + +my $title; +if ($id) { +$title = loc('Edit Custom Fields for [_1]', $Object->Name); +} +elsif ($SubType) { + + $title= loc("Modify Custom Fields which apply to [_1] for all [_2]", loc(lc($FriendlySubTypes)), loc(lc($Types))); +} else { + $title =loc("Modify Custom Fields which apply to all [_1]", loc(lc($Types))); + +} +my $sub_type_url; +$sub_type_url = "SubType=$SubType" if $SubType; + +</%INIT> +<%ARGS> +$id => undef +$ObjectType +$SubType => undef +</%ARGS> diff --git a/rt/html/Admin/Elements/PickCustomFields b/rt/html/Admin/Elements/PickCustomFields new file mode 100644 index 000000000..c2a30f9a3 --- /dev/null +++ b/rt/html/Admin/Elements/PickCustomFields @@ -0,0 +1,96 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@CustomFields == 0) { +<p><i><&|/l&>(None)</&></i></p> +% } else { +<TABLE cellspacing=0 cellpadding=2> +% my $count; +% foreach my $CustomFieldObj (@CustomFields) { +<TR> +% if (!$ReadOnly) { + <TD valign="TOP"> +<input type="checkbox" name="Object-<%$id%>-CF-<%$CustomFieldObj->Id%>" value="1" <% $Checked ? 'CHECKED' : '' %> +> + </TD> +% } + <TD valign="TOP"> + <A HREF="<%$RT::WebPath%>/Admin/CustomFields/Modify.html?id=<%$CustomFieldObj->id()%>"> +% if ($CustomFieldObj->Name) { +<b><%$CustomFieldObj->Name%></b> +% } else { +<i>(<&|/l&>no name</&>)</i> +% } +</a><br> + <%$CustomFieldObj->Description%> + </TD> + <TD valign="TOP"> + <i><% $CustomFieldObj->FriendlyTypeComposite %></i> + </TD> +% # show 'move up' unless it's the first item +% if ($count++ and $Checked) { + <TD valign="TOP"> + [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=-1"><&|/l&>Move up</&></a>] +% } else { + <TD valign="TOP" ALIGN=RIGHT> +% } + +% # show 'move down' unless it's the last item +% if ($count != @CustomFields and $Checked) { +% $m->print(' | ') if $count > 1; + [<a href="<%$RT::WebPath%><% $m->request_comp->path |n %>?id=<%$id%>&SubType=<%$SubType%>&CustomField=<%$CustomFieldObj->id%>&Move=1"><&|/l&>Move down</&></a>] +% } + </TD> +</TR> +% } +</TABLE> +% } +<%ARGS> +@CustomFields +$id +$ReadOnly => 0 +$Checked => 0 +$SubType +</%ARGS> diff --git a/rt/html/Admin/Elements/PickObjects b/rt/html/Admin/Elements/PickObjects new file mode 100644 index 000000000..b07a88240 --- /dev/null +++ b/rt/html/Admin/Elements/PickObjects @@ -0,0 +1,80 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if (@Objects == 0) { +<P><i><&|/l&>(None)</&></i></P> +% } else { +<TABLE cellspacing=0 cellpadding=2> +% my $count; +% foreach my $Object (@Objects) { +<TR> +% if (!$ReadOnly) { + <TD valign="TOP"> +<input type="checkbox" name="Object-<%$Object->id%>-CF-<%$id%>" value="1" <% $Checked ? 'CHECKED' : ''%> +> + </TD> +% } + <TD valign="TOP"> +% if ($Object->Name) { + <b><%$Object->Name%></b><br> +% } else { + <i>(<%loc("no name")%>)</i><br> +% } + <%$Object->can('Description') && $Object->Description%> + </TD> +%# <TD valign="TOP"> +%# <i><% $CustomFieldObj->FriendlyTypeComposite %></i> +%# </TD> + </TD> +</TR> +% } +</TABLE> +% } +<%ARGS> +@Objects +$id +$ReadOnly => 0 +$Checked => 0 +</%ARGS> diff --git a/rt/html/Admin/Elements/QueueRightsForUser b/rt/html/Admin/Elements/QueueRightsForUser index 57b5fd8b3..01f294a59 100644 --- a/rt/html/Admin/Elements/QueueRightsForUser +++ b/rt/html/Admin/Elements/QueueRightsForUser @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <UL> %while(my $ACE = $ACL->Next) { -<LI><checkbox name="delete_ace_<%$ACE->id%>"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) +<LI><checkbox name="delete_ace_<%$ACE->id%>" value="1"> <% loc($ACE->RightName) %> (<%$ACE->UserObj->RealName%>) %} </UL> diff --git a/rt/html/Admin/Elements/QueueTabs b/rt/html/Admin/Elements/QueueTabs index 0eec1fc6f..93522d0a2 100644 --- a/rt/html/Admin/Elements/QueueTabs +++ b/rt/html/Admin/Elements/QueueTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Queues/', @@ -71,8 +71,12 @@ if ($id) { path => "Admin/Queues/Templates.html?id=".$id, }, - G => { title => loc('Custom Fields'), - path => 'Admin/Queues/CustomFields.html?id='.$id, + G1 => { title => loc('Ticket Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket&id='.$id, + }, + + G2 => { title => loc('Transaction Custom Fields'), + path => 'Admin/Queues/CustomFields.html?SubType=RT::Ticket-RT::Transaction&id='.$id, }, H => { title => loc('Group Rights'), @@ -90,8 +94,7 @@ if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminQue }; $tabs->{"B"} = { title => loc('New queue'), path => "Admin/Queues/Modify.html?Create=1", - separator => 1, - }; + separator => 1, }; } # Now let callbacks add their extra tabs diff --git a/rt/html/Admin/Elements/SelectCustomFieldLookupType b/rt/html/Admin/Elements/SelectCustomFieldLookupType new file mode 100644 index 000000000..ec9f740b9 --- /dev/null +++ b/rt/html/Admin/Elements/SelectCustomFieldLookupType @@ -0,0 +1,58 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<SELECT NAME ="<%$Name%>"> +%for my $option ($cf->LookupTypes) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyLookupType($option) %></OPTION> +%} +</SELECT> +<%INIT> +my $cf = RT::CustomField->new($session{'CurrentUser'}); + +</%INIT> +<%ARGS> +$Default=>undef +$Name => 'LookupType' +</%ARGS> diff --git a/rt/html/Admin/Elements/SelectCustomFieldType b/rt/html/Admin/Elements/SelectCustomFieldType index 76606c412..3f25b8e71 100644 --- a/rt/html/Admin/Elements/SelectCustomFieldType +++ b/rt/html/Admin/Elements/SelectCustomFieldType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,10 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> -%for my $option ($cf->Types) { -<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyType($option) %></OPTION> +%for my $option ($cf->TypeComposites) { +<OPTION VALUE="<%$option%>" <%$option eq $Default && "SELECTED"%>><% $cf->FriendlyTypeComposite($option) %></OPTION> %} </SELECT> <%INIT> @@ -54,5 +54,5 @@ my $cf = RT::CustomField->new($session{'CurrentUser'}); </%INIT> <%ARGS> $Default=>undef -$Name => 'Type' +$Name => 'TypeComposite' </%ARGS> diff --git a/rt/html/Admin/Elements/SelectGroups b/rt/html/Admin/Elements/SelectGroups index 175ce0657..92bd47587 100644 --- a/rt/html/Admin/Elements/SelectGroups +++ b/rt/html/Admin/Elements/SelectGroups @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> %while (my $group = $groups->Next) { <OPTION VALUE="<%$group->id%>"><%$group->Name%> diff --git a/rt/html/Admin/Elements/SelectModifyGroup b/rt/html/Admin/Elements/SelectModifyGroup index b33eaea44..272e1f0c7 100644 --- a/rt/html/Admin/Elements/SelectModifyGroup +++ b/rt/html/Admin/Elements/SelectModifyGroup @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $Group = $Groups->Next) { <A HREF="Modify.html?id=<%$Group->id%>"><%$Group->id%>: <%$Group->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectModifyQueue b/rt/html/Admin/Elements/SelectModifyQueue index 2ca6bd814..3a30d09c8 100644 --- a/rt/html/Admin/Elements/SelectModifyQueue +++ b/rt/html/Admin/Elements/SelectModifyQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $queue = $queues->Next) { <A HREF="Modify.html?id=<%$queue->id%>"><%$queue->id%>: <%$queue->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectModifyUser b/rt/html/Admin/Elements/SelectModifyUser index 97411c909..fc6c01205 100644 --- a/rt/html/Admin/Elements/SelectModifyUser +++ b/rt/html/Admin/Elements/SelectModifyUser @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %while ( $user = $users->Next) { <A HREF="Modify.html?id=<%$user->id%>"><%$user->id%>: <%$user->Name%></a><BR> %} diff --git a/rt/html/Admin/Elements/SelectNewGroupMembers b/rt/html/Admin/Elements/SelectNewGroupMembers index 90f9a0b91..95056aec9 100644 --- a/rt/html/Admin/Elements/SelectNewGroupMembers +++ b/rt/html/Admin/Elements/SelectNewGroupMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Show ne 'Groups') { <b><&|/l&>Users</&></b> <SELECT MULTIPLE NAME="<%$Name%>Users" SIZE=10> diff --git a/rt/html/Admin/Elements/SelectRights b/rt/html/Admin/Elements/SelectRights index 61a9e42ec..3e61d5071 100644 --- a/rt/html/Admin/Elements/SelectRights +++ b/rt/html/Admin/Elements/SelectRights @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,27 +42,30 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <INPUT TYPE=HIDDEN NAME="CheckACL" VALUE="<%$ACLDesc%>"> <TABLE BORDER=0> <TR> <TD valign=top width="180" align="left"> +% my %current_rights; <h3><&|/l&>Current rights</&></h3> -% if ($ACLObj->Count() > 0) { -<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> -% } else { +% if ($ACLObj->Count() == 0) { <i><&|/l&>No rights granted.</&></i> <BR> -% } +% } else { +<i>(<&|/l&>Check box to revoke right</&>)</i> <BR> % while (my $right = $ACLObj->Next()) { % if ($right->RightName) { +% $current_rights{$right->RightName} = 1; <input type=checkbox value="<%$right->Id%>" name="RevokeRight-<%$ACLDesc%>-<%$right->RightName%>"> <% loc($right->RightName) %><br> % } % } +% } </TD> <TD valign=top> <h3><&|/l&>New rights</&></h3> <SELECT SIZE=5 MULTIPLE NAME="GrantRight-<%$ACLDesc%>"> % foreach $right (sort keys %Rights) { +% next if $current_rights{$right}; <OPTION VALUE="<%$right%>" ><% loc($right) %></OPTION> % } @@ -100,7 +103,7 @@ } else { - %Rights = { loc('System Error') => loc("No rights found")}; + %Rights = ( loc('System Error') => loc("No rights found") ); } $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id; diff --git a/rt/html/Admin/Elements/SelectScrip b/rt/html/Admin/Elements/SelectScrip index 7fce6d54e..a9e979699 100644 --- a/rt/html/Admin/Elements/SelectScrip +++ b/rt/html/Admin/Elements/SelectScrip @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" <% $Default eq undef && 'SELECTED' %> diff --git a/rt/html/Admin/Elements/SelectScripAction b/rt/html/Admin/Elements/SelectScripAction index 17cd6a199..8d88d6458 100644 --- a/rt/html/Admin/Elements/SelectScripAction +++ b/rt/html/Admin/Elements/SelectScripAction @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" -<% $Default eq undef && 'SELECTED' %> +<% ! defined $Default && 'SELECTED' %> >-</OPTION> %while (my $ScripAction = $ScripActions->Next) { <OPTION VALUE=<%$ScripAction->Id%> -<% $ScripAction->Id == $Default && 'SELECTED' %> +<% defined $Default && $ScripAction->Id == $Default && 'SELECTED' %> ><% loc($ScripAction->Name) %> </OPTION> %} diff --git a/rt/html/Admin/Elements/SelectScripCondition b/rt/html/Admin/Elements/SelectScripCondition index 021132be7..faa99fda6 100644 --- a/rt/html/Admin/Elements/SelectScripCondition +++ b/rt/html/Admin/Elements/SelectScripCondition @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" -<% $Default eq undef && 'SELECTED' %> +<% ! defined $Default && 'SELECTED' %> >-</OPTION> %while (my $ScripCondition = $ScripConditions->Next) { <OPTION VALUE=<%$ScripCondition->Id%> -<% $ScripCondition->Id == $Default && 'SELECTED' %> +<% defined $Default && $ScripCondition->Id == $Default && 'SELECTED' %> ><% loc($ScripCondition->Name) %> </OPTION> %} diff --git a/rt/html/Admin/Elements/SelectSingleOrMultiple b/rt/html/Admin/Elements/SelectSingleOrMultiple index 9b1982606..571695091 100644 --- a/rt/html/Admin/Elements/SelectSingleOrMultiple +++ b/rt/html/Admin/Elements/SelectSingleOrMultiple @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="<%$Name%>"> <option value="1" <%$SingleDefault%>><&|/l&>Single</&></option> <option value="0" <%$MultipleDefault%>><&|/l&>Multiple</&></option> diff --git a/rt/html/Admin/Elements/SelectStage b/rt/html/Admin/Elements/SelectStage index 0472d2fcd..0fbf5c609 100644 --- a/rt/html/Admin/Elements/SelectStage +++ b/rt/html/Admin/Elements/SelectStage @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,9 +42,9 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> -% foreach my $stage (qw(TransactionCreate TransactionBatch Disabled)) { +% foreach my $stage (@stages) { <OPTION VALUE=<%$stage%> <% ($stage eq $Default) && 'SELECTED' %> ><% loc($stage) %> @@ -54,6 +54,9 @@ if ($Default eq '') { $Default = 'TransactionCreate'; } +my @stages = 'TransactionCreate'; +push @stages, 'TransactionBatch' if $RT::UseTransactionBatch; +push @stages, 'Disabled'; </%INIT> <%ARGS> $Default => 'TransactionCreate' diff --git a/rt/html/Admin/Elements/SelectTemplate b/rt/html/Admin/Elements/SelectTemplate index f48948387..7d83b6768 100644 --- a/rt/html/Admin/Elements/SelectTemplate +++ b/rt/html/Admin/Elements/SelectTemplate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME=<%$Name%>> <OPTION VALUE="" <% $Default eq 'none' && 'SELECTED' %> diff --git a/rt/html/Admin/Elements/SelectUsers b/rt/html/Admin/Elements/SelectUsers index 31ac3e453..a88aa8ff7 100644 --- a/rt/html/Admin/Elements/SelectUsers +++ b/rt/html/Admin/Elements/SelectUsers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT MULTIPLE NAME="<%$Name%>" SIZE=10> %while (my $user = $users->Next) { <OPTION VALUE="<%$user->id%>"><%$user->Name%> diff --git a/rt/html/Admin/Elements/SystemTabs b/rt/html/Admin/Elements/SystemTabs index 4409695d8..646f552f5 100644 --- a/rt/html/Admin/Elements/SystemTabs +++ b/rt/html/Admin/Elements/SystemTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Global/', current_subtab => $current_tab, @@ -59,7 +59,7 @@ }, F => { title => loc('Custom Fields'), - path => 'Admin/Global/CustomFields.html', + path => 'Admin/Global/CustomFields/index.html', }, G => { title => loc('Group Rights'), diff --git a/rt/html/Admin/Elements/Tabs b/rt/html/Admin/Elements/Tabs index 39eaa728b..f90a629a2 100644 --- a/rt/html/Admin/Elements/Tabs +++ b/rt/html/Admin/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Admin/', @@ -59,10 +59,13 @@ C => { title => loc('Queues'), path => 'Admin/Queues/', }, - D => { 'title' => loc('Global'), + D => { 'title' => loc('Custom Fields'), + path => 'Admin/CustomFields/', + }, + E => { 'title' => loc('Global'), path => 'Admin/Global/', }, - E => { 'title' => loc('Tools'), + F => { 'title' => loc('Tools'), path => 'Admin/Tools/', }, }; diff --git a/rt/html/Admin/Elements/ToolTabs b/rt/html/Admin/Elements/ToolTabs index 606bd1202..773b81099 100755 --- a/rt/html/Admin/Elements/ToolTabs +++ b/rt/html/Admin/Elements/ToolTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Tabs, subtabs => $tabs, current_tab => 'Admin/Tools/', current_subtab => $current_tab, diff --git a/rt/html/Admin/Elements/UserTabs b/rt/html/Admin/Elements/UserTabs index 671bd6dd4..0ffd29b0f 100644 --- a/rt/html/Admin/Elements/UserTabs +++ b/rt/html/Admin/Elements/UserTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,52 +42,61 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Admin/Elements/Tabs, +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Tabs, subtabs => $tabs, - current_tab => 'Admin/Users/', - current_subtab => $current_tab, + current_tab => 'Admin/Users/', + current_subtab => $current_tab, Title => $Title &> <%INIT> my $tabs; if ($id) { - $tabs->{'this'} = { - title => eval { $UserObj->Name }, +$tabs->{'this'} = { title => eval { $UserObj->Name }, + path => "Admin/Users/Modify.html?id=".$id, - current_subtab => $current_tab, - subtabs => { - A => { title => loc('Basics'), +subtabs => { + Basics => { title => loc('Basics'), path => "Admin/Users/Modify.html?id=".$id }, - } + Memberships => { title => loc('Memberships'), + path => "Admin/Users/Memberships.html?id=".$id + }, + History => { title => loc('History'), + path => "Admin/Users/History.html?id=".$id + }, +# Scrips => { title => loc('Rights'), +# path => "Admin/Users/Rights.html?id=".$id +# } + } } - -if ( $session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers') ) { - $tabs->{"A"} = { - title => loc('Select user'), - path => "Admin/Users/", - }; - $tabs->{"B"} = { - title => loc('New user'), - path => "Admin/Users/Modify.html?Create=1", +} +if ($session{'CurrentUser'}->HasRight( Object => $RT::System, Right => 'AdminUsers')) { + $tabs->{"A"} = { title => loc('Select user'), + path => "Admin/Users/", + }; + $tabs->{"B"} = { title => loc('New user'), + path => "Admin/Users/Modify.html?Create=1", separator => 1, }; } -# Now let callbacks add their extra tabs -$m->comp('/Elements/Callback', tabs => $tabs, %ARGS); - -foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { - if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { - $tabs->{'this'}->{"current_subtab"} = $current_tab; - $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; - $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; - } -} - + # Now let callbacks add their extra tabs + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + +#foreach my $tab ( sort keys %{$tabs} ) { +# if ( $tabs->{$tab}->{'path'} eq $current_subtab ) { +# $tabs->{$tab}->{"current_subtab"} = $current_subtab; +# } +#} +foreach my $tab ( sort keys %{$tabs->{'this'}->{'subtabs'}} ) { + if ( $tabs->{'this'}->{'subtabs'}->{$tab}->{'path'} eq $current_tab ) { + $tabs->{'this'}->{'subtabs'}->{$tab}->{"subtabs"} = $subtabs; + $tabs->{'this'}->{'subtabs'}->{$tab}->{"current_subtab"} = $current_subtab; + } +} +$tabs->{'this'}->{"current_subtab"} = $current_tab; $current_tab = "Admin/Users/Modify.html?id=".$id if $id; - </%INIT> <%ARGS> $UserObj => undef diff --git a/rt/html/Admin/Global/CustomFields/Groups.html b/rt/html/Admin/Global/CustomFields/Groups.html new file mode 100644 index 000000000..bffde016f --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Groups.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Groups.html", + current_subtab => "Admin/Global/CustomFields/Groups.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Group', Object=> $object &> +<%INIT> + my $title = loc( 'Edit Custom Fields for all groups'); + my $object = RT::Group->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Queue-Tickets.html b/rt/html/Admin/Global/CustomFields/Queue-Tickets.html new file mode 100755 index 000000000..396559a17 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Queue-Tickets.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Queue-Tickets.html", + current_subtab => "Admin/Global/CustomFields/Queue-Tickets.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket' &> +<%INIT> + my $title = loc( 'Edit Custom Fields for tickets in all queues'); + my $object = RT::Queue->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Queue-Transactions.html b/rt/html/Admin/Global/CustomFields/Queue-Transactions.html new file mode 100755 index 000000000..63b4cfe6b --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Queue-Transactions.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Queue-Transactions.html", + current_subtab => "Admin/Global/CustomFields/Queue-Transactions.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::Queue', Object=> $object, SubType => 'RT::Ticket-RT::Transaction' &> +<%INIT> + my $title = loc( 'Edit Custom Fields for tickets in all queues'); + my $object = RT::Queue->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/Users.html b/rt/html/Admin/Global/CustomFields/Users.html new file mode 100644 index 000000000..6b79743d2 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/Users.html @@ -0,0 +1,11 @@ +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, + current_tab => "Admin/Global/CustomFields/Users.html", + current_subtab => "Admin/Global/CustomFields/Users.html", + Title => $title + &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, ObjectType => 'RT::User', Object=> $object &> +<%INIT> + my $title = loc( 'Edit Custom Fields for all users'); + my $object = RT::User->new($session{'CurrentUser'}); +</%INIT> diff --git a/rt/html/Admin/Global/CustomFields/index.html b/rt/html/Admin/Global/CustomFields/index.html new file mode 100644 index 000000000..9cdcfd549 --- /dev/null +++ b/rt/html/Admin/Global/CustomFields/index.html @@ -0,0 +1,91 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Elements/Callback, tabs => $tabs, %ARGS &> +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GlobalCustomFieldTabs, Title => $title &> + +<ul> +% foreach my $key (sort keys %$tabs) { +<li><font size="+2"><a href="<% $tabs->{$key}{path} %>"><% $tabs->{$key}{title} %></a></font><br> +<% $tabs->{$key}{text} %> +</li> +% } +</ul> + +<%INIT> +my $title = loc("Global custom field configuration"); + +my $tabs = { + + A => { + title => loc('Users'), + text => loc('Select custom fields for all users'), + path => 'Users.html', + }, + B => { + title => loc('Groups'), + text => loc('Select custom fields for all user groups'), + path => 'Groups.html', + }, + + F => { + title => loc('Tickets'), + text => loc('Select custom fields for tickets in all queues'), + path => 'Queue-Tickets.html', + }, + + G => { + title => loc('Ticket Transactions'), + text => + loc('Select custom fields for transactions on tickets in all queues'), + path => 'Queue-Transactions.html', + }, + +}; + + +$m->comp('/Elements/Callback', tabs => $tabs); +</%INIT> diff --git a/rt/html/Admin/Global/GroupRights.html b/rt/html/Admin/Global/GroupRights.html index 68718b9af..8d71432e0 100644 --- a/rt/html/Admin/Global/GroupRights.html +++ b/rt/html/Admin/Global/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify global group rights') &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/GroupRights.html', diff --git a/rt/html/Admin/Global/Scrip.html b/rt/html/Admin/Global/Scrip.html index 2e63fe7e2..4e0c1f466 100644 --- a/rt/html/Admin/Global/Scrip.html +++ b/rt/html/Admin/Global/Scrip.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Scrips.html', diff --git a/rt/html/Admin/Global/Scrips.html b/rt/html/Admin/Global/Scrips.html index 37bd2c722..dcfa6ff07 100644 --- a/rt/html/Admin/Global/Scrips.html +++ b/rt/html/Admin/Global/Scrips.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Scrips.html', diff --git a/rt/html/Admin/Global/Template.html b/rt/html/Admin/Global/Template.html index a289eb644..17da59b9e 100644 --- a/rt/html/Admin/Global/Template.html +++ b/rt/html/Admin/Global/Template.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc("Modify template [_1]", $TemplateObj->id) &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Templates.html', diff --git a/rt/html/Admin/Global/Templates.html b/rt/html/Admin/Global/Templates.html index da3395ab4..387326cd1 100644 --- a/rt/html/Admin/Global/Templates.html +++ b/rt/html/Admin/Global/Templates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /Admin/Elements/Header, Title => $title &> +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title, FeedURI => 'templates' &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/Templates.html', current_subtab => 'Admin/Global/Templates.html', diff --git a/rt/html/Admin/Global/UserRights.html b/rt/html/Admin/Global/UserRights.html index a65e7c216..14a4de368 100644 --- a/rt/html/Admin/Global/UserRights.html +++ b/rt/html/Admin/Global/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify global user rights') &> <& /Admin/Elements/SystemTabs, current_tab => 'Admin/Global/UserRights.html', diff --git a/rt/html/Admin/Global/index.html b/rt/html/Admin/Global/index.html index 3a70e7c17..af7a9ddd9 100644 --- a/rt/html/Admin/Global/index.html +++ b/rt/html/Admin/Global/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, tabs => $tabs, %ARGS &> <& /Admin/Elements/Header, Title => loc('Admin/Global configuration') &> <& /Admin/Elements/SystemTabs, @@ -69,8 +69,8 @@ }, F => { title => loc('Custom Fields'), - text => loc('Modify Custom Fields which apply to all queues'), - path => 'CustomFields.html', + text => loc('Modify global custom fields'), + path => 'CustomFields/index.html', }, G => { title => loc('Group Rights'), diff --git a/rt/html/Admin/Groups/CustomFields.html b/rt/html/Admin/Groups/CustomFields.html new file mode 100644 index 000000000..c2336b042 --- /dev/null +++ b/rt/html/Admin/Groups/CustomFields.html @@ -0,0 +1,46 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &> diff --git a/rt/html/Admin/Groups/GroupRights.html b/rt/html/Admin/Groups/GroupRights.html index 55e2a6530..d95bdae07 100644 --- a/rt/html/Admin/Groups/GroupRights.html +++ b/rt/html/Admin/Groups/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> <& /Admin/Elements/GroupTabs, GroupObj => $GroupObj, diff --git a/rt/html/Admin/Groups/History.html b/rt/html/Admin/Groups/History.html new file mode 100644 index 000000000..40dab46e9 --- /dev/null +++ b/rt/html/Admin/Groups/History.html @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, + id => $id, + GroupObj => $GroupObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $GroupObj, + ShowHeaderModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Groups/History.html?id='.$id; +my $GroupObj = new RT::Group($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort("Couldn't load group '$id'"); +my $title = loc("History of the group [_1]", $GroupObj->Name); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html index 779df9567..fd25b2d7f 100644 --- a/rt/html/Admin/Groups/Members.html +++ b/rt/html/Admin/Groups/Members.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => "RT/Admin/Edit the group ". $Group->Name &> <& /Admin/Elements/GroupTabs, GroupObj => $Group, current_tab => 'Admin/Groups/Members.html?id='.$id, @@ -78,7 +78,7 @@ % $UserMembers->LimitToUsers(); <UL> % while (my $member = $UserMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) % } </ul> @@ -87,7 +87,7 @@ % my $GroupMembers = $Group->MembersObj; % $GroupMembers->LimitToGroups(); % while (my $member = $GroupMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> % } % } diff --git a/rt/html/Admin/Groups/Modify.html b/rt/html/Admin/Groups/Modify.html index 0140a57e1..94c0203b1 100644 --- a/rt/html/Admin/Groups/Modify.html +++ b/rt/html/Admin/Groups/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, @@ -53,7 +53,7 @@ -<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST> +<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Modify.html" METHOD=POST ENCTYPE="multipart/form-data"> %unless ($Group->Id) { <INPUT TYPE=HIDDEN NAME=id VALUE="new"> @@ -65,16 +65,27 @@ <&|/l&>Name</&>: </TD> <TD><INPUT name="Name" value="<%$Group->Name%>"></TD> -</TR><TR> +</TR> +<TR> <TD ALIGN=RIGHT> <&|/l&>Description</&>:</TD><TD COLSPAN=3><INPUT name="Description" value="<%$Group->Description%>" size=60></TD> -</TR><TR> +</TR> +% my $CFs = $Group->CustomFields; +% while (my $CF = $CFs->Next) { +<TR VALIGN="TOP"><TD ALIGN="RIGHT"> +<% $CF->Name %>: +</TD><TD> +<& /Elements/EditCustomField, CustomField => $CF, Object => $Group &> +</TD></TR> +% } +<TR> <TD COLSPAN=2> <INPUT TYPE=HIDDEN NAME="SetEnabled" VALUE="1"> <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> </TR> +<& /Elements/Callback, GroupObj => $Group, results => \@results, %ARGS &> </TABLE> -<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> </form> <%INIT> @@ -124,6 +135,7 @@ if ($id) { Object => $Group, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $Group ); } #we're asking about enabled on the web page but really care about disabled. diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html index 3f17baa41..5237b1578 100644 --- a/rt/html/Admin/Groups/UserRights.html +++ b/rt/html/Admin/Groups/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> <& /Admin/Elements/GroupTabs, GroupObj => $GroupObj, diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html index 7c2cd504c..073440696 100644 --- a/rt/html/Admin/Groups/index.html +++ b/rt/html/Admin/Groups/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,36 +42,66 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', current_subtab => 'Admin/Groups/', Title => $title &> - - -<UL> +<%$caption%>:<BR> <UL> +%if ($Groups->Count == 0) { +<LI> <i><&|/l&>No groups matching search criteria found.</&></i> +% } +%my @ids; %while ( my $Group = $Groups->Next) { +% push @ids, $Group->Id; <LI><A HREF="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><BR> %} </UL> +%if (my $ids = join(',', @ids)) { +<em>(<a href="<%$RT::WebPath%>/Download/Tabular/Group/<% $ids %>/Groups.tsv"><&|/l&>Download as a tab-delimited file</&></a>)</em><br> +%} <br><br> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html"> -<input type="checkbox" name="FindDisabledGroups"> <&|/l&>Include disabled groups in listing.</&> +<input type="checkbox" name="FindDisabledGroups" value="1"> <&|/l&>Include disabled groups in listing.</&> <BR> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> +<br><br> +<FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Groups/index.html"> +<&|/l&>Find groups whose</&> <& /Elements/SelectGroups &><BR> +<div align=right><input type=submit value="<&|/l&>Go!</&>"></div> +</FORM> <%INIT> my $Groups = RT::Groups->new($session{'CurrentUser'}); - -if ($FindDisabledGroups) { - $Groups->{'find_disabled_rows'} = 1; -} - $Groups->LimitToUserDefinedGroups(); my $title = loc('Select a group'); +my $caption; +if (length $GroupString) { + $caption = loc("Groups matching search criteria"); + if ($GroupField =~ /^CustomField-(\d+)/) { + $Groups->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } + else { + $Groups->Limit( + FIELD => $GroupField, + OPERATOR => $GroupOp, + VALUE => $GroupString, + ); + } +} +else { + $caption = loc("User-defined groups"); +} </%INIT> <%ARGS> +$GroupString => undef +$GroupOp => '=' +$GroupField => 'Name' $FindDisabledGroups => 0 </%ARGS> diff --git a/rt/html/Admin/Queues/CustomField.html b/rt/html/Admin/Queues/CustomField.html index a865dba71..5beba58c8 100644 --- a/rt/html/Admin/Queues/CustomField.html +++ b/rt/html/Admin/Queues/CustomField.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, @@ -78,7 +78,7 @@ my $subtabs = { </%INIT> <%ARGS> $CustomField => undef -$Queue => undef +$Queue => 0 </%ARGS> <%ATTR> AutoFlush => 0 diff --git a/rt/html/Admin/Queues/CustomFields.html b/rt/html/Admin/Queues/CustomFields.html index 507c02d79..4d7e08875 100644 --- a/rt/html/Admin/Queues/CustomFields.html +++ b/rt/html/Admin/Queues/CustomFields.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,29 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> -<& /Admin/Elements/QueueTabs, id => $Queue->id, - current_tab => 'Admin/Queues/CustomFields.html?id='.$id, - QueueObj => $Queue, - subtabs => $subtabs, +<& /Admin/Elements/QueueTabs, + id => $Object->id, + current_tab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + current_subtab => "Admin/Queues/CustomFields.html?SubType=$SubType&id=$id", + QueueObj => $Object, Title => $title &> -<& /Admin/Elements/EditCustomFields, title => $title, %ARGS &> + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::Queue' &> <%INIT> -my $Queue = new RT::Queue($session{'CurrentUser'}); -$Queue->Load($id) || Abort(loc("Couldn't load queue", $id)); +my $Object = RT::Queue->new( $session{'CurrentUser'} ); -my $CustomFields = RT::CustomFields->new($RT::SystemUser); -$CustomFields->LimitToQueue($Queue->Id); -my $subtabs = { - A => { title => loc('New custom field'), - path => "Admin/Queues/CustomField.html?create=1&Queue=".$id, - } - }; +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); -my $title= loc('Edit Custom Fields for [_1]', $Queue->Name); </%INIT> <%ARGS> $id => undef +$SubType => 'RT::Queue-RT::Ticket' </%ARGS> diff --git a/rt/html/Admin/Queues/GroupRights.html b/rt/html/Admin/Queues/GroupRights.html index 5e0d5b919..c5a12bfa3 100644 --- a/rt/html/Admin/Queues/GroupRights.html +++ b/rt/html/Admin/Queues/GroupRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Modify.html b/rt/html/Admin/Queues/Modify.html index 717a83af4..5517a80c0 100644 --- a/rt/html/Admin/Queues/Modify.html +++ b/rt/html/Admin/Queues/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, @@ -72,13 +72,13 @@ <&|/l&>Reply Address</&>: </TD><TD> <INPUT name="CorrespondAddress" value="<% ($Create) ? "" : $QueueObj->CorrespondAddress %>"> -<BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1]</&></i></font> +<BR><font size="-1"><i><&|/l , $RT::CorrespondAddress&>(If left blank, will default to [_1])</&></i></font> </TD> <TD ALIGN=RIGHT> <&|/l&>Comment Address</&>: </TD><TD> <INPUT NAME="CommentAddress" value="<% ($Create) ? "" : $QueueObj->CommentAddress %>"> -<BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1]</&></i></font> +<BR><font size="-1"><i><&|/l , $RT::CommentAddress&>(If left blank, will default to [_1])</&></i></font> </TD> </TR><TR> @@ -159,7 +159,7 @@ my @attribs= qw(Description CorrespondAddress CommentAddress Name } if ( ($SetEnabled) and ( $Disabled != $QueueObj->Disabled) ) { my ($code, $msg) = $QueueObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + push @results, loc('Enabled status: [_1]', loc_fuzzy($msg)); } if ($QueueObj->Disabled()) { diff --git a/rt/html/Admin/Queues/People.html b/rt/html/Admin/Queues/People.html index 1a5caeec4..e29b9d34f 100644 --- a/rt/html/Admin/Queues/People.html +++ b/rt/html/Admin/Queues/People.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify people related to queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, @@ -79,7 +79,7 @@ <& /Elements/SelectUsers &> <input type=submit name="OnlySearchForPeople" value="<&|/l&>Go!</&>"> <BR> -<&|/l&>Find group whose</&><BR> +<&|/l&>Find groups whose</&><BR> <& /Elements/SelectGroups &> <input type=submit name="OnlySearchForGroup" value="<&|/l&>Go!</&>"> diff --git a/rt/html/Admin/Queues/Scrip.html b/rt/html/Admin/Queues/Scrip.html index be9226fac..1223fbfed 100644 --- a/rt/html/Admin/Queues/Scrip.html +++ b/rt/html/Admin/Queues/Scrip.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->Id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Scrips.html b/rt/html/Admin/Queues/Scrips.html index 5d10e442b..e7092fb22 100644 --- a/rt/html/Admin/Queues/Scrips.html +++ b/rt/html/Admin/Queues/Scrips.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Template.html b/rt/html/Admin/Queues/Template.html index 066e7dd25..c60a90900 100644 --- a/rt/html/Admin/Queues/Template.html +++ b/rt/html/Admin/Queues/Template.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $Queue, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/Templates.html b/rt/html/Admin/Queues/Templates.html index e92184841..888fdbc8a 100644 --- a/rt/html/Admin/Queues/Templates.html +++ b/rt/html/Admin/Queues/Templates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/QueueTabs, id => $QueueObj->id, current_tab => 'Admin/Queues/Templates.html?id='.$id, diff --git a/rt/html/Admin/Queues/UserRights.html b/rt/html/Admin/Queues/UserRights.html index 6aaaab95a..399992ae2 100644 --- a/rt/html/Admin/Queues/UserRights.html +++ b/rt/html/Admin/Queues/UserRights.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Modify user rights for queue [_1]', $QueueObj->Name) &> <& /Admin/Elements/QueueTabs, id => $id, QueueObj => $QueueObj, diff --git a/rt/html/Admin/Queues/index.html b/rt/html/Admin/Queues/index.html index 80998bd56..28adf531c 100644 --- a/rt/html/Admin/Queues/index.html +++ b/rt/html/Admin/Queues/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc("Admin queues") &> <& /Admin/Elements/QueueTabs, current_tab => 'Admin/Queues/', current_subtab => 'Admin/Queues/', @@ -50,18 +50,19 @@ -<%$caption%>:<BR> +<h1><%$caption%></h1> +<p><&|/l&>Select a queue</&>:</p> <UL> %if ($queues->Count == 0) { -<LI> <i><&|/l&>No queues matching search criteria found.</&></i> +<li><i><&|/l&>No queues matching search criteria found.</&></i></li> % } %while ( $queue = $queues->Next) { -<LI><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></LI> +<li><A HREF="Modify.html?id=<%$queue->id%>"><%$queue->Name%></a></li> %} </UL> <BR> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Queues/index.html"> -<input type="checkbox" name="FindDisabledQueues"> <&|/l&>Include disabled queues in listing.</&> +<input type="checkbox" name="FindDisabledQueues" value="1"> <&|/l&>Include disabled queues in listing.</&> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> diff --git a/rt/html/Admin/Tools/Configuration.html b/rt/html/Admin/Tools/Configuration.html index 24d9b7309..bc5ca69a1 100644 --- a/rt/html/Admin/Tools/Configuration.html +++ b/rt/html/Admin/Tools/Configuration.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> require Module::Versions::Report; my $title = loc('System Configuration'); @@ -80,7 +80,7 @@ unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'Super % next if (ref ${'RT::'.$key} ); <tr><td>RT::<%$key%></td> <td> -% if ($key =~ /Password/i) { +% if ($key =~ /Password(?!Length)/i) { <i>Password not printed</i> % } else { <%${'RT::'.$key} %> diff --git a/rt/html/Admin/Tools/index.html b/rt/html/Admin/Tools/index.html index c9a587371..49cfac3ee 100644 --- a/rt/html/Admin/Tools/index.html +++ b/rt/html/Admin/Tools/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $title = loc('System Tools'); </%init> diff --git a/rt/html/Admin/Users/CustomFields.html b/rt/html/Admin/Users/CustomFields.html new file mode 100644 index 000000000..5662c6c16 --- /dev/null +++ b/rt/html/Admin/Users/CustomFields.html @@ -0,0 +1,69 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $Object->id, + current_tab => "Admin/Users/CustomFields.html?$id=".$id, + current_subtab => "Admin/Users/CustomFields.html?id=".$id, + UserObj => $Object, + Title => $title + &> + + <& /Admin/Elements/EditCustomFields, %ARGS, title => $title, Object => $Object, ObjectType => 'RT::User' &> +<%INIT> +my $Object = RT::User->new( $session{'CurrentUser'} ); + +$Object->Load($id) || Abort( loc( "Couldn't load object [_1]", $id ) ); +my $FriendlySubTypes = + RT::CustomField->new( $session{'CurrentUser'} ) + ->FriendlyLookupType( $Object->CustomFieldLookupType ); + +my $title = loc( 'Edit Custom Fields for [_1]', $Object->Name ); + +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/History.html b/rt/html/Admin/Users/History.html new file mode 100644 index 000000000..024a90b00 --- /dev/null +++ b/rt/html/Admin/Users/History.html @@ -0,0 +1,66 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $UserObj, + ShowHeaderModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Users/History.html?id='.$id; +my $UserObj = new RT::User($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("History of the user [_1]", $UserObj->Name); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/Memberships.html b/rt/html/Admin/Users/Memberships.html new file mode 100644 index 000000000..3e632393f --- /dev/null +++ b/rt/html/Admin/Users/Memberships.html @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/UserTabs, + id => $id, + UserObj => $UserObj, + current_tab => $current_tab, + Title => $title &> + +<h2><&|/l&>Groups</&></h2> + +<& /Elements/ShowMemberships, UserObj => $UserObj &> + +<%INIT> +my $UserObj = RT::User->new($session{'CurrentUser'}); +$UserObj->Load($id) || Abort("Couldn't load user '$id'"); +my $title = loc("Memberships of the user [_1]", $UserObj->Name); +my $current_tab = 'Admin/Users/Memberships.html?id='.$id; +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Users/Modify.html b/rt/html/Admin/Users/Modify.html index efa1f80de..8a24f9c4a 100644 --- a/rt/html/Admin/Users/Modify.html +++ b/rt/html/Admin/Users/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => $title &> <& /Admin/Elements/UserTabs, id => $id, @@ -52,7 +52,7 @@ <& /Elements/ListActions, actions => \@results &> -<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST> +<FORM ACTION="<%$RT::WebPath%>/Admin/Users/Modify.html" METHOD=POST ENCTYPE="multipart/form-data"> %if ($Create) { <INPUT TYPE=HIDDEN NAME=id VALUE="new"> % } else { @@ -91,6 +91,11 @@ <input name="Gecos" value="<%$UserObj->Gecos%>"> </TD></TR> <TR><TD ALIGN="RIGHT"> +<&|/l&>Language</&>: +</TD><TD> +<& /Elements/SelectLang, Name => 'Lang', Default => $UserObj->Lang &> +</TD></TR> +<TR><TD ALIGN="RIGHT"> <&|/l&>Extra info</&>: </TD><TD> <textarea name="FreeformContactInfo" cols=20 rows=5><%$UserObj->FreeformContactInfo%></TEXTAREA> @@ -199,17 +204,30 @@ <TR> </TR> </TABLE> +<BR> +<& /Elements/TitleBoxStart, title => loc('Custom Fields') &> +<TABLE> +% my $CFs = $UserObj->CustomFields; +% while (my $CF = $CFs->Next) { +<TR VALIGN="TOP"><TD ALIGN="RIGHT"> +<% $CF->Name %>: +</TD><TD> +<& /Elements/EditCustomField, %ARGS, Object => $UserObj, CustomField => $CF &> +</TD></TR> +% } +<TR> +</TR> +</TABLE> +<& /Elements/TitleBoxEnd &> <TR> <TD colspan="2"> <& /Elements/TitleBoxStart, title => loc('Comments about this user') &> -<TEXTAREA name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%> -</TEXTAREA> +<TEXTAREA class="comments" name="Comments" COLS=80 ROWS=5 WRAP=VIRTUAL><%$UserObj->Comments%></TEXTAREA> <& /Elements/TitleBoxEnd &> %if ($UserObj->Privileged) { <BR> <& /Elements/TitleBoxStart, title => loc('Signature') &> -<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> -<%$UserObj->Signature%></TEXTAREA> +<TEXTAREA class="signature" COLS=80 ROWS=5 name="Signature" WRAP=HARD><%$UserObj->Signature%></TEXTAREA> <& /Elements/TitleBoxEnd &> % } @@ -236,46 +254,44 @@ else { $current_tab = 'Admin/Users/Modify.html?id='.$id; if ($id eq 'new') { - ( $val, $msg ) = $UserObj->Create( - Name => $Name, - EmailAddress => $ARGS{'EmailAddress'}, - Name => $ARGS{'Name'}, - Comments => $ARGS{'Comments'}, - Signature => $ARGS{'Signature'}, - EmailAddress => $ARGS{'EmailAddress'}, - FreeformContactInfo => $ARGS{'FreeformContactInfo'}, - Organization => $ARGS{'Organization'}, - RealName => $ARGS{'RealName'}, - NickName => $ARGS{'NickName'}, - Lang => $ARGS{'Lang'}, - EmailEncoding => $ARGS{'EmailEncoding'}, - WebEncoding => $ARGS{'WebEncoding'}, - ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, - ContactInfoSystem => $ARGS{'ContactInfoSystem'}, - Gecos => $ARGS{'Gecos'}, - ExternalAuthId => $ARGS{'ExternalAuthId'}, - AuthSystem => $ARGS{'AuthSystem'}, - HomePhone => $ARGS{'HomePhone'}, - WorkPhone => $ARGS{'WorkPhone'}, - MobilePhone => $ARGS{'MobilePhone'}, - PagerPhone => $ARGS{'PagerPhone'}, - Address1 => $ARGS{'Address1'}, - Address2 => $ARGS{'Address2'}, - City => $ARGS{'City'}, - State => $ARGS{'State'}, - Zip => $ARGS{'Zip'}, - Country => $ARGS{'Country'}, - Privileged => $ARGS{'Privileged'}, - Disabled => ($ARGS{'Enabled'} ? 0 : 1) - ); + ( $val, $msg ) = $UserObj->Create( + Name => $Name, + EmailAddress => $ARGS{'EmailAddress'}, + Name => $ARGS{'Name'}, + Comments => $ARGS{'Comments'}, + Signature => $ARGS{'Signature'}, + EmailAddress => $ARGS{'EmailAddress'}, + FreeformContactInfo => $ARGS{'FreeformContactInfo'}, + Organization => $ARGS{'Organization'}, + RealName => $ARGS{'RealName'}, + NickName => $ARGS{'NickName'}, + Lang => $ARGS{'Lang'}, + EmailEncoding => $ARGS{'EmailEncoding'}, + WebEncoding => $ARGS{'WebEncoding'}, + ExternalContactInfoId => $ARGS{'ExternalContactInfoId'}, + ContactInfoSystem => $ARGS{'ContactInfoSystem'}, + Gecos => $ARGS{'Gecos'}, + ExternalAuthId => $ARGS{'ExternalAuthId'}, + AuthSystem => $ARGS{'AuthSystem'}, + HomePhone => $ARGS{'HomePhone'}, + WorkPhone => $ARGS{'WorkPhone'}, + MobilePhone => $ARGS{'MobilePhone'}, + PagerPhone => $ARGS{'PagerPhone'}, + Address1 => $ARGS{'Address1'}, + Address2 => $ARGS{'Address2'}, + City => $ARGS{'City'}, + State => $ARGS{'State'}, + Zip => $ARGS{'Zip'}, + Country => $ARGS{'Country'}, + Privileged => $ARGS{'Privileged'}, + Disabled => ($ARGS{'Enabled'} ? 0 : 1) + ); + if ($val) { push @results, $msg; } else { push @results, loc('User could not be created: [_1]', $msg); - } - - # set the id, so the the menu will have the right info - $id = $UserObj->Id; + } } else { $UserObj->Load($id) || $UserObj->Load($Name) || Abort("Couldn't load user '$Name'"); $val = $UserObj->Id(); @@ -283,14 +299,13 @@ else { if ($val) { $title = loc("Modify the user [_1]", $UserObj->Name); - } + } # If the create failed else { $title = loc("Create a new user"); $Create = 1; - } - + } } @@ -298,49 +313,55 @@ else { # If we have a user to modify, lets try. if ($UserObj->Id && $id ne 'new') { - + my @fields = qw(Name Comments Signature EmailAddress FreeformContactInfo Organization RealName NickName Lang EmailEncoding WebEncoding ExternalContactInfoId ContactInfoSystem Gecos ExternalAuthId AuthSystem HomePhone WorkPhone MobilePhone PagerPhone Address1 - Address2 City State Zip Country + Address2 City State Zip Country ); - + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, Object => $UserObj, ARGSRef => \%ARGS ); push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $UserObj ); -# {{{ Deal with special fields: Privileged, Enabled and Password -if ( ($SetPrivileged) and ( $Privileged != $UserObj->Privileged) ) { -my ($code, $msg) = $UserObj->SetPrivileged($Privileged); - push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); -} + # {{{ Deal with special fields: Privileged, Enabled + if ( $SetPrivileged and $Privileged != $UserObj->Privileged ) { + my ($code, $msg) = $UserObj->SetPrivileged($Privileged); + push @results, loc('Privileged status: [_1]', loc_fuzzy($msg)); + } -#we're asking about enabled on the web page but really care about disabled. -if ($Enabled == 1) { - $Disabled = 0; -} -else { - $Disabled = 1; -} -if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { - my ($code, $msg) = $UserObj->SetDisabled($Disabled); - push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); -} + #we're asking about enabled on the web page but really care about disabled. + $Disabled = $Enabled ? 0 : 1; + + if ( ($SetEnabled) and ( $Disabled != $UserObj->Disabled) ) { + my ($code, $msg) = $UserObj->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); + } -#TODO: make this report errors properly -if ((defined $Pass1) and ($Pass1 ne '') and ($Pass1 eq $Pass2) and (!$UserObj->IsPassword($Pass1))) { - my ($code, $msg); - ($code, $msg) = $UserObj->SetPassword($Pass1); - push @results, loc('Password: [_1]', loc_fuzzy($msg)); -} elsif ( $Pass1 && ($Pass1 ne $Pass2)) { - push @results, loc("Passwords do not match."); + # }}} } -# }}} +if ( $UserObj->Id ) { + my $password_not_set; + # Deal with Password field + if ( !$Pass1 and !$Pass2 ) { + $password_not_set = 1; + } elsif ( $Pass1 ne $Pass2 ) { + $password_not_set = 1; + push @results, loc("Passwords do not match."); + } elsif ( $Pass1 eq $Pass2 and !$UserObj->IsPassword($Pass1) ) { + my ($code, $msg) = $UserObj->SetPassword($Pass1); + push @results, loc_fuzzy($msg); + $password_not_set = 1 unless $code; + } + if ($id eq 'new' and $password_not_set) { + push @results, loc("A password was not set, so user won't be able to login."); + } } @@ -354,6 +375,11 @@ if ($UserObj->Privileged()) { } # }}} + +# set the id, so the the menu will have the right info, this needs to +# be done here to avoid creating and then modifying a user +$id = $UserObj->Id; + </%INIT> diff --git a/rt/html/Admin/Users/index.html b/rt/html/Admin/Users/index.html index f4cf2f0fc..1bbe867f7 100644 --- a/rt/html/Admin/Users/index.html +++ b/rt/html/Admin/Users/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,30 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('Select a user') &> <& /Admin/Elements/UserTabs, current_tab => 'Admin/Users/', current_subtab => 'Admin/Users/', Title => loc('Select a user') &> - - - -<%$caption%>:<BR> -<UL> +<h1><%$caption%></h1> +<p><&|/l&>Select a user</&>:</p> +<ul> %if ($users->Count == 0) { -<LI> <i><&|/l&>No users matching search criteria found.</&></i> +<li><i><&|/l&>No users matching search criteria found.</&></i></li> % } +%my @ids; %while ( $user = $users->Next) { +% push @ids, $user->Id; <LI><A HREF="Modify.html?id=<%$user->id%>"><%$user->Name || loc('(no name listed)')%></a></LI> %} - </UL> +%if (my $ids = join(',', @ids)) { +<em>(<a href="<%$RT::WebPath%>/Download/Tabular/User/<% $ids %>/Users.tsv"><&|/l&>Download as a tab-delimited file</&></a>)</em><br> +%} + <br><br> <FORM METHOD=POST ACTION="<% $RT::WebPath %>/Admin/Users/index.html"> <&|/l&>Find people whose</&> <& /Elements/SelectUsers &><BR> -<input type="checkbox" name="FindDisabledUsers"> <&|/l&>Include disabled users in search.</&> +<input type="checkbox" name="FindDisabledUsers" value="1"> <&|/l&>Include disabled users in search.</&> <BR> <div align=right><input type=submit value="<&|/l&>Go!</&>"></div> </FORM> @@ -78,19 +81,26 @@ if ($FindDisabledUsers) { $users->{'find_disabled_rows'} = 1; } -unless (defined $UserString) { - $users->LimitToPrivileged(); - $caption = loc("Privileged users"); -} -else { +if (length $UserString) { $caption = loc("Users matching search criteria"); - - if ($UserString) { - $users->Limit( FIELD => $UserField, - OPERATOR => $UserOp, - VALUE => $UserString); - + if ($UserField =~ /^CustomField-(\d+)/) { + $users->LimitCustomField( + CUSTOMFIELD => $1, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } + else { + $users->Limit( + FIELD => $UserField, + OPERATOR => $UserOp, + VALUE => $UserString, + ); + } } +else { + $caption = loc("Privileged users"); + $users->LimitToPrivileged; } </%INIT> <%ARGS> diff --git a/rt/html/Admin/autohandler b/rt/html/Admin/autohandler new file mode 100644 index 000000000..def61010a --- /dev/null +++ b/rt/html/Admin/autohandler @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%init> +$m->call_next(%ARGS) if $session{'CurrentUser'}->UserObj->HasRight( + Right => 'ShowConfigTab', + Object => $RT::System, +); +</%init>
\ No newline at end of file diff --git a/rt/html/Admin/index.html b/rt/html/Admin/index.html index 5aec88b9d..01ba24d2d 100644 --- a/rt/html/Admin/index.html +++ b/rt/html/Admin/index.html @@ -1,11 +1,11 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# -%# (Except where explicitly superseded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices), %# %# %# LICENSE: @@ -31,7 +31,7 @@ %# to you to modify and distribute this software under the terms of %# the GNU General Public License and is only of importance to you if %# you choose to contribute your changes and enhancements to the -%# community by submitting them to Best Practical Solutions, LLC.) +%# community by submitting them to Best Practical Solutions, LLC.), %# %# By intentionally submitting any modifications, corrections or %# derivatives to this work, or any other work intended for use with @@ -42,21 +42,58 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Admin/Elements/Header, Title => loc('RT Administration') &> <& /Admin/Elements/Tabs, Title => loc('RT Administration') &> <ul> -<li><font size="+2"><a href="Users/"><&|/l&>Users</&></a></font><br> -<&|/l&>Manage users and passwords</&> -</li> -<li><font size="+2"><a href="Groups/"><&|/l&>Groups</&></a></font><br> -<&|/l&>Manage groups and group membership</&> -</li> -<li><font size="+2"><a href="Queues/"><&|/l&>Queues</&></a></font><br> -<&|/l&>Manage queues and queue-specific properties</&> -</li> -<li><font size="+2"><a href="Global/"><&|/l&>Global</&></a></font><br> -<&|/l&>Manage properties and configuration which apply to all queues</&> +% foreach my $key (sort keys %$tabs) { +<li><font size="+2"><a href="<%$RT::WebPath%>/<%$tabs->{$key}->{'path'}|n %>"><%$tabs->{$key} ->{'title'}%></a></font><br> +<%$tabs->{$key}->{description}%> </li> +%} </ul> +<%init> + + + +my $tabs = { + A => { + title => loc('Users'), + path => 'Admin/Users/index.html', + description => loc('Manage users and passwords'), + }, + B => { + title => loc('Groups'), + path => 'Admin/Groups/index.html', + description => loc('Manage groups and group membership'), + }, + C => { + title => loc('Queues'), + path => 'Admin/Queues/index.html', + description => loc('Manage queues and queue-specific properties'), + }, + D => { + 'title' => loc('Custom Fields'), + description => loc('Manage custom fields and custom field values'), + path => 'Admin/CustomFields/index.html', + }, + E => { + 'title' => loc('Global'), + path => 'Admin/Global/index.html', + description => + loc('Manage properties and configuration which apply to all queues'), + }, + F => { + 'title' => loc('Tools'), + path => 'Admin/Tools/index.html', + description => loc('Use other RT administrative tools') + }, +}; + + $m->comp('/Elements/Callback', tabs => $tabs, %ARGS); + + + + +</%init> diff --git a/rt/html/Approvals/Display.html b/rt/html/Approvals/Display.html index 8b5a6c33f..d9d6df582 100644 --- a/rt/html/Approvals/Display.html +++ b/rt/html/Approvals/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& Elements/Tabs, diff --git a/rt/html/Approvals/Elements/Approve b/rt/html/Approvals/Elements/Approve index f4f015f68..bf786fb03 100644 --- a/rt/html/Approvals/Elements/Approve +++ b/rt/html/Approvals/Elements/Approve @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <tr bgcolor="#b9b9ff"> <td colspan=2><font size="3"> <a href="<%$RT::WebPath%>/Approvals/Display.html?id=<%$ticket->Id%>"><% loc("#[_1]: [_2]", $ticket->Id, $ticket->Subject) %></a> (<%loc($ticket->Status)%>)</font></td> diff --git a/rt/html/Approvals/Elements/PendingMyApproval b/rt/html/Approvals/Elements/PendingMyApproval index abc76cc00..f13ddf0f3 100644 --- a/rt/html/Approvals/Elements/PendingMyApproval +++ b/rt/html/Approvals/Elements/PendingMyApproval @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table width="100%"> % my ($i, $class); % my %done; diff --git a/rt/html/Approvals/Elements/ShowDependency b/rt/html/Approvals/Elements/ShowDependency index b86709665..e8d0b00d5 100644 --- a/rt/html/Approvals/Elements/ShowDependency +++ b/rt/html/Approvals/Elements/ShowDependency @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % my $approving = $Ticket->DependedOnBy(); % if ($approving->Count) { <h3><&|/l&>Tickets which depend on this approval:</&></h3> diff --git a/rt/html/Approvals/Elements/Tabs b/rt/html/Approvals/Elements/Tabs index 99cdec8ef..03bdc262e 100644 --- a/rt/html/Approvals/Elements/Tabs +++ b/rt/html/Approvals/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Approvals/', diff --git a/rt/html/Approvals/index.html b/rt/html/Approvals/index.html index 93d979a59..88c277c1e 100644 --- a/rt/html/Approvals/index.html +++ b/rt/html/Approvals/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("My approvals") &> <& /Approvals/Elements/Tabs, Title => loc("My approvals") &> diff --git a/rt/html/Download/CustomFieldValue/dhandler b/rt/html/Download/CustomFieldValue/dhandler new file mode 100644 index 000000000..521968024 --- /dev/null +++ b/rt/html/Download/CustomFieldValue/dhandler @@ -0,0 +1,75 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%perl> +my $id; +my $arg = $m->dhandler_arg; # get rest of path +if ($arg =~ /^(\d+)\//) { + $id = $1; +} +else { + Abort("Corrupted customfieldvalue URL."); +} +my $OCFV = RT::ObjectCustomFieldValue->new($session{'CurrentUser'}); +$OCFV->Load($id) || Abort("OCFV '$id' could not be loaded"); + +unless ($OCFV->id) { + Abort("Bad OCFV id. Couldn't find OCFV '$id'\n"); +} + +my $content_type = $OCFV->ContentType || 'text/plain'; + +unless ($RT::TrustHTMLAttachments) { + $content_type = 'text/plain' if ($content_type =~ /^text\/html/i); +} + +$r->content_type( $content_type ); +$m->clear_buffer(); +$m->out($OCFV->LargeContent); +$m->abort; +</%perl> +<%attr> +AutoFlush => 0 +</%attr> diff --git a/rt/html/Download/Tabular/dhandler b/rt/html/Download/Tabular/dhandler new file mode 100644 index 000000000..3965a990e --- /dev/null +++ b/rt/html/Download/Tabular/dhandler @@ -0,0 +1,74 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%perl> +my ($class, $filename, @ids); +my $arg = $m->dhandler_arg; # get rest of path +if ($arg =~ /^(\w+)\/([,\d]+)(?:\/([^\/]+))?/) { + $class = "RT::$1"; + $filename = $3 || "$1s.tsv"; + @ids = sort split(/,+/, $2); +} +else { + Abort("Corrupted tabular URL."); +} + +my @cols = $class->BasicColumns or return; + +#$r->content_type( 'application/octet-stream' ); +$r->content_type( 'text/plain' ); +$r->headers_out->{'Content-Disposition'} = "attachment; filename=$filename"; +$m->clear_buffer(); +$m->out(join("\t", "Id", map $_->[1], @cols), "\n"); +foreach my $id (@ids) { + my $obj = $class->new; + $obj->Load($id) or next; + $m->out(join("\t", map $obj->$_, "Id", map $_->[0], @cols), "\n"); +} +$m->abort; +</%perl> +<%attr> +AutoFlush => 0 +</%attr> diff --git a/rt/html/Elements/BevelBoxRaisedEnd b/rt/html/Elements/BevelBoxRaisedEnd index f1c794b37..e1d1edb7c 100644 --- a/rt/html/Elements/BevelBoxRaisedEnd +++ b/rt/html/Elements/BevelBoxRaisedEnd @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} </TD> </TR> </table> diff --git a/rt/html/Elements/BevelBoxRaisedStart b/rt/html/Elements/BevelBoxRaisedStart index ca504e4b2..6c5a6137e 100644 --- a/rt/html/Elements/BevelBoxRaisedStart +++ b/rt/html/Elements/BevelBoxRaisedStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table cellspacing=0 cellpadding=0 width=100% height=100%> <TR> <TD width=100% height=100%> diff --git a/rt/html/Elements/Callback b/rt/html/Elements/Callback index cbec1883d..937e923a1 100644 --- a/rt/html/Elements/Callback +++ b/rt/html/Elements/Callback @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,43 +42,45 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%once> -my (%cache, $check); +my %cache; </%once> <%init> -# checks for inode change time for each callback directory -my $new_check = join( - $;, map { $_->[1] => (stat("$_->[1]/Callbacks"))[10] } $m->interp->resolver->comp_root_array -) or return; - $Page = $m->callers(1)->path unless ($Page); -my $callbacks; -if ($new_check eq $check) { - $callbacks = $cache{$Page,$_CallbackName}; -} -else { - $check = $new_check; -} +my $CacheKey = "Callback--$Page--$_CallbackName"; +my $callbacks = $cache{$CacheKey} || $m->notes($CacheKey); if (!$callbacks) { - my $path = "/Callbacks/*$Page/$_CallbackName"; - $callbacks = [ $m->interp->resolver->glob_path($path) ]; - @$callbacks = grep !/^\.|~$/, @$callbacks; #skip backup files - - #skip files without a package - my $invalid_base = "/Callbacks/$Page/$_CallbackName"; - @$callbacks = grep !/^$invalid_base$/, @$callbacks; - - + my $path = "/Callbacks/*$Page/$_CallbackName"; - $cache{$Page,$_CallbackName} = $callbacks; + # Due to API changes after Mason 1.28, we have to check for which + # version we're running when getting the component roots + my @roots = map { $_->[1] } + $HTML::Mason::VERSION <= 1.28 + ? $m->interp->resolver->comp_root_array + : $m->interp->comp_root_array; + + my %seen; + + for my $root (@roots) { + push @$callbacks, + # Skip backup files, files without a leading package name, + # and files we've already seen + grep { !/^\.|~$/ + and $_ ne "/Callbacks/$Page/$_CallbackName" + and not $seen{$_}++ } + $m->interp->resolver->glob_path($path, $root); + } + + $m->notes($CacheKey => $callbacks); + $cache{$Page,$_CallbackName} = $callbacks if !$RT::DevelMode; } my @rv; foreach my $comp (sort @$callbacks) { - push @rv, $m->comp($comp, %ARGS) if $m->comp_exists($comp); + push @rv, $m->comp($comp, %ARGS); } return @rv; </%init> diff --git a/rt/html/Elements/Checkbox b/rt/html/Elements/Checkbox index 146de6a7a..f2256fb78 100644 --- a/rt/html/Elements/Checkbox +++ b/rt/html/Elements/Checkbox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<INPUT TYPE="Checkbox" NAME ="<%$Name%>" <%$IsChecked%>> +%# END BPS TAGGED BLOCK }}} +<INPUT TYPE="Checkbox" NAME="<%$Name%>" value="1" <%$IsChecked%>> <%ARGS> $Name => undef diff --git a/rt/html/Elements/CollectionAsTable/Header b/rt/html/Elements/CollectionAsTable/Header index 2d1574dea..9ed4be8ec 100644 --- a/rt/html/Elements/CollectionAsTable/Header +++ b/rt/html/Elements/CollectionAsTable/Header @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,16 +20,32 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%ARGS> @Format => undef +$FormatString => undef $AllowSorting => undef $Order=>undef $BaseURL => undef @@ -32,53 +54,63 @@ $Rows => undef $Page => undef $maxitems => undef </%ARGS> -<TR> +<TR class="collection-as-table"> <%perl> -my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page ); +my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString ); my $item = 0; -$$maxitems = 0; foreach my $col (@Format) { $item++; - $$maxitems = $item if $item > $$maxitems; if ( $col->{title} eq 'NEWLINE' ) { - $m->out('</TR> <TR>'); - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{<th class="collection-as-table"> </th>\n}); + $item++; + } + + $item = 0; + $m->out(qq{</TR>\n<TR class="collection-as-table">}); } else { - $m->out('<TH align="center">'); + $m->out('<TH class="collection-as-table">'); my $title = $col->{title}; $title =~ s/^__(.*)__$/$1/o; - $title = ( $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $title, - Attr => 'title' - ) - || $title - ); - if ( $AllowSorting + $title = ( + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $title, + Attr => 'title' + ) + || $title + ); + if ( + $AllowSorting && $col->{'attribute'} - && $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' ) - ) + && $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) + ) { $m->out( - '<a href="' . $BaseURL + '<a href="' . $BaseURL . $m->comp( '/Elements/QueryString', %generic_query_args, OrderBy => ( - $m->comp('/Elements/RT__Ticket/ColumnMap', - Name => $col->{'attribute'}, - Attr => 'attribute' - ) + $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col->{'attribute'}, + Attr => 'attribute' + ) || $col->{'attribute'} ), Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' ) - ). - '">' . loc($title) . '</a>' + ) + . '">' + . loc($title) . '</a>' ); } else { diff --git a/rt/html/Elements/CollectionAsTable/ParseFormat b/rt/html/Elements/CollectionAsTable/ParseFormat index c7b709bff..57434efe2 100644 --- a/rt/html/Elements/CollectionAsTable/ParseFormat +++ b/rt/html/Elements/CollectionAsTable/ParseFormat @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,44 +20,59 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%ARGS> $Format </%ARGS> <%init> -use Regexp::Common qw(delimited); +use Regexp::Common; my @Columns; -#my $quoted = qr[$RE{delimited}{-delim=>qq{\'\"}}|(?:\{|\}|\w|\.)+]; -my $justquoted = qr[$RE{delimited}{-delim=>qq{\'\"}}]; -#my $quoted = $RE{quoted}{-esc}; -my $word = qr [(?:\{|\}|\w|\.)+]; -while ($Format =~ /($justquoted|$word)/igx) { +while ($Format =~ /($RE{delimited}{-delim=>qq{\'"}}|[{}\w.]+)/go) { my $col = $1; - if ($col =~ /^$RE{quoted}{-esc}$/) { + if ($col =~ /^$RE{quoted}$/o) { substr($col,0,1) = ""; substr($col,-1,1) = ""; } my $colref; - if ( $col =~ s/\/STYLE:(.*?)$//io ) { + + if ( $col =~ s!/STYLE:([^/]+)!!io ) { $colref->{'style'} = $1; } - if ( $col =~ s/\/CLASS:(.*?)$//io ) { + if ( $col =~ s!/CLASS:([^/]+)!!io ) { $colref->{'class'} = $1; } - if ( $col =~ s/\/TITLE:(.*?)$//io ) { + if ( $col =~ s!/TITLE:([^/]+)!!io ) { $colref->{'title'} = $1; } + if ( $col =~ s!/ALIGN:([^\/]+)!!io ) { + $colref->{'align'} = $1; + } if ( $col =~ /__(.*?)__/gio ) { my @subcols; while ( $col =~ s/^(.*?)__(.*?)__//o ) { diff --git a/rt/html/Elements/CollectionAsTable/Row b/rt/html/Elements/CollectionAsTable/Row index 926317be9..3316bc027 100644 --- a/rt/html/Elements/CollectionAsTable/Row +++ b/rt/html/Elements/CollectionAsTable/Row @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,14 +20,29 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%ARGS> $i => undef @Format => undef @@ -32,35 +53,56 @@ $Warning => undef </%ARGS> <%PERL> -$m->out( '<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); +$m->out('<TR class="' . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); my $item; foreach my $column (@Format) { if ( $column->{title} eq 'NEWLINE' ) { - while ($item < $maxitems) { - $m->out("<td> </td>\n"); - $item++; - } - $item = 0; + while ( $item < $maxitems ) { + $m->out(qq{<td class="collection-as-table"> </td>\n}); + $item++; + } + $item = 0; $m->out('</TR>'); - $m->out( '<TR class="' . - ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) . '" >' ); + $m->out('<TR class="' + . ( $Warning ? 'warnline' : $i % 2 ? 'oddline' : 'evenline' ) + . '" >' ); next; } $item++; - $m->out('<td align="left">'); + $m->out('<td class="collection-as-table" '); + $m->out( 'align="' . $column->{align} . '"' ) if ( $column->{align} ); + $m->out('>'); foreach my $subcol ( @{ $column->{output} } ) { if ( $subcol =~ /^__(.*?)__$/o ) { - my $col = $1; - my $value = $m->comp('/Elements/RT__Ticket/ColumnMap', Name => $col, Attr => 'value'); + my $col = $1; + my $value = $m->comp( + '/Elements/RT__Ticket/ColumnMap', + Name => $col, + Attr => 'value' + ); + my @out; + + if ( $value && ref($value) ) { + + # All HTML snippets are returned by the callback function + # as scalar references. Data fetched from the objects are + # plain scalars, and needs to be escaped properly. + @out = + map { + ref($_) ? $$_ : $m->interp->apply_escapes( $_ => 'h' ) + } &{$value}( $record, $i ) + ; + } + else { - if ( $value && ref($value)) { - $m->out( &{ $value } ( $record, $i ) ); - } else { - $m->out($value ); + # Simple value; just escape it. + @out = $m->interp->apply_escapes( $value => 'h' ); } + s/\n/<br>/gs for @out; + $m->out( @out ); } else { - $m->out( Encode::decode_utf8($subcol) ); + $m->out($subcol); } } $m->out('</td>'); diff --git a/rt/html/Elements/CreateTicket b/rt/html/Elements/CreateTicket index 70c94e78f..bd60bbddf 100644 --- a/rt/html/Elements/CreateTicket +++ b/rt/html/Elements/CreateTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<FORM ACTION="<% $RT::WebPath%>/Ticket/Create.html"> +%# END BPS TAGGED BLOCK }}} +<FORM ACTION="<% $RT::WebPath %>/Ticket/Create.html" NAME="CreateTicketInQueue"> <&|/l, $m->scomp('/Elements/SelectNewTicketQueue')&><input type="submit" value="New ticket in"> [_1]</&> </FORM> diff --git a/rt/html/Elements/EditCustomField b/rt/html/Elements/EditCustomField new file mode 100644 index 000000000..d2398c9da --- /dev/null +++ b/rt/html/Elements/EditCustomField @@ -0,0 +1,89 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<%INIT> +my $Values; +if ($Object) { + $Values = $Object->CustomFieldValues($CustomField->id); + $Values->Columns( qw( id CustomField ObjectType ObjectId Disabled Content ContentType ContentEncoding ) ); + $NamePrefix ||= join('-', 'Object', ref($Object), $Object->Id, 'CustomField', ''); +} +my $Type = $CustomField->Type; + +return unless ($Type); # if we can't see the type, all hell will break loose. + +my $MaxValues = $CustomField->MaxValues; +if ($MaxValues == 1 and $Object and $Values) { + # what exactly is this doing? Without the "unless" it breaks RTFM + # transaction extraction into articles. + $Default = ($Values->First ? $Values->First->Content : '') unless $Default; + $Values->GotoFirstItem; +} +# The "Magic" hidden input causes RT to know that we were trying to edit the field, even if +# we don't see a value later, since browsers aren't compelled to submit empty form fields +$m->out("\n".'<input type="hidden" name="'.$NamePrefix.$CustomField->Id.'-Values-Magic" value="1">'."\n"); + +return $m->comp( + "EditCustomField$Type", + %ARGS, + Rows => $Rows, + Cols => $Cols, + Default => $Default, + Object => $Object, + Values => $Values, + MaxValues => $MaxValues, + Multiple => ($MaxValues != 1), + NamePrefix => $NamePrefix, + CustomField => $CustomField, +); +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Rows => 5 +$Cols => 15 +$Default => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldBinary b/rt/html/Elements/EditCustomFieldBinary new file mode 100644 index 000000000..002825660 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldBinary @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +%# XXX - let user download the file(s) here? +<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload"> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldFreeform b/rt/html/Elements/EditCustomFieldFreeform new file mode 100644 index 000000000..c097ee0a9 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldFreeform @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% if ($Multiple) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$Default%></textarea> +% } else { +<input name="<%$NamePrefix%><%$CustomField->Id%>-Value" size="<%$Cols%>" value="<%$Default ? $Default : ''%>"> +% } +<%INIT> +if ($Multiple and $Values) { + $Default = ''; + while (my $value = $Values->Next ) { + $Default .= $value->Content."\n"; + } +} +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldImage b/rt/html/Elements/EditCustomFieldImage new file mode 100644 index 000000000..b378ceae6 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldImage @@ -0,0 +1,60 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><& ShowCustomFieldImage, Object => $value &> +<br> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload"> +% } +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldSelect b/rt/html/Elements/EditCustomFieldSelect new file mode 100644 index 000000000..db33a6839 --- /dev/null +++ b/rt/html/Elements/EditCustomFieldSelect @@ -0,0 +1,71 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} + <select name="<%$NamePrefix%><%$CustomField->Id%>-Values" + size="<%$Rows%>" + <% $Multiple && 'MULTIPLE' %>> +% my $selected; +% my $CFVs = $CustomField->Values; +% while ($CFVs and my $value = $CFVs->Next ) { + <option value="<%$value->Name%>" +% if ($Values) { + <% $Values->HasEntry($value->Name) && ($selected = 1) && 'SELECTED' %> +% } elsif ($Default) { + <% ($Default eq $value->Name) && ($selected = 1) && 'SELECTED' %> +% } + ><% $value->Name%></option> +% } + <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option> + </select> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$Multiple => 0 +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldText b/rt/html/Elements/EditCustomFieldText new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldText @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea> +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditCustomFieldWikitext b/rt/html/Elements/EditCustomFieldWikitext new file mode 100644 index 000000000..1aac3283b --- /dev/null +++ b/rt/html/Elements/EditCustomFieldWikitext @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% while ($Values and my $value = $Values->Next ) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $value->Content %></textarea><br> +% } +% if (!$MaxValues or !$Values or $Values->Count < $MaxValues) { +<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><% $Default %></textarea> +% } +<%INIT> +# XXX - MultiValue textarea is for now outlawed. +$MaxValues = 1; +</%INIT> +<%ARGS> +$Object => undef +$CustomField => undef +$NamePrefix => undef +$Default => undef +$Values => undef +$MaxValues => undef +$Cols +$Rows +</%ARGS> diff --git a/rt/html/Elements/EditLinks b/rt/html/Elements/EditLinks index b66291f30..68c08dd16 100755 --- a/rt/html/Elements/EditLinks +++ b/rt/html/Elements/EditLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE width=100%> <TR> <TD VALIGN=TOP WIDTH=50%> @@ -57,7 +57,7 @@ <td class="labeltop"><&|/l&>Depends on</&>:</td> <td class="value"> % while (my $link = $Object->DependsOn->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> % } </td> @@ -67,7 +67,7 @@ <td class="value"> % while (my $link = $Object->DependedOnBy->Next) { % my $member = $link->BaseObj; - <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -76,7 +76,7 @@ <td class="labeltop"><&|/l&>Parents</&>:</td> <td class="value"> % while (my $link = $Object->MemberOf->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> % } </td> @@ -85,7 +85,7 @@ <td class="labeltop"><&|/l&>Children</&>:</td> <td class="value"> % while (my $link = $Object->Members->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -94,7 +94,7 @@ <td class="labeltop"><&|/l&>Refers to</&>:</td> <td class="value"> % while (my $link = $Object->RefersTo->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink--<%$link->Type%>-<%$link->Target%>" value="1"> <& ShowLink, URI => $link->TargetURI &><br> %} </td> @@ -103,7 +103,7 @@ <td class="labeltop"><&|/l&>Referred to by</&>:</td> <td class="value"> % while (my $link = $Object->ReferredToBy->Next) { - <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-"> + <INPUT TYPE=CHECKBOX NAME="DeleteLink-<%$link->Base%>-<%$link->Type%>-" value="1"> <& ShowLink, URI => $link->BaseURI &><br> % } </td> @@ -114,9 +114,12 @@ <TD VALIGN=TOP> <h3><&|/l&>New Links</&></h3> % if (ref($Object) eq 'RT::Ticket') { -<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&></i><br> +<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&> +<& /Elements/Callback, _CallbackName => 'ExtraLinkInstructions' &> +</i><br> % } elsif (ref($Object) eq 'RT::Queue') { -<i><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&></i><br> +<i><&|/l&>Enter queues or URIs to link queues to. Separate multiple entries with spaces.</&> +</i><br> % } else { <i><&|/l&>Enter objects or URIs to link objects to. Separate multiple entries with spaces.</&></i><br> % } diff --git a/rt/html/Elements/Error b/rt/html/Elements/Error index 3aa77a51e..bc5a1880a 100644 --- a/rt/html/Elements/Error +++ b/rt/html/Elements/Error @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, %ARGS, error => $error &> <& /Elements/Header, Code => $Code, Why => $Why &> <& /Elements/Tabs &> @@ -53,9 +53,11 @@ <%$Details%> </font> <& /Elements/TitleBoxEnd &> -</body> -</HTML> +<%cleanup> +$m->comp('/Elements/Footer'); +$m->abort(); +</%cleanup> <%args> $Code => undef diff --git a/rt/html/Elements/Footer b/rt/html/Elements/Footer index 213761e91..4c90acfa3 100644 --- a/rt/html/Elements/Footer +++ b/rt/html/Elements/Footer @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Menu) { </td> </tr> @@ -51,20 +51,12 @@ % } <& /Elements/Callback, %ARGS &> <div class="bpscredits"> -<&|/l, '»|«', - $RT::VERSION, - '2004', - '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', -&>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br> +<&|/l, '»|«', $RT::VERSION, '2005', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&><br> % if (!$Menu) { <&|/l&>Distributed under version 2 <a href="http://www.gnu.org/copyleft/gpl.html"> of the GNU GPL.</a></&><br> <&|/l, '<a href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>' &>To inquire about support, training, custom development or licensing, please contact [_1].</&><br> % } </div> -% if ($Debug) { -<HR> -<b><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></b> -% } % if ($Debug >= 2 ) { % require Data::Dumper; % my $d = Data::Dumper->new([\%ARGS], [qw(%ARGS)]); @@ -72,6 +64,7 @@ <%$d->Dump() %> </pre> % } +<div class="page-stats"><&|/l&>Time to display</&>: <%Time::HiRes::tv_interval( $m->{'rt_base_time'} )%></div> % if ($Menu) { </TD> </TR> diff --git a/rt/html/Elements/GotoTicket b/rt/html/Elements/GotoTicket index 393b28f89..869d57ef1 100644 --- a/rt/html/Elements/GotoTicket +++ b/rt/html/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <FORM ACTION="<%$RT::WebPath%>/Ticket/Display.html"><input type=submit value="<&|/l&>Goto ticket</&>"> <input size=5 name=id accesskey="0"></FORM> diff --git a/rt/html/Elements/Header b/rt/html/Elements/Header index 5d9bbb08b..8c3775bba 100644 --- a/rt/html/Elements/Header +++ b/rt/html/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> @@ -77,16 +77,18 @@ ONLOAD=" > <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"> <tr> - <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="" width="230" height="50"></a></td> + <td colspan=2><a href="http://bestpractical.com"><img src="<%$RT::WebImagesURL%>/bplogo.gif" alt="<%loc("Best Practical Solutions, LLC corporate logo")%>" width="230" height="50"></a></td> <td> </td> <td> </td> <td width="50%" align="right"> % if ($session{'CurrentUser'} && $session{'CurrentUser'}->Id && $LoggedIn) { <SPAN STYLE="display: none"><A HREF="#skipnav"><&|/l&>Skip Menu</&></A> |</SPAN> +%if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', Object => $RT::System )) { <A HREF="<%$RT::WebPath%><% $Prefs %>" ><&|/l&>Preferences</&></A> +% } <& /Elements/Callback, %ARGS &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL && "?URL=".$URL%>"><&|/l&>Logout</&></a> +| <A HREF="<%$RT::WebPath%>/NoAuth/Logout.html<%$URL ? "?URL=".$URL : ''%>"><&|/l&>Logout</&></a> % } <BR> <&|/l, "<b>".$session{'CurrentUser'}->Name."</b>" &>Logged in as [_1]</&> @@ -105,7 +107,7 @@ $r->headers_out->{'Cache-control'} = 'no-cache'; <%ARGS> $Prefs => '/User/Prefs.html' $Focus => 'focus' -$Title => undef +$Title => 'RT' $Code => undef $Refresh => 0 $Why => undef diff --git a/rt/html/Elements/ListActions b/rt/html/Elements/ListActions index 344fe9e5a..8433d17e0 100644 --- a/rt/html/Elements/ListActions +++ b/rt/html/Elements/ListActions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { <& /Elements/TitleBoxStart, title => loc('Results') &> <UL> diff --git a/rt/html/Elements/Login b/rt/html/Elements/Login index 25ded9ff3..1d4bfd5ec 100644 --- a/rt/html/Elements/Login +++ b/rt/html/Elements/Login @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { $r->content_type("text/plain"); @@ -67,7 +67,7 @@ if ($m->request_comp->path =~ '^/REST/\d+\.\d+/') { contentbg=>"#cccccc" &> % unless ($RT::WebExternalAuth and !$RT::WebFallbackToInternalAuth) { -<FORM METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" > +<FORM id="login" name="login" METHOD=POST ACTION="<% (UNIVERSAL::can($r, 'uri') && ($r->uri) =~ m!.*/(.*)!) %>" > <TABLE BORDER=0 WIDTH=100%> <TR ALIGN=RIGHT> <TD ALIGN=RIGHT><&|/l&>Username</&>:</TD><TD ALIGN=LEFT><input name=user value="<%$user%>"></TD></TR> diff --git a/rt/html/Elements/Menu b/rt/html/Elements/Menu index 0e57585c5..398e3ab07 100644 --- a/rt/html/Elements/Menu +++ b/rt/html/Elements/Menu @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# font size depends on level % if ($level ge 3) { % $size = $basesize-(6); @@ -69,16 +69,17 @@ % } % my $style=""; % if ($sep) { -% $style="border-top: solid #999 1px; padding-top: .1em; margin-top: .5em;"; +% $style="minor"; % } elsif ($level == 0 ) { -% $style="border-bottom: solid white 1px; padding-top: .25em; padding-bottom: .5em;" ; +% $style="major"; % } % if ($toptabs->{$tab}->{'separator'}) { % $sep=1; % } else { % $sep=0; % } -<li style="<%$style%>"><A HREF="<%$RT::WebPath%>/<%$toptabs->{$tab}->{'path'}%>" style="font-size: <%$size%>;" class="<%$class%>" +% my $url = $toptabs->{$tab}->{'path'} =~ /^https?:/i ? $toptabs->{$tab}->{'path'} : $RT::WebPath . "/" . $toptabs->{$tab}->{'path'}; +<li class="<%$class%>-<%$level%>-<%$style%>"><A HREF="<% $url %>" class="<%$class%>-<%$level%>" <%($class eq 'currenttopnav') ? "name='focus'" : ""|n %> <% !$level && "accesskey='".$accesskey++."'" |n%>><% $toptabs->{$tab}->{'title'}%></A> %# Second-level items diff --git a/rt/html/Elements/MessageBox b/rt/html/Elements/MessageBox index 5faa9575c..dd48bec9a 100644 --- a/rt/html/Elements/MessageBox +++ b/rt/html/Elements/MessageBox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<TEXTAREA COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></TEXTAREA> +%# END BPS TAGGED BLOCK }}} +<textarea class="messagebox" COLS=<%$Width%> ROWS=<%$Height%> WRAP=<%$Wrap%> NAME="<%$Name%>"><& /Elements/Callback, %ARGS &><% $Default %><%$message%><%$IncludeSignature ? $signature : ''%></textarea> <%INIT> my ($message); diff --git a/rt/html/Elements/MyRequests b/rt/html/Elements/MyRequests index 4e1bf3eaf..172b4a4fa 100644 --- a/rt/html/Elements/MyRequests +++ b/rt/html/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc("[_1] newest unowned tickets", $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,9 +61,10 @@ my $rows = $RT::MyRequestsLength; my $Query = "Owner = 'Nobody' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); </%init> diff --git a/rt/html/Elements/MyTickets b/rt/html/Elements/MyTickets index 9f30a893b..cf5225abc 100644 --- a/rt/html/Elements/MyTickets +++ b/rt/html/Elements/MyTickets @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/Elements/TitleBox, title => loc('[_1] highest priority tickets I own', $rows), title_href => "Search/Results.html".$QueryString &> @@ -61,10 +61,11 @@ my $rows = $RT::MyTicketsLength; my $Query = " Owner = '".$session{'CurrentUser'}->Id."' AND ( Status = 'new' OR Status = 'open')"; -my $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Order => 'DESC', - OrderBy => 'Priority') if ($Query); +my $QueryString = ""; +$QueryString = '?' . $m->comp('/Elements/QueryString', + Query => $Query, + Order => 'DESC', + OrderBy => 'Priority') if ($Query); </%init> diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index 4670a8bb2..3d7241dad 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table class="darkblue" border=0 cellspacing=0 cellpadding=0 width="100%"> <th class="titlebox" align="left"><span class="rtname"><%$AppName%></span> </th> @@ -76,7 +76,7 @@ % if ($actions->{"$action"}->{'html'}) { % push @actions, $actions->{"$action"}->{'html'}; % } else { -% push @actions, "<A class='nav' HREF=\"".$RT::WebPath."/".$actions->{$action}->{'path'}."\">".$actions->{$action}->{'title'}."</A>"; +% push @actions, qq|<a class="nav" href="|.$RT::WebPath."/".$actions->{$action}->{'path'}.qq|">|.$actions->{$action}->{'title'}."</a>"; % } % } <% join(" | ", @actions) | n %> @@ -93,11 +93,12 @@ </tr> <TR valign="top"> <TD valign="top" width="100%" height="100%" class="mainbody" > - +<& /Elements/Callback, _CallbackName => 'BeforeBody', %ARGS &> +%$m->flush_buffer(); # we've got the page laid out, let's flush the buffer; <%INIT> foreach my $tab (sort keys %{$toptabs}) { - if ($toptabs->{$tab}->{'path'} eq $current_toptab) { + if ($current_toptab && $toptabs->{$tab}->{'path'} eq $current_toptab) { $toptabs->{$tab}->{"subtabs"} = $tabs; $toptabs->{$tab}->{"current_subtab"} = $current_tab; } diff --git a/rt/html/Elements/QueryString b/rt/html/Elements/QueryString index cbec29a30..7d41f15e0 100644 --- a/rt/html/Elements/QueryString +++ b/rt/html/Elements/QueryString @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my @params; while ( (my $key, my $value) = each %ARGS ){ diff --git a/rt/html/Elements/QuickCreate b/rt/html/Elements/QuickCreate index 10cfbd3c0..0d2489c61 100644 --- a/rt/html/Elements/QuickCreate +++ b/rt/html/Elements/QuickCreate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Quick ticket creation') &> <form method="post" action="<%$RT::WebPath%>/index.html"> <input type="hidden" name="QuickCreate" value="1"> diff --git a/rt/html/Elements/Quicksearch b/rt/html/Elements/Quicksearch index 103c760c7..d54f72e88 100644 --- a/rt/html/Elements/Quicksearch +++ b/rt/html/Elements/Quicksearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,42 +42,40 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc("Quick search"), bodyclass => "" &> <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> <tr> - <th align=left><&|/l&>Queue</&></th> - <th align=right><font size=-1><&|/l&>New</&></font></th> - <th align=right><font size=-1><&|/l&>Open</&></font></th> + <th class="collection-as-table" align=left><&|/l&>Queue</&></th> + <th class="collection-as-table" align=right><&|/l&>New</&></th> + <th class="collection-as-table" align=right><&|/l&>Open</&></th> </tr> <%PERL> my $i; while (my $queue = $Queues->Next) { - my $new_q = "Queue = '".$queue->Name."' AND Status = 'new'"; - my $open_q = "Queue = '".$queue->Name."' AND Status = 'open'"; - my $all_q = "Queue = '".$queue->Name."' AND (Status = 'open' OR Status = 'new')"; + next unless ($queue->CurrentUserHasRight('ShowTicket')); + my $name = $queue->Name; + $name =~ s|(['\\])|\\$1|g; + + my $new_q = "Queue = '$name' AND Status = 'new'"; + my $open_q = "Queue = '$name' AND Status = 'open'"; + my $all_q = "Queue = '$name' AND (Status = 'open' OR Status = 'new')"; - $Tickets->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "open"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $open = $Tickets->Count(); - - $Tickets->ClearRestrictions; - $Tickets->LimitStatus(VALUE => "new"); - $Tickets->LimitQueue(VALUE => $queue->Name, OPERATOR => '='); - my $new = $Tickets->Count(); - + $Tickets->FromSQL($open_q); + my $open = $Tickets->Count(); + $Tickets->FromSQL($new_q); + my $new = $Tickets->Count(); + $i++; </%PERL> -% $i++; <TR class="<% $i%2 ? 'oddline' : 'evenline'%>" > -<td><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$all_q%>&Rows=50" TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD> -<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$new_q%>&Rows=50"><%$new%></a></TD> -<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$open_q%>&Rows=50"><%$open%></a></TD> +<td><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$all_q |nu%>&Rows=50" TITLE="<% $queue->Description %>"><%$queue->Name%></a></TD> +<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$new_q |nu%>&Rows=50"><%$new%></a></TD> +<td align="right"><A HREF="<% $RT::WebPath%>/Search/Results.html?Query=<%$open_q |nu%>&Rows=50"><%$open%></a></TD> </TR> % } </TABLE> diff --git a/rt/html/Elements/RT__Ticket/ColumnMap b/rt/html/Elements/RT__Ticket/ColumnMap index a6d387cae..dade91494 100644 --- a/rt/html/Elements/RT__Ticket/ColumnMap +++ b/rt/html/Elements/RT__Ticket/ColumnMap @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,25 +20,37 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <%ARGS> $Name => undef $Attr => undef </%ARGS> -<%perl> -return ColumnMap($Name, $Attr); -</%perl> -<%INIT> -our ( $COLUMN_MAP, $CUSTOM_FIELD_MAP ); +<%ONCE> +our ( $COLUMN_MAP ); sub ColumnMap { my $name = shift; @@ -45,46 +63,52 @@ sub ColumnMap { # now, let's deal with harder things, like Custom Fields - elsif ( $name =~ /^(?:CF|CustomField).(.*)$/ ) { + elsif ( $name =~ /^(?:CF|CustomField)\.\{(.+)\}$/ ) { my $field = $1; - my $cf; - if ( $CUSTOM_FIELD_MAP->{$field} ) { - $cf = $CUSTOM_FIELD_MAP->{$field}; - } - else { - - $cf = RT::CustomField->new( $session{'CurrentUser'} ); - - if ( $field =~ /^(.+?)\.{(.+)}$/ ) { - $cf->LoadByNameAndQueue( Queue => $1, Name => $2 ); - } - else { - $field = $1 if $field =~ /^{(.+)}$/; # trim { } - $cf->LoadByNameAndQueue( Queue => "0", Name => $field ); - } - $CUSTOM_FIELD_MAP->{$field} = $cf if ( $cf->id ); - } - - unless ( $cf->id ) { - return undef; - } if ( $attr eq 'attribute' ) { return (undef); } elsif ( $attr eq 'title' ) { - return ( $cf->Name ); + return ( $field ); } elsif ( $attr eq 'value' ) { - my $value = eval "sub { - my \$values = \$_[0]->CustomFieldValues('" . $cf->id . "'); - return ( join( ', ', map { \$_->Content } \@{ \$values->ItemsArrayRef } )) - }" || die $@; - return ($value); + # Display custom field contents, separated by newlines. + # For Image custom fields we also show a thumbnail here. + return sub { + my $values = $_[0]->CustomFieldValues($field); + return map { + ( + ($_->CustomFieldObj->Type eq 'Image') + ? \($m->scomp( '/Elements/ShowCustomFieldImage', Object => $_ )) + : $_->Content + ), + \'<br>', + } @{ $values->ItemsArrayRef } + }; } } } +sub LinkCallback { + my $method = shift; + + my $mode = $RT::Ticket::LINKTYPEMAP{$method}{Mode}; + my $type = $RT::Ticket::LINKTYPEMAP{$method}{Type}; + my $mode_uri = $mode.'URI'; + my $local_type = 'Local'.$mode; + + return sub { + map { + \'<A HREF="', + $_->$mode_uri->Resolver->HREF, + \'">', + ( $_->$mode_uri->IsLocal ? $_->$local_type : $_->$mode ), + \'</A><BR>', + } @{ $_[0]->Links($mode,$type)->ItemsArrayRef } + } +} + $COLUMN_MAP = { QueueName => { attribute => 'Queue', @@ -103,7 +127,7 @@ $COLUMN_MAP = { }, Status => { attribute => 'Status', - value => sub { return $_[0]->Status } + value => sub { return loc($_[0]->Status) } }, Subject => { attribute => 'Subject', @@ -119,10 +143,10 @@ $COLUMN_MAP = { if ( $Ticket->HasUnresolvedDependencies( Type => 'approval' ) or $Ticket->HasUnresolvedDependencies( Type => 'code' ) ) { - return "<em>" . loc('(pending approval)') . "</em>"; + return \'<em>', loc('(pending approval)'), \'</em>'; } else { - return "<em>" . loc('(pending other Collection)') . "</em>"; + return \'<em>', loc('(pending other Collection)'), \'</em>'; } } else { @@ -137,10 +161,12 @@ $COLUMN_MAP = { }, InitialPriority => { attribute => 'InitialPriority', + name => 'Initial Priority', value => sub { return $_[0]->InitialPriority } }, FinalPriority => { attribute => 'FinalPriority', + name => 'Final Priority', value => sub { return $_[0]->FinalPriority } }, EffectiveId => { @@ -153,14 +179,17 @@ $COLUMN_MAP = { }, TimeWorked => { attribute => 'TimeWorked', + title => 'Time Worked', value => sub { return $_[0]->TimeWorked } }, TimeLeft => { attribute => 'TimeLeft', + title => 'Time Left', value => sub { return $_[0]->TimeLeft } }, TimeEstimated => { attribute => 'TimeEstimated', + title => 'Time Estimated', value => sub { return $_[0]->TimeEstimated } }, Requestors => { @@ -188,7 +217,7 @@ $COLUMN_MAP = { value => sub { return $_[0]->CreatedObj->AgeAsString } }, LastUpdatedRelative => { - title => 'LastUpdated', + title => 'Last Updated', attribute => 'LastUpdated', value => sub { return $_[0]->LastUpdatedObj->AgeAsString } }, @@ -203,7 +232,7 @@ $COLUMN_MAP = { value => sub { my $date = $_[0]->DueObj; if ($date && $date->Unix > 0 && $date->Unix < time()) { - return '<span class="overdue">' . $date->AgeAsString . '</span>'; + return (\'<span class="overdue">' , $date->AgeAsString , \'</span>'); } else { return $date->AgeAsString; } @@ -228,14 +257,17 @@ $COLUMN_MAP = { }, CreatedBy => { attribute => 'CreatedBy', + title => 'Created By', value => sub { return $_[0]->CreatorObj->Name } }, LastUpdated => { attribute => 'LastUpdated', + title => 'Last Updated', value => sub { return $_[0]->LastUpdatedObj->AsString } }, LastUpdatedBy => { attribute => 'LastUpdatedBy', + title => 'Last Updated By', value => sub { return $_[0]->LastUpdatedByObj->Name } }, Told => { @@ -251,144 +283,18 @@ $COLUMN_MAP = { value => sub { return $_[0]->ResolvedObj->AsString } }, - DependedOnBy => { - value => sub { - my $links = $_[0]->DependedOnBy; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Members => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Children => { - value => sub { - my $links = $_[0]->Members; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - ReferredToBy => { - value => sub { - my $links = $_[0]->ReferredToBy; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->BaseURI->Resolver->HREF . '">' - . ( $_->BaseIsLocal ? $_->LocalBase : $_->Base ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - - DependsOn => { - value => sub { - my $links = $_[0]->DependsOn; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - MemberOf => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - Parents => { - value => sub { - my $links = $_[0]->MemberOf; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, - RefersTo => { - value => sub { - my $links = $_[0]->RefersTo; - return ( - join( - "<br>", - map { - '<A HREF="' - . $_->TargetURI->Resolver->HREF . '">' - . ( $_->TargetIsLocal ? $_->LocalTarget : $_->Target ) - . '</A>' - } @{ $links->ItemsArrayRef } - ) - ); - } - }, + # Everything from LINKTYPEMAP + (map { + $_ => { value => LinkCallback( $_ ) } + } keys %RT::Ticket::LINKTYPEMAP), '_CLASS' => { value => sub { return $_[1] % 2 ? 'oddline' : 'evenline' } }, }; - - - -# }}} +</%ONCE> +<%init> $m->comp( '/Elements/Callback', COLUMN_MAP => $COLUMN_MAP, _CallbackName => 'ColumnMap'); -</%INIT> +return ColumnMap($Name, $Attr); +</%init> diff --git a/rt/html/Elements/Refresh b/rt/html/Elements/Refresh index 3cfb7c663..9f241d279 100644 --- a/rt/html/Elements/Refresh +++ b/rt/html/Elements/Refresh @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="-1" %unless ($Default) { diff --git a/rt/html/Elements/ScrubHTML b/rt/html/Elements/ScrubHTML index 57495bceb..94a729907 100644 --- a/rt/html/Elements/ScrubHTML +++ b/rt/html/Elements/ScrubHTML @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $scrubber = HTML::Scrubber->new(); diff --git a/rt/html/Elements/Section b/rt/html/Elements/Section index 5bf7270fc..afbb9cf38 100644 --- a/rt/html/Elements/Section +++ b/rt/html/Elements/Section @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE WIDTH=100%> <TR> <TD> diff --git a/rt/html/Elements/SelectAttachmentField b/rt/html/Elements/SelectAttachmentField index cd16bbaee..ea1528c03 100644 --- a/rt/html/Elements/SelectAttachmentField +++ b/rt/html/Elements/SelectAttachmentField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="Subject"><&|/l&>Subject</&></OPTION> <OPTION VALUE="Content"><&|/l&>Content</&></OPTION> diff --git a/rt/html/Elements/SelectBoolean b/rt/html/Elements/SelectBoolean index d17606027..a3f08fdbc 100644 --- a/rt/html/Elements/SelectBoolean +++ b/rt/html/Elements/SelectBoolean @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="<%$TrueVal%>" <%$TrueDefault%>><%$True%></OPTION> <OPTION VALUE="<%$FalseVal%>" <%$FalseDefault%>><%$False%></OPTION> diff --git a/rt/html/Elements/SelectCustomFieldOperator b/rt/html/Elements/SelectCustomFieldOperator index 2264f2dcf..8f7ea618b 100644 --- a/rt/html/Elements/SelectCustomFieldOperator +++ b/rt/html/Elements/SelectCustomFieldOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % while (my $option = shift @Options) { % my $value = shift @Values; diff --git a/rt/html/Elements/SelectCustomFieldValue b/rt/html/Elements/SelectCustomFieldValue index de9f5401d..27d6c4995 100644 --- a/rt/html/Elements/SelectCustomFieldValue +++ b/rt/html/Elements/SelectCustomFieldValue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, %ARGS &> % if ($CustomField->Type =~ /Select/i) { % my $values = $CustomField->Values; diff --git a/rt/html/Elements/SelectDate b/rt/html/Elements/SelectDate index aaf2534c3..d3815798b 100644 --- a/rt/html/Elements/SelectDate +++ b/rt/html/Elements/SelectDate @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=<%$Size%>> <%init> diff --git a/rt/html/Elements/SelectDateRelation b/rt/html/Elements/SelectDateRelation index b3f3868b3..ccf0c1121 100644 --- a/rt/html/Elements/SelectDateRelation +++ b/rt/html/Elements/SelectDateRelation @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="<"><%$Before%></OPTION> <OPTION VALUE="="><%$On%></OPTION> diff --git a/rt/html/Elements/SelectDateType b/rt/html/Elements/SelectDateType index 79bc99436..7b3f0990f 100644 --- a/rt/html/Elements/SelectDateType +++ b/rt/html/Elements/SelectDateType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> <OPTION VALUE="Created"><&|/l&>Created</&></OPTION> <OPTION VALUE="Started"><&|/l&>Started</&></OPTION> diff --git a/rt/html/Elements/SelectEqualityOperator b/rt/html/Elements/SelectEqualityOperator index 5e5d1a4b9..0f8deea89 100644 --- a/rt/html/Elements/SelectEqualityOperator +++ b/rt/html/Elements/SelectEqualityOperator @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % while (my $option = shift @Options) { % my $value = shift @Values; @@ -58,5 +58,5 @@ SELECTED $Name => undef @Options => (loc('less than'), loc('equal to'), loc('greater than'), loc('not equal to')) @Values => qw(< = > !=) -$Default => undef +$Default =>'' </%ARGS> diff --git a/rt/html/Elements/SelectGroups b/rt/html/Elements/SelectGroups index f6f9dae54..bc37fd69a 100644 --- a/rt/html/Elements/SelectGroups +++ b/rt/html/Elements/SelectGroups @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="GroupField"> -<option value="Name"><&|/l&>Name</&> -<option value="Description"><&|/l&>Description</&> +% foreach my $col (RT::Group->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %> +% } </select> <& /Elements/SelectMatch, Name=> 'GroupOp' &> <input size=8 name="GroupString"> +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::Group'); +$CFs->OrderBy( FIELD => 'Name' ); +</%INIT> diff --git a/rt/html/Elements/SelectLang b/rt/html/Elements/SelectLang index 46d378437..a439ea330 100644 --- a/rt/html/Elements/SelectLang +++ b/rt/html/Elements/SelectLang @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % if ($ShowNullOption) { <OPTION VALUE="">-</OPTION> diff --git a/rt/html/Elements/SelectLinkType b/rt/html/Elements/SelectLinkType index d782e08b1..28cb4419a 100644 --- a/rt/html/Elements/SelectLinkType +++ b/rt/html/Elements/SelectLinkType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="MemberOf"><&|/l&>Member of</&></OPTION> <OPTION VALUE="DependsOn"><&|/l&>Depends on</&></OPTION> diff --git a/rt/html/Elements/SelectMatch b/rt/html/Elements/SelectMatch index 18a948d12..60949d979 100644 --- a/rt/html/Elements/SelectMatch +++ b/rt/html/Elements/SelectMatch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> <OPTION VALUE="LIKE" <%$LikeDefault%>><%$Like%></OPTION> <OPTION VALUE="NOT LIKE" <%$NotLikeDefault%>><%$NotLike%></OPTION> diff --git a/rt/html/Elements/SelectNewTicketQueue b/rt/html/Elements/SelectNewTicketQueue index fefb1bc97..d47b58a83 100644 --- a/rt/html/Elements/SelectNewTicketQueue +++ b/rt/html/Elements/SelectNewTicketQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <LABEL ACCESSKEY="9"> <SELECT NAME ="<%$Name%>"> % foreach my $queue (@{$session{'create_in_queues'}}) { @@ -76,6 +76,6 @@ while (my $queue=$q->Next) { <%ARGS> $Name => 'Queue' -$Verbose => undef -$Default => undef +$Verbose => 0 +$Default => 0 </%ARGS> diff --git a/rt/html/Elements/SelectOwner b/rt/html/Elements/SelectOwner index 2a818cdcd..85843e5f0 100644 --- a/rt/html/Elements/SelectOwner +++ b/rt/html/Elements/SelectOwner @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,44 +42,67 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %if ($DefaultValue) { -<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION> +<OPTION <% !$Default ? "SELECTED" : '' %> VALUE=""><%$DefaultLabel%></OPTION> %} -<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION> -%while ( my $User = $Users->Next()) { -<OPTION <% ($User->Id == $Default) && "SELECTED" %> VALUE="<%$User->Id()%>"><%$User->Name()%></OPTION> +%foreach my $User ( @users) { +<OPTION <% ($User->Id == $Default) ? "SELECTED" : ''%> +%if ($ValueAttribute eq 'id') { + value="<%$User->id%>" +%} elsif ($ValueAttribute eq 'Name') { + value="<%$User->Name%>" +%} +><%$User->Name()%></OPTION> %} </SELECT> - <%INIT> -my $Users = RT::Users->new($session{CurrentUser}); -my $object; - +my @objects; +my @users; if ($TicketObj) { - $object = $TicketObj; + @objects = ($TicketObj); } elsif ($QueueObj) { - $object = $QueueObj; + @objects = ($QueueObj); +} +elsif ($cfqueues) { + @objects = keys %{$cfqueues}; } -if ($object) { - $Users->WhoHaveRight(Right => 'OwnTicket', - Object => $object, - IncludeSystemRights => 1, - IncludeSuperusers => 1); -} else { - $Users->LimitToPrivileged; +else { + # Let's check rights on an empty queue object. that will do a search for any queue. + my $queue = RT::Queue->new($session{'CurrentUser'}); + push( @objects, $queue ); } + +my %user_uniq_hash; + + +foreach my $object (@objects) { + my $Users = RT::Users->new($session{CurrentUser}); + $Users->WhoHaveRight(Right => 'OwnTicket', Object => $object, IncludeSystemRights => 1, IncludeSuperusers => 0); + while (my $User = $Users->Next()) { + next if ($User->id == $RT::Nobody->id); # skip nobody here, so we can make them first later + $user_uniq_hash{$User->Id()} = $User; + } +} + +@users = sort { uc($a->Name) cmp uc($b->Name) } values %user_uniq_hash; +unshift(@users, $RT::Nobody); + + + </%INIT> <%ARGS> $QueueObj => undef $Name => undef -$Default => undef +$Default => 0 $User => undef $TicketObj => undef $DefaultValue => 1 $DefaultLabel => "-" +$ValueAttribute => 'id' +$cfqueues => undef </%ARGS> diff --git a/rt/html/Elements/SelectQueue b/rt/html/Elements/SelectQueue index 57d423697..56aede89f 100644 --- a/rt/html/Elements/SelectQueue +++ b/rt/html/Elements/SelectQueue @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($Lite) { % my $d = new RT::Queue($session{'CurrentUser'}); % $d->Load($Default); @@ -53,7 +53,7 @@ <OPTION VALUE="">-</OPTION> % } % while (my $queue=$q->Next) { -% if ($ShowAllQueues || $queue->CurrentUserHasRight('CreateTicket')) { +% if ($ShowAllQueues || $queue->CurrentUserHasRight($CheckQueueRight)) { <OPTION VALUE="<%($NamedValues ? $queue->Name : $queue->Id) %>" <%( $queue->Id eq $Default ? 'SELECTED' : '')%>><%$queue->Name%> % if (($Verbose) and ($queue->Description) ){ (<%$queue->Description%>) @@ -64,6 +64,7 @@ </SELECT> % } <%ARGS> +$CheckQueueRight => 'CreateTicket' $ShowNullOption => 1 $ShowAllQueues => 1 $Name => undef diff --git a/rt/html/Elements/SelectResultsPerPage b/rt/html/Elements/SelectResultsPerPage index 82f7035fe..65ed536d6 100644 --- a/rt/html/Elements/SelectResultsPerPage +++ b/rt/html/Elements/SelectResultsPerPage @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# TODO: Better default handling <SELECT NAME ="<%$Name%>"> diff --git a/rt/html/Elements/SelectSortOrder b/rt/html/Elements/SelectSortOrder index ea1a305f3..f6dd70ded 100644 --- a/rt/html/Elements/SelectSortOrder +++ b/rt/html/Elements/SelectSortOrder @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %foreach my $order (@orders) { <OPTION VALUE="<%$order%>" <%$order eq $Default && 'SELECTED' %>> diff --git a/rt/html/Elements/SelectStatus b/rt/html/Elements/SelectStatus index 694957a66..fa76a3e5d 100644 --- a/rt/html/Elements/SelectStatus +++ b/rt/html/Elements/SelectStatus @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> %if ($DefaultValue) { <OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION> @@ -58,7 +58,7 @@ my @status = $queue->StatusArray(); </%ONCE> <%ARGS> $Name => undef -$Default => undef +$Default => '' $SkipDeleted => 0 $DefaultValue => 1 $DefaultLabel => "-" diff --git a/rt/html/Elements/SelectTicketSortBy b/rt/html/Elements/SelectTicketSortBy index bf4b0bec0..3e05dcce9 100644 --- a/rt/html/Elements/SelectTicketSortBy +++ b/rt/html/Elements/SelectTicketSortBy @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> % foreach my $field (@sortfields) { <OPTION VALUE="<%$field%>" <% $field eq $Default && 'SELECTED'%>><% loc($field) %></OPTION> diff --git a/rt/html/Elements/SelectTicketTypes b/rt/html/Elements/SelectTicketTypes index c6912c87c..a905f6067 100644 --- a/rt/html/Elements/SelectTicketTypes +++ b/rt/html/Elements/SelectTicketTypes @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> %foreach (@Types) { <OPTION VALUE="<% $_ %>" <% ($_ eq $Default) && "SELECTED" %>><&|/l&><% $_ %></&> diff --git a/rt/html/Elements/SelectUsers b/rt/html/Elements/SelectUsers index be2230ad1..dfe816e49 100644 --- a/rt/html/Elements/SelectUsers +++ b/rt/html/Elements/SelectUsers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <select name="UserField"> -<option value="Name"><&|/l&>User Id</&> -<option value="EmailAddress"><&|/l&>Email</&> -<option value="RealName"><&|/l&>Name</&> -<option value="Organization"><&|/l&>Organization</&> +% foreach my $col (RT::User->BasicColumns) { +<option value="<% $col->[0] %>"><% loc($col->[1]) %> +% } +% while (my $CF = $CFs->Next) { +<option value="CustomField-<% $CF->Id %>"><&|/l&>CustomField</&>: <% $CF->Name %> +% } </select> <& /Elements/SelectMatch, Name=> 'UserOp' &> <input size=8 name="UserString"> +<%INIT> +my $CFs = RT::CustomFields->new($session{'CurrentUser'}); +$CFs->LimitToChildType('RT::User'); +$CFs->OrderBy( FIELD => 'Name' ); +</%INIT> diff --git a/rt/html/Elements/SelectWatcherType b/rt/html/Elements/SelectWatcherType index bb098abf6..6ba9c7aa0 100644 --- a/rt/html/Elements/SelectWatcherType +++ b/rt/html/Elements/SelectWatcherType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % if ($AllowNull) { <OPTION VALUE="">-</OPTION> diff --git a/rt/html/Elements/SetupSessionCookie b/rt/html/Elements/SetupSessionCookie index e72f45889..bd7861355 100644 --- a/rt/html/Elements/SetupSessionCookie +++ b/rt/html/Elements/SetupSessionCookie @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> return if $m->is_subrequest; # avoid reentrancy, as suggested by masonbook @@ -75,18 +75,25 @@ my $pm = "$session_class.pm"; $pm =~ s|::|/|g; require $pm; # If the session is invalid, create a new session. if ( $@ =~ /Object does not/i ) { - tie %session, $session_class, undef, - $backends{$RT::DatabaseType} ? { + tie %session, $session_class, undef, $backends{$RT::DatabaseType} + ? { Handle => $RT::Handle->dbh, LockHandle => $RT::Handle->dbh, - } : { + } + : { Directory => $RT::MasonSessionDir, LockDirectory => $RT::MasonSessionDir, }; undef $cookies{$cookiename}; } else { - die "RT Couldn't write to session directory '$RT::MasonSessionDir': $@. Check that this dir ectory's permissions are correct."; + die loc("RT couldn't store your session.") . "\n" + . loc( +"This may mean that that the directory '[_1]' isn't writable or a database table is missing or corrupt.", + $RT::MasonSessionDir + ) + . "\n\n" + . $@; } } diff --git a/rt/html/Elements/ShowCustomFieldBinary b/rt/html/Elements/ShowCustomFieldBinary new file mode 100644 index 000000000..ea9e5ae83 --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldBinary @@ -0,0 +1,49 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<a href="<%$RT::WebPath%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content %>"><% $Object->Content %></a> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldImage b/rt/html/Elements/ShowCustomFieldImage new file mode 100644 index 000000000..7fa5e46d1 --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldImage @@ -0,0 +1,51 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $url = $RT::WebPath . "/Download/CustomFieldValue/".$Object->Id.'/'.$Object->Content; +<a href="<% $url %>"><% $Object->Content %></a> +<img type="<% $Object->ContentType %>" height=64 src="<% $url %>" align="middle"> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFieldWikitext b/rt/html/Elements/ShowCustomFieldWikitext new file mode 100644 index 000000000..ab7c27b8b --- /dev/null +++ b/rt/html/Elements/ShowCustomFieldWikitext @@ -0,0 +1,55 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +% my $content = $Object->LargeContent || $Object->Content; +% $content = $m->comp('/Elements/ScrubHTML', Content => $content); +% my $wiki_content = Text::WikiFormat::format( $content."\n" , {}, { extended => 1, absolute_links => 1 }); +<%$wiki_content|n%> +<%init> +use Text::WikiFormat; +</%init> +<%ARGS> +$Object +</%ARGS> diff --git a/rt/html/Elements/ShowCustomFields b/rt/html/Elements/ShowCustomFields new file mode 100644 index 000000000..7591fa3aa --- /dev/null +++ b/rt/html/Elements/ShowCustomFields @@ -0,0 +1,77 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<table> +% my @entry_fields; +% while (my $CustomField = $CustomFields->Next()) { +% my $Values = $Object->CustomFieldValues($CustomField->Id); + <tr> + <td class="label"><%$CustomField->Name%>:</td> + <td class="value"> +<ul> +% while (my $Value = $Values->Next()) { +<li> +% my $comp = "ShowCustomField".$CustomField->Type; +% if ($m->comp_exists($comp)) { +<& $comp, Object => $Value &> +% } else { +<%$Value->Content%> +% } +</li> +% } +% unless ($Values->Count()) { +<li><i><&|/l&>(no value)</&></i></li> +% } +</ul> + </td> + </tr> +% } +</table> +<%INIT> +my $CustomFields = $Object->CustomFields; +</%INIT> +<%ARGS> +$Object => undef +</%ARGS> diff --git a/rt/html/Elements/ShowLink b/rt/html/Elements/ShowLink index 520d6890c..5929a968e 100644 --- a/rt/html/Elements/ShowLink +++ b/rt/html/Elements/ShowLink @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <A href="<%$URI->Resolver->HREF%>"> % if ($URI->IsLocal) { % my $member = $URI->Object; diff --git a/rt/html/Elements/ShowLinks b/rt/html/Elements/ShowLinks index 2ba62b8f4..c9279a5db 100755 --- a/rt/html/Elements/ShowLinks +++ b/rt/html/Elements/ShowLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td class="labeltop"><&|/l&>Depends on</&>:</td> diff --git a/rt/html/Elements/ShowMemberships b/rt/html/Elements/ShowMemberships new file mode 100644 index 000000000..3936d5080 --- /dev/null +++ b/rt/html/Elements/ShowMemberships @@ -0,0 +1,86 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<ul> +% while ( my $GroupMember = $GroupMembers->Next ) { +% my $Group = RT::Group->new($session{'CurrentUser'}); +% $Group->Load($GroupMember->GroupId) or next; +% if ($Group->Domain eq 'UserDefined') { +<li><a href="<%$RT::WebPath%>/Admin/Groups/Modify.html?id=<% $Group->Id %>"><% $Group->Name %></a></li> +% } elsif ($Group->Domain eq 'SystemInternal') { +<li><em><% loc($Group->Type) %></em></li> +% } +% } +</ul> +<%INIT> +my $GroupMembers = RT::GroupMembers->new($session{'CurrentUser'}); +$GroupMembers->Limit( FIELD => 'MemberId', VALUE => $UserObj->Id ); +my $alias = $GroupMembers->Join( + TYPE => 'left', + ALIAS1 => 'main', + FIELD1 => 'GroupId', + TABLE2 => 'Groups', + FIELD2 => 'id' +); +$GroupMembers->Limit( + ALIAS => $alias, + FIELD => 'Domain', + OPERATOR => '=', + VALUE => 'SystemInternal', +); +$GroupMembers->Limit( + ALIAS => $alias, + FIELD => 'Domain', + OPERATOR => '=', + VALUE => 'UserDefined', +); +$GroupMembers->OrderByCols( + { ALIAS => $alias, FIELD => 'Domain' }, + { ALIAS => $alias, FIELD => 'Name' }, +); +</%INIT> +<%ARGS> +$UserObj +</%ARGS> diff --git a/rt/html/Elements/SimpleSearch b/rt/html/Elements/SimpleSearch index a468fab59..2b34d3a24 100644 --- a/rt/html/Elements/SimpleSearch +++ b/rt/html/Elements/SimpleSearch @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <form action="<% $RT::WebPath %>/index.html"> <input size="12" name="q" autocomplete="off" accesskey="0"> <input type="submit" value="<&|/l&>Search</&>"> diff --git a/rt/html/Elements/Submit b/rt/html/Elements/Submit index 0b42aab01..9d8dca20f 100644 --- a/rt/html/Elements/Submit +++ b/rt/html/Elements/Submit @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,16 +42,33 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} +% if ($CheckAll or $ClearAll) { +<script><!-- +function set_checkbox (obj, val) { + var i; + var myfield = obj.form.getElementsByTagName('input'); + for (i = 0; i < myfield.length; i++) { + if (myfield[i].type == 'checkbox') { + myfield[i].checked = val; + } + } +} +--></script> +% } <TABLE WIDTH=100% BGCOLOR="<%$color%>" CELLSPACING=0 BORDER=0 CELLPADDING=0 > <TR> -% if ($Reset) { <TD> -<FONT COLOR=#ffd800 > +% if ($CheckAll) { +<INPUT TYPE=BUTTON VALUE="<%$CheckAllLabel%>" ONCLICK="set_checkbox(this, true)"> +% } +% if ($ClearAll) { +<INPUT TYPE=BUTTON VALUE="<%$ClearAllLabel%>" ONCLICK="set_checkbox(this, false)"> +% } +% if ($Reset) { <INPUT TYPE=RESET VALUE="<%$ResetLabel%>"> -</FONT> -</TD> %} +</TD> <TD> </TD> @@ -74,11 +91,15 @@ NAME="<%$Name%>" </TABLE> <%ARGS> $color => "#336699" -$Caption => undef +$Caption => '' $AlternateCaption => undef $AlternateLabel => undef $Label => loc('Submit') $Name => undef +$CheckAll => undef +$CheckAllLabel => loc('Check All') +$ClearAll => undef +$ClearAllLabel => loc('Clear All') $Reset => undef $ResetLabel => loc('Reset') </%ARGS> diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index e75de8a6a..b2081edca 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -71,17 +71,25 @@ my $basetabs = { A => { title => loc('Homepage'), C => { title => loc('Tools'), path => 'Tools/Offline.html' }, - E => { title => loc('Configuration'), - path => 'Admin/' - }, - K => { title => loc('Preferences'), - path => 'User/Prefs.html' - }, P => { title => loc('Approval'), path => 'Approvals/' }, }; +if ($session{'CurrentUser'}->HasRight( Right => 'ShowConfigTab', + Object => $RT::System )) { + $basetabs->{E} = { title => loc('Configuration'), + path => 'Admin/', + }; +} + +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $basetabs->{K} = { title => loc('Preferences'), + path => 'User/Prefs.html' + }; +} + if (!defined $toptabs) { $toptabs = $basetabs; } diff --git a/rt/html/Elements/TicketList b/rt/html/Elements/TicketList index 80d59f8c6..1a531274f 100644 --- a/rt/html/Elements/TicketList +++ b/rt/html/Elements/TicketList @@ -1,8 +1,14 @@ -%# BEGIN LICENSE BLOCK; +%# BEGIN BPS TAGGED BLOCK {{{ %# -%# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> %# -%# (Except where explictly superceded by other copyright notices) +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: %# %# This work is made available to you under the terms of Version 2 of %# the GNU General Public License. A copy of that license should have @@ -14,23 +20,35 @@ %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU %# General Public License for more details. %# -%# Unless otherwise specified, all modifications, corrections or -%# extensions to this work which alter its source code become the -%# property of Best Practical Solutions, LLC when submitted for -%# inclusion in the work. +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# -%# END LICENSE BLOCK - -%# If you're having TicketList display a single record, you need -%# to wrap the calls in your own table(s). -% unless (defined $SingleRecord) { +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} <TABLE BORDER=0 cellspacing=0 cellpadding=1 WIDTH=100%> -% } % if ($ShowHeader) { <& /Elements/CollectionAsTable/Header, Format => \@Format, + FormatString => $Format, AllowSorting => $AllowSorting, Order => $Order, Query => $Query, @@ -38,42 +56,46 @@ Page => $Page, OrderBy => $OrderBy , BaseURL => $BaseURL, - maxitems => \$maxitems &> + maxitems => $maxitems &> % } -% if (defined $SingleRecord) { -<& /Elements/CollectionAsTable/Row, Format => \@Format, i => 0, record => $SingleRecord, maxitems => $maxitems &> -% } else { % my $i; % while (my $record = $Collection->Next) { % $i++; +% # Every ten rows, flush the buffer and put something on the page. +% $m->flush_buffer() unless ($i % 10); <& /Elements/CollectionAsTable/Row, Format => \@Format, i => $i, record => $record, maxitems => $maxitems &> % } -% } -% unless (defined $SingleRecord) { </TABLE> -% } -% if ($ShowNavigation) { +% if ($Rows && $ShowNavigation) { <hr> -<&|/l, $Page, int($TotalFound/$Rows)+1&>Page [_1] of [_2]</&> +% my $oddRows; +% if (($TotalFound % $Rows) == 0) { +% $oddRows = 0; +% } else { $oddRows = 1; } +<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&> <%perl> -my $prev = $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Rows => $Rows, - OrderBy => $OrderBy, - Order => $Order, - Page => ($Page-1)); -my $next = $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Rows => $Rows, - OrderBy => $OrderBy, - Order => $Order, - Page => ($Page+1)); +my $prev = $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Rows => $Rows, + OrderBy => $OrderBy, + Order => $Order, + Page => ( $Page - 1 ) +); +my $next = $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Rows => $Rows, + OrderBy => $OrderBy, + Order => $Order, + Page => ( $Page + 1 ) +); </%perl> % if ($Page > 1) { <A href="<%$BaseURL%><%$prev%>"><&|/l&>Previous Page</&></a> @@ -83,13 +105,12 @@ my $next = $m->comp('/Elements/QueryString', % } % } <%INIT> -my $maxitems; +my $maxitems = 0; $Format ||= $RT::DefaultSearchResultFormat; # Scrub the html of the format string to remove any potential nasties. $Format = $m->comp('/Elements/ScrubHTML', Content => $Format); -$Rows ||= '25'; # we need a positive value unless ($Collection) { $Collection = RT::Tickets->new($session{'CurrentUser'}); @@ -98,19 +119,31 @@ unless ($Collection) { my (@Format) = $m->comp('/Elements/CollectionAsTable/ParseFormat', Format => $Format); +# Find the maximum number of items in any row, so we can pad the table. +my $item = 0; +foreach my $col (@Format) { + $item++; + if ( $col->{title} eq 'NEWLINE' ) { + $item = 0; + } + else { + $maxitems = $item if $item > $maxitems; + } +} + + $Collection->OrderBy(FIELD => $OrderBy, ORDER => $Order); -$Collection->RowsPerPage($Rows); +$Collection->RowsPerPage($Rows) if ($Rows); $Collection->GotoPage($Page-1); # SB uses page 0 as the first page my $TotalFound = $Collection->CountAll(); </%INIT> <%ARGS> $Query => undef -$Rows => 10 +$Rows => 50 $Page => 1 $Title => 'Ticket Search' $Collection => undef -$SingleRecord => undef $AllowSorting => undef $Order => undef $OrderBy => undef diff --git a/rt/html/Elements/TitleBox b/rt/html/Elements/TitleBox index 591393634..3c638e2d3 100644 --- a/rt/html/Elements/TitleBox +++ b/rt/html/Elements/TitleBox @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& TitleBoxStart, %ARGS&><%$m->content|n%><& TitleBoxEnd&> diff --git a/rt/html/Elements/TitleBoxEnd b/rt/html/Elements/TitleBoxEnd index 1c050bc60..d791e3a4f 100644 --- a/rt/html/Elements/TitleBoxEnd +++ b/rt/html/Elements/TitleBoxEnd @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} </TD> </TR> </TABLE> +% #Manually flush the content buffer after each titlebox is displayed +% $m->flush_buffer(); + <%ARGS> $title => undef $content => undef diff --git a/rt/html/Elements/TitleBoxStart b/rt/html/Elements/TitleBoxStart index a0c733543..804e5cfaa 100644 --- a/rt/html/Elements/TitleBoxStart +++ b/rt/html/Elements/TitleBoxStart @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE CLASS="box <%$class|n%>" BGCOLOR="<%$color%>" CELLSPACING=0 @@ -74,7 +74,7 @@ $class => undef $bodyclass => undef $title_href => undef $title => undef -$title_class => undef +$title_class => '' $titleright_href => undef $titleright => undef diff --git a/rt/html/NoAuth/Logout.html b/rt/html/NoAuth/Logout.html index 85fbc9e57..b6a238bac 100644 --- a/rt/html/NoAuth/Logout.html +++ b/rt/html/NoAuth/Logout.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <HTML> <HEAD> <TITLE>RT: Logout</TITLE> diff --git a/rt/html/NoAuth/Reminder.html b/rt/html/NoAuth/Reminder.html index 90c282a8b..0793f6c96 100644 --- a/rt/html/NoAuth/Reminder.html +++ b/rt/html/NoAuth/Reminder.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, title => loc('Password Reminder') &> <&|/l&>Not yet implemented.</&> diff --git a/rt/html/NoAuth/images/autohandler b/rt/html/NoAuth/images/autohandler index 86f3b2286..2e428c157 100644 --- a/rt/html/NoAuth/images/autohandler +++ b/rt/html/NoAuth/images/autohandler @@ -15,7 +15,10 @@ if ($file =~ /\.(gif|png|jpe?g)$/i) { die unless (-f $file && -r $file); $r->content_type($type); open (FILE, "<$file") || die; -$m->out($_) while (<FILE>); -close(FILE); +{ + local $/ = \16384; + $m->out($_) while (<FILE>); + close(FILE); +} $m->abort; </%init> diff --git a/rt/html/NoAuth/webrt.css b/rt/html/NoAuth/webrt.css index 0c851aec5..ccdd49d60 100644 --- a/rt/html/NoAuth/webrt.css +++ b/rt/html/NoAuth/webrt.css @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; @@ -68,12 +68,218 @@ SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF; text-decoration: none; white-space: nowrap} + +%# .topnav is the original RT class for the sidebar navigation tabs. +%# Font-sizing by level depth was originally hard-coded into Elements/Menu. +%# This modification sets a different class name for each level, allowing +%# style sheet control over the formats. + +a.topnav-0 { font-family: Verdana, sans-serif; + font-size: 16px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-1 { font-family: Verdana, sans-serif; + font-size: 14px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-2 { font-family: Verdana, sans-serif; + font-size: 12px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-3 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-4 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +a.topnav-5 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFFFF; + text-decoration: none; + white-space: nowrap} +li.topnav-0-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-1-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-2-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-3-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-4-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-5-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.topnav-0-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-1-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-2-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-3-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-4-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.topnav-5-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + .currenttopnav { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #FFFF66; text-decoration: none; white-space: nowrap} + +%# .currenttopnav is the original RT class for the sidebar navigation tabs. +%# Font-sizing by level depth was originally hard-coded into Elements/Menu. +%# This modification sets a different class name for each level, allowing +%# style sheet control over the formats + +a.currenttopnav-0 { font-family: Verdana, sans-serif; + font-size: 16px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-1 { font-family: Verdana, sans-serif; + font-size: 14px; + font-weight: bold; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-2 { font-family: Verdana, sans-serif; + font-size: 12px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-3 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-4 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +a.currenttopnav-5 { font-family: Verdana, sans-serif; + font-size: 11px; + font-weight: normal; + color: #FFFF66; + text-decoration: none; + white-space: nowrap} +li.currenttopnav-0-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-1-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-2-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-3-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-4-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-5-minor { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} +li.currenttopnav-0-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-1-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-2-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-3-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-4-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} +li.currenttopnav-5-major { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + .topactions { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #FFFFFF; @@ -106,10 +312,12 @@ SPAN.nav { font-family: Verdana, Arial, Helvetica, sans-serif; vertical-align: top; text-align: left; } +%# Actually the "topactions" section .blueright { background-color: #4682B4; background-position: left top; vertical-align: top; text-align: right; + padding-right: 1em; } .olddarkblue { background-color: #003399; background-position: left top; @@ -137,7 +345,7 @@ div.messagebody { div.downloadattachment { - font size: 10px; + font-size: 10px; text-align: right; } @@ -340,32 +548,21 @@ SPAN.attribution { SPAN.label { font-size: 0.8em; } -BLOCKQUOTE { - font-style: italic; - /* color: #990; */ -} +DIV.page-stats { font-size: 0.8em; + color: #cccccc; + text-align: right; + } -ADDRESS { - text-align: right; - font-weight: bold; - font-style: italic -} -BLOCKQUOTE P { /* Try to avoid space above the attribution */ - margin-bottom: 0; -} -BLOCKQUOTE ADDRESS { - margin: 0; +BLOCKQUOTE { + font-style: italic; } - .emphasized { font-weight: bold } -P.map-also { font-style: italic; margin-left: 15%; text-align: right } - .oddline { background-color : #ccccee; } @@ -381,6 +578,43 @@ ul.topnav { margin-bottom:0; } +.menu-major-separator { + border-bottom: solid white 1px; + padding-top: .25em; + padding-bottom: .5em; +} + +.menu-minor-separator { + border-top: solid #999999 1px; + padding-top: .1em; + margin-top: .5em; +} + +TH.collection-as-table { text-align: center; + font-size: 0.8em; + padding-left: .5em; + padding-right: .5em; + color: #333333; + background-color: #cccccc; + white-space: nowrap; + } + +TD.collection-as-table { text-align: left; + padding-left: .5em; + padding-right: .5em; + } + +textarea.signature { + width: 100%; +} +textarea.comments { + width: 100%; +} + +textarea.messagebox { + width: 100%; +} + %# Provide a callback for adding/modifying the style sheet. %# http://www.w3.org/TR/REC-CSS1 - section 3.2, says: %# "latter specified rule wins" @@ -390,5 +624,5 @@ inherit => undef </%flags> <%init> $r->content_type('text/css'); -$r->headers_out->{'Expires'} = '+30m'; +#$r->headers_out->{'Expires'} = '+30m'; </%init> diff --git a/rt/html/REST/1.0/Forms/queue/default b/rt/html/REST/1.0/Forms/queue/default index 1041684ec..c87c33cce 100644 --- a/rt/html/REST/1.0/Forms/queue/default +++ b/rt/html/REST/1.0/Forms/queue/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/queue/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/queue/ns b/rt/html/REST/1.0/Forms/queue/ns index bc722d81c..b0ba0036a 100644 --- a/rt/html/REST/1.0/Forms/queue/ns +++ b/rt/html/REST/1.0/Forms/queue/ns @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/queue/ns %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/ticket/attachments b/rt/html/REST/1.0/Forms/ticket/attachments index 944e1259b..ca75ce0d1 100644 --- a/rt/html/REST/1.0/Forms/ticket/attachments +++ b/rt/html/REST/1.0/Forms/ticket/attachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/attachments %# <%ARGS> @@ -80,7 +80,7 @@ if ($aid) { return [ "# Invalid attachment id: $aid", [], {}, 1 ]; } if ($content) { - $c = $attachment->Content; + $c = $attachment->OriginalContent; } else { my @data; push @data, [ id => $attachment->Id ]; diff --git a/rt/html/REST/1.0/Forms/ticket/default b/rt/html/REST/1.0/Forms/ticket/default index d231f7b4b..78f6c9562 100644 --- a/rt/html/REST/1.0/Forms/ticket/default +++ b/rt/html/REST/1.0/Forms/ticket/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/ticket/history b/rt/html/REST/1.0/Forms/ticket/history index f60615a43..4663e97ee 100644 --- a/rt/html/REST/1.0/Forms/ticket/history +++ b/rt/html/REST/1.0/Forms/ticket/history @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/history %# <%ARGS> @@ -97,8 +97,6 @@ if ($tid) { $t->Load($tid); push @data, [ id => $t->Id ]; - push @data, [ EffectiveTicket => $t->EffectiveTicket ] - if (!%$fields || exists $fields->{lc 'EffectiveTicket'}); push @data, [ Ticket => $t->Ticket ] if (!%$fields || exists $fields->{lc 'Ticket'}); push @data, [ TimeTaken => $t->TimeTaken ] diff --git a/rt/html/REST/1.0/Forms/ticket/links b/rt/html/REST/1.0/Forms/ticket/links index a3dab28b7..9f14da4e3 100644 --- a/rt/html/REST/1.0/Forms/ticket/links +++ b/rt/html/REST/1.0/Forms/ticket/links @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/ticket/links %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/user/default b/rt/html/REST/1.0/Forms/user/default index 3694416fc..ad2ebd57a 100644 --- a/rt/html/REST/1.0/Forms/user/default +++ b/rt/html/REST/1.0/Forms/user/default @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/user/default %# <%ARGS> diff --git a/rt/html/REST/1.0/Forms/user/ns b/rt/html/REST/1.0/Forms/user/ns index 8c7f16ef4..406156304 100644 --- a/rt/html/REST/1.0/Forms/user/ns +++ b/rt/html/REST/1.0/Forms/user/ns @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/Forms/user/ns %# <%ARGS> diff --git a/rt/html/REST/1.0/NoAuth/mail-gateway b/rt/html/REST/1.0/NoAuth/mail-gateway index 09e3e3c49..5252c1968 100644 --- a/rt/html/REST/1.0/NoAuth/mail-gateway +++ b/rt/html/REST/1.0/NoAuth/mail-gateway @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,18 +42,19 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%flags> inherit => undef # inhibit UTF8 conversion done in /autohandler </%flags> <%ARGS> -$message $queue => 1 $action => "correspond" $ticket => undef </%ARGS> <%init> use RT::Interface::Email; +$r->content_type('text/plain; charset=utf-8'); +$m->error_format('text'); my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway(\%ARGS); if ($status == -75 ) { $m->out("temporary failure - ". $error); @@ -71,4 +72,6 @@ $m->out('Requestor: '. $Ticket->Requestors->MemberEmailAddressesAsString ); } else { $m->out('not ok - '.$error); } + +$m->abort(); </%init> diff --git a/rt/html/REST/1.0/autohandler b/rt/html/REST/1.0/autohandler index c95231907..8e3fb164d 100644 --- a/rt/html/REST/1.0/autohandler +++ b/rt/html/REST/1.0/autohandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,12 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/autohandler %# <%INIT> use RT::Interface::REST; -$r->content_type('text/plain'); +$r->content_type('text/plain; charset=utf-8'); $m->error_format('text'); $m->call_next(); $m->abort(); diff --git a/rt/html/REST/1.0/dhandler b/rt/html/REST/1.0/dhandler index 725a61759..6cf45b000 100644 --- a/rt/html/REST/1.0/dhandler +++ b/rt/html/REST/1.0/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/dhandler %# <%ARGS> diff --git a/rt/html/REST/1.0/logout b/rt/html/REST/1.0/logout index 9f043769a..470cb0915 100644 --- a/rt/html/REST/1.0/logout +++ b/rt/html/REST/1.0/logout @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%PERL> tied(%session)->delete if (defined %session); </%PERL> diff --git a/rt/html/REST/1.0/search/dhandler b/rt/html/REST/1.0/search/dhandler index 8c61f725c..1915a4644 100644 --- a/rt/html/REST/1.0/search/dhandler +++ b/rt/html/REST/1.0/search/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/search/dhandler %# <%INIT> diff --git a/rt/html/REST/1.0/search/ticket b/rt/html/REST/1.0/search/ticket index 6b52ac8b8..d0ab59e98 100644 --- a/rt/html/REST/1.0/search/ticket +++ b/rt/html/REST/1.0/search/ticket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/search/ticket %# <%ARGS> @@ -135,7 +135,7 @@ if ($n == 0 && $format ne "i") { $output = form_compose(\@output) if @output; OUTPUT: -$m->out("RT/". $RT::VERSION . " " . $status); +$m->out("RT/". $RT::VERSION . " " . $status ."\n\n"); $m->out($output ); </%INIT> diff --git a/rt/html/REST/1.0/ticket/comment b/rt/html/REST/1.0/ticket/comment index 4915c64f1..e27bfcc1e 100644 --- a/rt/html/REST/1.0/ticket/comment +++ b/rt/html/REST/1.0/ticket/comment @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/comment %# <%ARGS> diff --git a/rt/html/REST/1.0/ticket/link b/rt/html/REST/1.0/ticket/link index 7507c0779..6556a5ef7 100644 --- a/rt/html/REST/1.0/ticket/link +++ b/rt/html/REST/1.0/ticket/link @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/link %# <%ARGS> diff --git a/rt/html/REST/1.0/ticket/merge b/rt/html/REST/1.0/ticket/merge index 7cc8b4b78..3db52111b 100644 --- a/rt/html/REST/1.0/ticket/merge +++ b/rt/html/REST/1.0/ticket/merge @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# REST/1.0/ticket/merge %# <%ARGS> diff --git a/rt/html/Search/Build.html b/rt/html/Search/Build.html index bbf2a1de9..cb6462651 100644 --- a/rt/html/Search/Build.html +++ b/rt/html/Search/Build.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,27 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} +%# +%# Data flow here: +%# The page receives a Query from the previous page, and maybe arguments +%# corresponding to actions. (If it doesn't get a Query argument, it pulls +%# one out of the session hash. Also, it could be getting just a raw query from +%# Build/Edit.html (Advanced).) +%# +%# After doing some stuff with default arguments and saved searches, the ParseQuery +%# function (which is similar to, but not the same as, _parser in RT/Tickets_Overlay_SQL) +%# converts the Query into a RT::Interface::Web::QueryBuilder::Tree. This mason file +%# then adds stuff to or modifies the tree based on the actions that had been requested +%# by clicking buttons. It then calls GetQueryAndOptionList on the tree to generate +%# the SQL query (which is saved as a hidden input) and the option list for the Clauses +%# box in the top right corner. +%# +%# Worthwhile refactoring: the tree manipulation code for the actions could use some cleaning +%# up. The node-adding code is different in the "add" actions from in ParseQuery, which leads +%# to things like ParseQuery correctly not quoting numbers in numerical fields, while the "add" +%# action does quote it (this breaks SQLite). +%# <& /Elements/Header, Title => $title &> <& /Ticket/Elements/Tabs, current_tab => "Search/Build.html".$QueryString, @@ -58,36 +78,28 @@ <input type=hidden name=SearchId value="<%$SearchId%>"> <input type=hidden name=Query value="<%$Query%>"> <input type=hidden name=Format value="<%$Format%>"> -<table width=100%> -<tr> -<td valign=top class="boxcontainer"> -<& Elements/PickCriteria, query => $Query, cfqueues => \%queues &> +<table width=100% border="0" cellpadding="5"> +<tr valign="top"> +<td class="boxcontainer" rowspan="2" width="65%"> +<& Elements/PickCriteria, query => $Query, cfqueues => $queues &> <& /Elements/Submit, Caption => loc('Add additional criteria'), Label => loc('Add'), Name => 'AddClause'&> +</td> +<td> +<& Elements/EditQuery, + %ARGS, + actions => \@actions, + optionlist => $optionlist, + Description => $Description &> </td> -<td valign=top class="boxcontainer"> -<& /Elements/TitleBoxStart, title => loc("Query") . ": " .$Description &> -<& Elements/NewListActions, actions => \@actions &> -<select size="10" name="clauses" style="width: 100%"> -<%$optionlist|n%> -</select> -</td></tr><tr><td bgcolor="#dddddd" colspan="2"> -<center> -<input type=submit name="Up" value="^"> -<input type=submit name="Down" value="v"> -<input type=submit name="Left" value="<"> -<input type=submit name="Right" value=">"> -<input type=submit name="DeleteClause" value="Delete"> -<br /> -<input type=submit name="Clear" value="Clear"> -<input type=submit name="Toggle" value="And/Or"> -%#<input type=submit name="EditQuery" value="Advanced"> -</center> -<& /Elements/TitleBoxEnd &> -<br> +</tr> + +<tr valign="top"> +<td> <& Elements/EditSearches, CurrentSearch => $search_hash, Dirty => $dirty, SearchId => $SearchId &> </td> </tr> + <tr> <td colspan=2 class="boxcontainer"> @@ -95,27 +107,35 @@ AvailableColumns => $AvailableColumns, CurrentFormat => $CurrentFormat, RowsPerPage => $RowsPerPage, OrderBy => $OrderBy, Order => $Order &> </td> </tr> +<tr> +<td colspan=2 class="boxcontainer"> +<& /Elements/Submit, Caption => loc("Do the Search"), Label => loc('Search'), Name => 'DoSearch'&> +</td> +</tr> </table> </FORM> <%INIT> -use Tree::Simple; +use RT::Interface::Web::QueryBuilder; +use RT::Interface::Web::QueryBuilder::Tree; my $search_hash = {}; my $search; my $title = loc("Query Builder"); # {{{ Clear out unwanted data -if ($NewQuery or $ARGS{'Delete'}) { +if ( $NewQuery or $ARGS{'Delete'} ) { + # Wipe all data-carrying variables clear if we want a new # search, or we're deleting an old one.. - $Query = ''; - $Format = ''; + $Query = ''; + $Format = ''; $Description = ''; - $SearchId = ''; - $Order = ''; - $OrderBy = ''; + $SearchId = ''; + $Order = ''; + $OrderBy = ''; $RowsPerPage = ''; + # ($search hasn't been set yet; no need to clear) # ..then wipe the session out.. @@ -124,6 +144,7 @@ if ($NewQuery or $ARGS{'Delete'}) { # ..and the search results. $session{'tickets'}->CleanSlate() if defined $session{'tickets'}; } + # }}} # {{{ Attempt to load what we can from the session, set defaults @@ -133,61 +154,71 @@ $search_hash = $session{'CurrentSearchHash'}; # These variables are what define a search_hash; this is also # where we give sane defaults. -$Query ||= $search_hash->{'Query'}; -$Format ||= $search_hash->{'Format'}; +$Query ||= $search_hash->{'Query'}; +$Format ||= $search_hash->{'Format'}; $Description ||= $search_hash->{'Description'}; -$SearchId ||= $search_hash->{'SearchId'} || 'new'; -$Order ||= $search_hash->{'Order'} || 'ASC'; -$OrderBy ||= $search_hash->{'OrderBy'} || 'id'; -$RowsPerPage = ($search_hash->{'RowsPerPage'} || 50) unless defined ($RowsPerPage); +$SearchId ||= $search_hash->{'SearchId'} || 'new'; +$Order ||= $search_hash->{'Order'} || 'ASC'; +$OrderBy ||= $search_hash->{'OrderBy'} || 'id'; +$RowsPerPage = ( $search_hash->{'RowsPerPage'} || 50 ) + unless defined($RowsPerPage); $search ||= $search_hash->{'Object'}; + # }}} my @actions = (); -my %queues; # Clean unwanted junk from the format -$Format = $m->comp('/Elements/ScrubHTML', Content => $Format) if ($Format); +$Format = $m->comp( '/Elements/ScrubHTML', Content => $Format ) if ($Format); # {{{ If we're asked to delete the current search, make it go away and reset the search parameters if ( $ARGS{'Delete'} ) { + # We set $SearchId to 'new' above already, so peek into the %ARGS if ( $ARGS{'SearchId'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { my $obj_type = $1; my $obj_id = $2; my $search_id = $3; - + my $container_object; - if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id) { - $container_object = $session{'CurrentUser'}->UserObj; + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { + $container_object = $session{'CurrentUser'}->UserObj; } - elsif ($obj_type eq 'RT::Group') { - $container_object = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); $container_object->Load($obj_id); } - if ($container_object->id ) { - # We have the object the entry is an attribute on; delete - # the entry.. - $container_object->Attributes->DeleteEntry( Name => 'SavedSearch', id => $search_id); - } + if ( $container_object->id ) { + + # We have the object the entry is an attribute on; delete + # the entry.. + $container_object->Attributes->DeleteEntry( + Name => 'SavedSearch', + id => $search_id + ); + } } } + # }}} # {{{ If the user wants to copy a search, uncouple from the one that this was based on, but don't erase the $Query or $Format if ( $ARGS{'CopySearch'} ) { - $SearchId = 'new'; - $search = undef; - $Description = loc("[_1] copy", $Description); + $SearchId = 'new'; + $search = undef; + $Description = loc( "[_1] copy", $Description ); } + # }}} # {{{ if we're asked to revert the current search, we just want to load it if ( $ARGS{'Revert'} ) { $ARGS{'LoadSavedSearch'} = $SearchId; } + # }}} # {{{ if we're asked to load a search, load it. @@ -196,15 +227,18 @@ if ( $ARGS{'LoadSavedSearch'} =~ /^(.*?)-(\d+)-SavedSearch-(\d+)$/ ) { my $obj_type = $1; my $obj_id = $2; my $search_id = $3; - + # We explicitly list out the available types (user and group) and # don't trust user input here - if ( ( $obj_type eq 'RT::User' ) && ( $obj_id == $session{'CurrentUser'}->id ) ) { - $search = $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); - + if ( ( $obj_type eq 'RT::User' ) + && ( $obj_id == $session{'CurrentUser'}->id ) ) + { + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + } - elsif ($obj_type eq 'RT::Group') { - my $group = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + my $group = RT::Group->new( $session{'CurrentUser'} ); $group->Load($obj_id); $search = $group->Attributes->WithId($search_id); } @@ -231,260 +265,227 @@ if ( $actions[0] ) { $m->abort(); } -my @options; -my $optionlist; $Query = ""; -%queues = (); -# Build the optionlist from the tree, so we can do additions and movements based on it -$optionlist = build_array( \$Query, $ARGS{clauses}, $tree, \@options, \%queues ); +my @options = $tree->GetDisplayedNodes; -my $currentkey; -$currentkey = $options[$ARGS{clauses}] if defined $ARGS{clauses}; +my @current_values = grep { defined } @options[@clauses]; # {{{ Try to find if we're adding a clause foreach my $arg ( keys %ARGS ) { - if ( $arg =~ m/ValueOf(.+)/ && $ARGS{$arg} ne "") { - # We're adding a $1 clause - my $field = $1; - my ($keyword, $op, $value); - - #figure out if it's a grouping - if ( $ARGS{ $field . "Field" } ) { - $keyword = $ARGS{ $field . "Field" }; - } - else { - $keyword = $field; - } - - $value = $ARGS{'ValueOf' . $field}; - $op = $ARGS{ $field . 'Op' }; - if ( $value eq 'NULL' && $op =~ /=/) { - if ($op eq '=') { - $op = "IS"; - } elsif ($op eq '!=') { - $op = "IS NOT"; - } + if ( + $arg =~ m/^ValueOf(.+)/ + && ( ref $ARGS{$arg} eq "ARRAY" + ? grep { $_ ne "" } @{ $ARGS{$arg} } + : $ARGS{$arg} ne "" ) + ) + { - # This isn't "right", but... - # It has to be this way until #5182 is fixed - $value = "'NULL'"; - } else { - $value = "'$value'"; + # We're adding a $1 clause + my $field = $1; + my ( $keyword, $op, $value ); + + #figure out if it's a grouping + if ( $ARGS{ $field . "Field" } ) { + $keyword = $ARGS{ $field . "Field" }; + } + else { + $keyword = $field; } - my $clause = { - Key => $keyword, - Op => $op, - Value => $value - }; - - my $newnode = Tree::Simple->new($clause); - if ($currentkey) { - my $newindex = $currentkey->getIndex() + 1; - if (!$currentkey->getParent->getParent()->isRoot()) { - } - $currentkey->insertSibling($newindex, $newnode); - $currentkey = $newnode; - } - else { - $tree->getChild(0)->addChild($newnode); - $currentkey = $newnode; - } - $newnode->getParent()->setNodeValue($ARGS{'AndOr'}); + my ( @ops, @values ); + if ( ref $ARGS{ 'ValueOf' . $field } eq "ARRAY" ) { + + # we have many keys/values to iterate over, because there is + # more than one CF with the same name. + @ops = @{ $ARGS{ $field . 'Op' } }; + @values = @{ $ARGS{ 'ValueOf' . $field } }; + } + else { + @ops = ( $ARGS{ $field . 'Op' } ); + @values = ( $ARGS{ 'ValueOf' . $field } ); + } + $RT::Logger->error("Bad Parameters passed into Query Builder") + unless @ops == @values; + + for my $i ( 0 .. @ops - 1 ) { + my ( $op, $value ) = ( $ops[$i], $values[$i] ); + next if $value eq ""; + + if ( $value eq 'NULL' && $op =~ /=/ ) { + if ( $op eq '=' ) { + $op = "IS"; + } + elsif ( $op eq '!=' ) { + $op = "IS NOT"; + } + + # This isn't "right", but... + # It has to be this way until #5182 is fixed + $value = "'NULL'"; + } + else { + $value = "'$value'"; + } + + my $clause = { + Key => $keyword, + Op => $op, + Value => $value + }; + + my $newnode = RT::Interface::Web::QueryBuilder::Tree->new($clause); + if (@current_values) { + foreach my $value (@current_values) { + my $newindex = $value->getIndex() + 1; + $value->insertSibling( $newindex, $newnode ); + $value = $newnode; + } + } + else { + $tree->getChild(0)->addChild($newnode); + @current_values = $newnode; + } + $newnode->getParent()->setNodeValue( $ARGS{'AndOr'} ); + } } } + # }}} # {{{ Move things around if ( $ARGS{"Up"} ) { - if ($currentkey) { - my $index = $currentkey->getIndex(); - if ( $currentkey->getIndex() > 0 ) { - my $parent = $currentkey->getParent(); - $parent->removeChild($index); - $parent->insertChild($index - 1, $currentkey); - $currentkey = $parent->getChild($index - 1); - } - else { - push( @actions, [ "error: can't move up", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $index = $value->getIndex(); + if ( $value->getIndex() > 0 ) { + my $parent = $value->getParent(); + $parent->removeChild($index); + $parent->insertChild( $index - 1, $value ); + $value = $parent->getChild( $index - 1 ); + } + else { + push( @actions, [ loc("error: can't move up"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Down"} ) { - if ($currentkey) { - my $index = $currentkey->getIndex(); - my $parent = $currentkey->getParent(); - if ( $currentkey->getIndex() < ($parent->getChildCount - 1) ) { - $parent->removeChild($index); - $parent->insertChild($index + 1, $currentkey); - $currentkey = $parent->getChild($index + 1); - } - else { - push( @actions, [ "error: can't move down", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $index = $value->getIndex(); + my $parent = $value->getParent(); + if ( $value->getIndex() < ( $parent->getChildCount - 1 ) ) { + $parent->removeChild($index); + $parent->insertChild( $index + 1, $value ); + $value = $parent->getChild( $index + 1 ); + } + else { + push( @actions, [ loc("error: can't move down"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Left"} ) { - if ($currentkey) { - my $parent = $currentkey->getParent(); - my $grandparent = $parent->getParent(); - if (!$grandparent->isRoot) { - my $index = $parent->getIndex(); - $parent->removeChild($currentkey); - $grandparent->insertChild($index, $currentkey); - if ($parent->isLeaf()) { - $grandparent->removeChild($parent); - } - } - else { - push( @actions, [ "error: can't move left", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + my $grandparent = $parent->getParent(); + if ( !$grandparent->isRoot ) { + my $index = $parent->getIndex(); + $parent->removeChild($value); + $grandparent->insertChild( $index, $value ); + if ( $parent->isLeaf() ) { + $grandparent->removeChild($parent); + } + } + else { + push( @actions, [ loc("error: can't move left"), -1 ] ); + } } } else { - push( @actions, [ "error: nothing to move", -1 ] ); + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"Right"} ) { - if ($currentkey) { - my $parent = $currentkey->getParent(); - my $index = $currentkey->getIndex(); - my $newparent; - if ($index > 0 ) { - my $sibling = $parent->getChild($index - 1); - if (ref($sibling->getNodeValue)) { - $parent->removeChild($currentkey); - my $newtree = Tree::Simple->new('AND', $parent); - $newtree->addChild($currentkey); - } else { - $parent->removeChild($index); - $sibling->addChild($currentkey); - } - } - else { - $parent->removeChild($currentkey); - $newparent = Tree::Simple->new('AND', $parent); - $newparent->addChild($currentkey); - } - } else { - push( @actions, [ "error: nothing to move", -1 ] ); + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + my $index = $value->getIndex(); + my $newparent; + if ( $index > 0 ) { + my $sibling = $parent->getChild( $index - 1 ); + if ( ref( $sibling->getNodeValue ) ) { + $parent->removeChild($value); + my $newtree = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent ); + $newtree->addChild($value); + } + else { + $parent->removeChild($index); + $sibling->addChild($value); + } + } + else { + $parent->removeChild($value); + $newparent = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $parent ); + $newparent->addChild($value); + } + } + } + else { + push( @actions, [ loc("error: nothing to move"), -1 ] ); } } elsif ( $ARGS{"DeleteClause"} ) { - if ($currentkey) { - $currentkey->getParent()->removeChild($currentkey); + if (@current_values) { + $_->getParent()->removeChild($_) for @current_values; } else { - push( @actions, [ "error: nothing to delete", -1 ] ); + push( @actions, [ loc("error: nothing to delete"), -1 ] ); } } elsif ( $ARGS{"Toggle"} ) { my $ea; - if ($currentkey) { - my $value = $currentkey->getNodeValue(); - my $parent = $currentkey->getParent(); - my $parentvalue = $parent->getNodeValue(); - - if ( $parentvalue eq 'AND') { - $parent->setNodeValue('OR'); - } - else { - $parent->setNodeValue('AND'); - } + if (@current_values) { + foreach my $value (@current_values) { + my $parent = $value->getParent(); + + if ( $parent->getNodeValue eq 'AND' ) { + $parent->setNodeValue('OR'); + } + else { + $parent->setNodeValue('AND'); + } + } } else { - push( @actions, [ "error: nothing to toggle", -1 ] ); + push( @actions, [ loc("error: nothing to toggle"), -1 ] ); } } -elsif ( $ARGS{"Clear"} ) { - $tree = Tree::Simple->new(Tree::Simple->ROOT); -} + +$tree->PruneChildlessAggregators; + # }}} # {{{ Rebuild $Query based on the additions / movements -$Query = ""; -@options = (); -%queues = (); -$optionlist = build_array( \$Query, $currentkey, $tree, \@options, \%queues ); - -sub build_array { - my $Query = shift; - my $currentkey = shift; - my $tree = shift; - my ($keys, $queues) = @_; - my $i = 0; - my $optionlist; - my $depth = 0; - my %parens; - - $tree->traverse( sub { - my ($_tree) = @_; - - return if $_tree->getParent->isRoot(); - - push @$keys, $_tree; - my $clause = $_tree->getNodeValue(); - my $str; - my $ea = $_tree->getParent()->getNodeValue(); - if (ref($clause)) { - $str .= $ea . " " if $_tree->getIndex() > 0; - $str .= $clause->{Key} . " " . $clause->{Op} . " " . $clause->{Value}; - - if ( $clause->{Key} eq "Queue" ) { - $queues->{ $clause->{Value} } = 1; - } - } else { - $str = $ea if $_tree->getIndex() > 0; - } - - my $selected; - if ($_tree == $currentkey) { - $selected = "SELECTED"; - } - else { - $selected = ""; - } - - foreach my $p (keys %parens) { - if ($p > $_tree->getDepth) { - $$Query .= ')' x $parens{$p}; - $parens{$p}--; - } - } - - $optionlist .= "<option value=$i $selected>" . - (" " x 5 x ($_tree->getDepth() - 1)) . "$str</option>\n"; - my $parent = $_tree->getParent(); - if (!($parent->isRoot || $parent->getParent()->isRoot) && - !ref($parent->getNodeValue())) { - if ( $_tree->getIndex() == 0) { - $$Query .= '('; - $parens{$_tree->getDepth}++; - } - } - $$Query .= " " . $str . " "; - - if ($_tree->getDepth < $depth) { - $$Query .= ')'; - $parens{$depth}--; - } - - $i++; - }); - - foreach my $p (keys %parens) { - $$Query .= ") " x $parens{$p}; - } +$Query = ""; +my $optionlist_arrayref; + +($Query, $optionlist_arrayref) = $tree->GetQueryAndOptionList(\@current_values); + +my $optionlist = join "\n", map { qq(<option value="$_->{INDEX}" $_->{SELECTED}>) + . (" " x (5 * $_->{DEPTH})) + . $m->interp->apply_escapes($_->{TEXT}, 'h') . qq(</option>) } @$optionlist_arrayref; + - return $optionlist; -} use Regexp::Common qw /delimited/; @@ -496,18 +497,18 @@ use constant PAREN => 8; use constant KEYWORD => 16; sub ParseQuery { - my $string = shift; - my $tree = shift; + my $string = shift; + my $tree = shift; my @actions = shift; - my $want = KEYWORD | PAREN; - my $last = undef; + my $want = KEYWORD | PAREN; + my $last = undef; my $depth = 1; # make a tree root - $$tree = Tree::Simple->new(Tree::Simple->ROOT); - my $root = Tree::Simple->new('AND', $$tree); - my $lastnode = $root; + $$tree = RT::Interface::Web::QueryBuilder::Tree->new; + my $root = RT::Interface::Web::QueryBuilder::Tree->new( 'AND', $$tree ); + my $lastnode = $root; my $parentnode = $root; # get the FIELDS from Tickets_Overlay @@ -521,17 +522,20 @@ sub ParseQuery { my $re_aggreg = qr[(?i:AND|OR)]; my $re_value = qr[$RE{delimited}{-delim=>qq{\'\"}}|\d+]; my $re_keyword = qr[$RE{delimited}{-delim=>qq{\'\"}}|(?:\{|\}|\w|\.)+]; - my $re_op = qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT LIKE)|(?i:LIKE)] ; # long to short + my $re_op = + qr[=|!=|>=|<=|>|<|(?i:IS NOT)|(?i:IS)|(?i:NOT LIKE)|(?i:LIKE)] + ; # long to short my $re_paren = qr'\(|\)'; - # assume that $ea is AND if it's not set + # assume that $ea is AND if it is not set my ( $ea, $key, $op, $value ) = ( "AND", "", "", "" ); # order of matches in the RE is important.. op should come early, # because it has spaces in it. otherwise "NOT LIKE" might be parsed # as a keyword or value. - while ( $string =~ /( + while ( + $string =~ /( $re_aggreg |$re_op |$re_keyword @@ -556,7 +560,15 @@ sub ParseQuery { # Error # FIXME: I will only print out the highest $want value my $token = $tokens[ ( ( log $want ) / ( log 2 ) ) ]; - push @actions, [ "current: $current, want $want, Error near ->$val<- expecting a " . $token . " in '$string'\n", -1 ]; + push @actions, + [ + loc( +"current: $current, want $want, Error near ->$val<- expecting a " + . $token + . " in '$string'\n" + ), + -1 + ]; } # State Machine: @@ -565,20 +577,21 @@ sub ParseQuery { # Parens are highest priority if ( $current & PAREN ) { if ( $val eq "(" ) { - $depth++; - # make a new node that the clauses can be children of - $parentnode = Tree::Simple->new($ea, $parentnode); + $depth++; + + # make a new node that the clauses can be children of + $parentnode = RT::Interface::Web::QueryBuilder::Tree->new( $ea, $parentnode ); } else { - $depth--; - $parentnode = $parentnode->getParent(); - $lastnode = $parentnode; + $depth--; + $parentnode = $parentnode->getParent(); + $lastnode = $parentnode; } $want = KEYWORD | PAREN | AGGREG; } elsif ( $current & AGGREG ) { - $ea = $val; + $ea = $val; $want = KEYWORD | PAREN; } elsif ( $current & KEYWORD ) { @@ -616,27 +629,27 @@ sub ParseQuery { $val = "'$val'"; } - push @actions, [ "Unknown field: $key", -1 ] unless $class; + push @actions, [ loc("Unknown field: $key"), -1 ] unless $class; $want = PAREN | AGGREG; } else { - push @actions, [ "I'm lost", -1 ]; + push @actions, [ loc("I'm lost"), -1 ]; } if ( $current & VALUE ) { - if ( $key =~ /^CF./ ) { - $key = "'" . $key . "'"; - } + if ( $key =~ /^CF./ ) { + $key = "'" . $key . "'"; + } my $clause = { Key => $key, Op => $op, Value => $val }; - # explicity add a child to it - $lastnode = Tree::Simple->new($clause, $parentnode); - $lastnode->getParent()->setNodeValue($ea); + # explicity add a child to it + $lastnode = RT::Interface::Web::QueryBuilder::Tree->new( $clause, $parentnode ); + $lastnode->getParent()->setNodeValue($ea); ( $ea, $key, $op, $value ) = ( "", "", "", "" ); } @@ -644,14 +657,14 @@ sub ParseQuery { $last = $current; } # while - push @actions, [ "Incomplete query", -1 ] + push @actions, [ loc("Incomplete query"), -1 ] unless ( ( $want | PAREN ) || ( $want | KEYWORD ) ); - push @actions, [ "Incomplete Query", -1 ] + push @actions, [ loc("Incomplete Query"), -1 ] unless ( $last && ( $last | PAREN ) || ( $last || VALUE ) ); # This will never happen, because the parser will complain - push @actions, [ "Mismatched parentheses", -1 ] + push @actions, [ loc("Mismatched parentheses"), -1 ] unless $depth == 1; } @@ -667,24 +680,32 @@ sub _match { sub debug { my $message = shift; - $m->print($message . "<br>"); + $m->print( $message . "<br>" ); } # }}} # }}} +my $queues = $tree->GetReferencedQueues; + # {{{ Deal with format changes -my ($AvailableColumns, $CurrentFormat); -($Format, $AvailableColumns, $CurrentFormat) = $m->comp('Elements/BuildFormatString', cfqueues => \%queues, %ARGS, Format => $Format); +my ( $AvailableColumns, $CurrentFormat ); +( $Format, $AvailableColumns, $CurrentFormat ) = $m->comp( + 'Elements/BuildFormatString', + cfqueues => $queues, + %ARGS, Format => $Format +); + # }}} # {{{ if we're asked to save the current search, save it if ( $ARGS{'Save'} ) { - if ($search && $search->id) { - # This search is based on a previously loaded search -- so - # just update the current search object with new values + if ( $search && $search->id ) { + + # This search is based on a previously loaded search -- so + # just update the current search object with new values $search->SetSubValues( Format => $Format, Query => $Query, @@ -692,83 +713,102 @@ if ( $ARGS{'Save'} ) { OrderBy => $OrderBy, RowsPerPage => $RowsPerPage, ); - $search->SetDescription( $Description ); + $search->SetDescription($Description); } elsif ( $SearchId eq 'new' && $ARGS{'Owner'} =~ /^(.*?)-(\d+)$/ ) { - # We're saving a new search - my $obj_type = $1; - my $obj_id = $2; - - # Find out if we're saving on the user, or a group + # We're saving a new search + my $obj_type = $1; + my $obj_id = $2; + + # Find out if we're saving on the user, or a group my $container_object; - if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id) { + if ( $obj_type eq 'RT::User' && $obj_id == $session{'CurrentUser'}->Id ) + { $container_object = $session{'CurrentUser'}->UserObj; } - elsif ($obj_type eq 'RT::Group') { - $container_object = RT::Group->new($session{'CurrentUser'}); + elsif ( $obj_type eq 'RT::Group' ) { + $container_object = RT::Group->new( $session{'CurrentUser'} ); $container_object->Load($obj_id); } - if ($container_object->id ) { - # If we got one or the other, add the saerch - my ( $search_id, $search_msg ) = $container_object->AddAttribute( - Name => 'SavedSearch', - Description => $Description, - Content => { - Format => $Format, - Query => $Query, - Order => $Order, - OrderBy => $OrderBy, - RowsPerPage => $RowsPerPage, - } - ); - $search = $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); - # Build new SearchId - $SearchId = ref( $session{'CurrentUser'}->UserObj ) . '-' - . $session{'CurrentUser'}->UserObj->Id . '-SavedSearch-' . $search->Id; - } - unless ($search->id) { - push @actions, [loc("Can't find a saved search to work with"), 0]; + if ( $container_object->id ) { + + # If we got one or the other, add the saerch + my ( $search_id, $search_msg ) = $container_object->AddAttribute( + Name => 'SavedSearch', + Description => $Description, + Content => { + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $RowsPerPage, + } + ); + $search = + $session{'CurrentUser'}->UserObj->Attributes->WithId($search_id); + + # Build new SearchId + $SearchId = + ref( $session{'CurrentUser'}->UserObj ) . '-' + . $session{'CurrentUser'}->UserObj->Id + . '-SavedSearch-' + . $search->Id; + } + unless ( $search->id ) { + push @actions, [ loc("Can't find a saved search to work with"), 0 ]; } } else { - push @actions, [loc("Can't save this search"), 0]; + push @actions, [ loc("Can't save this search"), 0 ]; } } + # }}} # {{{ If we're modifying an old query, check if it has changed my $dirty = 0; -$dirty = 1 if defined $search and - ($search->SubValue('Format') ne $Format or - $search->SubValue('Query') ne $Query or - $search->SubValue('Order') ne $Order or - $search->SubValue('OrderBy') ne $OrderBy or - $search->SubValue('RowsPerPage') ne $RowsPerPage); +$dirty = 1 + if defined $search + and ($search->SubValue('Format') ne $Format + or $search->SubValue('Query') ne $Query + or $search->SubValue('Order') ne $Order + or $search->SubValue('OrderBy') ne $OrderBy + or $search->SubValue('RowsPerPage') ne $RowsPerPage ); + # }}} # {{{ Push the updates into the session so we don't loose 'em -$search_hash->{'SearchId'} = $SearchId; -$search_hash->{'Format'} = $Format; -$search_hash->{'Query'} = $Query; +$search_hash->{'SearchId'} = $SearchId; +$search_hash->{'Format'} = $Format; +$search_hash->{'Query'} = $Query; $search_hash->{'Description'} = $Description; -$search_hash->{'Object'} = $search; -$search_hash->{'Order'} = $Order; -$search_hash->{'OrderBy'} = $OrderBy; +$search_hash->{'Object'} = $search; +$search_hash->{'Order'} = $Order; +$search_hash->{'OrderBy'} = $OrderBy; $search_hash->{'RowsPerPage'} = $RowsPerPage; $session{'CurrentSearchHash'} = $search_hash; + # }}} # {{{ Show the results, if we were asked. if ( $ARGS{"DoSearch"} ) { - $m->comp("Results.html" , Query => $Query, Format => $Format, Order => $Order, OrderBy => $OrderBy, Rows => $RowsPerPage); + $m->comp( + "Results.html", + Query => $Query, + Format => $Format, + Order => $Order, + OrderBy => $OrderBy, + Rows => $RowsPerPage + ); $m->abort(); } + # }}} # {{{ Build a querystring for the tabs @@ -776,14 +816,20 @@ if ( $ARGS{"DoSearch"} ) { my $QueryString; if ($NewQuery) { $QueryString = '?NewQuery=1'; -} else { - $QueryString = '?' . $m->comp('/Elements/QueryString', - Query => $Query, - Format => $Format, - Order => $Order, - OrderBy => $OrderBy, - Rows => $RowsPerPage) if ($Query); } +else { + $QueryString = '?' + . $m->comp( + '/Elements/QueryString', + Query => $Query, + Format => $Format, + Order => $Order, + OrderBy => $OrderBy, + Rows => $RowsPerPage + ) + if ($Query); +} + # }}} </%INIT> @@ -798,4 +844,6 @@ $Order => undef $OrderBy => undef $RowsPerPage => undef $HideResults => 0 +@clauses => () </%ARGS> + diff --git a/rt/html/Search/Bulk.html b/rt/html/Search/Bulk.html index f75934bf3..f9eef26b6 100644 --- a/rt/html/Search/Bulk.html +++ b/rt/html/Search/Bulk.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,13 +42,13 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Bulk ticket update") &> <& /Elements/Tabs, Title => loc("Bulk ticket update") &> <& /Elements/ListActions, actions => \@results &> - -<FORM METHOD=POST> +<FORM METHOD="POST" ACTION="<%$RT::WebPath%>/Search/Bulk.html" > +<input type="hidden" name="Query" value="<%$ARGS{'Query'}%>"> <TABLE WIDTH=100% border=0 cellpadding=3 CELLSPACING=0> <TR> <TH><&|/l&>Update</&></TH> @@ -75,8 +75,7 @@ while (my $Ticket = $Tickets->Next) { } </%PERL> <TR bgcolor="<%$bgcolor%>"> -<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>" CHECKED></TD> -%# The ticket view is controlled by config.pm, WebOptions +<TD><input type=checkbox name="UpdateTicket<%$Ticket->Id%>" value="1" CHECKED></TD> %foreach my $col (@cols) { <TD> % if ($col eq 'id') { @@ -153,44 +152,26 @@ while (my $Ticket = $Tickets->Next) { </select> </td></tr> <tr><td align=right><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size=60 value=""></td></tr> +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => "Object-RT::Transaction--CustomField-" + &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } # end if while <tr><td align=right><&|/l&>Attach</&>:</td><td><input name="UpdateAttachment" type="file"></td></tr> <tr><td class=labeltop><&|/l&>Message</&>:</td><td> <& /Elements/MessageBox, Name=>"UpdateContent"&> </td></tr> </table> -<table> -% foreach (keys %allcfs) { -<tr><td class=label> -% my $cf = $allcfs{$_}; -% my $pref; -% if ($cf->Queue == 0) { -% $pref = "[Global]"; -% } else { -% $pref = "[Queue: " . $cfqnames{$_} . "]"; -% } -<%$pref%> <b><% $cf->Name %></b><br> -<% $cf->FriendlyType %> -</td> -<td> -% if ($cf->Type ne "FreeformMultiple") { -<& /Ticket/Elements/EditCustomField, CustomField => $cf &> -% } else { -Add Values<br> -<textarea cols=15 rows=3 name="<%$cf->Id%>-Values"></textarea> -</td><td> -Delete Values<br> -<textarea cols=15 rows=3 name="<%$cf->Id%>-DeleteValues"></textarea> -% } -</td> -</tr> -% } -</table> - <& /Elements/TitleBoxEnd &> + <& /Elements/TitleBoxStart, title => loc('Edit Links'), color => "#336633"&> -<i><&|/l&>Enter tickets or URIs to link tickets to. Seperate multiple entries with spaces.</&></i><br> +<i><&|/l&>Enter tickets or URIs to link tickets to. Separate multiple entries with spaces.</&></i><br> <& /Ticket/Elements/BulkLinks &> <& /Elements/TitleBoxEnd &> @@ -223,7 +204,7 @@ while (my $Ticket = $Tickets->Next) { unless ( exists $cfqs{$cfqid} ) { $cfqs{$cfqid} = 1; $count++; - my $cfs = $cfq->CustomFields; + my $cfs = $cfq->TicketCustomFields; while (my $cf = $cfs->Next) { $allcfs{$cf->Id} = $cf; $cfqnames{$cf->Id} = $cfqn; @@ -245,9 +226,11 @@ if ($ARGS{'UpdateContent'} && #Iterate through each ticket we've been handed my @linkresults; +my %queues; $Tickets->RedoSearch(); while (my $Ticket = $Tickets->Next) { + $queues{$Ticket->QueueObj->Id}++; $RT::Logger->debug( "Checking Ticket ".$Ticket->Id ."\n"); next unless ($ARGS{"UpdateTicket".$Ticket->Id}); $RT::Logger->debug ("Matched\n"); @@ -262,16 +245,6 @@ while (my $Ticket = $Tickets->Next) { #Update the watchers my @watchresults = ProcessTicketWatchers(TicketObj => $Ticket, ARGSRef => \%ARGS); - #Update custom fields - my $pat = "^(\\d+)-(.*)\$"; - foreach (keys %ARGS) { - $ARGS{"Ticket-" . $Ticket->Id . "-CustomField-" . $1 . "-" . $2} = $ARGS{$_} if (/$pat/o); - } - my @cfresults = ProcessTicketCustomFieldUpdates(ARGSRef => \%ARGS); - foreach (keys %ARGS) { - delete $ARGS{"Ticket-" . $Ticket->Id . "-CustomField-" . $1 . "-" . $2} if (/$pat/o); - } - #Update the links $ARGS{'id'} = $Ticket; @@ -291,11 +264,15 @@ while (my $Ticket = $Tickets->Next) { delete $ARGS{'MemberOf-'.$Ticket->Id}; delete $ARGS{$Ticket->Id.'-RefersTo'}; delete $ARGS{'RefersTo-'.$Ticket->Id}; - - my @tempresults = (@watchresults, @basicresults, @dateresults, @updateresults, @linkresults, @cfresults); + my @tempresults = (@watchresults, @basicresults, @dateresults, + @updateresults, @linkresults); @tempresults = map { loc("Ticket [_1]: [_2]",$Ticket->Id,$_) } @tempresults; @results = (@results, @tempresults); } +my $TxnCFs = RT::CustomFields->new($session{CurrentUser}); +$TxnCFs->LimitToLookupType("RT::Queue-RT::Ticket-RT::Transaction"); +$TxnCFs->LimitToGlobalOrObjectId(sort keys %queues); + </%INIT> diff --git a/rt/html/Search/Edit.html b/rt/html/Search/Edit.html index 769d38d9d..16e8a0e71 100755 --- a/rt/html/Search/Edit.html +++ b/rt/html/Search/Edit.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title&> <& /Ticket/Elements/Tabs, current_tab => "Search/Edit.html?".$QueryString, diff --git a/rt/html/Search/Elements/BuildFormatString b/rt/html/Search/Elements/BuildFormatString index e5e131b6c..639e62c29 100644 --- a/rt/html/Search/Elements/BuildFormatString +++ b/rt/html/Search/Elements/BuildFormatString @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,45 +42,76 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Format => undef %cfqueues => undef +$Face => undef +$Size => undef +$Link => undef +$Title => undef +$AddCol => undef +$RemoveCol => undef +$ColUp => undef +$ColDown => undef +$SelectDisplayColumns => undef +$CurrentDisplayColumns => undef </%args> <%init> unless ($Format) { $Format = $RT::DefaultSearchResultFormat; } - -my @fields = ( - "QueueName", "OwnerName", - "id", "Status", - "Subject", "ExtendedStatus", - "Priority", "InitialPriority", - "FinalPriority", "EffectiveId", - "Type", "TimeWorked", - "TimeLeft", "TimeEstimated", - "Requestors", "Cc", - "AdminCc", "StartsRelative", - "StartedRelative", "CreatedRelative", - "LastUpdatedRelative", "ToldRelative", - "DueRelative", "ResolvedRelative", - "Starts", "Started", - "Created", "CreatedBy", - "LastUpdated", "LastUpdatedBy", - "Told", "Due", - "Resolved", "NEWLINE", - "RefersTo", "ReferredToBy", - "DependsOn", "DependedOnBy", - "MemberOf", "Members", - "Parents", "Children", - "-", + + +# All the things we can display in the format string by default +my @fields = qw( + id + Status + ExtendedStatus + Subject + QueueName + OwnerName + Priority + InitialPriority + FinalPriority + Type + TimeWorked + TimeLeft + TimeEstimated + CreatedBy + LastUpdatedBy + Requestors + Cc + AdminCc + Starts + StartsRelative + Started + StartedRelative + Created + CreatedRelative + LastUpdated + LastUpdatedRelative + Told + ToldRelative + Due + DueRelative + Resolved + ResolvedRelative + RefersTo + ReferredToBy + DependsOn + DependedOnBy + MemberOf + Members + Parents + Children + NEWLINE ); my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); -foreach (keys %cfqueues) { - my $id = $_; +foreach my $id (keys %cfqueues) { + # What does this _do_? What are the keys to cfqueues $id =~ s/^.'*(.*).'*$/$1/; # Gotta load up the $queue object, since queues get stored by name now. my $queue = RT::Queue->new($session{'CurrentUser'}); @@ -117,8 +148,8 @@ foreach my $field (@format) { push @seen, \%column; } -if ( $ARGS{"RemoveCol"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +if ( $RemoveCol ) { + my $index = $CurrentDisplayColumns; my $column = $seen[$index]; if ($index) { delete $seen[$index]; @@ -130,9 +161,9 @@ if ( $ARGS{"RemoveCol"} ) { } } } -elsif ( $ARGS{"AddCol"} ) { - if ( defined $ARGS{'SelectDisplayColumns'} ) { - my $selected = $ARGS{'SelectDisplayColumns'}; +elsif ( $AddCol ) { + if ( defined $SelectDisplayColumns ) { + my $selected = $SelectDisplayColumns; my @columns; if (ref($selected) eq 'ARRAY') { @columns = @$selected; @@ -141,74 +172,71 @@ elsif ( $ARGS{"AddCol"} ) { } foreach my $col (@columns) { my %column = (); - $column{Column} = $fields[ $col ]; - - if ( $ARGS{Face} eq "Bold" ) { - $column{Prefix} .= "<B>"; - } - if ( $ARGS{Face} eq "Italic" ) { - $column{Prefix} .= "<I>"; - } - if ( $ARGS{Size} ) { - $column{Prefix} .= "<" . $ARGS{Size} . ">"; - } - if ( $ARGS{Link} eq "Display" ) { - $column{Prefix} .= "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?id=__id__\">"; - } - elsif ( $ARGS{Link} eq "Take" ) { - $column{Prefix} .= - "<A HREF=\"".$RT::WebPath."/Ticket/Display.html?Action=Take&id=__id__\">"; - } - - my $suffix; - if ( $ARGS{'Link'} eq "Display" || $ARGS{'Link'} eq "Take" ) { - $column{Suffix} .= "</a>"; - } - if ( $ARGS{Size} ) { - $column{Suffix} .= "</" . $ARGS{Size} . ">"; - } - if ( $ARGS{Face} eq "Italic" ) { - $column{Suffix} .= "</I>"; - } - if ( $ARGS{Face} eq "Bold" ) { - $column{Suffix} .= "</B>"; - } - if ( $ARGS{Title} ) { - $column{Suffix} .= "/TITLE:" . $ARGS{Title}; - } - push @seen, \%column; - } + $column{Column} = $col; + + if ( $Face eq "Bold" ) { + $column{Prefix} .= "<B>"; + $column{Suffix} .= "</B>"; + } + if ( $Face eq "Italic" ) { + $column{Prefix} .= "<I>"; + $column{Suffix} .= "</I>"; + } + if ($Size) { + $column{Prefix} .= "<" . $m->interp->apply_escapes( $Size, 'h' ) . ">"; + $column{Suffix} .= "</" . $m->interp->apply_escapes( $Size, 'h' ) . ">"; + } + if ( $Link eq "Display" ) { + $column{Prefix} .= + "<A HREF=\"" . $RT::WebPath . "/Ticket/Display.html?id=__id__\">"; + $column{Suffix} .= "</a>"; + } + elsif ( $Link eq "Take" ) { + $column{Prefix} .= "<A HREF=\"" . $RT::WebPath + . "/Ticket/Display.html?Action=Take&id=__id__\">"; + $column{Suffix} .= "</a>"; + } + + if ($Title) { + $column{Suffix} .= "/TITLE:" . $m->interp->apply_escapes( $Title, 'h' ); } + push @seen, \%column; +} +} } -elsif ( $ARGS{"ColUp"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +elsif ( $ColUp ) { + my $index = $CurrentDisplayColumns; if ( defined $index && ( $index - 1 ) >= 0 ) { my $column = $seen[$index]; $seen[$index] = $seen[ $index - 1 ]; $seen[ $index - 1 ] = $column; - $ARGS{CurrentDisplayColumns} = $index - 1; + $CurrentDisplayColumns = $index - 1; } } -elsif ( $ARGS{"ColDown"} ) { - my $index = $ARGS{'CurrentDisplayColumns'}; +elsif ( $ColDown ) { + my $index = $CurrentDisplayColumns; if ( defined $index && ( $index + 1 ) < scalar @seen ) { my $column = $seen[$index]; $seen[$index] = $seen[ $index + 1 ]; $seen[ $index + 1 ] = $column; - $ARGS{CurrentDisplayColumns} = $index + 1; + $CurrentDisplayColumns = $index + 1; } } -$Format = ""; + +my @format_string; foreach my $field (@seen) { next unless $field; - $Format .= ", \n" if $Format; - $Format .= "'"; - $Format .= $field->{Prefix}; - $Format .= "__" . $field->{Column} . "__" if ( $field->{Column} ne "<blank>" ) ; - $Format .= $field->{Suffix}; - $Format .= "'"; + my $row = "'" . $field->{Prefix}; + $row .= "__" . $m->interp->apply_escapes( $field->{Column}, 'h' ) . "__" + unless ( $field->{Column} eq "<blank>" ); + $row .= $field->{Suffix} . "'"; + push( @format_string, $row ); } + +$Format = join(",\n", @format_string); + + return($Format, \@fields, \@seen); </%init> diff --git a/rt/html/Search/Elements/DisplayOptions b/rt/html/Search/Elements/DisplayOptions index 330948d32..43a9d9998 100644 --- a/rt/html/Search/Elements/DisplayOptions +++ b/rt/html/Search/Elements/DisplayOptions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc("Display Columns") &> <table> <tr> @@ -54,15 +54,15 @@ <tr> <td class=label> <&|/l&>Order by</&>: -</td><td class=label> +</td><td class=value> <select name="OrderBy"> % foreach my $field (keys %fields) { % next unless $field; <option value=<%$field%> -% if ($field eq $OrderBy) { +% if ($field =~ /^$OrderBy$/i) { SELECTED % } -><%$field%></option> +><&|/l&><%$field%></&></option> % } </select> <select name="Order"> @@ -81,7 +81,7 @@ SELECTED </tr> <td class=label> <&|/l&>Rows per page</&>: -</td><td> +</td><td class="value"> <& /Elements/SelectResultsPerPage, Name => "RowsPerPage", Default => $RowsPerPage &> @@ -91,13 +91,14 @@ SELECTED </td> </tr> </table> -<& /Elements/Submit, Caption => "Do the Search", Label => loc('Search'), Name => 'DoSearch'&> <& /Elements/TitleBoxEnd &> <%INIT> my $tickets = new RT::Tickets($session{'CurrentUser'}); my %fields = %{$tickets->FIELDS}; map { $fields{$_}->[0] =~ /^(?:ENUM|INT|DATE|STRING)$/ || delete $fields{$_} } keys %fields; +delete $fields{'EffectiveId'}; + </%INIT> diff --git a/rt/html/Search/Elements/EditFormat b/rt/html/Search/Elements/EditFormat index 7d314aee6..dc8720f26 100644 --- a/rt/html/Search/Elements/EditFormat +++ b/rt/html/Search/Elements/EditFormat @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td> -<&|/l&>Available Columns</&>: +<&|/l&>Add Columns</&>: </td> <td> -Format: +<&|/l&>Format</&>: </td> <td></td> <td> @@ -58,50 +58,42 @@ Format: <tr> <td valign=top> <select size="6" name="SelectDisplayColumns" multiple> -% my $i = 0; -% while ($i < scalar @$AvailableColumns) { -% my $field = $AvailableColumns->[$i]; -% if ($field) { -<option value=<%$i%> -><%$field%></option> -% } -% $i++; +% foreach my $field ( @$AvailableColumns) { +<option value="<%$field%>"><% loc( $field) %></option> +%# $m->comp( '/Elements/RT__Ticket/ColumnMap', Name => $field, Attr => 'title') || % } </select> </td> <td> -Link: -<select name=Link> +<&|/l&>Link</&>: +<select name="Link"> <option value="None">-</option> -<option value="Display">Display</option> -<option value="Take">Take</option> +<option value="Display"><&|/l&>Display</&></option> +<option value="Take"><&|/l&>Take</&></option> </select> -<br>Title: <input name="Title" size=10> -<br>Size: -<select name=Size> +<br><&|/l&>Title</&>: <input name="Title" size=10> +<br><&|/l&>Size</&>: +<select name="Size"> <option value="">-</option> -<option value="Small">Small</option> -<option value="Large">Large</option> +<option value="Small"><&|/l&>Small</&></option> +<option value="Large"><&|/l&>Large</&></option> </select> -<br>Face: -<select name=Face> +<br><&|/l&>Style</&>: +<select name="Face"> <option value="">-</option> -<option value="Bold">Bold</option> -<option value="Italic">Italic</option> +<option value="Bold"><&|/l&>Bold</&></option> +<option value="Italic"><&|/l&>Italic</&></option> </select> </td> <td> <input type=submit name="AddCol" value="->"> </td> <td valign=top> -<select size=4 name="CurrentDisplayColumns" style="width : 100%"> -% $i = 0; -% while ($i < scalar @$CurrentFormat) { -% my $field = $CurrentFormat->[$i]; -% if ($field) { -<option value=<%$i%>><%$field->{Column}%></option> -% } -% $i++; +<select size=4 name="CurrentDisplayColumns"> +% my $i=0; +% foreach my $field (@$CurrentFormat) { +<option value="<%$i++%>><%$field->{Column}%>"> +<%loc( $field->{Column}) %></option> % } </select> <br> diff --git a/rt/html/Search/Elements/EditQuery b/rt/html/Search/Elements/EditQuery new file mode 100644 index 000000000..783541a64 --- /dev/null +++ b/rt/html/Search/Elements/EditQuery @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& NewListActions, actions => $actions &> +<& /Elements/TitleBoxStart, title => join(': ', grep defined, loc("Query"), $Description) &> +<select size="10" name="clauses" style="width: 100%" multiple> +% $m->out($optionlist); +</select> +<p align="center"> +<input type=submit name="Up" value="^"> +<input type=submit name="Down" value="v"> +<input type=submit name="Left" value="<"> +<input type=submit name="Right" value=">"> +<input type=submit name="Toggle" value="<&|/l&>And/Or</&>"> +<input type=submit name="DeleteClause" value="<&|/l&>Delete</&>"> +%#<input type=submit name="EditQuery" value="Advanced"> +</p> +<& /Elements/TitleBoxEnd &> +<%ARGS> +$Description +$optionlist +$actions +</%ARGS> diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches index cd9f1ef3b..bc6b80e6f 100644 --- a/rt/html/Search/Elements/EditSearches +++ b/rt/html/Search/Elements/EditSearches @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Saved searches') &> +%# Hide all the save functionality if the user shouldn't see it. +% if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch', +% Object=> $RT::System )) { <&|/l&>Privacy:</&> % if ($CurrentSearch->{'Object'} && $CurrentSearch->{'Object'}->id) { <& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &><br> @@ -52,13 +55,14 @@ % } <&|/l&>Description</&>:<br> <font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}%>"></font> -<br> +<nobr> % if ($SearchId ne 'new') { % if ($Dirty) { <input type="submit" name="Revert" value="<%loc('Revert')%>"> % } <input type="submit" name="Delete" value="<%loc('Delete')%>"> <input type="submit" name="CopySearch" value="<%loc('Copy')%>"> +</nobr> % } @@ -66,12 +70,18 @@ <input type="submit" name="Save" value="<%loc('Save')%>"> % } <hr> +% } <&|/l&>Load saved search:</&><br> <& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&> <input value="<%loc('Load')%>" type="submit"> <& /Elements/TitleBoxEnd &> <%init> + +unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', + Object=> $RT::System )) { + return; +} my @Objects; push @Objects, $session{CurrentUser}->UserObj; diff --git a/rt/html/Search/Elements/NewListActions b/rt/html/Search/Elements/NewListActions index 7b81d80b1..eb82544f3 100644 --- a/rt/html/Search/Elements/NewListActions +++ b/rt/html/Search/Elements/NewListActions @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($actions[0] ) { <b><%loc('Results')%></b><br> % foreach my $action (@actions) { diff --git a/rt/html/Search/Elements/PickBasics b/rt/html/Search/Elements/PickBasics index d7e19788f..8a48f6b18 100644 --- a/rt/html/Search/Elements/PickBasics +++ b/rt/html/Search/Elements/PickBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,18 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<tr><td> -% foreach my $field (@fields) { +%# END BPS TAGGED BLOCK }}} +<tr> +<td class="label"> +<&|/l&>id</&> +</td><td> +<& /Elements/SelectEqualityOperator, Name => "idOp" &> +</td><td> +<INPUT Name="ValueOfid" SIZE=5> +</td> +</tr> + <tr><td align=right> -% if ($field eq "Attachment") { <& /Elements/SelectAttachmentField, Name => 'AttachmentField' &> </td><td> <& /Elements/SelectBoolean, Name => "AttachmentOp", @@ -57,44 +64,26 @@ &> </td><td> <Input Name="ValueOfAttachment" Size=20> -% } elsif ($field eq "Dates") { -<& /Elements/SelectDateType, Name=>"DateField" &> -</td><td> -<& /Elements/SelectDateRelation, Name=>"DateOp" &> -</td><td> -<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> -% } elsif ($field eq "Links") { -<& SelectLinks, Name=>"LinksField" &> -</td><td> -<& /Elements/SelectBoolean, Name => "LinksOp", - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=' -&> -</td><td> -<INPUT Name="ValueOfLinks" value="" SIZE=5> -%} elsif ($field eq "Priority") { -<SELECT NAME="PriorityField"> -<OPTION VALUE="Priority"><&|/l&>Priority</&></OPTION> -<OPTION VALUE="InitialPriority"><&|/l&>Initial Priority</&></OPTION> -<OPTION VALUE="FinalPriority"><&|/l&>Final Priority</&></OPTION> -</SELECT> -</td><td> -<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> -</td><td> -<INPUT Name="ValueOfPriority" SIZE=5> -%} elsif ($field =~ m/Time.*/) { -<SELECT NAME="TimeField"> -<OPTION VALUE="TimeWorked"><&|/l&>Time Worked</&></OPTION> -<OPTION VALUE="TimeEstimated"><&|/l&>Time Estimated</&></OPTION> -<OPTION VALUE="TimeLeft"><&|/l&>Time Left</&></OPTION> -</SELECT> +</td> +</tr> +<tr> +<td class="label"> +<&|/l&>Queue</&> </td><td> -<& /Elements/SelectEqualityOperator, Name => "TimeOp" &> +<& /Elements/SelectBoolean, Name => "QueueOp" , + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> </td><td> -<INPUT Name="ValueOfTime" SIZE=5> -% } elsif ($field eq "Status") { +<& /Elements/SelectQueue, + Name => "ValueOfQueue", + NamedValues => 1, + CheckQueueRight => 'ShowTicket' &> +</td> +</tr> +<tr> +<td class="label"> <&|/l&>Status</&> </td><td> <& /Elements/SelectBoolean, Name => "StatusOp", @@ -105,32 +94,9 @@ &> </td><td> <& /Elements/SelectStatus, Name => "ValueOfStatus", SkipDeleted => 1 &> -%} elsif ($field =~ m/.*Priority/ || $field =~ m/Time.*/) { -<&|/l&><%$field%></&> -</td><td> -<& /Elements/SelectEqualityOperator, Name => $field . "Op" &> -</td><td> -<INPUT Name="<%"ValueOf" . $field%>" SIZE=5> -% } elsif ($field eq "Queue") { -<&|/l&>Queue</&> -</td><td> -<& /Elements/SelectBoolean, Name => "QueueOp" , - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', - FalseVal => '!=' &> -</td><td> -<& /Elements/SelectQueue, Name => "ValueOfQueue", NamedValues => 1 &> -% } elsif ($field eq "id") { -<&|/l&>Id</&> -</td><td> -<& /Elements/SelectEqualityOperator, Name => "idOp" &> -</td><td> -<INPUT Name="ValueOfid" SIZE=5> -% } elsif ($field eq "People") { -% foreach my $field (@people) { +</td> +</tr> <tr><td class="label"> -% if ($field eq "Actor") { <SELECT NAME="ActorField"> <OPTION VALUE="Owner"><&|/l&>Owner</&></OPTION> <OPTION VALUE="Creator"><&|/l&>Creator</&></OPTION> @@ -142,43 +108,80 @@ FalseVal => '!=' &> </td><td> -<& /Elements/SelectOwner, Name => "ValueOfActor" &> -% } elsif ($field eq 'Watcher') { +<& /Elements/SelectOwner, Name => "ValueOfActor", ValueAttribute => 'Name' &> +</td> +</tr> +<tr> +<td class="label"> <& SelectPersonType, Name => 'WatcherField', Default => 'Requestor' &> </td><td> <& /Elements/SelectMatch, Name => "WatcherOp" &> </td><td> <Input Name="ValueOfWatcher" Size=20> -% } else { -<&|/l&><%$field%></&> -<& /Elements/SelectMatch, Name => "$field" . "Op" &> -<INPUT Name="<%"ValueOf" . $field%>" value=""SIZE=20> -% } +</tr> +<tr> +<td class="label"> +<& SelectPersonType, Name => 'WatcherGroupField', Default => 'RequestorGroup', Suffix => 'Group' &> +</td><td> +<& /Elements/SelectBoolean, Name => "WatcherGroupOp", + True=> loc('belongs to'), + False=> loc('does not belong to'), + TrueVal=> '=', + FalseVal => '!=' +&> +</td><td> +<& SelectGroup, Name => 'ValueOfWatcherGroup' &> +</td> +</tr> +<tr> +<td class="label"> +<& /Elements/SelectDateType, Name=>"DateField" &> +</td><td> +<& /Elements/SelectDateRelation, Name=>"DateOp" &> +</td><td> +<& /Elements/SelectDate, Name => "ValueOfDate", ShowTime => 0, Default => '' &> </td></tr> -% } -% } else { -<&|/l&><%$field%></&> +<tr> +<td class="label"> +<SELECT NAME="TimeField"> +<OPTION VALUE="TimeWorked"><&|/l&>Time Worked</&></OPTION> +<OPTION VALUE="TimeEstimated"><&|/l&>Time Estimated</&></OPTION> +<OPTION VALUE="TimeLeft"><&|/l&>Time Left</&></OPTION> +</SELECT> +</td><td> +<& /Elements/SelectEqualityOperator, Name => "TimeOp" &> </td><td> -<& /Elements/SelectMatch, Name => "$field" . "Op" &> +<INPUT Name="ValueOfTime" SIZE=5> +</td> +</tr> +<tr> +<td class="label"> +<SELECT NAME="PriorityField"> +<OPTION VALUE="Priority"><&|/l&>Priority</&></OPTION> +<OPTION VALUE="InitialPriority"><&|/l&>Initial Priority</&></OPTION> +<OPTION VALUE="FinalPriority"><&|/l&>Final Priority</&></OPTION> +</SELECT> +</td><td> +<& /Elements/SelectEqualityOperator, Name => "PriorityOp" &> </td><td> -<INPUT Name="<%"ValueOf" . $field%>" value="" SIZE=20> -% } +<INPUT Name="ValueOfPriority" SIZE=5> +</td> +</tr> +<tr> +<td class="label"> +<& SelectLinks, Name=>"LinksField" &> +</td><td> +<& /Elements/SelectBoolean, Name => "LinksOp", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', + FalseVal => '!=' &> +</td><td> +<INPUT Name="ValueOfLinks" value="" SIZE=5> </td></tr> -% } -<& '/Elements/Callback', _CallbackName => 'EndOfList' &> <%INIT> -my @fields = ('Attachment', - 'Queue', - 'Status', - 'People', - 'Dates', - 'Time', - 'Priority', - 'Links', - 'id', - ); - my @people = ('Actor', 'Watcher', + 'WatcherGroup', ); </%INIT> diff --git a/rt/html/Search/Elements/PickCFs b/rt/html/Search/Elements/PickCFs index fb143ba57..435a07ad3 100644 --- a/rt/html/Search/Elements/PickCFs +++ b/rt/html/Search/Elements/PickCFs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,24 +42,17 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % while ( my $CustomField = $CustomFields->Next ) { -<tr><td class=label> - -% my $name; -% if ($CustomField->QueueObj->id) { -% $name = "'CF." . $CustomField->QueueObj->Name . -% ".{" . $CustomField->Name . "}'"; -% } else { -% $name = "'CF." . $CustomField->Name . "'"; -% } +% my $name = "'CF.{" . $CustomField->Name . "}'"; +<tr><td class="label"> <% $CustomField->Name %> </td> <td> -<& /Elements/SelectCustomFieldOperator, Name => $name . "Op", - True => loc("is"), - False => loc("isn't"), - TrueVal=> '=', FalseVal => '!=' &> + <& /Elements/SelectCustomFieldOperator, Name => $name . "Op", + True => loc("is"), + False => loc("isn't"), + TrueVal=> '=', FalseVal => '!=' &> </td> <td> <& /Elements/SelectCustomFieldValue, Name => "ValueOf" . $name, @@ -67,13 +60,11 @@ &> </td></tr> % } - <%INIT> my $CustomFields = RT::CustomFields->new( $session{'CurrentUser'}); -foreach (keys %cfqueues) { - my $id = $_; +foreach my $id (keys %cfqueues) { $id =~ s/^.'*(.*).'*$/$1/; - # Gotta load up the $queue object, since queues get stored by name now. + # Gotta load up the $queue object, since queues get stored by name now. my $id my $queue = RT::Queue->new($session{'CurrentUser'}); $queue->Load($id); $CustomFields->LimitToQueue($queue->Id); diff --git a/rt/html/Search/Elements/PickCriteria b/rt/html/Search/Elements/PickCriteria index 344830e34..129344443 100644 --- a/rt/html/Search/Elements/PickCriteria +++ b/rt/html/Search/Elements/PickCriteria @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,26 +42,32 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => loc('Add Criteria')&> <table width=100% cellspacing=0 cellpadding=0 border=0> <tr> <td> <table cellspacing=0 border=0> <tr><td class=label> - Aggregator: + <&|/l&>Aggregator</&>: </td> <td><& SelectAndOr, Name => "AndOr" &> </td></tr> </table> </td></tr> <tr> - <td colspan=3> + <td> <hr> </td> </tr> - <& PickBasics &> - <& PickCFs, cfqueues => \%cfqueues &> + <tr> + <td valign=top> + <table cellspacing=0 border=0> + <& PickBasics &> + <& PickCFs, cfqueues => \%cfqueues &> + </table> + </td> + </tr> <tr><td> </td></tr> </table> diff --git a/rt/html/Search/Elements/SearchPrivacy b/rt/html/Search/Elements/SearchPrivacy index 5f6f207fe..270e1baa3 100644 --- a/rt/html/Search/Elements/SearchPrivacy +++ b/rt/html/Search/Elements/SearchPrivacy @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Object => undef </%args> diff --git a/rt/html/Search/Elements/SelectAndOr b/rt/html/Search/Elements/SelectAndOr index 11df03ff1..2f3c70477 100644 --- a/rt/html/Search/Elements/SelectAndOr +++ b/rt/html/Search/Elements/SelectAndOr @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,10 +42,10 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<input type=radio NAME="<%$Name%>" CHECKED VALUE="AND">AND</input> -<input type=radio NAME="<%$Name%>" VALUE="OR">OR</input> +%# END BPS TAGGED BLOCK }}} +<input type=radio NAME="<%$Name%>" CHECKED VALUE="AND"><&|/l&>AND</&></input> +<input type=radio NAME="<%$Name%>" VALUE="OR"><&|/l&>OR</&></input> <%ARGS> $Name => "Operator" -</%ARGS>
\ No newline at end of file +</%ARGS> diff --git a/rt/html/Search/Elements/SelectGroup b/rt/html/Search/Elements/SelectGroup new file mode 100644 index 000000000..edd53713f --- /dev/null +++ b/rt/html/Search/Elements/SelectGroup @@ -0,0 +1,65 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<SELECT NAME="<%$Name%>"> +% if ($AllowNull) { +<OPTION VALUE="">-</OPTION> +% } +%while (my $group = $groups->Next) { +<OPTION VALUE="<%$group->id%>" <%$group->id eq $Default && "SELECTED"%>><%$group->Name%></OPTION> +%} +</SELECT> + +<%INIT> +my $groups = new RT::Groups($session{'CurrentUser'}); +$groups->Limit(FIELD => 'Domain', OPERATOR => '=', VALUE => $Domain); + +</%INIT> +<%ARGS> +$AllowNull => 1 +$Default=> '' +$Name => 'Group' +$Domain => 'UserDefined'; +</%ARGS> diff --git a/rt/html/Search/Elements/SelectLinks b/rt/html/Search/Elements/SelectLinks index b814e3088..00ec80bd3 100644 --- a/rt/html/Search/Elements/SelectLinks +++ b/rt/html/Search/Elements/SelectLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME="<%$Name%>"> % foreach (@fields) { <OPTION VALUE="<%$_%>"><&|/l&><%$_%></&></OPTION> @@ -56,7 +56,7 @@ $Name => 'LinksField' my @fields = ('HasMember', 'MemberOf', 'DependsOn', - 'DependentOn', + 'DependedOnBy', 'RefersTo', 'ReferredToBy', 'LinkedTo', diff --git a/rt/html/Search/Elements/SelectPersonType b/rt/html/Search/Elements/SelectPersonType index 01f389304..d4127c97b 100644 --- a/rt/html/Search/Elements/SelectPersonType +++ b/rt/html/Search/Elements/SelectPersonType @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,16 +42,20 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <SELECT NAME ="<%$Name%>"> % if ($AllowNull) { <OPTION VALUE="">-</OPTION> % } -%for my $option (@types) { -%foreach my $subtype (@subtypes) { -<OPTION VALUE="<%"$option.$subtype"%>" <%$option eq $Default && $subtype eq 'EmailAddress' && "SELECTED"%> ><%loc("[_1] [_2]",$option, $subtype)%></OPTION> +% for my $option (@types) { +% if ($Suffix) { +<OPTION VALUE="<% $option %><% $Suffix %>" <%$option eq $Default && "SELECTED"%> ><%loc($option)%></OPTION> +% next; +% } +% foreach my $subtype (@subtypes) { +<OPTION VALUE="<%"$option.$subtype"%>" <%$option eq $Default && $subtype eq 'EmailAddress' && "SELECTED"%> ><% loc($option) %> <% loc($subtype) %></OPTION> +% } % } -%} </SELECT> <%INIT> @@ -59,6 +63,9 @@ my @types; if ($Scope =~ 'queue') { @types = qw(Cc AdminCc); } +elsif ($Suffix eq 'Group') { + @types = qw(Requestor Cc AdminCc Watcher); +} else { @types = qw(Requestor Cc AdminCc Watcher Owner); } @@ -68,6 +75,7 @@ my @subtypes = qw(EmailAddress Name RealName Nickname Organization Address1 Addr </%INIT> <%ARGS> $AllowNull => 1 +$Suffix => '' $Default=>undef $Scope => 'ticket' $Name => 'WatcherType' diff --git a/rt/html/Search/Elements/SelectSearchObject b/rt/html/Search/Elements/SelectSearchObject index 6eaa680f8..e9df5179f 100644 --- a/rt/html/Search/Elements/SelectSearchObject +++ b/rt/html/Search/Elements/SelectSearchObject @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> @Objects => undef $Name => undef diff --git a/rt/html/Search/Elements/SelectSearchesForObjects b/rt/html/Search/Elements/SelectSearchesForObjects index 3f0c458cb..e6be66a58 100644 --- a/rt/html/Search/Elements/SelectSearchesForObjects +++ b/rt/html/Search/Elements/SelectSearchesForObjects @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> @Objects => undef $Name => undef @@ -57,6 +57,9 @@ $Name => undef % } % my @searches = $object->Attributes->Named('SavedSearch'); % foreach my $search (@searches) { +% # Skip it if it is not a ticket search. +% next if ($search->SubValue('SearchType') +% && $search->SubValue('SearchType') ne 'Ticket'); <option value="<%ref($object)%>-<%$object->id%>-SavedSearch-<%$search->Id%>"> -<%$search->Description||loc('Unnamed search')%></option> % } % } diff --git a/rt/html/Search/Results.html b/rt/html/Search/Results.html index dfcc7885c..5849378a8 100755 --- a/rt/html/Search/Results.html +++ b/rt/html/Search/Results.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} &> <& /Ticket/Elements/Tabs, current_tab => "Search/Results.html".$QueryString, @@ -52,7 +52,6 @@ Rows => $Rows, OrderBy => $OrderBy, Order => $Order &> -<hr> <& /Elements/TicketList, Query => $Query, AllowSorting => 1, @@ -81,24 +80,26 @@ <a href="<%$RT::WebPath%>/Search/Bulk.html<%$QueryString%>"><&|/l&>Update multiple tickets</&></a><br> <a href="<%$RT::WebPath%>/Search/Results.html<%$QueryString%>"><&|/l&>Bookmarkable link</&></a><br> <a href="<%$RT::WebPath%>/Search/Results.tsv<%$QueryString%>"><&|/l&>spreadsheet</&></a> | -<a href="<%$RT::WebPath%>/Search/Results.rdf<%$QueryString%>"><&|/l&>RSS</&></a> | -<a href="<%$RT::WebPath%>/Tools/Offline.html<%$QueryString%>"><&|/l&>Work offline</&></a><br> +<a href="<%$RT::WebPath%>/Search/Results.rdf<%$ShortQueryString%>"><&|/l&>RSS</&></a> | +<a href="<%$RT::WebPath%>/Tools/Offline.html<%$ShortQueryString%>"><&|/l&>Work offline</&></a><br> <& /Elements/Callback, _CallbackName => 'SearchActions', QueryString => $QueryString&> </div> <%INIT> my ($title, $ticketcount); $session{'i'}++; -$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) unless ($session{'tickets'}); +$session{'tickets'} = RT::Tickets->new($session{'CurrentUser'}) ; $session{'tickets'}->FromSQL($Query) if ($Query); $session{'tickets'}->OrderBy(FIELD => $OrderBy, ORDER => $Order); -if ($OrderBy ne $session{'CurrentSearchHash'}->{'OrderBy'} - or $Order ne $session{'CurrentSearchHash'}->{'Order'}) { - $session{'CurrentSearchHash'}->{'OrderBy'} = $OrderBy; - $session{'CurrentSearchHash'}->{'Order'} = $Order; - # Invalidate the ordering cache - undef $session{'tickets'}->{'items_array'}; -} + +$session{'CurrentSearchHash'} = { + Format => $Format, + Query => $Query, + Order => $Order, + OrderBy => $OrderBy, + RowsPerPage => $Rows + }; + if ( $session{'tickets'}->Query()) { @@ -116,6 +117,7 @@ my $QueryString = "?".$m->comp('/Elements/QueryString', Order => $Order, Page => $Page); +my $ShortQueryString = "?".$m->comp('/Elements/QueryString', Query => $Query); if ($ARGS{'TicketsRefreshInterval'}) { $session{'tickets_refresh_interval'} = $ARGS{'TicketsRefreshInterval'}; diff --git a/rt/html/Search/Results.rdf b/rt/html/Search/Results.rdf index 8054c8616..ee71fea94 100644 --- a/rt/html/Search/Results.rdf +++ b/rt/html/Search/Results.rdf @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $Tickets = RT::Tickets->new($session{'CurrentUser'}); diff --git a/rt/html/Search/Results.tsv b/rt/html/Search/Results.tsv index 631e299f0..17aa88ae1 100644 --- a/rt/html/Search/Results.tsv +++ b/rt/html/Search/Results.tsv @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $Tickets = RT::Tickets->new($session{'CurrentUser'}); @@ -84,7 +84,8 @@ my @attrs = qw( id QueueObj->Name Subject Status TimeEstimated TimeWorked TimeLe my @header; foreach my $attr (@attrs) { my $label = $attr; - $label =~ s'Obj-.(AsString|Name|ISO)''g; + $label =~ s'Obj-.(?:AsString|Name|ISO)''g; + $label =~ s'-\>MemberEmailAddressesAsString''g; push @header, $label; } foreach my $id (sort keys %known_cfs) { diff --git a/rt/html/SelfService/Attachment/dhandler b/rt/html/SelfService/Attachment/dhandler index 698e345d3..f953c2486 100644 --- a/rt/html/SelfService/Attachment/dhandler +++ b/rt/html/SelfService/Attachment/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> $m->comp('/Ticket/Attachment/dhandler', %ARGS); $m->abort; diff --git a/rt/html/SelfService/Closed.html b/rt/html/SelfService/Closed.html index 515879eeb..2d49a6897 100644 --- a/rt/html/SelfService/Closed.html +++ b/rt/html/SelfService/Closed.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,8 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title => loc('Closed Tickets') &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, Title => loc('Closed tickets') &> <& /SelfService/Elements/MyRequests, status => ['rejected', 'resolved'], friendly_status => loc('closed') &> diff --git a/rt/html/SelfService/Create.html b/rt/html/SelfService/Create.html index a2cfd9fee..d60ae267a 100644 --- a/rt/html/SelfService/Create.html +++ b/rt/html/SelfService/Create.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& Elements/Header, Title => loc("Create a ticket") &> <FORM ACTION="Display.html" METHOD="POST" ENCTYPE="multipart/form-data"> @@ -50,43 +50,49 @@ <TABLE> <TR> -<TD> +<TD class="label"> <&|/l&>Queue</&>: -</TD> -<TD> -<& /Elements/SelectNewTicketQueue, Verbose => 'True' &> +</td> +<td class="value"> + <input type="hidden" name="Queue" value="<%$queue_obj->id%>"> + <b><%$queue_obj->Name%></b> (<%$queue_obj->Description%>) </TD> </TR> <TR> -<TD> +<TD class="label"> <&|/l&>Requestors</&>: </TD> -<TD> +<TD class="value"> <INPUT Name="Requestors" Value="<%$session{CurrentUser}->EmailAddress%>" SIZE=20> </TD> </TR> <TR> -<TD> +<TD class="label"> <&|/l&>Cc</&>: </TD> -<TD> +<TD class="value"> <INPUT NAME="Cc" SIZE=20> </TD> </TR> <TR> -<TD> +<TD class="label"> <&|/l&>Subject</&>: </TD> -<TD> +<TD class="value"> <INPUT Name="Subject" SIZE=60 MAXSIZE=100 value=""> </TD> </TR> -<TR> -<TD> +<tr> + <td colspan="2"> + <& /Ticket/Elements/EditCustomFields, QueueObj => $queue_obj &> + </td> +</tr> +<tr> +<TD class="label"> <&|/l&>Attach file</&>: </TD> -<TD> -<INPUT Name="Attach" type=file> +<TD class="value"> +<INPUT Name="Attach" type="file"> </TD> </TR> <TR> @@ -100,3 +106,10 @@ </FORM> +<%args> +$Queue => undef +</%args> +<%init> +my $queue_obj = RT::Queue->new($session{'CurrentUser'}); +$queue_obj->Load($Queue); +</%init> diff --git a/rt/html/SelfService/CreateTicketInQueue.html b/rt/html/SelfService/CreateTicketInQueue.html new file mode 100755 index 000000000..5e8973610 --- /dev/null +++ b/rt/html/SelfService/CreateTicketInQueue.html @@ -0,0 +1,61 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# You should have received a copy of the GNU General Public License +%# along with this program; if not, write to the Free Software +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# +%# +%# CONTRIBUTION SUBMISSION POLICY: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& Elements/Header, Title => loc("Create a ticket") &> + +<h1><&|/l&>Select a queue for your new ticket</&></h1> + +<dl> +% while (my $queue = $queues->Next) { +% next unless $queue->CurrentUserHasRight('CreateTicket'); + +<dt><a href="<%$RT::WebPath%>/SelfService/Create.html?Queue=<%$queue->id%>"><%$queue->Name%></a></dt> +<dd><%$queue->Description%></dd> +% } +</dl> +<%init> +my $queues = RT::Queues->new($session{'CurrentUser'}); +$queues->UnLimit; +</%init> diff --git a/rt/html/SelfService/Display.html b/rt/html/SelfService/Display.html index a94593e32..f7140df02 100644 --- a/rt/html/SelfService/Display.html +++ b/rt/html/SelfService/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('#[_1]: [_2]', $Ticket->id, $Ticket->Subject) &> <& /Elements/ListActions, actions => \@results &> @@ -54,6 +54,7 @@ title_class=> 'inverse', color => "#993333" &> <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> + <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> </TD> <TD VALIGN=TOP WIDTH="50%" class="boxcontainer"> @@ -69,7 +70,14 @@ %#!!pape: selfservice_find_attachments.patch {{ -<& /Ticket/Elements/ShowHistory, Ticket => $Ticket, AttachPath => "Attachment", Attachments => $attachments, UpdatePath => "Update.html" &> +<& /Ticket/Elements/ShowHistory, + Ticket => $Ticket, + URIFile => "Display.html", + ShowHeaders => $ARGS{'ShowHeaders'}, + AttachPath => "Attachment", + Attachments => $attachments, + UpdatePath => "Update.html" +&> %#!!pape: selfservice_find_attachments.patch }} @@ -85,6 +93,30 @@ my ( $field, @results ); my @id = ( ref $id eq 'ARRAY' ) ? @{$id} : ($id); my $Ticket = new RT::Ticket( $session{'CurrentUser'} ); + +# store the uploaded attachment in session +if ( $ARGS{'Attach'} ) { # attachment? + $session{'Attachments'} = {} unless defined $session{'Attachments'}; + + my $subject = "$ARGS{'Attach'}"; + + # since CGI.pm deutf8izes the magic field, we need to add it back. + Encode::_utf8_on($subject); + + # strip leading directories + $subject =~ s#^.*[\\/]##; + + my $attachment = MakeMIMEEntity( + Subject => $subject, + Body => "", + AttachmentFieldName => 'Attach' + ); + + $session{'Attachments'} = + { %{ $session{'Attachments'} || {} }, + $ARGS{'Attach'} => $attachment }; +} + if ( $id[0] eq 'new' ) { # {{{ Create a new ticket @@ -97,108 +129,87 @@ if ( $id[0] eq 'new' ) { unless ( $Queue->CurrentUserHasRight('CreateTicket') ) { $m->comp( 'Error.html', - Why => - loc('You have no permission to create tickets in that queue.') ); + Why => + loc('You have no permission to create tickets in that queue.') ); $m->abort; } - my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} ); - my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} ); - - my $MIMEObj = MakeMIMEEntity( Subject => $ARGS{'Subject'}, - From => $ARGS{'From'}, - Cc => $ARGS{'Cc'}, - Body => $ARGS{'Content'}, - AttachmentFieldName => 'Attach' ); - - #TODO in Create_Details.html: priorities and due-date - my ( $id, $Trans, $ErrMsg ) = $Ticket->Create( Queue => $ARGS{Queue}, - Requestor => \@Requestors, - Cc => \@Cc, - Subject => $ARGS{Subject}, - MIMEObj => $MIMEObj ); - unless ( $id && $Trans ) { - $m->comp( 'Error.html', Why => $ErrMsg ); - $m->abort(); - } - push ( @results, $ErrMsg ); + ( $Ticket, @results ) = + CreateTicket( Attachments => $session{'Attachments'}, %ARGS, Status => 'new' ); + + unless ( $Ticket->id ) { + $m->comp( 'Error.html', Why => join( "\n", @results )); + $m->abort(); + } + + # }}} + + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { + delete $session{'Attachments'}; + } + + # }}} + } + else { + unless ( $Ticket->Load( $id[0] ) ) { + $m->comp( 'Error.html', + Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + $m->abort(); + } + } # }}} -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} -} -else { - unless ( $Ticket->Load( $id[0] ) ) { + unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { $m->comp( 'Error.html', - Why => loc( "Couldn't load ticket '[_1]'", $id ) ); + Why => loc("No permission to display that ticket") ); $m->abort(); } -} -# }}} + my ( $code, $msg ); -unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) { - $m->comp( 'Error.html', - Why => loc("No permission to display that ticket") ); - $m->abort(); -} - -my ( $code, $msg ); - -#Update the status -if ( ( defined $ARGS{'Status'} ) and $ARGS{'Status'} - and ( $ARGS{'Status'} ne $Ticket->Status ) ) { - ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); - push @results, "$msg"; -} - -# {{{ store the uploaded attachment in session -if ($ARGS{'Attach'}) { # attachment? - $session{'Attachments'} = {} unless defined $session{'Attachments'}; + #Update the status + if ( ( defined $ARGS{'Status'} ) + and $ARGS{'Status'} + and ( $ARGS{'Status'} ne $Ticket->Status ) ) + { + ( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} ); + push @results, "$msg"; + } - my $subject = "$ARGS{'Attach'}"; - # since CGI.pm deutf8izes the magic field, we need to add it back. - Encode::_utf8_on($subject); - # strip leading directories - $subject =~ s#^.*[\\/]##; + # }}} - my $attachment = MakeMIMEEntity( - Subject => $subject, - Body => "", - AttachmentFieldName => 'Attach' + if ( + $session{'Attachments'} + || ( $ARGS{'UpdateContent'} ne '' + && $ARGS{'UpdateContent'} ne "-- \n" + . $session{'CurrentUser'}->UserObj->Signature ) + ) + { + $ARGS{UpdateAttachments} = $session{'Attachments'}; + } + ProcessUpdateMessage( + ARGSRef => \%ARGS, + Actions => \@results, + TicketObj => $Ticket ); - $session{'Attachments'} = { %{$session{'Attachments'} || {}}, - $ARGS{'Attach'} => $attachment }; -} -# }}} + # delete temporary storage entry to make WebUI clean + unless ( keys %{ $session{'Attachments'} } and $ARGS{'UpdateAttach'} ) { + delete $session{'Attachments'}; + } -if ( $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' - && $ARGS{'UpdateContent'} ne "-- \n" - . $session{'CurrentUser'}->UserObj->Signature )) { - $ARGS{UpdateAttachments} = $session{'Attachments'}; -} -ProcessUpdateMessage( ARGSRef => \%ARGS, - Actions => \@results, - TicketObj => $Ticket ); + my @cfupdates = ProcessObjectCustomFieldUpdates(Object => $Ticket, ARGSRef => \%ARGS); + push (@results, @cfupdates); -# delete temporary storage entry to make WebUI clean -unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) { - delete $session{'Attachments'}; -} -# }}} + # }}} -my $Transactions = $Ticket->Transactions; + my $Transactions = $Ticket->Transactions; -#!!pape: selfservice_find_attachments.patch {{ -my $attachments = $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket); -#!!pape: selfservice_find_attachments.patch }} + my $attachments = + $m->comp( '/Ticket/Elements/FindAttachments', Ticket => $Ticket ); </%INIT> diff --git a/rt/html/SelfService/Elements/GotoTicket b/rt/html/SelfService/Elements/GotoTicket index 265d69874..50efaa24e 100644 --- a/rt/html/SelfService/Elements/GotoTicket +++ b/rt/html/SelfService/Elements/GotoTicket @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,5 +42,5 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <FORM ACTION="<%$RT::WebPath%>/SelfService/Display.html"><input type=submit value="<&|/l&>Goto ticket</&>"> <input size=4 name=id></FORM> diff --git a/rt/html/SelfService/Elements/Header b/rt/html/SelfService/Elements/Header index 6fe2133ea..c7e6a9167 100644 --- a/rt/html/SelfService/Elements/Header +++ b/rt/html/SelfService/Elements/Header @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,6 +42,6 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, %ARGS, Prefs => '/SelfService/Prefs.html' &> <& /SelfService/Elements/Tabs, %ARGS &> diff --git a/rt/html/SelfService/Elements/MyRequests b/rt/html/SelfService/Elements/MyRequests index 026722a7f..2df8ce842 100644 --- a/rt/html/SelfService/Elements/MyRequests +++ b/rt/html/SelfService/Elements/MyRequests @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/TitleBoxStart, title => $title &> <TABLE BORDER=0 cellspacing=1 cellpadding=1 BGCOLOR="#eeeeee" WIDTH=100%> <TR> @@ -57,7 +57,7 @@ <a href="<%$RT::WebPath%>/SelfService/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: <%$Ticket->Subject%></a> </TD> <TD> -<%$Ticket->Status%> +<%loc($Ticket->Status)%> </TD><TD> <%$Ticket->OwnerObj->Name%> </TR> diff --git a/rt/html/SelfService/Elements/Tabs b/rt/html/SelfService/Elements/Tabs index dbe2109ce..802fd6525 100644 --- a/rt/html/SelfService/Elements/Tabs +++ b/rt/html/SelfService/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/PageLayout, current_toptab => $current_toptab, current_tab => $current_tab, @@ -67,12 +67,16 @@ my $tabs = { A => { title => loc('Open tickets'), path => 'SelfService/Closed.html', }, C => { title => loc('New ticket'), - path => 'SelfService/Create.html' - }, - Z => { title => loc('Preferences'), - path => 'SelfService/Prefs.html' + path => 'SelfService/CreateTicketInQueue.html' } }; +if ($session{'CurrentUser'}->HasRight( Right => 'ModifySelf', + Object => $RT::System )) { + $tabs->{Z} = { title => loc('Preferences'), + path => 'SelfService/Prefs.html' + }; +} + my $actions = { B => { html => $m->scomp('GotoTicket') } diff --git a/rt/html/SelfService/Error.html b/rt/html/SelfService/Error.html index b4cddee4f..8ac9f81ea 100644 --- a/rt/html/SelfService/Error.html +++ b/rt/html/SelfService/Error.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Error') &> <h2 class="title"><%loc('Error')%></h2> <& /Elements/TitleBoxStart, title => $Title &> diff --git a/rt/html/SelfService/Prefs.html b/rt/html/SelfService/Prefs.html index ce2165e22..3913203fb 100644 --- a/rt/html/SelfService/Prefs.html +++ b/rt/html/SelfService/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => loc('Preferences') &> <& /Elements/ListActions, actions => \@results &> diff --git a/rt/html/SelfService/Update.html b/rt/html/SelfService/Update.html index ef37684c9..816a610aa 100644 --- a/rt/html/SelfService/Update.html +++ b/rt/html/SelfService/Update.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,35 +42,62 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<& /SelfService/Elements/Header, Title =>loc('Update ticket #[_1]', $Ticket->id) &> +%# END BPS TAGGED BLOCK }}} +<& /SelfService/Elements/Header, + Title =>loc('Update ticket #[_1]', $Ticket->id) +&> <FORM ACTION="Display.html" METHOD=POST ENCTYPE="multipart/form-data"> <input type=hidden name="UpdateType" value="response"> - -<&|/l&>Status</&>: <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",$DefaultStatus) &><br> -<&|/l&>Subject</&>: <input name="UpdateSubject" size=60 value="Re: <% $Ticket->Subject %>"> <br> +<input TYPE="hidden" NAME="id" VALUE="<%$Ticket->Id%>"> <table> -<tr> + <tr> + <td class="label"> + <&|/l&>Status</&> + </td> + <td class="value"> + <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",loc($DefaultStatus)) &> + </td> + </tr> + <tr> + <td class="label"> + <&|/l&>Subject</&> + </td> + <td class="value"> + <input name="UpdateSubject" size=60 value="<% $Ticket->Subject %>"> + </td> + + </tr> % if (exists $session{'Attachments'}) { -<TD> -<&|/l&>Attached file</&>: -</TD> -<TD COLSPAN=5> -<&|/l&>Check box to delete</&><BR> +<tr> + <TD class="label"> + <&|/l&>Attached file</&> + </TD> + <TD COLSPAN=5 class="value"> + <&|/l&>Check box to delete</&><BR> % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR> + <input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> % } # end of foreach -</TD> + </TD> </TR> -<TR> % } # end of if -<tr><td align=right><&|/l&>Attach</&>:</td><td><input name="Attach" type="file"><input type="hidden" name="UpdateAttach" value="1"> -</td></tr> +<tr> + <td class"label"> + <&|/l&>Attach</&> + </td> + <td class="value"> + <input name="Attach" type="file"> + <input type="hidden" name="UpdateAttach" value="1"> + </td> + </tr> </table> -<& /Elements/MessageBox, Name=>"UpdateContent", QuoteTransaction=>$ARGS{QuoteTransaction} &> - <INPUT TYPE=HIDDEN NAME=id VALUE="<%$Ticket->Id%>"><br> +<& /Ticket/Elements/EditCustomFields, TicketObj => $Ticket &> +<& /Elements/MessageBox, + Name => "UpdateContent", + QuoteTransaction => $ARGS{QuoteTransaction} + &> + <br> <& /Elements/Submit &> @@ -82,14 +109,14 @@ my $Ticket = LoadTicket($id); -my $title = loc("Update ticket #[_1]", $Ticket->id); +my $title = loc( "Update ticket #[_1]", $Ticket->id ); $DefaultStatus = $Ticket->Status() unless ($DefaultStatus); -Abort(loc("No permission to view update ticket")) - unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') or - $Ticket->CurrentUserHasRight('ModifyTicket') ); +Abort( loc("No permission to view update ticket") ) + unless ( $Ticket->CurrentUserHasRight('ReplyToTicket') + or $Ticket->CurrentUserHasRight('ModifyTicket') ); </%INIT> diff --git a/rt/html/SelfService/index.html b/rt/html/SelfService/index.html index 234568c81..f3ccb8555 100644 --- a/rt/html/SelfService/index.html +++ b/rt/html/SelfService/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /SelfService/Elements/Header, Title => undef &> <& /SelfService/Elements/MyRequests &> diff --git a/rt/html/Ticket/Attachment/dhandler b/rt/html/Ticket/Attachment/dhandler index 27b88bd14..584fd721d 100644 --- a/rt/html/Ticket/Attachment/dhandler +++ b/rt/html/Ticket/Attachment/dhandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> my ($ticket, $trans,$attach, $filename); my $arg = $m->dhandler_arg; # get rest of path diff --git a/rt/html/Ticket/Create.html b/rt/html/Ticket/Create.html index fd2af45ff..b547242f2 100644 --- a/rt/html/Ticket/Create.html +++ b/rt/html/Ticket/Create.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,12 +42,12 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Create a new ticket") &> <& /Elements/Tabs, current_toptab => "Ticket/Create.html", Title => loc("Create a new ticket") &> -<FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data"> +<FORM ACTION="<%$RT::WebPath%>/Ticket/Create.html" METHOD="POST" ENCTYPE="multipart/form-data" NAME="TicketCreate"> <INPUT TYPE=HIDDEN Name="id" VALUE="new"> <A NAME="top"> @@ -113,6 +113,15 @@ <& /Ticket/Elements/EditCustomFields, QueueObj => $QueueObj &> </TD> </TR> +% if ($TxnCFs->Count) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } +% } <TR> % if (exists $session{'Attachments'}) { <TD class=label> @@ -121,7 +130,7 @@ <TD COLSPAN=5> <&|/l&>Check box to delete</&><BR> % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR> +<input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> % } # end of foreach </TD> </TR> @@ -228,7 +237,8 @@ $ARGS{Due}%>"></TD></TR> my $QueueObj = new RT::Queue($session{'CurrentUser'}); $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded.")); -my $CFs = $QueueObj->CustomFields(); +my $CFs = $QueueObj->TicketCustomFields(); +my $TxnCFs = $QueueObj->TicketTransactionCustomFields(); # if no due date has been set explicitly, then use the # queue's default if it exists diff --git a/rt/html/Ticket/Display.html b/rt/html/Ticket/Display.html index 745ed42d2..dd4c093dc 100644 --- a/rt/html/Ticket/Display.html +++ b/rt/html/Ticket/Display.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &> <& /Ticket/Elements/Tabs, @@ -58,6 +58,9 @@ <& /Elements/TitleBoxEnd &> <BR> + +<& /Elements/Callback, _CallbackName => 'BeforeShowHistory', Ticket => $TicketObj, %ARGS &> + <& /Ticket/Elements/ShowHistory , Ticket => $TicketObj, Tickets => $Tickets, @@ -124,10 +127,11 @@ if ($ARGS{'id'} eq 'new') { } } - $ARGS{'UpdateContent'} =~ s/\r\n/\n/g; + $ARGS{'UpdateContent'} =~ s/\r\n/\n/g if defined $ARGS{'UpdateContent'}; if ( $ARGS{'UpdateTimeWorked'} || $session{'Attachments'} || - ( $ARGS{'UpdateContent'} ne '' + ( defined $ARGS{'UpdateContent'} + && $ARGS{'UpdateContent'} ne '' && $ARGS{'UpdateContent'} ne "-- \n" . $session{'CurrentUser'}->UserObj->Signature )) { $ARGS{UpdateAttachments} = $session{'Attachments'}; diff --git a/rt/html/Ticket/Elements/AddWatchers b/rt/html/Ticket/Elements/AddWatchers index f70e86a17..98314b9d2 100644 --- a/rt/html/Ticket/Elements/AddWatchers +++ b/rt/html/Ticket/Elements/AddWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <BR> <%$msg%><br> diff --git a/rt/html/Ticket/Elements/BulkLinks b/rt/html/Ticket/Elements/BulkLinks index c071bd1cc..6a3859aa3 100644 --- a/rt/html/Ticket/Elements/BulkLinks +++ b/rt/html/Ticket/Elements/BulkLinks @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD class="label"><&|/l&>Merge into</&>:</TD> diff --git a/rt/html/Ticket/Elements/EditBasics b/rt/html/Ticket/Elements/EditBasics index 7ad4a63b0..715685153 100644 --- a/rt/html/Ticket/Elements/EditBasics +++ b/rt/html/Ticket/Elements/EditBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <td class="label"><&|/l&>Subject</&>:</td> @@ -84,7 +84,7 @@ <%INIT> #It's hard to do this inline, so we'll preload the html of the selectstatus in here. -my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",$TicketObj->Status)); +my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",loc($TicketObj->Status))); my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id); </%INIT> diff --git a/rt/html/Ticket/Elements/EditCustomField b/rt/html/Ticket/Elements/EditCustomField index 74e57ddf3..63687acd7 100644 --- a/rt/html/Ticket/Elements/EditCustomField +++ b/rt/html/Ticket/Elements/EditCustomField @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,55 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -% my $Values; -% if ($TicketObj) { -% $Values = $TicketObj->CustomFieldValues($CustomField->id); -% } -% if ($CustomField->Type eq 'FreeformSingle') { - <input name="<%$NamePrefix%><%$CustomField->Id%>-Value" - size="<%$Cols%>" -% if ($TicketObj) { - value="<%$Values->Count ? $Values->First->Content : ''%>" -% } elsif ($Default) { - value="<%$Default ? $Default : ''%>" -% } -> -% } elsif ($CustomField->Type eq 'FreeformMultiple') { -% my $content; -% if ($TicketObj) { -% while (my $value = $Values->Next ) { -% $content .= $value->Content; -% } -% } elsif ($Default) { - value="<%$Default ? $Default : ''%>" -% } -<input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1"> -<textarea cols=<%$Cols%> rows=<%$Rows%> name="<%$NamePrefix%><%$CustomField->Id%>-Values"><%$content%></textarea> -% } elsif ($CustomField->Type =~ /^Select/) { - <input type="hidden" name="<%$NamePrefix%><%$CustomField->Id%>-Values-Magic" value="1"> - <select name="<%$NamePrefix%><%$CustomField->Id%>-Values" - size="<%$Rows%>" - <%$CustomField->Type eq 'SelectMultiple' && 'MULTIPLE'%>> -% my $CustomFieldValues = $CustomField->Values(); -% my $selected; -% while (my $value = $CustomFieldValues->Next) { - <option value="<%$value->Name%>" -% if ($TicketObj) { - <% $Values->HasEntry($value->Name) && ($selected = 1) && 'SELECTED' %> -% } elsif ($Default) { - <% ($Default eq $value->Name) && ($selected = 1) && 'SELECTED' %> -% } - ><% $value->Name%></option> -% } - <option value="" <% !$selected && 'SELECTED' %>><&|/l&>(no value)</&></option> - </select> -% } -<%ARGS> -$TicketObj => undef -$CustomField => undef -$NamePrefix => undef -$Rows => 5 -$Cols=> 15 -$Default => undef -</%ARGS> +%# END BPS TAGGED BLOCK }}} +<%init> + +# RT 3.2 API compatibility glue + +$RT::Logger->debug("Ticket/Elements/EditCustomField is deprecated in RT 3.4 and will be removed in 3.6."); + +$ARGS{'NamePrefix'} =~ s/^Ticket-/Object-RT::Ticket-/; +$ARGS{'NamePrefix'} =~ s/^CustomField-/Object-RT::Ticket--CustomField-/; +$m->comp('/Elements/EditCustomField', %ARGS, Object=> $ARGS{'TicketObj'}); +</%init> diff --git a/rt/html/Ticket/Elements/EditCustomFields b/rt/html/Ticket/Elements/EditCustomFields index b049751ff..d566f4e71 100644 --- a/rt/html/Ticket/Elements/EditCustomFields +++ b/rt/html/Ticket/Elements/EditCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td valign="top" width="50%"> @@ -66,7 +66,11 @@ <b><%$CustomField->Name%></b><br> <i><%$CustomField->FriendlyType%></i> </td> - <td class="entry"><& EditCustomField, TicketObj => $TicketObj, CustomField => $CustomField, NamePrefix => $NamePrefix &></td> + <td class="entry"><& /Elements/EditCustomField, + Object => $TicketObj, + CustomField => $CustomField, + NamePrefix => $NamePrefix + &></td> </tr> % } </table> @@ -79,12 +83,12 @@ my $CustomFields; my $NamePrefix; if ($TicketObj) { - $CustomFields = $TicketObj->QueueObj->CustomFields(); - $NamePrefix = "Ticket-".$TicketObj->Id."-CustomField-"; + $CustomFields = $TicketObj->CustomFields(); + $NamePrefix = "Object-RT::Ticket-".$TicketObj->Id."-CustomField-"; } else { - $CustomFields = $QueueObj->CustomFields(); - $NamePrefix = "CustomField-"; + $CustomFields = $QueueObj->TicketCustomFields(); + $NamePrefix = "Object-RT::Ticket--CustomField-"; } diff --git a/rt/html/Ticket/Elements/EditDates b/rt/html/Ticket/Elements/EditDates index 8e12f2534..a19774192 100644 --- a/rt/html/Ticket/Elements/EditDates +++ b/rt/html/Ticket/Elements/EditDates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD class="label"><&|/l&>Starts</&>:</TD> diff --git a/rt/html/Ticket/Elements/EditPeople b/rt/html/Ticket/Elements/EditPeople index 4b2a1ac81..055d7ba20 100644 --- a/rt/html/Ticket/Elements/EditPeople +++ b/rt/html/Ticket/Elements/EditPeople @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD VALIGN=TOP> @@ -52,7 +52,7 @@ <& /Elements/SelectUsers &> <input type=submit name="OnlySearchForPeople" value="<&|/l&>Go!</&>"> <BR> -<&|/l&>Find group whose</&><BR> +<&|/l&>Find groups whose</&><BR> <& /Elements/SelectGroups &> <input type=submit name="OnlySearchForGroup" value="<&|/l&>Go!</&>"> diff --git a/rt/html/Ticket/Elements/EditWatchers b/rt/html/Ticket/Elements/EditWatchers index 19c884bd8..0089932f4 100644 --- a/rt/html/Ticket/Elements/EditWatchers +++ b/rt/html/Ticket/Elements/EditWatchers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <ul> %# Print out a placeholder if there are none. %if ($Members->Count == 0 ) { @@ -52,7 +52,7 @@ %while (my $watcher=$Members->Next) { <li> -<INPUT TYPE=CHECKBOX NAME="Ticket-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" UNCHECKED> +<INPUT TYPE=CHECKBOX NAME="Ticket-DeleteWatcher-Type-<%$Watchers->Type%>-Principal-<%$watcher->MemberId%>" value="1" UNCHECKED> %if ($watcher->MemberObj->IsUser) { <a href="<%$RT::WebPath%>/Admin/Users/Modify.html?id=<%$watcher->MemberObj->Object->id%>"> <%$watcher->MemberObj->Object->Name%></a> diff --git a/rt/html/Ticket/Elements/FindAttachments b/rt/html/Ticket/Elements/FindAttachments index a1e973f0e..017c77288 100755 --- a/rt/html/Ticket/Elements/FindAttachments +++ b/rt/html/Ticket/Elements/FindAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my %documents; @@ -63,11 +63,14 @@ $attachments->Join( ALIAS1 => 'main', my $tickets = $attachments->NewAlias('Tickets'); -$attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', - ALIAS2 => $tickets, - FIELD2 => 'id' ); - + $attachments->Join( ALIAS1 => $transactions, + FIELD1 => 'ObjectId', + ALIAS2 => $tickets, + FIELD2 => 'id' ); + + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); if ($Tickets) { while ($Ticket = $Tickets->Next) { $attachments->Limit( ALIAS => $tickets, diff --git a/rt/html/Ticket/Elements/LoadTextAttachments b/rt/html/Ticket/Elements/LoadTextAttachments index 370371b5a..943568fb3 100755 --- a/rt/html/Ticket/Elements/LoadTextAttachments +++ b/rt/html/Ticket/Elements/LoadTextAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> my $attachments = RT::Attachments->new( $session{'CurrentUser'} ); @@ -58,11 +58,17 @@ if ( $Ticket->CurrentUserHasRight('ShowTicket') ) { my $tickets = $attachments->NewAlias('Tickets'); + $attachments->Join( ALIAS1 => $transactions, - FIELD1 => 'Ticket', + FIELD1 => 'ObjectId', ALIAS2 => $tickets, FIELD2 => 'id' ); + $attachments->Limit( ALIAS => $transactions, + FIELD => 'ObjectType', + VALUE => 'RT::Ticket'); + + $attachments->Limit( ALIAS => $tickets, FIELD => 'EffectiveId', VALUE => $Ticket->id() ); diff --git a/rt/html/Ticket/Elements/PreviewScrips b/rt/html/Ticket/Elements/PreviewScrips index 846c62c24..a3492b749 100755 --- a/rt/html/Ticket/Elements/PreviewScrips +++ b/rt/html/Ticket/Elements/PreviewScrips @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $TicketObj => undef @@ -95,7 +95,7 @@ my @non_recipients = $TicketObj->SquelchMailTo; % foreach my $scrip (@{$Object->Scrips->Prepared}) { % next unless $scrip->ActionObj->Action->isa('RT::Action::SendEmail'); <b><%$scrip->Description%></b><br> -<&|/l, $scrip->ConditionObj->Name, $scrip->ActionObj->Name, $scrip->TemplateObj->Name&>[_1] [_2] with template [_3]</&> +<&|/l, loc($scrip->ConditionObj->Name), loc($scrip->ActionObj->Name), loc($scrip->TemplateObj->Name)&>[_1] [_2] with template [_3]</&> <br> %foreach my $type qw(To Cc Bcc) { %my @addresses = $scrip->ActionObj->Action->$type(); diff --git a/rt/html/Ticket/Elements/ShowAttachments b/rt/html/Ticket/Elements/ShowAttachments index 8a2a5cb3f..82028dd28 100644 --- a/rt/html/Ticket/Elements/ShowAttachments +++ b/rt/html/Ticket/Elements/ShowAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if (keys %documents) { <& /Elements/TitleBoxStart, title => loc('Attachments'), title_class=> 'inverse', @@ -82,8 +82,12 @@ if ($size) { % } <%INIT> -my %documents; +# If we haven't been passed in an Attachments object (through the precaching mechanism) +# then we need to find one +$Attachments ||= $m->comp('FindAttachments', Ticket => $Ticket); + +my %documents; while ( my $attach = $Attachments->Next() ) { next unless ($attach->Filename()); unshift( @{ $documents{ $attach->Filename } }, $attach ); diff --git a/rt/html/Ticket/Elements/ShowBasics b/rt/html/Ticket/Elements/ShowBasics index 55e923fa2..00ed3ccd1 100644 --- a/rt/html/Ticket/Elements/ShowBasics +++ b/rt/html/Ticket/Elements/ShowBasics @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td class="label"><&|/l&>Id</&>:</td> diff --git a/rt/html/Ticket/Elements/ShowCustomFields b/rt/html/Ticket/Elements/ShowCustomFields index 895439e1b..eb49212c5 100644 --- a/rt/html/Ticket/Elements/ShowCustomFields +++ b/rt/html/Ticket/Elements/ShowCustomFields @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,27 +42,8 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK -<table> -% my @entry_fields; -% while (my $CustomField = $CustomFields->Next()) { -% my $Values = $Ticket->CustomFieldValues($CustomField->Id); - <tr> - <td class="label"><%$CustomField->Name%>:</td> - <td class="value"> -% while (my $Value = $Values->Next()) { -<%$Value->Content%><br> -% } -% unless ($Values->Count()) { -<i><&|/l&>(no value)</&></i> -% } - </td> - </tr> -% } -</table> -<%INIT> -my $CustomFields = $Ticket->QueueObj->CustomFields(); -</%INIT> +%# END BPS TAGGED BLOCK }}} +<& /Elements/ShowCustomFields, Object => $Ticket &> <%ARGS> $Ticket => undef </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowDates b/rt/html/Ticket/Elements/ShowDates index a22a02d5c..2ccbb3fea 100644 --- a/rt/html/Ticket/Elements/ShowDates +++ b/rt/html/Ticket/Elements/ShowDates @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE> <TR> <TD class="label"><&|/l&>Created</&>:</TD> diff --git a/rt/html/Ticket/Elements/ShowDependencies b/rt/html/Ticket/Elements/ShowDependencies index d3bdd59bc..f276bc949 100644 --- a/rt/html/Ticket/Elements/ShowDependencies +++ b/rt/html/Ticket/Elements/ShowDependencies @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <&|/l&>Depends on</&>:<BR> % while (my $Link = $Ticket->DependsOn->Next) { % my $member = $Link->TargetObj; diff --git a/rt/html/Ticket/Elements/ShowGroupMembers b/rt/html/Ticket/Elements/ShowGroupMembers index 1d6e71182..1fdb79aab 100644 --- a/rt/html/Ticket/Elements/ShowGroupMembers +++ b/rt/html/Ticket/Elements/ShowGroupMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# Released under the terms of version 2 of the GNU Public License % my $UserMembers = $Group->UserMembersObj; diff --git a/rt/html/Ticket/Elements/ShowHistory b/rt/html/Ticket/Elements/ShowHistory index 37b670d82..75e34776f 100644 --- a/rt/html/Ticket/Elements/ShowHistory +++ b/rt/html/Ticket/Elements/ShowHistory @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> if ($ShowDisplayModes or $ShowTitle) { my $title; @@ -104,8 +104,8 @@ while ( my $Transaction = $Transactions->Next ) { $m->comp( 'ShowTransaction', %ARGS, - AttachPath => $AttachPath, - UpdatePath => $UpdatePath, + AttachPath => $AttachPath, + UpdatePath => $UpdatePath, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, @@ -116,6 +116,10 @@ while ( my $Transaction = $Transactions->Next ) { AttachmentContent => $trans_content, LastTransaction => $Transactions->IsLast ); + +# manually flush the content buffer after each txn, so the user sees +# some update +$m->flush_buffer(); } </%perl> @@ -127,9 +131,7 @@ while ( my $Transaction = $Transactions->Next ) { my $Transactions = new RT::Transactions($session{'CurrentUser'}); if ($Tickets) { while (my $t = $Tickets->Next) { - $Transactions->Limit(FIELD => 'Ticket', - OPERATOR => '=', - VALUE => $t->Id); + $Transactions->LimitToTicket($t->id); } } else { $Transactions = $Ticket->Transactions; @@ -153,5 +155,4 @@ $ShowDisplayModes => 1 $ShowTitleBarCommands => 1 $AttachPath => $RT::WebPath."/Ticket/Attachment" $UpdatePath => $RT::WebPath."/Ticket/Update.html" - </%ARGS> diff --git a/rt/html/Ticket/Elements/ShowMemberOf b/rt/html/Ticket/Elements/ShowMemberOf index eb285d34b..e443132bc 100644 --- a/rt/html/Ticket/Elements/ShowMemberOf +++ b/rt/html/Ticket/Elements/ShowMemberOf @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <UL> % my $memberof = $Ticket->MemberOf; % while (my $member_of = $memberof->Next) { -<LI><a href="/Ticket/Display.html?id=<%$member_of->Id%>"><%$member_of->Id%></a>: <%$member_of->Subject%> [<%$member_of->Status%>] +<LI><a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member_of->Id%>"><%$member_of->Id%></a>: <%$member_of->Subject%> [<%$member_of->Status%>] % } </UL> diff --git a/rt/html/Ticket/Elements/ShowMembers b/rt/html/Ticket/Elements/ShowMembers index 9802e8982..f4fec1c7c 100644 --- a/rt/html/Ticket/Elements/ShowMembers +++ b/rt/html/Ticket/Elements/ShowMembers @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if ($members->Count) { <UL> % while (my $link = $members->Next) { diff --git a/rt/html/Ticket/Elements/ShowMessageHeaders b/rt/html/Ticket/Elements/ShowMessageHeaders index 408b2c898..8dc76bae3 100644 --- a/rt/html/Ticket/Elements/ShowMessageHeaders +++ b/rt/html/Ticket/Elements/ShowMessageHeaders @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % use Data::Dumper; <table> % foreach my $header (@headers) { diff --git a/rt/html/Ticket/Elements/ShowMessageStanza b/rt/html/Ticket/Elements/ShowMessageStanza index 8b912612b..eaf551de9 100644 --- a/rt/html/Ticket/Elements/ShowMessageStanza +++ b/rt/html/Ticket/Elements/ShowMessageStanza @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} % if (ref($Message)) { <font color="<%$colors[$Depth]%>"> <%perl> @@ -57,7 +57,7 @@ foreach my $stanza (@$Message) { my $content = $stanza->{raw}; RT::Interface::Web::EscapeUTF8(\$content); $m->comp('/Elements/Callback', content => \$content, %ARGS); - $content =~ s/\n/<br>/gi; + $content =~ s/\n/<br>/gi if defined $content; </%perl> <%$content |n%><br> diff --git a/rt/html/Ticket/Elements/ShowPeople b/rt/html/Ticket/Elements/ShowPeople index 597a991d5..dbec93928 100644 --- a/rt/html/Ticket/Elements/ShowPeople +++ b/rt/html/Ticket/Elements/ShowPeople @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,11 +42,11 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <table> <tr> <td class="label"><&|/l&>Owner</&>:</td> - <td class="value"><%$Ticket->OwnerObj->Name%></td> + <td class="value"><& ShowUserEntry, User => $Ticket->OwnerObj &></td> </tr> <tr> <td class="labeltop"><&|/l&>Requestors</&>:</td> diff --git a/rt/html/Ticket/Elements/ShowReferences b/rt/html/Ticket/Elements/ShowReferences index e3639d01d..bb323f66c 100644 --- a/rt/html/Ticket/Elements/ShowReferences +++ b/rt/html/Ticket/Elements/ShowReferences @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <UL> % while (my $Link = $Ticket->RefersTo->Next) { <LI> % if ($Link->TargetURI->IsLocal) { % my $member = $Link->TargetObj; -<a href="/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> % } else { <A HREF="<%$Link->TargetURI->HREF%>"><%$Link->Target%></A> % } @@ -61,7 +61,7 @@ <LI> % if ($Link->BaseURI->IsLocal) { % my $member = $Link->BaseObj; -<a href="/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> +<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$member->Id%>"><%$member->Id%></a>: (<%$member->OwnerObj->Name%>) <%$member->Subject%> [<%$member->Status%>]<br> % } else { <A HREF="<%$Link->BaseURI->HREF%>"><%$Link->Base%></A> %} diff --git a/rt/html/Ticket/Elements/ShowRequestor b/rt/html/Ticket/Elements/ShowRequestor index cb9d7a6cc..421d38e0a 100644 --- a/rt/html/Ticket/Elements/ShowRequestor +++ b/rt/html/Ticket/Elements/ShowRequestor @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%PERL> my $rows = 10; my $people = $Ticket->Requestors->UserMembersObj; @@ -73,6 +73,11 @@ $tickets->OrderBy(FIELD => 'Priority', <LI><a href="<%$RT::WebPath%><%$DisplayPath%>?id=<%$w->id%>"><%$w->Id%>: <%$w->Subject%></a> (<%$w->Status%>) %} </UL> + +<&|/l&>Groups this user belongs to</&>:<BR> + +<& /Elements/ShowMemberships, UserObj => $requestor &> + <& /Elements/TitleBoxEnd &> % } diff --git a/rt/html/Ticket/Elements/ShowSummary b/rt/html/Ticket/Elements/ShowSummary index 5540417c7..31571400e 100644 --- a/rt/html/Ticket/Elements/ShowSummary +++ b/rt/html/Ticket/Elements/ShowSummary @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TABLE WIDTH="100%" class="ticketsummary" > <TR> <TD VALIGN=TOP WIDTH="50%" class="boxcontainer"> @@ -53,7 +53,7 @@ <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &> <& /Elements/TitleBoxEnd &> <br> -% if ($Ticket->QueueObj->CustomFields()->First) { +% if ($Ticket->QueueObj->TicketCustomFields->First) { <& /Elements/TitleBoxStart, title => loc('Custom Fields'), title_href =>"$RT::WebPath/Ticket/Modify.html?id=".$Ticket->Id, title_class=> 'inverse', diff --git a/rt/html/Ticket/Elements/ShowTransaction b/rt/html/Ticket/Elements/ShowTransaction index f0b8326cf..8bf589d45 100644 --- a/rt/html/Ticket/Elements/ShowTransaction +++ b/rt/html/Ticket/Elements/ShowTransaction @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,9 +42,9 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" > -<TD rowspan="2" valign="top" bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A><% $LastTransaction ? '<a name="lasttrans"> </a>' : ' ' |n %></TD> +<TD rowspan="2" valign="top" bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="<% $DisplayPath %>#txn-<%$Transaction->Id%>">#</A><% $LastTransaction ? '<a name="lasttrans"> </a>' : ' ' |n %></TD> <TD>  </TD> <TD><font size=-2><% $transdate|n %></font> </TD> % my $desc = $Transaction->BriefDescription; @@ -56,6 +56,9 @@ <TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD> </TR> <TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>"><TD colspan=5> +% if ($Transaction->CustomFieldValues->Count) { +<& /Elements/ShowCustomFields, Object => $Transaction &> +% } % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody); </TD> </TR> @@ -67,6 +70,7 @@ $ShowHeaders => 0 $Collapsed => undef $ShowTitleBarCommands => 1 $RowNum => 1 +$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id $AttachPath => $RT::WebPath."/Ticket/Attachment" $UpdatePath => $RT::WebPath."/Ticket/Update.html" $EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html" @@ -114,6 +118,7 @@ else { if ( $Ticket->Id != $Transaction->Ticket ) { $TicketString = "Ticket " . $Transaction->Ticket . ": "; } +$TicketString ||= ''; if ( $Transaction->TimeTaken != 0 ) { $TimeTaken = $Transaction->TimeTaken . " min"; diff --git a/rt/html/Ticket/Elements/ShowTransactionAttachments b/rt/html/Ticket/Elements/ShowTransactionAttachments index b01586deb..8dabff421 100644 --- a/rt/html/Ticket/Elements/ShowTransactionAttachments +++ b/rt/html/Ticket/Elements/ShowTransactionAttachments @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%perl> # Find all the attachments which have parent $Parent # For each of these attachments @@ -79,21 +79,24 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { } </%PERL> -<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&><%$message->Filename || loc('(untitled)') %></a> +<A HREF="<%$AttachPath%>/<%$Transaction->Id%>/<%$message->Id%>/<%$message->Filename | u%>"><&|/l&>Download</&> <%$message->Filename || loc('(untitled)') %></a> <div class="downloadcontenttype"> <%$message->ContentType%> <% $size %> </div> </div> -%} - +% } % # }}} <div class="messagebody"> <%perl> -# {{{ if it's got content-disposition inline, show it inline +# {{{ if it has a content-disposition: attachment, don't show inline +unless ( $message->GetHeader('Content-Disposition') =~ /attachment/i ) { + my $content; # If it's text - if ( $message->ContentType =~ m{^(text|message)}i ) { + if ( $message->ContentType =~ m{^(text|message)}i + && $size <= $RT::MaxInlineBody ) + { if ( @@ -127,7 +130,7 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) { $content = $m->comp( '/Elements/ScrubHTML', Content => $content ); - $m->out( $content ); + $m->out($content); } # if it's a text/plain show the body @@ -146,22 +149,24 @@ foreach my $message ( grep { $_->Parent == $Parent } @$Attachments ) { } } - # if it's an image, show it as an image - elsif ( $message->ContentType =~ /^image\//i ) { - $m->out('<img src="' - . $AttachPath . '/' - . $Transaction->Id . '/' - . $message->Id - . '/">' ); - } - - # }}} + # if it's an image, show it as an image + elsif ( $message->ContentType =~ /^image\//i ) { + $m->out('<img src="' + . $AttachPath . '/' + . $Transaction->Id . '/' + . $message->Id + . '/">' ); + } +} - $m->comp( 'ShowTransactionAttachments', %ARGS, - Parent => $message->id, - ParentObj => $message ); +# }}} +$m->comp( + 'ShowTransactionAttachments', %ARGS, + Parent => $message->id, + ParentObj => $message +); } </%PERL> diff --git a/rt/html/Ticket/Elements/ShowUserEntry b/rt/html/Ticket/Elements/ShowUserEntry index 38473fff9..163bcbdb1 100644 --- a/rt/html/Ticket/Elements/ShowUserEntry +++ b/rt/html/Ticket/Elements/ShowUserEntry @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} %# Released under the terms of version 2 of the GNU Public License <%$User->Name%> diff --git a/rt/html/Ticket/Elements/Tabs b/rt/html/Ticket/Elements/Tabs index 4f17d1024..1a5058691 100644 --- a/rt/html/Ticket/Elements/Tabs +++ b/rt/html/Ticket/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Callback, Ticket => $Ticket, actions=> $actions, tabs => $tabs, %ARGS &> <& /Elements/Tabs, tabs => $tabs, @@ -121,7 +121,7 @@ my $ticket_page_tabs = { path => "Ticket/ModifyLinks.html?id=" . $id, }, _F => { title => loc('Jumbo'), path => "Ticket/ModifyAll.html?id=" . $id, - seperator => 1 + separator => 1 }, }; @@ -187,6 +187,7 @@ my $args = "?" . $m->comp( Order => $ARGS{'Order'} || $session{'CurrentSearchHash'}->{'Order'}, Rows => $ARGS{'Rows'}, ) if ($ARGS{'Query'} or $session{'CurrentSearchHash'}->{'Query'}); +$args ||= ''; $tabs->{"f"} = { path => "Search/Build.html?NewQuery=1", title => loc('New Query')}; @@ -211,7 +212,7 @@ if (defined $session{'tickets'} and $session{'tickets'}->Count) { <%ARGS> $Ticket => undef $subtabs => undef -$current_tab => undef -$current_subtab => undef +$current_tab => '' +$current_subtab => '' $Title => undef </%ARGS> diff --git a/rt/html/Ticket/History.html b/rt/html/Ticket/History.html index faa6a29d5..a80cd0002 100644 --- a/rt/html/Ticket/History.html +++ b/rt/html/Ticket/History.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Ticket History # [_1] [_2]", $Ticket->Id, $Ticket->Subject) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, current_tab => 'Ticket/History.html?id='.$Ticket->id, diff --git a/rt/html/Ticket/Modify.html b/rt/html/Ticket/Modify.html index f567ff2b3..a6c316141 100644 --- a/rt/html/Ticket/Modify.html +++ b/rt/html/Ticket/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,14 +42,14 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify ticket #[_1]', $TicketObj->Id) &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, current_subtab => "Ticket/Modify.html?id=".$TicketObj->Id, Title => loc('Modify ticket #[_1]', $TicketObj->Id) &> <& /Elements/ListActions, actions => \@results &> -<FORM METHOD=POST ACTION="Modify.html"> +<FORM METHOD=POST ACTION="Modify.html" ENCTYPE="multipart/form-data"> <INPUT TYPE=HIDDEN NAME=id VALUE="<%$TicketObj->Id%>"> <& /Elements/TitleBoxStart, title => loc('Modify ticket #[_1]',$TicketObj->Id), color=> "#993333", width => "100%" &> @@ -62,13 +62,13 @@ <%INIT> my $TicketObj = LoadTicket($id); -my $CustomFields = $TicketObj->QueueObj->CustomFields(); +my $CustomFields = $TicketObj->QueueObj->TicketCustomFields(); # Now let callbacks have a chance at editing %ARGS $m->comp('/Elements/Callback', TicketObj => $TicketObj, CustomFields => $CustomFields, %ARGS); my @results = ProcessTicketBasics(TicketObj => $TicketObj, ARGSRef => \%ARGS); -my @cf_results = ProcessTicketCustomFieldUpdates(TicketObj => $TicketObj, ARGSRef => \%ARGS); +my @cf_results = ProcessObjectCustomFieldUpdates(Object => $TicketObj, ARGSRef => \%ARGS); push (@results, @cf_results); # TODO: display the results, even if we can't display the ticket diff --git a/rt/html/Ticket/ModifyAll.html b/rt/html/Ticket/ModifyAll.html index f78cddcf1..23cd93570 100644 --- a/rt/html/Ticket/ModifyAll.html +++ b/rt/html/Ticket/ModifyAll.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Ticket #[_1] Jumbo update: [_2]", $Ticket->Id, $Ticket->Subject) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, @@ -100,6 +100,17 @@ <td class="label"><&|/l&>Subject</&>:</td> <td class="entry"><input name="UpdateSubject" size=60 value="<%$Ticket->Subject%>"></td> </tr> +% if (my $TxnCFs = $Ticket->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD class="label"><% $CF->Name %>:</TD> +<TD class="entry"><& /Elements/EditCustomField, + CustomField => $CF, + NamePrefix => "Object-RT::Transaction--CustomField-" + &><em><% $CF->FriendlyType %></em></TD> +</TD></TR> +% } # end if while +% } # end of if <tr> <td class="label"><&|/l&>Attach</&>:</td> <td class="entry"><input name="UpdateAttachment" type=file></td> @@ -112,7 +123,9 @@ <& /Elements/TitleBoxEnd &> -<& /Elements/Submit, Label => loc('Save Changes'), Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> +<& /Elements/Submit, + Label => loc('Save Changes'), + Caption => loc("If you've updated anything above, be sure to"), color => "#333399" &> </form> <%INIT> @@ -136,8 +149,7 @@ my (@wresults, @results, @dresults, @lresults, @cf_results); unless ($OnlySearchForPeople) { @wresults = ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS); - @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); - @cf_results = ProcessTicketCustomFieldUpdates( TicketObj => $Ticket, ARGSRef => \%ARGS); + @cf_results = ProcessObjectCustomFieldUpdates( Object => $Ticket, ARGSRef => \%ARGS); @dresults = ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS); @lresults = ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS); @@ -159,15 +171,11 @@ unless ($OnlySearchForPeople) { $ARGS{'UpdateContent'} =~ s/\r+\n/\n/g; - if ($ARGS{'UpdateAttachments'} || ( - $ARGS{'UpdateContent'} && - $ARGS{'UpdateContent'} ne "-- \n" . - $session{'CurrentUser'}->UserObj->Signature - )) { - ProcessUpdateMessage(TicketObj => $Ticket, - ARGSRef=>\%ARGS, - Actions=>\@results); + if ($ARGS{'UpdateAttachments'} || ( $ARGS{'UpdateContent'} && $ARGS{'UpdateContent'} ne "-- \n" . + $session{'CurrentUser'}->UserObj->Signature)) { + ProcessUpdateMessage(TicketObj => $Ticket, ARGSRef=>\%ARGS, Actions=>\@results); } + @results = ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS); } push @results, @wresults; push @results, @dresults; diff --git a/rt/html/Ticket/ModifyDates.html b/rt/html/Ticket/ModifyDates.html index bf4bc7993..a4f68f2f5 100644 --- a/rt/html/Ticket/ModifyDates.html +++ b/rt/html/Ticket/ModifyDates.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify dates for #[_1]', $TicketObj->Id) &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, diff --git a/rt/html/Ticket/ModifyLinks.html b/rt/html/Ticket/ModifyLinks.html index 05d369d72..150597d89 100644 --- a/rt/html/Ticket/ModifyLinks.html +++ b/rt/html/Ticket/ModifyLinks.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Link ticket #[_1]", $Ticket->Id) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, diff --git a/rt/html/Ticket/ModifyPeople.html b/rt/html/Ticket/ModifyPeople.html index dde2d297d..61cbe6c27 100644 --- a/rt/html/Ticket/ModifyPeople.html +++ b/rt/html/Ticket/ModifyPeople.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc('Modify people related to ticket #[_1]', $Ticket->id) &> <& /Ticket/Elements/Tabs, Ticket => $Ticket, diff --git a/rt/html/Ticket/ShowEmailRecord.html b/rt/html/Ticket/ShowEmailRecord.html index 23eb6d5a0..38eddd3d2 100644 --- a/rt/html/Ticket/ShowEmailRecord.html +++ b/rt/html/Ticket/ShowEmailRecord.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%args> $Attachment => undef $Transaction => undef diff --git a/rt/html/Ticket/Update.html b/rt/html/Ticket/Update.html index e26d98830..df739c9c7 100644 --- a/rt/html/Ticket/Update.html +++ b/rt/html/Ticket/Update.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /Ticket/Elements/Tabs, Ticket => $TicketObj, @@ -58,7 +58,7 @@ <tr><td align=right><&|/l&>Status</&>:</td> <td> -<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->Status), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&> +<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", loc($TicketObj->Status)), Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&> <&|/l&>Owner</&>: <& /Elements/SelectOwner, Name=>"Owner", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj, Default => $ARGS{'Owner'} &> <&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr> @@ -94,19 +94,33 @@ value="<% $ARGS{UpdateCc} %>"><BR> <TD COLSPAN=5> <&|/l&>Check box to delete</&><BR> % foreach my $attach_name (keys %{$session{'Attachments'}}) { -<input type="checkbox" name="DeleteAttach-<%$attach_name%>"><%$attach_name%><BR> +<input type="checkbox" name="DeleteAttach-<%$attach_name%>" value="1"><%$attach_name%><BR> % } # end of foreach </TD> </TR> <TR> % } # end of if + +% if (my $TxnCFs = $TicketObj->TransactionCustomFields) { +% while (my $CF = $TxnCFs->Next()) { +<TR> +<TD ALIGN=RIGHT><% $CF->Name %>:</TD> +<TD><& /Elements/EditCustomField, CustomField => $CF, NamePrefix => + "Object-RT::Transaction--CustomField-" &><em><% $CF->FriendlyType %></em></TD> +</TR> +% } # end if while +% } # end of if + <tr><td align=right><&|/l&>Attach</&>:</td><td><input name="Attach" type="file"><INPUT TYPE=SUBMIT NAME="AddMoreAttach" VALUE="<&|/l&>Add More Files</&>"><input type="hidden" name="UpdateAttach" value="1"> </td></tr> <tr><td align="right" valign="top"><&|/l&>Message</&>:</td><td> <& /Elements/Callback, _CallbackName => 'BeforeMessageBox', %ARGS &> % if (exists $ARGS{UpdateContent}) { +% # preserve QuoteTransaction so we can use it to set up sane references/in/reply to +% my $temp = $ARGS{'QuoteTransaction'}; % delete $ARGS{'QuoteTransaction'}; <& /Elements/MessageBox, Name=>"UpdateContent", Default=>$ARGS{UpdateContent}, IncludeSignature => 0, %ARGS&> +% $ARGS{'QuoteTransaction'} = $temp; % } else { <& /Elements/MessageBox, Name=>"UpdateContent", %ARGS &> % } @@ -122,7 +136,6 @@ value="<% $ARGS{UpdateCc} %>"><BR> % } </FORM> <%INIT> - my $CanRespond = 0; my $CanComment = 0; my $title; @@ -168,6 +181,7 @@ foreach my $key (keys %ARGS) { } $session{'Attachments'} = { %{$session{'Attachments'} || {}} }; } +# }}} # {{{ store the uploaded attachment in session if ($ARGS{'Attach'}) { # attachment? @@ -180,7 +194,7 @@ if ($ARGS{'Attach'}) { # attachment? $subject =~ s#^.*[\\/]##; my $attachment = MakeMIMEEntity( - Subject => $subject, + Filename => $subject, Body => "", AttachmentFieldName => 'Attach' ); @@ -200,6 +214,7 @@ if ( exists $ARGS{SubmitTicket} ) { $m->comp('Display.html', TicketObj => $TicketObj, %ARGS); return; } + </%INIT> <%ARGS> diff --git a/rt/html/Tools/Elements/Tabs b/rt/html/Tools/Elements/Tabs index 39321f145..fc4153b98 100644 --- a/rt/html/Tools/Elements/Tabs +++ b/rt/html/Tools/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'Tools/Offline.html', diff --git a/rt/html/Tools/MyDay.html b/rt/html/Tools/MyDay.html index 3fe2eda21..a20209c9b 100644 --- a/rt/html/Tools/MyDay.html +++ b/rt/html/Tools/MyDay.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, title => "What I did today" &> (displaying new and open tickets for <%$session{'CurrentUser'}->Name%>) <FORM METHOD=POST ACTION="MyDay.html"> @@ -62,7 +62,7 @@ HREF="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%>: cols=60></textarea></TD></TR> <TR <%$class|n%>> <TD><SPAN CLASS="label">Status:</SPAN> <& /Elements/SelectStatus, Name=> 'UpdateStatus-'.$Ticket->Id, - DefaultLabel => loc("[_1] (Unchanged)",$Ticket->Status()) &></TD> + DefaultLabel => loc("[_1] (Unchanged)",loc($Ticket->Status())) &></TD> </TR> % } diff --git a/rt/html/Tools/Offline.html b/rt/html/Tools/Offline.html index 0879c94fc..8b12784e8 100644 --- a/rt/html/Tools/Offline.html +++ b/rt/html/Tools/Offline.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Offline upload") &> <& Elements/Tabs, current_tab => "Tools/Offline.html", diff --git a/rt/html/User/Delegation.html b/rt/html/User/Delegation.html index 47a5d13a2..3347fda1f 100644 --- a/rt/html/User/Delegation.html +++ b/rt/html/User/Delegation.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => loc("Delegate rights") &> <& /User/Elements/Tabs, current_tab => 'User/Delegation.html', diff --git a/rt/html/User/Elements/DelegateRights b/rt/html/User/Elements/DelegateRights index 112f3f6df..79ecb5977 100644 --- a/rt/html/User/Elements/DelegateRights +++ b/rt/html/User/Elements/DelegateRights @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <h2><%$sectionheading%></h2> <%perl> @@ -81,7 +81,7 @@ while ( my $delegation = $delegations->Next) { </td> % while (my $pg = $personalgroups->Next) { <td align=center> - <input name="Delegate-ACE-<% $right->Id %>-to-<% $pg->PrincipalId%>" type=checkbox <%$ del_hash->{$pg->PrincipalId} && 'CHECKED' %>> + <input name="Delegate-ACE-<% $right->Id %>-to-<% $pg->PrincipalId%>" type=checkbox value="1" <%$ del_hash->{$pg->PrincipalId} && 'CHECKED' %>> % if ( $del_hash->{$pg->PrincipalId}) { <input type=hidden name="Delegate-Existing-ACE-<% $right->Id %>-to-<% $pg->PrincipalId%>-as-<%$del_hash->{$pg->PrincipalId}->Id%>"> % } diff --git a/rt/html/User/Elements/GroupTabs b/rt/html/User/Elements/GroupTabs index 26d8e8512..2e79df268 100644 --- a/rt/html/User/Elements/GroupTabs +++ b/rt/html/User/Elements/GroupTabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /User/Elements/Tabs, subtabs => $tabs, current_tab => 'User/Groups/', diff --git a/rt/html/User/Elements/Tabs b/rt/html/User/Elements/Tabs index 6411be658..1d25fb926 100644 --- a/rt/html/User/Elements/Tabs +++ b/rt/html/User/Elements/Tabs @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Tabs, tabs => $tabs, current_toptab => 'User/Prefs.html', diff --git a/rt/html/User/Groups/Members.html b/rt/html/User/Groups/Members.html index 0b133b35b..2068e5a5b 100644 --- a/rt/html/User/Groups/Members.html +++ b/rt/html/User/Groups/Members.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, GroupObj => $Group, @@ -81,7 +81,7 @@ % $UserMembers->LimitToUsers(); <UL> % while (my $member = $UserMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) % } </ul> @@ -90,7 +90,7 @@ % my $GroupMembers = $Group->MembersObj; % $GroupMembers->LimitToGroups(); % while (my $member = $GroupMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>"> +<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> <%$member->MemberObj->Object->Name%> % } % } diff --git a/rt/html/User/Groups/Modify.html b/rt/html/User/Groups/Modify.html index e744e104d..c0e9ce575 100644 --- a/rt/html/User/Groups/Modify.html +++ b/rt/html/User/Groups/Modify.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, @@ -74,7 +74,7 @@ <INPUT TYPE=CHECKBOX NAME="Enabled" VALUE="1" <%$EnabledChecked%>> <&|/l&>Enabled (Unchecking this box disables this group)</&><BR> </TR> </TABLE> -<& /Elements/Submit, Label => loc('Create'), Reset => 1 &> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> </form> <%INIT> diff --git a/rt/html/User/Groups/index.html b/rt/html/User/Groups/index.html index d4fa7dfb5..6d2e15d47 100644 --- a/rt/html/User/Groups/index.html +++ b/rt/html/User/Groups/index.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title => $title &> <& /User/Elements/GroupTabs, current_subtab => 'User/Groups/index.html', diff --git a/rt/html/User/Prefs.html b/rt/html/User/Prefs.html index b5aa13db9..f1c755826 100644 --- a/rt/html/User/Prefs.html +++ b/rt/html/User/Prefs.html @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title=>loc("Preferences") &> <& /User/Elements/Tabs, current_tab => 'User/Prefs.html', @@ -165,7 +165,7 @@ %if ($UserObj->Privileged) { <BR> <& /Elements/TitleBoxStart, title => loc('Signature') &> -<TEXTAREA COLS=80 ROWS=5 name="Signature" WRAP=HARD> +<TEXTAREA COLS=80 ROWS=5 name="Signature" class="signature" WRAP=HARD> <%$UserObj->Signature%></TEXTAREA> <& /Elements/TitleBoxEnd &> % } @@ -210,9 +210,10 @@ if ($UserObj->Id) { Object => $UserObj, ARGSRef => \%ARGS ); if ($Lang) { - $session{'CurrentUser'}->LanguageHandle($Lang); - $session{'CurrentUser'}= $session{'CurrentUser'}; # Force writeback + $session{'CurrentUser'}->LanguageHandle($Lang); + $session{'CurrentUser'} = $session{'CurrentUser'}; # force writeback } + push (@results,@fieldresults); diff --git a/rt/html/autohandler b/rt/html/autohandler index b21d26145..c854c2b33 100644 --- a/rt/html/autohandler +++ b/rt/html/autohandler @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%INIT> # Roll back any dangling transactions from a previous failed connection @@ -61,21 +61,15 @@ if ($m->request_comp->attr_exists('AutoFlush')) { # passed just one, a scalar whatever they are, mark them as utf8 my $type = ref($_); (!$type) - ? Encode::decode(utf8 => $_, Encode::FB_PERLQQ) : + ? Encode::is_utf8($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) : ($type eq 'ARRAY') - ? [ map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] : + ? [ map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } @$_ ] : ($type eq 'HASH') - ? { map { ref($_) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_ + ? { map { (ref($_) or Encode::is_utf8($_)) ? $_ : Encode::decode(utf8 => $_, Encode::FB_PERLQQ) } %$_ } : $_ } %ARGS; -if ($ARGS{'Debug'}) { - require Time::HiRes; - $m->{'rt_base_time'} = [Time::HiRes::gettimeofday()]; +$m->{'rt_base_time'} = [Time::HiRes::gettimeofday()]; -} -else { - $m->{'rt_base_time'} = time; -} $m->comp('/Elements/SetupSessionCookie', %ARGS); unless ($session{'CurrentUser'} && $session{'CurrentUser'}->Id) { @@ -169,7 +163,7 @@ elsif ( $RT::WebExternalAuth ) { elsif ($RT::WebFallbackToInternalAuth) { unless (defined($session{'CurrentUser'})) { $m->comp('/Elements/Login', %ARGS, - Error=> loc('XXX CHANGEME You are not an authorized user')); + Error=> loc('You are not an authorized user')); $m->abort(); } } else { @@ -193,8 +187,8 @@ if (!$session{'CurrentUser'} && defined ($user) && defined ($pass) ){ if (!$session{'CurrentUser'}->id() || !$session{'CurrentUser'}->IsPassword($pass)) { - $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}"); delete $session{'CurrentUser'}; + $RT::Logger->error("FAILED LOGIN for $user from $ENV{'REMOTE_ADDR'}"); $m->comp('/Elements/Login', %ARGS, Error => loc('Your username or password is incorrect')); $m->abort(); diff --git a/rt/html/index.html b/rt/html/index.html index 8c64b5aeb..04d48ece6 100644 --- a/rt/html/index.html +++ b/rt/html/index.html @@ -24,11 +24,11 @@ If you need commercial support, please contact us at sales@bestpractical.com. <!-- % } -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -68,7 +68,7 @@ If you need commercial support, please contact us at sales@bestpractical.com. %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <& /Elements/Header, Title=>loc("RT at a glance"), Refresh => $session{'home_refresh_interval'} &> <& /Elements/Tabs, current_toptab => '', @@ -1,8 +1,8 @@ -%# {{{ BEGIN BPS TAGGED BLOCK +%# BEGIN BPS TAGGED BLOCK {{{ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -42,7 +42,7 @@ %# works based on those contributions, and sublicense and distribute %# those contributions and any derivatives thereof. %# -%# }}} END BPS TAGGED BLOCK +%# END BPS TAGGED BLOCK }}} <%init> my $hand = ($session{'CurrentUser'} ||= RT::CurrentUser->new)->LanguageHandle; $m->print($hand->maketext($m->content,@_)); |