Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
ed6c89ca
Commit
ed6c89ca
authored
Aug 03, 2018
by
mduppanapudi-nisum-com
Committed by
rbonthala-nisum-com
Aug 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix in manage Employee (#110)
parent
9ec32ced
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
46 deletions
+90
-46
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+80
-43
newRoleTemplate.html
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
+10
-3
No files found.
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
ed6c89ca
...
...
@@ -331,6 +331,11 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
$scope
.
validateFields
=
function
(){
var
today
=
new
Date
();
if
(
$scope
.
templateTitle
==
"Add"
){
$scope
.
empStatus
=
"Active"
;
}
var
searchId
=
$scope
.
empId
;
var
empName
=
$scope
.
empName
;
var
gender
=
$scope
.
gender
;
...
...
@@ -389,63 +394,95 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
else
if
(
hasB1
==
undefined
){
$scope
.
alertMsg
=
"Please select a Visa"
;
document
.
getElementById
(
'hasB1'
).
focus
();
}
else
if
(
$scope
.
templateTitle
!=
"Add"
&&
$scope
.
exitDate
==
undefined
&&
$scope
.
empStatus
!=
"Active"
){
$scope
.
alertMsg
=
"Please select the exit date"
;
document
.
getElementById
(
'hasB1'
).
focus
();
}
else
if
(
$scope
.
templateTitle
!=
"Add"
&&
$scope
.
exitDate
>=
today
){
$scope
.
alertMsg
=
"Please select the exit date less than or equal to current date"
;
document
.
getElementById
(
'hasB1'
).
focus
();
}
else
{
$scope
.
alertMsg
=
""
;
console
.
log
(
$scope
.
empName
,
"VENU"
);
var
record
=
{
"employeeId"
:
$scope
.
empId
,
"employeeName"
:
$scope
.
empName
,
"gender"
:
$scope
.
gender
,
"emailId"
:
$scope
.
empEmail
,
"role"
:
$scope
.
empRole
,
"empLocation"
:
$scope
.
empLocation
,
"designation"
:
$scope
.
designation
,
"functionalGroup"
:
$scope
.
functionalGroup
,
"empStatus"
:
$scope
.
empStatus
,
"employmentType"
:
$scope
.
employmentType
,
"domain"
:
$scope
.
domain
,
"dateOfJoining"
:
$scope
.
dateOfJoining
,
"dateOfBirth"
:
$scope
.
dateOfBirth
,
"hasPassort"
:
$scope
.
hasPassort
,
"hasB1"
:
$scope
.
hasB1
,
"passportExpiryDate"
:
$scope
.
passportExpiryDate
,
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
,
"endDate"
:
$scope
.
exitDate
};
if
(
$scope
.
templateTitle
==
"Add"
){
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
}
else
{
if
(
isDataUpdated
()
==
true
){
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
}
else
{
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
title
:
'Attention'
,
textContent
:
'There is no data change to Update'
,
ok
:
'ok'
}))
}
}
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
}
};
$scope
.
cancel
=
function
()
{
var
showConfirmDialog
=
false
;
isDataUpdated
=
function
(){
if
(
dataToPass
.
action
==
"Update"
){
console
.
log
(
dataToPass
);
$scope
.
previousData
=
{
EmpId
:
dataToPass
.
employeeId
,
EmpName
:
dataToPass
.
employeeName
,
Gender
:
dataToPass
.
gender
,
Email
:
dataToPass
.
emailId
,
EmploymentStatus
:
dataToPass
.
empStatus
,
Role
:
dataToPass
.
role
,
Designation
:
dataToPass
.
designation
,
WorkLocation
:
dataToPass
.
empLocation
,
EmploymentType
:
dataToPass
.
employmentType
,
FunctionalGroup
:
dataToPass
.
functionalGroup
,
HasPassport
:
dataToPass
.
hasPassort
,
HasB1Visa
:
dataToPass
.
hasB1
,
Dateofjoining
:
new
Date
(
dataToPass
.
dateOfJoining
),
//DateofBirth:dataToPass.dateOfBirth ? new Date(dataToPass.dateOfBirth) : ''
DateofBirth
:
new
Date
(
dataToPass
.
dateOfBirth
)
console
.
log
(
dataToPass
);
$scope
.
previousData
=
{
EmpId
:
dataToPass
.
employeeId
,
EmpName
:
dataToPass
.
employeeName
,
Gender
:
dataToPass
.
gender
,
Email
:
dataToPass
.
emailId
,
EmploymentStatus
:
dataToPass
.
empStatus
,
Role
:
dataToPass
.
role
,
Designation
:
dataToPass
.
designation
,
WorkLocation
:
dataToPass
.
empLocation
,
EmploymentType
:
dataToPass
.
employmentType
,
FunctionalGroup
:
dataToPass
.
functionalGroup
,
HasPassport
:
dataToPass
.
hasPassort
,
HasB1Visa
:
dataToPass
.
hasB1
,
Dateofjoining
:
new
Date
(
dataToPass
.
dateOfJoining
),
//DateofBirth:dataToPass.dateOfBirth ? new Date(dataToPass.dateOfBirth) : ''
DateofBirth
:
new
Date
(
dataToPass
.
dateOfBirth
)
}
$scope
.
currentData
=
{
EmpId
:
$scope
.
empId
,
EmpName
:
$scope
.
empName
,
Gender
:
$scope
.
gender
,
Email
:
$scope
.
empEmail
,
EmploymentStatus
:
$scope
.
empStatus
,
Role
:
$scope
.
empRole
,
Designation
:
$scope
.
designation
,
WorkLocation
:
$scope
.
empLocation
,
EmploymentType
:
$scope
.
employmentType
,
FunctionalGroup
:
$scope
.
functionalGroup
,
HasPassport
:
$scope
.
hasPassort
,
HasB1Visa
:
$scope
.
hasB1
,
Dateofjoining
:
$scope
.
dateOfJoining
,
DateofBirth
:
$scope
.
dateOfBirth
}
$scope
.
currentData
=
{
EmpId
:
$scope
.
empId
,
EmpName
:
$scope
.
empName
,
Gender
:
$scope
.
gender
,
Email
:
$scope
.
empEmail
,
EmploymentStatus
:
$scope
.
empStatus
,
Role
:
$scope
.
empRole
,
Designation
:
$scope
.
designation
,
WorkLocation
:
$scope
.
empLocation
,
EmploymentType
:
$scope
.
employmentType
,
FunctionalGroup
:
$scope
.
functionalGroup
,
HasPassport
:
$scope
.
hasPassort
,
HasB1Visa
:
$scope
.
hasB1
,
Dateofjoining
:
$scope
.
dateOfJoining
,
DateofBirth
:
$scope
.
dateOfBirth
}
var
predata
=
JSON
.
stringify
(
$scope
.
previousData
);
var
curdata
=
JSON
.
stringify
(
$scope
.
currentData
);
if
(
predata
===
curdata
){
}
var
predata
=
JSON
.
stringify
(
$scope
.
previousData
);
var
curdata
=
JSON
.
stringify
(
$scope
.
currentData
);
if
(
predata
==
curdata
){
return
false
;
}
return
true
;
}
}
$scope
.
cancel
=
function
()
{
var
showConfirmDialog
=
false
;
if
(
dataToPass
.
action
==
"Update"
){
if
(
isDataUpdated
()
!=
true
){
$mdDialog
.
hide
(
'Cancelled'
);
}
else
{
...
...
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
View file @
ed6c89ca
...
...
@@ -64,17 +64,24 @@
</td>
</tr>
<tr>
<td
colspan=
"4"
><b>
Employment Status:
</b><span
class=
"mandatory"
></span></td>
<tr
ng-show=
"templateTitle != 'Add'"
>
<td
colspan=
"4"
><b>
Employment Status
{{templateTitle}}
:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"8"
><md-select
ng-model=
"empStatus"
md-selected-text=
"getSelectedEmpStatus()"
id=
"empStatus"
>
<md-optgroup
label=
"Employment Status"
>
<md-option
ng-value=
"status"
ng-repeat=
"status in empStatuses"
>
{{status}}
</md-option>
</md-optgroup>
</md-select></td>
</tr>
<tr
ng-show=
"empStatus == 'In Active'"
>
<td
colspan=
"4"
><b>
Employment Status:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"8"
><md-datepicker
ng-model=
"exitDate"
md-placeholder=
"Exit Date"
md-min-date=
"minDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
></md-datepicker>
</td>
</tr>
<tr>
<td
colspan=
"
4
"
>
<td
colspan=
"
12
"
>
<div
role=
"alert"
>
<span
class=
"error"
style=
"color: red;"
>
{{alertMsg}}
</span>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment