Bugzilla – Attachment 109630 Details for
Bug 26370
Add ability to disable demagnetizing items via SIP2 based on patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26370: Add ability to disable demagnetizing items via SIP2 for arbitrary patron categories
Bug-26370-Add-ability-to-disable-demagnetizing-ite.patch (text/plain), 2.25 KB, created by
Kyle M Hall (khall)
on 2020-09-03 14:42:05 UTC
(
hide
)
Description:
Bug 26370: Add ability to disable demagnetizing items via SIP2 for arbitrary patron categories
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2020-09-03 14:42:05 UTC
Size:
2.25 KB
patch
obsolete
>From a5f780c219fd80dc88f7d27317aff66d26452f88 Mon Sep 17 00:00:00 2001 >From: Larry Baerveldt <larry@bywatersolutions.com> >Date: Fri, 6 May 2016 12:32:11 -0700 >Subject: [PATCH] Bug 26370: Add ability to disable demagnetizing items via > SIP2 for arbitrary patron categories > >Some libraries have certain patron categories that can only do in house checkouts via SIP self check machines. >In these cases, the items should not be demagnetized since the items cannot leave the library. >--- > C4/SIP/Sip/MsgType.pm | 27 +++++++++++++++++++++++++-- > 1 file changed, 25 insertions(+), 2 deletions(-) > >diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm >index d9f8901c06..0560e3f70a 100644 >--- a/C4/SIP/Sip/MsgType.pm >+++ b/C4/SIP/Sip/MsgType.pm >@@ -552,7 +552,7 @@ sub handle_checkout { > } > > # We never return the obsolete 'U' value for 'desensitize' >- $resp .= sipbool( $status->desensitize ); >+ $resp .= sipbool( desensitize( { status => $status, patron => $patron, server => $server } ) ); > $resp .= timestamp; > > # Now for the variable fields >@@ -1447,7 +1447,7 @@ sub handle_renew { > } else { > $resp .= 'U'; > } >- $resp .= sipbool( $status->desensitize ); >+ $resp .= sipbool( desensitize( { status => $status, patron => $patron, server => $server } ) ); > $resp .= timestamp; > $resp .= add_field( FID_PATRON_ID, $patron->id, $server ); > $resp .= add_field( FID_ITEM_ID, $item->id, $server ); >@@ -1688,6 +1688,29 @@ sub api_auth { > return $status; > } > >+sub desensitize { >+ my ($params) = @_; >+ >+ my $status = $params->{status}; >+ my $desensitize = $status->desensitize(); >+ >+ # If desenstize is already false, no need to do anything >+ return unless $desensitize; >+ >+ my $patron = $params->{patron}; >+ my $server = $params->{server}; >+ >+ my $patron_categories = $server->{account}->{never_demagnitize}; >+ >+ # If no patron categories are set for never desensitize, no need to do anything >+ return $desensitize unless $patron_categories; >+ >+ my $patron_category = $patron->ptype(); >+ my @patron_categories = split( /,/, $patron_categories ); >+ >+ return !grep( /^$patron_category$/, @patron_categories ); >+} >+ > 1; > __END__ > >-- >2.24.1 (Apple Git-126)
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 26370
:
109630
|
120834
|
133144
|
133145
|
133146
|
133206
|
133207
|
133208