<% /*
    $Revision$
    $Id$

    File:           model_res_srtartikel_onrgoed.inc

    Description:    Model voor res_srtartikel_onrgoed

    Context:

    Notes:
*/
%>
<%

function model_res_srtartikel_onrgoed()
{
    this.table = "res_srtartikel_onrgoed";
    this.primary = "res_srtartikel_onrgoed_key";
    this.records_name = "articlescopes";
    this.record_name = "articlescope";
    this.soft_delete = "res_srtartikel_og_verwijder";
    this.autfunction = "WEB_RESMSU";
    this.record_title = L("res_srtartikel_onrgoed");
    this.records_title = L("res_srtartikel_onrgoed_m");


    this.fields = {
        "id": {
            "dbs": "res_srtartikel_onrgoed_key",
            "label": "Key",
            "typ": "key",
            "hidden_fld": true,
            "required": true,
            "filter": "exact",
            "seq": "res_s_res_srtartikel_og_key"
        },
        "res_discipline_key": {
            "dbs": "res_discipline_key",
            "label": L("res_discipline_key"),
            "typ": "key",
            "required": true,
            "insertonly": true,
            "foreign": {
                "tbl": "(SELECT ins_discipline_key, ins_discipline_omschrijving"
                     + "   FROM INS_TAB_DISCIPLINE"
                     + "  WHERE ins_discipline_verwijder IS NULL"
                     + "    AND ins_discipline_module='RES'"
                     + "    AND ins_discipline_min_level=2)",
                "key": "ins_discipline_key",
                "desc": "ins_discipline_omschrijving"
            },
            "filter": "exact",
            "LOVinit": ""
        },
        "alg_onrgoed_niveau": {
            "dbs": "alg_onrgoed_niveau",
            "label": L("lcl_niveau"),
            "typ": "varchar",
            "hidden_fld": true,
            "LOV": fill_og_niveau_LOV()
        },
        "ruimtekey": {  // Onder deze naam komt de parameter terug uit FCLTplaatsselector!
            "dbs": "alg_onrgoed_key",
            "label": L("res_srtartikel_plaats"),
            "typ": "key",
            "requiredlevel": 2,
            "insertonly": true,
            "foreign": {
                "tbl": "alg_v_plaatsaanduiding",
                "key": "alg_onroerendgoed_keys",
                "desc": "alg_plaatsaanduiding",
                "where": "alg_onroerendgoed_type = res_srtartikel_onrgoed.alg_onrgoed_niveau",
                "selectorforeign": "ALG_RUIMTE"
            },
            "friendlyname": true,
            "foreignfiltercode": null // Ook facilitor irrelevant
        }
    };

    this.edit = {
        modal: true  // In asp zetten werkt niet ?
    };

    this.REST_GET    = generic_REST_GET(this);
    this.REST_POST   = generic_REST_POST(this);
    this.REST_PUT    = generic_REST_PUT(this);
    this.REST_DELETE = generic_REST_DELETE(this, {});
}
%>