From 6a17be208561ce0655d1d4e8add341238f500980 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 1 Jul 2013 15:59:14 +0200 Subject: [PATCH] Bug 7180: QA followup Ergonomic improvements: - Remove the green color the selected record. - Use fieldset.rows (and legend). - Use the required css class for quantity inputs. - Replace "budget" with "fund". - fix the "undefined" string - Add a "show MARC" link - replace "no_match" with a text. --- acqui/ajax-getauthvaluedropbox.pl | 2 +- .../prog/en/modules/acqui/addorderiso2709.tt | 137 +++++++++++++------- 2 files changed, 92 insertions(+), 47 deletions(-) diff --git a/acqui/ajax-getauthvaluedropbox.pl b/acqui/ajax-getauthvaluedropbox.pl index 86f440c..57c1f99 100755 --- a/acqui/ajax-getauthvaluedropbox.pl +++ b/acqui/ajax-getauthvaluedropbox.pl @@ -60,7 +60,7 @@ $default = C4::Charset::NormalizeString($default); binmode STDOUT, ':encoding(UTF-8)'; print $input->header(-type => 'text/plain', -charset => 'UTF-8'); my $avs = GetAuthvalueDropbox($category, $default); -my $html = qq||; for my $av ( @$avs ) { if ( $av->{default} ) { $html .= qq||; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt index 0ebbded..681d0aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt @@ -7,6 +7,7 @@ › Batch list [% END %] +[% INCLUDE 'greybox.inc' %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'datatables.inc' %] @@ -17,6 +18,7 @@ [% IF (dateformat == 'metric') %] dt_add_type_uk_date(); [% END %] + $(document).ready(function() { var srlt = $("#files").dataTable($.extend(true, {}, dataTablesDefaults, { "aoColumnDefs": [ @@ -28,15 +30,15 @@ $("select[name='budget_id']").change(function(){ var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat'); var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat'); - var destination_sort1 = $(this).siblings('span.sort1').find('input[name="sort1"]'); - var sort1 = $(destination_sort1).val(); + var destination_sort1 = $(this).parents('fieldset').find('li.sort1').find('input[name="sort1"]'); + var sort1 = $(destination_sort1).val() || ""; if ( destination_sort1.length < 1 ) { - destination_sort1 = $(this).siblings('span.sort1').find('select[name="sort1"]'); + destination_sort1 = $(this).parents('fieldset').find('li.sort1 > select[name="sort1"]'); } - var destination_sort2 = $(this).siblings('span.sort2').find('input[name="sort2"]'); - var sort2 = $(destination_sort2).val(); + var destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('input[name="sort2"]'); + var sort2 = $(destination_sort2).val() || ""; if ( destination_sort2.length < 1 ) { - destination_sort2 = $(this).siblings('span.sort2').find('select[name="sort2"]'); + destination_sort2 = $(this).parents('fieldset').find('li.sort2').find('select[name="sort2"]'); } getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 ); @@ -64,13 +66,17 @@ $(this).parent().siblings('li').find('input[name="sort2"]').attr('name', 'all_sort2'); } ); + $("#records_to_import fieldset.rows ol").hide(); $('input:checkbox[name="import_record_id"]').change(function(){ + var container = $(this).parents("fieldset"); if ( $(this).is(':checked') ) { - $(this).parent().addClass("selected"); - $(this).parent().removeClass("unselected"); + $(container).addClass("selected"); + $(container).removeClass("unselected"); + $(container).find("ol").toggle(); } else { - $(this).parent().addClass("unselected"); - $(this).parent().removeClass("selected"); + $(container).addClass("unselected"); + $(container).removeClass("selected"); + $(container).find("ol").toggle(); } } ); @@ -89,6 +95,25 @@ return false; }); + $("#Aform").on("submit", function(){ + if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) { + alert("There is no record selected"); + return false; + } + + var error = 0; + $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){ + if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) { + error++; + } + }); + if ( error > 0 ) { + alert(error + " quantity values are not filled or not a number"); + return false; + } + + return disableUnchecked($(this)); + }); }); function disableUnchecked(form){ @@ -96,7 +121,7 @@ $(this).find('select').attr('disabled', 'disabled'); $(this).find('input').attr('disabled', 'disabled'); }); - form.submit(); + return 1; } //]]> @@ -114,9 +139,10 @@ ([% file_name %] staged on [% upload_timestamp %])
+
Check All Uncheck All -
+ @@ -128,30 +154,47 @@ [% END %] [% FOREACH biblio IN biblio_list %] -
- - - - [% biblio.overlay_status %] - [% IF ( biblio.match_biblionumber ) %] - Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): [% biblio.match_citation %] - [% END %] - - Quantity: - - - Price: - - - Discount: - - +
+ + + ( Show MARC | Card ) + + + +
    +
  1. + + [% IF biblio.overlay_status == 'no_match' %] + There is no matching biblio for this records. + [% ELSE %] + This record matches existing biblio. + [% END %] + [% IF ( biblio.match_biblionumber ) %] + Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): [% biblio.match_citation %] + [% END %] + +
  2. +
  3. + + +
  4. +
  5. + + +
  6. +
  7. + + +
  8. +
  9. + [% IF ( close ) %] - Budget: - [% Budget_name %] + [% Budget_name %] [% ELSE %] - - [% FOREACH budget IN budget_loop %] [% IF ( budget.b_id == biblio.budget_id ) %] @@ -160,20 +203,22 @@ [% END %] [% END %] - + [% END %] - - - - - - - - - -
+ +
  • + + +
  • +
  • + + +
  • + + [% END %] -
    +
    +

    Import All

    Import all the lines in the basket with the following parameters:

    -- 1.7.10.4