wip javascript
This commit is contained in:
@@ -873,7 +873,7 @@
|
|||||||
<form id="entityform">
|
<form id="entityform">
|
||||||
<div id="formerrors"></div>
|
<div id="formerrors"></div>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<input type="hidden" id="locale" name="locale" value="${currentLocale}" />
|
<input type="hidden" id="locale" name="locale" value="{{=$ctx.currentLocale()}}" />
|
||||||
<legend>{{=$ctx.doI18N("form.legend.loan.product.information")}}</legend>
|
<legend>{{=$ctx.doI18N("form.legend.loan.product.information")}}</legend>
|
||||||
|
|
||||||
<label for="name">{{=$ctx.doI18N("form.label.loan.product.name")}}</label>
|
<label for="name">{{=$ctx.doI18N("form.label.loan.product.name")}}</label>
|
||||||
|
|||||||
@@ -1,14 +1,3 @@
|
|||||||
/* not used
|
|
||||||
queryParam = (function(){
|
|
||||||
var query = {}, pair, search = location.search.substring(1).split("&"), i = search.length;
|
|
||||||
while (i--) {
|
|
||||||
pair = search[i].split("=");
|
|
||||||
query[pair[0]] = decodeURIComponent(pair[1]);
|
|
||||||
}
|
|
||||||
return query;
|
|
||||||
})();
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
saveSuccessFunctionReloadClient = function(data, textStatus, jqXHR) {
|
saveSuccessFunctionReloadClient = function(data, textStatus, jqXHR) {
|
||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
@@ -117,13 +106,14 @@ function setAddLoanContent(divName) {
|
|||||||
|
|
||||||
function setOrgAdminContent(divName) {
|
function setOrgAdminContent(divName) {
|
||||||
|
|
||||||
|
var addLoanProductUrl = "maintainLoanProduct('loanproducts/template', 'loanproducts', 'POST', 'dialog.title.add.loan.product');return false;";
|
||||||
var htmlVar = '<div id="inputarea"></div><div id="schedulearea"></div>'
|
var htmlVar = '<div id="inputarea"></div><div id="schedulearea"></div>'
|
||||||
|
|
||||||
var htmlVar = '<div>';
|
var htmlVar = '<div>';
|
||||||
htmlVar += '<span style="float: left">';
|
htmlVar += '<span style="float: left">';
|
||||||
htmlVar += ' <a href="unknown.html" onclick="refreshLoanProductsView();return false;" id="viewloanproducts">' + doI18N("administration.link.view.products") + '</a>';
|
htmlVar += ' <a href="unknown.html" onclick="refreshLoanProductsView();return false;" id="viewloanproducts">' + doI18N("administration.link.view.products") + '</a>';
|
||||||
htmlVar += ' | ';
|
htmlVar += ' | ';
|
||||||
htmlVar += ' <a href="#" id="addloanproduct">' + doI18N("administration.link.add.product") + '</a>';
|
htmlVar += ' <a href="unknown.html" onclick="' + addLoanProductUrl + '" id="addloanproduct">' + doI18N("administration.link.add.product") + '</a>';
|
||||||
htmlVar += ' | ';
|
htmlVar += ' | ';
|
||||||
htmlVar += ' <a href="#" id="viewoffices">' + doI18N("administration.link.view.offices") + '</a>';
|
htmlVar += ' <a href="#" id="viewoffices">' + doI18N("administration.link.view.offices") + '</a>';
|
||||||
htmlVar += ' | ';
|
htmlVar += ' | ';
|
||||||
@@ -1128,9 +1118,9 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
/* user admin code */
|
/* user admin code */
|
||||||
|
|
||||||
function showILOrgAdmin() {
|
function showILOrgAdmin() {
|
||||||
setOrgAdminContent("content");
|
setOrgAdminContent("content");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refreshLoanProductsView() {
|
function refreshLoanProductsView() {
|
||||||
@@ -1148,18 +1138,9 @@ function showILOrgAdmin() {
|
|||||||
$("a.editproduct").click( function(e) {
|
$("a.editproduct").click( function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var productId = linkId.replace("editproduct", "");
|
var productId = linkId.replace("editproduct", "");
|
||||||
var getUrl = baseApiUrl + 'loanproducts/' + productId + '?template=true';
|
var getUrl = 'loanproducts/' + productId + '?template=true';
|
||||||
var putUrl = baseApiUrl + 'loanproducts/' + productId;
|
var putUrl = 'loanproducts/' + productId;
|
||||||
|
maintainLoanProduct(getUrl, putUrl, 'PUT', "dialog.title.product.details");
|
||||||
var templateSelector = "#productFormTemplate";
|
|
||||||
var width = 800;
|
|
||||||
var height = 550;
|
|
||||||
|
|
||||||
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
|
||||||
$("#dialog-form").dialog("close");
|
|
||||||
refreshLoanProductsView();
|
|
||||||
}
|
|
||||||
popupDialogWithFormView(getUrl, putUrl, 'PUT', "dialog.title.product.details", templateSelector, width, height, saveSuccessFunction);
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1193,7 +1174,20 @@ function showILOrgAdmin() {
|
|||||||
executeAjaxRequest(url, 'GET', "", base64, successFunction, formErrorFunction);
|
executeAjaxRequest(url, 'GET', "", base64, successFunction, formErrorFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function maintainLoanProduct(getUrl, putOrPostUrl, submitType, dialogTitle) {
|
||||||
|
var templateSelector = "#productFormTemplate";
|
||||||
|
var width = 800;
|
||||||
|
var height = 550;
|
||||||
|
|
||||||
|
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
||||||
|
$("#dialog-form").dialog("close");
|
||||||
|
refreshLoanProductsView();
|
||||||
|
}
|
||||||
|
|
||||||
|
popupDialogWithFormView(baseApiUrl + getUrl, baseApiUrl + putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user