diff --git a/APPL/Shared/Suggest/Suggest.inc b/APPL/Shared/Suggest/Suggest.inc index 6fdc5e24ba..c602a6b753 100644 --- a/APPL/Shared/Suggest/Suggest.inc +++ b/APPL/Shared/Suggest/Suggest.inc @@ -31,6 +31,7 @@ function WriteResult(sql, bAll, fldName, fldKey, fldDesc, fldExtraParam, fldTitl } // Params bAll, fldName, fldKey, fldDesc, fldExtraParam, fldTitle, bStoreDesc, checkExist of similarSQL +// foto function WriteResult2(sql, params) { var jsonResult = { } ; @@ -57,6 +58,13 @@ function WriteResult2(sql, params) (params.fldExtraParam? oRs(params.fldExtraParam).Value : null) ]; if (params.fldTitle) result.push(oRs(params.fldTitle).Value||""); + if (params.fldFoto) + { + if (!params.fldTitle) + result.push(""); + result.push(oRs(params.fldFoto).Value||""); + } + lijst.push(result); oRs.MoveNext(); } diff --git a/APPL/Shared/Suggest/SuggestBesItem.asp b/APPL/Shared/Suggest/SuggestBesItem.asp index d35800c185..6849f6c785 100644 --- a/APPL/Shared/Suggest/SuggestBesItem.asp +++ b/APPL/Shared/Suggest/SuggestBesItem.asp @@ -37,14 +37,17 @@ sql = "SELECT " + lcl.xsqla('bd.ins_discipline_omschrijving', 'bd.ins_discipline //optie, maar dan anders: + "|| ' ' ||TRIM(TO_CHAR(bes.getsrtdeelprijs(isd.bes_srtdeel_key, null),'9999999D99'))" + " descr" + " , bes_srtdeel_key" + + " , nvl2(isd.bes_srtdeel_image, p.prs_bedrijf_image_loc || isd.bes_srtdeel_image, null) foto" + " FROM bes_srtdeel isd" + " , bes_srtgroep isg" + " , bes_discipline bd" + + " , prs_bedrijf p" + " WHERE (UPPER(bes_srtdeel_nr || ' ' || "+ lcl.xsql('bes_srtdeel_omschrijving','isd.bes_srtdeel_key') +") LIKE " + safe.quoted_sql_wild("%" + chars + "%") + ( srtgroep_key < 0 ? " OR UPPER("+ lcl.xsql('bes_srtgroep_omschrijving','isg.bes_srtgroep_key') +") LIKE " + safe.quoted_sql_wild("%" + chars + "%") : "") + " )" + + " AND isd.prs_bedrijf_key = p.prs_bedrijf_key" + " AND isd.bes_srtgroep_key = isg.bes_srtgroep_key" + " AND isg.ins_discipline_key = bd.ins_discipline_key" + " AND isd.prs_bedrijf_key IS NOT NULL" // want die geven later een error en kunnen niet besteld worden @@ -63,8 +66,12 @@ sql += " ORDER BY isd.bes_srtdeel_volgnr" + ", " + lcl.xsql('bd.ins_discipline_omschrijving', 'bd.ins_discipline_key') + ", " + lcl.xsql('bes_srtgroep_omschrijving','isg.bes_srtgroep_key'); -if (disc_key > 0) - WriteResult(sql, bAll, "descr", "bes_srtdeel_key", "bes_srtgroep_omschrijving"); -else - WriteResult(sql, bAll, "descr", "bes_srtdeel_key", "ins_discipline_omschrijving"); +var params = { bAll: bAll, + fldName: "descr", + fldKey: "bes_srtdeel_key", + fldDesc: (disc_key > 0)?"bes_srtgroep_omschrijving":"ins_discipline_omschrijving", + fldFoto: "foto" + } + +WriteResult2(sql, params); %> diff --git a/APPL/Shared/Suggest/suggest.css b/APPL/Shared/Suggest/suggest.css index 9e4b0b4ec4..97c919720b 100644 --- a/APPL/Shared/Suggest/suggest.css +++ b/APPL/Shared/Suggest/suggest.css @@ -33,3 +33,9 @@ input.suggestBusy { background-color:#E0FFE0; .suggestsimilar { font-style : italic; } + +.suggestfoto { + height: 20; + float : left; + margin-left : 0px; + } diff --git a/APPL/Shared/Suggest/suggest.js b/APPL/Shared/Suggest/suggest.js index b16954a3ab..33b55bde01 100644 --- a/APPL/Shared/Suggest/suggest.js +++ b/APPL/Shared/Suggest/suggest.js @@ -729,6 +729,7 @@ function Suggest(inParams) else $(_completeDiv).removeClass("suggestsimilar"); + var hasfoto = false; for (var i = 0; i < resultsObj.result.length; i++) { if (resultsObj.result[i][0]) @@ -751,6 +752,15 @@ function Suggest(inParams) xDiv.onmousedown = function() { setValues(true);hideAutocompleteDiv(); return true; }; if (resultsObj.result[i].length > 4) xDiv.title = resultsObj.result[i][4]; + if (resultsObj.result[i].length > 5) // Image erbij + { + var xFoto = thisdoc.createElement("img"); + xFoto.setAttribute("src", resultsObj.result[i][5]); + xFoto.setAttribute("height", "40"); + xFoto.className = "suggestfoto"; + xDiv.appendChild(xFoto); + hasfoto = true; + } var xSpan = thisdoc.createElement("span"); xSpan.className = "suggestsrt";