use of com.axelor.apps.helpdesk.db.Ticket in project axelor-open-suite by axelor.
the class TicketController method stopTimer.
public void stopTimer(ActionRequest request, ActionResponse response) {
try {
Ticket ticket = request.getContext().asType(Ticket.class);
Beans.get(TimerTicketService.class).stop(ticket, Beans.get(AppBaseService.class).getTodayDateTime().toLocalDateTime());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.helpdesk.db.Ticket in project axelor-open-suite by axelor.
the class TicketController method cancelTimer.
public void cancelTimer(ActionRequest request, ActionResponse response) {
try {
Ticket ticket = request.getContext().asType(Ticket.class);
Beans.get(TimerTicketService.class).cancel(ticket);
response.setReload(true);
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.helpdesk.db.Ticket in project axelor-open-suite by axelor.
the class TicketController method computeTotalTimerDuration.
public void computeTotalTimerDuration(ActionRequest request, ActionResponse response) {
try {
Ticket ticket = request.getContext().asType(Ticket.class);
if (ticket.getId() != null) {
Duration duration = Beans.get(TimerTicketService.class).compute(ticket);
response.setValue("$_totalTimerDuration", duration.toMinutes() / 60F);
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.helpdesk.db.Ticket in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyCustomerTickets.
/* TICKETS OnClick */
public void showClientMyCustomerTickets(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Customer tickets")).model(Ticket.class.getName()).add("grid", "ticket-grid").add("form", "ticket-form").param("search-filters", "ticket-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.helpdesk.db.Ticket in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyLateTickets.
public void showClientMyLateTickets(ActionRequest request, ActionResponse response) {
try {
ClientViewService clientViewService = Beans.get(ClientViewService.class);
User clientUser = clientViewService.getClientUser();
if (clientUser.getPartner() == null) {
response.setError(I18n.get(ITranslation.CLIENT_PORTAL_NO_PARTNER));
} else {
Filter filter = clientViewService.getLateTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Late tickets")).model(Ticket.class.getName()).add("grid", "ticket-grid").add("form", "ticket-form").param("search-filters", "ticket-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations