Bugzilla – Attachment 57109 Details for
Bug 17541
Add ability to log all barcodes scanned at checkin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17541 - Add ability to log all barcodes scanned at checkin
Bug-17541---Add-ability-to-log-all-barcodes-scanne.patch (text/plain), 10.03 KB, created by
Claire Gravely
on 2016-11-02 19:15:36 UTC
(
hide
)
Description:
Bug 17541 - Add ability to log all barcodes scanned at checkin
Filename:
MIME Type:
Creator:
Claire Gravely
Created:
2016-11-02 19:15:36 UTC
Size:
10.03 KB
patch
obsolete
>From 7aedc214784ed1b3092a97a13df3bb640761052c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 2 Nov 2016 18:04:05 +0000 >Subject: [PATCH] Bug 17541 - Add ability to log all barcodes scanned at > checkin > >On occasion, librarians claim that a barcode was scanned successfully >at checkin but the item was not returned. It would be useful to be able >to log all scanned barcodes at checkin regardless of validity to know if >the barcode scan made it to Koha or if there is an issue keeping it from >being received by the server. > >Test Plan: >1) Apply the patch >2) Run updatedatabase.pl >3) Enable the new system preference CirculationCheckinLog >4) Can some valid and invalid barcdes through the checkin screen >5) View the circulation log from the log viewer tool >6) Note the barcodes are there! > >Signed-off-by: Claire Gravely <claire_gravely@hotmail.com> >--- > circ/returns.pl | 3 +++ > installer/data/mysql/atomicupdate/bug_17541.perl | 10 ++++++++++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/logs.pref | 6 ++++++ > .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 23 +++++++++++++++++++--- > tools/viewlog.pl | 2 +- > 6 files changed, 41 insertions(+), 4 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_17541.perl > >diff --git a/circ/returns.pl b/circ/returns.pl >index ec13c04..00ee258 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -47,6 +47,7 @@ use C4::Members; > use C4::Members::Messaging; > use C4::Koha; # FIXME : is it still useful ? > use C4::RotatingCollections; >+use C4::Log; > use Koha::AuthorisedValues; > use Koha::DateUtils; > use Koha::Calendar; >@@ -251,6 +252,8 @@ if ($canceltransfer){ > # actually return book and prepare item table..... > my $returnbranch; > if ($barcode) { >+ logaction("CIRCULATION", "BARCODE_SCAN_CHECKIN", $barcode, $barcode ) if C4::Context->preference('CirculationCheckinLog'); >+ > $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace > $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter'); > $itemnumber = GetItemnumberFromBarcode($barcode); >diff --git a/installer/data/mysql/atomicupdate/bug_17541.perl b/installer/data/mysql/atomicupdate/bug_17541.perl >new file mode 100644 >index 0000000..a630371 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17541.perl >@@ -0,0 +1,10 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES >+ ('CirculationCheckinLog','0',NULL,'If ON, log all barcodes scanned at during checkin, regardless of validity.','YesNo'); >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 17541 - Add ability to log all barcodes scanned at checkin)\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 5a90b7c..1d84b0f 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -95,6 +95,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'), > ('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), > ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), >+('CirculationCheckinLog','0',NULL,'If ON, log all barcodes scanned at during checkin, regardless of validity.','YesNo'), > ('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'), > ('Coce','0', NULL, 'If on, enables cover retrieval from the configured Coce server', 'YesNo'), > ('CoceHost', '', NULL, 'Coce server URL', 'Free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref >index 4aa5790..a6c96a1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref >@@ -66,6 +66,12 @@ Logging: > on: Log > off: "Don't log" > - when reports are added, deleted or changed. >+ - >+ - pref: CirculationCheckinLog >+ choices: >+ on: Log >+ off: "Don't log" >+ - log all barcodes scanned at during checkin, regardless of validity. > Debugging: > - > - pref: DumpTemplateVarsIntranet >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >index e5706c6..c591298 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -50,6 +50,7 @@ > [% CASE 'CHANGE PASS' %]Change password > [% CASE 'ADDCIRCMESSAGE' %]Add circulation message > [% CASE 'DELCIRCMESSAGE' %]Delete circulation message >+[% CASE 'BARCODE_SCAN_CHECKIN' %]Scanned barcode at checkin > [% CASE 'Run' %]Run > [% CASE %][% action %] > [% END %] >@@ -117,7 +118,7 @@ > <option value="">All</option> > [% END %] > >- [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'CHANGE PASS' 'Run' ] %] >+ [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'CHANGE PASS' 'Run' 'BARCODE_SCAN_CHECKIN'] %] > [% IF actions.grep(actx).size %] > <option value="[% actx %]" selected="selected">[% PROCESS translate_log_action action=actx %]</option> > [% ELSE %] >@@ -214,7 +215,19 @@ > <td>[% PROCESS translate_log_action action=loopro.action %]</td> > <td> > [% IF ( loopro.module == 'MEMBERS' ) || ( loopro.module == 'CIRCULATION' ) || ( loopro.module == 'FINES' ) %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> [% IF ( loopro.object ) %][% IF ( loopro.borrowerfirstname ) || ( loopro.borrowersurname ) %][% loopro.borrowerfirstname %] [% loopro.borrowersurname %] ([% loopro.object %]) [% ELSE %]Member [% loopro.object %][% END %][% END %] </a> >+ [% IF loopro.action == 'BARCODE_SCAN_CHECKIN' %] >+ [% loopro.info %] >+ [% ELSE %] >+ <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loopro.object %]" title="Display member details."> >+ [% IF ( loopro.object ) %] >+ [% IF ( loopro.borrowerfirstname ) || ( loopro.borrowersurname ) %] >+ [% loopro.borrowerfirstname %] [% loopro.borrowersurname %] ([% loopro.object %]) >+ [% ELSE %] >+ Member [% loopro.object %] >+ [% END %] >+ [% END %] >+ </a> >+ [% END %] > [% ELSE %] > [% IF ( loopro.module == 'CATALOGUING' ) %] > [% IF ( loopro.info.substr(0, 4) == 'item' ) %] >@@ -239,7 +252,11 @@ > </td> > <td> > [% IF ( loopro.module == 'CIRCULATION' ) %] >- <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% loopro.info %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.info %]" title="Display detail for this item">Item [% loopro.barcode |html %]</a> >+ [% IF loopro.biblionumber %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% loopro.info %]&biblionumber=[% loopro.biblionumber %]&bi=[% loopro.biblioitemnumber %]#item[% loopro.info %]" title="Display detail for this item"> >+ Item [% loopro.barcode |html %] >+ </a> >+ [% END %] > [% ELSE %] > [% loopro.info |html %] > [% END %] >diff --git a/tools/viewlog.pl b/tools/viewlog.pl >index 3c37162..d3b0e4d 100755 >--- a/tools/viewlog.pl >+++ b/tools/viewlog.pl >@@ -126,7 +126,7 @@ if ($do_it) { > # get item information so we can create a working link > my $itemnumber = $result->{'object'}; > $itemnumber = $result->{'info'} if ( $result->{module} eq "CIRCULATION" ); >- my $item = GetItem($itemnumber); >+ my $item = GetItem($itemnumber) || GetItem( undef, $itemnumber ); > if ($item) { > $result->{'biblionumber'} = $item->{'biblionumber'}; > $result->{'biblioitemnumber'} = $item->{'biblionumber'}; >-- >2.1.4
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 17541
:
57108
| 57109