ReadJSShifts now only for operators, minor correction

parent 664d0895
...@@ -98,6 +98,9 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -98,6 +98,9 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
breakStart, breakEnd = timePair breakStart, breakEnd = timePair
timeStartList.append(breakEnd) timeStartList.append(breakEnd)
timeEndList.insert(0, breakStart) timeEndList.insert(0, breakStart)
# sort the list before proceeding
timeEndList.sort()
timeStartList.sort()
#if it is the current row is an extended row for the information belonging to a resource, and no resource name is entered #if it is the current row is an extended row for the information belonging to a resource, and no resource name is entered
if line[0]: if line[0]:
entityID = line[0].split("-")[0] entityID = line[0].split("-")[0]
...@@ -142,7 +145,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -142,7 +145,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
#create default pattern for all operators (10 days long) #create default pattern for all operators (10 days long)
timeStartList = [] timeStartList = []
timeEndList = [] timeEndList = []
for dayNumber in range(0,10): for dayNumber in range(0,20):
startTime = "08:00" startTime = "08:00"
endTime = "18:00" endTime = "18:00"
upDate = now.date()+datetime.timedelta(days=dayNumber) upDate = now.date()+datetime.timedelta(days=dayNumber)
...@@ -167,6 +170,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin): ...@@ -167,6 +170,7 @@ class ReadJSShifts(plugin.InputPreparationPlugin, TimeSupportMixin):
# ================================================================ # ================================================================
for node, node_data in nodes.items(): for node, node_data in nodes.items():
if node_data.get('_class', None) == 'Dream.Operator':
modifiedDefaultDays = [] # the days of the defaultShiftPattern that have been modified according to the exceptionShiftPattern modifiedDefaultDays = [] # the days of the defaultShiftPattern that have been modified according to the exceptionShiftPattern
if node in exceptionShiftPattern: if node in exceptionShiftPattern:
for index1, exception in enumerate(exceptionShiftPattern[node]): for index1, exception in enumerate(exceptionShiftPattern[node]):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment