<% /*
    $Revision$
    $Id$

    File:           model_kpi_score.inc

    Description:    Model voor kpi_score

    Context:

    Notes:
*/
%>
<%
function model_kpi_score()
{
    this.records_name = "kpi_scores";
    this.record_name = "kpi_score";
    this.table = "kpi_score";
    this.primary = "kpi_score_key";
    this.autfunction = "WEB_PRSSYS";
    this.record_title = L("lcl_kpi_score_frame");
    this.records_title = L("lcl_kpi_score_title");

    this.fields = {
        "id": {
            "dbs": "kpi_score_key",
            "label": L("lcl_key"),
            "typ": "key",
            "required": true,
            "seq": "kpi_s_kpi_score_key"
        },
        "kpi": {
            "dbs": "kpi_definitie_key",
            "label": L('kpi_definitie_key'),
            "typ": "key",
            "readonly": true,
            "foreign": {
                "tbl": "kpi_definitie_key",
                "key": "kpi_definitie_key",
                "desc": "kpi_definitie_omschrijving"
            },
            "defaultvalue": null
        },
        "date": {
            "dbs": "kpi_score_datum",
            "label": L('kpi_score_datum'),
            "typ": "date",
            "required": true,
            "defaultvalue": new Date()
        },
        "location": {
            "dbs": "alg_locatie_key",
            "label": L("alg_locatie"),
            "typ": "key",
            "readonly": true,
            "foreign": {
                "tbl": "alg_locatie",
                "key": "alg_locatie_key",
                "desc": "alg_locatie_omschrijving"
            },
            "defaultvalue": null
        },
        "xmlnode": {
            "dbs": "kpi_score_xmlnode",
            "label": L("kpi_score_xmlnode"),
            "typ": "varchar",
            "filter": "like",
            "defaultvalue": null
        },
        "refkey": {
            "dbs": "alg_locatie_key",
            "label": L("alg_locatie"),
            "typ": "key",
            "readonly": true,
            "foreign": {
                "tbl": "alg_locatie",
                "key": "alg_locatie_key",
                "desc": "alg_locatie_omschrijving"
            },
            "defaultvalue": null
        },
        "score": {
            "dbs": "kpi_score_score",
            "label": L("kpi_score_score"),
            "typ": "number",
            "required": true,
            "filter": "like",
            "defaultvalue": null
        },
        "standard": {
            "dbs": "kpi_score_norm_score",
            "label": L("kpi_score_norm_score"),
            "typ": "varchar",
            "filter": "like",
            "defaultvalue": null
        },
        "threshold": {
            "dbs": "kpi_score_drempels",
            "label": L("kpi_score_drempels"),
            "typ": "varchar"
        }
    };

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

    this.list = {
        "columns": ["kpi", "date", "location", "xmlnode", "refkey", "score", "standard", "threshold"]
    };

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