-%#
-%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
-%# <jesse@bestpractical.com>
-%#
+%#
+%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+%# <sales@bestpractical.com>
+%#
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%# General Public License for more details.
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%# General Public License for more details.
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%# (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.)
%# (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
%# 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
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
-%# Action => me.html',
-%# Name => 'my-selection',
-%# Available => \@items,
+%# Action => me.html',
+%# Name => 'my-selection',
+%# Available => \@items,
-%# OnSubmit => sub { my $sel = shift; },
-%# Selected => \@selected);
+%# OnSubmit => sub { my $sel = shift; },
+%# Selected => \@selected);
%# <& /Widgets/SelectionBox:show, self => $sel &>
%#
%# if the SelectionBox is created with AutoSave option, OnSubmit will be called
%# <& /Widgets/SelectionBox:show, self => $sel &>
%#
%# if the SelectionBox is created with AutoSave option, OnSubmit will be called
-%# on every button clicked in non-js mode.
-<%method header>
-% unless ($nojs) {
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/class.js"></script>
-<script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/NoAuth/js/list.js"></script>
-% }
-<%ARGS>
-$nojs => 0
-</%ARGS>
-</%method>
-
+%# on every button clicked
- unless ($self->{ReadOnly}) {
- ++$self->{Modified};
- if ($ARGS{add}) {
- my $choosed = $ARGS{$self->{Name}.'-Available'};
- for my $add (ref($choosed) ? @$choosed : $choosed) {
- next if grep { $_ eq $add } @$current;
- push @$current, $add;
- }
+unless ($self->{ReadOnly}) {
+ ++$self->{Modified};
+ if ($ARGS{add}) {
+ my $choosed = $ARGS{$self->{Name}.'-Available'};
+ for my $add (ref($choosed) ? @$choosed : $choosed) {
+ next if grep { $_ eq $add } @$current;
+ push @$current, $add;
- if ($ARGS{remove}) {
- my $choosed = $ARGS{$self->{Name}.'-Selected'};
- for my $del (ref($choosed) ? @$choosed : $choosed) {
- @$current = map { $_ eq $del ? () : $_ } @$current;
- }
+ if ($ARGS{remove}) {
+ my $choosed = $ARGS{$self->{Name}.'-Selected'};
+ for my $del (ref($choosed) ? @$choosed : $choosed) {
+ @$current = map { $_ eq $del ? () : $_ } @$current;
- if ($ARGS{moveup} or $ARGS{movedown}) {
- my $offset = $ARGS{moveup} ? 1 : 0;
- my $choosed = $ARGS{$self->{Name}.'-Selected'};
- $choosed = [$choosed] unless ref ($choosed);
- my $canmove = 0; # not in the cornor
- for my $i ($ARGS{moveup} ? 0..$#{$current} : reverse 0..$#{$current}) {
- if (grep {$_ eq $current->[$i]} @$choosed) {
- if ($canmove) {
- splice (@$current, $i-$offset, 2,
- @{$current}[$i+1-$offset,$i-$offset]);
- }
- }
- else {
- ++$canmove;
- }
+ if ($ARGS{moveup} or $ARGS{movedown}) {
+ my $offset = $ARGS{moveup} ? 1 : 0;
+ my $choosed = $ARGS{$self->{Name}.'-Selected'};
+ $choosed = [$choosed] unless ref ($choosed);
+ my $canmove = 0; # not in the cornor
+ for my $i ($ARGS{moveup} ? 0..$#{$current} : reverse 0..$#{$current}) {
+ if (grep {$_ eq $current->[$i]} @$choosed) {
+ if ($canmove) {
+ splice (@$current, $i-$offset, 2,
+ @{$current}[$i+1-$offset,$i-$offset]);
+ }
+ }
+ else {
+ ++$canmove;
<input type="hidden" class="hidden" name="<% $self->{Name} %>-Submit" value="1" />
<& SelectionBox:current, self => $self &>
<input type="hidden" class="hidden" name="<% $self->{Name} %>-Submit" value="1" />
<& SelectionBox:current, self => $self &>
% for (@{$self->{Available}}) {
<option value="<% $_->[0] %>"><% $_->[1] %></option>
% }
</select>
% unless ($self->{ReadOnly}) {
% for (@{$self->{Available}}) {
<option value="<% $_->[0] %>"><% $_->[1] %></option>
% }
</select>
% unless ($self->{ReadOnly}) {
- <input name="moveup" type="submit" class="button" value=" ↑ " />
- <input name="movedown" type="submit" class="button" value=" ↓ " />
+ <input aria-label="Move up" name="moveup" type="submit" class="button" value=" ↑ " />
+ <input aria-label="Move down" name="movedown" type="submit" class="button" value=" ↓ " />