We plan to use a specific item type to keep track of ILLs. The possibility to chose a message to display when returning specific item types would be highly useful to make sure that the ILLs isn't shelved at the local library. I imagine others could find other uses for it so building it as general as possible would be good.
Created attachment 19397 [details] [review] Bug 10513 - Light up 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. 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 - Check in an item with an item type that does *not* have a check in message, and make sure no false messages are displayed - 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
Created attachment 19398 [details] [review] Bug 10513 - Light up 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. 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 - Check in an item with an item type that does *not* have a check in message, and make sure no false messages are displayed - 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 Sponsored-by: Kultur i Halland - Regionbibliotek
Looks great! I do not however (yet) have a dev install to test it on, but I hope someone who does can give it spin.
Created attachment 19444 [details] [review] Bug 10513 - Light up 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. 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 - Check in an item with an item type that does *not* have a check in message, and make sure no false messages are displayed - 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 Sponsored-by: Kultur i Halland - Regionbibliotek Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Hi Magnus, I am sorry, but I found a bug: 1) (Major) You can no longer create new itemtypes, as we are missing a ?: [Sun Jul 14 10:58:14 2013] [error] [client 127.0.0.1] [Sun Jul 14 10:58:14 2013] itemtypes.pl: DBD::mysql::st execute failed: called with 7 bind variables when 6 are needed at /home/katrin/kohaclone/admin/itemtypes.pl line 174., referer: http://localhost:8080/cgi-bin/koha/admin/itemtypes.pl?op=add_form [Sun Jul 14 10:58:17 2013] [error] [client 127.0.0.1] File does not exist: /home/katrin/kohaclone/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/sudoc, referer: http://localhost:8080/cgi-bin/koha/admin/itemtypes.pl 2) (Trivial) Can you please add an AFTER summary to your database update?
Thanks for catching these, Katrin! I'm not sure I understand the second point, though. I have this in updatedatabase.pl: $DBversion = "3.13.00.XXX"; if ( CheckVersion($DBversion) ) { $dbh->do("ALTER TABLE itemtypes ADD COLUMN checkinmsg VARCHAR(255);"); print "Upgrade to $DBversion done (Bug 10513 - Light up a warning/message when returning a chosen item type)\n"; SetVersion($DBversion); }
In your updatedatabase SQL statement you don't specify where the new column should be added within the table - so it is theoretically possible that the sequence of columns ends up being different from the one in kohastructure.sql. To avoid this you can tell it specifically to add the new column after summary :)
Created attachment 19854 [details] [review] Bug 10513 - Light up 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. 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 - 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! Sponsored-by: Kultur i Halland - Regionbibliotek
When I tested this I found that I did not see the custom message if the item was on hold (prompting a hold message) or required a transfer (prompting a transfer message). Is this a bug, or is it by design?
(In reply to Owen Leonard from comment #9) > When I tested this I found that I did not see the custom message if the item > was on hold (prompting a hold message) or required a transfer (prompting a > transfer message). Is this a bug, or is it by design? Sounds like a bug to me. Corrected patch coming shortly.
Created attachment 19976 [details] [review] Bug 10513 - Light up 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
I added another enhancement to this patch: the ability to choose if the check in message should be displayed as an alert or a message. The check in messages are displayed without a heading, but if libraries want one, they can include HTML along these lines in the check in message it self: <h3>Warning!</h3><p>This is an ILL item, please return it to the owning library!</p>
Created attachment 20051 [details] [review] [SIGNED-OFF] Bug 10513 - Light up 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>
Created attachment 20925 [details] [review] [PASSED QA] Bug 10513 - Light up 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.
Pushed to master, along with a follow-up to add support for multiline checkin messages and a tweak to standardize labels on "checkin" rather than "check in" when used as an adjective. Thanks, Magnus!
Warning: with this change, sample imtemtypes can't load. See Bug 10965