mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:51:55 +00:00
Client image management
This commit is contained in:
parent
cf06bc1b17
commit
930a759b0c
@ -203,6 +203,7 @@
|
||||
"label.createclient":"Create Client",
|
||||
"title.client.activate":"Client Activation",
|
||||
"title.client.assignloanofficer":"Assign LoanOfficer",
|
||||
"label.client.select.image":"Client Photo",
|
||||
|
||||
"#new loan account application":"",
|
||||
"label.applicant":"Applicant: ",
|
||||
|
||||
@ -66,8 +66,8 @@
|
||||
|
||||
scope.submit = function() {
|
||||
resourceFactory.accountCoaResource.update({'glAccountId': routeParams.id},this.formData,function(data){
|
||||
location.path('/viewglaccount/' + data.resourceId);
|
||||
});
|
||||
location.path('/viewglaccount/' + data.resourceId);
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
AccViewGLAccountContoller: function(scope, routeParams , location, resourceFactory ) {
|
||||
AccViewGLAccountContoller: function(scope, routeParams , location, resourceFactory, route) {
|
||||
scope.glaccountdata = [];
|
||||
scope.accountOptions = [];
|
||||
|
||||
@ -51,9 +51,15 @@
|
||||
location.path('/accounting_coa');
|
||||
});
|
||||
};
|
||||
|
||||
scope.changeState = function (disabled){
|
||||
resourceFactory.accountCoaResource.update({'glAccountId': routeParams.id},{disabled:!disabled},function(data){
|
||||
route.reload();
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('AccViewGLAccountContoller', ['$scope', '$routeParams', '$location', 'ResourceFactory', mifosX.controllers.AccViewGLAccountContoller]).run(function($log) {
|
||||
mifosX.ng.application.controller('AccViewGLAccountContoller', ['$scope', '$routeParams', '$location', 'ResourceFactory', '$route', mifosX.controllers.AccViewGLAccountContoller]).run(function($log) {
|
||||
$log.info("AccViewGLAccountContoller initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
CreateClientController: function(scope, resourceFactory, location) {
|
||||
CreateClientController: function(scope, resourceFactory, location, http) {
|
||||
scope.offices = [];
|
||||
scope.staffs = [];
|
||||
scope.formData = {
|
||||
@ -12,24 +12,43 @@
|
||||
scope.formData.officeId = scope.offices[0].id;
|
||||
});
|
||||
|
||||
scope.changeOffice =function(officeId) {
|
||||
scope.changeOffice =function(officeId) {
|
||||
resourceFactory.clientTemplateResource.get({staffInSelectedOfficeOnly : false, officeId : officeId
|
||||
}, function(data) {
|
||||
scope.staffs = data.staffOptions;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
scope.onFileSelect = function($files) {
|
||||
scope.file = $files[0];
|
||||
};
|
||||
|
||||
scope.submit = function() {
|
||||
this.formData.locale = 'en';
|
||||
this.formData.dateFormat = 'dd MMMM yyyy';
|
||||
this.formData.activationDate = '05 August 2013';
|
||||
resourceFactory.clientResource.save(this.formData,function(data){
|
||||
location.path('/viewclient/' + data.resourceId);
|
||||
|
||||
});
|
||||
if (scope.file) {
|
||||
http.uploadFile({
|
||||
url: 'https://demo.openmf.org/mifosng-provider/api/v1/clients/'+data.clientId+'/images',
|
||||
data: {},
|
||||
file: scope.file
|
||||
}).then(function(imageData) {
|
||||
// to fix IE not refreshing the model
|
||||
if (!scope.$$phase) {
|
||||
scope.$apply();
|
||||
}
|
||||
location.path('/viewclient/'+data.resourceId);
|
||||
});
|
||||
} else{
|
||||
location.path('/viewclient/' + data.resourceId);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('CreateClientController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.CreateClientController]).run(function($log) {
|
||||
mifosX.ng.application.controller('CreateClientController', ['$scope', 'ResourceFactory', '$location', '$http', mifosX.controllers.CreateClientController]).run(function($log) {
|
||||
$log.info("CreateClientController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
EditClientController: function(scope, routeParams, resourceFactory, location) {
|
||||
EditClientController: function(scope, routeParams, resourceFactory, location, http) {
|
||||
scope.offices = [];
|
||||
|
||||
resourceFactory.clientResource.get({clientId: routeParams.id, template: 'true'} , function(data) {
|
||||
@ -17,18 +17,36 @@
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
scope.onFileSelect = function($files) {
|
||||
scope.file = $files[0];
|
||||
};
|
||||
|
||||
scope.submit = function() {
|
||||
this.formData.locale = 'en';
|
||||
this.formData.activationDate = '05 August 2013';
|
||||
this.formData.dateFormat = 'dd MMMM yyyy';
|
||||
resourceFactory.clientResource.update({'clientId': routeParams.id},this.formData,function(data){
|
||||
location.path('/viewclient/' + data.resourceId);
|
||||
if (scope.file) {
|
||||
http.uploadFile({
|
||||
url: 'https://demo.openmf.org/mifosng-provider/api/v1/clients/'+data.clientId+'/images',
|
||||
data: {},
|
||||
file: scope.file
|
||||
}).then(function(imageData) {
|
||||
// to fix IE not refreshing the model
|
||||
if (!scope.$$phase) {
|
||||
scope.$apply();
|
||||
}
|
||||
location.path('/viewclient/'+data.resourceId);
|
||||
});
|
||||
} else{
|
||||
location.path('/viewclient/' + data.resourceId);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('EditClientController', ['$scope', '$routeParams', 'ResourceFactory', '$location', mifosX.controllers.EditClientController]).run(function($log) {
|
||||
mifosX.ng.application.controller('EditClientController', ['$scope', '$routeParams', 'ResourceFactory', '$location', '$http', mifosX.controllers.EditClientController]).run(function($log) {
|
||||
$log.info("EditClientController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
ViewClientController: function(scope, routeParams , route, location, resourceFactory) {
|
||||
ViewClientController: function(scope, routeParams , route, location, resourceFactory, http) {
|
||||
scope.client = [];
|
||||
scope.identitydocuments = [];
|
||||
scope.buttons = [];
|
||||
@ -8,6 +8,14 @@
|
||||
|
||||
resourceFactory.clientResource.get({clientId: routeParams.id} , function(data) {
|
||||
scope.client = data;
|
||||
if (data.imagePresent) {
|
||||
http({
|
||||
method:'GET',
|
||||
url: 'https://demo.openmf.org/mifosng-provider/api/v1/clients/'+routeParams.id+'/images'
|
||||
}).then(function(imageData) {
|
||||
scope.image = imageData.data;
|
||||
});
|
||||
}
|
||||
if (data.status.value == "Pending") {
|
||||
scope.buttons = [{
|
||||
name:"button.edit",
|
||||
@ -195,7 +203,7 @@
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('ViewClientController', ['$scope', '$routeParams', '$route', '$location', 'ResourceFactory', mifosX.controllers.ViewClientController]).run(function($log) {
|
||||
mifosX.ng.application.controller('ViewClientController', ['$scope', '$routeParams', '$route', '$location', 'ResourceFactory', '$http', mifosX.controllers.ViewClientController]).run(function($log) {
|
||||
$log.info("ViewClientController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<div ng-controller="ViewAccRuleController">
|
||||
<div class="paddedbottom10">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/accounting">{{'link.accounting' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li><a href="#/accounting_rules">{{'label.accountingrules' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{{rule.name}}</li>
|
||||
</ul>
|
||||
<li><a href="#/accounting">{{'link.accounting' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li><a href="#/accounting_rules">{{'label.accountingrules' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{{rule.name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="#/editaccrule/{{rule.id}}" class="btn btn-primary"><i class="icon-edit icon-white"></i> Edit</a>
|
||||
<a class="btn btn-primary" ng-click="deleteRule()"><i class="icon-trash icon-white"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="#/editaccrule/{{rule.id}}" class="btn btn-primary"><i class="icon-edit icon-white"></i> Edit</a>
|
||||
<a class="btn btn-primary" ng-click="deleteRule()"><i class="icon-trash icon-white"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row paddedleft">
|
||||
<h3>{{rule.name}}</h3>
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
<div ng-controller="AccViewGLAccountContoller">
|
||||
<div ng-controller="AccViewGLAccountContoller">
|
||||
<div class="paddedbottom10">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/accounting">{{'link.accounting' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li><a href="#/accounting_coa">{{'label.coa' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{{glaccount.name}}</li>
|
||||
</ul>
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/accounting">{{'link.accounting' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li><a href="#/accounting_coa">{{'label.coa' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{{glaccount.name}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="paddedbottom">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a ng-hide="glaccount.disabled" class="btn btn-primary" ng-click="changeState(glaccount.disabled)"><i class="icon-lock icon-white"></i> Disable</a>
|
||||
<a ng-show="glaccount.disabled" class="btn btn-primary" ng-click="changeState(glaccount.disabled)"><i class="icon-unlock icon-white"></i> Enable</a>
|
||||
<a href="#/editglaccount/{{glaccount.id}}" class="btn btn-primary"><i class="icon-edit icon-white"></i> Edit</a>
|
||||
<a href="#" class="btn btn-primary" ng-click="deleteGLAccount()"><i class="icon-trash icon-white"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paddedbottom">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group">
|
||||
<a href="#/editglaccount/{{glaccount.id}}" class="btn btn-primary"><i class="icon-edit icon-white"></i> Edit</a>
|
||||
<a href="#" class="btn btn-primary" ng-click="deleteGLAccount()"><i class="icon-trash icon-white"></i> Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row paddedleft">
|
||||
<h3>{{glaccount.name}}</h3>
|
||||
|
||||
@ -41,6 +41,12 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="file">{{'label.client.select.image' | translate}}</label>
|
||||
<div class="controls">
|
||||
<input type="file" ng-file-select="onFileSelect($files)">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset3">
|
||||
<a href="#/clients"><button type="reset" class="btn">Cancel</button></a>
|
||||
|
||||
@ -84,6 +84,17 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="file">{{'label.client.select.image' | translate}}</label>
|
||||
<div class="controls">
|
||||
<input type="file" ng-file-select="onFileSelect($files)">
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="offset3">
|
||||
<a href='#/clients'><button type="reset" class="btn">Cancel</button></a>
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<div ng-controller="ViewClientController">
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<img src="../app/images/blank_avatar.jpg" alt="Avatar" width="40">
|
||||
<img ng-hide="client.imagePresent" src="../app/images/blank_avatar.jpg" alt="Avatar" width="40">
|
||||
<img ng-show="client.imagePresent" src="{{image}}" alt="Avatar" width="40">
|
||||
</li>
|
||||
<li>
|
||||
<h3>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user