Bugzilla – Attachment 40572 Details for
Bug 11405
Inventory tool enhancements [OMNIBUS]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11405 [1] - Warn of items possibly scanned out of order
Bug-11405-1---Warn-of-items-possibly-scanned-out-o.patch (text/plain), 4.93 KB, created by
Kyle M Hall (khall)
on 2015-06-24 11:28:06 UTC
(
hide
)
Description:
Bug 11405 [1] - Warn of items possibly scanned out of order
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-24 11:28:06 UTC
Size:
4.93 KB
patch
obsolete
>From 430047e8c874d70f522751e32a81f9e0e5b62ed4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 16 Dec 2013 09:38:55 -0500 >Subject: [PATCH] Bug 11405 [1] - Warn of items possibly scanned out of order > >This patch addes the ability to choose to be warned if it's possible >an item was scanned out of order ( i.e. mis-shelved ). > >Test Plan: >1) Apply this patch >2) Generate a list of barcodes ordered by callnumber >3) "Misplace" one callnumber by moving it to another area of the list >4) Browse to the inventory tool, choose your barcodes file >5) Check the checkbox for "Check barcodes list for items shelved out of order" >6) Click "submit", note the item has been flagged as possibly out of order >--- > .../prog/en/modules/tools/inventory.tt | 6 +++ > tools/inventory.pl | 39 +++++++++++++++----- > 2 files changed, 36 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >index fdac5fa..29db8e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -214,6 +214,10 @@ $(document).ready(function(){ > <label for="compareinv2barcd">Compare barcodes list to results: </label> > <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" /> > </li> >+ <li> >+ <label for="out_of_order">Check barcodes list for items shelved out of order: </label> >+ <input type="checkbox" name="out_of_order" id="out_of_order" /> >+ </li> > </ol> > </fieldset> > <input type="hidden" name="op" value="do_it" /> >@@ -293,6 +297,8 @@ $(document).ready(function(){ > <p>Change item status</p> > [% ELSIF result.problem == 'not_scanned' %] > <p>Item should have been scanned</p> >+ [% ELSIF result.problem == 'out_of_order' %] >+ <p>Item may be shelved out of order</p> > [% END %] > </td> > </tr> >diff --git a/tools/inventory.pl b/tools/inventory.pl >index a4bf639..a1fae52 100755 >--- a/tools/inventory.pl >+++ b/tools/inventory.pl >@@ -52,6 +52,7 @@ my $branchcode = $input->param('branchcode') || ''; > my $branch = $input->param('branch'); > my $op = $input->param('op'); > my $compareinv2barcd = $input->param('compareinv2barcd'); >+my $out_of_order = $input->param('out_of_order'); > > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > { template_name => "tools/inventory.tt", >@@ -294,7 +295,26 @@ if ( $compareinv2barcd ) { > # insert "wrongplace" to all scanned items that are not supposed to be in this range > # note this list is always displayed, whatever the librarian has chosen for comparison > my $moddatecount = 0; >-foreach my $item ( @scanned_items ) { >+for ( my $i = 0; $i < @scanned_items; $i++ ) { >+ my $item = $scanned_items[$i]; >+ >+ # Check for items shelved out of order >+ if ($out_of_order) { >+ unless ( $i == 0 ) { >+ my $previous_item = $scanned_items[ $i - 1 ]; >+ if ( $previous_item && $item->{cn_sort} lt $previous_item->{cn_sort} ) { >+ $item->{problem} = 'out_of_order'; >+ push( @items_with_problems, {%$item} ); >+ } >+ } >+ unless ( $i == scalar(@scanned_items) ) { >+ my $next_item = $scanned_items[ $i + 1 ]; >+ if ( $next_item && $item->{cn_sort} gt $next_item->{cn_sort} ) { >+ $item->{problem} = 'out_of_order'; >+ push( @items_with_problems, {%$item} ); >+ } >+ } >+ } > > # Saving notforloan code before it's replaced by it's authorised value for later comparison > $item->{notforloancode} = $item->{notforloan}; >@@ -316,9 +336,11 @@ foreach my $item ( @scanned_items ) { > next if $item->{onloan}; # skip checked out items > > # If we have scanned items with a non-matching notforloan value >- if (none { $item->{'notforloancode'} eq $_ } @notforloans) { >- $item->{problem} = 'changestatus'; >- push @items_with_problems, { %$item }; >+ if ( $item->{notforloancode} ) { >+ if ( none { $item->{'notforloancode'} eq $_ } @notforloans ) { >+ $item->{problem} = 'changestatus'; >+ push @items_with_problems, {%$item}; >+ } > } > if (none { $item->{barcode} eq $_->{barcode} && !$_->{'onloan'} } @$wrongplacelist) { > $item->{problem} = 'wrongplace'; >@@ -349,11 +371,10 @@ for my $item ( @items_with_problems ) { > > # If a barcode file is given, we want to show problems, else all items > my @results; >-@results = $uploadbarcodes >- ? @items_with_problems >- : $op >- ? @$inventorylist >- : (); >+@results = >+ $uploadbarcodes ? @items_with_problems >+ : $op ? @$inventorylist >+ : undef; > > $template->param( > moddatecount => $moddatecount, >-- >1.7.2.5
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 11405
:
23582
|
23583
|
23584
|
23585
|
23586
|
23587
|
24173
|
24174
|
24175
|
24176
|
24177
|
24178
|
25037
|
31250
|
31251
|
31252
|
31253
|
31254
|
31255
|
31256
|
40572
|
40573
|
40574
|
40575
|
40576
|
40577
|
40578
|
47027
|
47028
|
47029
|
47030
|
47031
|
47032
|
47033
|
47035
|
47036
|
47037
|
47038
|
47039
|
47040
|
47041
|
47106