Bug 15531: (QA followup) Fix several small issues
authorJesse Weaver <jweaver@bywatersolutions.com>
Mon, 11 Jan 2016 23:07:33 +0000 (16:07 -0700)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 13:07:18 +0000 (13:07 +0000)
  * Add `AFTER` to DB update
  * Change "Is standing order basket:" to "Orders are standing:"
  * Disable item creation when adding from a staged file
  * Correctly show is_standing for existing baskets

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
acqui/addorderiso2709.pl
acqui/basketheader.pl
installer/data/mysql/atomicupdate/bug_15531-add_is_standing_to_aqbasket.sql
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketheader.tt

index e5159dc..552754c 100755 (executable)
@@ -99,7 +99,8 @@ if ($op eq ""){
                      "allmatch" => $allmatch,
                      );
     import_biblios_list($template, $cgiparams->{'import_batch_id'});
-    if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
+    my $basket = GetBasket($cgiparams->{basketno});
+    if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) {
         # prepare empty item form
         my $cell = PrepareItemrecordDisplay( '', '', '', 'ACQ' );
 
@@ -238,7 +239,8 @@ if ($op eq ""){
         # 4th, add items if applicable
         # parse the item sent by the form, and create an item just for the import_record_id we are dealing with
         # this is not optimised, but it's working !
-        if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
+        my $basket = GetBasket($cgiparams->{basketno});
+        if ( C4::Context->preference('AcqCreateItem') eq 'ordering' && !$basket->{is_standing} ) {
             my @tags         = $input->multi_param('tag');
             my @subfields    = $input->multi_param('subfield');
             my @field_values = $input->multi_param('field_value');
index 051e148..c59ea87 100755 (executable)
@@ -123,6 +123,7 @@ if ( $op eq 'add_form' ) {
                     booksellers => \@booksellers,
                     deliveryplace => $basket->{deliveryplace},
                     billingplace => $basket->{billingplace},
+                    is_standing => $basket->{is_standing},
     );
 
     my $billingplace = $basket->{'billingplace'} || C4::Context->userenv->{"branch"};
index 69d8fab..4df3e9c 100644 (file)
@@ -1 +1 @@
-ALTER TABLE aqbasket ADD COLUMN is_standing TINYINT(1) NOT NULL DEFAULT 0;
+ALTER TABLE aqbasket ADD COLUMN is_standing TINYINT(1) NOT NULL DEFAULT 0 AFTER branch;
index d33de40..128eed0 100644 (file)
                 [% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
                 [% IF ( estimateddeliverydate ) %]<li><span class="label">Estimated delivery date:</span> [% estimateddeliverydate | $KohaDates  %]</li>[% END %]
-                <li><span class="label">Is standing order basket:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
+                <li><span class="label">Orders are standing:</span> [% IF is_standing %]Yes[% ELSE %]No[% END %]</li>
 
 
                 </ol>
index 1e7f4e6..cc06ae3 100644 (file)
                 [% END %]
                 <li>
                     <label for="is_standing">Orders are standing:</label>
-                    <input type="checkbox" id="is_standing" name="is_standing"/>
+                    [% IF is_standing %]
+                        <input type="checkbox" id="is_standing" name="is_standing" checked="checked" />
+                    [% ELSE %]
+                        <input type="checkbox" id="is_standing" name="is_standing"/>
+                    [% END %]
                     <div class="hint">Standing orders do not close when received.</div>
                 </li>
             </ol>