Bug 10513: display a warning/message when returning a chosen item type
authorMagnus Enger <magnus@enger.priv.no>
Thu, 27 Jun 2013 20:22:18 +0000 (22:22 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 16 Sep 2013 17:45:31 +0000 (17:45 +0000)
commit9dca7096c89bef81c3a4cfb46df788e65818e86b
tree4d9fa9e4e40f761cbfd50cb9f796f3fa813b6bb4
parent7c82fe1a670892b07f426f356c67bc3cd60a37f3
Bug 10513: display a warning/message when returning a chosen item type

This patch adds a new column to item types. Text in this column is
displayed as a warning when an item of the given type is checked in.
The type of message can also be chosen, affecting how the message is
displayed.

Use case: Items that are on inter-library loan can have a separate
item type, and when items of this type are checked in a message
saying something like "ILL! Remember to return it to the owning
library!" can be displayed.

To test:
- Apply the patch
- Go to Home > Administration > Item types administration
- Check that there is a new column, called "Check in message"
- Edit an item type and add a check in message
- Check that the check in message you added is displayed in the table
- Check in an item with an item type that has a check in message
- Check that the message is displayed
- Repeat the steps above, but select "Alert" instead of the default
  "Message" as the "Check in message type". Check that the message
  is displayed in a yellow alert box, not a blue message box.
- Check in an item with an item type that does *not* have a check
  in message, and make sure no false messages are displayed
- Create a new item type from scratch and check that it works
  the way it is supposed to
- Run the tests in t/ItemType.t, which are updated by this patch

This patch also removes backticks around column names in the
itemtypes table in installer/data/mysql/kohastructure.sql

UPDATE 2013-07-22
- Rebased on current master (no changes)
- Added "AFTER summary" to the SQL statement in updatedatabase.pl
- Added another placeholder on line 170 of admin/itemtypes.pl
Thanks Katrin!

UPDATE 2013-07-29
- Make this message independent of all other messages - thanks Owen!
- Make it possible to choose the type of message ("alert" or
  "message")

Sponsored-by: Kultur i Halland - Regionbibliotek
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed some tabs to make the QA script happy.
All old and new tests pass.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
C4/ItemType.pm
admin/itemtypes.pl
circ/returns.pl
installer/data/mysql/kohastructure.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
t/ItemType.t