collection sheet display messages fix

This commit is contained in:
goutham-M 2013-12-03 13:31:52 +05:30
parent ea5f0c92e8
commit 782734c3e2
7 changed files with 37 additions and 13 deletions

View File

@ -272,6 +272,7 @@
"label.heading.news": "Latest News",
"label.heading.amountdisbursedfortoday":"Amount Disbursed for Today",
"label.heading.loginname":"Login Name",
"label.savecollectionsheetsuccessfully":"Collection Sheet saved successfully",
"#Menu Links": "..",
"label.menu.office": "Office",
@ -332,6 +333,9 @@
"label.selectentity": "Select Entity",
"label.nodata": "No Data",
"#Enumeration & Error Messages": "..",
"validation.msg.collectionsheet.calendarId.cannot.be.blank":"Collection sheet cannot be generated for center/group without attachmeeting define",
"------": "------------",
"#Clients": "....",

View File

@ -1,6 +1,6 @@
(function(module) {
mifosX.controllers = _.extend(module, {
EnterCollectionSheetController: function(scope, resourceFactory, location, routeParams, dateFilter) {
EnterCollectionSheetController: function(scope, resourceFactory, location, routeParams, dateFilter, localStorageService, route, $timeout) {
scope.offices = [];
scope.centers = [];
scope.groups = [];
@ -16,7 +16,16 @@
resourceFactory.officeResource.getAllOffices(function(data) {
scope.offices = data;
});
if (localStorageService.get('Success') == 'true') {
scope.savesuccess = true;
localStorageService.remove('Success');
scope.val = true;
$timeout(function() {
scope.val = false;
}, 3000);
}
scope.officeSelected = function(officeId) {
if(officeId) {
resourceFactory.centerResource.get({'officeId' : officeId}, function(data) {
@ -56,7 +65,9 @@
scope.collectionsheetdata = "";
resourceFactory.groupResource.get({'groupId' : groupId, associations : 'collectionMeetingCalendar'}, function(data) {
scope.groupdetails = data.pageItems;
scope.calendarId = data.collectionMeetingCalendar.id;
if (data.collectionMeetingCalendar) {
scope.calendarId = data.collectionMeetingCalendar.id;
}
if (data.collectionMeetingCalendar && data.collectionMeetingCalendar.recentEligibleMeetingDate) {
scope.date.transactionDate = new Date(dateFilter(data.collectionMeetingCalendar.recentEligibleMeetingDate,'dd MMMM yyyy'));
}
@ -303,17 +314,20 @@
scope.formData.bulkRepaymentTransactions = scope.bulkRepaymentTransactions;
if (centerOrGroupResource == "centerResource") {
resourceFactory.centerResource.save({'centerId' : scope.centerId, command : 'saveCollectionSheet'}, scope.formData,function(data){
location.path('/home/');
localStorageService.add('Success', true);
route.reload();
});
} else if (centerOrGroupResource == "groupResource") {
resourceFactory.groupResource.save({'groupId' : scope.groupId, command : 'saveCollectionSheet'}, scope.formData,function(data){
location.path('#/home/');
localStorageService.add('Success', true);
route.reload();
});
}
}
};
}
});
mifosX.ng.application.controller('EnterCollectionSheetController', ['$scope', 'ResourceFactory', '$location', '$routeParams', 'dateFilter', mifosX.controllers.EnterCollectionSheetController]).run(function($log) {
mifosX.ng.application.controller('EnterCollectionSheetController', ['$scope', 'ResourceFactory', '$location', '$routeParams', 'dateFilter', 'localStorageService',
'$route', '$timeout', mifosX.controllers.EnterCollectionSheetController]).run(function($log) {
$log.info("EnterCollectionSheetController initialized");
});
}(mifosX.controllers || {}));

View File

@ -919,3 +919,8 @@ nav:hover:after{
color:deepskyblue;
}
.display-save-message {
top:50%;
left:35%;
position:absolute;
}

View File

@ -12,7 +12,7 @@
<thead>
<tr><td colspan="5">&nbsp;</td></tr>
<tr class="graybg">
<th>{{ 'label.heading..name' | translate }}</th>
<th>{{ 'label.heading.name' | translate }}</th>
<th>{{ 'label.heading.attendance' | translate }}</th>
</tr>
</thead>

View File

@ -154,7 +154,7 @@
<div class="row-fluid">
<div class="row-fluid primarydiv" data-ng-hide="center.status.value == 'Closed'">
<a href="#/addgroup?centerId={{center.id}}&officeId={{center.officeId}}" class="btn btn-primary pull-right"><i class="icon-plus-sign-alt icon-white"></i>{{ 'label.button.add' | translate }}</a>
<a href="#/centerattendance?centerId={{center.id}}&calendarId={{meeting.id}}" class="btn btn-primary pull-right">{{ 'label.button.attendance' | translate }}</a>
<a href="#/centerattendance?centerId={{center.id}}&calendarId={{meeting.id}}" class="btn btn-primary pull-right" data-ng-show="center.collectionMeetingCalendar">{{ 'label.button.attendance' | translate }}</a>
<a href="#/attachmeeting/{{center.id}}/centers" class="btn btn-primary pull-right" data-ng-hide="center.collectionMeetingCalendar"><i class="icon-paper-clip icon-white"></i>{{ 'label.button.attachmeeting' | translate }}</a>
</div>
</div>

View File

@ -1,6 +1,7 @@
<form name="collectionsheetform" novalidate class="form-horizontal well" ng-controller="EnterCollectionSheetController" rc-submit="">
<form name="collectionsheetform" novalidate class="form-horizontal" ng-controller="EnterCollectionSheetController" rc-submit="">
<api-validate></api-validate>
<fieldset>
<h2><strong ng-show="val" class="display-save-message">{{'label.savecollectionsheetsuccessfully' | translate}}</strong></h2>
<fieldset ng-hide="val">
<div class="control-group">
<label class="control-label">{{ 'label.input.branchoffice' | translate }}<span class="required">*</span></label>
<div class="controls">
@ -21,7 +22,7 @@
</div>
<div class="control-group">
<label class="control-label">{{ 'label.input.group' | translate }}</label>
<label class="control-label">{{ 'label.input.group' | translate }}<span class="required">*</span></label>
<div class="controls">
<select id="groupId" ng-model="groupId" ng-options="group.id as group.name for group in groups" value="{{group.id}}" ng-change="groupSelected(groupId)">
<option value="">{{'label.selectgroup' | translate}}</option>

View File

@ -186,7 +186,7 @@
<a href="#/addmember?groupId={{group.id}}&officeId={{group.officeId}}" class="btn btn-primary pull-right"><i class="icon-plus-sign-alt icon-white"></i>{{ 'label.button.add' | translate }}</a>
<a href="#/membermanage/{{group.id}}?managecode=2" class="btn btn-primary pull-right">{{ 'label.button.disassociatemember' | translate }}</a>
<a href="#/membermanage/{{group.id}}?managecode=1" class="btn btn-primary pull-right">{{ 'label.button.associatemember' | translate }}</a>
<a href="#/groupattendance?groupId={{group.id}}&calendarId={{group.collectionMeetingCalendar.id}}" class="btn btn-primary pull-right">{{ 'label.button.attendance' | translate }}</a>
<a href="#/groupattendance?groupId={{group.id}}&calendarId={{group.collectionMeetingCalendar.id}}" data-ng-show="group.collectionMeetingCalendar" class="btn btn-primary pull-right">{{ 'label.button.attendance' | translate }}</a>
<a href="#/attachmeeting/{{group.id}}/groups" class="btn btn-primary pull-right" data-ng-hide="group.collectionMeetingCalendar"><i class="icon-paper-clip icon-white"></i>{{ 'label.button.attachmeeting' | translate }}</a>
<a href="#/transferclients/{{group.id}}" class="btn btn-primary pull-right">{{ 'label.button.transferclients' | translate }}</a>
</div>