Example #1
0
  public ArrayList<SelectItem> getPublishedSelectActionList() {
    if (publishedActionList != null) {
      return publishedActionList;
    }

    ResourceLoader com =
        new ResourceLoader("org.sakaiproject.tool.assessment.bundle.CommonMessages");
    AuthorizationBean authorizationBean =
        (AuthorizationBean) ContextUtil.lookupBean("authorization");

    publishedActionList = new ArrayList<SelectItem>();
    boolean isEditAnyAssessment = authorizationBean.getEditAnyAssessment();
    boolean isEditOwnAssessment = authorizationBean.getEditOwnAssessment();

    if (isEditAnyAssessment || isEditOwnAssessment) {
      publishedActionList.add(new SelectItem("preview_published", com.getString("action_preview")));
      if (ServerConfigurationService.getBoolean("samigo.printAssessment", true)) {
        publishedActionList.add(new SelectItem("print_published", com.getString("action_print")));
      }
      publishedActionList.add(
          new SelectItem("settings_published", com.getString("settings_action")));
    }

    return publishedActionList;
  }
Example #2
0
  public ArrayList<SelectItem> getPendingSelectActionList2() {
    if (pendingActionList2 != null) {
      return pendingActionList2;
    }

    pendingActionList2 = new ArrayList<SelectItem>();
    ResourceLoader com =
        new ResourceLoader("org.sakaiproject.tool.assessment.bundle.CommonMessages");
    AuthorizationBean authorizationBean =
        (AuthorizationBean) ContextUtil.lookupBean("authorization");

    boolean isEditAnyAssessment = authorizationBean.getEditAnyAssessment();
    boolean isEditOwnAssessment = authorizationBean.getEditOwnAssessment();
    boolean isDeleteAnyAssessment = authorizationBean.getDeleteAnyAssessment();
    boolean isDeleteOwnAssessment = authorizationBean.getDeleteOwnAssessment();

    pendingActionList2.add(new SelectItem("select", com.getString("action_select")));
    if (isEditAnyAssessment || isEditOwnAssessment) {
      pendingActionList2.add(new SelectItem("edit_pending", com.getString("edit_action")));
      pendingActionList2.add(new SelectItem("preview_pending", com.getString("action_preview")));
      if (ServerConfigurationService.getBoolean("samigo.printAssessment", true)) {
        pendingActionList2.add(new SelectItem("print_pending", com.getString("action_print")));
      }
      pendingActionList2.add(new SelectItem("settings_pending", com.getString("settings_action")));
      pendingActionList2.add(new SelectItem("duplicate", com.getString("action_duplicate")));
      pendingActionList2.add(new SelectItem("export", com.getString("export_action")));
    }
    if (isDeleteAnyAssessment || isDeleteOwnAssessment) {
      pendingActionList2.add(new SelectItem("remove_pending", com.getString("remove_action")));
    }
    return pendingActionList2;
  }