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
00486ce3
Commit
00486ce3
authored
Jun 18, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added substatus start date and end date
parent
dc2783ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
13 deletions
+48
-13
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+29
-8
newRoleTemplate.html
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
+19
-5
No files found.
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
00486ce3
...
@@ -88,6 +88,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -88,6 +88,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
parentData
.
passportExpiryDate
=
row
.
entity
.
passportExpiryDate
;
$scope
.
parentData
.
passportExpiryDate
=
row
.
entity
.
passportExpiryDate
;
$scope
.
parentData
.
b1ExpiryDate
=
row
.
entity
.
b1ExpiryDate
;
$scope
.
parentData
.
b1ExpiryDate
=
row
.
entity
.
b1ExpiryDate
;
$scope
.
parentData
.
endDate
=
row
.
entity
.
endDate
;
$scope
.
parentData
.
endDate
=
row
.
entity
.
endDate
;
$scope
.
parentData
.
subStatusStartDate
=
row
.
entity
.
subStatusStartDate
;
$scope
.
parentData
.
subStatusEndDate
=
row
.
entity
.
subStatusEndDate
;
if
(
action
==
"Update"
)
if
(
action
==
"Update"
)
$scope
.
assignRole
(
action
,
$scope
.
parentData
);
$scope
.
assignRole
(
action
,
$scope
.
parentData
);
else
if
(
action
==
"Delete"
)
else
if
(
action
==
"Delete"
)
...
@@ -260,10 +262,12 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -260,10 +262,12 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
designation
;
$scope
.
designation
;
$scope
.
empLocation
;
$scope
.
empLocation
;
$scope
.
dateOfJoining
;
$scope
.
dateOfJoining
;
$scope
.
domain
=
""
;
$scope
.
domain
=
""
;
$scope
.
isDisabled
=
false
;
$scope
.
isDisabled
=
false
;
$scope
.
hasPassort
;
$scope
.
hasPassort
;
$scope
.
hasB1
;
$scope
.
hasB1
;
$scope
.
subStatusEndDate
;
$scope
.
subStatusStartDate
;
}
else
if
(
dataToPass
.
action
==
"Update"
)
{
}
else
if
(
dataToPass
.
action
==
"Update"
)
{
$scope
.
empId
=
dataToPass
.
employeeId
;
$scope
.
empId
=
dataToPass
.
employeeId
;
$scope
.
empName
=
dataToPass
.
employeeName
;
$scope
.
empName
=
dataToPass
.
employeeName
;
...
@@ -274,6 +278,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -274,6 +278,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
functionalGroup
=
dataToPass
.
functionalGroup
;
$scope
.
functionalGroup
=
dataToPass
.
functionalGroup
;
$scope
.
empStatus
=
dataToPass
.
empStatus
;
$scope
.
empStatus
=
dataToPass
.
empStatus
;
$scope
.
empSubStatus
=
dataToPass
.
empSubStatus
;
$scope
.
empSubStatus
=
dataToPass
.
empSubStatus
;
$scope
.
subStatusEndDate
=
(
dataToPass
.
subStatusEndDate
==
null
)
?
null
:
new
Date
(
dataToPass
.
subStatusEndDate
);
$scope
.
subStatusStartDate
=
(
dataToPass
.
subStatusStartDate
==
null
)
?
null
:
new
Date
(
dataToPass
.
subStatusStartDate
);
$scope
.
employmentType
=
dataToPass
.
employmentType
;
$scope
.
employmentType
=
dataToPass
.
employmentType
;
$scope
.
domain
=
dataToPass
.
domain
;
$scope
.
domain
=
dataToPass
.
domain
;
$scope
.
designation
=
dataToPass
.
designation
;
$scope
.
designation
=
dataToPass
.
designation
;
...
@@ -435,6 +441,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -435,6 +441,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
}
}
$scope
.
validateFields
=
function
(){
$scope
.
validateFields
=
function
(){
console
.
log
(
$scope
.
subStatusStartDate
)
var
today
=
new
Date
();
var
today
=
new
Date
();
if
(
$scope
.
templateTitle
==
"Add"
){
if
(
$scope
.
templateTitle
==
"Add"
){
...
@@ -457,6 +464,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -457,6 +464,8 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
var
dateOfBirth
=
$scope
.
dateOfBirth
;
var
dateOfBirth
=
$scope
.
dateOfBirth
;
var
b1ExpiryDate
=
$scope
.
b1ExpiryDate
;
var
b1ExpiryDate
=
$scope
.
b1ExpiryDate
;
var
passportExpiryDate
=
$scope
.
passportExpiryDate
;
var
passportExpiryDate
=
$scope
.
passportExpiryDate
;
var
subStatusStartDate
=
$scope
.
subStatusStartDate
;
var
subStatusEndDate
=
$scope
.
subStatusEndDate
;
if
(
searchId
==
""
){
if
(
searchId
==
""
){
$scope
.
alertMsg
=
"Employee Id is mandatory"
;
$scope
.
alertMsg
=
"Employee Id is mandatory"
;
document
.
getElementById
(
'empId'
).
focus
();
document
.
getElementById
(
'empId'
).
focus
();
...
@@ -485,7 +494,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -485,7 +494,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
else
if
(
dateOfJoining
==
undefined
){
else
if
(
dateOfJoining
==
undefined
){
$scope
.
alertMsg
=
"Please select a Date Of Joining"
;
$scope
.
alertMsg
=
"Please select a Date Of Joining"
;
document
.
getElementById
(
'dateOfJoining'
).
focus
();
document
.
getElementById
(
'dateOfJoining'
).
focus
();
}
else
if
(
dateOfBirth
!=
undefined
&&
!
(
today
.
getFullYear
()
-
dateOfBirth
.
getFullYear
()
>
20
)){
}
else
if
(
subStatusStartDate
==
undefined
){
$scope
.
alertMsg
=
"Please select a SubStatus start Date"
;
document
.
getElementById
(
'subStatusStartDate'
).
focus
();
}
else
if
(
subStatusEndDate
==
undefined
){
$scope
.
alertMsg
=
"Please select a SubStatus end Date"
;
document
.
getElementById
(
'subStatusEndDate'
).
focus
();
}
else
if
(
dateOfBirth
!=
undefined
&&
!
(
today
.
getFullYear
()
-
dateOfBirth
.
getFullYear
()
>
20
)){
$scope
.
alertMsg
=
"Please check your date of birth"
;
$scope
.
alertMsg
=
"Please check your date of birth"
;
document
.
getElementById
(
'dateOfBirth'
).
focus
();
document
.
getElementById
(
'dateOfBirth'
).
focus
();
}
else
if
(
empStatus
==
undefined
){
}
else
if
(
empStatus
==
undefined
){
...
@@ -537,13 +555,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -537,13 +555,16 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
else
if
(
$scope
.
templateTitle
!=
"Add"
&&
$scope
.
exitDate
>=
today
){
else
if
(
$scope
.
templateTitle
!=
"Add"
&&
$scope
.
exitDate
>=
today
){
$scope
.
alertMsg
=
"Please select the exit date less than or equal to current date"
;
$scope
.
alertMsg
=
"Please select the exit date less than or equal to current date"
;
document
.
getElementById
(
'hasB1'
).
focus
();
document
.
getElementById
(
'hasB1'
).
focus
();
}
else
{
}
else
if
(
subStatusStartDate
>=
subStatusEndDate
){
$scope
.
alertMsg
=
"Start date should not be greater than end date"
;
}
else
{
$scope
.
alertMsg
=
""
;
$scope
.
alertMsg
=
""
;
var
record
=
{
"employeeId"
:
$scope
.
empId
,
"employeeName"
:
$scope
.
empName
,
"gender"
:
$scope
.
gender
,
"emailId"
:
$scope
.
empEmail
,
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
,
"role"
:
$scope
.
empRole
,
"empLocation"
:
$scope
.
empLocation
,
"designation"
:
$scope
.
designation
,
"functionalGroup"
:
$scope
.
functionalGroup
,
"empStatus"
:
$scope
.
empStatus
,
"empSubStatus"
:
$scope
.
empSubStatus
,
"employmentType"
:
$scope
.
employmentType
,
"dateOfJoining"
:
$scope
.
dateOfJoining
,
"empStatus"
:
$scope
.
empStatus
,
"empSubStatus"
:
$scope
.
empSubStatus
,
"employmentType"
:
$scope
.
employmentType
,
"dateOfJoining"
:
$scope
.
dateOfJoining
,
"dateOfBirth"
:
$scope
.
dateOfBirth
,
"hasPassort"
:
$scope
.
hasPassort
,
"hasB1"
:
$scope
.
hasB1
,
"passportExpiryDate"
:
$scope
.
passportExpiryDate
,
"dateOfBirth"
:
$scope
.
dateOfBirth
,
"hasPassort"
:
$scope
.
hasPassort
,
"hasB1"
:
$scope
.
hasB1
,
"passportExpiryDate"
:
$scope
.
passportExpiryDate
,
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
,
"endDate"
:
$scope
.
exitDate
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
,
"endDate"
:
$scope
.
exitDate
,
"subStatusStartDate"
:
$scope
.
subStatusStartDate
,
"subStatusEndDate"
:
$scope
.
subStatusEndDate
};
};
if
(
$scope
.
templateTitle
==
"Add"
){
if
(
$scope
.
templateTitle
==
"Add"
){
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
...
@@ -554,7 +575,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -554,7 +575,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
"role"
:
dataToPass
.
role
,
"empLocation"
:
dataToPass
.
empLocation
,
"designation"
:
dataToPass
.
designation
,
"functionalGroup"
:
dataToPass
.
functionalGroup
,
"role"
:
dataToPass
.
role
,
"empLocation"
:
dataToPass
.
empLocation
,
"designation"
:
dataToPass
.
designation
,
"functionalGroup"
:
dataToPass
.
functionalGroup
,
"empStatus"
:
dataToPass
.
empStatus
,
"empSubStatus"
:
dataToPass
.
empSubStatus
,
"employmentType"
:
dataToPass
.
employmentType
,
"dateOfJoining"
:
new
Date
(
dataToPass
.
dateOfJoining
),
"empStatus"
:
dataToPass
.
empStatus
,
"empSubStatus"
:
dataToPass
.
empSubStatus
,
"employmentType"
:
dataToPass
.
employmentType
,
"dateOfJoining"
:
new
Date
(
dataToPass
.
dateOfJoining
),
"dateOfBirth"
:
new
Date
(
dataToPass
.
dateOfBirth
),
"hasPassort"
:
dataToPass
.
hasPassort
,
"hasB1"
:
dataToPass
.
hasB1
,
"passportExpiryDate"
:
new
Date
(
dataToPass
.
passportExpiryDate
),
"dateOfBirth"
:
new
Date
(
dataToPass
.
dateOfBirth
),
"hasPassort"
:
dataToPass
.
hasPassort
,
"hasB1"
:
dataToPass
.
hasB1
,
"passportExpiryDate"
:
new
Date
(
dataToPass
.
passportExpiryDate
),
"b1ExpiryDate"
:
new
Date
(
dataToPass
.
b1ExpiryDate
),
"endDate"
:
new
Date
(
dataToPass
.
endDate
)
"b1ExpiryDate"
:
new
Date
(
dataToPass
.
b1ExpiryDate
),
"endDate"
:
new
Date
(
dataToPass
.
endDate
)
,
"subStatusStartDate"
:
new
Date
(
dataToPass
.
subStatusStartDate
)
,
"subStatusEndDate"
:
new
Date
(
dataToPass
.
subStatusEndDate
)
};
};
objectConstructionBasedOnParameters
(
recordFromDb
);
objectConstructionBasedOnParameters
(
recordFromDb
);
objectConstructionBasedOnParameters
(
record
);
objectConstructionBasedOnParameters
(
record
);
...
@@ -611,14 +632,14 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -611,14 +632,14 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
"role"
:
$scope
.
empRole
,
"empLocation"
:
$scope
.
empLocation
,
"designation"
:
$scope
.
designation
,
"functionalGroup"
:
$scope
.
functionalGroup
,
"role"
:
$scope
.
empRole
,
"empLocation"
:
$scope
.
empLocation
,
"designation"
:
$scope
.
designation
,
"functionalGroup"
:
$scope
.
functionalGroup
,
"empStatus"
:
$scope
.
empStatus
,
"empSubStatus"
:
$scope
.
empSubStatus
,
"employmentType"
:
$scope
.
employmentType
,
"dateOfJoining"
:
$scope
.
dateOfJoining
,
"empStatus"
:
$scope
.
empStatus
,
"empSubStatus"
:
$scope
.
empSubStatus
,
"employmentType"
:
$scope
.
employmentType
,
"dateOfJoining"
:
$scope
.
dateOfJoining
,
"dateOfBirth"
:
$scope
.
dateOfBirth
,
"hasPassort"
:
$scope
.
hasPassort
,
"hasB1"
:
$scope
.
hasB1
,
"passportExpiryDate"
:
$scope
.
passportExpiryDate
,
"dateOfBirth"
:
$scope
.
dateOfBirth
,
"hasPassort"
:
$scope
.
hasPassort
,
"hasB1"
:
$scope
.
hasB1
,
"passportExpiryDate"
:
$scope
.
passportExpiryDate
,
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
,
"endDate"
:
$scope
.
exitDate
"b1ExpiryDate"
:
$scope
.
b1ExpiryDate
,
"endDate"
:
$scope
.
exitDate
,
"subStatusStartDate"
:
$scope
.
subStatusStartDate
,
"subStatusEndDate"
:
$scope
.
subStatusEndDate
};
};
var
recordFromDb
=
{
var
recordFromDb
=
{
"employeeId"
:
dataToPass
.
employeeId
,
"employeeName"
:
dataToPass
.
employeeName
,
"gender"
:
dataToPass
.
gender
,
"emailId"
:
dataToPass
.
emailId
,
"employeeId"
:
dataToPass
.
employeeId
,
"employeeName"
:
dataToPass
.
employeeName
,
"gender"
:
dataToPass
.
gender
,
"emailId"
:
dataToPass
.
emailId
,
"role"
:
dataToPass
.
role
,
"empLocation"
:
dataToPass
.
empLocation
,
"designation"
:
dataToPass
.
designation
,
"functionalGroup"
:
dataToPass
.
functionalGroup
,
"role"
:
dataToPass
.
role
,
"empLocation"
:
dataToPass
.
empLocation
,
"designation"
:
dataToPass
.
designation
,
"functionalGroup"
:
dataToPass
.
functionalGroup
,
"empStatus"
:
dataToPass
.
empStatus
,
"empSubStatus"
:
dataToPass
.
empSubStatus
,
"employmentType"
:
dataToPass
.
employmentType
,
"dateOfJoining"
:
new
Date
(
dataToPass
.
dateOfJoining
),
"empStatus"
:
dataToPass
.
empStatus
,
"empSubStatus"
:
dataToPass
.
empSubStatus
,
"employmentType"
:
dataToPass
.
employmentType
,
"dateOfJoining"
:
new
Date
(
dataToPass
.
dateOfJoining
),
"dateOfBirth"
:
new
Date
(
dataToPass
.
dateOfBirth
),
"hasPassort"
:
dataToPass
.
hasPassort
,
"hasB1"
:
dataToPass
.
hasB1
,
"passportExpiryDate"
:
new
Date
(
dataToPass
.
passportExpiryDate
),
"dateOfBirth"
:
new
Date
(
dataToPass
.
dateOfBirth
),
"hasPassort"
:
dataToPass
.
hasPassort
,
"hasB1"
:
dataToPass
.
hasB1
,
"passportExpiryDate"
:
new
Date
(
dataToPass
.
passportExpiryDate
),
"b1ExpiryDate"
:
new
Date
(
dataToPass
.
b1ExpiryDate
),
"endDate"
:
new
Date
(
dataToPass
.
endDate
)
"b1ExpiryDate"
:
new
Date
(
dataToPass
.
b1ExpiryDate
),
"endDate"
:
new
Date
(
dataToPass
.
endDate
)
,
"subStatusStartDate"
:
new
Date
(
dataToPass
.
subStatusStartDate
)
,
"subStatusEndDate"
:
new
Date
(
dataToPass
.
subStatusEndDate
)
};
};
objectConstructionBasedOnParameters
(
recordFromDb
);
objectConstructionBasedOnParameters
(
recordFromDb
);
objectConstructionBasedOnParameters
(
record
);
objectConstructionBasedOnParameters
(
record
);
...
...
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
View file @
00486ce3
...
@@ -72,6 +72,13 @@
...
@@ -72,6 +72,13 @@
ng-value=
"status"
ng-repeat=
"status in empStatuses"
>
{{status}}
</md-option>
ng-value=
"status"
ng-repeat=
"status in empStatuses"
>
{{status}}
</md-option>
</md-optgroup>
</md-select></td>
</md-optgroup>
</md-select></td>
</tr>
</tr>
<tr
ng-show=
"empStatus == 'In Active'"
>
<td
colspan=
"4"
><b>
Employee Exit Date:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"8"
><md-datepicker
ng-model=
"exitDate"
name=
"endDate"
md-placeholder=
"Exit Date"
md-min-date=
"minDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
></md-datepicker>
</td>
</tr>
<tr
ng-show=
"empStatus == 'Active' && templateTitle != 'Add' "
>
<tr
ng-show=
"empStatus == 'Active' && templateTitle != 'Add' "
>
<td
colspan=
"4"
><b>
Select Sub Status :
</b></td>
<td
colspan=
"4"
><b>
Select Sub Status :
</b></td>
<td
colspan=
"8"
><md-select
ng-model=
"empSubStatus"
name =
"empSubStatus"
<td
colspan=
"8"
><md-select
ng-model=
"empSubStatus"
name =
"empSubStatus"
...
@@ -81,11 +88,18 @@
...
@@ -81,11 +88,18 @@
<md-option
ng-value=
"status"
ng-repeat=
"status in empSubStatuses"
>
{{status}}
</md-option>
<md-option
ng-value=
"status"
ng-repeat=
"status in empSubStatuses"
>
{{status}}
</md-option>
</md-optgroup>
</md-select></td>
</md-optgroup>
</md-select></td>
</tr>
</tr>
<tr
ng-show=
"empStatus == 'In Active'"
>
<tr
ng-show=
"empSubStatus != null && empSubStatus != '' && empStatus == 'Active' && templateTitle != 'Add'"
>
<td
colspan=
"4"
><b>
Employee Exit Date:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"4"
><b>
{{empSubStatus}} Start Date:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"8"
><md-datepicker
ng-model=
"exitDate"
name=
"endDate"
<td
colspan=
"8"
><md-datepicker
ng-model=
"subStatusStartDate"
name=
"subStatusStartDate"
id=
"subStatusStartDate"
md-placeholder=
"Exit Date"
md-min-date=
"minDate"
md-placeholder=
"Start Date"
md-min-date=
"minDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
></md-datepicker>
md-max-date=
"maxDate"
onkeydown=
"return false"
ng-blur=
"validateMessage()"
></md-datepicker>
</td>
</tr>
<tr
ng-show=
"empSubStatus != null && empSubStatus != '' && empStatus == 'Active' && templateTitle != 'Add'"
>
<td
colspan=
"4"
><b>
{{empSubStatus}} End Date:
</b><span
class=
"mandatory"
></span></td>
<td
colspan=
"8"
><md-datepicker
ng-model=
"subStatusEndDate"
name=
"subStatusEndDate"
md-placeholder=
"End Date"
md-min-date=
"minDate"
id=
"subStatusEndDate"
md-max-date=
"maxDate"
onkeydown=
"return false"
ng-blur=
"validateMessage()"
></md-datepicker>
</td>
</td>
</tr>
</tr>
...
...
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