" + data[i].id +
@@ -364,7 +374,7 @@ function resetPage()
function triggerSearch ()
{
- my_paz.search(document.mkwsSearchForm.mkwsQuery.value, recPerPage, curSort, curFilter);
+ my_paz.search(document.mkwsSearchForm.mkwsQuery.value, recPerPage, curSort, mkws.pp2filter);
}
function loadSelect ()
@@ -380,6 +390,7 @@ function loadSelect ()
// limit the query after clicking the facet
mkws.limitQuery = function (field, value)
{
+ debug("limitQuery(field=" + field + ", value=" + value + ")");
document.mkwsSearchForm.mkwsQuery.value += ' and ' + field + '="' + value + '"';
onFormSubmitEventHandler();
}
@@ -387,11 +398,12 @@ mkws.limitQuery = function (field, value)
// limit by target functions
mkws.limitTarget = function (id, name)
{
+ debug("limitTarget(id=" + id + ", name=" + name + ")");
var navi = document.getElementById('mkwsNavi');
navi.innerHTML =
'Source: '
+ name + '';
- curFilter = 'pz:id=' + id;
+ mkws.pp2filter = 'pz:id=' + id;
resetPage();
loadSelect();
triggerSearch();
@@ -402,7 +414,7 @@ mkws.delimitTarget = function ()
{
var navi = document.getElementById('mkwsNavi');
navi.innerHTML = '';
- curFilter = null;
+ mkws.pp2filter = null;
resetPage();
loadSelect();
triggerSearch();
@@ -549,14 +561,23 @@ function replaceHtml(el, html) {
function renderDetails(data, marker)
{
var details = '';
- if (marker) details += ''+ marker + ' | ';
+ if (marker) details += ''+ marker + ' | ';
+
+ var locations = [];
+ for (var i in data.location) {
+ locations.push(data.location[i]['@name']);
+ }
details += renderField("Title", data["md-title"], data["md-title-remainder"], data["md-title-responsibility"]);
details += renderField("Date", data["md-date"]);
details += renderField("Author", data["md-author"]);
details += renderField("URL", data["md-electronic-url"]);
details += renderField("Subject", data["location"][0]["md-subject"]);
- details += renderField("Location", data["location"][0]["@name"], data["location"][0]["@id"]);
+ if (locations.length == 0) {
+ details += 'No locations for record! | ';
+ } else {
+ details += renderField("Location" + (locations.length == 1 ? "" : "s"), locations);
+ }
details += ' ';
return details;
@@ -567,19 +588,27 @@ function renderField(caption, data, data2, data3) {
return "";
}
- if (caption == "URL") {
- data = '' + data + '';
+ var res = "";
+ for (var i = 0; i < data.length; i++) {
+ var s = data[i];
+ if (i > 0)
+ res += ", ";
+
+ if (caption == "URL")
+ s = '' + s + '';
+
+ res += s
}
if (data2 != undefined) {
- data = data + " (" + data2 + ")";
+ res = res + " (" + data2 + ")";
}
if (data3 != undefined) {
- data = data + " " + data3 + "";
+ res = res + " " + data3 + "";
}
- return ' |