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
c6881717
Commit
c6881717
authored
Jun 21, 2019
by
Prayas Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Reserved and proposed Functionality
parent
3e359ddb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
58 deletions
+90
-58
DashboardController.js
src/main/webapp/WEB-INF/controllers/DashboardController.js
+17
-10
ProjectController.js
src/main/webapp/WEB-INF/controllers/ProjectController.js
+59
-34
employeeDetails.html
src/main/webapp/WEB-INF/templates/employeeDetails.html
+2
-2
projectTeamDetails.html
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
+12
-12
No files found.
src/main/webapp/WEB-INF/controllers/DashboardController.js
View file @
c6881717
...
...
@@ -231,7 +231,6 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
{
field
:
'projectStartDate'
,
displayName
:
'Start Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
minWidth
:
100
,
width
:
150
},
{
field
:
'projectEndDate'
,
displayName
:
'End Date'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
minWidth
:
100
,
width
:
150
},
{
field
:
'projectStatus'
,
displayName
:
'Status'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
}
]
};
...
...
@@ -281,26 +280,30 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
columnDefs
:
[
{
field
:
'projectName'
,
displayName
:
'Project'
,
enableColumnMenu
:
true
,
enableSorting
:
true
,
minWidth
:
100
,
width
:
150
},
{
field
:
'accountName'
,
displayName
:
'Account'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
},
{
field
:
'billingStartDate'
,
displayName
:
'Start Date'
,
{
field
:
'billingStartDate'
,
displayName
:
'
Billing
Start Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
minWidth
:
100
,
width
:
150
},
{
field
:
'billingEndDate'
,
displayName
:
'End Date'
,
displayName
:
'
Billing
End Date'
,
cellFilter
:
'date:"dd-MMM-yyyy"'
,
minWidth
:
100
,
width
:
150
},
{
field
:
'
comments'
,
displayName
:
'Comment
s'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
},
{
field
:
'resource
Status'
,
displayName
:
'Status'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
enableCellEdit
:
false
,
minWidth
:
100
,
width
:
150
}
{
field
:
'
billableStatus'
,
displayName
:
'Billability Statu
s'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
},
{
field
:
'resource
Role'
,
displayName
:
'Role'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
},
{
field
:
'resourceStatus'
,
displayName
:
'Allocation Status'
,
enableColumnMenu
:
false
,
enableSorting
:
false
,
minWidth
:
100
,
width
:
150
}
]
};
$http
({
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"resources/billing?employeeId="
+
$scope
.
profile
.
employeeId
}).
then
(
function
mySuccess
(
response
)
{
//alert("response"+response);
// alert("response"+response.data);
$scope
.
gridOptionsEmpBillability
.
data
=
response
.
data
;
if
(
response
.
data
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
else
{
$scope
.
gridOptions
.
enablePaginationControls
=
false
;
}
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
...
...
@@ -308,9 +311,13 @@ myApp.controller("dashboardController", function($scope, $http, myFactory,export
method
:
"GET"
,
url
:
appConfig
.
appUri
+
"resources/getMyProjectAllocations?employeeId="
+
$scope
.
profile
.
employeeId
}).
then
(
function
mySuccess
(
response
)
{
//alert("response"+response);
// alert("response"+response.data);
$scope
.
gridOptionsProjectAllocatons
.
data
=
response
.
data
.
records
;
if
(
response
.
data
.
records
.
length
>
10
){
$scope
.
gridOptions
.
enablePaginationControls
=
true
;
}
else
{
$scope
.
gridOptions
.
enablePaginationControls
=
false
;
}
},
function
myError
(
response
)
{
showAlert
(
"Something went wrong while fetching data!!!"
);
});
...
...
src/main/webapp/WEB-INF/controllers/ProjectController.js
View file @
c6881717
...
...
@@ -82,6 +82,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
viewTeamDetails
(
action
,
$scope
.
parentData
);
}
$scope
.
refreshPage
=
function
()
{
...
...
@@ -403,9 +404,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
projectModel
;
$scope
.
isSecondTab
=
false
;
$scope
.
prjctStses
=
[
"Active"
,
"Completed"
,
"On Hold"
,
"Proposed"
];
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"
Reserved"
,
"
Trainee"
];
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"Trainee"
];
$scope
.
allocationStatuses
=
[
"Engaged"
,
"Proposed"
];
$scope
.
empAllocationStatus
=
'Engaged'
;
//
$scope.empAllocationStatus = 'Engaged';
$scope
.
employeeShifts
=
myFactory
.
getShifts
();
$scope
.
deliveryLeadIds
=
dataToPass
.
deliveryLeadIds
;
var
allAccounts
=
myFactory
.
getAccounts
();
...
...
@@ -458,6 +459,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
empBillableStatus
=
undefined
;
$scope
.
newBillingStartDate
=
undefined
;
$scope
.
employeeShift
=
undefined
;
$scope
.
empAllocationStatus
=
undefined
;
$scope
.
employeeModel
=
{};
$
(
'.md-datepicker-input'
)[
0
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
1
].
value
=
null
;
...
...
@@ -475,11 +477,12 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
};
var
removeTab
=
function
(
action
)
{
if
(
action
==
"Add"
){
if
(
$scope
.
isSecondTab
===
true
){
if
(
$scope
.
isSecondTab
===
true
){
$
(
'.md-select-value'
)[
0
].
childNodes
[
0
].
innerHTML
=
null
$
(
'.md-select-value'
)[
1
].
childNodes
[
0
].
innerHTML
=
null
$
(
'.md-select-value'
)[
2
].
childNodes
[
0
].
innerHTML
=
null
// $('.md-select-value')[3].childNodes[0].innerHTML = null
$
(
'.md-select-value'
)[
3
].
childNodes
[
0
].
innerHTML
=
null
$
(
'.md-datepicker-input'
)[
0
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
1
].
value
=
null
;
$
(
'.md-datepicker-input'
)[
2
].
value
=
null
;
...
...
@@ -487,6 +490,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
}
$scope
.
selectedTab
=
0
;
$scope
.
templateTitle
=
'View'
;
document
.
getElementsByClassName
(
"md-tab"
)[
1
].
style
.
visibility
=
"hidden"
;
document
.
getElementsByClassName
(
"md-tab"
)[
2
].
style
.
visibility
=
"hidden"
;
$scope
.
isSecondTab
=
!
$scope
.
isSecondTab
;
...
...
@@ -836,34 +840,40 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
}
$scope
.
changeAllocationStatusToEngaged
=
function
(
row
)
{
var
loginEmpId
=
myFactory
.
getEmpId
();
var
record
=
{
"id"
:
row
.
id
,
"employeeId"
:
row
.
employeeId
,
"projectId"
:
row
.
projectId
,
"billableStatus"
:
row
.
billableStatus
,
"billingEndDate"
:
row
.
billingEndDate
,
"resourceRole"
:
row
.
resourceRole
,
"billingStartDate"
:
row
.
billingStartDate
,
"status"
:
"Engaged"
};
var
urlRequest
=
appConfig
.
appUri
+
"resources?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'PUT'
,
url
:
urlRequest
,
headers
:
{
"Content-type"
:
"application/json"
},
data
:
record
if
(
row
.
billableStatus
==
"Reserved"
){
$scope
.
alertMsg
=
'Please Update Your Billability Status From Reserved and then Move to Engage'
;
}
else
{
$scope
.
alertMsg
=
''
;
var
loginEmpId
=
myFactory
.
getEmpId
();
var
record
=
{
"id"
:
row
.
id
,
"employeeId"
:
row
.
employeeId
,
"projectId"
:
row
.
projectId
,
"billableStatus"
:
row
.
billableStatus
,
"billingEndDate"
:
row
.
billingEndDate
,
"resourceRole"
:
row
.
resourceRole
,
"billingStartDate"
:
row
.
billingStartDate
,
"status"
:
"Engaged"
};
var
urlRequest
=
appConfig
.
appUri
+
"resources?loginEmpId="
+
loginEmpId
;
var
req
=
{
method
:
'PUT'
,
url
:
urlRequest
,
headers
:
{
"Content-type"
:
"application/json"
},
data
:
record
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
if
(
response
.
data
.
message
==
"Resource updated successfully"
){
$timeout
(
function
()
{
getProjectDetails
(
$scope
.
projectId
,
$scope
.
status
);
},
500
);
}
$http
(
req
).
then
(
function
mySuccess
(
response
)
{
$scope
.
result
=
"Success"
;
if
(
response
.
data
.
message
==
"Resource updated successfully"
){
$timeout
(
function
()
{
getProjectDetails
(
$scope
.
projectId
,
$scope
.
status
);
},
500
);
}
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
response
.
data
.
message
,
ok
:
'ok'
})).
then
(
function
()
{
$scope
.
myForm
.
$setPristine
();
})
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
});
$mdDialog
.
show
(
$mdDialog
.
alert
({
skipHide
:
true
,
textContent
:
response
.
data
.
message
,
ok
:
'ok'
})).
then
(
function
()
{
$scope
.
myForm
.
$setPristine
();
})
},
function
myError
(
response
){
$scope
.
result
=
"Error"
;
});
}
}
...
...
@@ -997,6 +1007,7 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
getTeamMates
=
function
(){
getProjectDetails
(
$scope
.
projectId
,
$scope
.
status
);
$scope
.
alertMsg
=
''
;
}
/* $scope.updateTeamMate = function(action, userData){
$scope.updateTab();
...
...
@@ -1186,6 +1197,16 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
endDate
=
new
Date
(
dataToPass
.
projectEndDate
);
$
(
'.md-datepicker-input'
)[
3
].
value
=
new
Date
(
dataToPass
.
projectEndDate
);
}
}
$scope
.
changeBillableStatusList
=
function
()
{
if
(
$scope
.
empAllocationStatus
==
'Proposed'
)
{
$scope
.
empBillableStatus
=
'Reserved'
;
$scope
.
billableStatuses
=
[
"Reserved"
];
}
else
if
(
$scope
.
empAllocationStatus
==
'Engaged'
){
$scope
.
empBillableStatus
=
null
;
//$scope.billableStatuses ;
$scope
.
billableStatuses
=
[
"Billable"
,
"Shadow"
,
"Non-Billable"
,
"Trainee"
];
}
}
/* $scope.getEditTeammate = function(selectedStatus) {
if(selectedStatus) {
...
...
@@ -1459,6 +1480,10 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
$scope
.
alertMsg
=
"Please select a employee role"
;
angular
.
element
(
document
.
getElementById
(
'empRole'
)).
focus
();
}
else
if
(
action
===
"Add"
&&
$scope
.
empAllocationStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a employee Allocation Status"
;
angular
.
element
(
document
.
getElementById
(
'empAllocationStatus'
)).
focus
();
}
else
if
(
$scope
.
empBillableStatus
==
undefined
){
$scope
.
alertMsg
=
"Please select a billable status"
;
angular
.
element
(
document
.
getElementById
(
'empBillableStatus'
)).
focus
();
...
...
@@ -1482,9 +1507,9 @@ myApp.controller("projectController", function ($scope,uiGridConstants, myFactor
else
if
(
!
((
$scope
.
newBillingStartDate
>=
new
Date
(
dataToPass
.
projectStartDate
))
&&
(
$scope
.
newBillingStartDate
<=
$scope
.
endDate
))){
$scope
.
alertMsg
=
$scope
.
empBillableStatus
+
" start date should be in between project start date and end date"
;
}
else
if
(
!
((
$scope
.
newBillingStartDate
>=
$scope
.
parentData
.
newBillingStartDate
)
&&
(
$scope
.
newBillingStartDate
<=
$scope
.
endDate
))
&&
action
==
"Update"
){
$scope
.
alertMsg
=
$scope
.
empBillableStatus
+
" start date should be in between previous Billing start date and end date"
;
}
//
else if (!(($scope.newBillingStartDate >= $scope.parentData.newBillingStartDate) && ($scope.newBillingStartDate <= $scope.endDate)) && action == "Update"){
//
$scope.alertMsg = $scope.empBillableStatus + " start date should be in between previous Billing start date and end date";
//
}
else
if
(
$scope
.
endDate
>
new
Date
(
dataToPass
.
projectEndDate
)){
$scope
.
alertMsg
=
"End date should not exceed project end date"
;
}
...
...
src/main/webapp/WEB-INF/templates/employeeDetails.html
View file @
c6881717
...
...
@@ -195,7 +195,7 @@
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
id=
"gridProjectAllocatons"
ui-grid=
"gridOptionsProjectAllocatons"
class=
"myGrid"
style=
"width:
99
%;height:200px;"
ng-show=
"showProjectAllocations"
>
class=
"myGrid"
style=
"width:
85
%;height:200px;"
ng-show=
"showProjectAllocations"
>
<div
class=
"watermark"
ng-show=
"!gridOptionsProjectAllocatons.data.length"
>
No
data available
</div>
</div>
...
...
@@ -206,7 +206,7 @@
<legend
style=
"font-size: 18px;"
>
Billability Details
<i
style=
"margin-top:3px;color:blue;cursor:pointer;font-size: 14px;"
ng-click=
"toggleBillability()"
>
{{showOrHideBD}}
</i></legend>
<div
class=
"row col-lg-12"
style=
"margin-left: 0px;"
>
<div
id=
"gridEmpBillability"
ui-grid=
"gridOptionsEmpBillability"
class=
"myGrid"
style=
"width:
99
%;height:200px;"
ng-show=
"showBillable"
>
class=
"myGrid"
style=
"width:
85
%;height:200px;"
ng-show=
"showBillable"
>
<div
class=
"watermark"
ng-show=
"!gridOptionsEmpBillability.data.length"
>
No
data available
</div>
</div>
...
...
src/main/webapp/WEB-INF/templates/projectTeamDetails.html
View file @
c6881717
...
...
@@ -140,12 +140,22 @@
</md-select>
</td>
</tr> -->
<tr>
<tr>
<td
class=
"Employee"
>
Allocation Status
</td>
<td>
<md-select
ng-model=
"empAllocationStatus "
md-selected-text=
"getSelectedAllocationStatus()"
id=
"empAllocationStatus"
name=
"empAllocationStatus"
ng-change=
"changeBillableStatusList()"
>
<md-optgroup
label=
"allocation statuses "
>
<md-option
ng-value=
"allocationStatus "
ng-repeat=
"allocationStatus in allocationStatuses "
>
{{allocationStatus}}
</md-option>
</md-optgroup>
</md-select>
</td>
</tr>
<tr
ng-show=
"empAllocationStatus"
>
<td
class=
"Employee"
>
Billability Status
</td>
<td>
<md-select
ng-model=
"empBillableStatus "
md-selected-text=
"getSelectedBillableStatus() "
id=
"empBillableStatus"
name=
"empBillableStatus"
ng-change=
"changeEmpBillableStatus()"
>
<md-optgroup
label=
"billable statuses "
>
<md-option
ng-value=
"billableStatus "
ng-repeat=
"billableStatus in billableStatuses
"
>
{{billableStatus}}
</md-option>
<md-option
ng-value=
"billableStatus "
ng-repeat=
"billableStatus in billableStatuses"
>
{{billableStatus}}
</md-option>
</md-optgroup>
</md-select>
</td>
...
...
@@ -172,16 +182,6 @@
onkeydown=
"return false "
name=
"endDate"
></md-datepicker>
</td>
</tr>
<tr>
<td
class=
"Employee"
>
Allocation Status
</td>
<td>
<md-select
ng-model=
"empAllocationStatus "
md-selected-text=
"getSelectedAllocationStatus() "
id=
"empAllocationStatus"
name=
"empAllocationStatus"
>
<md-optgroup
label=
"allocation statuses "
>
<md-option
ng-value=
"allocationStatus "
ng-repeat=
"allocationStatus in allocationStatuses "
>
{{allocationStatus}}
</md-option>
</md-optgroup>
</md-select>
</td>
</tr>
</table>
<div
ng-if =
'templateTitle == "Add"'
role=
"alert"
>
...
...
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