Bug 9780: restrict the ability to delete a bib record associated with an order
authorMathieu Saby <mathieu.saby@univ-rennes2.fr>
Thu, 19 Sep 2013 12:12:02 +0000 (14:12 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 23:58:40 +0000 (23:58 +0000)
commitb693ea0cd8bd7b781eb43e6ee8bfc8883d8832cb
tree7d9ffbe75c422e231a47d5e6b6df41c0878ec9d1
parentc4c5496ec656ee4745587b3cea239cc849d2c09a
Bug 9780: restrict the ability to delete a bib record associated with an order

Currently, anyone can delete a record used in an order.

With this patch, only librarians with managing order permission
can delete it if it is used in an active or a deleted order.

This patch also add a specific warning informing that deleting a record
used in an active order is dangerous.

To test :
A. test what can do and see a librarian with order managing rights
0) Connect to Koha with a borrower with order managing rights
1) in a basket, create 2 orders A & B from new records
2) delete order B
3) in the catalogue, try to delete
- record used for order A : you should see a specific warning
   informing you the record is used in 1 order, and that deleting it
   is dangerous
- record used for order B : you should see a specific warning informing
  you the record is used in 1 deleted order
- a record not used in any order : you should see no specific warning

B. test what can do and see a librarian without order managing rights
4) Connect to Koha with a borrower without order managing rights
5) in a basket, create 2 orders A & B from new records
6) delete order B
7) in the catalogue, try to delete
- record used for order A : you should see a specific warning informing you that
   you need specific rights to delete the record
- record used for order B : idem
- a record not used in any order : you should see no specific warning

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc