View | Details | Raw Unified | Return to bug 8230
Collapse All | Expand All

(-)a/C4/Acquisition.pm (-1 / +9 lines)
Lines 2036-2041 sub GetHistory { Link Here
2036
    my $basketgroupname = $params{basketgroupname};
2036
    my $basketgroupname = $params{basketgroupname};
2037
    my $budget = $params{budget};
2037
    my $budget = $params{budget};
2038
    my $orderstatus = $params{orderstatus};
2038
    my $orderstatus = $params{orderstatus};
2039
    my $biblionumber = $params{biblionumber};
2040
    my $get_canceled_order = $params{get_canceled_order} || 0;
2039
2041
2040
    my @order_loop;
2042
    my @order_loop;
2041
    my $total_qty         = 0;
2043
    my $total_qty         = 0;
Lines 2087-2096 sub GetHistory { Link Here
2087
2089
2088
    $query .= " WHERE 1 ";
2090
    $query .= " WHERE 1 ";
2089
2091
2090
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') " if $orderstatus ne '4';
2092
    $query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
2093
        if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne '4' );
2091
2094
2092
    my @query_params  = ();
2095
    my @query_params  = ();
2093
2096
2097
    if ( $biblionumber ) {
2098
        $query .= " AND biblio.biblionumber = ?";
2099
        push @query_params, $biblionumber;
2100
    }
2101
2094
    if ( $title ) {
2102
    if ( $title ) {
2095
        $query .= " AND biblio.title LIKE ? ";
2103
        $query .= " AND biblio.title LIKE ? ";
2096
        $title =~ s/\s+/%/g;
2104
        $title =~ s/\s+/%/g;
(-)a/catalogue/detail.pl (-2 / +14 lines)
Lines 20-25 use strict; Link Here
20
use warnings;
20
use warnings;
21
21
22
use CGI;
22
use CGI;
23
use C4::Acquisition qw( GetHistory GetItemnumbersFromOrder );
23
use C4::Auth;
24
use C4::Auth;
24
use C4::Dates qw/format_date/;
25
use C4::Dates qw/format_date/;
25
use C4::Koha;
26
use C4::Koha;
Lines 42-49 use C4::Images; Link Here
42
use Koha::DateUtils;
43
use Koha::DateUtils;
43
use C4::HTML5Media;
44
use C4::HTML5Media;
44
45
45
# use Smart::Comments;
46
47
my $query = CGI->new();
46
my $query = CGI->new();
48
47
49
my $analyze = $query->param('analyze');
48
my $analyze = $query->param('analyze');
Lines 164-169 foreach my $subscription (@subscriptions) { Link Here
164
    push @subs, \%cell;
163
    push @subs, \%cell;
165
}
164
}
166
165
166
167
# Get acquisition details
168
my ( $orders, $qty, $price, $received ) = C4::Acquisition::GetHistory( biblionumber => $biblionumber, get_canceled_order => 1 );
169
if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
170
    for my $order ( @$orders ) {
171
        $order->{itemnumbers} = [ C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ];
172
    }
173
}
174
$template->param(
175
    orders => $orders,
176
    AcquisitionDetails => C4::Context->preference('AcquisitionDetails'),
177
);
178
167
if ( defined $dat->{'itemtype'} ) {
179
if ( defined $dat->{'itemtype'} ) {
168
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
180
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
169
}
181
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 423-425 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( Link Here
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
426
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo');
(-)a/installer/data/mysql/updatedatabase.pl (+13 lines)
Lines 6788-6793 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
6788
    SetVersion($DBversion);
6788
    SetVersion($DBversion);
6789
}
6789
}
6790
6790
6791
6792
6793
6794
6795
6796
$DBversion = "3.13.00.XXX";
6797
if ( CheckVersion($DBversion) ) {
6798
   $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo');");
6799
   print "Upgrade to $DBversion done (Bug 8230: Add AcquisitionDetails)\n";
6800
   SetVersion ($DBversion);
6801
}
6802
6803
6791
=head1 FUNCTIONS
6804
=head1 FUNCTIONS
6792
6805
6793
=head2 TableExists($table)
6806
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (+6 lines)
Lines 176-178 Cataloging: Link Here
176
            - pref: NotesBlacklist
176
            - pref: NotesBlacklist
177
              class: multi
177
              class: multi
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
178
            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
179
        -
180
            - pref: AcquisitionDetails
181
              choices:
182
                  yes: Display
183
                  no: "Don't display"
184
            - acquisition details on the biblio detail page.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +65 lines)
