';
- echo 'Please wait ... (transforming) '; - require 'csv_laden.php'; - echo ' | ';
-echo '
diff --git a/csv.php b/csv.php
index c4a1592..01196e2 100644
--- a/csv.php
+++ b/csv.php
@@ -56,7 +56,7 @@ foreach ($availableFields as $headline => $fields) {
# $tLine4[] = $field['remark'];
if (!empty($field['allowedValues'])) $tLine4[] = end($field['allowedValues']);
else $tLine4[] = $field['name_human_readable'];
-
+
$i++;
}
@@ -75,5 +75,5 @@ else
header("Content-Disposition: attachment; filename=csvxml_museum-digital_template-{$lang}.csv");
for ($i = 2; $i <= 4; $i++) {
- echo mb_convert_encoding('"' . implode("\";\"", ${"line$i"}) . '"' . PHP_EOL, 'utf-16','utf-8');;
+ echo mb_convert_encoding('"' . implode("\";\"", ${"line$i"}) . '"' . PHP_EOL, 'utf-16', 'utf-8');;
}
diff --git a/csv_check.php b/csv_check.php
index 97759e7..97df1a2 100644
--- a/csv_check.php
+++ b/csv_check.php
@@ -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 '
5: Dependent colums observed ?
';
// 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 '
De
///// Check #7
echo '
7: Not allowed values in controlled lists?
';
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 {$columnName}
on row {$i}
: " . $value . " (allowed values: " . implode(", ", $fieldsWithAllowedValueSet[$columnName]) . ")";
}
-
+
}
}
@@ -354,8 +354,7 @@ if ($hasanyimage > 0) {
if (isset($errormessage) and $errormessage != '') {
echo 'There is not one main image for each object !';
- for ($i = 0; $i < count ($errormessage); $i++)
- {
+ for ($i = 0; $i < count($errormessage); $i++) {
echo '
' . $errormessage[$i];
$error++;
}
@@ -364,8 +363,7 @@ if ($hasanyimage > 0) {
echo 'For each object that has images attached exactly one main image is given !';
}
}
-else
-{
+else {
echo 'No images to be imported !';
}
@@ -375,6 +373,5 @@ if ($error + $depcon_error > 0) {
Error(s) found: ' . ($error + $depcon_error) . '
'; } else { - echo ' Create XML for md:import (iso 8859-1)';
- echo 'Please wait ... (transforming) '; - require 'csv_laden.php'; - echo ' | ';
-echo '