Bugzilla – Attachment 62098 Details for
Bug 14399
Fix inventory.pl part two (following 12913)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14399: Interface changes
Bug-14399-Interface-changes.patch (text/plain), 9.52 KB, created by
Marcel de Rooy
on 2017-04-12 15:01:01 UTC
(
hide
)
Description:
Bug 14399: Interface changes
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-04-12 15:01:01 UTC
Size:
9.52 KB
patch
obsolete
>From 7fd31d5fbd6690e38a890c037067ef9c248438ee Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 5 Apr 2017 15:12:31 +0200 >Subject: [PATCH] Bug 14399: Interface changes >Content-Type: text/plain; charset=utf-8 > >A part of the confusion around the inventory script may arise from the >fact that the form offers several options that are only used under >certain conditions. This patch hopefully rearranges a few options more >logically and only offers options when appropriate. > >The barcode fieldset now also contains Compare barcodes and Do not check in >checkboxes. These are meaningful when a barcode file is uploaded. > >The fieldset Item location filters (new name) contains fields that are >always used. Same for tne only control left under Additional options, >Export to CSV. > >The fieldset Optional filters depends on the status of the barcode file >and the Compare checkbox. It is now shown or hidden depending on what >you select: if you do not upload a file, it is shown; or if you upload >a file and check Compare, it is shown. Otherwise we hide it, since the >script will not look at these values. Under this fieldset last inventory >date and Skip items on loan are added, since their behavior is the same >as the various item statuses. > >Test plan: >In this test plan we test both the script changes from the previous patch >and the interface changes here. We follow the three main scenario's as >mentioned in the previous patch. > >[1] First we prepare a few test items. > Pick two biblios A, B and create five items say A1,A2,B1,B2,B3. > Pick a not-existing callnumber range you want to test and move these > five items there. Add barcodes too (say A1..B3). > Edit one item A1 to a not-existing notforloan status (doing this on > the mysql command line is fastest). > Like: update items set notforloan = '9' where barcode='A1'; > >Scenario 1 (no barcodes uploaded) >[2] Enter the callnumber range on inventory form. > Verify that "Set inventory date", Compare barcodes and "Do not check > in" are disabled on the form. Check that you see the Optional filters > box. > Submit the form. Verify that you see all five items. > Do the same. Check Export to CSV. Check result file contents. > >Scenario 2 (upload barcodes, do not compare) >[3] Create a barcode file with the barcodes of A1, A2 and B1. Add another > existing barcode outside the test callnumber range. > After uploading this file, verify that "Set inventory date", Compare and > "Do not check in" are enabled. The Optional filters should be hidden. > Leave "Set inventory date" to today. Enter the callnumber range again. > Submit the form. > What do we expect? Four items should have been updated (alert). We > should see barcode A1 with problem Unknown status. We should see > also the barcode from the other range (Found in wrong place). > Repeat this step with the same file. But now export to CSV. Verify that > you see two barcodes with problems again in the csv file. > >Scenario 3 (upload barcodes, compare) >[4] Create another barcode file with barcodes of B2 and one existing barcode > outside the test callnumber range. > After uploading this file, check the Compare checkbox. Verify now that > the Optional filters box is displayed again. > Leave "Set inventory date" to today. Enter the callnumber range again. > Also set "Last inventory date" to today (important!). > Submit the form. > What do we expect now? Two items should be updated (see alert). > We should see barcode B3 with problem Missing. We should also see the > barcode from the other range (wrong place). > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../prog/en/modules/tools/inventory.tt | 80 +++++++++++++++------- > 1 file changed, 55 insertions(+), 25 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 7f31c93..58f3897 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt >@@ -89,6 +89,35 @@ $(document).ready(function(){ > $("#inventory_form").on("submit",function(){ > return checkForm(); > }); >+ >+ // #uploadbarcodes and #compareinv2barcd determine the behavior of >+ // the controls within the barcode fieldset and the optional filters >+ $("#uploadbarcodes").change(function() { >+ if( $("#uploadbarcodes").val() ) { >+ $("#setdate").prop('disabled',false); >+ $("#compareinv2barcd").prop('disabled',false); >+ $("#dont_checkin").prop('disabled',false); >+ if( $("#compareinv2barcd").attr('checked') ) { >+ $("fieldset#optionalfilters").show(); >+ } else { >+ $("fieldset#optionalfilters").hide(); >+ } >+ } else { >+ $("#setdate").prop('disabled',true); >+ $("#compareinv2barcd").prop('disabled',true); >+ $("#compareinv2barcd").attr('checked',false); >+ $("#dont_checkin").prop('disabled',true); >+ $("#dont_checkin").attr('checked',false); >+ $("fieldset#optionalfilters").show(); >+ } >+ }); >+ $("#compareinv2barcd").click(function() { >+ if( $("#compareinv2barcd").attr('checked') ) { >+ $("fieldset#optionalfilters").show(); >+ } else { >+ $("fieldset#optionalfilters").hide(); >+ } >+ }); > }); > //]]> > </script> >@@ -125,16 +154,17 @@ $(document).ready(function(){ > <div class="yui-g"> > <form method="post" id="inventory_form" action="/cgi-bin/koha/tools/inventory.pl" enctype="multipart/form-data"> > <fieldset class="rows"> >- <legend>Use a barcode file</legend> >- <ol> >+ <legend>Use a barcode file</legend> >+ <ol> > <li><label for="uploadbarcodes">Barcode file: </label> <input type="file" id="uploadbarcodes" name="uploadbarcodes" /></li> >- <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" /> >- </li> >+ <li><label for="setdate">Set inventory date to:</label> <input type="text" id="setdate" name="setdate" value="[% today | $KohaDates %]" class="datepicker" disabled /></li> >+ <li><label for="compareinv2barcd">Compare barcodes list to results: </label><input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" disabled /></li> >+ <li><label for="dont_checkin">Do not check in items scanned during inventory: </label><input type="checkbox" name="dont_checkin" id="dont_checkin" disabled /></li> > </ol> > </fieldset> > > <fieldset class="rows"> >- <legend>Select items you want to check</legend> >+ <legend>Item location filters</legend> > <ol><li> > <label for="branch">Library: </label> > <input type="radio" name="branch" value="homebranch"> Home library</input> >@@ -165,11 +195,12 @@ $(document).ready(function(){ > <li><label for="maxlocation">...and: </label> > <input type="text" name="maxlocation" id="maxlocation" value="[% maxlocation %]" /> > </li> >- [% IF (statuses) %] > </ol> > </fieldset> >- <fieldset class="rows"> >- <legend>Item statuses</legend> >+ >+ <fieldset class="rows" id="optionalfilters"> >+ <legend>Optional filters for inventory list or comparing barcodes</legend> >+ <br/> > <div id="statuses" style="display: block;"> > [% FOREACH status IN statuses %] > [% IF (status.values) %] >@@ -195,33 +226,32 @@ $(document).ready(function(){ > [% END %] > [% END %] > </div> >- </fieldset> >- <fieldset class="rows"> >- <ol> >- [% END %] >- >- <li><label for="datelastseen">Last inventory date:</label> >+ <ol> >+ <li> >+ <br/> >+ <label for="datelastseen">Last inventory date:</label> > <input type="text" id="datelastseen" name="datelastseen" value="[% datelastseen | $KohaDates %]" class="datepicker" /> > (Skip records marked as seen on or after this date.) > </li> >- <li><label for="ignoreissued">Skip items on loan: </label> >+ <li> >+ <label for="ignoreissued">Skip items on loan: </label> > [% IF (ignoreissued) %] >- <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /></li> >+ <input type="checkbox" id="ignoreissued" name="ignoreissued" checked="checked" /> > [% ELSE %] >- <input type="checkbox" id="ignoreissued" name="ignoreissued" /></li> >+ <input type="checkbox" id="ignoreissued" name="ignoreissued" /> > [% END %] >+ </li> >+ </ol> >+ </fieldset> >+ >+ <fieldset class="rows"> >+ <legend>Additional options</legend> >+ <ol> >+ > <li> > <label for="CSVexport">Export to CSV file: </label> > <input type="checkbox" name="CSVexport" id="CSVexport" /> > </li> >- <li> >- <label for="compareinv2barcd">Compare barcodes list to results: </label> >- <input type="checkbox" name="compareinv2barcd" id="compareinv2barcd" /> >- </li> >- <li> >- <label for="dont_checkin">Do not check in items scanned during inventory: </label> >- <input type="checkbox" name="dont_checkin" id="dont_checkin" /> >- </li> > </ol> > </fieldset> > <input type="hidden" name="op" value="do_it" /> >-- >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 14399
:
61685
|
62096
|
62097
|
62098
|
62099
|
62139
|
62140
|
62733
|
62734
|
62735
|
62736
|
63465
|
63466
|
63467
|
63468
|
67546
|
67547
|
67548
|
67549