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

(-)a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc (+77 lines)
Line 0 Link Here
1
<script type="text/javascript">
2
//<![CDATA[
3
4
var debug    = "[% debug %]";
5
var dformat  = "[% dateformat %]";
6
var sentmsg = 0;
7
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
8
9
function Date_from_syspref(dstring) {
10
        var dateX = dstring.split(/[-/]/);
11
        if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
12
        if (dformat === "iso") {
13
                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
14
        } else if (dformat === "us") {
15
                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
16
        } else if (dformat === "metric") {
17
                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
18
        } else {
19
                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
20
                return 0;
21
        }
22
}
23
24
/* Instead of including multiple localization files as you would normally see with
25
   jQueryUI we expose the localization strings in the default configuration */
26
jQuery(function($){
27
    $.datepicker.regional[''] = {
28
        closeText: _('Done'),
29
        prevText: _('Prev'),
30
        nextText: _('Next'),
31
        currentText: _('Today'),
32
        monthNames: [_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),
33
        _('July'),_('August'),_('September'),_('October'),_('November'),_('December')],
34
        monthNamesShort: [_('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'),
35
        _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec')],
36
        dayNames: [_('Sunday'), _('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday')],
37
        dayNamesShort: [_('Sun'), _('Mon'), _('Tue'), _('Wed'), _('Thu'), _('Fri'), _('Sat')],
38
        dayNamesMin: [_('Su'),_('Mo'),_('Tu'),_('We'),_('Th'),_('Fr'),_('Sa')],
39
        weekHeader: _('Wk'),
40
        dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
41
        firstDay: [% CalendarFirstDayOfWeek %],
42
        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
43
        showMonthAfterYear: false,
44
        yearSuffix: ''};
45
    $.datepicker.setDefaults($.datepicker.regional['']);
46
});
47
48
$(document).ready(function(){
49
50
$.datepicker.setDefaults({
51
        showOn: "both",
52
        changeMonth: true,
53
        changeYear: true,
54
        buttonImage: '[% interface %]/lib/famfamfam/silk/calendar.png',
55
        buttonImageOnly: true,
56
        showButtonPanel: true,
57
        showOtherMonths: true
58
    });
59
60
    $( ".datepicker" ).datepicker();
61
    // http://jqueryui.com/demos/datepicker/#date-range
62
    var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
63
        changeMonth: true,
64
        numberOfMonths: 1,
65
        onSelect: function( selectedDate ) {
66
            var option = this.id == "from" ? "minDate" : "maxDate",
67
                instance = $( this ).data( "datepicker" );
68
                date = $.datepicker.parseDate(
69
                    instance.settings.dateFormat ||
70
                    $.datepicker._defaults.dateFormat,
71
                    selectedDate, instance.settings );
72
            dates.not( this ).datepicker( "option", option, date );
73
        }
74
    });
75
});
76
//]]>
77
</script>
(-)a/koha-tmpl/opac-tmpl/prog/en/js/script.js (-24 / +1 lines)
Lines 7-41 function Dopop(link) { Link Here
7
	newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
7
	newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
8
}
8
}
9
9
10
$.datepicker.setDefaults({
11
        showOn: "both",
12
        changeMonth: true,
13
        changeYear: true,
14
        buttonImage: '/opac-tmpl/lib/famfamfam/silk/calendar.png',
15
        buttonImageOnly: true,
16
        showButtonPanel: true
17
    });
18
19
$(document).ready(function(){
10
$(document).ready(function(){
20
	$(".close").click(function(){
11
	$(".close").click(function(){
21
		window.close();
12
		window.close();
22
	});
13
	});
23
	$(".focus").focus();
14
	$(".focus").focus();
24
    $( ".datepicker" ).datepicker();
15
25
    // http://jqueryui.com/demos/datepicker/#date-range
26
    var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
27
        changeMonth: true,
28
        numberOfMonths: 1,
29
        onSelect: function( selectedDate ) {
30
            var option = this.id == "from" ? "minDate" : "maxDate",
31
                instance = $( this ).data( "datepicker" );
32
                date = $.datepicker.parseDate(
33
                    instance.settings.dateFormat ||
34
                    $.datepicker._defaults.dateFormat,
35
                    selectedDate, instance.settings );
36
            dates.not( this ).datepicker( "option", option, date );
37
        }
38
    });
39
	// clear the basket when user logs out
16
	// clear the basket when user logs out
40
	$("#logout").click(function(){
17
	$("#logout").click(function(){
41
		var nameCookie = "bib_list";
18
		var nameCookie = "bib_list";
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (+1 lines)
Lines 1-5 Link Here
1
[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
1
[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
2
[% INCLUDE 'doc-head-close.inc' %]
2
[% INCLUDE 'doc-head-close.inc' %]
3
[% INCLUDE 'calendar.inc' %]
3
<script type="text/javascript">
4
<script type="text/javascript">
4
// <![CDATA[
5
// <![CDATA[
5
 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
6
 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt (-1 / +1 lines)
Lines 3-8 Link Here
3
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home
4
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home
5
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'calendar.inc' %]
6
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.metadata.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.metadata.min.js"></script>
7
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
8
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
8
<script type="text/JavaScript">
9
<script type="text/JavaScript">
9
- 

Return to bug 9166