mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 11:26:51 +00:00
FINERACT-1432:ClientDocumentDropDown (#3447)
merging after code review. thanks @luckyman20
This commit is contained in:
parent
2c610b3f71
commit
88d63ad43e
@ -1,6 +1,6 @@
|
||||
(function (module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
ClientDocumentController: function (scope, location, http, routeParams, API_VERSION, Upload, $rootScope) {
|
||||
ClientDocumentController: function (scope, location, resourceFactory, http, routeParams, API_VERSION, Upload, $rootScope) {
|
||||
scope.clientId = routeParams.clientId;
|
||||
scope.onFileSelect = function (files) {
|
||||
scope.formData.file = files[0];
|
||||
@ -18,9 +18,13 @@
|
||||
location.path('/viewclient/' + scope.clientId);
|
||||
});
|
||||
};
|
||||
|
||||
resourceFactory.codeValueResource.getAllCodeValues({codeId: 34}, function (data) {
|
||||
scope.documenttypes = data;
|
||||
});
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('ClientDocumentController', ['$scope', '$location', '$http', '$routeParams', 'API_VERSION', 'Upload', '$rootScope', mifosX.controllers.ClientDocumentController]).run(function ($log) {
|
||||
mifosX.ng.application.controller('ClientDocumentController', ['$scope', '$location', 'ResourceFactory', '$http', '$routeParams', 'API_VERSION', 'Upload', '$rootScope', mifosX.controllers.ClientDocumentController]).run(function ($log) {
|
||||
$log.info("ClientDocumentController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
@ -86,7 +86,9 @@
|
||||
clientIdenfierResource: defineResource(apiVer + "/clients/:clientId/identifiers/:id", {clientId: '@clientId', id: '@id'}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
}),
|
||||
|
||||
clientDocumentTemplateResource: defineResource(apiVer + "/clients/:clientId/documentsuploaded", {clientId: '@clientId'}, {
|
||||
get: {method: 'GET', params: {}}
|
||||
}),
|
||||
surveyResource: defineResource(apiVer + "/surveys/:surveyId", {surveyId: '@surveyId'}, {
|
||||
getAll: {method: 'GET', params: {}, isArray: true},
|
||||
get: {method: 'GET', params: {surveyId: '@surveyId'}, isArray: false},
|
||||
|
||||
@ -14,8 +14,12 @@
|
||||
class="required">*</span></label>
|
||||
|
||||
<div class="col-sm-3">
|
||||
<input ng-autofocus="true" type="text" id="name" name="name" ng-model="formData.name" class="form-control" required
|
||||
late-Validate/>
|
||||
<select id="name" ng-model="formData.name"
|
||||
ng-options="documenttype.name as documenttype.name for documenttype in documenttypes"
|
||||
value="{{documenttype.name}}" required="required"
|
||||
class="form-control">
|
||||
<option style="display:none" value="">{{'label.menu.selectone' | translate}}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<form-validate valattributeform="clientdocumentform" valattribute="name"/>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user