<% /*
    $Revision$
    $Id$

    File:           model_ins_srtdeel.inc

    Description:

    Context:

    Notes:
*/
%>
<%

function model_ins_srtdeel()
{
    this.records_name = "objecttypes";
    this.record_name = "objecttype";
    this.table = "ins_srtdeel";
    this.primary = "ins_srtdeel_key";
    this.soft_delete = "ins_srtdeel_verwijder";
    this.autfunction = "WEB_INSMGT";
    this.record_title = L("ins_srtdeel");
    this.records_title = L("ins_srtdeel_m");
    this.trackcode = "INSSUP";

    this.fields = {
        "id": {
            "dbs": "ins_srtdeel_key",
            "label": L("lcl_key"),
            "typ": "key",
            "required": true,
            "seq": "ins_s_ins_srtinst_keys",
            "defaultvalue": null
        },
        "objectgroup": {
            "dbs": "ins_srtgroep_key",
            "label": L("lcl_obj_group"),
            "typ": "key",
            "required": true,
            "insertonly": true,
            "foreign": {
                "tbl": "ins_v_aanwezigsrtgroep",
                "key": "ins_srtgroep_key",
                "desc": "ins_srtgroep_omschrijving"
            },
            "LOVinit": "",
            "defaultvalue": null,
            "showtransit": true,
            "track": true
        },
        "code": {
            "dbs": "ins_srtdeel_code",
            "label": L("lcl_obj_srtdeel_code"),
            "typ": "varchar",
            "len": 10,
            "track": true
        },
        "name": {
            "dbs": "ins_srtdeel_omschrijving",
            "label": L("lcl_descr"),
            "typ": "varchar",
            "len": 100,
            "required": true,
            "translate": true,
            "filter": "like",
            "track": true
        },
        "sequence": {
            "dbs": "ins_srtdeel_volgnr",
            "label": L("lcl_ins_volgnr"),
            "typ": "number",
            "multiedit": true,
            "track": true
        },
        "unit": {
            "dbs": "ins_srtdeel_eenheid",
            "label": L("lcl_obj_unit"),
            "typ": "varchar",
            "translate": true,
            "len": 30,
            "multiedit": true,
            "track": true
        },
        //"dimension": {
        //    "dbs": "ins_srtdeel_dimensie",
        //    "label": L("lcl_ins_dimensie"),
        //    "typ": "varchar",
        //    "translate": true,
        //    "multiedit": true
        //},
        "expirationdate": {
            "dbs": "ins_srtdeel_vervaldatum",
            "label": L("lcl_ins_vervaldatum"),
            "typ": "date",
            "multiedit": true,
            "track": true
        },
        "sensortype": {
            "dbs": "ins_srtdeel_sensortype",
            "label": L("lcl_ins_sensortype"),
            "typ": "number",
            "LOV": L("lcl_ins_sensortypeLOV"),
            "multiedit": true,
            "track": true
        },
        "sensorthreshold": {
            "dbs": "ins_srtdeel_statethreshold",
            "label": L("lcl_ins_srtdeel_statethreshold"),
            "typ": "number",
            "multiedit": true,
            "track": true
        },
        "stdmelding": {
            "dbs": "mld_stdmelding_key",
            "label": L("lcl_ins_srtdeel_statethresholdmld"),
            "typ": "key",
            "foreign": "mld_stdmelding",
            "multiedit": true,
            "track" : true
        },
        "commoditynumber": {
            "dbs": "ins_srtdeel_nr",
            "label": L("lcl_ins_srtartikelnr"),
            "typ": "varchar",
            "len": 32,
            "multiedit": true,
            "track": true
        },
        "supplier": {
            "dbs": "prs_bedrijf_key",
            "label": L("lcl_ins_leverancier"),
            "typ": "key",
            "foreign": "prs_bedrijf",
            "foreignfiltercode": "L",
            "multiedit": true,
            "track": true
        },
        "mjb_grensscore1": {
            "dbs": "ins_srtdeel_mjb_grensscore1",
            "label": L("ins_srtdeel_mjb_grensscore1"),
            "typ": "float",
            "len": 10,
            "multiedit": true,
            "hidden_fld": S("ins_score_enabled") == 0,
            "track": true
        },
        "options": {
            "dbs": "ins_srtdeel_binding",
            "label": L("lcl_obj_bind"),
            "typ": "number",
            "bits": [
                {
                    "name": "",
                    "label": "",
                    "typ": "check",
                    "mask": 15,
                    "radios": [
                        {
                            "name": "bind_room",
                            "label": L("lcl_obj_bind_r"),
                            "mask": 1,
                            "defaultvalue": 0
                        },
                        {
                            "name": "bind_workplace",
                            "label": L("lcl_obj_bind_w"),
                            "mask": 2,
                            "defaultvalue": 0
                        },
                        {
                            "name": "bind_terrain",
                            "label": L("lcl_obj_bind_t"),
                            "mask": 4,
                            "defaultvalue": 0
                        },
                        {
                            "name": "bind_department",
                            "label": L("lcl_obj_bind_a"),
                            "mask": 8,
                            "defaultvalue": 0
                        },
                        {
                            "name": "bind_perslid",
                            "label": L("lcl_obj_bind_p"),
                            "mask": 16,
                            "defaultvalue": 0
                        },
                        {
                            "name": "bind_insdeel",
                            "label": L("lcl_obj_bind_i"),
                            "mask": 32,
                            "defaultvalue": 0
                        }
                    ]
                }
            ],
            "track": true
        },
        "lendable": {
            "dbs": "ins_srtdeel_uitleenbaar",
            "label": L("lcl_ins_uitleenbaar"),
            "typ": "check",
            "multiedit": true,
            "track": 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, {});
}
%>