use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskController method cancelTimer.
public void cancelTimer(ActionRequest request, ActionResponse response) {
try {
ProjectTask task = request.getContext().asType(ProjectTask.class);
Beans.get(TimerProjectTaskService.class).cancel(task);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskController method startTimer.
public void startTimer(ActionRequest request, ActionResponse response) {
try {
ProjectTask task = request.getContext().asType(ProjectTask.class);
Beans.get(TimerProjectTaskService.class).start(task, Beans.get(AppBaseService.class).getTodayDateTime().toLocalDateTime());
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskController method computeTotalTimerDuration.
public void computeTotalTimerDuration(ActionRequest request, ActionResponse response) {
try {
ProjectTask task = request.getContext().asType(ProjectTask.class);
if (task.getId() == null) {
return;
}
Duration duration = Beans.get(TimerProjectTaskService.class).compute(task);
response.setValue("$_totalTimerDuration", duration.toMinutes() / 60F);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskController method stopTimer.
public void stopTimer(ActionRequest request, ActionResponse response) {
try {
ProjectTask task = request.getContext().asType(ProjectTask.class);
Beans.get(TimerProjectTaskService.class).stop(task, Beans.get(AppBaseService.class).getTodayDateTime().toLocalDateTime());
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.project.db.ProjectTask in project axelor-open-suite by axelor.
the class ProjectTaskServiceImpl method removeNextTasks.
@Override
@Transactional
public void removeNextTasks(ProjectTask projectTask) {
List<ProjectTask> projectTaskList = getAllNextTasks(projectTask);
projectTask.setNextProjectTask(null);
projectTask.setHasDateOrFrequencyChanged(false);
projectTaskRepo.save(projectTask);
for (ProjectTask projectTaskToRemove : projectTaskList) {
projectTaskRepo.remove(projectTaskToRemove);
}
}
Aggregations