mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:17:04 +00:00
checker inbox modified
This commit is contained in:
parent
ceee4dd5da
commit
d41bb506dc
@ -1118,6 +1118,8 @@
|
||||
"label.exportcsv":"Export CSV Format",
|
||||
"label.pdfformat":"PDF Format",
|
||||
"label.run":"Run",
|
||||
"label.category":"Category"
|
||||
"label.category":"Category",
|
||||
"label.madeondate":"Created On",
|
||||
"label.viewcheckerinbox":"View Checker Inbox"
|
||||
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
TaskController: function(scope, resourceFactory, route, dateFilter,$modal) {
|
||||
TaskController: function(scope, resourceFactory, route, dateFilter,$modal,location) {
|
||||
|
||||
scope.clients = [];
|
||||
scope.loans = [];
|
||||
@ -9,85 +9,95 @@
|
||||
scope.formData = {};
|
||||
scope.loanTemplate = {};
|
||||
scope.date = {};
|
||||
scope.checkData = [];
|
||||
scope.isCollapsed = true;
|
||||
resourceFactory.checkerInboxResource.get({templateResource:'searchtemplate'},function(data){
|
||||
scope.checkerTemplate = data;
|
||||
});
|
||||
|
||||
scope.approveChecker = function (aid) {
|
||||
resourceFactory.checkerInboxResource.search(function(data) {
|
||||
scope.searchData = data;
|
||||
});
|
||||
scope.approveChecker = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'approvechecker.html',
|
||||
controller: CheckerApproveCtrl,
|
||||
resolve:{
|
||||
aId : function ()
|
||||
{
|
||||
return aid;
|
||||
}
|
||||
}
|
||||
});
|
||||
controller: CheckerApproveCtrl
|
||||
});
|
||||
};
|
||||
var CheckerApproveCtrl = function ($scope, $modalInstance,aId) {
|
||||
var CheckerApproveCtrl = function ($scope, $modalInstance) {
|
||||
|
||||
$scope.approve = function () {
|
||||
resourceFactory.checkerInboxResource.save({templateResource: aId,command:'approve'},{}, function(data){
|
||||
scope.isCollapsed = true;
|
||||
scope.displayResults = true;
|
||||
var reqFromDate = dateFilter(scope.date.from,'yyyy-MM-dd');
|
||||
var reqToDate = dateFilter(scope.date.to,'yyyy-MM-dd');
|
||||
var params = {};
|
||||
if (scope.formData.action) { params.actionName = scope.formData.action; };
|
||||
|
||||
if (scope.formData.entity) { params.entityName = scope.formData.entity; };
|
||||
|
||||
if (scope.formData.resourceId) { params.resourceId = scope.formData.resourceId; };
|
||||
|
||||
if (scope.formData.user) { params.makerId = scope.formData.user; };
|
||||
|
||||
if (scope.date.from) { params.makerDateTimeFrom = reqFromDate; };
|
||||
|
||||
if (scope.date.to) { params.makerDateTimeto = reqToDate; };
|
||||
resourceFactory.checkerInboxResource.search(params , function(data) {
|
||||
scope.searchData = data;
|
||||
});
|
||||
var totalApprove = 0;
|
||||
var approveCount = 0;
|
||||
_.each(scope.checkData,function(value,key)
|
||||
{
|
||||
if(value==true)
|
||||
{
|
||||
totalApprove++;
|
||||
}
|
||||
});
|
||||
_.each(scope.checkData,function(value,key)
|
||||
{
|
||||
if(value==true)
|
||||
{
|
||||
|
||||
resourceFactory.checkerInboxResource.save({templateResource: key,command:'approve'},{}, function(data){
|
||||
approveCount++;
|
||||
if(approveCount==totalApprove){
|
||||
scope.search();
|
||||
}
|
||||
},function(data){
|
||||
approveCount++;
|
||||
if(approveCount==totalApprove){
|
||||
scope.search();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
scope.checkData = {};
|
||||
$modalInstance.close('approve');
|
||||
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.deleteChecker = function (id) {
|
||||
scope.deleteChecker = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'deletechecker.html',
|
||||
controller: CheckerDeleteCtrl,
|
||||
resolve:{
|
||||
id: function ()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
}
|
||||
controller: CheckerDeleteCtrl
|
||||
});
|
||||
};
|
||||
var CheckerDeleteCtrl = function ($scope, $modalInstance,id) {
|
||||
var CheckerDeleteCtrl = function ($scope, $modalInstance) {
|
||||
$scope.delete = function () {
|
||||
resourceFactory.checkerInboxResource.delete({templateResource: id}, {}, function(data){
|
||||
scope.isCollapsed = true;
|
||||
scope.displayResults = true;
|
||||
var reqFromDate = dateFilter(scope.date.from,'yyyy-MM-dd');
|
||||
var reqToDate = dateFilter(scope.date.to,'yyyy-MM-dd');
|
||||
var params = {};
|
||||
if (scope.formData.action) { params.actionName = scope.formData.action; };
|
||||
|
||||
if (scope.formData.entity) { params.entityName =scope.formData.entity; };
|
||||
|
||||
if (scope.formData.resourceId) { params.resourceId = scope.formData.resourceId; };
|
||||
|
||||
if (scope.formData.user) { params.makerId = scope.formData.user; };
|
||||
|
||||
if (scope.date.from) { params.makerDateTimeFrom = reqFromDate; };
|
||||
|
||||
if (scope.date.to) { params.makerDateTimeto = reqToDate; };
|
||||
resourceFactory.checkerInboxResource.search(params , function(data) {
|
||||
scope.searchData = data;
|
||||
});
|
||||
var totalDelete = 0;
|
||||
var deleteCount = 0
|
||||
_.each(scope.checkData,function(value,key)
|
||||
{
|
||||
if(value==true)
|
||||
{
|
||||
totalDelete++;
|
||||
}
|
||||
});
|
||||
_.each(scope.checkData,function(value,key)
|
||||
{
|
||||
if(value==true)
|
||||
{
|
||||
|
||||
resourceFactory.checkerInboxResource.delete({templateResource: key}, {}, function(data){
|
||||
deleteCount++;
|
||||
if(deleteCount==totalDelete){
|
||||
scope.search();
|
||||
}
|
||||
}, function(data){
|
||||
deleteCount++;
|
||||
if(deleteCount==totalDelete){
|
||||
scope.search();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
scope.checkData = {};
|
||||
$modalInstance.close('delete');
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
@ -95,6 +105,10 @@
|
||||
};
|
||||
};
|
||||
|
||||
scope.routeTo = function(id){
|
||||
location.path('viewcheckerinbox/'+id);
|
||||
};
|
||||
|
||||
resourceFactory.officeResource.getAllOffices(function(data){
|
||||
scope.offices = data;
|
||||
for(var i in data){
|
||||
@ -135,7 +149,6 @@
|
||||
|
||||
scope.search = function(){
|
||||
scope.isCollapsed = true;
|
||||
scope.displayResults = true;
|
||||
var reqFromDate = dateFilter(scope.date.from,'yyyy-MM-dd');
|
||||
var reqToDate = dateFilter(scope.date.to,'yyyy-MM-dd');
|
||||
var params = {};
|
||||
@ -181,7 +194,7 @@
|
||||
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('TaskController', ['$scope', 'ResourceFactory', '$route', 'dateFilter','$modal', mifosX.controllers.TaskController]).run(function($log) {
|
||||
mifosX.ng.application.controller('TaskController', ['$scope', 'ResourceFactory', '$route', 'dateFilter','$modal','$location', mifosX.controllers.TaskController]).run(function($log) {
|
||||
$log.info("TaskController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
57
app/scripts/controllers/main/ViewCheckerinboxController.js
Normal file
57
app/scripts/controllers/main/ViewCheckerinboxController.js
Normal file
@ -0,0 +1,57 @@
|
||||
(function(module) {
|
||||
mifosX.controllers = _.extend(module, {
|
||||
ViewCheckerinboxController: function(scope, resourceFactory, routeParams,location,$modal) {
|
||||
scope.details = {};
|
||||
resourceFactory.auditResource.get({templateResource: routeParams.id} , function(data) {
|
||||
scope.details = data;
|
||||
scope.commandAsJson = data.commandAsJson;
|
||||
var obj = JSON.parse(scope.commandAsJson);
|
||||
scope.jsondata = [];
|
||||
_.each(obj,function(value,key){
|
||||
scope.jsondata.push({name:key,property:value});
|
||||
});
|
||||
});
|
||||
scope.checkerApprove = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'approve.html',
|
||||
controller: ApproveCtrl
|
||||
});
|
||||
};
|
||||
var ApproveCtrl = function ($scope, $modalInstance) {
|
||||
|
||||
$scope.approve = function () {
|
||||
resourceFactory.checkerInboxResource.save({templateResource: routeParams.id,command:'approve'},{}, function(data){
|
||||
location.path('tasks');
|
||||
});
|
||||
$modalInstance.close('approve');
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
scope.checkerDelete = function () {
|
||||
$modal.open({
|
||||
templateUrl: 'delete.html',
|
||||
controller: DeleteCtrl
|
||||
});
|
||||
};
|
||||
var DeleteCtrl = function ($scope, $modalInstance) {
|
||||
$scope.delete = function () {
|
||||
resourceFactory.checkerInboxResource.delete({templateResource: routeParams.id}, {}, function(data){
|
||||
location.path('tasks');
|
||||
});
|
||||
$modalInstance.close('delete');
|
||||
};
|
||||
$scope.cancel = function () {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
}
|
||||
});
|
||||
mifosX.ng.application.controller('ViewCheckerinboxController', ['$scope', 'ResourceFactory', '$routeParams','$location','$modal', mifosX.controllers.ViewCheckerinboxController]).run(function($log) {
|
||||
$log.info("ViewCheckerinboxController initialized");
|
||||
});
|
||||
}(mifosX.controllers || {}));
|
||||
|
||||
|
||||
@ -152,7 +152,8 @@ define(['underscore', 'mifosX'], function() {
|
||||
'template/ViewTemplateController',
|
||||
'template/EditTemplateController',
|
||||
'loanAccount/GuarantorController',
|
||||
'loanAccount/EditGuarantorController'
|
||||
'loanAccount/EditGuarantorController',
|
||||
'main/ViewCheckerinboxController'
|
||||
],
|
||||
filters: [
|
||||
'StatusLookup',
|
||||
|
||||
@ -452,6 +452,9 @@
|
||||
.when('/guarantor/:id', {
|
||||
templateUrl: 'views/loans/guarantor.html'
|
||||
})
|
||||
.when('/viewcheckerinbox/:id',{
|
||||
templateUrl: 'views/system/viewcheckerinbox.html'
|
||||
})
|
||||
.when('/editguarantor/:id/:loanId',{
|
||||
templateUrl: 'views/loans/editguarantor.html'
|
||||
});
|
||||
|
||||
@ -386,6 +386,14 @@ a:hover
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
tr.pointer-main:hover {
|
||||
color: #007FFF;
|
||||
}
|
||||
|
||||
.grbgcolor {
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
|
||||
88
app/views/system/viewcheckerinbox.html
Normal file
88
app/views/system/viewcheckerinbox.html
Normal file
@ -0,0 +1,88 @@
|
||||
<div ng-controller="ViewCheckerinboxController">
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="#/tasks">{{'link.tasks' | translate}}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{{'label.viewcheckerinbox' | translate}}</li>
|
||||
</ul>
|
||||
<span class="pull-right">
|
||||
<td><button type="button" class="btn btn-success" data-ng-click="checkerApprove()"><i class="icon-ok"></i>{{'label.approve' | translate}}</button> </td>
|
||||
<td><button type="button" class="btn btn-warning" data-ng-click="checkerDelete()"><i class="icon-trash"></i>{{'label.delete' | translate}}</button> </td>
|
||||
</span>
|
||||
<h3 class="paddedleft bolder">{{'label.viewcheckerinbox' | translate}}</h3>
|
||||
<div class="paddedleft">
|
||||
<table width="100%" >
|
||||
<tr>
|
||||
<td width="35%"><strong>{{'label.id' | translate}}:</strong></td>
|
||||
<td width="65%">{{details.id}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.status' | translate }}:</strong></td>
|
||||
<td>{{details.processingResult}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.user' | translate }}:</strong></td>
|
||||
<td>{{details.maker}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.action' | translate }}:</strong></td>
|
||||
<td>{{details.actionName}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.entity' | translate }}:</strong></td>
|
||||
<td>{{details.entityName}}</td>
|
||||
</tr>
|
||||
<tr data-ng-show="details.resourceId">
|
||||
<td><strong>{{ 'label.resourceid' | translate }}:</strong></td>
|
||||
<td>{{details.resourceId}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>{{ 'label.date' | translate }}:</strong></td>
|
||||
<td>{{details.madeOnDate | DateFormat}}</td>
|
||||
</tr>
|
||||
<tr data-ng-show="details.officeName">
|
||||
<td><strong>{{ 'label.office' | translate }}:</strong></td>
|
||||
<td>{{details.officeName}}</td>
|
||||
</tr>
|
||||
<tr data-ng-show="details.savingsAccountNo">
|
||||
<td><strong>{{ 'label.savingsaccountno' | translate }}:</strong></td>
|
||||
<td>{{details.savingsAccountNo}}</td>
|
||||
</tr>
|
||||
<tr data-ng-show="details.groupLevelName">
|
||||
<td><strong>{{details.groupLevelName}}:</strong></td>
|
||||
<td>{{details.groupName}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<script type="text/ng-template" id="delete.html">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.delete' | translate}}</h3>
|
||||
</div>
|
||||
<div class="modal-body modal-middle">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="delete()">{{'label.confirm' | translate}}</button>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/ng-template" id="approve.html">
|
||||
<div class="modal-header silver">
|
||||
<h3 class="bolder">{{'label.approve' | translate}}</h3>
|
||||
</div>
|
||||
<div class="modal-body modal-middle">
|
||||
<button class="btn btn-warning" ng-click="cancel()">{{'label.cancel' | translate}}</button>
|
||||
<button class="btn btn-primary" ng-click="approve()">{{'label.confirm' | translate}}</button>
|
||||
</div>
|
||||
</script>
|
||||
<hr/>
|
||||
<table class="table" data-ng-show="details.commandAsJson">
|
||||
<thead>
|
||||
<tr class="graybg">
|
||||
<th> {{ 'label.command' | translate }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr data-ng-repeat="json in jsondata">
|
||||
<td><strong> {{json.name}}</strong></td>
|
||||
<td>{{json.property}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -80,6 +80,10 @@
|
||||
<span><a ng-click="isCollapsed = !isCollapsed" class="btn blockoverlaywidth control">{{'label.searchoptions' | translate}}<i class="icon-chevron-down"></i></a></span>
|
||||
<span><a ng-click="search()" class="btn btn-primary control"><i class="icon-search icon-white"></i></a></span>
|
||||
</span>
|
||||
<span class="pull-right">
|
||||
<td><button type="button" class="btn btn-success" data-ng-click="approveChecker()"><i class="icon-ok"></i>{{'label.approve' | translate}}</button> </td>
|
||||
<td><button type="button" class="btn btn-warning" data-ng-click="deleteChecker()"><i class="icon-trash"></i>{{'label.delete' | translate}}</button> </td>
|
||||
</span>
|
||||
</div>
|
||||
<div collapse="isCollapsed" class="blockoverlay" width="100%" style="overflow-y: scroll">
|
||||
<div class="control-group">
|
||||
@ -97,8 +101,8 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select ng-model="formData.user">
|
||||
<option value="">All</option>
|
||||
<option value="">--Select User--</option>
|
||||
<option selected="selected" value="">All</option>
|
||||
<option ng-repeat="user in checkerTemplate.appUsers" value="{{user.id}}">{{user.username}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -106,8 +110,8 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select ng-model="formData.action">
|
||||
<option value="">All</option>
|
||||
<option value="">--Select Action--</option>
|
||||
<option selected="selected" value="">All</option>
|
||||
<option ng-repeat="action in checkerTemplate.actionNames" value="{{action}}">{{action}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -115,8 +119,8 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<select ng-model="formData.entity">
|
||||
<option value="">All</option>
|
||||
<option value="">--Select Entity--</option>
|
||||
<option selected="selected" value="">All</option>
|
||||
<option ng-repeat="entity in checkerTemplate.entityNames" value="{{entity}}">{{entity}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -166,31 +170,30 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ng-show="displayResults" class="row-fluid">
|
||||
<div ng-show="searchData" class="row-fluid">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr class="graybg">
|
||||
<th>{{'label.id' | translate}}</th>
|
||||
<th>{{'label.status' | translate}}</th>
|
||||
<th>{{'label.user' | translate}}</th>
|
||||
<th>{{'label.action' | translate}}</th>
|
||||
<th>{{'label.entity' | translate}}</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr class="graybg">
|
||||
<th></th>
|
||||
<th>{{'label.id' | translate}}</th>
|
||||
<th>{{'label.madeondate' | translate}}</th>
|
||||
<th>{{'label.status' | translate}}</th>
|
||||
<th>{{'label.user' | translate}}</th>
|
||||
<th>{{'label.action' | translate}}</th>
|
||||
<th>{{'table.heading.entity' | translate}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="data in searchData">
|
||||
<td>{{data.id}}</td>
|
||||
<td>{{data.processingResult}}</td>
|
||||
<td>{{data.maker}}</td>
|
||||
<td>{{data.actionName}}</td>
|
||||
<td>{{data.entityName}}</td>
|
||||
<td><a href="#/viewaudit/{{data.id}}" class="pointer required">{{'label.details' | translate}}</a></td>
|
||||
<td><button type="button" class="btn btn-success" data-ng-click="approveChecker(data.id)"><i class="icon-ok"></i></button> </td>
|
||||
<td><button type="button" class="btn btn-warning" data-ng-click="deleteChecker(data.id)"><i class="icon-remove"></i></button> </td>
|
||||
</tr>
|
||||
<tr class="pointer-main" ng-repeat="data in searchData">
|
||||
<td><input type="checkbox" data-ng-model="checkData[data.id]"/></td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.id}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.madeOnDate | DateFormat}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.processingResult}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.maker}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.actionName}}</td>
|
||||
<td class="pointer" data-ng-click="routeTo(data.id)">{{data.entityName}}</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user