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

(-)a/C4/Acquisition.pm (+5 lines)
Lines 1494-1499 sub SearchOrders { Link Here
1494
    my $basketgroupname = $params->{basketgroupname};
1494
    my $basketgroupname = $params->{basketgroupname};
1495
    my $owner = $params->{owner};
1495
    my $owner = $params->{owner};
1496
    my $pending = $params->{pending};
1496
    my $pending = $params->{pending};
1497
    my $biblionumber = $params->{biblionumber};
1497
1498
1498
    my $dbh = C4::Context->dbh;
1499
    my $dbh = C4::Context->dbh;
1499
    my @args = ();
1500
    my @args = ();
Lines 1538-1543 sub SearchOrders { Link Here
1538
        $query .= ' AND (aqorders.ordernumber=?)';
1539
        $query .= ' AND (aqorders.ordernumber=?)';
1539
        push @args, $ordernumber;
1540
        push @args, $ordernumber;
1540
    }
1541
    }
1542
    if ( $biblionumber ) {
1543
        $query .= 'AND aqorders.biblionumber = ?';
1544
        push @args, $biblionumber;
1545
    }
1541
    if( $search ) {
1546
    if( $search ) {
1542
        $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)';
1547
        $query .= ' AND (biblio.title LIKE ? OR biblio.author LIKE ? OR biblioitems.isbn LIKE ?)';
1543
        push @args, ("%$search%","%$search%","%$search%");
1548
        push @args, ("%$search%","%$search%","%$search%");
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 199-204 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
199
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
199
('OAI-PMH:ConfFile','',NULL,'If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.','File'),
200
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
200
('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'),
201
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
201
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
202
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
202
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
203
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
203
('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'),
204
('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'),
204
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
205
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+14 lines)
Lines 7596-7601 if ( CheckVersion($DBversion) ) { Link Here
7596
}
7596
}
7597
7597
7598
7598
7599
7600
7601
$DBversion = "3.13.00.XXX";
7602
if ( CheckVersion($DBversion) ) {
7603
    $dbh->do(q|
7604
        INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACAcquisitionDetails','0', '','Show the acquisition details at the OPAC','YesNo')
7605
    |);
7606
    print "Upgrade to $DBversion done (MT12445 - Add OPACAcquisitionDetails syspref)\n";
7607
    SetVersion($DBversion);
7608
}
7609
7610
7611
7612
7599
=head1 FUNCTIONS
7613
=head1 FUNCTIONS
7600
7614
7601
=head2 TableExists($table)
7615
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-1 / +7 lines)
Lines 424-430 OPAC: Link Here
424
                  yes: Allow
424
                  yes: Allow
425
                  no: Do not allow
425
                  no: Do not allow
426
            - users to add a note when placing a hold.
426
            - users to add a note when placing a hold.
427
427
        -
428
            - pref: OPACAcquisitionDetails
429
              default: 0
430
              choices:
431
                  yes: Display
432
                  no: Don't display
433
            - the acquisition details on OPAC detail pages.
428
    Policy:
434
    Policy:
429
        -
435
        -
430
            - pref: singleBranchMode
436
            - pref: singleBranchMode
(-)a/koha-tmpl/opac-tmpl/prog/en/includes/item-status.inc (+2 lines)
Lines 39-44 Link Here
39
    [% ELSE %]
39
    [% ELSE %]
40
        Item damaged
40
        Item damaged
41
    [% END %]
41
    [% END %]
42
[% ELSIF item.on_order %]
43
  On order
42
[% ELSE %]
44
[% ELSE %]
43
    Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
45
    Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
44
[% END %]
46
[% END %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-1 / +20 lines)
Lines 980-985 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
980
        <a href="#subscriptions">Subscriptions</a>
980
        <a href="#subscriptions">Subscriptions</a>
981
    </li>
981
    </li>
982
[% END %]
982
[% END %]
983
[% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.orders.size > 0 %]
984
    <li id="tab_acquisitions"><a href="#acquisition_details">Acquisition details</a></li>
985
[% END %]
983
[% IF ( Koha.Preference( 'reviewson' ) == 1 ) %]
986
[% IF ( Koha.Preference( 'reviewson' ) == 1 ) %]
984
    <li id="tab_comments"><a href="#comments">Comments ( [% reviews.size || 0 %] )</a></li>
987
    <li id="tab_comments"><a href="#comments">Comments ( [% reviews.size || 0 %] )</a></li>
985
[% END %]
988
[% END %]
Lines 1235-1240 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1235
    </div>
1238
    </div>
1236
    [% END %]
1239
    [% END %]
1237
1240
1241
1242
[% IF Koha.Preference('OPACAcquisitionDetails') and acquisition_details.orders.size > 0 %]
1243
  <div id="acquisition_details">
1244
    <h2>Acquisition details</h2>
1245
    [% IF Koha.Preference('AcqCreateItem') == 'ordering' %]
1246
      The following items are on order.
1247
      [% INCLUDE items_table items=acquisition_details.items tab="acquisition_details" noshelfbrowser=1 %]
1248
    [% ELSE %]
1249
      [% acquisition_details.total_quantity %] items are on order.
1250
    [% END %]
1251
  </div>
1252
[% END %]
1253
1254
1255
1256
1238
[% IF ( LibraryThingForLibrariesID ) %] 
1257
[% IF ( LibraryThingForLibrariesID ) %] 
1239
[% IF ( LibraryThingForLibrariesTabbedView ) %]
1258
[% IF ( LibraryThingForLibrariesTabbedView ) %]
1240
	<!-- Library Thing for Libraries Content --> 
1259
	<!-- Library Thing for Libraries Content --> 
Lines 1543-1549 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1543
        <td class="call_no" property="sku">
1562
        <td class="call_no" property="sku">
1544
            [% IF ( ITEM_RESULT.itemcallnumber ) %]
1563
            [% IF ( ITEM_RESULT.itemcallnumber ) %]
1545
                [% ITEM_RESULT.itemcallnumber %]
1564
                [% ITEM_RESULT.itemcallnumber %]
1546
                [% IF ( OPACShelfBrowser ) %]
1565
                [% IF ( OPACShelfBrowser and not noshelfbrowser ) %]
1547
                    [% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
1566
                    [% IF ( ITEM_RESULT.itemnumber == starting_itemnumber ) %]
1548
                        (<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
1567
                        (<a class="close_shelf" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)
1549
                    [% ELSE %]
1568
                    [% ELSE %]
(-)a/opac/opac-detail.pl (-49 / +80 lines)
Lines 25-30 use warnings; Link Here
25
25
26
use CGI;
26
use CGI;
27
use C4::Auth qw(:DEFAULT get_session);
27
use C4::Auth qw(:DEFAULT get_session);
28
use C4::Acquisition qw( SearchOrders );
28
use C4::Branch;
29
use C4::Branch;
29
use C4::Koha;
30
use C4::Koha;
30
use C4::Serials;    #uses getsubscriptionfrom biblionumber
31
use C4::Serials;    #uses getsubscriptionfrom biblionumber
Lines 486-501 if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) { Link Here
486
487
487
my $dat = &GetBiblioData($biblionumber);
488
my $dat = &GetBiblioData($biblionumber);
488
489
489
my $itemtypes = GetItemTypes();
490
our $itemtypes = GetItemTypes();
490
# imageurl:
491
# imageurl:
491
my $itemtype = $dat->{'itemtype'};
492
my $itemtype = $dat->{'itemtype'};
492
if ( $itemtype ) {
493
if ( $itemtype ) {
493
    $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
494
    $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
494
    $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
495
    $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
495
}
496
}
496
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
497
our $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
497
my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
498
our $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
498
my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');
499
our $copynumbers = GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');
499
500
500
#coping with subscriptions
501
#coping with subscriptions
501
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
502
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
Lines 531-537 $dat->{'count'} = scalar(@items); Link Here
531
532
532
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
533
my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
533
534
534
my (%item_reserves, %priority);
535
our (%item_reserves, %priority);
535
my ($show_holds_count, $show_priority);
536
my ($show_holds_count, $show_priority);
536
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
537
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
537
    m/holds/o and $show_holds_count = 1;
538
    m/holds/o and $show_holds_count = 1;
Lines 562-611 if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) { Link Here
562
}
563
}
563
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
564
my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
564
for my $itm (@items) {
565
for my $itm (@items) {
565
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
566
    $itm = _get_items_infos( $itm );
566
    $itm->{priority} = $priority{ $itm->{itemnumber} };
567
    $norequests = 0
568
       if ( (not $itm->{'withdrawn'} )
569
         && (not $itm->{'itemlost'} )
570
         && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
571
		 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
572
         && ($itm->{'itemnumber'} ) );
573
567
574
    # get collection code description, too
575
    my $ccode = $itm->{'ccode'};
576
    $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
577
    my $copynumber = $itm->{'copynumber'};
578
    $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
579
    if ( defined $itm->{'location'} ) {
580
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
581
    }
582
    if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) {
583
        $itm->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
584
        $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
585
    }
586
    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
587
        $itemfields{$_} = 1 if ($itm->{$_});
588
    }
