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
6a08ed6e
Commit
6a08ed6e
authored
May 09, 2018
by
Rajeshekar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-43[Rajeshekar]:Updated Manage Employee to update location
parent
1b5f9eab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
11 deletions
+17
-11
AssignRolesController.js
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
+12
-2
newRoleTemplate.html
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
+4
-0
roles.html
src/main/webapp/WEB-INF/templates/roles.html
+1
-9
No files found.
src/main/webapp/WEB-INF/controllers/AssignRolesController.js
View file @
6a08ed6e
...
@@ -55,6 +55,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -55,6 +55,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
parentData
.
employeeName
=
row
.
entity
.
employeeName
;
$scope
.
parentData
.
employeeName
=
row
.
entity
.
employeeName
;
$scope
.
parentData
.
emailId
=
row
.
entity
.
emailId
;
$scope
.
parentData
.
emailId
=
row
.
entity
.
emailId
;
$scope
.
parentData
.
role
=
row
.
entity
.
role
;
$scope
.
parentData
.
role
=
row
.
entity
.
role
;
$scope
.
parentData
.
empLocation
=
row
.
entity
.
empLocation
;
if
(
action
==
"Update"
)
if
(
action
==
"Update"
)
$scope
.
assignRole
(
action
,
$scope
.
parentData
);
$scope
.
assignRole
(
action
,
$scope
.
parentData
);
else
if
(
action
==
"Delete"
)
else
if
(
action
==
"Delete"
)
...
@@ -220,15 +221,18 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -220,15 +221,18 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
$scope
.
empName
=
""
;
$scope
.
empName
=
""
;
$scope
.
empRole
;
$scope
.
empRole
;
$scope
.
empEmail
=
""
;
$scope
.
empEmail
=
""
;
$scope
.
empLocation
=
""
;
$scope
.
isDisabled
=
false
;
$scope
.
isDisabled
=
false
;
}
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
;
$scope
.
empRole
=
dataToPass
.
role
;
$scope
.
empRole
=
dataToPass
.
role
;
$scope
.
empEmail
=
dataToPass
.
emailId
;
$scope
.
empEmail
=
dataToPass
.
emailId
;
$scope
.
empLocation
=
dataToPass
.
empLocation
;
$scope
.
isDisabled
=
true
;
$scope
.
isDisabled
=
true
;
}
}
$scope
.
roles
=
[
"Delivery Manager"
,
"Director"
,
"Employee"
,
"HR"
,
"HR Manager"
,
"Lead"
,
"Manager"
];
$scope
.
roles
=
[
"Delivery Manager"
,
"Director"
,
"Employee"
,
"HR"
,
"HR Manager"
,
"Lead"
,
"Manager"
];
$scope
.
locations
=
myFactory
.
getLocations
();
$scope
.
getSelectedRole
=
function
(){
$scope
.
getSelectedRole
=
function
(){
if
(
$scope
.
empRole
!==
undefined
)
{
if
(
$scope
.
empRole
!==
undefined
)
{
return
$scope
.
empRole
;
return
$scope
.
empRole
;
...
@@ -236,7 +240,13 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -236,7 +240,13 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
return
"Please select a role"
;
return
"Please select a role"
;
}
}
};
};
$scope
.
getSelectedLocation
=
function
(){
if
(
$scope
.
empLocation
!==
undefined
)
{
return
$scope
.
empLocation
;
}
else
{
return
"Please select a location"
;
}
};
$scope
.
validateEmpId
=
function
(){
$scope
.
validateEmpId
=
function
(){
var
searchId
=
$scope
.
empId
;
var
searchId
=
$scope
.
empId
;
if
(
searchId
!=
""
&&
isNaN
(
searchId
)){
if
(
searchId
!=
""
&&
isNaN
(
searchId
)){
...
@@ -314,7 +324,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
...
@@ -314,7 +324,7 @@ myApp.controller("assignRoleController",function($scope, myFactory, $mdDialog, $
document
.
getElementById
(
'empRole'
).
focus
();
document
.
getElementById
(
'empRole'
).
focus
();
}
else
{
}
else
{
$scope
.
alertMsg
=
""
;
$scope
.
alertMsg
=
""
;
var
record
=
{
"employeeId"
:
$scope
.
empId
,
"employeeName"
:
$scope
.
empName
,
"emailId"
:
$scope
.
empEmail
,
"role"
:
$scope
.
empRole
};
var
record
=
{
"employeeId"
:
$scope
.
empId
,
"employeeName"
:
$scope
.
empName
,
"emailId"
:
$scope
.
empEmail
,
"role"
:
$scope
.
empRole
,
"empLocation"
:
$scope
.
empLocation
};
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
addOrUpdateRole
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
}
}
...
...
src/main/webapp/WEB-INF/templates/newRoleTemplate.html
View file @
6a08ed6e
...
@@ -26,6 +26,10 @@
...
@@ -26,6 +26,10 @@
<md-select
ng-model=
"empShift"
md-selected-text=
"getSelectedShift()"
id=
"empShift"
ng-disabled=
"isDisabled"
style=
"display:none"
>
<md-select
ng-model=
"empShift"
md-selected-text=
"getSelectedShift()"
id=
"empShift"
ng-disabled=
"isDisabled"
style=
"display:none"
>
<md-optgroup
label=
"shifts"
>
<md-option
ng-value=
"shift"
<md-optgroup
label=
"shifts"
>
<md-option
ng-value=
"shift"
ng-repeat=
"shift in shifts"
>
{{shift}}
</md-option>
</md-optgroup>
</md-select>
ng-repeat=
"shift in shifts"
>
{{shift}}
</md-option>
</md-optgroup>
</md-select>
<md-select
ng-model=
"empLocation"
md-selected-text=
"getSelectedLocation()"
id=
"empLocation"
>
<md-optgroup
label=
"locations"
>
<md-option
ng-value=
"location"
ng-repeat=
"location in locations"
>
{{location}}
</md-option>
</md-optgroup>
</md-select>
<div
role=
"alert"
>
<div
role=
"alert"
>
<span
class=
"error"
style=
"color: red;"
>
{{alertMsg}}
</span>
<span
class=
"error"
style=
"color: red;"
>
{{alertMsg}}
</span>
</div>
</div>
...
...
src/main/webapp/WEB-INF/templates/roles.html
View file @
6a08ed6e
...
@@ -50,15 +50,7 @@
...
@@ -50,15 +50,7 @@
</div>
</div>
</div>
</div>
<div
class=
"col-lg-1"
style=
"cursor: pointer; float: right; right: 75px;"
>
<md-button
class=
"md-raised md-primary"
style=
"width:142px;background: cadetblue;"
ng-click=
"assignRole('Add', parentData)"
>
<i
class=
"fa fa-plus-circle fa-2x"
style=
"margin-top: 5px; font-size: 1.5em; float: left"
></i>
Add
Employee
</md-button>
</div>
</div>
</div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></div>
<div
class=
"row col-lg-12"
style=
"height: 15px;"
></div>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
...
...
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