Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead
authorNick Clemens <nick@bywatersolutions.com>
Mon, 6 Jun 2016 14:11:36 +0000 (10:11 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Tue, 13 Sep 2016 17:21:05 +0000 (17:21 +0000)
- Uses a dialog box to warn of unique fields not copying, dialog was in
place for barcode generation so removed the extar modal completey
- Fixes a problem when barcode was undefined and autobarcode on
- deleted an extra space in Barcodes/hbymmincr.pm

Signed-off-by: sonia BOUIS <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Barcodes/hbyymmincr.pm
acqui/addorder.pl
koha-tmpl/intranet-tmpl/prog/en/includes/additem.js.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/js/additem.js

index 64f85c4..6b41e36 100644 (file)
@@ -41,7 +41,7 @@ BEGIN {
 sub db_max {
        my $self = shift;
     my $width = WIDTH;
-    my $query = "SELECT SUBSTRING(barcode,-$width) AS chunk, barcode FROM items WHERE barcode REGEXP ?  ORDER BY chunk DESC LIMIT 1";
+    my $query = "SELECT SUBSTRING(barcode,-$width) AS chunk, barcode FROM items WHERE barcode REGEXP ? ORDER BY chunk DESC LIMIT 1";
        $debug and print STDERR "(hbyymmincr) db_max query: $query\n";
        my $sth = C4::Context->dbh->prepare($query);
        my ($iso);
index 80f01c6..5223b7f 100755 (executable)
@@ -316,7 +316,7 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) {
                                     'ITEM');
             my $record=MARC::Record::new_from_xml($xml, 'UTF-8');
             my ($barcodefield,$barcodesubfield) = GetMarcFromKohaField('items.barcode');
-            my $barcode = $record->subfield($barcodefield,$barcodesubfield);
+            my $barcode = $record->subfield($barcodefield,$barcodesubfield) || '';
             my $aBpref = C4::Context->preference('autoBarcode');
             if( $barcode eq '' && $aBpref ne 'OFF'){
                 my $barcodeobj;
index 1ecee30..d7cd4d7 100644 (file)
@@ -3,6 +3,7 @@
 var MSG_ADDITEM_JS_ADDITEM = _("Add item");
 var MSG_ADDITEM_JS_ADDMULTI = _("Add multiple items");
 var MSG_ADDITEM_JS_MULTIVAL = _("Number of items to add");
+var MSG_ADDITEM_JS_MULTI_UNIQUE_NOTE = _("NOTE: Fields listed in the \'UniqueItemsFields\' system preference will not be copied");
 var MSG_ADDITEM_JS_SUBMITMULTI = _("Add");
 var MSG_ADDITEM_JS_UPDATEITEM = _("Update item");
 var MSG_ADDITEM_JS_EDIT = _("Edit");
index fe659a6..6497721 100644 (file)
@@ -658,22 +658,6 @@ $(document).ready(function()
     </div>
 </div>
 
-[% IF UniqueItemFields %]
-<div id="uniqueFieldsModal" class="modal hide fade" aria-labelledby="uniqueFieldsModal" aria-hidden="true">
-    <div class="modal-body">
-    <h3>The following fields are listed in the UniqueItemFields system preference and will not be copied</h3>
-    <ul id="uniqueItemFields">
-    [% FOREACH uniqueField IN UniqueItemFields.split(" ") %]
-        <li>[% uniqueField %]</li>
-    [% END %]
-    </ul>
-    [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
-    <h3>If barcode is blank and/or listed in UniqueItemFields barcodes will be generate using the autoBarcode preference setting ([% Koha.Preference('autoBarcode') %]) when saved</h3>
-    [% END %]
-    </div>
-</div>
-[% END %]
-
 <div id="multiCountModal" class="modal hide fade" aria-labelledby="multiCountModal" aria-hidden="true">
     <h3>Invalid number of copies</h3>
     <p>Please enter a <b>number</b>, greater than or equal to 1</p>
index 3cbd66d..0f93310 100644 (file)
@@ -180,8 +180,12 @@ function cloneItemBlock(index, unique_item_fields, callback) {
             var buttonPlus = "<fieldset class=\"action\">";
                 buttonPlus += '<input type="button" class="addItemControl" name="buttonPlus" style="cursor:pointer; margin:0 1em;" onclick="addItem(this,\'' + unique_item_fields + '\')" value="' + (window.MSG_ADDITEM_JS_ADDITEM || 'Add item')+ '" />';
                 buttonPlus += '<input type="button" class="addItemControl cancel" name="buttonClear" style="cursor:pointer;" onclick="clearItemBlock(this)" value="' + (window.MSG_ADDITEM_JS_CLEAR || 'Clear')+ '" />';
-                buttonPlus += '<input type="button" class="addItemControl" name="buttonPlusMulti" data-toggle="modal" data-target="#uniqueFieldsModal" onclick="javascript:this.nextSibling.style.visibility=\'visible\'; return false;" style="cursor:pointer; margin:0 1em;" value="' + (window.MSG_ADDITEM_JS_ADDMULTI || 'Add multiple items')+ '" />';
-                buttonPlus +='<span id="add_multiple_copies" style="visibility:hidden"><input type="number" class="addItemControl" id="multiValue" name="multiValue" placeholder="'+window.MSG_ADDITEM_JS_MULTIVAL+'" /><input type="button" class="addItemControl" name=buttonAddMulti" style="cursor:pointer; margin:0 1em;" onclick="checkCount( this ,\'' + unique_item_fields + '\')" value="' + (window.MSG_ADDITEM_JS_SUBMITMULTI || 'Add') + '" /></span>';
+                buttonPlus += '<input type="button" class="addItemControl" name="buttonPlusMulti" onclick="javascript:this.nextSibling.style.display=\'inline\'; return false;" style="cursor:pointer; margin:0 1em;" value="' + (window.MSG_ADDITEM_JS_ADDMULTI || 'Add multiple items')+ '" />';
+                buttonPlus += '<span id="add_multiple_copies" style="display:none">'
+                            +     '<input type="number" class="addItemControl" id="multiValue" name="multiValue" placeholder="'+window.MSG_ADDITEM_JS_MULTIVAL+'" />'
+                            +     '<input type="button" class="addItemControl" name=buttonAddMulti" style="cursor:pointer; margin:0 1em;" onclick="checkCount( this ,\'' + unique_item_fields + '\')" value="' + (window.MSG_ADDITEM_JS_SUBMITMULTI || 'Add') + '" />'
+                            +     '<div class="dialog message">' + window.MSG_ADDITEM_JS_MULTI_UNIQUE_NOTE + '</div>'
+                            + '</span>';
                 buttonPlus += "</fieldset>";
             $(clone).append(buttonPlus);
             /* Copy values from the original block (input) */