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

(-)a/C4/Acquisition.pm (+5 lines)
Lines 1723-1728 sub SearchOrders { Link Here
1723
    my $owner = $params->{owner};
1723
    my $owner = $params->{owner};
1724
    my $pending = $params->{pending};
1724
    my $pending = $params->{pending};
1725
    my $ordered = $params->{ordered};
1725
    my $ordered = $params->{ordered};
1726
    my $biblionumber = $params->{biblionumber};
1726
1727
1727
    my $dbh = C4::Context->dbh;
1728
    my $dbh = C4::Context->dbh;
1728
    my @args = ();
1729
    my @args = ();
Lines 1782-1787 sub SearchOrders { Link Here
1782
        $query .= ' AND ( aqorders.ordernumber = ? OR aqorders_transfers.ordernumber_from = ? ) ';
1783
        $query .= ' AND ( aqorders.ordernumber = ? OR aqorders_transfers.ordernumber_from = ? ) ';
1783
        push @args, ( $ordernumber, $ordernumber );
1784
        push @args, ( $ordernumber, $ordernumber );
1784
    }
1785
    }
1786
    if ( $biblionumber ) {
1787
        $query .= 'AND aqorders.biblionumber = ?';
1788
        push @args, $biblionumber;
1789
    }
1785
    if( $search ) {
1790
    if( $search ) {
1786
        $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)';
1791
        $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)';
1787
        push @args, ("%$search%","%$search%","%$search%");
1792
        push @args, ("%$search%","%$search%","%$search%");
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 210-215 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
210
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
210
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
211
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
211
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
212
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
212
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
213
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
213
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
214
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
214
('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'),
215
('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'),
215
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
216
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+12 lines)
Lines 8471-8476 if ( CheckVersion($DBversion) ) { Link Here
8471
    SetVersion($DBversion);
8471
    SetVersion($DBversion);
8472
}
8472
}
8473
8473
8474
$DBversion = "3.15.00.XXX";
8475
if ( CheckVersion($DBversion) ) {
8476
    $dbh->do(q|
8477
        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACAcquisitionDetails','0', '','Show the acquisition details at the OPAC','YesNo')
8478
    |);
8479
    print "Upgrade to $DBversion done (Bug 11169 - Add OPACAcquisitionDetails syspref)\n";
8480
    SetVersion($DBversion);
8481
}
8482
8483
8484
8485
8474
=head1 FUNCTIONS
8486
=head1 FUNCTIONS
8475
8487
8476
=head2 TableExists($table)
8488
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +7 lines)
Lines 444-450 OPAC: Link Here
444
                  yes: Allow
444
                  yes: Allow
445
                  no: Do not allow
445
                  no: Do not allow
446
            - users to add a note when placing a hold.
446
            - users to add a note when placing a hold.
447
447
        -
448
            - pref: OPACAcquisitionDetails
449
              default: 0
450
              choices:
451
                  yes: Display
452
                  no: Don't display
453
            - the acquisition details on OPAC detail pages.
448
    Policy:
454
    Policy:
449
        -
455
        -
450
            - pref: singleBranchMode
456
            - pref: singleBranchMode
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (+2 lines)
Lines 46-51 not use an API to fetch items that populates item.datedue. Link Here
46
    [% ELSE %]
46
    [% ELSE %]
47
        Item damaged
47
        Item damaged
48
    [% END %]
48
    [% END %]
49
[% ELSIF item.on_order %]
50
  On order
49
[% ELSE %]
51
[% ELSE %]
50
    Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
52
    Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
51
[% END %]
53
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +7 lines)
Lines 632-638 Link Here
632
                            <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
632
                            <p>This record has many physical items ([% items_count %]). <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1">Click here to view them all.</a></p>
633
                        [% ELSIF ( itemloop.size ) %]
633
                        [% ELSIF ( itemloop.size ) %]
634
                            [% INCLUDE items_table items=itemloop tab="holdings" %]
634
                            [% INCLUDE items_table items=itemloop tab="holdings" %]
635
635
                            [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %]
636
                              [% IF acquisition_details.total_quantity == 1 %]
637
                                1 item is on order.
638
                              [% ELSE %]
639
                                [% acquisition_details.total_quantity %] items are on order.
640
                              [% END %]
641
                            [% END %]
636
                            [% IF holds_count.defined || priority %]
642
                            [% IF holds_count.defined || priority %]
637
                                <div id="bib_holds">
643
                                <div id="bib_holds">
638
                                    [% IF holds_count.defined %]
644
                                    [% IF holds_count.defined %]
(-)a/opac/opac-detail.pl (+26 lines)
Lines 24-29 use strict; Link Here
24
use warnings;
24
use warnings;
25
25
26
use CGI;
26
use CGI;
27
use C4::Acquisition qw( SearchOrders );
27
use C4::Auth qw(:DEFAULT get_session);
28
use C4::Auth qw(:DEFAULT get_session);
28
use C4::Branch;
29
use C4::Branch;
29
use C4::Koha;
30
use C4::Koha;
Lines 596-601 if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { Link Here
596
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
597
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
597
my $viewallitems = $query->param('viewallitems');
598
my $viewallitems = $query->param('viewallitems');
598
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
599
my $max_items_to_display = C4::Context->preference('OpacMaxItemsToDisplay') // 50;
600
601
# Get items on order
602
my ( $items_on_order, $orders );
603
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
604
    $orders = C4::Acquisition::SearchOrders({
605
        biblionumber => $biblionumber,
606
        pending => 1,
607
    });
608
    my $total_quantity = 0;
609
    for my $order ( @$orders ) {
610
        if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
611
            for my $itemnumber ( C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ) {
612
                my $item = C4::Items::GetItem( $itemnumber );
613
                $item->{on_order} = 1;
614
                $item->{branchname} = C4::Branch::GetBranchName( $item->{holdingbranch} );
615
                push @items, $item;
616
            }
617
        }
618
        $total_quantity += $order->{quantity};
619
    }
620
    $template->{VARS}->{acquisition_details} = {
621
        total_quantity => $total_quantity,
622
    };
623
}
624
599
if ( not $viewallitems and @items > $max_items_to_display ) {
625
if ( not $viewallitems and @items > $max_items_to_display ) {
600
    $template->param(
626
    $template->param(
601
        too_many_items => 1,
627
        too_many_items => 1,
(-)a/t/db_dependent/Acquisition.t (-2 / +5 lines)
Lines 8-14 use POSIX qw(strftime); Link Here
8
8
9
use C4::Bookseller qw( GetBookSellerFromId );
9
use C4::Bookseller qw( GetBookSellerFromId );
10
10
11
use Test::More tests => 76;
11
use Test::More tests => 77;
12
12
13
BEGIN {
13
BEGIN {
14
    use_ok('C4::Acquisition');
14
    use_ok('C4::Acquisition');
Lines 798-803 $search_orders = SearchOrders({ Link Here
798
});
798
});
799
is( scalar (@$search_orders), 3, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" );
799
is( scalar (@$search_orders), 3, "SearchOrders with pending and ordered params gets only pending ordered orders. After closing the basket, orders are marked as 'ordered' (bug 11170)" );
800
800
801
$search_orders = SearchOrders({
802
    ordernumber => $ordernumbers[4]
803
});
804
is( scalar (@$search_orders), 1, "SearchOrders takes into account the ordernumber filter" );
801
805
802
#
806
#
803
# Test AddClaim
807
# Test AddClaim
804
- 

Return to bug 11169