NMPC#35150 (besartikel)Plaatjes kunnen tonen in suggest.

Nog af te ronden

svn path=/Website/trunk/; revision=28009
This commit is contained in:
Jos Groot Lipman
2016-02-02 15:47:10 +00:00
parent 19394dd44c
commit 3dee888cb5
4 changed files with 35 additions and 4 deletions

View File

@@ -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();
}

View File

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

View File

@@ -33,3 +33,9 @@ input.suggestBusy { background-color:#E0FFE0;
.suggestsimilar {
font-style : italic;
}
.suggestfoto {
height: 20;
float : left;
margin-left : 0px;
}

View File

@@ -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";