Bugzilla – Attachment 24055 Details for
Bug 7180
Order from staged file improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7180: QA followup
Bug-7180-QA-followup.patch (text/plain), 14.43 KB, created by
Jonathan Druart
on 2014-01-09 11:50:33 UTC
(
hide
)
Description:
Bug 7180: QA followup
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-01-09 11:50:33 UTC
Size:
14.43 KB
patch
obsolete
>From a1f612cb178dd151d1fb0fa551e4b2c61ed8534a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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|<select id="$name", name="$name">|; >+my $html = qq|<select id="$name" name="$name">|; > for my $av ( @$avs ) { > if ( $av->{default} ) { > $html .= qq|<option value="$av->{value}" selected="selected">$av->{label}</option>|; >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 95be656..d168b2d 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 %] > </title> >+[% INCLUDE 'greybox.inc' %] > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% 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, { > "aoColumns": [ >@@ -32,15 +34,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 ); > >@@ -68,13 +70,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(); > } > } ); > >@@ -93,6 +99,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){ >@@ -100,7 +125,7 @@ > $(this).find('select').attr('disabled', 'disabled'); > $(this).find('input').attr('disabled', 'disabled'); > }); >- form.submit(); >+ return 1; > } > //]]> > </script> >@@ -118,9 +143,10 @@ > ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %]) > </h1> > <div> >+ <div id="records_to_import"> > <span class="checkall"><a id="checkAll" href="#">Check All</a></span> > <span class="uncheckall"><a id="unCheckAll" href="#">Uncheck All</a></span> >- <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform" onsubmit="disableUnchecked(this); return false;"> >+ <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform"> > <input type="hidden" name="op" value="import_records"/> > <input type="hidden" name="basketno" value="[% basketno %]" /> > <input type="hidden" name="booksellerid" value="[% booksellerid %]" /> >@@ -132,30 +158,47 @@ > [% END %] > > [% FOREACH biblio IN biblio_list %] >- <div class="biblio unselected" style="border-radius: 5px 5px; -moz-border-radius: 5px; padding: 5px; margin:5px; border-style : solid; border-color : grey; border-width:1px;"> >- <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" /> >- <input type="hidden" value="[% biblio.rrp %]" name="rrp" /> >- <label for="record_[% biblio.import_record_id %]"><span class="citation" style="font-weight:bold;">[% biblio.citation %]</span></label> >- <span class="match" style="display:block;">[% biblio.overlay_status %]</span> >- [% IF ( biblio.match_biblionumber ) %] >- Matches biblio [% biblio.match_biblionumber %] (score = [% biblio.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a> >- [% END %] >- <span class="quantity" style="display:block;"> >- Quantity: <input type="text" value="[% biblio.quantity %]" name="quantity" /> >- </span> >- <span class="price" style="display:block;"> >- Price: <input type="text" value="[% biblio.price %]" name="price" /> >- </span> >- <span class="discount" style="display:block;"> >- Discount: <input type="text" value="[% biblio.discount %]" name="discount" /> >- </span> >- <span class="budget" style="display:block;"> >+ <fieldset class="biblio unselected rows"> >+ <legend> >+ <label for="record_[% biblio.import_record_id %]" style="width:auto;"> >+ <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id %]" value="[% biblio.import_record_id %]" /> >+ <span class="citation">[% biblio.citation %]</span> >+ </label> >+ ( Show <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id %]" title="MARC" rel="gb_page_center[600,500]">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% biblio.import_record_id %]" title="MARC" rel="gb_page_center[600,500]">Card</a> ) >+ >+ </legend> >+ <input type="hidden" value="[% biblio.rrp %]" name="rrp" /> >+ <ol> >+ <li class="status"> >+ <span class="match"> >+ [% 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 %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber %]">[% biblio.match_citation %]</a> >+ [% END %] >+ </span> >+ </li> >+ <li class="quantity"> >+ <label for="quantity_record_[% biblio.import_record_id %]" class="required">Quantity: </label> >+ <input id="quantity_record_[% biblio.import_record_id %]" type="text" value="[% biblio.quantity %]" name="quantity" /> >+ </li> >+ <li class="price"> >+ <label for="price_record_[% biblio.import_record_id %]">Price: </label> >+ <input id="price_record_[% biblio.import_record_id %]" type="text" value="[% biblio.price %]" name="price" /> >+ </li> >+ <li class="discount"> >+ <label for="discount_record_[% biblio.import_record_id %]">Discount: </label> >+ <input id="discount_record_[% biblio.import_record_id %]" type="text" value="[% biblio.discount %]" name="discount" /> >+ </li> >+ <li class="budget"> >+ <label for="fund_record_[% biblio.import_record_id %]">Fund: </label> > [% IF ( close ) %] >- <span class="label">Budget: </span> >- <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %] >+ <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %] > [% ELSE %] >- <label for="budget_id">Budget: </label> >- <select size="1" name="budget_id"> >+ <select id="fund_record_[% biblio.import_record_id %]" size="1" name="budget_id"> > <option value=""></option> > [% FOREACH budget IN budget_loop %] > [% IF ( budget.b_id == biblio.budget_id ) %] >@@ -164,20 +207,22 @@ > <option value="[% budget.b_id %]" data-sort1-authcat="[% budget.b_sort1_authcat %]" data-sort2-authcat="[% budget.b_sort2_authcat %]">[% budget.b_txt %]</option> > [% END %] > [% END %] >- </select> >+ </select> > [% END %] >- <span class="sort1"> >- <label for="sort1">Planning value1: </label> >- <input type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" /> >- </span> >- <span class="sort2"> >- <label for="sort2">Planning value2: </label> >- <input type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" /> >- </span> >- </span> >- </div> >+ </li> >+ <li class="sort1"> >+ <label for="sort1_record_[% biblio.import_record_id %]">Planning value1: </label> >+ <input id="sort1_record_[% biblio.import_record_id %]" type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 %]" /> >+ </li> >+ <li class="sort2"> >+ <label for="sort2_record_[% biblio.import_record_id %]">Planning value2: </label> >+ <input id="sort2_record_[% biblio.import_record_id %]" type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 %]" /> >+ </li> >+ </ol> >+ </fieldset> > [% END %] >- <div> >+ </div> >+ <div id="import_all"> > <h2>Import all</h2> > <p>Import all the lines in the basket with the following parameters:</p> > >-- >1.7.10.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 7180
:
6234
|
13019
|
15023
|
15048
|
15617
|
15677
|
15934
|
15935
|
16014
|
16505
|
16511
|
16544
|
16566
|
16613
|
19066
|
19067
|
19068
|
19316
|
19587
|
19588
|
19589
|
19590
|
19641
|
19645
|
20900
|
20901
|
20902
|
20903
|
20904
|
20926
|
20933
|
20934
|
20935
|
20978
|
20979
|
21004
|
21014
|
21017
|
21117
|
21462
|
21463
|
21464
|
21465
|
21466
|
21467
|
21468
|
21469
|
21470
|
21471
|
21472
|
21473
|
21474
|
21514
|
22546
|
22547
|
22548
|
22549
|
22550
|
22551
|
22552
|
22553
|
22554
|
22555
|
22556
|
22557
|
22558
|
22559
|
24052
|
24053
|
24054
|
24055
|
24056
|
24057
|
24058
|
24059
|
24060
|
24061
|
24062
|
24063
|
24064
|
24065
|
24636
|
24637
|
24638
|
24639
|
24640
|
24641
|
24642
|
24643
|
24644
|
24645
|
24646
|
24647
|
24648
|
24649
|
24708
|
24709
|
24710
|
24711
|
24712
|
24713
|
24714
|
24715
|
24716
|
24717
|
24718
|
24719
|
24720
|
24721
|
25908
|
26950
|
26951
|
26952
|
26953
|
26954
|
26955
|
26956
|
26957
|
26958
|
26959
|
26960
|
26961
|
26962
|
26963
|
26964
|
27128
|
27131
|
27136
|
27160
|
27325
|
27408
|
27409
|
27410
|
27411
|
27412
|
27413
|
27414
|
27415
|
27416
|
27417
|
27418
|
27419
|
27420
|
27421
|
27422
|
27423
|
27424
|
27451
|
27520
|
27561
|
27562
|
27563
|
27564
|
27565
|
27566
|
27567
|
27568
|
27569
|
27570
|
27571
|
27572
|
27573
|
27574
|
27575
|
27576
|
27577
|
27578
|
27829
|
27830
|
27831
|
27832
|
27833
|
27834
|
27835
|
27836
|
27837
|
27838
|
27839
|
27840
|
27841
|
27842
|
27843
|
27844
|
27845
|
27846
|
27847
|
27848
|
27849
|
27850
|
27851
|
27852
|
27853
|
27854
|
27855
|
27856
|
27857
|
27858
|
27859
|
27860
|
27861
|
27862
|
27863
|
27864
|
27865
|
27866