This patch adds HTML comments to Template::Toolkit include files which contain <script> tags so that it is clear where the embedded scripts can be found in the code. To test, apply the patch and view source on the following pages to verify the presence of the comments: Acquisitions home page: - acquisitions-toolbar.inc - validtor-strings.inc - js_includes.inc - format-price.inc Acquisitions -> Add order from new record, Acquisitions -> Receive order: - additem.js.inc Cataloging -> Add/Edit item: - columns_settings.inc - strings.inc - select2.inc - calendar.inc - str/cataloging_additem.inc Authorities home page: - authorities_js.inc Bibliographic detail page: - catalog-strings.inc Cataloging -> Advanced editor: - cateditor-ui.inc - cateditor-widgets-marc21.inc Administration -> Item types: - greybox.inc ILL requests: - ill-list-table-strings.inc Web installer - installer-intranet-bottom.inc Web installer -> Onboarding - installer-strings.inc Lists -> List contents -> Merge records - merge-record-strings.inc Patrons -> Patron -> Change password - password_check.inc - str/members-menu.inc Patrons -> Patron -> Print summary - slip-print.inc Circulation -> Check out - timepicker.inc Administration -> System preferences: - str/tinymce_i18n.inc - wysiwyg-systempreferences.inc Cataloging -> Z39.50 Search: - z3950_search.inc Signed-off-by: Frédéric Demians <f.demians@tamil.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
36 lines
1.5 KiB
PHP
36 lines
1.5 KiB
PHP
[% USE Koha %]
|
|
<!-- format-price.inc -->
|
|
<script>
|
|
[%# This should use the Format template plugin, but not pushed yet %]
|
|
[% IF Koha.Preference("CurrencyFormat") == 'FR' %]
|
|
var default_value = {
|
|
thousands_sep: ' ',
|
|
decimal_point: ',',
|
|
decimal_digits: 2
|
|
};
|
|
[% ELSIF Koha.Preference("CurrencyFormat") == 'CH' %]
|
|
var default_value = {
|
|
thousands_sep: '\'',
|
|
decimal_point: '.',
|
|
decimal_digits: 2
|
|
};
|
|
[% ELSE %]
|
|
var default_value = {
|
|
thousands_sep: ',',
|
|
decimal_point: '.',
|
|
decimal_digits: 2
|
|
};
|
|
|
|
[% END %]
|
|
Number.prototype.format_price = function( value, params ) {
|
|
params = params == undefined ? {} : params;
|
|
var thousands_sep = params.thousands_sep == undefined ? default_value.thousands_sep : params.thousands_sep,
|
|
decimal_point = params.decimal_point == undefined ? default_value.decimal_point : params.decimal_point,
|
|
//symbol = params.symbol == undefined ? '$' : params.symbol, // Not implemented yet
|
|
decimal_digits = params.decimal_digits == undefined ? default_value.decimal_digits : params.decimal_digits;
|
|
|
|
var re = '\\d(?=(\\d{' + 3 + '})+' + '\\D' + ')', value = this.toFixed(decimal_digits);
|
|
return value.replace('.', decimal_point).replace(new RegExp(re, 'g'), '$&' + thousands_sep);
|
|
}
|
|
</script>
|
|
<!-- / format-price.inc -->
|