Bugzilla – Attachment 170115 Details for
Bug 32485
Add itemtype checkout message
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32485: Add itemtype checkout message
Bug-32485-Add-itemtype-checkout-message.patch (text/plain), 7.58 KB, created by
Sam Lau
on 2024-08-06 20:12:43 UTC
(
hide
)
Description:
Bug 32485: Add itemtype checkout message
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-08-06 20:12:43 UTC
Size:
7.58 KB
patch
obsolete
>From 4d60e7df17321c3f2e2dcd902b88d07c40bfc10d Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Tue, 6 Aug 2024 19:24:52 +0000 >Subject: [PATCH] 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 >--- > Koha/ItemType.pm | 2 ++ > admin/itemtypes.pl | 16 +++++++++++----- > circ/circulation.pl | 5 +++++ > .../prog/en/modules/admin/itemtypes.tt | 19 +++++++++++++++++++ > .../prog/en/modules/circ/circulation.tt | 10 ++++++++++ > 5 files changed, 47 insertions(+), 5 deletions(-) > >diff --git a/Koha/ItemType.pm b/Koha/ItemType.pm >index fb88518c25..024d68452e 100644 >--- a/Koha/ItemType.pm >+++ b/Koha/ItemType.pm >@@ -224,6 +224,8 @@ sub to_api_mapping { > return { > checkinmsg => 'checkin_message', > checkinmsgtype => 'checkin_message_type', >+ checkoutmsg => 'checkout_message', >+ checkoutmsgtype => 'checkout_message_type', > defaultreplacecost => 'default_replacement_cost', > hideinopac => 'hide_in_opac', > imageurl => 'image_url', >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 684f9377db..507feedcd6 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -90,11 +90,13 @@ if ( $op eq 'add_form' ) { > $image eq 'remoteImage' ? $input->param('remoteImage') > : $image > ); >- my $summary = $input->param('summary'); >- my $checkinmsg = $input->param('checkinmsg'); >- my $checkinmsgtype = $input->param('checkinmsgtype'); >- my $hideinopac = $input->param('hideinopac') // 0; >- my $searchcategory = $input->param('searchcategory'); >+ my $summary = $input->param('summary'); >+ my $checkinmsg = $input->param('checkinmsg'); >+ my $checkinmsgtype = $input->param('checkinmsgtype'); >+ my $checkoutmsg = $input->param('checkoutmsg'); >+ my $checkoutmsgtype = $input->param('checkoutmsgtype'); >+ my $hideinopac = $input->param('hideinopac') // 0; >+ my $searchcategory = $input->param('searchcategory'); > my $rentalcharge_daily_calendar = $input->param('rentalcharge_daily_calendar') // 0; > my $rentalcharge_hourly_calendar = $input->param('rentalcharge_hourly_calendar') // 0; > my $automatic_checkin = $input->param('automatic_checkin') // 0; >@@ -112,6 +114,8 @@ if ( $op eq 'add_form' ) { > $itemtype->summary($summary); > $itemtype->checkinmsg($checkinmsg); > $itemtype->checkinmsgtype($checkinmsgtype); >+ $itemtype->checkoutmsg($checkoutmsg); >+ $itemtype->checkoutmsgtype($checkoutmsgtype); > $itemtype->sip_media_type($sip_media_type); > $itemtype->hideinopac($hideinopac); > $itemtype->searchcategory($searchcategory); >@@ -145,6 +149,8 @@ if ( $op eq 'add_form' ) { > summary => $summary, > checkinmsg => $checkinmsg, > checkinmsgtype => $checkinmsgtype, >+ checkoutmsg => $checkoutmsg, >+ checkoutmsgtype => $checkoutmsgtype, > sip_media_type => $sip_media_type, > hideinopac => $hideinopac, > searchcategory => $searchcategory, >diff --git a/circ/circulation.pl b/circ/circulation.pl >index acabfa4d1d..37d408f914 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -517,6 +517,11 @@ if (@$barcodes && $op eq 'cud-checkout') { > recall_id => $recall_id, > } > ); >+ my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype ); >+ if ( $itemtype && $itemtype->checkoutmsg ) { >+ $template_params->{checkoutmsg} = $itemtype->checkoutmsg; >+ $template_params->{checkoutmsgtype} = $itemtype->checkoutmsgtype; >+ } > $template_params->{issue} = $issue; > $session->clear('auto_renew'); > $inprocess = 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index b9ea060e30..0942f3060f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -318,6 +318,25 @@ > [% END %] > </select> > </li> >+ <li> >+ <label for="checkoutmsg">Checkout message: </label> >+ <textarea id="checkoutmsg" name="checkoutmsg" cols="55" rows="5">[% itemtype.checkoutmsg | html %]</textarea> >+ </li> >+ <li> >+ <label for="checkoutmsgtype">Checkout message type: </label> >+ <select id="checkoutmsgtype" name="checkoutmsgtype"> >+ [% IF itemtype.checkoutmsgtype == 'message' %] >+ <option value="message" selected="selected">Message</option> >+ [% ELSE %] >+ <option value="message">Message</option> >+ [% END %] >+ [% IF itemtype.checkoutmsgtype == 'alert' %] >+ <option value="alert" selected="selected">Alert</option> >+ [% ELSE %] >+ <option value="alert">Alert</option> >+ [% END %] >+ </select> >+ </li> > <li> > <label for="sip_media_type">SIP media type: </label> > <select id="sip_media_type" name="sip_media_type"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index e596daec91..70ff32632c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -880,6 +880,16 @@ > </p> > </div> > [% END %] >+ >+ [% IF ( checkoutmsg ) %] >+ [% IF ( checkoutmsgtype == 'alert' ) %] >+ <div class="dialog alert" style="margin: 1em 0;"> >+ [% ELSE %] >+ <div class="dialog message" style="margin: 1em 0;"> >+ [% END %] >+ <p class="ret_checkoutmsg">[% checkoutmsg | html_line_break %]</p> >+ </div> >+ [% END # /IF checkoutmsg %] > </form> <!-- /#mainform --> > </div> <!-- /.col-sm-6 --> > >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32485
:
170113
|
170114
| 170115 |
170116
|
170503