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
85e930bd
Commit
85e930bd
authored
Jul 18, 2018
by
dgoud-nisum-com
Committed by
rbonthala-nisum-com
Jul 18, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MT-69 (#18)
* MT-69 * MT-69 * MT-69 * MT-69
parent
690a4763
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
362 additions
and
82 deletions
+362
-82
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+240
-39
default-styles.css
src/main/webapp/WEB-INF/css/default-styles.css
+9
-0
projectTeamDetails.html
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
+113
-43
No files found.
src/main/webapp/WEB-INF/controllers/ProjectController.js
100644 → 100755
View file @
85e930bd
myApp
.
controller
(
"projectController"
,
function
(
$scope
,
myFactory
,
exportUiGridService
,
$mdDialog
,
$http
,
appConfig
,
$timeout
){
myApp
.
controller
(
"projectController"
,
function
(
$scope
,
myFactory
,
exportUiGridService
,
$mdDialog
,
$http
,
appConfig
,
$timeout
,
$window
){
$scope
.
records
=
[];
$scope
.
records
=
[];
$scope
.
empSearchId
=
""
;
$scope
.
empSearchId
=
""
;
$scope
.
parentData
=
{
$scope
.
parentData
=
{
...
@@ -12,20 +12,18 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -12,20 +12,18 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
};
};
$scope
.
managers
=
[];
$scope
.
managers
=
[];
var
getCellTemplate
=
'<p class="col-lg-12"><i class="fa fa-book fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
View
\'
)"></i>'
+
var
getCellTemplate
=
'<p class="col-lg-12"><i class="fa fa-book fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="Edit" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
View
\'
)" ></i>'
+
' <i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i>'
+
' <i class="fa fa-pencil-square-o fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="center" title="View" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Update
\'
)"></i>'
+
' <i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" ng-click="grid.appScope.getRowData(row,
\'
Delete
\'
)"></i></p>'
;
' <i class="fa fa-minus-circle fa-2x" aria-hidden="true" style="font-size:1.5em;margin-top:3px;cursor:pointer;" data-placement="left" title="Delete" onmouseenter="$(this).tooltip(
\'
show
\'
)" ng-click="grid.appScope.getRowData(row,
\'
Delete
\'
)"></i></p>'
;
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSize
:
10
,
paginationPageSize
:
10
,
pageNumber
:
1
,
pageNumber
:
1
,
pageSize
:
10
,
pageSize
:
10
,
enableFiltering
:
true
,
enableFiltering
:
true
,
columnDefs
:
[
columnDefs
:
[
{
field
:
'projectId'
,
displayName
:
'Project ID'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
120
,
},
{
field
:
'projectId'
,
displayName
:
'Project ID'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableFiltering
:
false
,
width
:
120
},
{
field
:
'projectName'
,
displayName
:
'Project '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'projectName'
,
displayName
:
'Project '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'account'
,
displayName
:
'Account '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
{
field
:
'account'
,
displayName
:
'Account '
,
enableColumnMenu
:
false
,
enableSorting
:
true
,
enableFiltering
:
true
},
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
//{field : 'managerId',displayName: 'Manager ID ', enableColumnMenu: false, enableSorting: false},
...
@@ -35,7 +33,6 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -35,7 +33,6 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
]
]
};
};
$scope
.
gridOptions
.
data
=
$scope
.
records
;
$scope
.
gridOptions
.
data
=
$scope
.
records
;
$scope
.
getRowData
=
function
(
row
,
action
){
$scope
.
getRowData
=
function
(
row
,
action
){
$scope
.
parentData
.
projectId
=
row
.
entity
.
projectId
;
$scope
.
parentData
.
projectId
=
row
.
entity
.
projectId
;
$scope
.
parentData
.
projectName
=
row
.
entity
.
projectName
;
$scope
.
parentData
.
projectName
=
row
.
entity
.
projectName
;
...
@@ -50,8 +47,11 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -50,8 +47,11 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope
.
deleteRole
(
row
);
$scope
.
deleteRole
(
row
);
else
if
(
action
==
"View"
)
else
if
(
action
==
"View"
)
$scope
.
viewTeamDetails
(
action
,
$scope
.
parentData
);
$scope
.
viewTeamDetails
(
action
,
$scope
.
parentData
);
}
}
$scope
.
refreshPage
=
function
(){
$scope
.
refreshPage
=
function
(){
$scope
.
empSearchId
=
""
;
$scope
.
empSearchId
=
""
;
$scope
.
getProjects
();
$scope
.
getProjects
();
...
@@ -163,6 +163,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -163,6 +163,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
templateUrl
:
'templates/projectTeamDetails.html'
,
templateUrl
:
'templates/projectTeamDetails.html'
,
parent
:
angular
.
element
(
document
.
body
),
parent
:
angular
.
element
(
document
.
body
),
clickOutsideToClose
:
true
,
clickOutsideToClose
:
true
,
preserveScope
:
true
,
locals
:{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
managers
:
$scope
.
managers
},
locals
:{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
managers
:
$scope
.
managers
},
})
})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
...
@@ -172,6 +173,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -172,6 +173,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
else
showAlert
(
'Manager assigning/updation failed!!!'
);
else
showAlert
(
'Manager assigning/updation failed!!!'
);
});
});
};
};
$scope
.
getUnAssignedEmployees
=
function
(
action
,
userData
){
$scope
.
getUnAssignedEmployees
=
function
(
action
,
userData
){
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
userData
.
action
=
action
;
userData
.
action
=
action
;
...
@@ -197,9 +199,10 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -197,9 +199,10 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
templateUrl
:
'templates/projectAssignedDetails.html'
,
templateUrl
:
'templates/projectAssignedDetails.html'
,
parent
:
angular
.
element
(
document
.
body
),
parent
:
angular
.
element
(
document
.
body
),
clickOutsideToClose
:
true
,
clickOutsideToClose
:
true
,
locals
:{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
managers
:
$scope
.
managers
},
locals
:{
dataToPass
:
userData
,
gridOptionsData
:
$scope
.
gridOptions
.
data
,
managers
:
$scope
.
managers
,
employees
:
$scope
.
employees
},
})
})
.
then
(
function
(
result
)
{
.
then
(
function
(
result
)
{
console
.
log
(
"result"
,
result
);
if
(
result
==
"Assign"
)
showAlert
(
'Manager assigned successfully'
);
if
(
result
==
"Assign"
)
showAlert
(
'Manager assigned successfully'
);
else
if
(
result
==
"Update"
)
showAlert
(
'Manager updated successfully'
);
else
if
(
result
==
"Update"
)
showAlert
(
'Manager updated successfully'
);
else
if
(
result
==
"Cancelled"
)
console
.
log
(
result
);
else
if
(
result
==
"Cancelled"
)
console
.
log
(
result
);
...
@@ -209,7 +212,6 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -209,7 +212,6 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
$scope
.
cancel
=
function
()
{
$scope
.
cancel
=
function
()
{
$mdDialog
.
hide
();
$mdDialog
.
hide
();
};
};
$scope
.
deleteRole
=
function
(
row
){
$scope
.
deleteRole
=
function
(
row
){
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
$
(
'#home'
).
addClass
(
'md-scroll-mask'
);
var
confirm
=
$mdDialog
.
confirm
()
var
confirm
=
$mdDialog
.
confirm
()
...
@@ -249,15 +251,65 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -249,15 +251,65 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
}
}
function
AddProjectController
(
$scope
,
$mdDialog
,
dataToPass
,
gridOptionsData
,
managers
,
$window
,
$mdSelect
)
{
function
AddProjectController
(
$scope
,
$mdDialog
,
dataToPass
,
gridOptionsData
,
managers
)
{
$scope
.
templateTitle
=
dataToPass
.
action
;
$scope
.
templateTitle
=
dataToPass
.
action
;
$scope
.
alertMsg
=
""
;
$scope
.
alertMsg
=
""
;
$scope
.
isDisabled
=
false
;
$scope
.
isDisabled
=
false
;
$scope
.
result
=
""
;
$scope
.
result
=
""
;
$scope
.
managerDetails
=
managers
;
$scope
.
managerDetails
=
managers
;
$scope
.
employee
;
$scope
.
projectModel
;
$scope
.
isSecondTab
=
false
;
$scope
.
prjctStses
=
[
"Active"
,
"Completed"
,
"On Hold"
,
"Proposed"
];
$scope
.
prjctStses
=
[
"Active"
,
"Completed"
,
"On Hold"
,
"Proposed"
];
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"Reserved"
];
$scope
.
accounts
=
myFactory
.
getAccounts
();
$scope
.
accounts
=
myFactory
.
getAccounts
();
$scope
.
selectedTab
=
0
;
$scope
.
addTab
=
function
()
{
if
(
$scope
.
isSecondTab
===
false
){
$scope
.
templateTitle
=
"Add"
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"visible"
;
$scope
.
isSecondTab
=
true
;
$scope
.
selectedTab
=
1
;
}
};
var
removeTab
=
function
(
action
)
{
if
(
action
==
"Add"
){
if
(
$scope
.
isSecondTab
===
true
){
$
(
'.md-select-value'
)[
0
].
childNodes
[
0
].
innerHTML
=
null
$
(
'.md-select-value'
)[
1
].
childNodes
[
0
].
innerHTML
=
null
$
(
'.md-datepicker-input'
)[
0
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
1
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
2
].
value
=
null
;
$scope
.
employeeModel
=
{};
}
}
$scope
.
selectedTab
=
0
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"hidden"
;
$scope
.
isSecondTab
=
!
$scope
.
isSecondTab
;
};
$window
.
addEventListener
(
'click'
,
function
(
e
){
$mdSelect
.
hide
();
})
$scope
.
getEmployeeDetails
=
function
(){
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"projectTeam/getEmployeesToTeam"
}).
then
(
function
mySuccess
(
response
)
{
$scope
.
employeeList
=
response
.
data
;
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
};
if
(
dataToPass
.
action
==
"Assign"
){
if
(
dataToPass
.
action
==
"Assign"
){
$scope
.
projectId
=
""
;
$scope
.
projectId
=
""
;
$scope
.
projectName
=
""
;
$scope
.
projectName
=
""
;
...
@@ -284,12 +336,27 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -284,12 +336,27 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
};
};
$scope
.
managerDetails
=
managers
;
$scope
.
managerDetails
=
managers
;
$scope
.
isDisabled
=
true
;
$scope
.
isDisabled
=
true
;
}
else
if
(
dataToPass
.
action
==
"View"
){
}
else
if
(
dataToPass
.
action
==
"View"
){
$scope
.
projectId
=
dataToPass
.
projectId
;
$scope
.
projectId
=
dataToPass
.
projectId
;
$scope
.
account
=
dataToPass
.
account
;
$scope
.
projectName
=
dataToPass
.
projectName
;
$scope
.
projectName
=
dataToPass
.
projectName
;
$scope
.
managerId
=
dataToPass
.
managerId
;
$scope
.
managerId
=
dataToPass
.
managerId
;
$scope
.
managerName
=
dataToPass
.
managerName
;
$scope
.
managerName
=
dataToPass
.
managerName
;
$scope
.
projectStatus
=
dataToPass
.
status
;
$scope
.
projectStatus
=
dataToPass
.
status
;
$scope
.
domain
=
dataToPass
.
domain
;
$scope
.
managerModel
=
{
'employeeName'
:
dataToPass
.
managerName
,
'employeeId'
:
dataToPass
.
managerId
};
$scope
.
projectModel
=
{
'projectName'
:
dataToPass
.
projectName
,
'projectId'
:
dataToPass
.
projectId
};
var
employeeModel
=
$scope
.
employeeModel
;
var
getCellActiveTemplate
=
'<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>'
;
var
getCellActiveTemplate
=
'<div ng-show="COL_FIELD==true"><p class="col-lg-12">Y</P></div><div ng-show="COL_FIELD==false"><p class="col-lg-12">N</p></div>'
;
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
...
@@ -316,6 +383,13 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -316,6 +383,13 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
showAlert
(
"Something went wrong while fetching data!!!"
);
showAlert
(
"Something went wrong while fetching data!!!"
);
$scope
.
gridOptions
.
data
=
[];
$scope
.
gridOptions
.
data
=
[];
});
});
document
.
addEventListener
(
"DOMSubtreeModified"
,
function
(
e
)
{
if
(
document
.
getElementsByClassName
(
"md-tab"
)[
1
]
&&
(
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
===
""
)){
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"hidden"
;
}
},
false
);
}
else
if
(
dataToPass
.
action
==
"UnAssigned"
){
}
else
if
(
dataToPass
.
action
==
"UnAssigned"
){
$scope
.
gridOptions
=
{
$scope
.
gridOptions
=
{
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
paginationPageSizes
:
[
10
,
20
,
30
,
40
,
50
,
100
],
...
@@ -396,6 +470,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -396,6 +470,7 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
]
]
};
};
$scope
.
isDisabled
=
true
;
$scope
.
isDisabled
=
true
;
$http
({
$http
({
method
:
"GET"
,
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"/projectTeam/getProjectAllocations"
url
:
appConfig
.
appUri
+
"/projectTeam/getProjectAllocations"
...
@@ -489,11 +564,68 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -489,11 +564,68 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
return
false
;
return
false
;
}
}
$scope
.
validateFields
=
function
(){
$scope
.
currentBillabilityDateChange
=
function
(){
$scope
.
startDate
=
$scope
.
newBillingStartDate
;
}
$scope
.
validateFields
=
function
(
action
){
var
project
=
$scope
.
projectId
;
var
project
=
$scope
.
projectId
;
var
projectName
=
$scope
.
projectName
;
var
projectName
=
$scope
.
projectName
;
var
managerModel
=
$scope
.
managerModel
;
var
managerModel
=
$scope
.
managerModel
;
var
account
=
$scope
.
account
;
var
managerId
=
$scope
.
managerId
;
var
managerName
=
$scope
.
managerName
;
var
employeeModel
=
$scope
.
employeeModel
;
var
projectModel
=
$scope
.
projectModel
;
var
domain
=
$scope
.
domain
;
var
newBillingStartDate
=
$scope
.
newBillingStartDate
if
(
action
===
"Add"
){
if
(
employeeModel
==
undefined
){
$scope
.
alertMsg
=
"Please select a employee"
;
angular
.
element
(
document
.
getElementById
(
'selectEmp'
)).
focus
();
}
else
if
(
$scope
.
empBillableStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a billable status"
;
angular
.
element
(
document
.
getElementById
(
'empBillableStatus'
)).
focus
();
}
else
if
(
$scope
.
startDate
==
undefined
)
{
$scope
.
alertMsg
=
"Please select Start Date"
;
angular
.
element
(
document
.
getElementById
(
'startDate'
)).
focus
();
}
else
if
(
$scope
.
endDate
==
undefined
)
{
$scope
.
alertMsg
=
"Please select End Date"
;
angular
.
element
(
document
.
getElementById
(
'endDate'
)).
focus
();
}
else
if
(
$scope
.
newBillingStartDate
==
undefined
){
$scope
.
alertMsg
=
"Please select new Billing StartDate"
;
angular
.
element
(
document
.
getElementById
(
'newBillingStartDate'
)).
focus
();
}
else
if
(
$scope
.
newBillingStartDate
>
$scope
.
endDate
){
$scope
.
alertMsg
=
"Assignment End Date should be less than Current Billability Start Date "
;
}
else
if
(
employeeModel
!=
undefined
&&
projectModel
!=
undefined
&&
getExistingRecordProjectStatus
(
employeeModel
.
employeeId
,
projectModel
.
projectName
)){
$scope
.
alertMsg
=
"Employee is already assigned to the selected project"
;
return
false
;
}
else
{
$scope
.
alertMsg
=
""
;
var
record
=
{
"employeeId"
:
employeeModel
.
employeeId
,
"employeeName"
:
employeeModel
.
employeeName
,
"emailId"
:
employeeModel
.
emailId
,
"designation"
:
employeeModel
.
designation
,
"projectId"
:
project
,
"projectName"
:
projectName
,
"managerId"
:
managerId
,
"managerName"
:
managerName
,
"mobileNumber"
:
employeeModel
.
mobileNumber
,
"active"
:
true
,
"billableStatus"
:
$scope
.
empBillableStatus
,
"startDate"
:
$scope
.
startDate
,
"endDate"
:
$scope
.
endDate
,
"account"
:
account
,
"newBillingStartDate"
:
newBillingStartDate
};
addRecord
(
record
,
action
);
$timeout
(
function
(){
updateGrid
(
'Add'
,
record
);
removeTab
(
'Add'
);
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
'Employee Added'
,
ok
:
'ok'
}));
},
500
);
}
}
else
{
// if(project == ""){
// if(project == ""){
// $scope.alertMsg = "Project ID is mandatory";
// $scope.alertMsg = "Project ID is mandatory";
// document.getElementById('projectId').focus();
// document.getElementById('projectId').focus();
...
@@ -511,35 +643,93 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -511,35 +643,93 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
}
}
else
if
(
managerModel
==
undefined
){
else
if
(
managerModel
==
undefined
){
$scope
.
alertMsg
=
"Please select a manager"
;
$scope
.
alertMsg
=
"Please select a manager"
;
}
else
{
}
else
{
$scope
.
alertMsg
=
""
;
$scope
.
alertMsg
=
""
;
var
record
=
{
"projectId"
:
$scope
.
projectId
,
"projectName"
:
$scope
.
projectName
,
"managerId"
:
$scope
.
managerModel
.
employeeId
,
"managerName"
:
$scope
.
managerModel
.
employeeName
,
"status"
:
$scope
.
projectStatus
,
"account"
:
$scope
.
account
.
accountName
,
"domain"
:
$scope
.
domain
};
var
record
=
{
"projectId"
:
$scope
.
projectId
,
"projectName"
:
$scope
.
projectName
,
"managerId"
:
$scope
.
managerModel
.
employeeId
,
"managerName"
:
$scope
.
managerModel
.
employeeName
,
"status"
:
$scope
.
projectStatus
,
"account"
:
$scope
.
account
.
accountName
,
"domain"
:
$scope
.
domain
};
addOrUpdateProject
(
record
,
$scope
.
templateTitle
);
addOrUpdateProject
(
record
,
$scope
.
templateTitle
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
$timeout
(
function
(){
updateGrid
(
$scope
.
templateTitle
,
record
)},
500
);
}
}
}
};
$scope
.
cancelDialog
=
function
()
{
$mdDialog
.
hide
(
'Cancelled'
);
};
};
$scope
.
cancelTab
=
function
()
{
removeTab
(
"cancel"
);
};
$scope
.
cancel
=
function
()
{
$scope
.
cancel
=
function
()
{
$mdDialog
.
hide
(
'Cancelled'
);
$mdDialog
.
hide
(
'Cancelled'
);
};
};
$scope
.
getEmployeeSelected
=
function
(){
if
(
$scope
.
employeeModel
!==
undefined
)
{
$scope
.
employee
=
$scope
.
employeeModel
;
return
$scope
.
employeeModel
.
employeeName
;
}
else
{
return
"Please select a employee"
;
}
};
// $scope.getProjectSelected = function(){
// if ($scope.projectModel !== undefined) {
// $scope.project=$scope.projectModel;
// return $scope.projectModel.projectName;
// } else {
// return "Please select a project";
// }
// };
$scope
.
getSelectedBillableStatus
=
function
(){
if
(
$scope
.
empBillableStatus
!==
undefined
)
{
return
$scope
.
empBillableStatus
;
}
else
{
return
"Please select a billable status"
;
}
};
function
updateGrid
(
action
,
record
){
function
updateGrid
(
action
,
record
){
if
(
$scope
.
alertMsg
==
""
){
if
(
$scope
.
alertMsg
==
""
){
if
(
$scope
.
result
==
"Success"
){
if
(
$scope
.
result
==
"Success"
){
if
(
action
==
"Assign"
){
if
(
action
==
"Assign"
){
gridOptionsData
.
push
(
record
);
gridOptionsData
.
push
(
record
);
$mdDialog
.
hide
(
action
);
}
else
if
(
action
==
"Update"
){
}
else
if
(
action
==
"Update"
){
var
existingRecord
=
getRowEntity
(
$scope
.
projectId
);
var
existingRecord
=
getRowEntity
(
$scope
.
projectId
);
var
index
=
gridOptionsData
.
indexOf
(
existingRecord
);
var
index
=
gridOptionsData
.
indexOf
(
existingRecord
);
gridOptionsData
[
index
]
=
record
;
gridOptionsData
[
index
]
=
record
;
}
$mdDialog
.
hide
(
action
);
$mdDialog
.
hide
(
action
);
}
else
if
(
action
==
"Add"
){
$scope
.
gridOptions
.
data
.
push
(
record
);
}
// $mdDialog.hide(action);
}
else
{
}
else
{
$mdDialog
.
hide
(
"Error"
);
$mdDialog
.
hide
(
"Error"
);
}
}
}
}
}
}
function
addRecord
(
record
,
action
){
var
urlRequest
=
""
;
urlRequest
=
appConfig
.
appUri
+
"projectTeam/addEmployeeToTeam"
;
var
req
=
{
method
:
'POST'
,
url
:
urlRequest
,
headers
:
{
"Content-type"
:
"application/json"
},
data
:
record
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
$scope
.
objectId
=
response
.
data
.
id
;
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
});
}
function
addOrUpdateProject
(
record
,
action
){
function
addOrUpdateProject
(
record
,
action
){
...
@@ -572,5 +762,16 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
...
@@ -572,5 +762,16 @@ myApp.controller("projectController",function($scope, myFactory,exportUiGridServ
}
}
}
}
}
}
function
getExistingRecordProjectStatus
(
empId
,
projectName
){
for
(
var
i
=
0
;
i
<
$scope
.
gridOptions
.
data
.
length
;
i
++
){
var
record
=
$scope
.
gridOptions
.
data
[
i
];
if
(
record
.
employeeId
==
empId
){
if
(
record
.
active
==
true
&&
record
.
projectName
==
projectName
)
return
true
;
}
}
return
false
;
}
}
}
});
});
\ No newline at end of file
src/main/webapp/WEB-INF/css/default-styles.css
View file @
85e930bd
...
@@ -146,3 +146,12 @@ md-dialog{
...
@@ -146,3 +146,12 @@ md-dialog{
.md-select-menu-container
{
.md-select-menu-container
{
z-index
:
100
!important
;
z-index
:
100
!important
;
}
}
.md-dialog-custom-height
{
max-height
:
95%
!important
;
}
.md-content
{
height
:
1100px
!important
;
}
\ No newline at end of file
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
100644 → 100755
View file @
85e930bd
<md-dialog
aria-label=
"Team Details"
style=
"width:950px;height:auto;"
class=
"md-dialog-custom-height"
ng-init=
"getEmployeeDetails()"
>
<md-dialog
aria-label=
"Team Details"
style=
"width:950px;height:450px;"
>
<form
ng-cloak
name=
"myForm "
>
<form
ng-cloak
name=
"myForm"
>
<md-toolbar>
<md-toolbar>
<div
class=
"md-toolbar-tools"
<div
class=
"md-toolbar-tools "
style=
"background: cadetblue; "
>
style=
"background: cadetblue;"
>
<h2>
Team Details
</h2>
<h2>
Team Details
</h2>
<span
flex
></span>
<span
flex
></span>
<md-button
class=
"md-icon-button"
ng-click=
"cancel()"
>
<i
<md-button
class=
"md-icon-button "
ng-click=
"cancelDialog() "
>
class=
"fa fa-times fa-2x"
<i
class=
"fa fa-times fa-2x "
style=
"margin-top: 5px; font-size: 1.5em; float: left "
></i>
style=
"margin-top: 5px; font-size: 1.5em; float: left"
></i>
</md-button>
</md-button>
</div>
</div>
</md-toolbar>
</md-toolbar>
<section
layout=
"row"
style=
"background-color: #fafafa;padding-top: 40px;"
layout-sm=
"column"
layout-align=
"end end"
layout-wrap
>
<md-button
class=
"md-raised "
class=
"pull-right"
data-ng-click=
"addTab()"
style=
"width:120px;background: cadetblue;color:white; "
ng-show=
"!isSecondTab"
>
Add
</md-button>
</section>
<md-content
style=
"height:1100px !important"
>
<md-tabs
md-dynamic-height=
" "
md-border-bottom=
" "
md-selected=
"selectedTab"
>
<md-tab
label=
"Team Details "
>
<md-content
class=
"md-padding "
>
<md-dialog-content>
<md-dialog-content>
<div
class=
"md-dialog-content
"
>
<div
class=
"md-dialog-content
"
>
<div
class=
"form-group
"
>
<div
class=
"form-group
"
>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;
"
>
<div
class=
"row col-lg-12 "
style=
"margin-left: 0px;
"
>
<div
class=
"row col-lg-12 col-xs-12
"
>
<div
class=
"row col-lg-12 col-xs-12
"
>
<div
class=
"col-xs-6 text-center
"
>
<div
class=
"col-xs-6 text-center
"
>
<p>
<p>
<b>
Project Name:
</b>
{{projectName}}
<b>
Project Name:
</b>
{{projectName}}
</p>
</p>
</div>
</div>
<div
class=
"col-xs-6 text-center
"
>
<div
class=
"col-xs-6 text-center
"
>
<p>
<p>
<b>
Manager Name:
</b>
{{managerName}}
<b>
Manager Name:
</b>
{{managerName}}
</p>
</p>
...
@@ -31,17 +34,84 @@
...
@@ -31,17 +34,84 @@
</div>
</div>
<div
id=
"gridTest"
ui-grid=
"gridOptions"
ui-grid-pagination
<div
id=
"gridTest "
ui-grid=
"gridOptions "
ui-grid-pagination
style=
"width:99%;height:230px;margin-left:10px; "
>
style=
"width:99%;height:230px;margin-left:10px;"
>
<div
class=
"watermark "
ng-show=
"!gridOptions.data.length "
>
No data available
</div>
<div
class=
"watermark"
ng-show=
"!gridOptions.data.length"
>
No
data available
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</md-dialog-content>
</md-dialog-content>
</md-content>
</md-tab>
<md-tab
label=
"Add Team Mate"
id=
"tab2"
>
<md-content
class=
"md-padding "
>
<form
ng-cloak
name=
"myForm"
id=
"myForm"
>
<!-- <md-toolbar>
<div class="md-toolbar-tools " style="background: cadetblue; ">
<h2>Add Team Mate </h2>
<span flex></span>
<md-button class="md-icon-button " ng-click="cancel() ">
<i class="fa fa-times fa-2x " style="margin-top: 5px; font-size: 1.5em; float: left "></i>
</md-button>
</div>
</md-toolbar> -->
<div
class=
"md-dialog-content "
>
<div
class=
"form-group "
>
<div
class=
"row col-lg-12 "
style=
"margin-left: 0px; "
>
<div
class=
"row col-lg-12 col-xs-12 "
>
<div
class=
"col-xs-6 text-center "
>
<p>
<b>
Project Name:
</b>
{{projectName}}
</p>
</div>
<div
class=
"col-xs-6 text-center "
>
<p>
<b>
Manager Name:
</b>
{{managerName}}
</p>
</div>
</div>
<md-select
ng-model=
"employeeModel "
md-selected-text=
"getEmployeeSelected() "
id=
"selectEmp"
name=
"employeeModel"
>
<md-optgroup
label=
"Employee "
>
<md-option
ng-value=
"employee "
ng-repeat=
"employee in employeeList "
>
{{employee.employeeName}}
</md-option>
</md-optgroup>
</md-select>
<output>
Employee Name : {{employeeModel.employeeName}}
</output>
<output>
Employee Id : {{employeeModel.employeeId}}
</output>
<output>
Email Id : {{employeeModel.emailId}}
</output>
<output>
Role : {{employeeModel.role}}
</output>
<output>
Designation : {{employeeModel.designation}}
</output>
<md-select
ng-model=
"empBillableStatus "
md-selected-text=
"getSelectedBillableStatus() "
id=
"empBillableStatus"
name=
"empBillableStatus"
>
<md-optgroup
label=
"billable statuses "
>
<md-option
ng-value=
"billableStatus "
ng-repeat=
"billableStatus in billableStatuses "
>
{{billableStatus}}
</md-option>
</md-optgroup>
</md-select>
<div
ng-show=
"empBillableStatus"
>
<md-datepicker
ng-model=
"newBillingStartDate"
md-placeholder=
"newBillingStartDate "
id=
"newBillingStartDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
onkeydown=
"return false "
ng-change=
"currentBillabilityDateChange()"
name=
"newBillingStartDate"
></md-datepicker>
</div>
<md-dialog-actions
layout=
"row"
>
<md-button
class=
"md-raised"
ng-click=
"cancel()"
style=
"width:120px;background: cadetblue;color:white;"
>
<md-datepicker
ng-model=
"startDate "
md-placeholder=
"Start Date "
id=
"startDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
Close
</md-button>
</md-dialog-actions>
onkeydown=
"return false "
ng-disabled=
"newBillingStartDate"
name=
"startDate"
></md-datepicker>
</form>
</br>
<md-datepicker
ng-model=
"endDate "
md-placeholder=
"Projected End Date "
id=
"endDate "
md-min-date=
"minDate "
md-max-date=
"maxDate "
onkeydown=
"return false "
name=
"endDate"
></md-datepicker>
<div
role=
"alert "
>
<span
class=
"error "
style=
"color: red; "
>
{{alertMsg}}
</span>
</div>
</div>
</div>
<md-dialog-actions
layout=
"row "
>
<md-button
class=
"md-raised "
data-ng-click=
"validateFields(templateTitle) "
style=
"width:120px;background: cadetblue;color:white; "
>
Add
</md-button>
<md-button
class=
"md-raised "
ng-click=
"cancelTab() "
style=
"width:120px;background: cadetblue;color:white; "
>
Cancel
</md-button>
</md-dialog-actions>
</form>
</md-content>
</md-tab>
</md-tabs>
</md-content>
</form>
</md-dialog>
</md-dialog>
\ No newline at end of file
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