|
Lines 292-297
Returns an array of all the date objects that are unique holidays.
Link Here
|
| 292 |
|
292 |
|
| 293 |
sub get_unique_holidays { |
293 |
sub get_unique_holidays { |
| 294 |
my $self = shift; |
294 |
my $self = shift; |
|
|
295 |
my $exclude_past = shift || 1; |
| 295 |
my $branchcode = $self->{branchcode}; |
296 |
my $branchcode = $self->{branchcode}; |
| 296 |
my @unique_holidays; |
297 |
my @unique_holidays; |
| 297 |
my $schema = Koha::Database->new->schema; |
298 |
my $schema = Koha::Database->new->schema; |
|
Lines 304-309
sub get_unique_holidays {
Link Here
|
| 304 |
{ |
305 |
{ |
| 305 |
select => [{ DATE => 'date' }, 'note' ], |
306 |
select => [{ DATE => 'date' }, 'note' ], |
| 306 |
as => [qw/ date note/], |
307 |
as => [qw/ date note/], |
|
|
308 |
where => ($exclude_past ? \[' date >= CURRENT_DATE()'] : {} ), |
| 307 |
} |
309 |
} |
| 308 |
); |
310 |
); |
| 309 |
while (my $date = $rs->next()){ |
311 |
while (my $date = $rs->next()){ |
|
Lines 329-334
Returns an array of all the date objects that are float holidays.
Link Here
|
| 329 |
|
331 |
|
| 330 |
sub get_float_holidays { |
332 |
sub get_float_holidays { |
| 331 |
my $self = shift; |
333 |
my $self = shift; |
|
|
334 |
my $exclude_past = shift || 1; |
| 332 |
my $branchcode = $self->{branchcode}; |
335 |
my $branchcode = $self->{branchcode}; |
| 333 |
my @float_holidays; |
336 |
my @float_holidays; |
| 334 |
my $schema = Koha::Database->new->schema; |
337 |
my $schema = Koha::Database->new->schema; |
|
Lines 341-346
sub get_float_holidays {
Link Here
|
| 341 |
{ |
344 |
{ |
| 342 |
select => [{ DATE => 'date' }, 'note' ], |
345 |
select => [{ DATE => 'date' }, 'note' ], |
| 343 |
as => [qw/ date note/], |
346 |
as => [qw/ date note/], |
|
|
347 |
where => ($exclude_past ? \[' date >= CURRENT_DATE()'] : {} ), |
| 344 |
} |
348 |
} |
| 345 |
); |
349 |
); |
| 346 |
while (my $date = $rs->next()){ |
350 |
while (my $date = $rs->next()){ |
|
Lines 366-371
Returns an array of all the date objects that are float holidays in need of vali
Link Here
|
| 366 |
|
370 |
|
| 367 |
sub get_need_validation_holidays { |
371 |
sub get_need_validation_holidays { |
| 368 |
my $self = shift; |
372 |
my $self = shift; |
|
|
373 |
my $exclude_past = shift || 1; |
| 369 |
my $branchcode = $self->{branchcode}; |
374 |
my $branchcode = $self->{branchcode}; |
| 370 |
my @need_validation_holidays; |
375 |
my @need_validation_holidays; |
| 371 |
my $schema = Koha::Database->new->schema; |
376 |
my $schema = Koha::Database->new->schema; |
|
Lines 378-383
sub get_need_validation_holidays {
Link Here
|
| 378 |
{ |
383 |
{ |
| 379 |
select => [{ DATE => 'date' }, 'note' ], |
384 |
select => [{ DATE => 'date' }, 'note' ], |
| 380 |
as => [qw/ date note/], |
385 |
as => [qw/ date note/], |
|
|
386 |
where => ($exclude_past ? \[' date >= CURRENT_DATE()'] : {} ), |
| 381 |
} |
387 |
} |
| 382 |
); |
388 |
); |
| 383 |
while (my $date = $rs->next()){ |
389 |
while (my $date = $rs->next()){ |
|
Lines 403-408
Returns an array of all the date objects that are repeatable holidays.
Link Here
|
| 403 |
|
409 |
|
| 404 |
sub get_repeatable_holidays { |
410 |
sub get_repeatable_holidays { |
| 405 |
my $self = shift; |
411 |
my $self = shift; |
|
|
412 |
my $exclude_past = shift || 1; |
| 406 |
my $branchcode = $self->{branchcode}; |
413 |
my $branchcode = $self->{branchcode}; |
| 407 |
my @repeatable_holidays; |
414 |
my @repeatable_holidays; |
| 408 |
my $schema = Koha::Database->new->schema; |
415 |
my $schema = Koha::Database->new->schema; |
|
Lines 416-421
sub get_repeatable_holidays {
Link Here
|
| 416 |
{ |
423 |
{ |
| 417 |
select => \[ 'distinct DAY(date), MONTH(date), note'], |
424 |
select => \[ 'distinct DAY(date), MONTH(date), note'], |
| 418 |
as => [qw/ day month note/], |
425 |
as => [qw/ day month note/], |
|
|
426 |
where => ($exclude_past ? \[' date >= CURRENT_DATE()'] : {} ), |
| 419 |
} |
427 |
} |
| 420 |
); |
428 |
); |
| 421 |
|
429 |
|
|
Lines 440-445
Returns an array of all the date objects that are weekly holidays.
Link Here
|
| 440 |
|
448 |
|
| 441 |
sub get_week_days_holidays { |
449 |
sub get_week_days_holidays { |
| 442 |
my $self = shift; |
450 |
my $self = shift; |
|
|
451 |
my $exclude_past = shift || 1; |
| 443 |
my $branchcode = $self->{branchcode}; |
452 |
my $branchcode = $self->{branchcode}; |
| 444 |
my @week_days; |
453 |
my @week_days; |
| 445 |
my $schema = Koha::Database->new->schema; |
454 |
my $schema = Koha::Database->new->schema; |
|
Lines 453-458
sub get_week_days_holidays {
Link Here
|
| 453 |
select => [{ DAYOFWEEK => 'date'}, 'note'], |
462 |
select => [{ DAYOFWEEK => 'date'}, 'note'], |
| 454 |
as => [qw/ weekday note /], |
463 |
as => [qw/ weekday note /], |
| 455 |
distinct => 1, |
464 |
distinct => 1, |
|
|
465 |
where => ($exclude_past ? \[' date >= CURRENT_DATE()'] : {} ), |
| 456 |
} |
466 |
} |
| 457 |
); |
467 |
); |
| 458 |
|
468 |
|