This commit is contained in:
Safiyu 2013-10-19 10:10:07 +05:30
parent 0748833917
commit b7a7b0205d
6 changed files with 29 additions and 11 deletions

View File

@ -780,6 +780,7 @@
"table.heading.userreport":"User Report",
"label.client":"Client",
"label.clients":"Clients",
"link.upload.document":"Upload Document",
"label.role":"Role",
"label.group.members":"Members",
"label.form.staff":"Staff",

View File

@ -1,8 +1,8 @@
(function(module) {
mifosX.controllers = _.extend(module, {
EditClientController: function(scope, routeParams, resourceFactory, location, http) {
EditClientController: function(scope, routeParams, resourceFactory, location, http,dateFilter) {
scope.offices = [];
scope.date = {};
resourceFactory.clientResource.get({clientId: routeParams.id, template: 'true'} , function(data) {
scope.offices = data.officeOptions;
scope.staffs = data.staffOptions;
@ -15,6 +15,11 @@
accountNo : data.accountNo,
staffId : data.staffId
};
var actDate = dateFilter(data.activationDate,'dd MMMM yyyy');
scope.date.activationDate = new Date(actDate);
if(data.active){
scope.choice = 1;
}
});
@ -25,6 +30,7 @@
scope.submit = function() {
this.formData.locale = 'en';
this.formData.dateFormat = 'dd MMMM yyyy';
if(scope.date.activationDate){this.formData.activationDate = dateFilter(scope.date.activationDate,'dd MMMM yyyy');}
resourceFactory.clientResource.update({'clientId': routeParams.id},this.formData,function(data){
if (scope.file) {
http.uploadFile({
@ -45,7 +51,7 @@
};
}
});
mifosX.ng.application.controller('EditClientController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$http', mifosX.controllers.EditClientController]).run(function($log) {
mifosX.ng.application.controller('EditClientController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$http','dateFilter', mifosX.controllers.EditClientController]).run(function($log) {
$log.info("EditClientController initialized");
});
}(mifosX.controllers || {}));

View File

@ -8,6 +8,7 @@
resourceFactory.clientResource.get({clientId: routeParams.id} , function(data) {
scope.client = data;
if (data.imagePresent) {
http({
method:'GET',
@ -169,9 +170,10 @@
};
scope.downloadDocument = function(documentId) {
resourceFactory.clientDocumentsResource.get({clientId: routeParams.id, documentId: documentId}, '', function(data) {
scope.clientdocuments.splice(index,1);
});
};
scope.isNotClosed = function(loanaccount) {
if(loanaccount.status.code === "loanStatusType.closed.written.off" ||
loanaccount.status.code === "loanStatusType.rejected") {
@ -179,7 +181,6 @@
} else{
return true;
}
};
scope.isClosed = function(loanaccount) {

View File

@ -5,9 +5,7 @@ define(['underscore'], function() {
'bootswatch',
'font-awesome.min',
'app',
'nv.d3',
'jquery-ui/redmond/jquery-ui-1.10.3.custom',
'angularjs-file-upload/war/common'
'nv.d3'
],
less: [
'mifosX'

View File

@ -1,4 +1,4 @@
<form class="form-horizontal well" ng-controller="ClientDocumentController" ng-submit="submit()">
<form class="form-horizontal" ng-controller="ClientDocumentController" ng-submit="submit()">
<div>
<ul class="breadcrumb">
<li><a href="#/clients">{{'link.clients' | translate}}</a> <span class="divider">/</span></li>

View File

@ -72,10 +72,22 @@
</td>
</tr>
<tr>
<td>
<div data-ng-switch on="choice">
<div class="control-group" data-ng-switch-when="1">
<label class="control-label">{{'label.form.activationdate' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" datepicker-pop="dd MMMM yyyy" ng-model="date.activationDate" is-open="opened" min="minDate" max="'2020-06-22'" date-disabled="disabled(date, mode)"/>
</div>
</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="file">{{'label.client.select.image' | translate}}</label>
<label class="control-label">{{'label.client.select.image' | translate}}</label>
<div class="controls">
<input type="file" ng-file-select="onFileSelect($files)">
</div>