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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/doc-head-close.inc (+8 lines)
Lines 54-62 Link Here
54
<!--[if lt IE 9]>
54
<!--[if lt IE 9]>
55
    <script src="[% interface | html %]/[% theme | html %]/lib/respond.min.js"></script>
55
    <script src="[% interface | html %]/[% theme | html %]/lib/respond.min.js"></script>
56
<![endif]-->
56
<![endif]-->
57
57
<script>
58
<script>
59
    var Koha = {};
58
    function _(s) { return s } // dummy function for gettext
60
    function _(s) { return s } // dummy function for gettext
59
</script>
61
</script>
62
[% IF lang && lang != 'en' %]
63
    [% Asset.js(lang _ '/js/locale_data.js') | $raw %]
64
[% END %]
65
[% Asset.js('js/Gettext.js') | $raw %]
66
[% Asset.js('js/i18n.js') | $raw %]
67
60
[% Asset.js("lib/modernizr.min.js") | $raw %]
68
[% Asset.js("lib/modernizr.min.js") | $raw %]
61
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
69
[% Asset.css("lib/font-awesome/css/font-awesome.min.css") | $raw %]
62
[% PROCESS 'html_helpers.inc' %]
70
[% PROCESS 'html_helpers.inc' %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc (-14 / +1 lines)
Lines 150-169 $.widget.bridge('uitooltip', $.ui.tooltip); Link Here
150
    var MSG_CANCEL_HOLD = _("Cancel");
150
    var MSG_CANCEL_HOLD = _("Cancel");
151
    var MSG_CANCEL_HOLD_CONFIRM = _("Are you sure you want to cancel this hold?");
151
    var MSG_CANCEL_HOLD_CONFIRM = _("Are you sure you want to cancel this hold?");
152
    var MSG_ON_HOLD = _("On hold");
152
    var MSG_ON_HOLD = _("On hold");
153
    [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
153
154
        var MSG_BASKET_EMPTY = _("Your cart is currently empty");
155
        var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
156
        var MSG_RECORD_ADDED = _("The item has been added to your cart");
157
        var MSG_RECORD_REMOVED = _("The item has been removed from your cart");
158
        var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
159
        var MSG_NRECORDS_IN_BASKET = _("already in your cart");
160
        var MSG_NO_RECORD_SELECTED = _("No item was selected");
161
        var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
162
        var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
163
        var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
164
        var MSG_ITEM_IN_CART = _("In your cart");
165
        var MSG_ITEM_NOT_IN_CART = _("Add to cart");
166
    [% END %]
167
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
154
    [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
168
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
155
        var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
169
        var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
156
        var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code.  It was NOT added.  Please try again with plain text.");
(-)a/koha-tmpl/opac-tmpl/bootstrap/js/basket.js (-23 / +22 lines)
Lines 1-4 Link Here
1
/* global MSG_BASKET_EMPTY MSG_RECORD_IN_BASKET MSG_RECORD_ADDED MSG_NRECORDS_IN_BASKET MSG_NRECORDS_ADDED MSG_NO_RECORD_SELECTED MSG_NO_RECORD_ADDED MSG_RECORD_REMOVED MSG_CONFIRM_DEL_BASKET MSG_CONFIRM_DEL_RECORDS MSG_ITEM_IN_CART MSG_ITEM_NOT_IN_CART */
1
/* global __ __p */
2
2
3
//////////////////////////////////////////////////////////////////////////////
3
//////////////////////////////////////////////////////////////////////////////
4
// BASIC FUNCTIONS FOR COOKIE MANAGEMENT //
4
// BASIC FUNCTIONS FOR COOKIE MANAGEMENT //
Lines 86-92 function openBasket() { Link Here
86
        if (window.focus) {basket.focus()}
86
        if (window.focus) {basket.focus()}
87
    }
87
    }
88
    else {
88
    else {
89
        showCartUpdate(MSG_BASKET_EMPTY);
89
        showCartUpdate( __("Your cart is currently empty") );
90
    }
90
    }
91
}
91
}
92
92
Lines 115-121 function addRecord(val, selection,NoMsgAlert) { Link Here
115
                return 0;
115
                return 0;
116
            }
116
            }
