diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm index 38646cb73e..2e013ac288 100644 --- a/C4/Acquisition.pm +++ b/C4/Acquisition.pm @@ -1723,6 +1723,7 @@ sub SearchOrders { my $owner = $params->{owner}; my $pending = $params->{pending}; my $ordered = $params->{ordered}; + my $biblionumber = $params->{biblionumber}; my $dbh = C4::Context->dbh; my @args = (); @@ -1782,6 +1783,10 @@ sub SearchOrders { $query .= ' AND ( aqorders.ordernumber = ? OR aqorders_transfers.ordernumber_from = ? ) '; push @args, ( $ordernumber, $ordernumber ); } + if ( $biblionumber ) { + $query .= 'AND aqorders.biblionumber = ?'; + push @args, $biblionumber; + } if( $search ) { $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)'; push @args, ("%$search%","%$search%","%$search%"); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index aff00ab4ab..5e4ce7c6c1 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -211,6 +211,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'), ('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'), ('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'), +('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'), ('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'), ('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'), ('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 01472d7138..36b4ac83dc 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8551,6 +8551,15 @@ if (CheckVersion($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.17.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACAcquisitionDetails','0', '','Show the acquisition details at the OPAC','YesNo') + |); + print "Upgrade to $DBversion done (Bug 11169 - Add OPACAcquisitionDetails syspref)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 839daa89e4..1304cef74a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -460,7 +460,13 @@ OPAC: yes: Allow no: Do not allow - users to add a note when placing a hold. - + - + - pref: OPACAcquisitionDetails + default: 0 + choices: + yes: Display + no: Don't display + - the acquisition details on OPAC detail pages. Policy: - - pref: singleBranchMode diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index f14df9050d..16599de35f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -46,6 +46,8 @@ not use an API to fetch items that populates item.datedue. [% ELSE %] Item damaged [% END %] +[% ELSIF item.on_order %] + On order [% ELSE %] Available [% IF ( item.restrictedopac ) %]([% item.restrictedopac %])[% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index dc6a3ae62d..ecfa2563c4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -633,7 +633,13 @@
This record has many physical items ([% items_count %]). Click here to view them all.
[% ELSIF ( itemloop.size ) %] [% INCLUDE items_table items=itemloop tab="holdings" %] - + [% IF Koha.Preference('OPACAcquisitionDetails') and Koha.Preference('AcqCreateItem') != 'ordering' and acquisition_details.total_quantity > 0 %] + [% IF acquisition_details.total_quantity == 1 %] + 1 item is on order. + [% ELSE %] + [% acquisition_details.total_quantity %] items are on order. + [% END %] + [% END %] [% IF holds_count.defined || priority %]