From f65815a8fd0e9d6f2bc28de066537a08478f2016 Mon Sep 17 00:00:00 2001 From: safiyu Date: Fri, 20 Sep 2013 18:26:49 +0530 Subject: [PATCH] group attendance Groups attendance and close group bug --- app/global-translations/locale-en.json | 3 +- .../groups/CloseGroupController.js | 27 +++++++++++++ .../groups/GroupAttendanceController.js | 38 +++++++++++++++++++ .../controllers/groups/ViewGroupController.js | 20 +--------- app/scripts/mifosXComponents.js | 4 +- app/scripts/routes.js | 6 +++ .../services/ResourceFactoryProvider.js | 3 ++ app/views/groups/closegroup.html | 21 ++++++++++ app/views/groups/groupattendance.html | 38 +++++++++++++++++++ app/views/groups/viewgroup.html | 27 ++----------- 10 files changed, 142 insertions(+), 45 deletions(-) create mode 100644 app/scripts/controllers/groups/CloseGroupController.js create mode 100644 app/scripts/controllers/groups/GroupAttendanceController.js create mode 100644 app/views/groups/closegroup.html create mode 100644 app/views/groups/groupattendance.html diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index c5c8d3e4..d80378c4 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -521,5 +521,6 @@ "label.enternote":"Enter Note", "label.associatemembers":"Associate Members", "label.disassociatemembers":"Disassociate Members", - "label.confirmdelete":"Confirm Delete" + "label.confirmdelete":"Confirm Delete", + "label.meetingdate":"Meeting Date" } \ No newline at end of file diff --git a/app/scripts/controllers/groups/CloseGroupController.js b/app/scripts/controllers/groups/CloseGroupController.js new file mode 100644 index 00000000..b0766913 --- /dev/null +++ b/app/scripts/controllers/groups/CloseGroupController.js @@ -0,0 +1,27 @@ +(function(module) { + mifosX.controllers = _.extend(module, { + CloseGroupController: function(scope, routeParams, route, location, resourceFactory) { + scope.group = []; + scope.template = []; + + resourceFactory.groupResource.get({groupId: routeParams.id,associations:'all'} , function(data) { + scope.group = data; + }); + resourceFactory.groupTemplateResource.get({command:'close'}, function(data){ + scope.template = data; + }); + + scope.closeGroup = function(){ + this.formData.locale = 'en'; + this.formData.dateFormat = 'dd MMMM yyyy'; + resourceFactory.groupResource.save({groupId: routeParams.id ,command:'close'},this.formData, function(data){ + location.path('/viewgroup/' + data.resourceId); + }); + }; + } + }); + mifosX.ng.application.controller('CloseGroupController', ['$scope', '$routeParams','$route', '$location', 'ResourceFactory', mifosX.controllers.CloseGroupController]).run(function($log) { + $log.info("CloseGroupController initialized"); + }); +}(mifosX.controllers || {})); + diff --git a/app/scripts/controllers/groups/GroupAttendanceController.js b/app/scripts/controllers/groups/GroupAttendanceController.js new file mode 100644 index 00000000..a35e84a9 --- /dev/null +++ b/app/scripts/controllers/groups/GroupAttendanceController.js @@ -0,0 +1,38 @@ +(function(module) { + mifosX.controllers = _.extend(module, { + GroupAttendanceController: function(scope, resourceFactory , routeParams, location) { + scope.group = []; + scope.tempData = {}; + + resourceFactory.groupResource.get({groupId: routeParams.groupId,associations:'all'} , function(data) { + scope.group = data; + scope.meeting = data.collectionMeetingCalendar; + }); + resourceFactory.groupMeetingResource.getMeetingInfo({groupId: routeParams.groupId,templateSource: 'template',calenderId: routeParams.calendarId}, function(data) { + scope.clients = data.clients; + scope.attendanceOptions = data.attendanceTypeOptions; + }); + + scope.attendanceUpdate = function(id){ + this.formData.clientsAttendance=[]; + for(var i=0; i +
+

{{ 'label.confirm' | translate }}

+
+ + +
+
+ + +
+
+
+ {{ 'label.cancel' | translate }} + +
+
+
+ \ No newline at end of file diff --git a/app/views/groups/groupattendance.html b/app/views/groups/groupattendance.html new file mode 100644 index 00000000..2ff68f1d --- /dev/null +++ b/app/views/groups/groupattendance.html @@ -0,0 +1,38 @@ +
+
+
+ {{'label.attendance' | translate}} +
+ +
+ Next Meeting on:{{meeting.nextTenRecurringDates[0]}} +
+
+ + + + + + + + + + + + + + +
 
{{ 'label.code.name' | translate }}{{ 'label.attendance' | translate }}
{{client.displayName}} +
+ +
+
+
+ {{'label.cancel' | translate}} + +
+
+
+
\ No newline at end of file diff --git a/app/views/groups/viewgroup.html b/app/views/groups/viewgroup.html index 245990c8..a095a7be 100644 --- a/app/views/groups/viewgroup.html +++ b/app/views/groups/viewgroup.html @@ -3,7 +3,7 @@