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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-16 lines)
Lines 147-168 Link Here
147
[% END %]
147
[% END %]
148
148
149
<script>
149
<script>
150
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
151
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
152
        var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
153
        var MSG_ILLEGAL_PARAMETER = _("Error! Illegal parameter");
154
        var MSG_TAG_SCRUBBED = _("Note: your tag contained markup code that was removed. The tag was added as ");
155
        var MSG_ADD_TAG_FAILED = _("Error! Adding tags failed at");
156
        var MSG_ADD_TAG_FAILED_NOTE = _("Note: you can only tag an item with a given term once.  Check 'My Tags' to see your current tags.");
157
        var MSG_DELETE_TAG_FAILED = _("Error! You cannot delete the tag");
158
        var MSG_DELETE_TAG_FAILED_NOTE = _("Note: you can only delete your own tags.")
159
        var MSG_LOGIN_REQUIRED = _("You must be logged in to add tags.");
160
        var MSG_TAGS_ADDED = _("Tags added: ");
161
        var MSG_TAGS_DELETED = _("Tags added: ");
162
        var MSG_TAGS_ERRORS = _("Errors: ");
163
        var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");
164
        var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
165
    [% END %]
166
    [% IF (query_desc) %]
150
    [% IF (query_desc) %]
167
        var query_desc = "[% query_desc | html %]";
151
        var query_desc = "[% query_desc | html %]";
168
        var querystring = "[% querystring | html %]";
152
        var querystring = "[% querystring | html %]";
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt (-1 / +1 lines)
Lines 395-401 Link Here
395
395
396
                    var tag = $("#tagsel_new").val();
396
                    var tag = $("#tagsel_new").val();
397
                    if (!tag || (tag == "")) {
397
                    if (!tag || (tag == "")) {
398
                        alert(MSG_NO_TAG_SPECIFIED);
398
                        alert( _("No tag was specified.") );
399
                        return false;
399
                        return false;
400
                    }
400
                    }
401
401
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +1 lines)
Lines 1795-1801 Link Here
1795
                        var thisid = $(this).attr("title");
1795
                        var thisid = $(this).attr("title");
1796
                        var tag = $("#newtag"+thisid).val();
1796
                        var tag = $("#newtag"+thisid).val();
1797
                        if (!tag || (tag == "")) {
1797
                        if (!tag || (tag == "")) {
1798
                            alert(MSG_NO_TAG_SPECIFIED);
1798
                            alert( _("No tag was specified.") );
1799
                            return false;
1799
                            return false;
1800
                        }
1800
                        }
1801
                        KOHA.Tags.add_tag_button(thisid, tag);
1801
                        KOHA.Tags.add_tag_button(thisid, tag);
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-2 / +2 lines)
Lines 647-653 Link Here
647
647
648
                var tag = $("#tagsel_new").val();
648
                var tag = $("#tagsel_new").val();
649
                if (!tag || (tag == "")) {
649
                if (!tag || (tag == "")) {
650
                    alert(MSG_NO_TAG_SPECIFIED);
650
                    alert( _("No tag was specified.") );
651
                    return false;
651
                    return false;
652
                }
652
                }
653
653
Lines 888-894 Link Here
888
                    var thisid = $(this).attr("title");
888
                    var thisid = $(this).attr("title");
889
                    var tag = $("#newtag"+thisid).val();
889
                    var tag = $("#newtag"+thisid).val();
890
                    if (!tag || (tag == "")) {
890
                    if (!tag || (tag == "")) {
891
                        alert(MSG_NO_TAG_SPECIFIED);
891
                        alert( _("No tag was specified.") );
892
                        return false;
892
                        return false;
893
                    }
893
                    }
894
                    KOHA.Tags.add_tag_button(thisid, tag);
894
                    KOHA.Tags.add_tag_button(thisid, tag);
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (-2 / +2 lines)
Lines 874-880 var MSG_CONFIRM_REMOVE_SHARE = _("Are you sure you want to remove this share?"); Link Here
874
874
875
        var tag = $("#tagsel_new").val();
875
        var tag = $("#tagsel_new").val();
876
        if (!tag || (tag == "")) {
876
        if (!tag || (tag == "")) {
877
            alert(MSG_NO_TAG_SPECIFIED);
877
            alert( _("No tag was specified.") );
878
            return false;
878
            return false;
879
        }
879
        }
