Search in sources :

Example 1 with AppService

use of com.axelor.apps.base.service.app.AppService in project axelor-open-suite by axelor.

the class AppMobileController method getAppMobile.

public void getAppMobile(ActionRequest request, ActionResponse response) {
    Map<String, Object> data = new HashMap<>();
    AppService appService = Beans.get(AppService.class);
    AppMobile appMobile = (AppMobile) appService.getApp("mobile");
    data.put("isAppMobileEnable", appMobile.getApp().getActive());
    data.put("isSaleAppEnable", appService.isApp("sale") ? appMobile.getIsSaleAppEnable() : false);
    data.put("isCrmAppEnable", appService.isApp("crm") ? appMobile.getIsCrmAppEnable() : false);
    data.put("isTimesheetAppEnable", appService.isApp("timesheet") ? appMobile.getIsTimesheetAppEnable() : false);
    data.put("isLeaveAppEnable", appService.isApp("leave") ? appMobile.getIsLeaveAppEnable() : false);
    data.put("isExpenseAppEnable", appService.isApp("expense") ? appMobile.getIsExpenseAppEnable() : false);
    data.put("isTaskAppEnable", appService.isApp("project") ? appMobile.getIsTaskAppEnable() : false);
    data.put("isQualityAppEnable", appService.isApp("quality") ? appMobile.getIsQualityAppEnable() : false);
    data.put("isStockAppEnable", appService.isApp("stock") ? appMobile.getIsStockAppEnable() : false);
    boolean isProductionAppEnable = appService.isApp("production") ? appMobile.getIsProductionAppEnable() : false;
    data.put("isProductionAppEnable", isProductionAppEnable);
    if (isProductionAppEnable) {
        data.put("mOFilterOnStockDetailStatusSelect", appMobile.getmOFilterOnStockDetailStatusSelect());
    }
    data.put("offlineRecordLimit", appMobile.getOfflineRecordLimit());
    data.put("partnerSet", convertToData(appMobile.getPartnerSet()));
    data.put("partnerContactSet", convertToData(appMobile.getPartnerContactSet()));
    data.put("projectSet", convertToData(appMobile.getProjectSet()));
    data.put("leadSet", convertToData(appMobile.getLeadSet()));
    data.put("productSet", convertToData(appMobile.getProductSet()));
    response.setData(data);
}
Also used : AppService(com.axelor.apps.base.service.app.AppService) HashMap(java.util.HashMap) AppMobile(com.axelor.apps.base.db.AppMobile)

Aggregations

AppMobile (com.axelor.apps.base.db.AppMobile)1 AppService (com.axelor.apps.base.service.app.AppService)1 HashMap (java.util.HashMap)1