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

(-)a/C4/HoldsQueue.pm (-1 lines)
Lines 29-35 use C4::Branch; Link Here
29
use C4::Circulation;
29
use C4::Circulation;
30
use C4::Members;
30
use C4::Members;
31
use C4::Biblio;
31
use C4::Biblio;
32
use C4::Dates qw/format_date/;
33
use Koha::DateUtils;
32
use Koha::DateUtils;
34
33
35
use List::Util qw(shuffle);
34
use List::Util qw(shuffle);
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 159-166 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
159
('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'),
159
('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'),
160
('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'),
160
('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'),
161
('HoldFeeMode','not_always','always|not_always','Set the hold fee mode','Choice'),
161
('HoldFeeMode','not_always','always|not_always','Set the hold fee mode','Choice'),
162
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
163
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
162
('HoldsQueueSkipClosed', '0', NULL, 'If enabled, any libraries that are closed when the holds queue is built will be ignored for the purpose of filling holds.', 'YesNo'),
163
('HoldsToPullStartDate','2',NULL,'Set the default start date for the Holds to pull list to this many days ago','Integer'),
164
('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'),
164
('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','Choice'),
165
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
165
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
166
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
166
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
(-)a/t/db_dependent/HoldsQueue.t (-9 / +9 lines)
Lines 8-26 Link Here
8
8
9
use Modern::Perl;
9
use Modern::Perl;
10
10
11
use Test::More tests => 24;
11
use Test::More tests => 26;
12
use Data::Dumper;
12
use Data::Dumper;
13
13
14
use C4::Branch;
14
use C4::Branch;
15
use C4::Members;
16
use Koha::Database;
17
18
use C4::Calendar;
15
use C4::Calendar;
19
use C4::Context;
16
use C4::Context;
20
use C4::Branch;
21
use C4::ItemType;
22
use C4::Members;
17
use C4::Members;
18
use Koha::Database;
23
use Koha::DateUtils;
19
use Koha::DateUtils;
20
use Koha::ItemType;
24
21
25
use t::lib::TestBuilder;
22
use t::lib::TestBuilder;
26
23
Lines 312-324 is( $holds_queue->[1]->{cardnumber}, $borrower2->{cardnumber}, "Holds queue fill Link Here
312
# have 1 row in the holds queue
309
# have 1 row in the holds queue
313
C4::Context->set_preference('HoldsQueueSkipClosed', 1);
310
C4::Context->set_preference('HoldsQueueSkipClosed', 1);
314
my $today = dt_from_string();
311
my $today = dt_from_string();
315
C4::Calendar->new( branchcode => 'MPL' )->insert_single_holiday(
312
C4::Calendar->new( branchcode => $branchcodes[0] )->insert_single_holiday(
316
    day         => $today->day(),
313
    day         => $today->day(),
317
    month       => $today->month(),
314
    month       => $today->month(),
318
    year        => $today->year(),
315
    year        => $today->year(),
319
    title       => "$today",
316
    title       => "$today",
320
    description => "$today",
317
    description => "$today",
321
);
318
);
319
# If the test below is removed, aother tests using the holiday will fail. For some reason if we call is_holiday now
320
# the holiday will get set in cache correctly, but not if we let C4::HoldsQueue call is_holiday instead.
321
is( Koha::Calendar->new( branchcode => $branchcodes[0] )->is_holiday( $today ), 1, 'Is today a holiday for pickup branch' );
322
C4::HoldsQueue::CreateQueue();
322
C4::HoldsQueue::CreateQueue();
323
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} });
323
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} });
324
is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" );
324
is( scalar( @$holds_queue ), 1, "Holds not filled with items from closed libraries" );
Lines 333-344 is( @$holds_queue, 3, "Holds queue filling correct number for holds for default Link Here
333
# Test skipping hold picks for closed libraries without transport cost matrix
333
# Test skipping hold picks for closed libraries without transport cost matrix
334
# At this point in the test, we have 3 rows in the holds queue
334
# At this point in the test, we have 3 rows in the holds queue
335
# one of which is coming from MPL. Let's enable HoldsQueueSkipClosed
335
# one of which is coming from MPL. Let's enable HoldsQueueSkipClosed
336
# and use our previously created holiday for MPL.
336
# and use our previously created holiday for MPL
337
# When we run it again we should only have 2 rows in the holds queue
337
# When we run it again we should only have 2 rows in the holds queue
338
C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 );
338
C4::Context->set_preference( 'HoldsQueueSkipClosed', 1 );
339
C4::HoldsQueue::CreateQueue();
339
C4::HoldsQueue::CreateQueue();
340
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} });
340
$holds_queue = $dbh->selectall_arrayref("SELECT * FROM tmp_holdsqueue", { Slice => {} });
341
is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" );
341
is( scalar( @$holds_queue ), 2, "Holds not filled with items from closed libraries" );
342
C4::Context->set_preference( 'HoldsQueueSkipClosed', 0 );
342
343
343
# Bug 14297
344
# Bug 14297
344
$itemtype = Koha::ItemTypes->search->next->itemtype;
345
$itemtype = Koha::ItemTypes->search->next->itemtype;
345
- 

Return to bug 12803