Bug 32485 - Add itemtype checkout message
Summary: Add itemtype checkout message
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Sam Lau
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-16 16:24 UTC by Lucas Gass (lukeg)
Modified: 2024-08-20 18:01 UTC (History)
6 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 32485: Schema Updates (DO NOT PUSH) (1.86 KB, patch)
2024-08-06 20:12 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32485: DB Updates (3.02 KB, patch)
2024-08-06 20:12 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32485: Add itemtype checkout message (7.58 KB, patch)
2024-08-06 20:12 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32485: Unit tests (1.62 KB, patch)
2024-08-06 20:12 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32485: Add checkout message to item types table and fix display location of checkout message (4.67 KB, patch)
2024-08-20 17:59 UTC, Sam Lau
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2022-12-16 16:24:28 UTC
For itemtypes we have checkinmsg. Some libraries would be interested in also having a checkout message that could be configured at the item type level.
Comment 1 Sara Brown 2022-12-16 16:26:15 UTC
+1

This would be really helpful when the message is the same for all items of the type vs. having to manually add a materials specified note to each applicable item!
Comment 2 Sam Lau 2024-08-06 20:12:39 UTC
Created attachment 170113 [details] [review]
Bug 32485: Schema Updates (DO NOT PUSH)
Comment 3 Sam Lau 2024-08-06 20:12:41 UTC
Created attachment 170114 [details] [review]
Bug 32485: DB Updates

Add new 'checkoutmsg' and 'checkoutmsgtype' columns to 'itemtypes'
Comment 4 Sam Lau 2024-08-06 20:12:43 UTC
Created attachment 170115 [details] [review]
Bug 32485: Add itemtype checkout message

These patches add new "Checkout message: " and "Checkout message type:" options for item types. When checking out an item, a dialog box appears with the desired message for that item type.

To test:
1) Apply patch, updatedatabase, dbic (for schema), restart_all
2) Visit Administration->Item types
3) Edit the book item type and enter a checkout message. Save your changes.
4) Checkout an item of type book to a patron
5) Your checkout message should be displayed
6) Go back to Admin->Item types, edit book, and then switch the 'Checkout message type:' to 'Alert'
7) Checkout another book item and note the dialog box is now an alert.
8) Checkout item of another type -> the message should not show
Comment 5 Sam Lau 2024-08-06 20:12:45 UTC
Created attachment 170116 [details] [review]
Bug 32485: Unit tests

prove t/Koha/ItemType.t
Comment 6 Roman Dolny 2024-08-10 09:30:45 UTC
Two notes after testing:
1. there is no "Checkout message" column in item types table (Administration->Item types),
2. probably checkout messages should be placed in messages section (id="messages") not in mainform (id="mainform").

QA script:
WARN   Koha/Schema/Result/Itemtype.pm
  WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 77, now: 86)

WARN   admin/itemtypes.pl
  WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 62, now: 66)

WARN   circ/circulation.pl
  WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 285, now: 290)

WARN   t/Koha/ItemType.t
  WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 0, now: 7)
Comment 7 Sam Lau 2024-08-20 17:59:33 UTC
Created attachment 170503 [details] [review]
Bug 32485: Add checkout message to item types table and fix display location of checkout message
Comment 8 Sam Lau 2024-08-20 18:01:21 UTC
(In reply to Roman Dolny from comment #6)

> 1. there is no "Checkout message" column in item types table
> (Administration->Item types),

Fixed this. 

> 2. probably checkout messages should be placed in messages section
> (id="messages") not in mainform (id="mainform").

Not exactly, that's included in messages.inc which is used in a lot of different places. However, I moved the dialog message/alert to the top of the screen, around where the messages div resides. 

> QA script:
> WARN   
These are all unrelated to my changes. 

However, still not ready for testing... noticed that checkin_message is utilized in SIP, thus, checkout message should probably be there too, so still some work to be done here.