Bugzilla – Attachment 91857 Details for
Bug 23376
Cleanup order receive page code
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23376: Move AcqCreateItem logic to template
Bug-23376-Move-AcqCreateItem-logic-to-template.patch (text/plain), 6.49 KB, created by
Nick Clemens (kidclamp)
on 2019-07-29 20:06:13 UTC
(
hide
)
Description:
Bug 23376: Move AcqCreateItem logic to template
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2019-07-29 20:06:13 UTC
Size:
6.49 KB
patch
obsolete
>From 825bbfb1d91976c1b732f564dc35e08829295715 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Mon, 29 Jul 2019 20:05:42 +0000 >Subject: [PATCH] Bug 23376: Move AcqCreateItem logic to template > >--- > acqui/orderreceive.pl | 13 ------------- > .../prog/en/modules/acqui/orderreceive.tt | 21 +++++++++++---------- > 2 files changed, 11 insertions(+), 23 deletions(-) > >diff --git a/acqui/orderreceive.pl b/acqui/orderreceive.pl >index fb08d0a5a9..0d732923f3 100755 >--- a/acqui/orderreceive.pl >+++ b/acqui/orderreceive.pl >@@ -114,18 +114,6 @@ unless($acq_fw) { > $template->param('NoACQframework' => 1); > } > >-my $AcqCreateItem = $basket->effective_create_items; >-if ($AcqCreateItem eq 'receiving') { >- $template->param( >- AcqCreateItemReceiving => 1, >- UniqueItemFields => C4::Context->preference('UniqueItemFields'), >- ); >-} elsif ($AcqCreateItem eq 'ordering') { >- my $fw = ($acq_fw) ? 'ACQ' : ''; >- my $items = $order->items; >- $template->param(items => $items); >-} >- > my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber}); > > my $creator = Koha::Patrons->find( $order->created_by ); >@@ -161,7 +149,6 @@ if ( $order->subscriptionid ) { > } > > $template->param( >- AcqCreateItem => $AcqCreateItem, > count => 1, > order => $order, > name => $bookseller->name, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >index 7c9fe7b4cf..0627fb291d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt >@@ -19,6 +19,7 @@ > > <div class="main container-fluid"> > <div class="row"> >+ [% AcqCreateItem = order.basket.effective_create_items %] > <div class="col-sm-10 col-sm-push-2"> > <main> > >@@ -111,7 +112,7 @@ > </tbody> > </table> > </fieldset> >- [% ELSIF (AcqCreateItemReceiving) %] >+ [% ELSIF (AcqCreateItem == 'receiving') %] > <div id="items_list" style="display:none"> > <p><b>Items list</b></p> > <div style="width:100%;overflow:auto;"> >@@ -154,7 +155,7 @@ > </fieldset> > [% END %] > [% ELSIF (AcqCreateItem == 'ordering') %] >- [% IF (items.count) %] >+ [% IF (order.items.count) %] > <h5>Items</h5> > <div style="width:100%;overflow:auto"> > <table> >@@ -178,7 +179,7 @@ > </tr> > </thead> > <tbody> >- [% FOREACH item IN items %] >+ [% FOREACH item IN order.items %] > <tr id="item_[% item.itemnumber | html %]"> > <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td> > <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td> >@@ -247,7 +248,7 @@ > [% IF order.subscriptionid %] > <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" /> > <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" /> >- [% ELSIF AcqCreateItemReceiving %] >+ [% ELSIF AcqCreateItem == 'receiving' %] > <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" /> > [% ELSE %] > [% IF ( order.quantityreceived ) %] >@@ -255,7 +256,7 @@ > <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" /> > <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" /> > [% ELSE %] >- [% IF ( items ) %] >+ [% IF ( order.items.count ) %] > <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" /> > [% ELSE %] > <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" /> >@@ -270,7 +271,7 @@ > <p class="error">Warning, you have entered more items than expected. > Items will not be created.</p> > </div> >- [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItemReceiving) %] >+ [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %] > </li> > > [% IF ( gst_values ) %] >@@ -349,7 +350,7 @@ > [% Asset.js("js/cataloging.js") | $raw %] > <script> > function Check(form) { >- [% IF (AcqCreateItemReceiving) %] >+ [% IF (AcqCreateItem == 'receiving') %] > var total_errors = CheckMandatorySubfields(form); > if (total_errors != 0) { > var alertString = _("Form not submitted because of the following problem(s)"); >@@ -359,7 +360,7 @@ > return false; > } > >- if(check_additem('[% UniqueItemFields | html %]') == false){ >+ if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){ > alert(_("Duplicate values detected. Please correct the errors and resubmit.") ); > return false; > }; >@@ -377,7 +378,7 @@ > $(lastitemblock).remove(); > } > >- if(check_additem('[% UniqueItemFields | html %]') == false){ >+ if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){ > alert(_("Duplicate values detected. Please correct the errors and resubmit.") ); > if(tobedeleted) { > $(lastitemblock).appendTo("#outeritemblock"); >@@ -436,7 +437,7 @@ > [% END %] > > $(document).ready(function() { >- [% IF (AcqCreateItemReceiving) %] >+ [% IF (AcqCreateItem == 'receiving') %] > cloneItemBlock(0, '[% UniqueItemFields | html %]'); > [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %] > $("input[name='items_to_receive']").change(function() { >-- >2.11.0
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 23376
:
91774
|
91857
|
91858
|
110692
|
110693
|
110694
|
111247
|
111248
|
111249
|
111250
|
111378
|
111750
|
131857