Bugzilla – Attachment 191555 Details for
Bug 41649
Add support for setting the magnetic media flag for SIP in Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 41649: Add option to set magnetic flag for item itemtypes
2d674ef.patch (text/plain), 4.06 KB, created by
Martin Renvoize (ashimema)
on 2026-01-16 08:17:27 UTC
(
hide
)
Description:
Bug 41649: Add option to set magnetic flag for item itemtypes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-01-16 08:17:27 UTC
Size:
4.06 KB
patch
obsolete
>From 2d674efbe7911bf85b5c3cdc10f5df26027303d5 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Fri, 16 Jan 2026 08:03:49 +0000 >Subject: [PATCH] Bug 41649: Add option to set magnetic flag for item itemtypes > >This patch adds the ability to set an item type as magentic for SIP >response purposes. > >Test plan: >1) Run included database updates >2) Navigate to admin > itemtypes >3) Edit/Add an itemtype and scroll to the 'Sip media types' input >4) A new 'Sip magnetic' checkbox should be available >5) Confirm setting/unsetting it works as expected >6) The SIP magnetic flag bit should respect the setting >--- > C4/SIP/ILS/Item.pm | 4 +--- > admin/itemtypes.pl | 3 +++ > .../intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 9 +++++++++ > 3 files changed, 13 insertions(+), 3 deletions(-) > >diff --git a/C4/SIP/ILS/Item.pm b/C4/SIP/ILS/Item.pm >index 36d505c3969..f2b2cb17b25 100644 >--- a/C4/SIP/ILS/Item.pm >+++ b/C4/SIP/ILS/Item.pm >@@ -108,9 +108,7 @@ sub new { > my $itemtype = Koha::Database->new()->schema()->resultset('Itemtype')->find($it); > if ($itemtype) { > $self->{sip_media_type} = $itemtype->sip_media_type; >- if ( defined( $self->{sip_media_type} ) && $self->{sip_media_type} =~ m/^(00[4578]|010)/ ) { >- $self->{magnetic_media} = 1; >- } >+ $self->{magnetic_media} = $itemtype->sip_magnetic; > } > > # check if its on issue and if so get the borrower >diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl >index 342639da408..c098b33e72d 100755 >--- a/admin/itemtypes.pl >+++ b/admin/itemtypes.pl >@@ -52,6 +52,7 @@ my $dbh = C4::Context->dbh; > > my $sip_media_type = $input->param('sip_media_type'); > undef($sip_media_type) if defined($sip_media_type) and $sip_media_type =~ /^\s*$/; >+my $sip_magnetic = $input->param('sip_magnetic') ? 1 : 0; > > if ( $op eq 'add_form' ) { > my $itemtype = Koha::ItemTypes->find($itemtype_code); >@@ -115,6 +116,7 @@ if ( $op eq 'add_form' ) { > $itemtype->checkinmsg($checkinmsg); > $itemtype->checkinmsgtype($checkinmsgtype); > $itemtype->sip_media_type($sip_media_type); >+ $itemtype->sip_magnetic($sip_magnetic); > $itemtype->hideinopac($hideinopac); > $itemtype->searchcategory($searchcategory); > $itemtype->rentalcharge_daily_calendar($rentalcharge_daily_calendar); >@@ -150,6 +152,7 @@ if ( $op eq 'add_form' ) { > checkinmsg => $checkinmsg, > checkinmsgtype => $checkinmsgtype, > sip_media_type => $sip_media_type, >+ sip_magnetic => $sip_magnetic, > hideinopac => $hideinopac, > searchcategory => $searchcategory, > rentalcharge_daily_calendar => $rentalcharge_daily_calendar, >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 53e0757b5dc..a9dc4cfec2e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -342,6 +342,15 @@ > [% END %] > </select> > </li> >+ <li> >+ <label for="magnetic">SIP magnetic flag: </label> >+ [% IF itemtype.magnetic %] >+ <input type="checkbox" id="magnetic" name="magnetic" checked="checked" value="1" /> >+ [% ELSE %] >+ <input type="checkbox" id="magnetic" name="magnetic" value="1" /> >+ [% END %] >+ <span class="hint">If checked, items of this type are flagged as magnetic media for SIP responses.</span> >+ </li> > <li> > <label for="library_limitation">Library limitation: </label> > <select id="library_limitation" name="branches" multiple size="10"> >-- >2.52.0 >
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 41649
:
191552
|
191553
|
191554
| 191555 |
191556