<% /*
    $Revision$
    $Id$

    File:           model_mld_stdmelding_srtruimte.inc

    Description:

    Context:

    Notes:
*/
%>
<%

function model_mld_stdmelding_srtruimte()
{
    this.table = "mld_stdmelding_srtruimte";
    this.primary = "mld_stdmelding_srtruimte_key";
    this.records_name = "mld_stdmelding_srtruimtes";
    this.record_name = "mld_stdmelding_srtruimte";
    this.autfunction = "WEB_MLDMGT";
    this.record_title = L("mld_stdmelding_srtruimte");
    this.records_title = L("mld_stdmelding_srtruimte_m");
    this.defaultIcon = "fa-box-open-full";

    this.fields = {
        "id": {
            "dbs": "mld_stdmelding_srtruimte_key",
            "label": "Key",
            "typ": "key",
            "seq": "mld_s_mld_stdm_srtruimte_key"
        },
        "level": {
            "dbs": "alg_srtruimte_key",
            "label": L("mld_srtruimte_omschr"),
            "typ": "key",
            "foreign": {
                "tbl": "alg_srtruimte",
                "key": "alg_srtruimte_key",
                "desc": "alg_srtruimte_omschrijving",
                "where": "alg_srtruimte_verwijder IS NULL"
            },
            "uniquewith": "issuetype"
        },
        "issuetype": {
            "dbs": "mld_stdmelding_key",
            "label": L("lcl_mld_stdmelding"),
            "typ": "key",
            "foreign": {
                "tbl": "(select mld_stdmelding_key"
                     + "      , sd.ins_srtdiscipline_prefix || '-' ||"
                     + "        td.ins_discipline_omschrijving || ' / ' ||"
                     + "        sm.mld_stdmelding_omschrijving  full_description"
                     + "   from ins_srtdiscipline sd"
                     + "      , ins_tab_discipline td"
                     + "      , mld_stdmelding  sm"
                     + "  where sd.ins_srtdiscipline_key = td.ins_srtdiscipline_key"
                     + "    and td.ins_discipline_key = sm.mld_ins_discipline_key"
                     + "    and td.ins_discipline_verwijder is null"
                     + "  order by 2)",
                "key": "mld_stdmelding_key",
                "desc": "full_description"
            },
            "friendlyname": true,
            "uniquewith": "level"
        }
    };

    this.list = {
        "columns": [
            "id",
            "issuetype",
            "level"
        ]
    };

    this.edit = {
        "modal": true
    };


    this.REST_GET    = generic_REST_GET(this);
    this.REST_POST   = generic_REST_POST(this);
    this.REST_DELETE = generic_REST_DELETE(this);
    // PUT: Gegevens mogen niet gewijzigd worden.
}
%>