589
590
     # walk through the item-level authorised values and populate some images
591
     my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
592
     # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
593
594
     if ( $itm->{'itemlost'} ) {
595
         my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
596
         $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
597
         $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
598
     }
599
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
600
      if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
601
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
602
    
603
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
604
     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
605
        $itm->{transfertwhen} = $transfertwhen;
606
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
607
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
608
     }
609
    my $itembranch = $itm->{$separatebranch};
568
    my $itembranch = $itm->{$separatebranch};
610
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
569
    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
611
        if ($itembranch and $itembranch eq $currentbranch) {
570
        if ($itembranch and $itembranch eq $currentbranch) {
Lines 1066-1069 if ( C4::Context->preference('UseCourseReserves') ) { Link Here
1066
    }
1025
    }
1067
}
1026
}
1068
1027
1028
if ( C4::Context->preference('OPACAcquisitionDetails') ) {
1029
    my $orders = C4::Acquisition::SearchOrders({
1030
        biblionumber => $biblionumber,
1031
        pending => 1,
1032
    });
1033
1034
    my @items;
1035
    my $total_quantity;
1036
    for my $order ( @$orders ) {
1037
        if ( C4::Context->preference('AcqCreateItem') eq 'ordering' ) {
1038
            for my $itemnumber ( C4::Acquisition::GetItemnumbersFromOrder( $order->{ordernumber} ) ) {
1039
                my $item = C4::Items::GetItem( $itemnumber );
1040
                $item->{on_order} = 1;
1041
                push @items, _get_items_infos( $item );
1042
            }
1043
        }
1044
        $total_quantity += $order->{quantity};
1045
    }
1046
    $template->{VARS}->{acquisition_details} = {
1047
        orders => $orders,
1048
        items => \@items,
1049
        total_quantity => $total_quantity,
1050
    };
1051
}
1052
1069
output_html_with_http_headers $query, $cookie, $template->output;
1053
output_html_with_http_headers $query, $cookie, $template->output;
1070
- 
1054
1055
sub _get_items_infos {
1056
    my ( $itm ) = @_;
1057
    $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
1058
    $itm->{priority} = $priority{ $itm->{itemnumber} };
1059
    $norequests = 0
1060
       if ( (not $itm->{'withdrawn'} )
1061
         && (not $itm->{'itemlost'} )
1062
         && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
1063
         && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
1064
         && ($itm->{'itemnumber'} ) );
1065
1066
    # get collection code description, too
1067
    my $ccode = $itm->{'ccode'};
1068
    $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
1069
    my $copynumber = $itm->{'copynumber'};
1070
    $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
1071
    if ( defined $itm->{'location'} ) {
1072
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
1073
    }
1074
    if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) {
1075
        $itm->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
1076
        $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
1077
    }
1078
    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
1079
        $itemfields{$_} = 1 if ($itm->{$_});
1080
    }
1081
1082
    # walk through the item-level authorised values and populate some images
1083
    my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
1084
1085
    if ( $itm->{'itemlost'} ) {
1086
        my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
1087
        $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
1088
        $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
1089
    }
1090
    my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
1091
     if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
1092
     if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
1093
1094
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
1095
    if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
1096
       $itm->{transfertwhen} = $transfertwhen;
1097
       $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
1098
       $itm->{transfertto}   = $branches->{$transfertto}{branchname};
1099
    }
1100
    return $itm;
1101
}

Return to bug 11169