117
            if (! NoMsgAlert ) {
117
            if (! NoMsgAlert ) {
118
                showCartUpdate(MSG_RECORD_IN_BASKET);
118
                showCartUpdate( __p("Bibliographic record", "The item is already in your cart") );
119
            }
119
            }
120
        }
120
        }
121
        else {
121
        else {
Lines 132-138 function addRecord(val, selection,NoMsgAlert) { Link Here
132
            return 1;
132
            return 1;
133
        }
133
        }
134
        if (! NoMsgAlert ) {
134
        if (! NoMsgAlert ) {
135
            showCartUpdate(MSG_RECORD_ADDED);
135
            showCartUpdate( __p("Bibliographic record", "The item has been added to your cart") );
136
            updateLink(val,"add");
136
            updateLink(val,"add");
137
        }
137
        }
138
138
Lines 189-206 function addSelRecords(valSel) { // function for adding a selection of biblios t Link Here
189
    var msg = "";
189
    var msg = "";
190
    if (nbAdd) {
190
    if (nbAdd) {
191
        if (i > nbAdd) {
191
        if (i > nbAdd) {
192
            msg = nbAdd+" "+MSG_NRECORDS_ADDED+", "+(i-nbAdd)+" "+MSG_NRECORDS_IN_BASKET;
192
            msg = nbAdd+" "+ __p("Bibliographic record", " item(s) added to your cart") +", "+(i-nbAdd)+" " + __("already in your cart");
193
        }
193
        }
194
        else {
194
        else {
195
            msg = nbAdd+" "+MSG_NRECORDS_ADDED;
195
            msg = nbAdd+" "+ __p("Bibliographic record", " item(s) added to your cart");
196
        }
196
        }
197
    }
197
    }
198
    else {
198
    else {
199
        if (i < 1) {
199
        if (i < 1) {
200
            msg = MSG_NO_RECORD_SELECTED;
200
            msg = __p("Bibliographic record", "No item was selected");
201
        }
201
        }
202
        else {
202
        else {
203
            msg = MSG_NO_RECORD_ADDED+" ("+MSG_NRECORDS_IN_BASKET+") !";
203
            msg = __p("Bibliographic record", "No item was added to your cart") + " (" + __("already in your cart") + ") !";
204
        }
204
        }
205
    }
205
    }
206
    showCartUpdate(msg);
206
    showCartUpdate(msg);
Lines 241-247 function delSingleRecord(biblionumber){ Link Here
241
    writeCookie( nameCookie, valCookie );
241
    writeCookie( nameCookie, valCookie );
242
    updateBasket( arrayRecords.length-1 );
242
    updateBasket( arrayRecords.length-1 );
243
    updateLink(biblionumber,"del");
243
    updateLink(biblionumber,"del");
244
    showCartUpdate(MSG_RECORD_REMOVED);
244
    showCartUpdate( __p("Bibliographic record", "The item has been removed from your cart") );
245
}
245
}
246
246
247
function delSelRecords() {
247
function delSelRecords() {
Lines 268-274 function delSelRecords() { Link Here
268
268
269
            if (str2.length == 0) { // equivalent to emptying the basket
269
            if (str2.length == 0) { // equivalent to emptying the basket
270
                var rep = false;
270
                var rep = false;
271
                rep = confirm(MSG_CONFIRM_DEL_BASKET);
271
                rep = confirm( __("Are you sure you want to empty your cart?") );
272
                if (rep) {
272
                if (rep) {
273
                    delCookie(nameCookie);
273
                    delCookie(nameCookie);
274
                    document.location = "about:blank";
274
                    document.location = "about:blank";
Lines 293-299 function delSelRecords() { Link Here
293
        document.location = "/cgi-bin/koha/opac-basket.pl?" + strCookie;
293
        document.location = "/cgi-bin/koha/opac-basket.pl?" + strCookie;
294
    }
294
    }
295
    else {
295
    else {
296
        alert(MSG_NO_RECORD_SELECTED);
296
        alert( __p("Bibliographic record", "No item was selected") );
297
    }
297
    }
298
}
298
}
299
299
Lines 324-330 function delBasket() { Link Here
324
    var nameCookie = "bib_list";
324
    var nameCookie = "bib_list";
325
325
326
    var rep = false;
326
    var rep = false;
327
    rep = confirm(MSG_CONFIRM_DEL_BASKET);
327
    rep = confirm( __("Are you sure you want to empty your cart?") );
328
    if (rep) {
328
    if (rep) {
329
        delCookie(nameCookie);
329
        delCookie(nameCookie);
330
        updateAllLinks(top.opener);
330
        updateAllLinks(top.opener);
Lines 338-344 function delBasket() { Link Here
338
function quit() {
338
function quit() {
339
    if (document.myform.records.value) {
339
    if (document.myform.records.value) {
340
        var rep = false;
340
        var rep = false;
341
        rep = confirm(MSG_CONFIRM_DEL_RECORDS);
341
        rep = confirm( __p("Bibliographic records", "Are you sure you want to remove the selected items?") );
342
        if (rep) {
342
        if (rep) {
343
            delSelRecords();
343
            delSelRecords();
344
        }
344
        }
Lines 388-394 function holdSel() { Link Here
388
        parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
388
        parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
389
        window.close();
389
        window.close();
390
    } else {
390
    } else {
391
        alert(MSG_NO_RECORD_SELECTED);
391
        alert( __p("Bibliographic record", "No item was selected") );
392
    }
392
    }
393
}
393
}
394
394
Lines 420-426 function addSelToShelf() { Link Here
420
        var loc = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
420
        var loc = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
421
        var shelf = open(loc, "shelf", optWin);
421
        var shelf = open(loc, "shelf", optWin);
422
    } else {
422
    } else {
423
        alert(MSG_NO_RECORD_SELECTED);
423
        alert( __p("Bibliographic record", "No item was selected") );
424
    }
424
    }
425
}
425
}
426
426
Lines 434-440 function vShelfAdd() { Link Here
434
                                bibs.push("biblionumber=" +  document.bookbag_form.biblionumber[i].value);
434
                                bibs.push("biblionumber=" +  document.bookbag_form.biblionumber[i].value);
435
                        }
435
                        }
436
                }
436
                }
437
        if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); }
437
        if (bibs.length == 0) { showListsUpdate( __p("Bibliographic record", "No item was selected") ); }
438
            return bibs.join("&");
438
            return bibs.join("&");
439
        } else {
439
        } else {
440
            if (document.bookbag_form.biblionumber.checked) {
440
            if (document.bookbag_form.biblionumber.checked) {
Lines 466-483 function hideCart(){ Link Here
466
function updateLink(val,op,target){
466
function updateLink(val,op,target){
467
    if(target){
467
    if(target){
468
        if(op == "add"){
468
        if(op == "add"){
469
            target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_IN_CART ).addClass("incart");
469
            target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("In your cart") ).addClass("incart");
470
            target.$("a.cartR"+val).show();
470
            target.$("a.cartR"+val).show();
471
        } else {
471
        } else {
472
            target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart cart"+val);
472
            target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart cart"+val);
473
            target.$("a.cartR"+val).hide();
473
            target.$("a.cartR"+val).hide();
474
        }
474
        }
475
    } else {
475
    } else {
476
        if(op == "add"){
476
        if(op == "add"){
477
            $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_IN_CART ).addClass("incart");
477
            $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("In your cart") ).addClass("incart");
478
            $("a.cartR"+val).show();
478
            $("a.cartR"+val).show();
479
        } else {
479
        } else {
480
            $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart cart"+val);
480
            $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart cart"+val);
481
            $("a.cartR"+val).hide();
481
            $("a.cartR"+val).hide();
482
        }
482
        }
483
    }
483
    }
Lines 485-494 function updateLink(val,op,target){ Link Here
485
485
486
function updateAllLinks(target){
486
function updateAllLinks(target){
487
    if(target){
487
    if(target){
488
        target.$("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart");
488
        target.$("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart");
489
        target.$("a.cartRemove").hide();
489
        target.$("a.cartRemove").hide();
490
    } else {
490
    } else {
491
        $("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart");
491
        $("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart");
492
        $("a.cartRemove").hide();
492
        $("a.cartRemove").hide();
493
    }
493
    }
494
}
494
}
495
- 

Return to bug 25351