use of com.axelor.auth.db.User in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyPlannedDeliveries.
public void showClientMyPlannedDeliveries(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.getPlannedDeliveriesOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Planned deliveries")).model(StockMove.class.getName()).add("grid", "stock-move-grid").add("form", "stock-move-form").param("search-filters", "internal-stock-move-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.auth.db.User in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyTasksDue.
public void showClientMyTasksDue(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.getTasksDueOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Tasks due")).model(ProjectTask.class.getName()).add("grid", "project-task-grid").add("form", "project-task-form").param("search-filters", "project-task-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.auth.db.User in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyRefund.
public void showClientMyRefund(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.getRefundOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("My refund")).model(Invoice.class.getName()).add("grid", "invoice-refund-grid").add("form", "invoice-form").param("search-filters", "customer-refunds-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.auth.db.User in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyCompanyTickets.
public void showClientMyCompanyTickets(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.getCompanyTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Company 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.auth.db.User in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyResolvedTickets.
public void showClientMyResolvedTickets(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.getResolvedTicketsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Resolved 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