<% /*
    $Revision$
    $Id$

    File:           model_tracking.inc

    Description:    Tracking model
    Parameters:
    Context:

    Notes:  shared/statusinfo toont bij een reservering bijvoorbeeld ook
            afspraak en melding tracking. Zover gaan we hier (nog?) niet
*/

%>
<%
function model_tracking(xmlnodes)
{
    this.table        = "fac_tracking";
    this.primary      = "fac_tracking_key";
    this.records_name = "tracking";
    this.record_name  = "tracking";
    this.xmlnodes     = xmlnodes;

    this.tablesql = "(SELECT fac_tracking_key,"
                  + "        ft.fac_srtnotificatie_key,"
                  + "        fac_tracking_refkey,"
                  + "        fac_tracking_datum,"
                  + "        fac_tracking_oms,"
                  + "        prs_perslid_key"
                  + "   FROM fac_tracking ft, "
                  + "        fac_srtnotificatie fs"
                  + "  WHERE ft.fac_srtnotificatie_key = fs.fac_srtnotificatie_key"
                  + "    AND fs.fac_srtnotificatie_xmlnode IN (" + safe.quoted_sql_join(xmlnodes) + ")) "
                  + "   fac_tracking";

    this.fields =
             { "id":                  { dbs: "fac_tracking_key",       typ: "key" },
               "notification":        { dbs: "fac_srtnotificatie_key", typ: "key", foreign: "fac_srtnotificatie" },
               "date":                { dbs: "fac_tracking_datum",     typ: "datetime" },
               "description":         { dbs: "fac_tracking_oms",       typ: "varchar" },
               "person":              { dbs: "prs_perslid_key",        typ: "varchar", foreign: "prs_perslid" },
               "fac_tracking_refkey": { dbs: "fac_tracking_refkey",    typ: "key" }
             };
    this.list = { columns: ["id", "date", "notification", "description", "person"] }

    // Merk op: géén eigen REST_GET
    // We kunnen alleen via een include van een parent die dan ook
    // vooral alle autorisatiecontrole voor ons kan verzorgen
    //    this.REST_GET = generic_REST_GET(this, {});

}

%>