<%@language = "javascript" %>
<% /*
     $Revision$
     $Id$
*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/selector.inc" -->

<%
FCLTHeader.Requires({ plugins: ["jQuery"],
                      js: [] });
var urole = getQParamSafe("urole");
var mld_key = getQParamInt('mld_key');
//var faq_question = unescape(getQParam("faq_question"));
//var faq_answer = unescape(getQParam("faq_answer"));
//var faq_perslid_key = getQParamInt("faq_perslid_key");

// De functie checkAutorisation(autfunction) geeft een Response.End indien er geen autorisatie voor autfunction wordt gevonden
//var authparams = user.checkAutorisation("WEB_MLDFOF");
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>

    <script type="text/javascript">
      function faq_save()
      {
           document.activeElement.blur(); // trigger laatste onChanges
           if (!validateForm("u2"))
               return false;
           document.faqform.submit();
      }

      function faq_cancel()
      {
          FcltMgr.closeDetail(window, { cancel: true } );
      }
    </script>
  </head>

  <body class="modal" id="mod_mldcontinue">
<%
    sql = "SELECT mld_melding_omschrijving"
        + "     , mld_melding_opmerking"
        + "  FROM mld_melding mm"
        + "     , mld_stdmelding std"
        + "     , mld_discipline md"
        + "     , ins_srtdiscipline sd"
        + " WHERE mld_melding_key = " + mld_key
        + "   AND mm.mld_stdmelding_key = std.mld_stdmelding_key"
        + "   AND std.mld_ins_discipline_key = md.ins_discipline_key"
        + "   AND md.ins_srtdiscipline_key = sd.ins_srtdiscipline_key";
    oRs = Oracle.Execute(sql);
    mld_omsc = oRs("mld_melding_omschrijving").value || "";
    mld_opmr = oRs("mld_melding_opmerking").value || "";
    oRs.close();
%>
    <form id="faqform" name="faqform" action="mld_2faq_save.asp?mld_key=<%=mld_key%>&urole=<%=urole%>" method="post">
<%
      BLOCK_START("mld2faq", "");
         RWTEXTAREATR("fac_question", "fldtxt required", L("lcl_faq_question"), String(mld_omsc).substring(0, 200), {html: "rows='6'"});
         RWTEXTAREATR("fac_answer", "fldtxt required", L("lcl_faq_answer"), mld_opmr, {html: "rows='6'"});
         var sql= "           SELECT 1, " + safe.quoted_sql(L("lcl_faq_level1")) + " FROM DUAL"
                + " UNION ALL SELECT 2, " + safe.quoted_sql(L("lcl_faq_level2")) + " FROM DUAL"
                + " UNION ALL SELECT 3, " + safe.quoted_sql(L("lcl_faq_level3")) + " FROM DUAL"

         FCLTselector("fac_level",
                      sql,
                      {label: L("lcl_faq_level")
                      }
                     );
         CHECKBOXTR(L("lcl_faq_stdmelding"), "", "fac_link", 1, {});
      BLOCK_END();

      var buttons =  [ {title: L("lcl_submit"), icon: "opslaan.png", action: "faq_save()" },
                       {title: L("lcl_cancel"), icon: "undo.png",    action: "faq_cancel()" } ];
      CreateButtons(buttons);
IFACE.FORM_END();
%>
    </form>
  </body>
</html>