use of com.axelor.apps.hr.db.TSTimer in project axelor-open-suite by axelor.
the class TSTimerController method editTimesheetTimerFromTimesheet.
public void editTimesheetTimerFromTimesheet(ActionRequest request, ActionResponse response) {
ActionViewBuilder actionView = ActionView.define(I18n.get("TSTimer")).model(TSTimer.class.getName()).add("form", "ts-timer-form").param("popup", "reload").param("forceEdit", "true").param("width", "800").param("show-confirm", "true").param("show-toolbar", "false").param("popup-save", "true");
TSTimer tsTimer = Beans.get(TimesheetTimerService.class).getCurrentTSTimer();
if (tsTimer != null) {
actionView.context("_showRecord", String.valueOf(tsTimer.getId()));
}
response.setView(actionView.map());
}
use of com.axelor.apps.hr.db.TSTimer in project axelor-open-suite by axelor.
the class TSTimerController method stop.
public void stop(ActionRequest request, ActionResponse response) {
try {
TSTimer timerView = request.getContext().asType(TSTimer.class);
TSTimer timer = Beans.get(TSTimerRepository.class).find(timerView.getId());
Beans.get(TimesheetTimerService.class).stop(timer);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.hr.db.TSTimer in project axelor-open-suite by axelor.
the class TSTimerController method pause.
public void pause(ActionRequest request, ActionResponse response) {
try {
TSTimer timerView = request.getContext().asType(TSTimer.class);
TSTimer timer = Beans.get(TSTimerRepository.class).find(timerView.getId());
Beans.get(TimesheetTimerService.class).pause(timer);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations