From ba8049820ba60be7e13fe4c2f72a8516c89df8a3 Mon Sep 17 00:00:00 2001 From: John Woodlock Date: Sun, 8 Jul 2012 18:20:52 +1000 Subject: [PATCH] wip javascript --- JavaScriptApps/IndivLendHome.html | 2 +- .../resources/IndividualLendingCode.js | 25 ++++++---- .../global-translations/messages.properties | 4 ++ .../messages_es.properties | 4 ++ .../messages_fr.properties | 4 ++ .../messages_pt.properties | 4 ++ .../messages_zh.properties | 4 ++ ...chydata-0.951.js => stretchydata-0.952.js} | 26 ++++++---- .../mifosngbundle/Messages.properties | 4 ++ .../mifosngbundle/Messages_en-US.properties | 2 - .../mifosngbundle/Messages_es.properties | 48 +++++++++++++++++++ .../mifosngbundle/Messages_fr.properties | 48 +++++++++++++++++++ .../mifosngbundle/Messages_pt.properties | 48 +++++++++++++++++++ .../mifosngbundle/Messages_sr.properties | 39 --------------- .../mifosngbundle/Messages_zh.properties | 48 +++++++++++++++++++ 15 files changed, 250 insertions(+), 60 deletions(-) rename JavaScriptApps/resources/{stretchydata-0.951.js => stretchydata-0.952.js} (96%) delete mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_en-US.properties create mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_es.properties create mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_fr.properties create mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_pt.properties delete mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_sr.properties create mode 100644 JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_zh.properties diff --git a/JavaScriptApps/IndivLendHome.html b/JavaScriptApps/IndivLendHome.html index d6de6f10b..7a53358da 100644 --- a/JavaScriptApps/IndivLendHome.html +++ b/JavaScriptApps/IndivLendHome.html @@ -27,7 +27,7 @@ - + diff --git a/JavaScriptApps/resources/IndividualLendingCode.js b/JavaScriptApps/resources/IndividualLendingCode.js index d9e63fb0c..a29555608 100644 --- a/JavaScriptApps/resources/IndividualLendingCode.js +++ b/JavaScriptApps/resources/IndividualLendingCode.js @@ -133,7 +133,7 @@ function setClientListingContent(divName) { function setClientContent(divName) { var htmlVar = '
'; $("#" + divName).html(htmlVar); } @@ -204,7 +204,7 @@ function setReportingContent(divName) { htmlVar += '
'; htmlVar += ' '; htmlVar += ' '; - htmlVar += ' '; + htmlVar += ' '; htmlVar += ' '; htmlVar += ' '; htmlVar += ' '; @@ -811,7 +811,10 @@ function showILClient(clientId) { headingPrefix: "", headingClass: "", labelClass: "longrowlabel", - valueClass: "rowvalue" + valueClass: "rowvalue", + editLabel: doI18N("link.edit"), + saveLabel: doI18N("dialog.button.save"), + cancelLabel: doI18N("dialog.button.cancel") }; jQuery.stretchyData.displayAllExtraData(additionalFieldsParams); }; @@ -1238,7 +1241,10 @@ function loadILLoan(loanId) { headingPrefix: "", headingClass: "", labelClass: "longrowlabel", - valueClass: "rowvalue" + valueClass: "rowvalue", + editLabel: doI18N("link.edit"), + saveLabel: doI18N("dialog.button.save"), + cancelLabel: doI18N("dialog.button.cancel") }; jQuery.stretchyData.displayAllExtraData(additionalFieldsParams) }; @@ -1543,6 +1549,7 @@ var reportingParams = { RESTUrl: baseApiUrl + "reports", basicAuthKey: base64, pentahoUrl: baseApiUrl + "pentahoreport", + initialLanguage: currentCulture, bundleDir: "resources/stretchyreporting/mifosngbundle/", reportsListDiv: "myListOfReports", runReportDiv: "myRunReportButton", @@ -1698,17 +1705,17 @@ function setCultureReshowListing(cultureVal) { function setCulture(cultureVal) { - - Globalize.culture(cultureVal); + currentCulture = cultureVal; + Globalize.culture(currentCulture); - $.datepicker.setDefaults( $.datepicker.regional[cultureVal]); + $.datepicker.setDefaults( $.datepicker.regional[currentCulture]); jQuery.i18n.properties({ name:'messages', path: 'resources/global-translations/', mode:'map', cache: true, - language: cultureVal, + language: currentCulture, callback: function() { } }); diff --git a/JavaScriptApps/resources/global-translations/messages.properties b/JavaScriptApps/resources/global-translations/messages.properties index 67f2eec95..6b0ca160e 100644 --- a/JavaScriptApps/resources/global-translations/messages.properties +++ b/JavaScriptApps/resources/global-translations/messages.properties @@ -1,5 +1,9 @@ # jQuery.1ln8 plugin seems to give first line of properties file as error for some reason. app.name=Mifos - Individual Lending: +app.loading=Loading... + +reporting.decimals=Decimals +reporting.format=Format login.username=User Name login.password=Password diff --git a/JavaScriptApps/resources/global-translations/messages_es.properties b/JavaScriptApps/resources/global-translations/messages_es.properties index ee34d89ed..f40ee3f01 100644 --- a/JavaScriptApps/resources/global-translations/messages_es.properties +++ b/JavaScriptApps/resources/global-translations/messages_es.properties @@ -1,4 +1,8 @@ app.name=Mifos - Individual Lending (es): +app.loading=Loading...(es) + +reporting.decimals=Decimals (es) +reporting.format=Format (es) login.username=User Name (es) login.password=Password (es) diff --git a/JavaScriptApps/resources/global-translations/messages_fr.properties b/JavaScriptApps/resources/global-translations/messages_fr.properties index 1fd826c69..27ed35fb7 100644 --- a/JavaScriptApps/resources/global-translations/messages_fr.properties +++ b/JavaScriptApps/resources/global-translations/messages_fr.properties @@ -1,4 +1,8 @@ app.name=Mifos - Individual Lending (fr): +app.loading=Loading...(fr) + +reporting.decimals=Decimals (fr) +reporting.format=Format (fr) login.username=User Name (fr) login.password=Password (fr) diff --git a/JavaScriptApps/resources/global-translations/messages_pt.properties b/JavaScriptApps/resources/global-translations/messages_pt.properties index c68ed9fc0..d643a3e3d 100644 --- a/JavaScriptApps/resources/global-translations/messages_pt.properties +++ b/JavaScriptApps/resources/global-translations/messages_pt.properties @@ -1,4 +1,8 @@ app.name=Mifos - Individual Lending (pt): +app.loading=Loading...(pt) + +reporting.decimals=Decimals (pt) +reporting.format=Format (pt) login.username=User Name (pt) login.password=Password (pt) diff --git a/JavaScriptApps/resources/global-translations/messages_zh.properties b/JavaScriptApps/resources/global-translations/messages_zh.properties index a7d07f69e..d04435871 100644 --- a/JavaScriptApps/resources/global-translations/messages_zh.properties +++ b/JavaScriptApps/resources/global-translations/messages_zh.properties @@ -1,4 +1,8 @@ app.name=Mifos - Individual Lending (zh): +app.loading=Loading...(zh) + +reporting.decimals=Decimals (zh) +reporting.format=Format (zh) login.username=User Name (zh) login.password=Password (zh) diff --git a/JavaScriptApps/resources/stretchydata-0.951.js b/JavaScriptApps/resources/stretchydata-0.952.js similarity index 96% rename from JavaScriptApps/resources/stretchydata-0.951.js rename to JavaScriptApps/resources/stretchydata-0.952.js index 3aa40539e..af9abc81b 100644 --- a/JavaScriptApps/resources/stretchydata-0.951.js +++ b/JavaScriptApps/resources/stretchydata-0.952.js @@ -25,6 +25,17 @@ return; } + + editLabel = "Edit"; + if (params.editLabel) editLabel = params.editLabel; + + saveLabel = "Save"; + if (params.saveLabel) saveLabel = params.saveLabel; + + cancelLabel = "Cancel"; + if (params.cancelLabel) cancelLabel = params.cancelLabel; + + var headingPrefix = ""; if (params.headingPrefix) headingPrefix = params.headingPrefix; @@ -108,11 +119,10 @@ var popupVar = "jQuery.stretchyData.popupEditDialog('" + url + "', '" + basicAuthKey + "', '" + datasetType + "', '" + datasetName + "', " + datasetPKValue - + ", '" + dsnDivName + "', '" + doI18N("Edit") + " " - + doI18N(datasetName) + "', 900, 500)"; - var editLink = '' - + doI18N("Edit") + '
'; - // alert(editLink); + + ", '" + dsnDivName + "', '" + editLabel + " " + + doI18N(datasetName) + "', 900, 500);return false;"; + var editLink = '' + + editLabel + '
'; return editLink; } @@ -365,10 +375,8 @@ function extraDataOpenDialog(url, basicAuthKey) { - // var saveButton = jQuery.i18n.prop('dialog.button.save'); - // var cancelButton = jQuery.i18n.prop('dialog.button.cancel'); - var saveButton = "save"; - var cancelButton = "cancel" + var saveButton = saveLabel; + var cancelButton = cancelLabel; var buttonsOpts = {}; buttonsOpts[saveButton] = function() { diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages.properties index ba07f6335..976cf4c4a 100644 --- a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages.properties +++ b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages.properties @@ -1,4 +1,8 @@ +#Options +Show Table=Show Table +Full CSV Export=Full CSV Export + #Messages appropriateValues = Please select appropriate values appropriateDateValues = Please enter appropriate date values diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_en-US.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_en-US.properties deleted file mode 100644 index 5932cbb9f..000000000 --- a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_en-US.properties +++ /dev/null @@ -1,2 +0,0 @@ - -appropriateValues = Please select appropriate values \ No newline at end of file diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_es.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_es.properties new file mode 100644 index 000000000..2adfd130f --- /dev/null +++ b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_es.properties @@ -0,0 +1,48 @@ + +#Options +Show Table=Show Table (es) +Full CSV Export=Full CSV Export (es) + +#Messages +appropriateValues = Please select appropriate values (es) +appropriateDateValues = Please enter appropriate date values (es) +invalidDate = Invalid Date: (es) +startAfterEndDate = Start Date is After End Date (es) +reportingInitError = Reporting Initialise Error: parameter {0} Mandatory (es) + +#Labels +rpt_run = Run (es) +rpt_clear = Clear (es) +rpt_select_one = Select One (es) +rpt_select_all = All (es) + +Report = Report (es) +Office = Office (es) +startDate = Start Date (es) +endDate = End Date (es) + + +#Screen Reports/Screen Charts/Pentaho Reports +ListClientLoans = List Client Loans (es) +ListClients = List Clients (es) + + +#ListClientLoans +Name = Client (es) +current_state_enum = Status Id (es) +installments = No. of Installments (es) +interest_rate_peryear = Interest Rate Per Annum (es) +principal_currency_code = Currency (es) +principal_amount = Principal (es) +submittedon_date = Submitted (es) +approvedon_date = Approved (es) +expected_disbursedon_date = Expected Disbursal (es) +expected_firstrepaymenton_date = Expected 1st Repayment (es) +expected_maturedon_date = Expected Maturity (es) +disbursedon_date = Disbursal (es) +closedon_date = Closed (es) +withdrawnon_date = Withdrawn (es) +rejectedon_date = Rejected (es) +rescheduledon_date = Rescheduled (es) +writtenoffon_date = Written Off (es) + diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_fr.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_fr.properties new file mode 100644 index 000000000..033575bf1 --- /dev/null +++ b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_fr.properties @@ -0,0 +1,48 @@ + +#Options +Show Table=Show Table (fr) +Full CSV Export=Full CSV Export (fr) + +#Messages +appropriateValues = Please select appropriate values (fr) +appropriateDateValues = Please enter appropriate date values (fr) +invalidDate = Invalid Date: (fr) +startAfterEndDate = Start Date is After End Date (fr) +reportingInitError = Reporting Initialise Error: parameter {0} Mandatory (fr) + +#Labels +rpt_run = Run (fr) +rpt_clear = Clear (fr) +rpt_select_one = Select One (fr) +rpt_select_all = All (fr) + +Report = Report (fr) +Office = Office (fr) +startDate = Start Date (fr) +endDate = End Date (fr) + + +#Screen Reports/Screen Charts/Pentaho Reports +ListClientLoans = List Client Loans (fr) +ListClients = List Clients (fr) + + +#ListClientLoans +Name = Client (fr) +current_state_enum = Status Id (fr) +installments = No. of Installments (fr) +interest_rate_peryear = Interest Rate Per Annum (fr) +principal_currency_code = Currency (fr) +principal_amount = Principal (fr) +submittedon_date = Submitted (fr) +approvedon_date = Approved (fr) +expected_disbursedon_date = Expected Disbursal (fr) +expected_firstrepaymenton_date = Expected 1st Repayment (fr) +expected_maturedon_date = Expected Maturity (fr) +disbursedon_date = Disbursal (fr) +closedon_date = Closed (fr) +withdrawnon_date = Withdrawn (fr) +rejectedon_date = Rejected (fr) +rescheduledon_date = Rescheduled (fr) +writtenoffon_date = Written Off (fr) + diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_pt.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_pt.properties new file mode 100644 index 000000000..194a68f7c --- /dev/null +++ b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_pt.properties @@ -0,0 +1,48 @@ + +#Options +Show Table=Show Table (pt) +Full CSV Export=Full CSV Export (pt) + +#Messages +appropriateValues = Please select appropriate values (pt) +appropriateDateValues = Please enter appropriate date values (pt) +invalidDate = Invalid Date: (pt) +startAfterEndDate = Start Date is After End Date (pt) +reportingInitError = Reporting Initialise Error: parameter {0} Mandatory (pt) + +#Labels +rpt_run = Run (pt) +rpt_clear = Clear (pt) +rpt_select_one = Select One (pt) +rpt_select_all = All (pt) + +Report = Report (pt) +Office = Office (pt) +startDate = Start Date (pt) +endDate = End Date (pt) + + +#Screen Reports/Screen Charts/Pentaho Reports +ListClientLoans = List Client Loans (pt) +ListClients = List Clients (pt) + + +#ListClientLoans +Name = Client (pt) +current_state_enum = Status Id (pt) +installments = No. of Installments (pt) +interest_rate_peryear = Interest Rate Per Annum (pt) +principal_currency_code = Currency (pt) +principal_amount = Principal (pt) +submittedon_date = Submitted (pt) +approvedon_date = Approved (pt) +expected_disbursedon_date = Expected Disbursal (pt) +expected_firstrepaymenton_date = Expected 1st Repayment (pt) +expected_maturedon_date = Expected Maturity (pt) +disbursedon_date = Disbursal (pt) +closedon_date = Closed (pt) +withdrawnon_date = Withdrawn (pt) +rejectedon_date = Rejected (pt) +rescheduledon_date = Rescheduled (pt) +writtenoffon_date = Written Off (pt) + diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_sr.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_sr.properties deleted file mode 100644 index d6b2ac4bc..000000000 --- a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_sr.properties +++ /dev/null @@ -1,39 +0,0 @@ - -#Messages -appropriateValues = Just put the right values in -invalidDate = Bad Date Mate: -startAfterEndDate = Start Date is After End Date - -#Labels -rpt_run = Kick It -rpt_clear = Rubbed Out -rpt_select_one = Pick 1 Mate -rpt_select_all = Kit n Kaboodle - -Report = Tell Me -Office = Big End of Town -startDate = Start It Here -endDate = End It Here - - -#Screen Reports/Screen Charts/Pentaho Reports -ActiveLoansLastInstallment = Nearly Finished -ActiveLoanSummaryBranch = Loan Summary -AgingSummary = Aging and Aging -CustomerDetails = Custmer Detawls - - -#ActiveLoansLastInstallment Column Headers -center_name = Centa -group_name = Growp -client_name = Cliyant -loan_amount = Laun Amownt -office_name = Orfice - -#ActiveLoanSummaryBranch Column Headers -branch = Braanch -amount_arrears = Amount up the Creek - -#AgingSummary Column Headers -weeks_in_arrears = Weeks up the Creek -transaction_type = Txn Typo \ No newline at end of file diff --git a/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_zh.properties b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_zh.properties new file mode 100644 index 000000000..a83981bc9 --- /dev/null +++ b/JavaScriptApps/resources/stretchyreporting/mifosngbundle/Messages_zh.properties @@ -0,0 +1,48 @@ + +#Options +Show Table=Show Table (zh) +Full CSV Export=Full CSV Export (zh) + +#Messages +appropriateValues = Please select appropriate values (zh) +appropriateDateValues = Please enter appropriate date values (zh) +invalidDate = Invalid Date: (zh) +startAfterEndDate = Start Date is After End Date (zh) +reportingInitError = Reporting Initialise Error: parameter {0} Mandatory (zh) + +#Labels +rpt_run = Run (zh) +rpt_clear = Clear (zh) +rpt_select_one = Select One (zh) +rpt_select_all = All (zh) + +Report = Report (zh) +Office = Office (zh) +startDate = Start Date (zh) +endDate = End Date (zh) + + +#Screen Reports/Screen Charts/Pentaho Reports +ListClientLoans = List Client Loans (zh) +ListClients = List Clients (zh) + + +#ListClientLoans +Name = Client (zh) +current_state_enum = Status Id (zh) +installments = No. of Installments (zh) +interest_rate_peryear = Interest Rate Per Annum (zh) +principal_currency_code = Currency (zh) +principal_amount = Principal (zh) +submittedon_date = Submitted (zh) +approvedon_date = Approved (zh) +expected_disbursedon_date = Expected Disbursal (zh) +expected_firstrepaymenton_date = Expected 1st Repayment (zh) +expected_maturedon_date = Expected Maturity (zh) +disbursedon_date = Disbursal (zh) +closedon_date = Closed (zh) +withdrawnon_date = Withdrawn (zh) +rejectedon_date = Rejected (zh) +rescheduledon_date = Rescheduled (zh) +writtenoffon_date = Written Off (zh) +