fix output of validation errors, add link to search for attribute value

This commit is contained in:
Uwe Steinmann 2017-07-21 16:54:49 +02:00
parent 407ef2097d
commit e5f917bdc1

View File

@ -82,12 +82,13 @@ $(document).ready( function() {
foreach($res['frequencies'][$type] as $entry) {
$value = $selattrdef->parseValue($entry['value']);
$content .= "<tr>";
$content .= "<td>".implode(';', $value)."</td><td>".$entry['c']."</td>";
$content .= "<td>".implode(';', $value)."</td>";
$content .= "<td><a href=\"../out/out.Search.php?resultmode=".($type == 'folder' ? 2 : ($type == 'document' ? 1 : 3))."&attributes[".$selattrdef->getID()."]=".$entry['value']."\">".urlencode($entry['c'])."</a></td>";
$content .= "<td>";
/* various checks, if the value is valid */
if(!$selattrdef->validate($entry['value'])) {
$content .= getAttributeValidationText($selattrdef->getValidationError(), $selattrdef->getName(), $entry['value']);
$content .= getAttributeValidationText($selattrdef->getValidationError(), $selattrdef->getName(), $entry['value'], $selattrdef->getRegex());
}
$content .= "<td>";
/* Check if value is in value set */
if($selattrdef->getValueSet()) {
foreach($value as $v) {