var MSG_CANCEL_HOLD = _("Cancel");
var MSG_CANCEL_HOLD_CONFIRM = _("Are you sure you want to cancel this hold?");
var MSG_ON_HOLD = _("On hold");
- [% IF Koha.Preference( 'opacbookbag' ) == 1 or Koha.Preference( 'virtualshelves' ) == 1 %]
- var MSG_BASKET_EMPTY = _("Your cart is currently empty");
- var MSG_RECORD_IN_BASKET = _("The item is already in your cart");
- var MSG_RECORD_ADDED = _("The item has been added to your cart");
- var MSG_RECORD_REMOVED = _("The item has been removed from your cart");
- var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
- var MSG_NRECORDS_IN_BASKET = _("already in your cart");
- var MSG_NO_RECORD_SELECTED = _("No item was selected");
- var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
- var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
- var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
- var MSG_ITEM_IN_CART = _("In your cart");
- var MSG_ITEM_NOT_IN_CART = _("Add to cart");
- [% END %]
+
[% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) %]
var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code. It was NOT added. Please try again with plain text.");
-/* 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 */
+/* global __ __p */
//////////////////////////////////////////////////////////////////////////////
// BASIC FUNCTIONS FOR COOKIE MANAGEMENT //
if (window.focus) {basket.focus()}
}
else {
- showCartUpdate(MSG_BASKET_EMPTY);
+ showCartUpdate( __("Your cart is currently empty") );
}
}
return 0;
}
if (! NoMsgAlert ) {
- showCartUpdate(MSG_RECORD_IN_BASKET);
+ showCartUpdate( __p("Bibliographic record", "The item is already in your cart") );
}
}
else {
return 1;
}
if (! NoMsgAlert ) {
- showCartUpdate(MSG_RECORD_ADDED);
+ showCartUpdate( __p("Bibliographic record", "The item has been added to your cart") );
updateLink(val,"add");
}
var msg = "";
if (nbAdd) {
if (i > nbAdd) {
- msg = nbAdd+" "+MSG_NRECORDS_ADDED+", "+(i-nbAdd)+" "+MSG_NRECORDS_IN_BASKET;
+ msg = nbAdd+" "+ __p("Bibliographic record", " item(s) added to your cart") +", "+(i-nbAdd)+" " + __("already in your cart");
}
else {
- msg = nbAdd+" "+MSG_NRECORDS_ADDED;
+ msg = nbAdd+" "+ __p("Bibliographic record", " item(s) added to your cart");
}
}
else {
if (i < 1) {
- msg = MSG_NO_RECORD_SELECTED;
+ msg = __p("Bibliographic record", "No item was selected");
}
else {
- msg = MSG_NO_RECORD_ADDED+" ("+MSG_NRECORDS_IN_BASKET+") !";
+ msg = __p("Bibliographic record", "No item was added to your cart") + " (" + __("already in your cart") + ") !";
}
}
showCartUpdate(msg);
writeCookie( nameCookie, valCookie );
updateBasket( arrayRecords.length-1 );
updateLink(biblionumber,"del");
- showCartUpdate(MSG_RECORD_REMOVED);
+ showCartUpdate( __p("Bibliographic record", "The item has been removed from your cart") );
}
function delSelRecords() {
if (str2.length == 0) { // equivalent to emptying the basket
var rep = false;
- rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ rep = confirm( __("Are you sure you want to empty your cart?") );
if (rep) {
delCookie(nameCookie);
document.location = "about:blank";
document.location = "/cgi-bin/koha/opac-basket.pl?" + strCookie;
}
else {
- alert(MSG_NO_RECORD_SELECTED);
+ alert( __p("Bibliographic record", "No item was selected") );
}
}
var nameCookie = "bib_list";
var rep = false;
- rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ rep = confirm( __("Are you sure you want to empty your cart?") );
if (rep) {
delCookie(nameCookie);
updateAllLinks(top.opener);
function quit() {
if (document.myform.records.value) {
var rep = false;
- rep = confirm(MSG_CONFIRM_DEL_RECORDS);
+ rep = confirm( __p("Bibliographic records", "Are you sure you want to remove the selected items?") );
if (rep) {
delSelRecords();
}
parent.opener.document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
window.close();
} else {
- alert(MSG_NO_RECORD_SELECTED);
+ alert( __p("Bibliographic record", "No item was selected") );
}
}
var loc = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
var shelf = open(loc, "shelf", optWin);
} else {
- alert(MSG_NO_RECORD_SELECTED);
+ alert( __p("Bibliographic record", "No item was selected") );
}
}
bibs.push("biblionumber=" + document.bookbag_form.biblionumber[i].value);
}
}
- if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); }
+ if (bibs.length == 0) { showListsUpdate( __p("Bibliographic record", "No item was selected") ); }
return bibs.join("&");
} else {
if (document.bookbag_form.biblionumber.checked) {
function updateLink(val,op,target){
if(target){
if(op == "add"){
- target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_IN_CART ).addClass("incart");
+ target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("In your cart") ).addClass("incart");
target.$("a.cartR"+val).show();
} else {
- 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);
+ target.$("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart cart"+val);
target.$("a.cartR"+val).hide();
}
} else {
if(op == "add"){
- $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_IN_CART ).addClass("incart");
+ $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("In your cart") ).addClass("incart");
$("a.cartR"+val).show();
} else {
- $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart cart"+val);
+ $("a.cart"+val).html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart cart"+val);
$("a.cartR"+val).hide();
}
}
function updateAllLinks(target){
if(target){
- target.$("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart");
+ target.$("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart");
target.$("a.cartRemove").hide();
} else {
- $("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + MSG_ITEM_NOT_IN_CART ).removeClass("incart").addClass("addtocart");
+ $("a.incart").html( "<i class=\"fa fa-fw fa-shopping-cart\"></i> " + __("Add to cart") ).removeClass("incart").addClass("addtocart");
$("a.cartRemove").hide();
}
}