Bug 11397: Remove the itemnumber list on the Acquisition detail tab
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 16 Dec 2013 10:57:15 +0000 (11:57 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 23 Jan 2014 16:41:43 +0000 (16:41 +0000)
The list of links to items from the acquisitions tab can be
unwieldy if an order was used to purchase a lot of them, and the
availability of AcqItemSetSubfieldsWhenReceived and filters on the
holdings table provide alternative ways to do things like turn
off on-order statuses.

Test plan:
- verify this patch does not introduce regression on the enhancement
  introduced by bug 8230.
- verify the itemnumber list does not appears anymore.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
The acquisitions details tab on the holdings table in the staff
client no longer shows the links to the items. Tests pass.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
In my tests the itemnumbers didn't show up on the acquisition
detail tab before the patch. So the patch visually only changed
the column header for me. All other acquisition related information
showed up ok.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index a3df03b..9cbf7f2 100755 (executable)
@@ -20,7 +20,7 @@ use strict;
 use warnings;
 
 use CGI;
-use C4::Acquisition qw( GetHistory GetItemnumbersFromOrder );
+use C4::Acquisition qw( GetHistory );
 use C4::Auth;
 use C4::Dates qw/format_date/;
 use C4::Koha;
@@ -167,16 +167,12 @@ foreach my $subscription (@subscriptions) {
 
 
 # Get acquisition details
-my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
-if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
-    for my $order ( @$orders ) {
-        $order->{itemnumbers} = [ C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ];
-    }
+if ( C4::Context->preference('AcquisitionDetails') ) {
+    my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
+    $template->param(
+        orders => $orders,
+    );
 }
-$template->param(
-    orders => $orders,
-    AcquisitionDetails => C4::Context->preference('AcquisitionDetails'),
-);
 
 if ( defined $dat->{'itemtype'} ) {
     $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
index ceb34fe..dd8487e 100644 (file)
@@ -1,3 +1,4 @@
+[% USE Koha %]
 [% USE KohaDates %]
 [% USE AuthorisedValues %]
 [% USE KohaDates %]
@@ -256,7 +257,7 @@ function verify_images() {
             table.before(link);
             deactivate_filters(id);
         }
-        [% IF AcquisitionDetails %]
+        [% IF Koha.Preference('AcquisitionDetails') %]
             $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
                 'sDom': 't',
                 'bPaginate': false,
@@ -496,7 +497,7 @@ function verify_images() {
     [% END %]
 [% IF ( MARCNOTES || notes ) %]<li><a href="#description">Descriptions</a></li>[% END %]
 [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
-[% IF AcquisitionDetails %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
+[% IF Koha.Preference('AcquisitionDetails') %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
 [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
 [% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
@@ -825,7 +826,7 @@ function verify_images() {
 </div>
 [% END %]
 
-[% IF AcquisitionDetails %]
+[% IF Koha.Preference('AcquisitionDetails') %]
 <div id="acq_details">
   [% IF orders %]
     <table id="orders">
@@ -837,7 +838,7 @@ function verify_images() {
           <th>Creation date</th>
           <th>Receive date</th>
           <th>Status</th>
-          <th>Quantity / items</th>
+          <th>Quantity</th>
         </tr>
       </thead>
       <tbody>
@@ -869,17 +870,7 @@ function verify_images() {
                 [% CASE 'cancelled' %]Cancelled
               [% END %]
             </td>
-            <td>
-              [% order.quantity %]
-              [% IF order.itemnumbers.size > 0 && order.orderstatus != 'cancelled' %]
-                (
-                  [% FOR itemnumber IN order.itemnumbers %]
-                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]#item[% itemnumber %]">[% itemnumber %]</a>
-                    [%- UNLESS loop.last %],[% END %]
-                  [% END %]
-                )
-              [% END %]
-            </th>
+            <td>[% order.quantity %]</th>
           </tr>
       [% END %]
       </tbody>