Bug 20148: Prevent adding same user multiple times to acq basket

When adding a user to manage acquisitions basket, it is possible
to add the same user multiple times. Prevent that.

Test plan:

1) Go to Home -> Acquisitions -> [bookseller] -> [basket]
2) On the "Add user" in the Managed by-part, and try adding
   the same user multiple times.
3) Apply patch
4) Repeat 1 and 2. You should now get an error message saying
   the user is already in the list.

Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi>
Signed-off-by: Roch D'Amour <roch.damour@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Conflicts:
	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 757c9b4231)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Pasi Kallinen 2018-02-07 09:45:20 +02:00 committed by Fridolin Somers
parent ac54d831df
commit cdce1d8f39
1 changed files with 1 additions and 1 deletions

View File

@ -138,7 +138,7 @@
} else {
ids = new Array;
}
if (ids.indexOf(borrowernumber) < 0) {
if (ids.indexOf(borrowernumber.toString()) < 0) {
ids.push(borrowernumber);
$("#users_ids").val(ids.join(':'));
var li = '<li id="user_'+borrowernumber+'">'+borrowername