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

(-)a/Koha/DiscreteCalendar.pm (+10 lines)
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
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/discrete_calendar.tt (-5 / +5 lines)
Lines 1-11 Link Here
1
[% USE Asset %]
1
[% USE Branches %]
2
[% USE Branches %]
2
[% SET footerjs = 1 %]
3
[% SET footerjs = 1 %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Tools &rsaquo; [% Branches.GetName( branch ) %] calendar</title>
5
<title>Koha &rsaquo; Tools &rsaquo; [% Branches.GetName( branch ) %] calendar</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'calendar.inc' %]
7
[% INCLUDE 'calendar.inc' %]
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
8
[% Asset.css("css/datatables.css") %]
8
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/discretecalendar_[% KOHA_VERSION %].css" />
9
[% Asset.css("css/discretecalendar.css") %]
9
[% INCLUDE 'datatables.inc' %]
10
[% INCLUDE 'datatables.inc' %]
10
</head>
11
</head>
11
12
Lines 165-171 Link Here
165
            <li>Click Save to finish.</li>
166
            <li>Click Save to finish.</li>
166
            <li>PS:
167
            <li>PS:
167
                <ul>
168
                <ul>
168
                    <li>You can't edit passed dates</li>
169
                    <li>Past dates cannot be changed</li>
169
                    <li>Weekly holidays change open/close hours for all the days affected unless inputs are empty</li>
170
                    <li>Weekly holidays change open/close hours for all the days affected unless inputs are empty</li>
170
                </ul>
171
                </ul>
171
            </li>
172
            </li>
Lines 301-307 Link Here
301
</div>
302
</div>
302
</div>
303
</div>
303
[% MACRO jsinclude BLOCK %]
304
[% MACRO jsinclude BLOCK %]
304
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min_[% KOHA_VERSION %].js"></script>
305
[% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
305
<script type="text/javascript">
306
<script type="text/javascript">
306
    //<![CDATA[
307
    //<![CDATA[
307
        var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
308
        var weekdays = new Array(_("Sundays"),_("Mondays"),_("Tuesdays"),_("Wednesdays"),_("Thursdays"),_("Fridays"),_("Saturdays"));
308
- 

Return to bug 17015