Bug 21511: Don't show acquisition details on subscription detail when there is no acq data

This patch modifies the subscription detail page so that acquisitions
details section is not shown when there is no acquisitions data.

The acquisitions details are moved into a new tab similar to how it
appears on the bibliographic details page. A count of orders is now
passed to the template so that the check for existing acquisitions data
will work correctly.

To test, apply the patch and view the detail page for subscriptions.

- When viewing a subscription for which there are orders you should see
  an "Acquisitions details" tab containing the acquisitions data.
- When viewing a subscription with no orders the tab should not appear.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2018-10-09 17:19:09 +00:00 committed by Nick Clemens
parent 0081120255
commit 777e29e420
2 changed files with 7 additions and 1 deletions

View file

@ -65,6 +65,11 @@
<li><a href="#subscription_planning">Planning</a></li> <li><a href="#subscription_planning">Planning</a></li>
<li><a href="#subscription_issues">Issues</a></li> <li><a href="#subscription_issues">Issues</a></li>
<li><a href="#subscription_summary">Summary</a></li> <li><a href="#subscription_summary">Summary</a></li>
[% IF order_count %]
<li>
<a href="#acquisition_details">Acquisition details</a>
</li>
[% END %]
</ul> </ul>
<div id="subscription_info"> <div id="subscription_info">
@ -340,7 +345,7 @@
</div> </div>
</div> </div>
[% IF orders %] [% IF order_count %]
<div id="acquisition_details"> <div id="acquisition_details">
<h2>Acquisition details</h2> <h2>Acquisition details</h2>
<table id="orders"> <table id="orders">

View file

@ -148,6 +148,7 @@ $template->param(
irregular_issues => scalar @irregular_issues, irregular_issues => scalar @irregular_issues,
default_bib_view => $default_bib_view, default_bib_view => $default_bib_view,
orders => $orders, orders => $orders,
order_count => $orders->count,
(uc(C4::Context->preference("marcflavour"))) => 1, (uc(C4::Context->preference("marcflavour"))) => 1,
); );