<% /*
    $Revision$
    $Id$

    File:           model_mld_srtdiscipline.inc

    Description:    Vanuit CodeCharge gegenereerd model voor mld_srtdiscipline

    Context:

    Notes:
*/
%>
<!-- #include file="../api2/model_mld_typeopdr_srtdiscipline.inc" -->
<!-- #include file="../api2/model_mld_vervolg_beperking.inc" -->
<!-- #include file="../api2/model_mld_discipline.inc" -->
<%

function model_mld_srtdiscipline()
{
    this.records_name = "disciplinetypes";
    this.record_name = "disciplinetype";
    this.terms = "mld_srtdiscipline";
    this.table = "ins_srtdiscipline";
    this.primary = "ins_srtdiscipline_key";
    this.soft_delete = "ins_srtdiscipline_verwijder";
    this.autfunction = "WEB_PRSSYS";
    this.record_title = L("ins_srtdiscipline");
    this.records_title = L("ins_srtdiscipline_m");


    this.fields = {
        "id": {
            "dbs": "ins_srtdiscipline_key",
            "label": "Key",
            "typ": "key",
            "required": true,
            "seq": "ins_s_ins_srtdiscipline_key"
        },
        "module": {
            "dbs": "ins_srtdiscipline_module",
            "label": L("ins_srtdiscipline_module"),
            "typ": "varchar",
            "hidden_fld": true,
            "defaultvalue": "MLD"
        },
        "name": {
            "dbs": "ins_srtdiscipline_omschrijving",
            "label": L("ins_srtdiscipline_omschrijving"),
            "typ": "varchar",
            "translate": true,
            "required": true
        },
        "prefix": {
            "dbs": "ins_srtdiscipline_prefix",
            "label": L("ins_srtdiscipline_prefix"),
            "typ": "varchar"
        },
        "locationdata": {
            "dbs": "ins_srtdiscipline_alg",
            "label": L("ins_srtdiscipline_alg"),
            "typ": "key",
            "LOV": L("ins_srtdiscipline_algLOV"),
            "emptyoption": null
        },
        "objectdata": {
            "dbs": "ins_srtdiscipline_ins",
            "label": L("ins_srtdiscipline_ins"),
            "typ": "check"
        },
        "orderdata": {
            "dbs": "ins_srtdiscipline_bes",
            "label": L("ins_srtdiscipline_bes"),
            "typ": "number",
            "defaultvalue": "0",
            "LOV": L("ins_srtdiscipline_besLOV"),
            "emptyoption": null
        },
        "reservationdata": {
            "dbs": "ins_srtdiscipline_res",
            "label": L("ins_srtdiscipline_res"),
            "typ": "check"
        },
        "issuegroup": {
            "dbs": "ins_srtdiscipline_mldgroup",
            "label": L("ins_srtdiscipline_mldgroup"),
            "typ": "number",
            "defaultvalue": "0",
            "LOV": L("ins_srtdiscipline_mldgroupLOV"),
            "emptyoption": null
        },
        "custpays": {
            "dbs": "ins_srtdiscipline_kostenklant",
            "label": L("ins_srtdiscipline_kostenklant"),
            "typ": "key",
            "bits": [
                {
                    "name": "",
                    "label": "",
                    "typ": "check",
                    "mask": 15,
                    "radios": [
                        {
                            "name": "fe_on",
                            "label": L("mgt_srtdisc_kk_fe_on"),
                            "mask": 1,
                            "defaultvalue": 0
                        },
                        {
                            "name": "fe_notshow",
                            "label": L("mgt_srtdisc_kk_fe_notshow"),
                            "mask": 2,
                            "defaultvalue": 0
                        },
                        {
                            "name": "fobo_on",
                            "label": L("mgt_srtdisc_kk_fobo_on"),
                            "mask": 4,
                            "defaultvalue": 0
                        },
                        {
                            "name": "fobo_notshow",
                            "label": L("mgt_srtdisc_kk_fobo_notshow"),
                            "mask": 8,
                            "defaultvalue": 0
                        }
                    ]
                }
            ],
            "defaultvalue": "0",
            "emptyoption": null
        },
        "description": {
            "dbs": "ins_srtdiscipline_opmerking",
            "label": L("ins_srtdiscipline_opmerking"),
            "typ": "memo",
            "translate": true
        },
        "rgb": {
            "dbs": "ins_srtdiscipline_color",
            "typ": "color",
            "label": L("lcl_ins_colors"),
            "defaultvalue": ""
        },
        "symbolname": {
            "dbs": "ins_srtdiscipline_image",
            "typ": "icon",
            "module": "MLDSD",
            "label": L("lcl_mld_symbol_name")
        },
        "externnr": {
            "dbs": "ins_srtdiscipline_externnr",
            "typ": "varchar",
            "label": L("extern_nr")
        },
        "externsyncdate": {
            "dbs": "ins_srtdiscipline_extsyncdate",
            "typ": "datetime",
            "label": L("extern_syncdate"),
            "readonly": !(user.has("WEB_FACTAB") || user.has("WEB_FACXNR"))
        }
    };

    this.includes = {
        // helaas problematisch door de merge van disc_params
        //"mld_disciplines": {
        //    "model": new model_mld_discipline(),
        //    "joinfield": "disciplinetype",
        //    "required": true
        //},
        "mld_vervolg_beperking": {
            "model": new model_mld_vervolg_beperking(),
            "joinfield": "disciplinetype_1",
            "enable_update": true
        },
        "mld_opdrtypes": {
            "model": new model_mld_typeopdr_srtdiscipline(),
            "joinfield": "disciplinetype",
            "enable_update": true
        }
    };

    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);
}
%>