Remove obsolete files for generating iso8859 XML files

This commit is contained in:
2019-09-01 19:58:23 +02:00
committed by Stefan Rohde-Enslin
parent 13395387a0
commit 1f766c7eca
6 changed files with 20 additions and 82 deletions

View File

@ -33,7 +33,7 @@ $allowed = $eventpart = $eventpartsure = $fieldsWithDependency = $fieldsWithAllo
foreach ($availableFields as $categoryName => $fieldCategory) {
$allowed = array_merge($allowed, array_keys($fieldCategory));
// Extended operations for events
if (strpos($categoryName, $basis['event']) !== false) {
foreach ($fieldCategory as $key => $value) {
@ -42,7 +42,7 @@ foreach ($availableFields as $categoryName => $fieldCategory) {
else $eventpart[] = $key;
}
}
foreach ($fieldCategory as $key => $value) {
if (!empty($value["dependsOn"])) {
$fieldsWithDependency[$key] = $value['dependsOn'];
@ -51,7 +51,7 @@ foreach ($availableFields as $categoryName => $fieldCategory) {
$fieldsWithAllowedValueSet[$key] = $value['allowedValues'];
}
}
}
$allowed_object_other_title_kind_of = array('object_other_title_kind_of', 'Wissenschaft', 'Alltagssprache', 'Umgangssprache', 'Dialekt', 'Tudományos', 'Köznyelvi', 'Nyelvjárás');
@ -73,8 +73,8 @@ $fp = fopen ( $csv_datei, 'r' );
$y = 1;
$error = 0;
$zeile = fgetcsv ( $fp, 100000, ';' );
for ($x = 0; $x < count ( $zeile ); $x++)
{
for ($x = 0; $x < count($zeile); $x++) {
$zeile[$x] = str_replace("\xEF\xBB\xBF", "", $zeile[$x]);
$inhalt[$y][$x] = $zeile[$x];
if (!in_array($inhalt[1][$x], $allowed)) {
@ -187,15 +187,15 @@ echo '<br><br>5: Dependent colums observed ?<br>';
// Check for correct handling of dependent fields
foreach ($fieldsWithDependency as $tField => $tDependentFields) {
if (array_search($tField, $erstezeile) === false) continue;
foreach ($tDependentFields as $tDependentField) {
if (array_search($tDependentField, $erstezeile) === false) {
$depencymessage[] = "Dependency issue at column $tField: Corresponding column $tDependentField is missing";
}
}
}
if (isset($depencymessage) and $depencymessage != '') {
@ -281,18 +281,18 @@ if ($depcon_error == 0) echo '<br><i style="font-style:normal;color:#009900;">De
///// Check #7
echo '<br><br>7: Not allowed values in controlled lists?<br>';
for ($i = 2; $i <= $y; $i++) {
foreach ($inhalt[$i] as $key => $value) {
$columnName = $inhalt[1][$key];
// If the field is not restricted, then continue
if (!isset($fieldsWithAllowedValueSet[$columnName])) continue;
// For others: check if the value is from the list of allowed values.
if (!in_array($value, $fieldsWithAllowedValueSet[$columnName])) {
$errormessage[] = "Disallowed value in column <code>{$columnName}</code> on row <code>{$i}</code>: <em>" . $value . "</em> (allowed values: <small>" . implode(", ", $fieldsWithAllowedValueSet[$columnName]) . "</small>)";
}
}
}
@ -354,8 +354,7 @@ if ($hasanyimage > 0) {
if (isset($errormessage) and $errormessage != '') {
echo '<b style="color:#990000;">There is not one main image for each object !</b>';
for ($i = 0; $i < count ($errormessage); $i++)
{
for ($i = 0; $i < count($errormessage); $i++) {
echo '<br>' . $errormessage[$i];
$error++;
}
@ -364,8 +363,7 @@ if ($hasanyimage > 0) {
echo '<i style="font-style:normal;color:#009900;">For each object that has images attached exactly one main image is given !</i>';
}
}
else
{
else {
echo '<i style="font-style:normal;color:#009900;">No images to be imported !</i>';
}
@ -375,6 +373,5 @@ if ($error + $depcon_error > 0) {
<p>Error(s) found: ' . ($error + $depcon_error) . '</p>';
}
else {
echo '<a href="index5.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (iso 8859-1)</a><br>';
echo '<a href="index6.php?fnam=' . $_GET['fnam'] . '"><img src="img/go.gif"> Create XML for md:import (utf8)</a><br>';
echo '<a href="index6.php?fnam=' . htmlspecialchars($_GET['fnam']) . '" class="buttonLike">Create XML for md:import (utf8)</a><br>';
}