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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt (-16 lines)
Lines 230-251 tr > td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
230
    [% INCLUDE 'calendar.inc' %]
230
    [% INCLUDE 'calendar.inc' %]
231
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
231
    [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
232
    [% Asset.js("js/pages/tags-review.js") | $raw %]
232
    [% Asset.js("js/pages/tags-review.js") | $raw %]
233
    <script>
234
        var MSG_AJAX_APPROVE_FAILED = _("AJAX failed to approve tag: %s");
235
        var MSG_AJAX_REJECTION_FAILED = _("AJAX failed to reject tag: %s");
236
        var MSG_AJAX_TAG_PERMITTED = _("%s is permitted!");
237
        var MSG_AJAX_TAG_PROHIBITED = _("%s is prohibited!");
238
        var MSG_AJAX_TAG_UNCLASSIFIED = _("%s is neither permitted nor prohibited!");
239
        var MSG_AJAX_ERROR = _("AJAX error (%s alert)");
240
        var LABEL_SELECT_ALL = _("Select all");
241
        var LABEL_CLEAR_ALL = _("Clear all");
242
        var LABEL_SELECT_ALL_PENDING = _("Select all pending");
243
        var LABEL_APPROVE = _("Approve");
244
        var LABEL_APPROVED = _("Approved");
245
        var LABEL_REJECT = _("Reject");
246
        var LABEL_REJECTED = _("Rejected");
247
        var LABEL_TESTING = _("Testing...");
248
    </script>
249
[% END %]
233
[% END %]
250
234
251
[% INCLUDE 'intranet-bottom.inc' %]
235
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/tags-review.js (-15 / +14 lines)
Lines 35-56 var success_approve = function(tag){ Link Here
35
    // window.alert(_("AJAX approved tag: ") + tag);
35
    // window.alert(_("AJAX approved tag: ") + tag);
36
};
36
};
37
var failure_approve = function(tag){
37
var failure_approve = function(tag){
38
    window.alert(MSG_AJAX_APPROVE_FAILED.format(decodeURIComponent( tag )));
38
    window.alert( __("AJAX failed to approve tag: %s").format(decodeURIComponent(tag)) );
39
};
39
};
40
var success_reject  = function(tag){
40
var success_reject  = function(tag){
41
    // window.alert(_("AJAX rejected tag: ") + tag);
41
    // window.alert(_("AJAX rejected tag: ") + tag);
42
};
42
};
43
var failure_reject  = function(tag){
43
var failure_reject  = function(tag){
44
    window.alert(MSG_AJAX_REJECTION_FAILED.format(decodeURIComponent( tag )));
44
    window.alert( __("AJAX failed to reject tag: %s").format(decodeURIComponent(tag)) );
45
};
45
};
46
var success_test    = function(tag){
46
var success_test    = function(tag){
47
    $('#verdict').html(MSG_AJAX_TAG_PERMITTED.format( decodeURIComponent( tag ) ));
47
    $('#verdict').html( __("%s is permitted!").format(decodeURIComponent(tag)) );
48
};
48
};
49
var failure_test    = function(tag){
49
var failure_test    = function(tag){
50
    $('#verdict').html(MSG_AJAX_TAG_PROHIBITED.format( decodeURIComponent( tag ) ));
50
    $('#verdict').html( __("%s is prohibited!").format(decodeURIComponent(tag)) );
51
};
51
};
52
var indeterminate_test = function(tag){
52
var indeterminate_test = function(tag){
53
    $('#verdict').html(MSG_AJAX_TAG_UNCLASSIFIED.format( decodeURIComponent( tag ) ));
53
    $('#verdict').html( __("%s is neither permitted nor prohibited!").format(decodeURIComponent(tag)) );
54
};
54
};
55
55
56
var success_test_call = function() {
56
var success_test_call = function() {
Lines 69-75 $(document).ready(function() { Link Here
69
        "sPaginationType": "full"
69
        "sPaginationType": "full"
70
    }));
70
    }));
71
    $('.ajax_buttons' ).css({visibility:"visible"});
71
    $('.ajax_buttons' ).css({visibility:"visible"});
72
    $("p.check").html("<div id=\"searchheader\"><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-check\"><\/i> "+ LABEL_SELECT_ALL +"<\/a> | <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-remove\"><\/i> "+ LABEL_CLEAR_ALL +"<\/a> | <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\"> "+ LABEL_SELECT_ALL_PENDING +"<\/a><\/div>");
72
    $("p.check").html("<div id=\"searchheader\"><a id=\"CheckAll\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-check\" aria-hidden=\"false\"><\/i> " + __("Select all") + "<\/a> | <a id=\"CheckNone\" href=\"/cgi-bin/koha/tags/review.pl\"><i class=\"fa fa-remove\" aria-hidden=\"false\"><\/i> " + __("Clear all") + "<\/a> | <a id=\"CheckPending\" href=\"/cgi-bin/koha/tags/review.pl\"> " + __("Select all pending") + "<\/a><\/div>");
73
    $("#CheckAll").click(function(){
73
    $("#CheckAll").click(function(){
74
        $(".checkboxed").checkCheckboxes();
74
        $(".checkboxed").checkCheckboxes();
75
        return false;
75
        return false;
Lines 96-107 $(document).ready(function() { Link Here
96
                success: count_approve // success_approve
96
                success: count_approve // success_approve
97
            });
97
            });
98
            $(event.target).next(".rej").prop('disabled', false).css("color","#000");
98
            $(event.target).next(".rej").prop('disabled', false).css("color","#000");
99
            $(event.target).next(".rej").html("<i class='fa fa-remove'></i> " + _("Reject"));
99
            $(event.target).next(".rej").html("<i class='fa fa-remove' aria-hidden='false'></i> " + __("Reject"));
100
            $(event.target).prop('disabled', true).css("color","#666");
100
            $(event.target).prop('disabled', true).css("color","#666");
101
            $(event.target).html("<i class='fa fa-check'></i> " + LABEL_APPROVED );
101
            $(event.target).html("<i class='fa fa-check' aria-hidden='false'></i> " + __("Approved") );
102
            getelement = $(event.target).data("num");
102
            getelement = $(event.target).data("num");
103
            gettitle = ".status" + getelement;
103
            gettitle = ".status" + getelement;
104
            $(gettitle).text( LABEL_APPROVED );
104
            $(gettitle).text( __("Approved") );
105
            if ($(gettitle).hasClass("pending") ){
105
            if ($(gettitle).hasClass("pending") ){
106
                $(gettitle).toggleClass("pending approved");
106
                $(gettitle).toggleClass("pending approved");
107
            } else {
107
            } else {
Lines 116-127 $(document).ready(function() { Link Here
116
                success: count_reject // success_reject
116
                success: count_reject // success_reject
117
            });
117
            });
118
            $(event.target).prev(".ok").prop('disabled', false).css("color","#000");
118
            $(event.target).prev(".ok").prop('disabled', false).css("color","#000");
119
            $(event.target).prev(".ok").html("<i class='fa fa-check'></i> " + LABEL_APPROVE );
119
            $(event.target).prev(".ok").html("<i class='fa fa-check' aria-hidden='false'></i> " + __("Approve"));
120
            $(event.target).prop('disabled', true).css("color","#666");
120
            $(event.target).prop('disabled', true).css("color","#666");
121
            $(event.target).html("<i class='fa fa-remove'></i> " + LABEL_REJECTED );
121
            $(event.target).html("<i class='fa fa-remove' aria-hidden='false'></i> " + __("Rejected"));
122
            getelement = $(event.target).data("num");
122
            getelement = $(event.target).data("num");
123
            gettitle = ".status" + getelement;
123
            gettitle = ".status" + getelement;
124
            $(gettitle).text( LABEL_REJECTED );
124
            $(gettitle).text( __("Rejected") );
125
            if ($(gettitle).hasClass("pending") ){
125
            if ($(gettitle).hasClass("pending") ){
126
                $(gettitle).toggleClass("pending rejected");
126
                $(gettitle).toggleClass("pending rejected");
127
            } else {
127
            } else {
Lines 130-136 $(document).ready(function() { Link Here
130
            return false;   // cancel submit
130
            return false;   // cancel submit
131
        }
131
        }
132
        if ($(event.target).is('#test_button')) {
132
        if ($(event.target).is('#test_button')) {
133
            $(event.target).text( LABEL_TESTING ).prop('disabled', true);
133
            $(event.target).text( __("Testing...") ).prop('disabled', true);
134
            $.ajax({
134
            $.ajax({
135
                data: {
135
                data: {
136
                    test: $('#test').attr("value")
136
                    test: $('#test').attr("value")
Lines 141-147 $(document).ready(function() { Link Here
141
        }
141
        }
142
    });
142
    });
143
    $("*").ajaxError(function(evt, request, settings){
143
    $("*").ajaxError(function(evt, request, settings){
144
        if ((alerted +=1) <= 1){ window.alert(MSG_AJAX_ERROR.format(alerted)); }
144
        if ((alerted +=1) <= 1){ window.alert( __("AJAX error (%s alert)").format(alerted) ); }
145
    });
145
    });
146
146
147
    var reviewerField = $("#approver");
147
    var reviewerField = $("#approver");
148
- 

Return to bug 26118