Search in sources :

Example 1 with TSTimer

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());
}
Also used : TSTimer(com.axelor.apps.hr.db.TSTimer) TimesheetTimerService(com.axelor.apps.hr.service.timesheet.timer.TimesheetTimerService) ActionViewBuilder(com.axelor.meta.schema.actions.ActionView.ActionViewBuilder)

Example 2 with TSTimer

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);
    }
}
Also used : TSTimer(com.axelor.apps.hr.db.TSTimer) TimesheetTimerService(com.axelor.apps.hr.service.timesheet.timer.TimesheetTimerService) TSTimerRepository(com.axelor.apps.hr.db.repo.TSTimerRepository)

Example 3 with TSTimer

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);
    }
}
Also used : TSTimer(com.axelor.apps.hr.db.TSTimer) TimesheetTimerService(com.axelor.apps.hr.service.timesheet.timer.TimesheetTimerService) TSTimerRepository(com.axelor.apps.hr.db.repo.TSTimerRepository)

Aggregations

TSTimer (com.axelor.apps.hr.db.TSTimer)3 TimesheetTimerService (com.axelor.apps.hr.service.timesheet.timer.TimesheetTimerService)3 TSTimerRepository (com.axelor.apps.hr.db.repo.TSTimerRepository)2 ActionViewBuilder (com.axelor.meta.schema.actions.ActionView.ActionViewBuilder)1