wip javascript
This commit is contained in:
@@ -345,7 +345,7 @@
|
|||||||
<script id="clientSearchTabTemplate" type="text/x-jquery-tmpl">
|
<script id="clientSearchTabTemplate" type="text/x-jquery-tmpl">
|
||||||
<form method="post" id="viewClient" name="viewClient" action="switchToClient">
|
<form method="post" id="viewClient" name="viewClient" action="switchToClient">
|
||||||
<label for="client">Choose client:</label>
|
<label for="client">Choose client:</label>
|
||||||
<select name="client" id="client" onChange="showILClient(baseApiUrl, options[selectedIndex].value);">
|
<select name="client" id="client" onChange="showILClient(options[selectedIndex].value);">
|
||||||
<option value="0">--Select Client--</option>
|
<option value="0">--Select Client--</option>
|
||||||
{{#each clients}}
|
{{#each clients}}
|
||||||
<option value="{{=id}}">{{=displayName}} - ({{=officeName}})</option>
|
<option value="{{=id}}">{{=displayName}} - ({{=officeName}})</option>
|
||||||
@@ -401,7 +401,7 @@
|
|||||||
<span class="longrowlabel">Pending approval loans ({{=$ctx.number(pendingApprovalLoanCount)}}):</span>
|
<span class="longrowlabel">Pending approval loans ({{=$ctx.number(pendingApprovalLoanCount)}}):</span>
|
||||||
<span class="rowvalue">
|
<span class="rowvalue">
|
||||||
{{#each pendingApprovalLoans}}
|
{{#each pendingApprovalLoans}}
|
||||||
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan(baseApiUrl, {{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -412,7 +412,7 @@
|
|||||||
<span class="longrowlabel">Awaiting disbursal loans ({{=$ctx.number(awaitingDisbursalLoanCount)}}):</span>
|
<span class="longrowlabel">Awaiting disbursal loans ({{=$ctx.number(awaitingDisbursalLoanCount)}}):</span>
|
||||||
<span class="rowvalue">
|
<span class="rowvalue">
|
||||||
{{#each awaitingDisbursalLoans}}
|
{{#each awaitingDisbursalLoans}}
|
||||||
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan(baseApiUrl, {{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
<span class="longrowlabel">Active loans ({{=$ctx.number(activeLoanCount)}}):</span>
|
<span class="longrowlabel">Active loans ({{=$ctx.number(activeLoanCount)}}):</span>
|
||||||
<span class="rowvalue">
|
<span class="rowvalue">
|
||||||
{{#each openLoans}}
|
{{#each openLoans}}
|
||||||
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan(baseApiUrl, {{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -434,7 +434,7 @@
|
|||||||
<div class="longrowlabel">Closed loans ({{=$ctx.number(closedLoanCount)}}):</div>
|
<div class="longrowlabel">Closed loans ({{=$ctx.number(closedLoanCount)}}):</div>
|
||||||
<div class="rowvalue">
|
<div class="rowvalue">
|
||||||
{{#each closedLoans}}
|
{{#each closedLoans}}
|
||||||
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan(baseApiUrl, {{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
<span class="loanaccount"><a href="unknown.html" onclick="showILLoan({{=id}}, '{{=loanProductName}}');return false ;" >{{=loanProductName}}: #{{=id}}</a></span>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1420,7 +1420,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="navwrapper">
|
<div id="navwrapper">
|
||||||
<ul id="nav" class="floatleft">
|
<ul id="nav" class="floatleft">
|
||||||
<li><a href="unknown.html" onclick="showILClientListing(baseApiUrl);return false;">Clients</a></li>
|
<li><a href="unknown.html" onclick="showILClientListing();return false;">Clients</a></li>
|
||||||
<li><a href="unknown.html" onclick="showILUserAdmin();return false;">User Administration</a></li>
|
<li><a href="unknown.html" onclick="showILUserAdmin();return false;">User Administration</a></li>
|
||||||
<li><a href="unknown.html" onclick="showILOrgAdmin();return false;">Organisation Administration</a></li>
|
<li><a href="unknown.html" onclick="showILOrgAdmin();return false;">Organisation Administration</a></li>
|
||||||
<li><a href="unknown.html" onclick="showILReporting();return false;">Reports</a></li>
|
<li><a href="unknown.html" onclick="showILReporting();return false;">Reports</a></li>
|
||||||
@@ -1486,7 +1486,7 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
jsViewsRegisterHelpers();
|
jsViewsRegisterHelpers();
|
||||||
|
|
||||||
showILLogon(baseApiUrl, "logonDiv");
|
showILLogon("logonDiv");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
saveSuccessFunctionReloadClient = function(data, textStatus, jqXHR) {
|
saveSuccessFunctionReloadClient = function(data, textStatus, jqXHR) {
|
||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
showILClient(baseApiUrl, currentClientId );
|
showILClient(currentClientId );
|
||||||
};
|
};
|
||||||
|
|
||||||
saveSuccessFunctionReloadLoan = function(data, textStatus, jqXHR) {
|
saveSuccessFunctionReloadLoan = function(data, textStatus, jqXHR) {
|
||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
loadILLoan(baseApiUrl, loanId);
|
loadILLoan(loanId);
|
||||||
clientDirty = true;
|
clientDirty = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ formErrorFunction = function(jqXHR, textStatus, errorThrown) {
|
|||||||
function executeAjaxRequest(url, verbType, jsonData, successFunction, errorFunction) {
|
function executeAjaxRequest(url, verbType, jsonData, successFunction, errorFunction) {
|
||||||
|
|
||||||
var jqxhr = $.ajax({
|
var jqxhr = $.ajax({
|
||||||
url : url,
|
url : baseApiUrl + url,
|
||||||
type : verbType, //POST, GET, PUT or DELETE
|
type : verbType, //POST, GET, PUT or DELETE
|
||||||
contentType : "application/json; charset=utf-8",
|
contentType : "application/json; charset=utf-8",
|
||||||
dataType : 'json',
|
dataType : 'json',
|
||||||
@@ -44,22 +44,22 @@ function doI18N(xlateStr, params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showILLogon(apiUrl, logonDivName) {
|
function showILLogon(logonDivName) {
|
||||||
|
|
||||||
var htmlVar = '<form name = "logonform"><table><tr><td>User Name:</td><td><input type="text" name="username"></td></tr>';
|
var htmlVar = '<form name = "logonform"><table><tr><td>User Name:</td><td><input type="text" name="username"></td></tr>';
|
||||||
htmlVar += '<tr><td>Password: </td><td><input type="password" name="password"></td></tr>';
|
htmlVar += '<tr><td>Password: </td><td><input type="password" name="password"></td></tr>';
|
||||||
htmlVar += '<tr><td><input type="button" value="Logon" name="Submit" ';
|
htmlVar += '<tr><td><input type="button" value="Logon" name="Submit" ';
|
||||||
htmlVar += 'onclick= "setBasicAuthKey(' + "'" + apiUrl + "', '" + logonDivName + "'" + ', document.logonform.username.value, document.logonform.password.value )"></td><td></td></tr></table></form>';
|
htmlVar += 'onclick= "setBasicAuthKey(' + "'" + logonDivName + "'" + ', document.logonform.username.value, document.logonform.password.value )"></td><td></td></tr></table></form>';
|
||||||
|
|
||||||
$("#" + logonDivName).html(htmlVar);
|
$("#" + logonDivName).html(htmlVar);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setBasicAuthKey(apiUrl, logonDivName, username, password)
|
function setBasicAuthKey(logonDivName, username, password)
|
||||||
{
|
{
|
||||||
base64 = "";
|
base64 = "";
|
||||||
var jqxhr = $.ajax({
|
var jqxhr = $.ajax({
|
||||||
url : apiUrl + "authentication?username=" + username + "&password=" + password,
|
url : baseApiUrl + "authentication?username=" + username + "&password=" + password,
|
||||||
type : 'POST',
|
type : 'POST',
|
||||||
contentType : "application/json; charset=utf-8",
|
contentType : "application/json; charset=utf-8",
|
||||||
dataType : 'json',
|
dataType : 'json',
|
||||||
@@ -69,7 +69,7 @@ function setBasicAuthKey(apiUrl, logonDivName, username, password)
|
|||||||
base64 = data.base64EncodedAuthenticationKey;
|
base64 = data.base64EncodedAuthenticationKey;
|
||||||
$("#" + logonDivName).hide();
|
$("#" + logonDivName).hide();
|
||||||
$("#container").show();
|
$("#container").show();
|
||||||
showILClientListing(apiUrl);
|
showILClientListing();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
error : function(jqXHR, textStatus, errorThrown) {
|
error : function(jqXHR, textStatus, errorThrown) {
|
||||||
@@ -575,7 +575,7 @@ function jsViewsRegisterHelpers() {
|
|||||||
|
|
||||||
//all the code for the various functions
|
//all the code for the various functions
|
||||||
|
|
||||||
function showILClientListing(baseApiUrl) {
|
function showILClientListing() {
|
||||||
|
|
||||||
setClientListingContent("content");
|
setClientListingContent("content");
|
||||||
|
|
||||||
@@ -598,7 +598,7 @@ setClientListingContent("content");
|
|||||||
$("#searchtab").html(tableHtml);
|
$("#searchtab").html(tableHtml);
|
||||||
};
|
};
|
||||||
|
|
||||||
executeAjaxRequest(baseApiUrl + 'clients', 'GET', "", successFunction, formErrorFunction);
|
executeAjaxRequest('clients', 'GET', "", successFunction, formErrorFunction);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -606,11 +606,11 @@ setClientListingContent("content");
|
|||||||
|
|
||||||
var addClientSuccessFunction = function(data, textStatus, jqXHR) {
|
var addClientSuccessFunction = function(data, textStatus, jqXHR) {
|
||||||
$('#dialog-form').dialog("close");
|
$('#dialog-form').dialog("close");
|
||||||
showILClient(baseApiUrl, data.entityId);
|
showILClient(data.entityId);
|
||||||
}
|
}
|
||||||
$("#addclient").button().click(function(e) {
|
$("#addclient").button().click(function(e) {
|
||||||
var getUrl = baseApiUrl + 'clients/template';
|
var getUrl = 'clients/template';
|
||||||
var postUrl = baseApiUrl + 'clients';
|
var postUrl = 'clients';
|
||||||
var templateSelector = "#clientFormTemplate";
|
var templateSelector = "#clientFormTemplate";
|
||||||
var width = 600;
|
var width = 600;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -626,8 +626,8 @@ setClientListingContent("content");
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function showILClient(baseApiUrl, clientId) {
|
function showILClient(clientId) {
|
||||||
var clientUrl = baseApiUrl + 'clients/' + clientId
|
var clientUrl = 'clients/' + clientId
|
||||||
setClientContent("content");
|
setClientContent("content");
|
||||||
$newtabs = $("#newtabs").tabs({
|
$newtabs = $("#newtabs").tabs({
|
||||||
|
|
||||||
@@ -673,7 +673,7 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
$('.newloanbtn').button().click(function(e) {
|
$('.newloanbtn').button().click(function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var clientId = linkId.replace("newloanbtn", "");
|
var clientId = linkId.replace("newloanbtn", "");
|
||||||
addILLoan(baseApiUrl, clientId);
|
addILLoan(clientId);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
$('button.newloanbtn span').text(doI18N('dialog.button.new.loan.application'));
|
$('button.newloanbtn span').text(doI18N('dialog.button.new.loan.application'));
|
||||||
@@ -681,14 +681,14 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
$('.addnotebtn').button().click(function(e) {
|
$('.addnotebtn').button().click(function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var clientId = linkId.replace("addnotebtn", "");
|
var clientId = linkId.replace("addnotebtn", "");
|
||||||
var postUrl = baseApiUrl + 'clients/' + clientId + '/notes';
|
var postUrl = 'clients/' + clientId + '/notes';
|
||||||
var templateSelector = "#noteFormTemplate";
|
var templateSelector = "#noteFormTemplate";
|
||||||
var width = 600;
|
var width = 600;
|
||||||
var height = 400;
|
var height = 400;
|
||||||
|
|
||||||
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
refreshNoteWidget(baseApiUrl + 'clients/' + clientId);
|
refreshNoteWidget('clients/' + clientId);
|
||||||
}
|
}
|
||||||
|
|
||||||
popupDialogWithFormView("", postUrl, 'POST', "dialog.title.add.note", templateSelector, width, height, saveSuccessFunction);
|
popupDialogWithFormView("", postUrl, 'POST', "dialog.title.add.note", templateSelector, width, height, saveSuccessFunction);
|
||||||
@@ -762,12 +762,12 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function addILLoan(baseApiUrl, clientId) {
|
function addILLoan(clientId) {
|
||||||
setAddLoanContent("content");
|
setAddLoanContent("content");
|
||||||
|
|
||||||
eval(genAddLoanSuccessVar(clientId));
|
eval(genAddLoanSuccessVar(clientId));
|
||||||
|
|
||||||
executeAjaxRequest(baseApiUrl + 'loans/template?clientId=' + clientId, 'GET', "", successFunction, formErrorFunction);
|
executeAjaxRequest('loans/template?clientId=' + clientId, 'GET', "", successFunction, formErrorFunction);
|
||||||
}
|
}
|
||||||
function genAddLoanSuccessVar(clientId) {
|
function genAddLoanSuccessVar(clientId) {
|
||||||
|
|
||||||
@@ -846,13 +846,13 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
$('button#submitloanapp span').text(doI18N('dialog.button.submit'));
|
$('button#submitloanapp span').text(doI18N('dialog.button.submit'));
|
||||||
|
|
||||||
$('#cancelloanapp').button().click(function(e) {
|
$('#cancelloanapp').button().click(function(e) {
|
||||||
showILClient(baseApiUrl, clientId);
|
showILClient(clientId);
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
$('button#cancelloanapp span').text(doI18N('dialog.button.cancel'));
|
$('button#cancelloanapp span').text(doI18N('dialog.button.cancel'));
|
||||||
};
|
};
|
||||||
|
|
||||||
executeAjaxRequest(baseApiUrl + 'loans/template?clientId=' + clientId + '&productId=' + productId, 'GET', "", successFunction, formErrorFunction);
|
executeAjaxRequest('loans/template?clientId=' + clientId + '&productId=' + productId, 'GET', "", successFunction, formErrorFunction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -892,7 +892,7 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
$("#schedulearea").html("");
|
$("#schedulearea").html("");
|
||||||
handleXhrError(jqXHR, textStatus, errorThrown, "#formErrorsTemplate", "#formerrors");
|
handleXhrError(jqXHR, textStatus, errorThrown, "#formErrorsTemplate", "#formerrors");
|
||||||
};
|
};
|
||||||
executeAjaxRequest(baseApiUrl + 'loans?command=calculateLoanSchedule', "POST", newFormData, successFunction, errorFunction);
|
executeAjaxRequest('loans?command=calculateLoanSchedule', "POST", newFormData, successFunction, errorFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -901,24 +901,24 @@ function showILClient(baseApiUrl, clientId) {
|
|||||||
var newFormData = JSON.stringify($('#entityform').serializeObject());
|
var newFormData = JSON.stringify($('#entityform').serializeObject());
|
||||||
|
|
||||||
var successFunction = function(data, textStatus, jqXHR) {
|
var successFunction = function(data, textStatus, jqXHR) {
|
||||||
showILClient(baseApiUrl, clientId);
|
showILClient(clientId);
|
||||||
};
|
};
|
||||||
|
|
||||||
executeAjaxRequest(baseApiUrl + 'loans', "POST", newFormData, successFunction, formErrorFunction);
|
executeAjaxRequest('loans', "POST", newFormData, successFunction, formErrorFunction);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function showILLoan(baseApiUrl, loanId, product) {
|
function showILLoan(loanId, product) {
|
||||||
var title = product + ": #" + loanId ;
|
var title = product + ": #" + loanId ;
|
||||||
$newtabs.tabs( "add", "no url", title);
|
$newtabs.tabs( "add", "no url", title);
|
||||||
loadILLoan(baseApiUrl, loanId);
|
loadILLoan(loanId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadILLoan(baseApiUrl, loanId) {
|
function loadILLoan(loanId) {
|
||||||
|
|
||||||
var loanUrl = baseApiUrl + 'loans/' + loanId + "?associations=ALL";
|
var loanUrl = 'loans/' + loanId + "?associations=ALL";
|
||||||
|
|
||||||
var errorFunction = function(jqXHR, status, errorThrown, index, anchor) {
|
var errorFunction = function(jqXHR, status, errorThrown, index, anchor) {
|
||||||
handleXhrError(jqXHR, textStatus, errorThrown, "#formErrorsTemplate", "#formerrors");
|
handleXhrError(jqXHR, textStatus, errorThrown, "#formErrorsTemplate", "#formerrors");
|
||||||
@@ -957,7 +957,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
$('.rejectloan').button().click(function(e) {
|
$('.rejectloan').button().click(function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("rejectbtn", "");
|
var loanId = linkId.replace("rejectbtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=reject';
|
var postUrl = 'loans/' + loanId + '?command=reject';
|
||||||
var templateSelector = "#stateTransitionLoanFormTemplate";
|
var templateSelector = "#stateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -971,7 +971,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
$('.withdrawnbyapplicantloan').button().click(function(e) {
|
$('.withdrawnbyapplicantloan').button().click(function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("withdrawnbyapplicantloanbtn", "");
|
var loanId = linkId.replace("withdrawnbyapplicantloanbtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=withdrewbyclient';
|
var postUrl = 'loans/' + loanId + '?command=withdrewbyclient';
|
||||||
var templateSelector = "#stateTransitionLoanFormTemplate";
|
var templateSelector = "#stateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -985,7 +985,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("approvebtn", "");
|
var loanId = linkId.replace("approvebtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=approve';
|
var postUrl = 'loans/' + loanId + '?command=approve';
|
||||||
var templateSelector = "#stateTransitionLoanFormTemplate";
|
var templateSelector = "#stateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -999,7 +999,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("undoapprovebtn", "");
|
var loanId = linkId.replace("undoapprovebtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=undoapproval';
|
var postUrl = 'loans/' + loanId + '?command=undoapproval';
|
||||||
var templateSelector = "#undoStateTransitionLoanFormTemplate";
|
var templateSelector = "#undoStateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -1012,7 +1012,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
$('.deleteloan').button().click(function(e) {
|
$('.deleteloan').button().click(function(e) {
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("deletebtn", "");
|
var loanId = linkId.replace("deletebtn", "");
|
||||||
var url = baseApiUrl + 'loans/' + loanId;
|
var url = 'loans/' + loanId;
|
||||||
var width = 400;
|
var width = 400;
|
||||||
var height = 225;
|
var height = 225;
|
||||||
|
|
||||||
@@ -1027,7 +1027,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("disbursebtn", "");
|
var loanId = linkId.replace("disbursebtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=disburse';
|
var postUrl = 'loans/' + loanId + '?command=disburse';
|
||||||
var templateSelector = "#stateTransitionLoanFormTemplate";
|
var templateSelector = "#stateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -1041,7 +1041,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("undodisbursalbtn", "");
|
var loanId = linkId.replace("undodisbursalbtn", "");
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '?command=undodisbursal';
|
var postUrl = 'loans/' + loanId + '?command=undodisbursal';
|
||||||
var templateSelector = "#undoStateTransitionLoanFormTemplate";
|
var templateSelector = "#undoStateTransitionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
var height = 350;
|
var height = 350;
|
||||||
@@ -1055,8 +1055,8 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("repaymentbtn", "");
|
var loanId = linkId.replace("repaymentbtn", "");
|
||||||
var getUrl = baseApiUrl + 'loans/' + loanId + '/transactions/template?command=repayment';
|
var getUrl = 'loans/' + loanId + '/transactions/template?command=repayment';
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '/transactions?command=repayment';
|
var postUrl = 'loans/' + loanId + '/transactions?command=repayment';
|
||||||
|
|
||||||
var templateSelector = "#transactionLoanFormTemplate";
|
var templateSelector = "#transactionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
@@ -1073,8 +1073,8 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
var linkId = this.id;
|
var linkId = this.id;
|
||||||
var loanId = linkId.replace("waivebtn", "");
|
var loanId = linkId.replace("waivebtn", "");
|
||||||
|
|
||||||
var getUrl = baseApiUrl + 'loans/' + loanId + '/transactions/template?command=waiver';
|
var getUrl = 'loans/' + loanId + '/transactions/template?command=waiver';
|
||||||
var postUrl = baseApiUrl + 'loans/' + loanId + '/transactions?command=waiver';
|
var postUrl = 'loans/' + loanId + '/transactions?command=waiver';
|
||||||
|
|
||||||
var templateSelector = "#transactionLoanFormTemplate";
|
var templateSelector = "#transactionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
@@ -1098,7 +1098,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
var ids = loanAndRepaymentId.split("_");
|
var ids = loanAndRepaymentId.split("_");
|
||||||
var loanId = ids[0];
|
var loanId = ids[0];
|
||||||
var transactionId = ids[1];
|
var transactionId = ids[1];
|
||||||
var getAndPostUrl = baseApiUrl + 'loans/' + loanId + '/transactions/' + transactionId;
|
var getAndPostUrl = 'loans/' + loanId + '/transactions/' + transactionId;
|
||||||
|
|
||||||
var templateSelector = "#transactionLoanFormTemplate";
|
var templateSelector = "#transactionLoanFormTemplate";
|
||||||
var width = 500;
|
var width = 500;
|
||||||
@@ -1107,7 +1107,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
var saveSuccessFunction = function(data, textStatus, jqXHR) {
|
||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
loadILLoan(baseApiUrl, loanId);
|
loadILLoan(loanId);
|
||||||
}
|
}
|
||||||
|
|
||||||
popupDialogWithFormView(getAndPostUrl, getAndPostUrl, 'POST', "dialog.title.adjust.loan.repayment", templateSelector, width, height, saveSuccessFunction);
|
popupDialogWithFormView(getAndPostUrl, getAndPostUrl, 'POST', "dialog.title.adjust.loan.repayment", templateSelector, width, height, saveSuccessFunction);
|
||||||
@@ -1147,7 +1147,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
|
|
||||||
function refreshLoanProductsView() {
|
function refreshLoanProductsView() {
|
||||||
|
|
||||||
var url = baseApiUrl + 'loanproducts';
|
var url = 'loanproducts';
|
||||||
|
|
||||||
var successFunction = function(data, textStatus, jqXHR) {
|
var successFunction = function(data, textStatus, jqXHR) {
|
||||||
|
|
||||||
@@ -1206,13 +1206,13 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
refreshLoanProductsView();
|
refreshLoanProductsView();
|
||||||
}
|
}
|
||||||
|
|
||||||
popupDialogWithFormView(baseApiUrl + getUrl, baseApiUrl + putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
popupDialogWithFormView(getUrl, putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function refreshOfficesView() {
|
function refreshOfficesView() {
|
||||||
|
|
||||||
var url = baseApiUrl + 'offices';
|
var url = 'offices';
|
||||||
var successFunction = function(data, textStatus, jqXHR) {
|
var successFunction = function(data, textStatus, jqXHR) {
|
||||||
|
|
||||||
var officelistParent = new Object();
|
var officelistParent = new Object();
|
||||||
@@ -1265,7 +1265,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
refreshOfficesView();
|
refreshOfficesView();
|
||||||
}
|
}
|
||||||
|
|
||||||
popupDialogWithFormView(baseApiUrl + getUrl, baseApiUrl + putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
popupDialogWithFormView(getUrl, putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
function maintainOrgCurrencies(getUrl, putOrPostUrl, submitType, dialogTitle) {
|
function maintainOrgCurrencies(getUrl, putOrPostUrl, submitType, dialogTitle) {
|
||||||
@@ -1277,7 +1277,7 @@ function loadILLoan(baseApiUrl, loanId) {
|
|||||||
$("#dialog-form").dialog("close");
|
$("#dialog-form").dialog("close");
|
||||||
}
|
}
|
||||||
|
|
||||||
popupDialogWithFormView(baseApiUrl + getUrl, baseApiUrl + putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
popupDialogWithFormView(getUrl, putOrPostUrl, submitType, dialogTitle, templateSelector, width, height, saveSuccessFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user