Lines 1-3 Link Here
1
[% USE KohaDates %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'greybox.inc' %]
3
[% INCLUDE 'greybox.inc' %]
3
<title>Koha &rsaquo; Catalog &rsaquo;
4
<title>Koha &rsaquo; Catalog &rsaquo;
Lines 117-122 function verify_images() { Link Here
117
            table.before(link);
118
            table.before(link);
118
            deactivate_filters(id);
119
            deactivate_filters(id);
119
        }
120
        }
121
        [% IF AcquisitionDetails %]
122
            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
123
                'sDom': 't',
124
                'bPaginate': false,
125
                'bAutoWidth': false,
126
                "aaSorting": [[ 2, "desc" ]],
127
                "aoColumnDefs": [
128
                    { "aTargets": [ 2, 3 ], "sType": "title-string" }
129
                ]
130
            }));
131
132
        [% END %]
120
    });
133
    });
121
//]]>
134
//]]>
122
</script>
135
</script>
Lines 345-350 function verify_images() { Link Here
345
    [% END %]
358
    [% END %]
346
<li><a href="#description">Descriptions</a></li>
359
<li><a href="#description">Descriptions</a></li>
347
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
360
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
361
[% IF AcquisitionDetails %]<li><a href="#acq_details">Acquisition details</a></li>[% END %]
348
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
362
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
349
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
363
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
350
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
364
[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
Lines 629-634 function verify_images() { Link Here
629
</div>
643
</div>
630
[% END %]
644
[% END %]
631
645
646
[% IF AcquisitionDetails %]
647
<div id="acq_details">
648
  [% IF orders %]
649
    <table id="orders">
650
      <thead>
651
        <tr>
652
          <th>Basket</th>
653
          <th>Ordernumber</th>
654
          <th>Creation date</th>
655
          <th>Receive date</th>
656
          <th>Status</th>
657
          <th>Quantity / items</th>
658
        </tr>
659
      </thead>
660
      <tbody>
661
      [% FOR order IN orders %]
662
          <tr>
663
            <td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketname %]</a></td>
664
            <td>[% order.ordernumber %]</td>
665
            <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates%]</span></td>
666
            <td><span title="[% order.datereceived %]">[% order.datereceived | $KohaDates%]</span></td>
667
            <td>
668
              [% SWITCH order.orderstatus %]
669
                [% CASE '0' %]New
670
                [% CASE '1' %]Ordered
671
                [% CASE '2' %]Partial
672
                [% CASE '3' %]Complete
673
                [% CASE '4' %]Deleted
674
              [% END %]
675
            </td>
676
            <td>
677
              [% order.quantity %]
678
              [% IF order.itemnumbers.size > 0 && order.orderstatus != '4' %]
679
                (
680
                  [% FOR itemnumber IN order.itemnumbers %]
681
                    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblionumber %]#item[% itemnumber %]">[% itemnumber %]</a>
682
                    [%- UNLESS loop.last %],[% END %]
683
                  [% END %]
684
                )
685
              [% END %]
686
            </th>
687
          </tr>
688
      [% END %]
689
      </tbody>
690
    </table>
691
  [% ELSE %]
692
    There is no order for this biblio.
693
  [% END %]
694
</div>
695
[% END %]
696
632
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
697
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
633
<div id="editions"><h4>Editions</h4>
698
<div id="editions"><h4>Editions</h4>
634
<table>
699
<table>
635
- 

Return to bug 8230