|
|
@ -433,23 +433,23 @@ def mark_point_working_on(request, point_id, task_id):
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Working On'
|
|
|
|
point.status = 'Working On'
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
activity = PointActivity(
|
|
|
|
activity = PointActivity(
|
|
|
|
point = point,
|
|
|
|
point = point,
|
|
|
|
start_time = datetime.now(),
|
|
|
|
start_time = timezone.now(),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
activity.save()
|
|
|
|
activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
if PointActivity.objects.filter(point=point).count() == 1:
|
|
|
|
if PointActivity.objects.filter(point=point).count() == 1:
|
|
|
|
status_text = f'Started Working On: {point.text}'
|
|
|
|
status_text = f'Started Working On: {point.text}'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
status_text = f'Resumed Working On: {point.text}'
|
|
|
|
status_text = f'Resumed Working On: {point.text}'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -466,23 +466,23 @@ def mark_point_working_on_task_page(request, point_id, task_id):
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Working On'
|
|
|
|
point.status = 'Working On'
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
activity = PointActivity(
|
|
|
|
activity = PointActivity(
|
|
|
|
point = point,
|
|
|
|
point = point,
|
|
|
|
start_time = datetime.now(),
|
|
|
|
start_time = timezone.now(),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
activity.save()
|
|
|
|
activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
if PointActivity.objects.filter(point=point).count() == 1:
|
|
|
|
if PointActivity.objects.filter(point=point).count() == 1:
|
|
|
|
status_text = f'Started Working On: {point.text}'
|
|
|
|
status_text = f'Started Working On: {point.text}'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
status_text = f'Resumed Working On: {point.text}'
|
|
|
|
status_text = f'Resumed Working On: {point.text}'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -496,17 +496,17 @@ def mark_point_paused(request, point_id, task_id):
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Paused'
|
|
|
|
point.status = 'Paused'
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
if last_activity:
|
|
|
|
if last_activity:
|
|
|
|
last_activity.end_time = timezone.make_aware(current_datetime, timezone.get_current_timezone())
|
|
|
|
last_activity.end_time = current_datetime
|
|
|
|
last_activity.save()
|
|
|
|
last_activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
status_text = f'{point.text} - Paused'
|
|
|
|
status_text = f'{point.text} - Paused'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -522,17 +522,17 @@ def mark_point_paused_task_page(request, point_id, task_id):
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
task = get_object_or_404(Task, id=task_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Paused'
|
|
|
|
point.status = 'Paused'
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
if last_activity:
|
|
|
|
if last_activity:
|
|
|
|
last_activity.end_time = timezone.make_aware(current_datetime, timezone.get_current_timezone())
|
|
|
|
last_activity.end_time = current_datetime
|
|
|
|
last_activity.save()
|
|
|
|
last_activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
status_text = f'{point.text} - Paused'
|
|
|
|
status_text = f'{point.text} - Paused'
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -545,14 +545,14 @@ def mark_point_completed(request, point_id, task_id):
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Completed'
|
|
|
|
point.status = 'Completed'
|
|
|
|
|
|
|
|
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
# Update the end time of the last activity to the current time
|
|
|
|
# Update the end time of the last activity to the current time
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
if last_activity:
|
|
|
|
if last_activity:
|
|
|
|
last_activity.end_time = timezone.make_aware(current_datetime, timezone.get_current_timezone())
|
|
|
|
last_activity.end_time = current_datetime
|
|
|
|
last_activity.save()
|
|
|
|
last_activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -570,7 +570,7 @@ def mark_point_completed(request, point_id, task_id):
|
|
|
|
if formatted_time:
|
|
|
|
if formatted_time:
|
|
|
|
status_text += f' in {formatted_time}'
|
|
|
|
status_text += f' in {formatted_time}'
|
|
|
|
|
|
|
|
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
task_id_str = task.task_id
|
|
|
|
task_id_str = task.task_id
|
|
|
@ -586,14 +586,14 @@ def mark_point_completed_task_page(request, point_id, task_id):
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point = get_object_or_404(Point, id=point_id)
|
|
|
|
point.status = 'Completed'
|
|
|
|
point.status = 'Completed'
|
|
|
|
|
|
|
|
|
|
|
|
current_datetime = datetime.now()
|
|
|
|
current_datetime = timezone.now()
|
|
|
|
|
|
|
|
|
|
|
|
point.save()
|
|
|
|
point.save()
|
|
|
|
|
|
|
|
|
|
|
|
# Update the end time of the last activity to the current time
|
|
|
|
# Update the end time of the last activity to the current time
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
last_activity = PointActivity.objects.filter(point=point).last()
|
|
|
|
if last_activity:
|
|
|
|
if last_activity:
|
|
|
|
last_activity.end_time = timezone.make_aware(current_datetime, timezone.get_current_timezone())
|
|
|
|
last_activity.end_time = current_datetime
|
|
|
|
last_activity.save()
|
|
|
|
last_activity.save()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -611,7 +611,7 @@ def mark_point_completed_task_page(request, point_id, task_id):
|
|
|
|
if formatted_time:
|
|
|
|
if formatted_time:
|
|
|
|
status_text += f' in {formatted_time}'
|
|
|
|
status_text += f' in {formatted_time}'
|
|
|
|
|
|
|
|
|
|
|
|
status = Status(text=status_text, date=current_datetime.date(), time=current_datetime.strftime("%I:%M %p"), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status = Status(text=status_text, date_time=timezone.now(), staff=request.user.staffprofile, task=point.task)
|
|
|
|
status.save()
|
|
|
|
status.save()
|
|
|
|
|
|
|
|
|
|
|
|
return redirect('detailed-task', task_id=task.task_id)
|
|
|
|
return redirect('detailed-task', task_id=task.task_id)
|
|
|
|