initial commit

b
This commit is contained in:
Safiyu 2013-12-27 10:25:35 +05:30
parent be37020331
commit dff690c02f
9 changed files with 111 additions and 27 deletions

View File

@ -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",

View File

@ -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 ;

View File

@ -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);

View File

@ -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';

View File

@ -29,7 +29,7 @@
<tbody>
<tr class="pointer-main" ng-repeat="coadata in coadatas | orderBy:'type.value' | filter:filterText">
<td class="pointer" data-ng-click="routeTo(coadata.id)">
<a href="#{{coadata.id}}">{{coadata.name}}</a>
{{coadata.name}}
</td>
<td class="pointer" data-ng-click="routeTo(coadata.id)">
{{coadata.glCode}}

View File

@ -27,11 +27,32 @@
</div>
</div>
<div class="control-group">
<label class="control-label">{{ 'label.input.clients' | translate }}</label>
<label class="control-label" for="staffId">{{'label.input.addclients' | translate}}</label>
<div class="controls">
<select id="clientMembers" multiple ng-model="formData.clientMembers">
<option ng-repeat="client in groupTemplate.clientOptions" value="{{client.id}}">{{client.displayName}}</option>
</select>
<div class="row-fluid">
<div class="span4">
<label class="control-label">{{ 'label.input.availableclients' | translate }}</label>
<select multiple id="clientMembers" ng-model="available">
<option ng-repeat="member in clients" value="{{member.id}}">{{member.displayName}}</option>
</select>
</div>
<div class="paddedtop10 span2 paddedleft0">
<button type="button" class="btn angled-btn btn-primary" data-ng-click="add()"><i class="icon-double-angle-right"></i></button><br/>
<button type="button" class="btn angled-btn btn-primary" data-ng-click="sub()"><i class="icon-double-angle-left"></i></button>
</div>
<div class="span3 angled-textarea">
<label class="control-label">{{ 'label.input.selectedclients' | translate }}</label>
<select multiple ng-model="added">
<option ng-repeat="client in addedClients" value="{{client.id}}">{{client.displayName}}</option>
</select>
</div>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">{{'label.input.submittedon' | translate}}:</label>
<div class="controls">
<input id="submittedon" type="text" name="submittedon" datepicker-pop="dd MMMM yyyy" ng-model="first.submitondate" is-open="opened" min="'2000-01-01'" max="restrictDate"/>
</div>
</div>
<div class="control-group">

View File

@ -3,13 +3,13 @@
<fieldset>
<legend>{{'label.heading.createclient' | translate}}</legend>
<div class="control-group">
<label class="control-label">{{'label.input.office' | translate}}:<span class="required">*</span></label>
<label class="control-label">{{'label.input.office' | translate}}<span class="required">*</span></label>
<div class="controls">
<select id="officeId" ng-model="formData.officeId" ng-options="office.id as office.name for office in offices" value="{{office.id}}" ng-change="changeOffice(formData.officeId)"></select>
</div>
</div>
<div class="control-group">
<label class="control-label">{{'label.input.staff' | translate}}:</label>
<label class="control-label">{{'label.input.staff' | translate}}</label>
<div class="controls">
<select id="staffId" ng-model="formData.staffId" ng-options="staff.id as staff.displayName for staff in staffs" value="{{staff.id}}">
<option value="">--{{'label.menu.selectstaff' | translate}}--</option>
@ -17,35 +17,39 @@
</div>
</div>
<div class="control-group">
<label class="control-label" for="firstname">{{ 'label.input.firstname' | translate }}:<span class="required">*</span></label>
<label class="control-label" for="firstname">{{ 'label.input.firstname' | translate }}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="firstname" name="firstname" ng-model="formData.firstname" required late-Validate/>
<form-validate valattributeform="createclientform" valattribute="firstname"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="middlename">{{'label.input.middlename' | translate}}:</label>
<label class="control-label" for="middlename">{{'label.input.middlename' | translate}}</label>
<div class="controls">
<input type="text" id="middlename" ng-model="formData.middlename"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="lastname">{{'label.input.lastname' | translate}}:<span class="required">*</span></label>
<label class="control-label" for="lastname">{{'label.input.lastname' | translate}}<span class="required">*</span></label>
<div class="controls">
<input type="text" id="lastname" name="lastname" ng-model="formData.lastname" required late-Validate/>
<form-validate valattributeform="createclientform" valattribute="lastname"/>
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobileNo">{{'label.input.mobilenumber' | translate}}:</label>
<div class="control-group">
<label class="control-label" for="mobileNo">{{'label.input.mobilenumber' | translate}}</label>
<div class="controls">
<input type="text" id="mobileNo" name="mobileNo" ng-model="formData.mobileNo" />
<form-validate valattributeform="createclientform" valattribute="mobileNo"/>
<input type="number" id="mobileNo" name="mobileNo" ng-model="formData.mobileNo" ng-pattern="/^[0-9]+$/" />
<span ng-show="createclientform.mobileNo.$invalid && createclientform.mobileNo.$dirty">
<small class="required" ng-show="createclientform.mobileNo.$error.pattern">
{{'label.mustbenumeric' | translate}}
</small>
</span>
</div>
</div>
<div class="control-group">
<label class="control-label">{{'label.input.active' | translate}}:</label>
<label class="control-label">{{'label.input.active' | translate}}</label>
<div class="controls">
<label class="checkbox">
<input id="activeCheckbox" type="checkbox" ng-model="formData.active" data-ng-click="setChoice()">
@ -54,14 +58,14 @@
</div>
<div data-ng-switch on="choice">
<div class="control-group" data-ng-switch-when="1">
<label class="control-label">{{'label.input.activationdate' | translate}}:<span class="required">*</span></label>
<label class="control-label">{{'label.input.activationdate' | translate}}<span class="required">*</span></label>
<div class="controls">
<input id="activationDate" type="text" name="activationdate" datepicker-pop="dd MMMM yyyy" ng-model="first.date" is-open="opened" min="'2000-01-01'" max="restrictDate"/>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label">{{'label.input.submittedon' | translate}}:</label>
<label class="control-label">{{'label.input.submittedon' | translate}}</label>
<div class="controls">
<input id="submittedon" type="text" name="submittedon" datepicker-pop="dd MMMM yyyy" ng-model="first.submitondate" is-open="opened" min="'2000-01-01'" max="restrictDate"/>
</div>

View File

@ -81,6 +81,21 @@
</div>
</td>
</tr>
<tr>
<td>
<div class="control-group">
<label class="control-label" for="mobileNo">{{'label.input.mobilenumber' | translate}}</label>
<div class="controls">
<input type="number" id="mobileNo" name="mobileNo" ng-model="formData.mobileNo" ng-pattern="/^[0-9]+$/" />
<span ng-show="createclientform.mobileNo.$invalid && createclientform.mobileNo.$dirty">
<small class="required" ng-show="createclientform.mobileNo.$error.pattern">
{{'label.mustbenumeric' | translate}}
</small>
</span>
</div>
</div>
</td>
</tr>
<tr>
<td>

View File

@ -61,7 +61,7 @@
</tr>
<tr>
<td style="font-weight: normal" class="table-bold-acc">{{'label.heading.saveorsubmit' | translate}}</td>
<td><span class="padded-td">ctrl + <span class="hotkey">s</span></span></td>
<td><span class="padded-td"><span class="hotkey">ctrl + s</span></span></td>
</tr>
<tr>
<td style="font-weight: normal" class="table-bold-acc">{{'label.heading.runreport' | translate}}</td>