880
880
Lines 967-973 $(function() { Link Here
967
          var thisid = $(this).attr("title");
967
          var thisid = $(this).attr("title");
968
          var tag = $("#newtag"+thisid).val();
968
          var tag = $("#newtag"+thisid).val();
969
          if (!tag || (tag == "")) {
969
          if (!tag || (tag == "")) {
970
              alert(MSG_NO_TAG_SPECIFIED);
970
              alert( _("No tag was specified.") );
971
              return false;
971
              return false;
972
          }
972
          }
973
          KOHA.Tags.add_tag_button(thisid, tag);
973
          KOHA.Tags.add_tag_button(thisid, tag);
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/tags.js (-14 / +13 lines)
Lines 39-47 KOHA.Tags = { Link Here
39
    },
39
    },
40
    common_status : function(addcount, delcount, errcount) {
40
    common_status : function(addcount, delcount, errcount) {
41
        var cstat = "";
41
        var cstat = "";
42
        if (addcount && addcount > 0) {cstat += MSG_TAGS_ADDED + addcount + ".  " ;}
42
        if (addcount && addcount > 0) {cstat += __("Tags added: ") + addcount + ".  " ;}
43
        if (delcount && delcount > 0) {cstat += MSG_TAGS_DELETED + delcount + ".  " ;}
43
        if (delcount && delcount > 0) {cstat += __("Tags deleted: ") + delcount + ".  " ;}
44
        if (errcount && errcount > 0) {cstat += MSG_TAGS_ERRORS + errcount + ". " ;}
44
        if (errcount && errcount > 0) {cstat += __("Errors: ") + errcount + ". " ;}
45
        return cstat;
45
        return cstat;
46
    },
46
    },
47
    set_tag_status : function(tagid, newstatus) {
47
    set_tag_status : function(tagid, newstatus) {
Lines 57-69 KOHA.Tags = { Link Here
57
    },
57
    },
58
58
59
    tag_message: {
59
    tag_message: {
60
    tagsdisabled : function(arg) {return (MSG_TAGS_DISABLED);},
60
    tagsdisabled : function(arg) {return ( __("Sorry, tags are not enabled on this system.") );},
61
    scrubbed_all_bad : function(arg) {return (MSG_TAG_ALL_BAD);},
61
    scrubbed_all_bad : function(arg) {return ( __("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.") );},
62
    badparam : function(arg) {return (MSG_ILLEGAL_PARAMETER+" "+arg);},
62
    badparam : function(arg) {return ( __("Error! Illegal parameter") +" "+arg);},
63
    scrubbed : function(arg) {return (MSG_TAG_SCRUBBED+" "+arg);},
63
    scrubbed : function(arg) {return ( __("Note: your tag contained markup code that was removed. The tag was added as ") +" "+arg);},
64
    failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " '"+arg+"'. \n"+MSG_ADD_TAG_FAILED_NOTE);},
64
    failed_add_tag : function(arg) {return ( __("Error! Adding tags failed at") + " '"+arg+"'. \n"+ __("Note: you can only tag an item with a given term once.  Check 'Tags' to see your current tags.") );},
65
    failed_delete  : function(arg) {return (MSG_DELETE_TAG_FAILED+ " '"+arg+"'. \n"+MSG_DELETE_TAG_FAILED_NOTE);},
65
    failed_delete  : function(arg) {return ( __("Error! You cannot delete the tag") + " '"+arg+"'. \n"+ __("Note: you can only delete your own tags.") );},
66
    login : function(arg) {return (MSG_LOGIN_REQUIRED);}
66
    login : function(arg) {return ( __("You must be logged in to add tags.") );}
67
    },
67
    },
68
68
69
    // Used to tag multiple items at once.  The main difference
69
    // Used to tag multiple items at once.  The main difference
Lines 93-99 KOHA.Tags = { Link Here
93
                    if (response[bib]) {
93
                    if (response[bib]) {
94
                        var added = response[bib]["added"];
94
                        var added = response[bib]["added"];
95
                        if (added > 0) {
95
                        if (added > 0) {
96
                            status = MSG_TAGS_ADDED + added + ".  ";
96
                            status = __("Tags added: ") + added + ".  ";
97
                        KOHA.Tags.set_tag_status(mytagid + "_status", status);
97
                        KOHA.Tags.set_tag_status(mytagid + "_status", status);
98
                        }
98
                        }
99
99
Lines 103-109 KOHA.Tags = { Link Here
103
                            bibErrors = true;
103
                            bibErrors = true;
104
                            var errid = "tagerr_" + bib;
104
                            var errid = "tagerr_" + bib;
105
                            var errstat = "<a id=\"" + errid + "\" class=\"tagerror\" href=\"#\">";
105
                            var errstat = "<a id=\"" + errid + "\" class=\"tagerror\" href=\"#\">";
106
                            errstat += MSG_TAGS_ERRORS + errors.length + ". ";
106
                            errstat += __("Errors: ") + errors.length + ". ";
107
                            errstat += "</a>";
107
                            errstat += "</a>";
108
                        KOHA.Tags.append_tag_status(mytagid + "_status", errstat);
108
                        KOHA.Tags.append_tag_status(mytagid + "_status", errstat);
109
                            var errmsg = "";
109
                            var errmsg = "";
Lines 123-129 KOHA.Tags = { Link Here
123
                if (bibErrors || response["global_errors"]) {
123
                if (bibErrors || response["global_errors"]) {
124
                    var msg = "";
124
                    var msg = "";
125
                    if (bibErrors) {
125
                    if (bibErrors) {
126
                        msg = MSG_MULTI_ADD_TAG_FAILED;
126
                        msg = __("Unable to add one or more tags.");
127
                    }
127
                    }
128
128
129
                    // Show global errors in a dialog.
129
                    // Show global errors in a dialog.
130
- 

Return to bug 34035