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 211-216 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
211
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
211
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
212
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
212
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
213
('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
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
214
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
214
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
215
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','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'),
216
('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'),
216
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
217
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 8551-8556 if (CheckVersion($DBversion)) { Link Here
8551
    SetVersion($DBversion);
8551
    SetVersion($DBversion);
8552
}
8552
}
8553
8553
8554
$DBversion = "3.17.00.XXX";
8555
if ( CheckVersion($DBversion) ) {
8556
    $dbh->do(q|
8557
        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACAcquisitionDetails','0', '','Show the acquisition details at the OPAC','YesNo')
8558
    |);
8559
    print "Upgrade to $DBversion done (Bug 11169 - Add OPACAcquisitionDetails syspref)\n";
8560
    SetVersion($DBversion);
8561
}
8562
8554
=head1 FUNCTIONS
8563
=head1 FUNCTIONS
8555
8564
8556
=head2 TableExists($table)
8565
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +7 lines)
Lines 460-466 OPAC: Link Here
460
                  yes: Allow
460
                  yes: Allow
461
                  no: Do not allow
461
                  no: Do not allow
462
            - users to add a note when placing a hold.
462
            - users to add a note when placing a hold.
463
463
        -
464
            - pref: OPACAcquisitionDetails
465
              default: 0
466
              choices:
467
                  yes: Display
468
                  no: Don't display
469
            - the acquisition details on OPAC detail pages.
464
    Policy:
470
    Policy:
465
        -
471
        -
466
            - pref: singleBranchMode
472
            - 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 (-2 / +16 lines)
Lines 633-639 Link Here
633
                            <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
                            <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>
634
                        [% ELSIF ( itemloop.size ) %]
634
                        [% ELSIF ( itemloop.size ) %]
635
                            [% INCLUDE items_table items=itemloop tab="holdings" %]
635
                            [% INCLUDE items_table items=itemloop tab="holdings" %]
636
636
                            [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %]
637
                              [% IF acquisition_details.total_quantity == 1 %]
638
                                1 item is on order.
639
                              [% ELSE %]
640
                                [% acquisition_details.total_quantity %] items are on order.
641
                              [% END %]
642
                            [% END %]
637
                            [% IF holds_count.defined || priority %]
643
                            [% IF holds_count.defined || priority %]
638
                                <div id="bib_holds">
644
                                <div id="bib_holds">
639
                                    [% IF holds_count.defined %]
645
                                    [% IF holds_count.defined %]
Lines 654-660 Link Here
654
                                    <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div>
660
                                    <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div>
655
                                [% END %]
661
                                [% END %]
656
                            [% ELSE %]
662
                            [% ELSE %]
657
                                <div id="noitems">No physical items for this record</div>
663
                                [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %]
664
                                  [% IF acquisition_details.total_quantity == 1 %]
665
                                    1 item is on order.
666
                                  [% ELSE %]
667
                                    [% acquisition_details.total_quantity %] items are on order.
668
                                  [% END %]
669
                                [% ELSE %]
670
                                    <div id="noitems">No physical items for this record</div>
671
                                [% END %]
658
                            [% END %]
672
                            [% END %]
659
                        [% END # IF itemloop.size %]
673
                        [% END # IF itemloop.size %]
660
                        [% PROCESS 'shelfbrowser.inc' %]
674
                        [% PROCESS 'shelfbrowser.inc' %]
(-)a/opac/opac-detail.pl (+31 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 ( @itemnumbers_on_order );
603
if ( C4::Context->preference('OPACAcquisitionDetails' ) ) {
604
    my $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
                push @itemnumbers_on_order, $itemnumber;
613
            }
614
        }
615
        $total_quantity += $order->{quantity};
616
    }
617
    $template->{VARS}->{acquisition_details} = {
618
        total_quantity => $total_quantity,
619
    };
620
}
621
599
if ( not $viewallitems and @items > $max_items_to_display ) {
622
if ( not $viewallitems and @items > $max_items_to_display ) {
600
    $template->param(
623
    $template->param(
601
        too_many_items => 1,
624
        too_many_items => 1,
Lines 647-652 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
647
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
670
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
648
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
671
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
649
     }
672
     }
673
    
674
    if (    C4::Context->preference('OPACAcquisitionDetails')
675
        and C4::Context->preference('AcqCreateItem') eq 'ordering' )
676
    {
677
        $itm->{on_order} = 1
678
          if grep /^$itm->{itemnumber}$/, @itemnumbers_on_order;
679
    }
680
650
    my $itembranch = $itm->{$separatebranch};
681
    my $itembranch = $itm->{$separatebranch};
651
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
682
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
652
        if ($itembranch and $itembranch eq $currentbranch) {
683
        if ($itembranch and $itembranch eq $currentbranch) {
(-)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