Bug 7180: QA followup
authorJonathan Druart <jonathan.druart@biblibre.com>
Thu, 12 Sep 2013 09:44:25 +0000 (11:44 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 4 May 2014 19:52:06 +0000 (19:52 +0000)
- fix unit tests (use a transaction).
- add 3 tabs on the page in order to be more understandable.
- fix a warn in logs

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

acqui/addorderiso2709.pl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt
t/db_dependent/Budgets.t

index 246de8d..e966a4c 100755 (executable)
@@ -502,6 +502,7 @@ sub get_infos_syspref {
     }
     my $r;
     for my $field_name ( @$field_list ) {
+        next unless exists $yaml->{$field_name};
         my @fields = split /\|/, $yaml->{$field_name};
         for my $field ( @fields ) {
             my ( $f, $sf ) = split /\$/, $field;
index 4215262..3db819f 100644 (file)
             if ( $(this).is(':checked') ) {
                 $(container).addClass("selected");
                 $(container).removeClass("unselected");
-                $(container).find("ol").toggle();
+                $(container).find("ol").toggle(true);
             } else {
                 $(container).addClass("unselected");
                 $(container).removeClass("selected");
-                $(container).find("ol").toggle();
+                $(container).find("ol").toggle(false);
             }
         } );
 
 
             return disableUnchecked($(this));
         });
+        $('#tabs').tabs();
     });
 
     function disableUnchecked(form){
         $("div.biblio.unselected").each(function(){
-            $(this).find('select').attr('disabled', 'disabled');
-            $(this).find('input').attr('disabled', 'disabled');
+            $(this).remove();
         });
         return 1;
     }
                 <h1>Add orders from [% comments %]
                     ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
                 </h1>
-                <div>
+                <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
+                <div id="tabs" class="toptabs">
+                  <ul>
+                    <li><a href="#records_to_import">Select to import</a></li>
+                    <li><a href="#items_info" class="items_info">Items information</a></li>
+                    <li><a href="#accounting_details">Default accounting details</a></li>
+                  </ul>
+
                   <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">
                         <input type="hidden" name="op" value="import_records"/>
                         <input type="hidden" name="basketno" value="[% basketno %]" />
                         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
                         [% END %]
 
                         [% FOREACH biblio IN biblio_list %]
-                        <fieldset class="biblio unselected rows">
+                        <fieldset class="biblio unselected rows" style="float:none;">
                           <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 %]" />
                         </fieldset>
                         [% END %]
                       </div>
-                      <div id="import_all">
-                        <h2>Import all</h2>
-                        <p>Import all the lines in the basket with the following parameters:</p>
+                      <div id="items_info">
+                        <h2>Items information</h2>
+                        <p>Import all the checked items in the basket with the following parameters:</p>
 
                         [% IF ( items ) %]
-                        <fieldset class="rows">
+                        <fieldset class="rows" style="float:none;">
                             <legend>Item</legend>
                             [% IF ( NoACQframework ) %]
                                 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
                             [% END %] <!-- /items -->
                         </fieldset>
                         [% END %] <!-- items -->
-
-                        <fieldset class="rows">
+                      </div>
+                      <div id="accounting_details">
+                        <fieldset class="rows" style="float:none;">
                             <legend>Accounting details</legend>
                             <ol>
                                 <li>
                                 </li>
                             </ol>
                         </fieldset>
-                        <fieldset class="action">
-                            <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
-                        </fieldset>
+                      </div>
+                      </div>
 
-                        </div>
+                      <fieldset class="action">
+                          <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
+                      </fieldset>
                     </form>
                 [% ELSE %]
                 <div>
index 54beddf..efb07ce 100755 (executable)
@@ -3,16 +3,17 @@ use warnings;
 use Test::More tests => 22;
 
 BEGIN {use_ok('C4::Budgets') }
+use C4::Context;
 use C4::Dates;
 use C4::Context;
 
 use YAML;
-
-my $dbh = C4::Context->dbh();
+my $dbh = C4::Context->dbh;
 $dbh->{AutoCommit} = 0;
 $dbh->{RaiseError} = 1;
 
-$dbh->do('DELETE FROM aqbudgetperiods');
+$dbh->do(q|DELETE FROM aqbudgetperiods|);
+$dbh->do(q|DELETE FROM aqbudgets|);
 
 #
 # Budget Periods :
@@ -134,3 +135,4 @@ ok($budgets->[0]->{budget_name} lt $budgets->[1]->{budget_name}, 'default sort o
 ok($del_status=DelBudget($budget_id),
     "DelBudget returned $del_status");
 
+$dbh->rollback;