Bugzilla – Attachment 19686 Details for
Bug 7598
Acquisitions JavaScript contains untranslatable English strings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
SIGNED-OFF-Bug-7598---Acquisitions-JavaScript-cont.patch (text/plain), 7.09 KB, created by
Srdjan Jankovic
on 2013-07-16 06:37:37 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 7598 - Acquisitions JavaScript contains untranslatable English strings
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2013-07-16 06:37:37 UTC
Size:
7.09 KB
patch
obsolete
>From 644b7e8fc8e77e4fefa267e34d88c6ca8deb52c0 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 10 Sep 2012 08:34:33 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 7598 - Acquisitions JavaScript contains > untranslatable English strings > >English strings in acq.js cannot be processed by the translation script. >This patch moves the strings to the templates to be set as JS variables >for use by the script. > >To test: > >- On the uncertain prices page, enter an invalid price and click save. > You should see a JavaScript alert pointing this out. > >- When adding a fund to an existing budget, enter an amount which > exceeds the amount in the parent budget. You should see a JavaScript > alert pointing this out. There is a similar function which has been > corrected, checkBudgetParent(), but I don't know how to trigger it for > testing. > >The closebasketgroup function has been updated but as far as I can tell >it's not actually in use. > >Signed-off-by: Srdjan <srdjan@catalyst.net.nz> >--- > koha-tmpl/intranet-tmpl/prog/en/js/acq.js | 20 ++++++++++---------- > .../prog/en/modules/acqui/basketgroup.tt | 6 ++++++ > .../prog/en/modules/acqui/uncertainprice.tt | 1 + > .../intranet-tmpl/prog/en/modules/admin/aqbudgets.tt | 7 +++++++ > 4 files changed, 24 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >index b9039ea..b1fdf58 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/acq.js >@@ -4,7 +4,7 @@ > function uncheckbox(form, field) { > var price = new Number(form.elements['price' + field].value); > var tmpprice = ""; >- var errmsg = _("ERROR: Price is not a valid number, please check the price and try again!") >+ var errmsg = MSG_INVALIDPRICE; > if (isNaN(price)) { > alert(errmsg); > for(var i=0; i<form.elements['price' + field].value.length; ++i) { >@@ -335,7 +335,7 @@ function enterpressed(event){ > > //Closes a basketgroup > function closebasketgroup(bgid) { >- var answer=confirm(_("Are you sure you want to close this basketgroup?")); >+ var answer = confirm(MSG_CONFIRM_CLOSE_BASKETGROUP); > if(! answer){ > return; > } >@@ -353,7 +353,7 @@ function closebasketgroup(bgid) { > var ul = document.getElementById(ulid); > var lis = ul.getElementsByTagName('li'); > if (lis.length == 0 ) { >- alert(_("Why close an empty basket?")); >+ alert(MSG_CLOSE_EMPTY_BASKET); > return; > } > var cantprint = document.createElement('p'); >@@ -369,11 +369,11 @@ function closebasketgroup(bgid) { > ddtarget.unreg(); > div.removeChild(stufftoremove); > // the print button is disabled because the page's content might (or is probably) not in sync with what the database contains >- cantprint.innerHTML=_("You need to save the page before printing"); >+ cantprint.innerHTML = MSG_SAVE_BEFORE_PRINTING; > cantprint.id = 'cantprint-' + bgid; > var unclosegroup = document.createElement('a'); > unclosegroup.href='javascript:unclosegroup('+bgid+');'; >- unclosegroup.innerHTML=_("reopen basketgroup"); >+ unclosegroup.innerHTML= MSG_REOPEN_BASKETGROUP; > unclosegroup.id = 'unclose-' + bgid; > > div.appendChild(cantprint); >@@ -384,7 +384,7 @@ function closeandprint(bg){ > if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){ > setTimeout("window.location.reload();",3000); > }else{ >- alert(_("Error downloading the file")); >+ alert(MSG_FILE_DOWNLOAD_ERROR); > } > } > >@@ -820,9 +820,9 @@ if ( newBudgetParent ) { url += '&parent_id=' + newBudgetParent}; > var result = eval ( xmlhttp.responseText ); > > if (result == '1') { >- return _("- Budget total exceeds parent allocation\n"); >+ return MSG_BUDGET_PARENT_ALLOCATION; > } else if (result == '2') { >- return _("- Budget total exceeds period allocation\n"); >+ return MSG_BUDGET_PARENT_ALLOCATION; > } else { > return false; > } >@@ -854,7 +854,7 @@ function checkBudgetParent(budgetId, newBudgetParent) { > var result = eval ( xmlhttp.responseText ); > > if (result == '1') { >- return _("- New budget-parent is beneath budget\n"); >+ return MSG_PARENT_BENEATH_BUDGET; > // } else if (result == '2') { > // return "- New budget-parent has insufficent funds\n"; > // } else { >@@ -891,4 +891,4 @@ function hideAllColumns(){ > $("#selections span").removeClass("selected"); > $("#plan td:nth-child(2),#plan th:nth-child(2)").nextUntil("th:nth-child("+(allCols-1)+"),td:nth-child("+(allCols-1)+")").hide(); // hide all but the last two columns > $("#hideall").attr("checked","checked").parent().addClass("selected"); >-} >\ No newline at end of file >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >index 4c5e604..6bb0048 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt >@@ -95,6 +95,12 @@ fieldset.various li { > //<![CDATA[ > YAHOO.util.Event.onDOMReady(DDApp.init, DDApp, true); > >+var MSG_CONFIRM_CLOSE_BASKETGROUP = _("Are you sure you want to close this basketgroup?"); >+var MSG_CLOSE_EMPTY_BASKET = _("Why close an empty basket?"); >+var MSG_SAVE_BEFORE_PRINTING = _("You need to save the page before printing"); >+var MSG_REOPEN_BASKETGROUP = _("reopen basketgroup"); >+var MSG_FILE_DOWNLOAD_ERROR = _("Error downloading the file"); >+ > function submitForm(form) { > if (form.close.checked == true) { > var input = document.createElement("input"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >index 7bbad51..a7b5fc9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt >@@ -15,6 +15,7 @@ > "sPaginationType": "four_button" > } ) ); > }); >+var MSG_INVALIDPRICE = _("ERROR: Price is not a valid number, please check the price and try again!"); > //]]> > </script> > <script type="text/javascript" src="[% themelang %]/js/acq.js"></script> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >index 7df04f3..44106ae 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt >@@ -1,6 +1,13 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Funds[% IF ( add_form ) %] › [% IF ( budget_id ) %]Modify fund[% IF ( budget_name ) %] '[% budget_name %]'[% END %][% ELSE %]Add fund [% END %][% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+var MSG_BUDGET_PARENT_ALLOCATION = _("- Fund amount exceeds parent allocation\n"); >+var MSG_PARENT_BENEATH_BUDGET = _("- New budget-parent is beneath budget\n"); >+//]]> >+</script> >+ > <script type="text/javascript" src="[% themelang %]/js/acq.js"></script> > > [% IF ( add_form ) %] >-- >1.8.1.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7598
:
19580
|
19686
|
19772
|
19785
|
19786