From dff690c02f49b8d5db9aa9ff9675b35d26b044e9 Mon Sep 17 00:00:00 2001 From: Safiyu Date: Fri, 27 Dec 2013 10:25:35 +0530 Subject: [PATCH] initial commit b --- app/global-translations/locale-en.json | 1 + .../controllers/centers/AddGroupController.js | 47 +++++++++++++++++-- .../client/EditClientController.js | 3 +- .../groups/CreateGroupController.js | 11 +++-- app/views/accounting/accounting_coa.html | 2 +- app/views/centers/addgroup.html | 29 ++++++++++-- app/views/clients/createclient.html | 28 ++++++----- app/views/clients/editclient.html | 15 ++++++ app/views/help.html | 2 +- 9 files changed, 111 insertions(+), 27 deletions(-) diff --git a/app/global-translations/locale-en.json b/app/global-translations/locale-en.json index d2995b16..6fe7f84e 100644 --- a/app/global-translations/locale-en.json +++ b/app/global-translations/locale-en.json @@ -164,6 +164,7 @@ "label.requirefield":"Required Field", "label.none":"None", "label.nodatafound":"No data was found related to the search parameters entered.", + "label.mustbenumeric":"Must be numeric", "#Enumeration & Error Messages": "..", "label.error": "Error", diff --git a/app/scripts/controllers/centers/AddGroupController.js b/app/scripts/controllers/centers/AddGroupController.js index 10853717..e9d7997a 100644 --- a/app/scripts/controllers/centers/AddGroupController.js +++ b/app/scripts/controllers/centers/AddGroupController.js @@ -2,11 +2,15 @@ mifosX.controllers = _.extend(module, { AddGroupController: function(scope, resourceFactory, location, routeParams,dateFilter) { scope.first = {}; - scope.first.date = new Date(); scope.restrictDate = new Date(); + scope.addedClients = []; + scope.available = []; + scope.added = []; scope.formData = {}; + scope.formData.clientMembers = []; resourceFactory.groupTemplateResource.get({centerId: routeParams.centerId} , function(data) { scope.groupTemplate = data; + scope.clients = data.clientOptions; }); scope.setChoice = function(){ if(this.formData.active){ @@ -16,12 +20,49 @@ scope.choice = 0; } }; + scope.add = function(){ + for(var i in this.available) + { + for(var j in scope.clients){ + if(scope.clients[j].id == this.available[i]) + { + var temp = {}; + temp.id = this.available[i]; + temp.displayName = scope.clients[j].displayName; + scope.addedClients.push(temp); + scope.clients.splice(j,1); + } + } + } + + }; + scope.sub = function(){ + for(var i in this.added) + { + for(var j in scope.addedClients){ + if(scope.addedClients[j].id == this.added[i]) + { + var temp = {}; + temp.id = this.added[i]; + temp.displayName = scope.addedClients[j].displayName; + scope.clients.push(temp); + scope.addedClients.splice(j,1); + } + } + } + }; scope.submit = function(){ - if (scope.first.date) { + for(var i in scope.addedClients){ + scope.formData.clientMembers[i] = scope.addedClients[i].id; + } + if (this.formData.active) { var reqDate = dateFilter(scope.first.date,'dd MMMM yyyy'); this.formData.activationDate = reqDate; - this.formData.dateFormat = 'dd MMMM yyyy'; } + if (scope.first.submitondate) { + this.formData.submittedOnDate = dateFilter(scope.first.submitondate,'dd MMMM yyyy'); + } + this.formData.dateFormat = 'dd MMMM yyyy'; this.formData.active = this.formData.active || false; this.formData.locale = 'en'; this.formData.centerId = routeParams.centerId ; diff --git a/app/scripts/controllers/client/EditClientController.js b/app/scripts/controllers/client/EditClientController.js index 0b9ac7ad..02c767ea 100644 --- a/app/scripts/controllers/client/EditClientController.js +++ b/app/scripts/controllers/client/EditClientController.js @@ -15,7 +15,8 @@ middlename : data.middlename, active : data.active, accountNo : data.accountNo, - staffId : data.staffId + staffId : data.staffId, + mobileNo : data.mobileNo }; var actDate = dateFilter(data.activationDate,'dd MMMM yyyy'); scope.date.activationDate = new Date(actDate); diff --git a/app/scripts/controllers/groups/CreateGroupController.js b/app/scripts/controllers/groups/CreateGroupController.js index ba9fd45b..3f7a0386 100644 --- a/app/scripts/controllers/groups/CreateGroupController.js +++ b/app/scripts/controllers/groups/CreateGroupController.js @@ -71,12 +71,13 @@ for(var i in scope.addedClients){ scope.formData.clientMembers[i] = scope.addedClients[i].id; } - var reqDate = dateFilter(scope.first.date,'dd MMMM yyyy'); - this.formData.activationDate = reqDate; - + if(this.formData.active){ + var reqDate = dateFilter(scope.first.date,'dd MMMM yyyy'); + this.formData.activationDate = reqDate; + } if (scope.first.submitondate) { - reqDate = dateFilter(scope.first.submitondate,'dd MMMM yyyy'); - this.formData.submittedOnDate = reqDate; + reqDat = dateFilter(scope.first.submitondate,'dd MMMM yyyy'); + this.formData.submittedOnDate = reqDat; } this.formData.locale = 'en'; diff --git a/app/views/accounting/accounting_coa.html b/app/views/accounting/accounting_coa.html index df47f3ea..489da200 100644 --- a/app/views/accounting/accounting_coa.html +++ b/app/views/accounting/accounting_coa.html @@ -29,7 +29,7 @@ - {{coadata.name}} + {{coadata.name}} {{coadata.glCode}} diff --git a/app/views/centers/addgroup.html b/app/views/centers/addgroup.html index 356d50ac..46cfa337 100644 --- a/app/views/centers/addgroup.html +++ b/app/views/centers/addgroup.html @@ -27,11 +27,32 @@
- +
- +
+
+ + +
+
+
+ +
+
+ + +
+
+
+
+
+ +
+
diff --git a/app/views/clients/createclient.html b/app/views/clients/createclient.html index a2ea4f4e..7142a338 100644 --- a/app/views/clients/createclient.html +++ b/app/views/clients/createclient.html @@ -3,13 +3,13 @@
{{'label.heading.createclient' | translate}}
- +
- +
- +
- +
-
- +
+
- - + + + + {{'label.mustbenumeric' | translate}} + +
- +
- +
- +
diff --git a/app/views/clients/editclient.html b/app/views/clients/editclient.html index 2cda9da3..d7344567 100644 --- a/app/views/clients/editclient.html +++ b/app/views/clients/editclient.html @@ -81,6 +81,21 @@
+ + +
+ +
+ + + + {{'label.mustbenumeric' | translate}} + + +
+
+ + diff --git a/app/views/help.html b/app/views/help.html index 6ccabf14..3895471b 100644 --- a/app/views/help.html +++ b/app/views/help.html @@ -61,7 +61,7 @@ {{'label.heading.saveorsubmit' | translate}} - ctrl + s + ctrl + s {{'label.heading.runreport' | translate}}