/**
   * Show Dependencies if any before deleting Survey
   *
   * @param context Description of the Parameter
   * @return Description of the Return Value
   */
  public String executeCommandConfirmDelete(ActionContext context) {
    Exception errorMessage = null;
    Connection db = null;
    Survey thisSurvey = null;

    HtmlDialog htmlDialog = new HtmlDialog();
    String id = null;

    if (!(hasPermission(context, "campaign-campaigns-surveys-delete"))) {
      return ("PermissionError");
    }

    if (context.getRequest().getParameter("id") != null) {
      id = context.getRequest().getParameter("id");
    }

    try {
      db = this.getConnection(context);
      SystemStatus systemStatus = this.getSystemStatus(context);
      thisSurvey = new Survey(db, id);
      if (!hasAuthority(context, thisSurvey.getEnteredBy())) {
        return ("PermissionError");
      }

      DependencyList dependencies = thisSurvey.processDependencies(db);
      dependencies.setSystemStatus(systemStatus);
      htmlDialog.addMessage(
          systemStatus.getLabel("confirmdelete.caution") + "\n" + dependencies.getHtmlString());
      htmlDialog.setTitle(systemStatus.getLabel("confirmdelete.title"));

      if (dependencies.size() == 0) {
        htmlDialog.setShowAndConfirm(false);
        htmlDialog.setDeleteUrl(
            "javascript:window.location.href='CampaignManagerSurvey.do?command=Delete&id="
                + id
                + "'");
      } else {
        htmlDialog.setHeader(systemStatus.getLabel("confirmdelete.surveyCampaignHeader"));
        htmlDialog.addButton(
            systemStatus.getLabel("button.ok"), "javascript:parent.window.close()");
      }

    } catch (Exception e) {
      errorMessage = e;
    } finally {
      this.freeConnection(context, db);
    }
    if (errorMessage == null) {
      context.getSession().setAttribute("Dialog", htmlDialog);
      return ("ConfirmDeleteOK");
    } else {
      context.getRequest().setAttribute("Error", errorMessage);
      return ("SystemError");
    }
  }
 /**
  * Description of the Method
  *
  * @param context Description of the Parameter
  * @return Description of the Return Value
  */
 public String executeCommandConfirmDelete(ActionContext context) {
   if (!(hasPermission(context, "tickets-tickets-tasks-delete"))) {
     return ("PermissionError");
   }
   Connection db = null;
   Task thisTask = null;
   HtmlDialog htmlDialog = new HtmlDialog();
   String id = context.getRequest().getParameter("id");
   String sourcePopup = context.getRequest().getParameter("sourcePopup");
   try {
     db = this.getConnection(context);
     SystemStatus systemStatus = this.getSystemStatus(context);
     thisTask = new Task(db, Integer.parseInt(id));
     htmlDialog.setTitle(systemStatus.getLabel("confirmdelete.title"));
     if (!hasAuthority(context, thisTask.getOwner())) {
       htmlDialog.setHeader(systemStatus.getLabel("confirmdelete.taskNotOwnerHeader"));
       htmlDialog.addButton(
           systemStatus.getLabel("button.ok"), "javascript:parent.window.close()");
     } else {
       DependencyList dependencies = thisTask.processDependencies(db);
       htmlDialog.addMessage(
           systemStatus.getLabel("confirmdelete.caution") + "\n" + dependencies.getHtmlString());
       if (dependencies.size() == 0) {
         htmlDialog.setShowAndConfirm(false);
         htmlDialog.setDeleteUrl(
             "javascript:window.location.href='TroubleTicketTasks.do?command=Delete&id="
                 + id
                 + "&sourcePopup="
                 + sourcePopup
                 + "'");
       } else {
         htmlDialog.setHeader(systemStatus.getLabel("confirmdelete.header"));
         htmlDialog.addButton(
             systemStatus.getLabel("button.delete"),
             "javascript:window.location.href='TroubleTicketTasks.do?command=Delete&id="
                 + id
                 + "&sourcePopup="
                 + sourcePopup
                 + "'");
         htmlDialog.addButton(
             systemStatus.getLabel("button.cancel"), "javascript:parent.window.close()");
       }
     }
   } catch (Exception e) {
     context.getRequest().setAttribute("Error", e);
     return ("SystemError");
   } finally {
     this.freeConnection(context, db);
   }
   context.getSession().setAttribute("Dialog", htmlDialog);
   return ("ConfirmDeleteOK");
 }