From c652b2c44e1997ca8f019785bee2b20499eebb0a Mon Sep 17 00:00:00 2001 From: Erik Groener Date: Mon, 30 Apr 2018 08:46:57 +0000 Subject: [PATCH] DJIN#53091 Dropdown object koppelen aan standaardmelding toont verwijderde disciplines svn path=/Website/branches/v2017.3/; revision=37801 --- APPL/API2/model_companies.inc | 12 +++++------- APPL/MGT/srtinstallatieselector.js | 25 ++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/APPL/API2/model_companies.inc b/APPL/API2/model_companies.inc index 3ec1289e78..deed1717e9 100644 --- a/APPL/API2/model_companies.inc +++ b/APPL/API2/model_companies.inc @@ -22,6 +22,7 @@ function model_companies() this.primary = "prs_bedrijf_key"; this.records_name = "companies"; this.record_name = "company"; + this.autfunction = "WEB_PROFIL"; // we controleren zelf this.fields = { @@ -59,7 +60,8 @@ function model_companies() this.includes = { "custom_fields" : { "model": new model_custom_fields(this, new model_prs_kenmerk("B", { internal: true }), { readman: true, readuse: true, pNiveau: "B" }), - "joinfield": "flexparentkey" + "joinfield": "flexparentkey", + "enable_update": true } }; @@ -88,12 +90,8 @@ function model_companies() return json; }; - this.PUT = function (params) /* update company */ - { - }; - this.POST = function (params) /* new company */ - { - }; + this.REST_PUT = generic_REST_PUT(this); + this.REST_POST = generic_REST_POST(this); this.DELETE = function (params) /* delete company */ { }; diff --git a/APPL/MGT/srtinstallatieselector.js b/APPL/MGT/srtinstallatieselector.js index 892edbba18..21bde8b8e9 100644 --- a/APPL/MGT/srtinstallatieselector.js +++ b/APPL/MGT/srtinstallatieselector.js @@ -10,13 +10,18 @@ function init_srtinstallatie() var srtinstallatie_key = $("#objectkey").val(); if (!srtinstallatie_key) + { + fill_discipline(-1); change_object_discipline(); // Initialisatie listboxen bij search. + } else { var discipline_key = $("#objectdiscipline").val(); var srtgroep_key = $("#objectgroup").val(); var srtdeel_key = $("#objecttype").val(); var niveau = $("#level").val(); + + fill_discipline(discipline_key); if (niveau == "D") { fill_srtgroep(discipline_key); @@ -53,6 +58,18 @@ function change_object_group(srtdeel_key) fill_srtdeel(discipline_key, srtgroep_key); } +function fill_discipline(discipline_key) +{ + $.getJSON("../ins/get_ins_info_ajax.asp", + { req_info: "ins_srtinstallatie", + niveau: "D", + install_key: -1, + init_key: discipline_key, + available: srtinstallatieselector_available + }, + process_info); +} + function fill_srtgroep(discipline_key, srtgroep_key) { if (discipline_key > 0) @@ -85,7 +102,13 @@ function fill_srtdeel(discipline_key, srtgroep_key, srtdeel_key) function process_info(data) { - var select = (data.niveau=="G" ? $("#objectgroup") : $("#objecttype")); + var select = null; + switch(data.niveau) + { + case "D": select = $("#objectdiscipline"); break; + case "G": select = $("#objectgroup"); break; + case "S": select = $("#objecttype"); break; + } var sel_key = -1; var new_lov = '';