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

     File:               loadPrioriteit.asp
     Description:        Maak prioriteit selectbox
     Parameters:
        stdm_key:        van deze standaardmelding
        mprio:           De default
        readonly:        Maak hem readonly
     Context:
     Note:
*/ %>

<%
DOCTYPE_Disable = true;
%>

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

<%
// Maak een prioriteit selector lijst
var stdm_key = getQParamInt("stdm_key"); // default
var mprio = getQParamInt("mprio"); // default
var readonly = (getQParamInt("readonly", 0) == 1);

var data = mld.mld_stdmeldinginfo(stdm_key);

var sql = "";
var union = "";
for (var i in data.prioriteiten)
{
  var priotxt = data.prioriteiten[i].text;
  if (__Logging > 0)
  {
    priotxt += " **";
    if (data.prioriteiten[i].eenheid == 'D')
        priotxt += data.prioriteiten[i].uitvoertijd + " " + L("lcl_mld_days");
    else
        priotxt += Math.round(data.prioriteiten[i].uitvoertijd*100000)/100000 + " " + L("lcl_mld_hours");
  }
  sql += union
       + " SELECT " + data.prioriteiten[i].key
       + ", " + safe.quoted_sql(priotxt)
       + " FROM DUAL";

  union = " UNION";
}

FCLTselector("prio",
             sql,
             { initKey: mprio,
               readonly: readonly,
               onChange: "onChangePrioriteit()"
             });
%>

<% ASPPAGE_END(); %> 
