Owen Leonard
ceee890899
This patch moves strings defined for translation in js_includes.inc into basket.js for translation using the new double-underscore i81n function. To test, apply the patch and perform a catalog search in the staff client. - Click the Cart link in the header menu. A pop-up should appear saying "Your cart is currently empty." - On the search results page, click the "Add to cart" link next to any search result. The text should change to "In your cart." - Click the "Remove" link. The text should change to "Add to cart." - Check the box next to a title in the search results and click the "Add to cart" button in the search results toolbar. A message should appear, "1 item(s) added to your cart." - Click the "Add to cart" button again. You should see the message "No item was added to your cart (already in your cart)!" - Uncheck all check boxes on the search results page and click "Add to cart." You should see "No item was selected." - Add more items to your cart so that it contains more than one item. - Click the "Cart" link to open it. - Click the "Empty and close" button. You should be asked to confirm, "Are you sure you want to empty your cart?" TESTING TRANSLATABILITY - Update a translation, e.g. fr-FR: > cd misc/translator > perl translate update fr-FR - Open the corresponding .po file for JavaScript strings, e.g. misc/translator/po/fr-FR-messages-js.po - Locate strings pulled from koha-tmpl/intranet-tmpl/prog/js/basket.js for translation, e.g.: msgid "Your cart is currently empty" msgstr "" - Edit the "msgstr" string however you want (it's just for testing). - Install the updated translation: > perl translate install fr-FR - Switch to your newly translated language in the staff client and repeat the test plan above. The translated strings should appear. Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
146 lines
6.1 KiB
PHP
146 lines
6.1 KiB
PHP
[% USE raw %]
|
|
[% USE Asset %]
|
|
[% USE AudioAlerts %]
|
|
[% USE To %]
|
|
[%# Prevent XFS attacks -%]
|
|
[% UNLESS popup %]
|
|
<script>
|
|
if (self === top) {
|
|
var antiClickjack = document.getElementById("antiClickjack");
|
|
antiClickjack.parentNode.removeChild(antiClickjack);
|
|
} else {
|
|
top.location = self.location;
|
|
}
|
|
</script>
|
|
[% END %]
|
|
|
|
[% Asset.js("lib/jquery/jquery-2.2.3.min.js") | $raw %]
|
|
[% Asset.js("lib/jquery/jquery-migrate-1.3.0.min.js") | $raw %]
|
|
[% Asset.js("lib/jquery/jquery-ui-1.11.4.min.js") | $raw %]
|
|
[% Asset.js("lib/shortcut/shortcut.js") | $raw %]
|
|
[% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
|
|
[% Asset.js("lib/js-cookie/js.cookie-2.2.1.min.js") | $raw %]
|
|
[% Asset.js("lib/jquery/plugins/jquery.highlight-3.js") | $raw %]
|
|
[% Asset.js("lib/bootstrap/bootstrap.min.js") | $raw %]
|
|
[% Asset.js("lib/jquery/plugins/jquery.validate.min.js") | $raw %]
|
|
<!-- koha core js -->
|
|
[% Asset.js("js/staff-global.js") | $raw %]
|
|
|
|
[% INCLUDE 'validator-strings.inc' %]
|
|
[% IF ( IntranetUserJS ) %]
|
|
<!-- js_includes.inc: IntranetUserJS -->
|
|
<script>
|
|
[% IntranetUserJS | $raw %]
|
|
</script>
|
|
<!-- / js_includes.inc: IntranetUserJS -->
|
|
[% END %]
|
|
|
|
<!-- js_includes.inc -->
|
|
[% IF ( virtualshelves || intranetbookbag ) %]
|
|
[% Asset.js("js/basket.js") | $raw %]
|
|
[% END %]
|
|
|
|
[% IF LocalCoverImages %]
|
|
[% Asset.js("js/localcovers.js") | $raw %]
|
|
[% END %]
|
|
|
|
[% IF Koha.Preference('AudioAlerts') || AudioAlertsPage %]
|
|
<script>
|
|
// AudioAlerts
|
|
var AUDIO_ALERT_PATH = '[% interface | html %]/[% theme | html %]/sound/';
|
|
var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" );
|
|
|
|
$( document ).ready(function() {
|
|
if ( AUDIO_ALERTS ) {
|
|
for ( var k in AUDIO_ALERTS ) {
|
|
var alert = AUDIO_ALERTS[k];
|
|
if ( $( alert.selector ).length ) {
|
|
playSound( alert.sound );
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
[% END %]
|
|
|
|
[% IF ( CAN_user_circulate_circulate_remaining_permissions ) %]
|
|
[% IF ( PatronAutoComplete ) %]
|
|
<script>
|
|
// PatronAutoComplete && CAN_user_circulate_circulate_remaining_permissions
|
|
$(document).ready(function(){
|
|
var obj = $( "#findborrower" ).autocomplete({
|
|
source: "/cgi-bin/koha/circ/ysearch.pl",
|
|
minLength: 3,
|
|
select: function( event, ui ) {
|
|
window.location.href = ui.item.link;
|
|
}
|
|
}).data( "ui-autocomplete" );
|
|
if( obj ) {
|
|
obj._renderItem = function( ul, item ) {
|
|
item.link = "/cgi-bin/koha/circ/circulation.pl?borrowernumber=" + item.borrowernumber;
|
|
var cardnumber = "";
|
|
if( item.cardnumber != "" ){
|
|
// Display card number in parentheses if it exists
|
|
cardnumber = " (" + item.cardnumber + ") ";
|
|
}
|
|
var itemString = "<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", " + ( item.firstname ? item.firstname.escapeHtml() : "" ) + cardnumber.escapeHtml() + " <small>";
|
|
if( item.dateofbirth ) {
|
|
itemString += ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" )
|
|
+ "<span class=\"age_years\"> (" + ( item.age ? item.age.escapeHtml() : "" ) + " " + _("years") + ")</span>, ";
|
|
}
|
|
itemString += ( item.address ? item.address.escapeHtml() : "" ) + " "
|
|
+ ( item.city ? item.city.escapeHtml() : "" ) + " "
|
|
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
|
|
+ ( item.country ? item.country.escapeHtml() : "" )
|
|
+ "</small></a>";
|
|
return $( "<li></li>" )
|
|
.data( "ui-autocomplete-item", item )
|
|
.append( itemString )
|
|
.appendTo( ul );
|
|
};
|
|
}
|
|
});
|
|
</script>
|
|
[% END %]
|
|
[% END %]
|
|
[% IF ( PatronAutoComplete ) %]
|
|
<script>
|
|
// PatronAutoComplete
|
|
$(document).ready(function(){
|
|
var obj = $( "#searchmember" ).autocomplete({
|
|
source: "/cgi-bin/koha/circ/ysearch.pl",
|
|
minLength: 3,
|
|
select: function( event, ui ) {
|
|
window.location.href = ui.item.link;
|
|
}
|
|
}).data( "ui-autocomplete" );
|
|
if( obj ) {
|
|
obj._renderItem = function( ul, item ) {
|
|
item.link = "/cgi-bin/koha/members/moremember.pl?borrowernumber=" + item.borrowernumber;
|
|
var cardnumber = "";
|
|
if( item.cardnumber != "" ){
|
|
// Display card number in parentheses if it exists
|
|
cardnumber = " (" + item.cardnumber + ") ";
|
|
}
|
|
return $( "<li></li>" )
|
|
.data( "ui-autocomplete-item", item )
|
|
.append(
|
|
"<a href=\"" + item.link + "\">" + ( item.surname ? item.surname.escapeHtml() : "" ) + ", "
|
|
+ ( item.firstname ? item.firstname.escapeHtml() : "" )
|
|
+ cardnumber.escapeHtml()
|
|
+ " <small>"
|
|
+ ( item.dateofbirth ? item.dateofbirth.escapeHtml() : "" ) + " "
|
|
+ ( item.address ? item.address.escapeHtml() : "" ) + " "
|
|
+ ( item.city ? item.city.escapeHtml() : "" ) + " "
|
|
+ ( item.zipcode ? item.zipcode.escapeHtml() : "" ) + " "
|
|
+ ( item.country ? item.country.escapeHtml() : "" )
|
|
+ "</small>"
|
|
+ "</a>" )
|
|
.appendTo( ul );
|
|
};
|
|
}
|
|
});
|
|
</script>
|
|
[% END %]
|
|
<!-- / js_includes.inc -->
|