Bug 40659

Summary: Allow "My virtual card" format and content to be set using a Notices & Slips template
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: OPACAssignee: Lucas Gass (lukeg) <lucas>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: hebah, lucas
Version: Main   
Hardware: All   
OS: All   
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 40659: Add new notice VIRTUALCARD
Bug 40659: Add ability to customize OPACVirtualCard
Bug 40659: Add ability to customize OPACVirtualCard
Bug 40659: Close two divs in sample notice

Description Andrew Fuerste-Henry 2025-08-15 12:55:54 UTC
Libraries would like more flexibility in the virtual card shown to patrons via the OPAC. Making that virtual card use a notice template would make is highly customizable.
Comment 1 Lucas Gass (lukeg) 2025-10-09 16:10:36 UTC
Created attachment 187695 [details] [review]
Bug 40659: Add new notice VIRTUALCARD
Comment 2 Lucas Gass (lukeg) 2025-10-09 16:12:45 UTC
Created attachment 187696 [details] [review]
Bug 40659: Add ability to customize OPACVirtualCard
Comment 3 Lucas Gass (lukeg) 2025-10-09 16:28:56 UTC
Created attachment 187697 [details] [review]
Bug 40659: Add ability to customize OPACVirtualCard

To test:

1. Turn on the OPACVirtualCard.
2. Log in to the OPAC as a patron and go look at your Library card ( opac-virtual-card.pl )
3. APPLY PATCH, updatedatabase, restart_all
4. Go again at your patron's card on the OPAC ( opac-virtual-card.pl ), it should look exactly the same.
5. Go to Tools > Notices > VIRTUALCARD
6. You should see the default content for the library card.
7. Play around with different variables from borrower, like [% borrower.firstname%] and branches, like [% branch.branchcode %]
8. You can also move around the barcode by using the placeholder value [% my_barcode %].
9. Put the [% my_barcode %] variable anywhere you want in the notice then go to the sys pref "OPACVirtualCardBarcode".
10. Change to different barcode types and relaod the library card page ( opac-virtual-card.pl ). You should notice the barcode type is being honored.
11. Turn on OPACpatronimages AND patronimages, then upload a patron image for your patron.
12. Use the [% my_image %] variable anywhere you want in the notice to place the patron image.
13. Leaving the [% my_image %] variable as is, turn off OPACpatronimages.
14. Reload the OPAC page, no image should display.
15. Delete the VIRTUALCARD notice.
16. Go back to the OPAC page and with the notice deleted you should see the hardcoded content. ie: the page should look exactly the same as it does without this patch.
Comment 4 Andrew Fuerste-Henry 2025-10-09 20:42:19 UTC
Created attachment 187706 [details] [review]
Bug 40659: Close two divs in sample notice