Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-gantt-editor
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
project-open
intranet-gantt-editor
Commits
02c86c6a
Commit
02c86c6a
authored
Sep 08, 2020
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Finished forward scheduling using faked Resource Calendar
parent
860ccc21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
33 deletions
+13
-33
GanttSchedulingController.js
www/controller/GanttSchedulingController.js
+13
-33
No files found.
www/controller/GanttSchedulingController.js
View file @
02c86c6a
...
...
@@ -333,9 +333,7 @@ Ext.define('GanttEditor.controller.GanttSchedulingController', {
// Calculate the percent assigned in total
var
assignedPercent
=
0.0
assignees
.
forEach
(
function
(
assig
)
{
assignedPercent
=
assignedPercent
+
assig
.
percent
});
assignees
.
forEach
(
function
(
assig
)
{
assignedPercent
=
assignedPercent
+
assig
.
percent
});
// Check what time
var
startDate
=
new
Date
(
timeMoment
);
...
...
@@ -428,9 +426,8 @@ Ext.define('GanttEditor.controller.GanttSchedulingController', {
if
(
newEndTime
==
previousEndTime
)
return
false
;
// skip if no change
// Write the newEndDate into model
newEndDate
=
new
Date
(
newEndTime
);
var
newEndDate
=
new
Date
(
newEndTime
);
var
newEndDateString
=
PO
.
Utilities
.
dateToPg
(
newEndDate
);
// newEndDateString = newEndDateString.substring(0,10) + ' 23 :59:59';
newEndDateString
=
newEndDateString
.
substring
(
0
,
19
);
if
(
me
.
debug
)
console
.
log
(
'PO.controller.gantt_editor.GanttSchedulingController.checkTaskLength: end_date='
+
newEndDateString
);
model
.
set
(
'end_date'
,
newEndDateString
);
...
...
@@ -897,42 +894,25 @@ Ext.define('GanttEditor.controller.GanttSchedulingController', {
var
previousEndTime
=
previousEndDate
.
getTime
();
var
assignees
=
model
.
get
(
'assignees'
);
var
plannedUnits
=
model
.
get
(
'planned_units'
);
if
(
0
==
plannedUnits
)
{
return
[];
}
// No units - no duration...
if
(
0
==
plannedUnits
)
{
return
[];
}
// No units - no duration...
if
(
!
plannedUnits
)
{
return
[];
}
// No units - no duration...
// Calculate the percent assigned in total
var
assignedPercent
=
0.0
assignees
.
forEach
(
function
(
assig
)
{
assignedPercent
=
assignedPercent
+
assig
.
percent
});
assignees
.
forEach
(
function
(
assig
)
{
assignedPercent
=
assignedPercent
+
assig
.
percent
});
if
(
0
==
assignedPercent
)
{
return
[];
}
// No assignments - "manually scheduled" task
var
durationHours
=
plannedUnits
*
100.0
/
assignedPercent
;
// Calculate the duration of the task in hours
// Adjust the time period, so that the effective hours >= durationHours
var
startTime
=
previousStartDate
.
getTime
();
var
endTime
=
startTime
;
var
hours
=
0.0
;
//
while
(
hours
<
durationHours
)
{
var
day
=
new
Date
(
endTime
);
var
dayOfWeek
=
day
.
getDay
();
if
(
dayOfWeek
==
6
||
dayOfWeek
==
0
)
{
// Weekend - just skip the day
}
else
{
hours
=
hours
+
8
;
// Weekday - add hours
}
endTime
=
endTime
+
1000
*
3600
*
24
;
}
endTime
=
endTime
-
1000
*
3600
*
24
;
// ]po[ sematics: zero time => 1 day
// Calculate the new endDate
var
newEndTime
=
me
.
taskForwardDuration
(
treeStore
,
model
);
if
(
newEndTime
==
previousEndTime
)
return
[];
// skip if no change
if
(
endTime
==
previousEndTime
)
return
[];
// skip if no change
// Write the newEndDate into model
var
newEndDate
=
new
Date
(
newEndTime
);
var
newEndDateString
=
PO
.
Utilities
.
dateToPg
(
newEndDate
);
newEndDateString
=
newEndDateString
.
substring
(
0
,
19
);
if
(
me
.
debug
)
console
.
log
(
'PO.controller.gantt_editor.GanttSchedulingController.scheduleTaskDuration: end_date='
+
newEndDateString
);
model
.
set
(
'end_date'
,
newEndDateString
);
// Write the new endDate into model
endDate
=
new
Date
(
endTime
);
endDateString
=
PO
.
Utilities
.
dateToPg
(
endDate
);
endDateString
=
endDateString
.
substring
(
0
,
10
)
+
' 23:59:59'
;
if
(
me
.
debug
)
console
.
log
(
'PO.controller.gantt_editor.GanttSchedulingController.scheduleTaskDuration: end_date='
+
endDateString
);
model
.
set
(
'end_date'
,
endDateString
);
if
(
me
.
debug
>
1
)
console
.
log
(
'PO.controller.gantt_editor.GanttSchedulingController.scheduleTaskDuration: Finished'
);
return
[
model
];
...
...
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