Bug 13943: Prevent the deletion of items if the user cancels
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 13 Jul 2015 16:34:53 +0000 (17:34 +0100)
committerChris Cormack <chris@bigballofwax.co.nz>
Tue, 22 Sep 2015 01:35:04 +0000 (13:35 +1200)
commiteb8a20b2b77549b5afd530e58208a78ef68e295a
tree15fe2b34e7b090de5cf4378122596733ceb4930b
parent27ba1a6fa1a5be170d9bf04747f31caab15766b1
Bug 13943: Prevent the deletion of items if the user cancels

On the edit items page, there is some weird JS code: if the user clicks
on the delete link and then cancel, the item is deleted anyway.

It's caused by the following JS code in browser.js
  $('a[href*="biblionumber="]').click(function (ev) {
      ev.preventDefault();
      window.location = $(this).attr('href') + '&searchid=' + me.searchid;
  });

Test plan:
- Do a search with multiple results
- Go to the detail page (make sure results browser shows up!)
- Use the "Edit items" link from the toolbar
- Delete an item (try both way)
- Choose "cancel"
- Delete an item (try both way) and confirm the deletion
You should see the browser after the deletion and the item should have
been deleted correctly.
- Edit an item (try both way)
You should see the browser (did not work before this patch)

Note: Before this patch, the 2 first columns didn't contain the
edit/delete item links, now it's only the 1st one.

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Much better!
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f7214859df15abfe874141bcc1a32b57067f7c54)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt