Lines 3-8
Link Here
|
3 |
[% USE Asset %] |
3 |
[% USE Asset %] |
4 |
[% USE TablesSettings %] |
4 |
[% USE TablesSettings %] |
5 |
[%- USE KohaSpan -%] |
5 |
[%- USE KohaSpan -%] |
|
|
6 |
[% USE KohaTimes %] |
6 |
[% PROCESS 'i18n.inc' %] |
7 |
[% PROCESS 'i18n.inc' %] |
7 |
[% SET footerjs = 1 %] |
8 |
[% SET footerjs = 1 %] |
8 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
[% INCLUDE 'doc-head-open.inc' %] |
Lines 556-562
Link Here
|
556 |
</li> |
557 |
</li> |
557 |
<li> |
558 |
<li> |
558 |
<span class="label">Opening hours: </span> |
559 |
<span class="label">Opening hours: </span> |
559 |
[% IF library.library_hours.count > 0 # Existing library %] |
560 |
[% SET CalendarFirstDayOfWeek = Koha.Preference("CalendarFirstDayOfWeek") %] |
|
|
561 |
[% SET set_hours = 0 %] |
562 |
[% IF library.library_hours.count > 0 %] |
563 |
[% FOR i IN [0..6] %] |
564 |
[% IF library.library_hours.as_list.$i.open_time != null || library.library_hours.as_list.$i.close_time != null %] |
565 |
[% set_hours = 1 %] |
566 |
[% END %] |
567 |
[% END %] |
568 |
[% END %] |
569 |
[% IF set_hours > 0 # Existing library %] |
560 |
[% SET library_hours = library.library_hours.as_list %] |
570 |
[% SET library_hours = library.library_hours.as_list %] |
561 |
<table id="library_hours_table"> |
571 |
<table id="library_hours_table"> |
562 |
<thead> |
572 |
<thead> |
Lines 575-584
Link Here
|
575 |
<span>[% PROCESS dayname day=d %]</span> |
585 |
<span>[% PROCESS dayname day=d %]</span> |
576 |
</td> |
586 |
</td> |
577 |
<td> |
587 |
<td> |
578 |
<span>[% hr.open_time | html %]</span> |
588 |
<span>[% IF hr.open_time != null %][% hr.open_time | $KohaTimes %][% END %]</span> |
579 |
</td> |
589 |
</td> |
580 |
<td> |
590 |
<td> |
581 |
<span>[% hr.close_time | html %]</span> |
591 |
<span>[% IF hr.close_time != null %][% hr.close_time | $KohaTimes %][% END %]</span> |
582 |
</td> |
592 |
</td> |
583 |
</tr> |
593 |
</tr> |
584 |
[% END %] |
594 |
[% END %] |
Lines 757-763
Link Here
|
757 |
{ |
767 |
{ |
758 |
"data": function( row, type, val, meta ) { |
768 |
"data": function( row, type, val, meta ) { |
759 |
let result = ''; |
769 |
let result = ''; |
|
|
770 |
let set_hours = 0; |
760 |
if ( row.library_hours.length > 0 ) { |
771 |
if ( row.library_hours.length > 0 ) { |
|
|
772 |
for (let check_counter = 0; check_counter < 7; check_counter++) { |
773 |
if ( row.library_hours[check_counter].open_time != null || row.library_hours[check_counter].close_time != null ) { |
774 |
set_hours = 1; |
775 |
} |
776 |
} |
777 |
} |
778 |
if ( set_hours > 0 ) { |
761 |
const daysOfWeek = [ _("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday") ]; |
779 |
const daysOfWeek = [ _("Sunday"), _("Monday"), _("Tuesday"), _("Wednesday"), _("Thursday"), _("Friday"), _("Saturday") ]; |
762 |
|
780 |
|
763 |
result = '<table id="library_hours_table"><thead><tr><th>Day</th><th>Open time</th><th>Close time</th></tr></thead><tbody>'; |
781 |
result = '<table id="library_hours_table"><thead><tr><th>Day</th><th>Open time</th><th>Close time</th></tr></thead><tbody>'; |
Lines 766-773
Link Here
|
766 |
const day = i % 7; // Wrap around the day using modulo operator |
784 |
const day = i % 7; // Wrap around the day using modulo operator |
767 |
result += '<tr id="hours_'+day+'">'; |
785 |
result += '<tr id="hours_'+day+'">'; |
768 |
result += '<td>'+daysOfWeek[day]+'</td>'; |
786 |
result += '<td>'+daysOfWeek[day]+'</td>'; |
769 |
result += '<td><span>'+row.library_hours[day].open_time+'</span></td>'; |
787 |
result += '<td><span>'; |
770 |
result += '<td><span>'+row.library_hours[day].close_time+'</span></td>'; |
788 |
result += row.library_hours[day].open_time != null ? $kohatime(row.library_hours[day].open_time): ''; |
|
|
789 |
result += '</span></td>'; |
790 |
result += '<td><span>'; |
791 |
result += row.library_hours[day].close_time != null ? $kohatime(row.library_hours[day].close_time): ''; |
792 |
result += '</span></td>'; |
771 |
result += '</tr>'; |
793 |
result += '</tr>'; |
772 |
counter++; |
794 |
counter++; |
773 |
} |
795 |
} |
774 |
- |
|
|