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
7) To test SIP functionality:
a) Start the SIP server (e.g., koha-sip service)
b) Create an item with an itemtype that has sip_magnetic checked
c) Use misc/sip_cli_emulator.pl to send a checkout request:
perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su <sip_username> -sp <sip_password> -l <location_code> --patron <patron_cardnumber> --password <patron_password> --item <item_barcode> -m checkout
d) Check the SIP response to ensure it handles magnetic media correctly (e.g., no desensitization flag)
Sponsored-by: OpenFifth <https://openfifth.co.uk/>
Signed-off-by: Marcus Michel <marcus.michel@rbkc.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
06bf94d455
commit
df7e600587
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -51,6 +51,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);
|
||||
|
|
@ -112,6 +113,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);
|
||||
|
|
@ -146,6 +148,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,
|
||||
|
|
|
|||
|
|
@ -77,6 +77,11 @@ properties:
|
|||
type:
|
||||
- string
|
||||
- "null"
|
||||
sip_magnetic:
|
||||
description: Whether this item type is magnetic media for SIP2 purposes
|
||||
type:
|
||||
- boolean
|
||||
- "null"
|
||||
hide_in_opac:
|
||||
description: Hide the item type from the search options in OPAC
|
||||
type: boolean
|
||||
|
|
|
|||
|
|
@ -338,6 +338,15 @@
|
|||
[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label for="sip_magnetic">SIP magnetic flag: </label>
|
||||
[% IF itemtype.sip_magnetic %]
|
||||
<input type="checkbox" id="sip_magnetic" name="sip_magnetic" checked="checked" value="1" />
|
||||
[% ELSE %]
|
||||
<input type="checkbox" id="sip_magnetic" name="sip_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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue