use of com.axelor.apps.portal.service.ClientViewService 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);
}
}
use of com.axelor.apps.portal.service.ClientViewService in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyNewTasks.
public void showClientMyNewTasks(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.getNewTasksOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("New tasks")).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.apps.portal.service.ClientViewService in project axelor-open-suite by axelor.
the class ClientViewController method showClientReversions.
public void showClientReversions(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.getReversionsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("My reversions")).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.apps.portal.service.ClientViewService in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyOverdueInvoices.
/* INVOICE OnClick */
public void showClientMyOverdueInvoices(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.getOverdueInvoicesOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Overdue invoices")).model(Invoice.class.getName()).add("grid", "invoice-grid").add("form", "invoice-form").param("search-filters", "customer-invoices-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.portal.service.ClientViewService in project axelor-open-suite by axelor.
the class ClientViewController method showClientMyTotalProjects.
/* PROJECT OnClick */
public void showClientMyTotalProjects(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.getTotalProjectsOfUser(clientUser).get(0);
if (filter != null) {
response.setView(ActionView.define(I18n.get("Total projects")).model(Project.class.getName()).add("grid", "project-grid").add("form", "project-form").param("search-filters", "project-filters").domain(filter.getQuery()).map());
}
}
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations