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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt (-47 / +46 lines)
Lines 1-58 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Administration &rsaquo; System preferences</title>
4
<title>Koha &rsaquo; Administration &rsaquo; System preferences</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6
[% INCLUDE 'datatables.inc' %]
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/preferences.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/preferences.css" />
8
[% IF ( bidi ) %]
9
   <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" />
10
[% END %]
11
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
12
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/multiple-select/jquery.multiple.select.js"></script>
13
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/plugins/multiple-select/multiple-select.css" />
8
<link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/plugins/multiple-select/multiple-select.css" />
14
<script type="text/javascript">
15
//<![CDATA[
16
    [% UNLESS ( searchfield ) %]$(document).ready(function(){
17
            $('#toolbar').fixFloat();
18
        });[% END %]
19
20
    $(document).ready(function(){
21
        $("select[multiple='multiple']").multipleSelect( {
22
            placeholder: _("Please select ..."),
23
            selectAllText: _("Select all"),
24
            allSelected: _("All selected"),
25
            countSelected: _("# of % selected"),
26
            noMatchesFound: _("No matches found")
27
        } );
28
        $(".force_reload").on("click",function(e){
29
            e.preventDefault();
30
            window.location.reload(true);
31
        });
32
    });
33
    // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
34
    var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
35
    var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
36
    var MSG_NOTHING_TO_SAVE = _("Nothing to save");
37
    var MSG_SAVING = _("Saving...");
38
    var MSG_SAVED_PREFERENCE = _("Saved preference %s");
39
    var MSG_MODIFIED = _("modified");
40
    var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
41
    var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
42
    var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
43
    var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" );
44
    var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
45
    var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
46
    var MSG_LOADING = _( "Loading..." );
47
48
//]]>
49
</script>
50
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/humanmsg.css" />
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/humanmsg.css" />
51
<script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
52
<script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
53
<script src="[% interface %]/[% theme %]/js/pages/preferences.js" type="text/javascript"></script>
54
[%# Add WYSIWYG editor for htmlarea system preferences %]
55
[% INCLUDE 'wysiwyg-systempreferences.inc' %]
56
</head>
10
</head>
57
<body id="admin_preferences" class="admin">
11
<body id="admin_preferences" class="admin">
58
[% INCLUDE 'header.inc' %]
12
[% INCLUDE 'header.inc' %]
Lines 195-198 Link Here
195
[% INCLUDE 'prefs-menu.inc' %]
149
[% INCLUDE 'prefs-menu.inc' %]
196
</div>
150
</div>
197
</div>
151
</div>
152
153
[% MACRO jsinclude BLOCK %]
154
    [% INCLUDE 'datatables.inc' %]
155
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
156
    <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/multiple-select/jquery.multiple.select.js"></script>
157
    <script type="text/javascript">
158
        [% UNLESS ( searchfield ) %]$(document).ready(function(){
159
                $('#toolbar').fixFloat();
160
            });[% END %]
161
162
        $(document).ready(function(){
163
            $("select[multiple='multiple']").multipleSelect( {
164
                placeholder: _("Please select ..."),
165
                selectAllText: _("Select all"),
166
                allSelected: _("All selected"),
167
                countSelected: _("# of % selected"),
168
                noMatchesFound: _("No matches found")
169
            } );
170
            $(".force_reload").on("click",function(e){
171
                e.preventDefault();
172
                window.location.reload(true);
173
            });
174
        });
175
        // This is here because of its dependence on template variables, everything else should go in js/pages/preferences.js - jpw
176
        var to_highlight = "[% searchfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
177
        var search_jumped = [% IF ( search_jumped ) %]true[% ELSE %]false[% END %];
178
        var MSG_NOTHING_TO_SAVE = _("Nothing to save");
179
        var MSG_SAVING = _("Saving...");
180
        var MSG_SAVED_PREFERENCE = _("Saved preference %s");
181
        var MSG_MODIFIED = _("modified");
182
        var MSG_MADE_CHANGES = _("You have made changes to system preferences.");
183
        var MSG_CLICK_TO_EXPAND = _("Click to expand this section");
184
        var MSG_CLICK_TO_COLLAPSE = _("Click to collapse this section");
185
        var MSG_INTERNAL_SERVER_ERROR = _( "Internal Server Error, please reload the page" );
186
        var MSG_SESSION_TIMED_OUT = _( "You need to log in again, your session has timed out" );
187
        var MSG_DATA_NOT_SAVED = _( "Error; your data might not have been saved" );
188
        var MSG_LOADING = _( "Loading..." );
189
    </script>
190
    <script src="[% interface %]/lib/jquery/plugins/humanmsg.js" type="text/javascript"></script>
191
    <script src="[% interface %]/[% theme %]/js/ajax.js" type="text/javascript"></script>
192
    <script src="[% interface %]/[% theme %]/js/pages/preferences.js" type="text/javascript"></script>
193
    [%# Add WYSIWYG editor for htmlarea system preferences %]
194
    [% INCLUDE 'wysiwyg-systempreferences.inc' %]
195
[% END %]
196
198
[% INCLUDE 'intranet-bottom.inc' %]
197
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tt (-76 / +77 lines)
Lines 1-85 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Administration &rsaquo; [% IF ( add_form ) %] System preferences &rsaquo; [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences &rsaquo; Data added[% END %]
4
<title>Koha &rsaquo; Administration &rsaquo; [% IF ( add_form ) %] System preferences &rsaquo; [% IF ( modify ) %]Modify system preference '[% searchfield %]'[% ELSE %]Add a system preference[% END %][% END %][% IF ( add_validate ) %] System preferences &rsaquo; Data added[% END %]
4
[% IF ( delete_confirm ) %] System preferences &rsaquo; [% searchfield %] &rsaquo; Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System preferences &rsaquo; Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title>
5
[% IF ( delete_confirm ) %] System preferences &rsaquo; [% searchfield %] &rsaquo; Confirm deletion of parameter '[% searchfield %]'[% END %][% IF ( delete_confirmed ) %] System preferences &rsaquo; Parameter deleted[% END %][% IF ( else ) %]System preferences[% END %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
6
[%# Add WYSIWYG editor for htmlarea system preferences %]
7
[% INCLUDE 'wysiwyg-systempreferences.inc' %]
8
[% IF ( else ) %]
9
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
7
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
11
<script type="text/javascript">
12
    //<![CDATA[
13
     $(document).ready(function() {
14
        [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
15
            "sDom": '<"top pager"ilf>t',
16
            "aoColumnDefs": [
17
                { "aTargets": [ -1, -2, -3 ], "bSortable": false }
18
            ],
19
            "bPaginate": false
20
        }));[% END %]
21
     });
22
</script>
23
[% END %]
24
<script type="text/javascript">
25
//<![CDATA[
26
[% IF ( add_form ) %]
27
    $(document).ready(function() {
28
        $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
29
        $('.variabletype').click(function() {
30
            $('#preftype').attr("value",$(this).attr("id"));
31
        });
32
    });
33
[% END %]
34
        // FIXME: many of these js functions appear unused
35
        function isNotNull(f,noalert) {
36
            if (f.value.length ==0) {
37
    return false;
38
            }
39
            return true;
40
        }
41
        //
42
        function isNum(v,maybenull) {
43
        var n = new Number(v.value);
44
        if (isNaN(n)) {
45
            return false;
46
            }
47
        if (maybenull==0 && v.value=='') {
48
            return false;
49
        }
50
        return true;
51
        }
52
        //
53
        function Check(f) {
54
            var ok=1;
55
            var _alertString="";
56
            var alertString2;
57
            if (f.variable.value.length==0) {
58
                _alertString += "\n- " + _("variable missing");
59
            }
60
            if (f.value.value.length==0) {
61
                _alertString += "\n- " + _("value missing");
62
            }
63
            if (_alertString.length==0) {
64
                document.Aform.submit();
65
            } else {
66
                alertString2  = _("Form not submitted because of the following problem(s)");
67
                alertString2 += "\n------------------------------------------------------------------------------------\n";
68
                alertString2 += _alertString;
69
                alert(alertString2);
70
            }
71
        }
72
        $( function() {
73
            $( '#sysprefst .expand-textarea' ).show().click( function () {
74
                $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
75
76
                return false;
77
            } ).nextAll( 'textarea, input[type=submit]' ).hide();
78
        } );
79
80
        //]]>
81
</script>
82
</head>
8
</head>
9
83
<body id="admin_systempreferences" class="admin">
10
<body id="admin_systempreferences" class="admin">
84
[% INCLUDE 'header.inc' %]
11
[% INCLUDE 'header.inc' %]
85
[% INCLUDE 'prefs-admin-search.inc' %]
12
[% INCLUDE 'prefs-admin-search.inc' %]
Lines 449-452 Link Here
449
[% INCLUDE 'prefs-menu.inc' %]
376
[% INCLUDE 'prefs-menu.inc' %]
450
</div>
377
</div>
451
</div>
378
</div>
379
380
[% MACRO jsinclude BLOCK %]
381
    [%# Add WYSIWYG editor for htmlarea system preferences %]
382
    [% INCLUDE 'wysiwyg-systempreferences.inc' %]
383
    [% IF ( else ) %]
384
        [% INCLUDE 'datatables.inc' %]
385
        <script type="text/javascript">
386
             $(document).ready(function() {
387
                [% IF ( loop ) %]$("#sysprefst").dataTable($.extend(true, {}, dataTablesDefaults, {
388
                    "sDom": '<"top pager"ilf>t',
389
                    "aoColumnDefs": [
390
                        { "aTargets": [ -1, -2, -3 ], "bSortable": false }
391
                    ],
392
                    "bPaginate": false
393
                }));[% END %]
394
             });
395
        </script>
396
    [% END %]
397
    <script type="text/javascript">
398
        [% IF ( add_form ) %]
399
            $(document).ready(function() {
400
                $('.variabletype').css({ color: "#0000CC", cursor: "pointer" });
401
                $('.variabletype').click(function() {
402
                    $('#preftype').attr("value",$(this).attr("id"));
403
                });
404
            });
405
        [% END %]
406
            // FIXME: many of these js functions appear unused
407
        function isNotNull(f,noalert) {
408
                if (f.value.length ==0) {
409
        return false;
410
                }
411
                return true;
412
        }
413
414
        function isNum(v,maybenull) {
415
            var n = new Number(v.value);
416
            if (isNaN(n)) {
417
                return false;
418
                }
419
            if (maybenull==0 && v.value=='') {
420
                return false;
421
            }
422
            return true;
423
        }
424
425
        function Check(f) {
426
            var ok=1;
427
            var _alertString="";
428
            var alertString2;
429
            if (f.variable.value.length==0) {
430
                _alertString += "\n- " + _("variable missing");
431
            }
432
            if (f.value.value.length==0) {
433
                _alertString += "\n- " + _("value missing");
434
            }
435
            if (_alertString.length==0) {
436
                document.Aform.submit();
437
            } else {
438
                alertString2  = _("Form not submitted because of the following problem(s)");
439
                alertString2 += "\n------------------------------------------------------------------------------------\n";
440
                alertString2 += _alertString;
441
                alert(alertString2);
442
            }
443
        }
444
        $( function() {
445
            $( '#sysprefst .expand-textarea' ).show().click( function () {
446
                $( this ).hide().nextAll( 'textarea, input[type=submit]' ).show( 'slow' );
447
448
                return false;
449
            } ).nextAll( 'textarea, input[type=submit]' ).hide();
450
        });
451
    </script>
452
[% END %]
453
452
[% INCLUDE 'intranet-bottom.inc' %]
454
[% INCLUDE 'intranet-bottom.inc' %]
453
- 

Return to bug 19726