diff --git a/csv_check.php b/csv_check.php index 273c728..12b3166 100644 --- a/csv_check.php +++ b/csv_check.php @@ -1,376 +1,376 @@ - $fieldCategory) { - $allowed = array_merge($allowed, array_keys($fieldCategory)); - - // Extended operations for events - if (strpos($categoryName, $basis['event']) !== false) { - foreach ($fieldCategory as $key => $value) { - if (strpos($key, "_annotation") !== false) continue; - if (strpos($key, "_sure") !== false) $eventpartsure[] = $key; - else $eventpart[] = $key; - } - } - - foreach ($fieldCategory as $key => $value) { - if (!empty($value["dependsOn"])) { - $fieldsWithDependency[$key] = $value['dependsOn']; - } - if (!empty($value["allowedValues"])) { - $fieldsWithAllowedValueSet[$key] = $value['allowedValues']; - } - } - -} - -$allowed_inclusion_kind_of = array('inclusion_kind_of', 'Schenkung', 'Kauf', 'Grabung', 'Notbergung', 'Erbschaft', 'Stiftung', 'Enteignung', 'Ursprungsbestand', 'Ajándékozás','Vétel','Feltárás','Hivatalos átadás','Csere','Gyűjtés','Saját előállítás','Törzsanyag','Letét', 'endowment', 'dispossession', 'old stock', ''); - -///// Check #1 -//echo '
';print_r($allowed);echo '
'; -echo '1: Only allowed tags (column names) used?'; -$fp = fopen ( $csv_datei, 'r' ); -$y = 1; -$error = 0; -$zeile = fgetcsv( $fp, 100000, ';' ); -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)) { - echo '
ERROR in column ' . $x . ' created by value: ' . $inhalt[1][$x] . ''; - $error = $error + 1; - } - //echo '
';var_dump($inhalt[1][$x]); -} -fclose($fp); -$erstezeile = $zeile; -if ($error != 0) echo '
Not allowed tags found !'; else echo '
Only allowed tags used !'; - -//// Check #2 -echo '

2: Not allowed multiple use of tags (column names)?'; -$compare = array_unique($zeile); - -$result = identical_values($zeile, $compare); -if ($result == false) { - echo '
There are dublicate column names !'; - $error = $error + 1; -} -else { - echo '
No dublicate column names !'; -} - - -//// Get values into memory for following checks -$fp = fopen ( $csv_datei, 'r' ); -$y = 0; -while ($zeile = fgetcsv($fp, 100000, ';')) { - - $y++; - for ($x = 0; $x < count ( $zeile ); $x++) { - $inhalt[$y][$x] = str_replace("'", "\'", $zeile[$x]); - } -} -fclose($fp); - -///// Check #3 -echo '

3: Mandatory tags available and always filled in?'; -unset($inv_array); -$inv_error = 0; - -function get_duplicates($array) { - return array_unique( array_diff_assoc( $array, array_unique( $array ) ) ); - -} - -$mandatory = array('inventory_number','object_type','object_title','object_description'); -for ($i = 0; $i < count($mandatory); $i++) { - if (!in_array($mandatory[$i], $erstezeile)) { - echo '
Mandatory: Column ' . $mandatory[$i] . ' missing'; - $error = $error + 1; - $inv_error = $inv_error + 1; - } - else { - $spaltenr = array_search($mandatory[$i], $erstezeile); - for ($j = 0; $j < $y; $j++) { - if ($inhalt[$j + 1][$spaltenr] == '') { - echo '
Missing value for ' . $mandatory[$i] . ' in row ' . ($j + 1) . ''; - $error = $error + 1; - $inv_error = $inv_error + 1; - } - if ($mandatory[$i] == 'inventory_number') { - $inv_array[] = $inhalt[$j + 1][$spaltenr]; - } - } - } -} -if ($inv_error == 0) echo '
All mandatory tags available and with values !'; - - -///// Check #4 -echo '

4: Inventory_number unique ?'; -if (in_array('inventory_number', $erstezeile)) { - $doppelte_inv = get_duplicates($inv_array); - $doppelte_inv = array_values($doppelte_inv); - if (count($doppelte_inv) > 0) { - for ($i = 0; $i < count($doppelte_inv); $i++) - { - echo '
Multiple use of inventory_number ' . $doppelte_inv[$i] . ''; - $error = $error + 1; - } - } - else echo '
All inventory_numbers are unique !'; -} -else -{ - echo '
Aborted, column inventory_number is missing'; - $error = $error + 1; -} - -///// Check #5 -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 != '') { - echo 'Dependent columns were not observed !'; - for ($i = 0; $i < count ($depencymessage); $i++) - { - echo '
' . $depencymessage[$i]; - $error = $error + 1; - } -} -else { - echo 'Dependent columns were observed !'; -} - -///// Check #6 -echo '

6: Dependency of content observed?'; - -$crosscheck1 = array('object_other_title','detailed_description','detailed_description','inscription','inscription','dimensions_separate_length_value', 'dimensions_separate_width_value', 'dimensions_separate_height_value', 'dimensions_separate_diameter_value', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_weight_value','closer_location','bought_for','worth_value','worth_insurance_value'); -$crosscheck2 = array('object_other_title_kind_of','detailed_description_md','detailed_description_extern','inscription_md','inscription_extern','dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_weight_unit','closer_location_as','bought_for_currency','worth_unit','worth_insurance_unit'); - -$depcon_error = 0; -for ($l = 0; $l < count($crosscheck1); $l++) { - - if (in_array($crosscheck1[$l], $erstezeile)) { - - for ($j = 1; $j < ($y + 1); $j++) { - if ($inhalt[$j][array_search($crosscheck2[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($crosscheck1[$l], $erstezeile)] == '') { - echo '
Tag ' . $crosscheck2[$l] . ' given but no entry for ' . $crosscheck1[$l] . ' (row ' . $j . ')'; - $depcon_error = $depcon_error + 1; - } - } - - } - -} - -for ($l = 0; $l < count($eventpart); $l++) { - if (in_array($eventpart[$l], $erstezeile)) { - for ($j = 1; $j < ($y + 1); $j++) { - if ($inhalt[$j][array_search($eventpartsure[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($eventpart[$l], $erstezeile)] == '') { - echo '
Tag ' . $eventpartsure[$l] . ' given but no entry for ' . $eventpart[$l] . ' (row ' . $j . ')'; - $depcon_error = $depcon_error + 1; - } - } - } -} - -if (in_array('dimensions_separate_show_md', $erstezeile)) { - for ($j = 1; $j < ($y + 1); $j++) - { - if ($inhalt[$j][array_search('dimensions_separate_show_md', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') { - echo '
Tag dimensions_separate_show_md given but no separate values available (row ' . $j . ')'; - $depcon_error = $depcon_error + 1; - } - } -} - -if (in_array('dimensions_separate_show_extern', $erstezeile)) { - for ($j = 1; $j < ($y + 1); $j++) { - if ($inhalt[$j][array_search('dimensions_separate_show_extern', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') { - echo '
Tag dimensions_separate_show_extern given but no separate values available (row ' . $j . ')'; - $depcon_error = $depcon_error + 1; - } - } -} -/* -for ($im=1;$im<11;$im++) -{ - if (in_array('image_name'.$im,$erstezeile)) - { - for ($j=1;$j<($y+1);$j++) - { - if ($inhalt[$j][array_search('image_rights'.$im,$erstezeile)]!=='') - { - echo '
TAG image_name'.$im.' given but no value available for image_rights'.$im.' (row '.$j.')'; - $depcon_error=$depcon_error+1; - } - if ($inhalt[$j][array_search('image_visible'.$im,$erstezeile)]!=='') - { - echo '
TAG image_name'.$im.' given but no value available for image_visible'.$im.' (row '.$j.')'; - $depcon_error=$depcon_error+1; - } - } - } -} -*/ -if ($depcon_error == 0) echo '
Dependency of content was observed !'; - -///// 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])) { - - // It may be that the value is empty together with all dependent fields, - // because it's in a repeat field that was needed earlier. - if (empty($value) && !empty($fieldsWithDependency[$columnName])) { - - $allDependentsEmpty = true; - foreach ($fieldsWithDependency[$columnName] as $depField) { - // Find keys of dependent field - $depFieldKey = array_search($depField, $inhalt[1]); - if (!empty($inhalt[$i][$depFieldKey])) { - $allDependentsEmpty = false; - break; - } - } - if ($allDependentsEmpty === true) continue; - - } - - $errormessage[] = "Disallowed value in column {$columnName} on row {$i}: " . $value . " (allowed values: " . implode(", ", $fieldsWithAllowedValueSet[$columnName]) . ")"; - } - - } -} - -if (isset($errormessage) and $errormessage != '') { - echo 'Columns with controlled values contain invalid values !'; - for ($i = 0; $i < count ($errormessage); $i++) { - echo '
' . $errormessage[$i]; - $error = $error + 1; - } -} -else -{ - echo 'Values in controlled fields are all valid !'; -} - -///// Check #8 -unset($errormessage); -echo '

8: Main image or main resource given?
'; -$hasanyimage = 0; -for ($im = 1; $im < 29; $im++) -{ - if (array_search('image_name' . $im, $erstezeile) != '') {$imagemain[$im]['name'] = array_search('image_name' . $im, $erstezeile);$hasanyimage++; - } - if (array_search('image_visible' . $im, $erstezeile) != '') $imagemain[$im]['visible'] = array_search('image_visible' . $im, $erstezeile); - if (array_search('image_main' . $im, $erstezeile) != '') $imagemain[$im]['main'] = array_search('image_main' . $im, $erstezeile); -} - -if ($hasanyimage > 0) { - $imagemain = array_values($imagemain); - for ($i = 1; $i <= $y; $i++) - { - if ($i > 1) { - $maimg[$i] = 0; - //check if in a row any image_name is given - $hatimg[$i] = 0; - for ($im = 0; $im < count($imagemain); $im++) - { - if ($inhalt[$i][$imagemain[$im]['name']] != '') $hatimg[$i]++; - } - if ($hatimg[$i] > 0) { - // first check: how many main-images? - for ($im = 0; $im < count($imagemain); $im++) - { - if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {$maimg[$i]++;$merk = $im; - } - } - // if there is exacly one main-image, is it visible? - if ($maimg[$i] == 1) { - if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') { - $errormessage[] = 'Main image in row ' . $i . ' is not visible'; - } - } - } - } - if ($i > 1 and $maimg[$i] == 0 and $hatimg[$i] > 0) $errormessage[] = 'There is no visible main image given in row ' . $i . ''; - if ($i > 1 and $maimg[$i] > 1 and $hatimg[$i] > 0) $errormessage[] = 'There are ' . $maimg[$i] . ' main images given in row ' . $i . ''; - } - - if (isset($errormessage) and $errormessage != '') { - echo 'There is not one main image for each object !'; - for ($i = 0; $i < count($errormessage); $i++) { - echo '
' . $errormessage[$i]; - $error++; - } - } - else { - echo 'For each object that has images attached exactly one main image is given !'; - } -} -else { - echo 'No images to be imported !'; -} - -echo '
'; -if ($error + $depcon_error > 0) { - echo ' -

Error(s) found: ' . ($error + $depcon_error) . '

'; -} -else { - echo 'Create XML for md:import (utf8)
'; -} + $fieldCategory) { + $allowed = array_merge($allowed, array_keys($fieldCategory)); + + // Extended operations for events + if (strpos($categoryName, $basis['event']) !== false) { + foreach ($fieldCategory as $key => $value) { + if (strpos($key, "_annotation") !== false) continue; + if (strpos($key, "_sure") !== false) $eventpartsure[] = $key; + else $eventpart[] = $key; + } + } + + foreach ($fieldCategory as $key => $value) { + if (!empty($value["dependsOn"])) { + $fieldsWithDependency[$key] = $value['dependsOn']; + } + if (!empty($value["allowedValues"])) { + $fieldsWithAllowedValueSet[$key] = $value['allowedValues']; + } + } + +} + +$allowed_inclusion_kind_of = ['inclusion_kind_of', 'Schenkung', 'Kauf', 'Grabung', 'Notbergung', 'Erbschaft', 'Stiftung', 'Enteignung', 'Ursprungsbestand', 'Ajándékozás','Vétel','Feltárás','Hivatalos átadás','Csere','Gyűjtés','Saját előállítás','Törzsanyag','Letét', 'endowment', 'dispossession', 'old stock', '']; + +///// Check #1 +//echo '
';print_r($allowed);echo '
'; +echo '1: Only allowed tags (column names) used?'; +$fp = fopen ( $csv_datei, 'r' ); +$y = 1; +$error = 0; +$zeile = fgetcsv( $fp, 100000, ';' ); +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)) { + echo '
ERROR in column ' . $x . ' created by value: ' . $inhalt[1][$x] . ''; + $error = $error + 1; + } + //echo '
';var_dump($inhalt[1][$x]); +} +fclose($fp); +$erstezeile = $zeile; +if ($error != 0) echo '
Not allowed tags found !'; else echo '
Only allowed tags used !'; + +//// Check #2 +echo '

2: Not allowed multiple use of tags (column names)?'; +$compare = array_unique($zeile); + +$result = identical_values($zeile, $compare); +if ($result == false) { + echo '
There are dublicate column names !'; + $error = $error + 1; +} +else { + echo '
No dublicate column names !'; +} + + +//// Get values into memory for following checks +$fp = fopen ( $csv_datei, 'r' ); +$y = 0; +while ($zeile = fgetcsv($fp, 100000, ';')) { + + $y++; + for ($x = 0; $x < count ( $zeile ); $x++) { + $inhalt[$y][$x] = str_replace("'", "\'", $zeile[$x]); + } +} +fclose($fp); + +///// Check #3 +echo '

3: Mandatory tags available and always filled in?'; +unset($inv_array); +$inv_error = 0; + +function get_duplicates($array) { + return array_unique( array_diff_assoc( $array, array_unique( $array ) ) ); + +} + +$mandatory = ['inventory_number','object_type','object_title','object_description']; +for ($i = 0; $i < count($mandatory); $i++) { + if (!in_array($mandatory[$i], $erstezeile)) { + echo '
Mandatory: Column ' . $mandatory[$i] . ' missing'; + $error = $error + 1; + $inv_error = $inv_error + 1; + } + else { + $spaltenr = array_search($mandatory[$i], $erstezeile); + for ($j = 0; $j < $y; $j++) { + if ($inhalt[$j + 1][$spaltenr] == '') { + echo '
Missing value for ' . $mandatory[$i] . ' in row ' . ($j + 1) . ''; + $error = $error + 1; + $inv_error = $inv_error + 1; + } + if ($mandatory[$i] == 'inventory_number') { + $inv_array[] = $inhalt[$j + 1][$spaltenr]; + } + } + } +} +if ($inv_error == 0) echo '
All mandatory tags available and with values !'; + + +///// Check #4 +echo '

4: Inventory_number unique ?'; +if (in_array('inventory_number', $erstezeile)) { + $doppelte_inv = get_duplicates($inv_array); + $doppelte_inv = array_values($doppelte_inv); + if (count($doppelte_inv) > 0) { + for ($i = 0; $i < count($doppelte_inv); $i++) + { + echo '
Multiple use of inventory_number ' . $doppelte_inv[$i] . ''; + $error = $error + 1; + } + } + else echo '
All inventory_numbers are unique !'; +} +else +{ + echo '
Aborted, column inventory_number is missing'; + $error = $error + 1; +} + +///// Check #5 +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 != '') { + echo 'Dependent columns were not observed !'; + for ($i = 0; $i < count ($depencymessage); $i++) + { + echo '
' . $depencymessage[$i]; + $error = $error + 1; + } +} +else { + echo 'Dependent columns were observed !'; +} + +///// Check #6 +echo '

6: Dependency of content observed?'; + +$crosscheck1 = ['object_other_title','detailed_description','detailed_description','inscription','inscription','dimensions_separate_length_value', 'dimensions_separate_width_value', 'dimensions_separate_height_value', 'dimensions_separate_diameter_value', 'dimensions_separate_wall_thickness_value', 'dimensions_separate_weight_value','closer_location','bought_for','worth_value','worth_insurance_value']; +$crosscheck2 = ['object_other_title_kind_of','detailed_description_md','detailed_description_extern','inscription_md','inscription_extern','dimensions_separate_length_unit', 'dimensions_separate_width_unit', 'dimensions_separate_height_unit', 'dimensions_separate_diameter_unit', 'dimensions_separate_wall_thickness_unit', 'dimensions_separate_weight_unit','closer_location_as','bought_for_currency','worth_unit','worth_insurance_unit']; + +$depcon_error = 0; +for ($l = 0; $l < count($crosscheck1); $l++) { + + if (in_array($crosscheck1[$l], $erstezeile)) { + + for ($j = 1; $j < ($y + 1); $j++) { + if ($inhalt[$j][array_search($crosscheck2[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($crosscheck1[$l], $erstezeile)] == '') { + echo '
Tag ' . $crosscheck2[$l] . ' given but no entry for ' . $crosscheck1[$l] . ' (row ' . $j . ')'; + $depcon_error = $depcon_error + 1; + } + } + + } + +} + +for ($l = 0; $l < count($eventpart); $l++) { + if (in_array($eventpart[$l], $erstezeile)) { + for ($j = 1; $j < ($y + 1); $j++) { + if ($inhalt[$j][array_search($eventpartsure[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($eventpart[$l], $erstezeile)] == '') { + echo '
Tag ' . $eventpartsure[$l] . ' given but no entry for ' . $eventpart[$l] . ' (row ' . $j . ')'; + $depcon_error = $depcon_error + 1; + } + } + } +} + +if (in_array('dimensions_separate_show_md', $erstezeile)) { + for ($j = 1; $j < ($y + 1); $j++) + { + if ($inhalt[$j][array_search('dimensions_separate_show_md', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') { + echo '
Tag dimensions_separate_show_md given but no separate values available (row ' . $j . ')'; + $depcon_error = $depcon_error + 1; + } + } +} + +if (in_array('dimensions_separate_show_extern', $erstezeile)) { + for ($j = 1; $j < ($y + 1); $j++) { + if ($inhalt[$j][array_search('dimensions_separate_show_extern', $erstezeile)] !== '' and ($inhalt[$j][array_search('dimensions_separate_length_value', $erstezeile)] == '') and $inhalt[$j][array_search('dimensions_separate_width_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_heigt_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_weight_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_diameter_value', $erstezeile)] == '' and $inhalt[$j][array_search('dimensions_separate_wall_thickness_value', $erstezeile)] == '') { + echo '
Tag dimensions_separate_show_extern given but no separate values available (row ' . $j . ')'; + $depcon_error = $depcon_error + 1; + } + } +} +/* +for ($im=1;$im<11;$im++) +{ + if (in_array('image_name'.$im,$erstezeile)) + { + for ($j=1;$j<($y+1);$j++) + { + if ($inhalt[$j][array_search('image_rights'.$im,$erstezeile)]!=='') + { + echo '
TAG image_name'.$im.' given but no value available for image_rights'.$im.' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + if ($inhalt[$j][array_search('image_visible'.$im,$erstezeile)]!=='') + { + echo '
TAG image_name'.$im.' given but no value available for image_visible'.$im.' (row '.$j.')'; + $depcon_error=$depcon_error+1; + } + } + } +} +*/ +if ($depcon_error == 0) echo '
Dependency of content was observed !'; + +///// 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])) { + + // It may be that the value is empty together with all dependent fields, + // because it's in a repeat field that was needed earlier. + if (empty($value) && !empty($fieldsWithDependency[$columnName])) { + + $allDependentsEmpty = true; + foreach ($fieldsWithDependency[$columnName] as $depField) { + // Find keys of dependent field + $depFieldKey = array_search($depField, $inhalt[1]); + if (!empty($inhalt[$i][$depFieldKey])) { + $allDependentsEmpty = false; + break; + } + } + if ($allDependentsEmpty === true) continue; + + } + + $errormessage[] = "Disallowed value in column {$columnName} on row {$i}: " . $value . " (allowed values: " . implode(", ", $fieldsWithAllowedValueSet[$columnName]) . ")"; + } + + } +} + +if (isset($errormessage) and $errormessage != '') { + echo 'Columns with controlled values contain invalid values !'; + for ($i = 0; $i < count ($errormessage); $i++) { + echo '
' . $errormessage[$i]; + $error = $error + 1; + } +} +else +{ + echo 'Values in controlled fields are all valid !'; +} + +///// Check #8 +unset($errormessage); +echo '

8: Main image or main resource given?
'; +$hasanyimage = 0; +for ($im = 1; $im < 29; $im++) +{ + if (array_search('image_name' . $im, $erstezeile) != '') {$imagemain[$im]['name'] = array_search('image_name' . $im, $erstezeile);$hasanyimage++; + } + if (array_search('image_visible' . $im, $erstezeile) != '') $imagemain[$im]['visible'] = array_search('image_visible' . $im, $erstezeile); + if (array_search('image_main' . $im, $erstezeile) != '') $imagemain[$im]['main'] = array_search('image_main' . $im, $erstezeile); +} + +if ($hasanyimage > 0) { + $imagemain = array_values($imagemain); + for ($i = 1; $i <= $y; $i++) + { + if ($i > 1) { + $maimg[$i] = 0; + //check if in a row any image_name is given + $hatimg[$i] = 0; + for ($im = 0; $im < count($imagemain); $im++) + { + if ($inhalt[$i][$imagemain[$im]['name']] != '') $hatimg[$i]++; + } + if ($hatimg[$i] > 0) { + // first check: how many main-images? + for ($im = 0; $im < count($imagemain); $im++) + { + if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {$maimg[$i]++;$merk = $im; + } + } + // if there is exacly one main-image, is it visible? + if ($maimg[$i] == 1) { + if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') { + $errormessage[] = 'Main image in row ' . $i . ' is not visible'; + } + } + } + } + if ($i > 1 and $maimg[$i] == 0 and $hatimg[$i] > 0) $errormessage[] = 'There is no visible main image given in row ' . $i . ''; + if ($i > 1 and $maimg[$i] > 1 and $hatimg[$i] > 0) $errormessage[] = 'There are ' . $maimg[$i] . ' main images given in row ' . $i . ''; + } + + if (isset($errormessage) and $errormessage != '') { + echo 'There is not one main image for each object !'; + for ($i = 0; $i < count($errormessage); $i++) { + echo '
' . $errormessage[$i]; + $error++; + } + } + else { + echo 'For each object that has images attached exactly one main image is given !'; + } +} +else { + echo 'No images to be imported !'; +} + +echo '
'; +if ($error + $depcon_error > 0) { + echo ' +

Error(s) found: ' . ($error + $depcon_error) . '

'; +} +else { + echo 'Create XML for md:import (utf8)
'; +} diff --git a/inc/zeichen.php b/inc/zeichen.php index 4e79942..1fc0bf6 100644 --- a/inc/zeichen.php +++ b/inc/zeichen.php @@ -1,7 +1,13 @@ zipFile = tmpfile(); - } else { - $this->zipData = ""; - } - } + /** + * Constructor. + * + * @param $useZipFile boolean. Write temp zip data to tempFile? Default false + */ + function __construct($useZipFile = false) { + if ($useZipFile) { + $this->zipFile = tmpfile(); + } else { + $this->zipData = ""; + } + } - function __destruct() { - if (!is_null($this->zipFile)) { - fclose($this->zipFile); - } - $this->zipData= null; - } + function __destruct() { + if (!is_null($this->zipFile)) { + fclose($this->zipFile); + } + $this->zipData= null; + } - /** - * Set Zip archive comment. - * - * @param string $newComment New comment. null to clear. - */ - public function setComment($newComment = null) { - $this->zipComment = $newComment; - } + /** + * Set Zip archive comment. + * + * @param string $newComment New comment. null to clear. + */ + public function setComment($newComment = null) { + $this->zipComment = $newComment; + } - /** - * Set zip file to write zip data to. - * This will cause all present and future data written to this class to be written to this file. - * This can be used at any time, even after the Zip Archive have been finalized. Any previous file will be closed. - * Warning: If the given file already exists, it will be overwritten. - * - * @param string $fileName - */ - public function setZipFile($fileName) { - if (file_exists($fileName)) { - unlink ($fileName); - } - $fd=fopen($fileName, "x+b"); - if (!is_null($this->zipFile)) { - rewind($this->zipFile); - while(!feof($this->zipFile)) { - fwrite($fd, fread($this->zipFile, $this->streamChunkSize)); - } - - fclose($this->zipFile); - } else { - fwrite($fd, $this->zipData); - $this->zipData = null; - } - $this->zipFile = $fd; - } + /** + * Set zip file to write zip data to. + * This will cause all present and future data written to this class to be written to this file. + * This can be used at any time, even after the Zip Archive have been finalized. Any previous file will be closed. + * Warning: If the given file already exists, it will be overwritten. + * + * @param string $fileName + */ + public function setZipFile($fileName) { + if (file_exists($fileName)) { + unlink ($fileName); + } + $fd=fopen($fileName, "x+b"); + if (!is_null($this->zipFile)) { + rewind($this->zipFile); + while(!feof($this->zipFile)) { + fwrite($fd, fread($this->zipFile, $this->streamChunkSize)); + } + + fclose($this->zipFile); + } else { + fwrite($fd, $this->zipData); + $this->zipData = null; + } + $this->zipFile = $fd; + } - /** - * Add an empty directory entry to the zip archive. - * Basically this is only used if an empty directory is added. - * - * @param string $directoryPath Directory Path and name to be added to the archive. - * @param int $timestamp (Optional) Timestamp for the added directory, if omitted or set to 0, the current time will be used. - * @param string $fileComment (Optional) Comment to be added to the archive for this directory. To use fileComment, timestamp must be given. - */ - public function addDirectory($directoryPath, $timestamp = 0, $fileComment = null) { - if ($this->isFinalized) { - return; - } - $this->buildZipEntry($directoryPath, $fileComment, "\x00\x00", "\x00\x00", $timestamp, "\x00\x00\x00\x00", 0, 0, 16); - } + /** + * Add an empty directory entry to the zip archive. + * Basically this is only used if an empty directory is added. + * + * @param string $directoryPath Directory Path and name to be added to the archive. + * @param int $timestamp (Optional) Timestamp for the added directory, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this directory. To use fileComment, timestamp must be given. + */ + public function addDirectory($directoryPath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + $this->buildZipEntry($directoryPath, $fileComment, "\x00\x00", "\x00\x00", $timestamp, "\x00\x00\x00\x00", 0, 0, 16); + } - /** - * Add a file to the archive at the specified location and file name. - * - * @param string $data File data. - * @param string $filePath Filepath and name to be used in the archive. - * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. - * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. - */ - public function addFile($data, $filePath, $timestamp = 0, $fileComment = null) { - if ($this->isFinalized) { - return; - } + /** + * Add a file to the archive at the specified location and file name. + * + * @param string $data File data. + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function addFile($data, $filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } - $gzType = "\x08\x00"; // Compression type 8 = deflate - $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. - $dataLength = strlen($data); - $fileCRC32 = pack("V", crc32($data)); + $gzType = "\x08\x00"; // Compression type 8 = deflate + $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. + $dataLength = strlen($data); + $fileCRC32 = pack("V", crc32($data)); - $gzData = gzcompress($data); - $gzData = substr( substr($gzData, 0, strlen($gzData) - 4), 2); // gzcompress adds a 2 byte header and 4 byte CRC we can't use. - // The 2 byte header does contain useful data, though in this case the 2 parameters we'd be interrested in will always be 8 for compression type, and 2 for General purpose flag. - $gzLength = strlen($gzData); + $gzData = gzcompress($data); + $gzData = substr( substr($gzData, 0, strlen($gzData) - 4), 2); // gzcompress adds a 2 byte header and 4 byte CRC we can't use. + // The 2 byte header does contain useful data, though in this case the 2 parameters we'd be interrested in will always be 8 for compression type, and 2 for General purpose flag. + $gzLength = strlen($gzData); - if ($gzLength >= $dataLength) { - $gzLength = $dataLength; - $gzData = $data; - $gzType = "\x00\x00"; // Compression type 0 = stored - $gpFlags = "\x00\x00"; // Compression type 0 = stored - } + if ($gzLength >= $dataLength) { + $gzLength = $dataLength; + $gzData = $data; + $gzType = "\x00\x00"; // Compression type 0 = stored + $gpFlags = "\x00\x00"; // Compression type 0 = stored + } - if (is_null($this->zipFile) && ($this->offset + $gzLength) > $this->zipMemoryThreshold) { - $this->zipFile = tmpfile(); - fwrite($this->zipFile, $this->zipData); - $this->zipData = null; - } + if (is_null($this->zipFile) && ($this->offset + $gzLength) > $this->zipMemoryThreshold) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } - $this->buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, 32); - if (is_null($this->zipFile)) { - $this->zipData .= $gzData; - } else { - fwrite($this->zipFile, $gzData); - } - } + $this->buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, 32); + if (is_null($this->zipFile)) { + $this->zipData .= $gzData; + } else { + fwrite($this->zipFile, $gzData); + } + } - /** - * Add a file to the archive at the specified location and file name. - * - * @param string $dataFile File name/path. - * @param string $filePath Filepath and name to be used in the archive. - * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. - * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. - */ - public function addLargeFile($dataFile, $filePath, $timestamp = 0, $fileComment = null) { - if ($this->isFinalized) { - return; - } - - $this->openStream($filePath, $timestamp, $fileComment); + /** + * Add a file to the archive at the specified location and file name. + * + * @param string $dataFile File name/path. + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function addLargeFile($dataFile, $filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } + + $this->openStream($filePath, $timestamp, $fileComment); - $fh = fopen($dataFile, "rb"); - while(!feof($fh)) { - $this->addStreamData(fread($fh, $this->streamChunkSize)); - } - fclose($fh); + $fh = fopen($dataFile, "rb"); + while(!feof($fh)) { + $this->addStreamData(fread($fh, $this->streamChunkSize)); + } + fclose($fh); - $this->closeStream(); - } + $this->closeStream(); + } - /** - * Create a stream to be used for large entries. - * - * @param string $filePath Filepath and name to be used in the archive. - * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. - * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. - */ - public function openStream($filePath, $timestamp = 0, $fileComment = null) { - if ($this->isFinalized) { - return; - } + /** + * Create a stream to be used for large entries. + * + * @param string $filePath Filepath and name to be used in the archive. + * @param int $timestamp (Optional) Timestamp for the added file, if omitted or set to 0, the current time will be used. + * @param string $fileComment (Optional) Comment to be added to the archive for this file. To use fileComment, timestamp must be given. + */ + public function openStream($filePath, $timestamp = 0, $fileComment = null) { + if ($this->isFinalized) { + return; + } - if (is_null($this->zipFile)) { - $this->zipFile = tmpfile(); - fwrite($this->zipFile, $this->zipData); - $this->zipData = null; - } - - if (strlen($this->streamFilePath) > 0) { - closeStream(); - } - $this->streamFile = tempnam(sys_get_temp_dir(), 'Zip'); - $this->streamData = gzopen($this->streamFile, "w9"); - $this->streamFilePath = $filePath; - $this->streamTimestamp = $timestamp; - $this->streamFileComment = $fileComment; - $this->streamFileLength = 0; - } - - public function addStreamData($data) { - $length = gzwrite($this->streamData, $data, strlen($data)); - if ($length != strlen($data)) { - print "

Length mismatch

\n"; - } - $this->streamFileLength += $length; - return $length; - } - - /** - * Close the current stream. - */ - public function closeStream() { - if ($this->isFinalized || strlen($this->streamFilePath) == 0) { - return; - } - - fflush($this->streamData); - gzclose($this->streamData); - - $gzType = "\x08\x00"; // Compression type 8 = deflate - $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. + if (is_null($this->zipFile)) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } + + if (strlen($this->streamFilePath) > 0) { + closeStream(); + } + $this->streamFile = tempnam(sys_get_temp_dir(), 'Zip'); + $this->streamData = gzopen($this->streamFile, "w9"); + $this->streamFilePath = $filePath; + $this->streamTimestamp = $timestamp; + $this->streamFileComment = $fileComment; + $this->streamFileLength = 0; + } + + public function addStreamData($data) { + $length = gzwrite($this->streamData, $data, strlen($data)); + if ($length != strlen($data)) { + print "

Length mismatch

\n"; + } + $this->streamFileLength += $length; + return $length; + } + + /** + * Close the current stream. + */ + public function closeStream() { + if ($this->isFinalized || strlen($this->streamFilePath) == 0) { + return; + } + + fflush($this->streamData); + gzclose($this->streamData); + + $gzType = "\x08\x00"; // Compression type 8 = deflate + $gpFlags = "\x02\x00"; // General Purpose bit flags for compression type 8 it is: 0=Normal, 1=Maximum, 2=Fast, 3=super fast compression. - $file_handle = fopen($this->streamFile, "rb"); - $stats = fstat($file_handle); - $eof = $stats['size']; - - fseek($file_handle, $eof-8); - $fileCRC32 = fread($file_handle, 4); - $dataLength = $this->streamFileLength;//$gzl[1]; + $file_handle = fopen($this->streamFile, "rb"); + $stats = fstat($file_handle); + $eof = $stats['size']; + + fseek($file_handle, $eof-8); + $fileCRC32 = fread($file_handle, 4); + $dataLength = $this->streamFileLength;//$gzl[1]; - $gzLength = $eof-10; - $eof -= 9; - - fseek($file_handle, 10); + $gzLength = $eof-10; + $eof -= 9; + + fseek($file_handle, 10); - $this->buildZipEntry($this->streamFilePath, $this->streamFileComment, $gpFlags, $gzType, $this->streamTimestamp, $fileCRC32, $gzLength, $dataLength, 32); - while(!feof($file_handle)) { - fwrite($this->zipFile, fread($file_handle, $this->streamChunkSize)); - } - - unlink($this->streamFile); - $this->streamFile = null; - $this->streamData = null; - $this->streamFilePath = null; - $this->streamTimestamp = null; - $this->streamFileComment = null; - $this->streamFileLength = 0; - } + $this->buildZipEntry($this->streamFilePath, $this->streamFileComment, $gpFlags, $gzType, $this->streamTimestamp, $fileCRC32, $gzLength, $dataLength, 32); + while(!feof($file_handle)) { + fwrite($this->zipFile, fread($file_handle, $this->streamChunkSize)); + } + + unlink($this->streamFile); + $this->streamFile = null; + $this->streamData = null; + $this->streamFilePath = null; + $this->streamTimestamp = null; + $this->streamFileComment = null; + $this->streamFileLength = 0; + } - /** - * Close the archive. - * A closed archive can no longer have new files added to it. - */ - public function finalize() { - if(!$this->isFinalized) { - if (strlen($this->streamFilePath) > 0) { - $this->closeStream(); - } - $cd = implode("", $this->cdRec); - - $cdRec = $cd . $this->endOfCentralDirectory - . pack("v", sizeof($this->cdRec)) - . pack("v", sizeof($this->cdRec)) - . pack("V", strlen($cd)) - . pack("V", $this->offset); - if (!is_null($this->zipComment)) { - $cdRec .= pack("v", strlen($this->zipComment)) . $this->zipComment; - } else { - $cdRec .= "\x00\x00"; - } - - if (is_null($this->zipFile)) { - $this->zipData .= $cdRec; - } else { - fwrite($this->zipFile, $cdRec); - fflush($this->zipFile); - } - $this->isFinalized = true; - $cd = null; - $this->cdRec = null; - } - } + /** + * Close the archive. + * A closed archive can no longer have new files added to it. + */ + public function finalize() { + if(!$this->isFinalized) { + if (strlen($this->streamFilePath) > 0) { + $this->closeStream(); + } + $cd = implode("", $this->cdRec); + + $cdRec = $cd . $this->endOfCentralDirectory + . pack("v", sizeof($this->cdRec)) + . pack("v", sizeof($this->cdRec)) + . pack("V", strlen($cd)) + . pack("V", $this->offset); + if (!is_null($this->zipComment)) { + $cdRec .= pack("v", strlen($this->zipComment)) . $this->zipComment; + } else { + $cdRec .= "\x00\x00"; + } + + if (is_null($this->zipFile)) { + $this->zipData .= $cdRec; + } else { + fwrite($this->zipFile, $cdRec); + fflush($this->zipFile); + } + $this->isFinalized = true; + $cd = null; + $this->cdRec = null; + } + } - /** - * Get the handle ressource for the archive zip file. - * If the zip haven't been finalized yet, this will cause it to become finalized - * - * @return zip file handle - */ - public function getZipFile() { - if(!$this->isFinalized) { - $this->finalize(); - } - if (is_null($this->zipFile)) { - $this->zipFile = tmpfile(); - fwrite($this->zipFile, $this->zipData); - $this->zipData = null; - } - rewind($this->zipFile); - return $this->zipFile; - } + /** + * Get the handle ressource for the archive zip file. + * If the zip haven't been finalized yet, this will cause it to become finalized + * + * @return zip file handle + */ + public function getZipFile() { + if(!$this->isFinalized) { + $this->finalize(); + } + if (is_null($this->zipFile)) { + $this->zipFile = tmpfile(); + fwrite($this->zipFile, $this->zipData); + $this->zipData = null; + } + rewind($this->zipFile); + return $this->zipFile; + } - /** - * Get the zip file contents - * If the zip haven't been finalized yet, this will cause it to become finalized - * - * @return zip data - */ - public function getZipData() { - if(!$this->isFinalized) { - $this->finalize(); - } - if (is_null($this->zipFile)) { - return $this->zipData; - } else { - rewind($this->zipFile); - $filestat = fstat($this->zipFile); - return fread($this->zipFile, $filestat['size']); - } - } + /** + * Get the zip file contents + * If the zip haven't been finalized yet, this will cause it to become finalized + * + * @return zip data + */ + public function getZipData() { + if(!$this->isFinalized) { + $this->finalize(); + } + if (is_null($this->zipFile)) { + return $this->zipData; + } else { + rewind($this->zipFile); + $filestat = fstat($this->zipFile); + return fread($this->zipFile, $filestat['size']); + } + } - /** - * Send the archive as a zip download - * - * @param String $fileName The name of the Zip archive, ie. "archive.zip". - * @return void - */ - function sendZip($fileName) { - if(!$this->isFinalized) { - $this->finalize(); - } + /** + * Send the archive as a zip download + * + * @param String $fileName The name of the Zip archive, ie. "archive.zip". + * @return void + */ + function sendZip($fileName) { + if(!$this->isFinalized) { + $this->finalize(); + } - if (!headers_sent($headerFile, $headerLine) or die("

Error: Unable to send file $fileName. HTML Headers have already been sent from $headerFile in line $headerLine

")) { - if (ob_get_contents() === false or die("\n

Error: Unable to send file $fileName.epub. Output buffer contains the following text (typically warnings or errors):
" . ob_get_contents() . "

")) { - if (ini_get('zlib.output_compression')) { - ini_set('zlib.output_compression', 'Off'); - } + if (!headers_sent($headerFile, $headerLine) or die("

Error: Unable to send file $fileName. HTML Headers have already been sent from $headerFile in line $headerLine

")) { + if (ob_get_contents() === false or die("\n

Error: Unable to send file $fileName.epub. Output buffer contains the following text (typically warnings or errors):
" . ob_get_contents() . "

")) { + if (ini_get('zlib.output_compression')) { + ini_set('zlib.output_compression', 'Off'); + } - header('Pragma: public'); - header("Last-Modified: " . gmdate("D, d M Y H:i:s T")); - header("Expires: 0"); - header("Accept-Ranges: bytes"); - header("Connection: close"); - header("Content-Type: application/zip"); - header('Content-Disposition: attachment; filename="' . $fileName . '";' ); - header("Content-Transfer-Encoding: binary"); - header("Content-Length: ". $this->getArchiveSize()); + header('Pragma: public'); + header("Last-Modified: " . gmdate("D, d M Y H:i:s T")); + header("Expires: 0"); + header("Accept-Ranges: bytes"); + header("Connection: close"); + header("Content-Type: application/zip"); + header('Content-Disposition: attachment; filename="' . $fileName . '";' ); + header("Content-Transfer-Encoding: binary"); + header("Content-Length: ". $this->getArchiveSize()); - if (is_null($this->zipFile)) { - echo $this->zipData; - } else { - rewind($this->zipFile); + if (is_null($this->zipFile)) { + echo $this->zipData; + } else { + rewind($this->zipFile); - while(!feof($this->zipFile)) { - echo fread($this->zipFile, $this->streamChunkSize); - } - } - } - } - } - - public function getArchiveSize() { - if (is_null($this->zipFile)) { - return strlen($this->zipData); - } - $filestat = fstat($this->zipFile); - return $filestat['size']; - } + while(!feof($this->zipFile)) { + echo fread($this->zipFile, $this->streamChunkSize); + } + } + } + } + } + + public function getArchiveSize() { + if (is_null($this->zipFile)) { + return strlen($this->zipData); + } + $filestat = fstat($this->zipFile); + return $filestat['size']; + } - /** - * Calculate the 2 byte dostime used in the zip entries. - * - * @param int $timestamp - * @return 2-byte encoded DOS Date - */ - private function getDosTime($timestamp = 0) { - $timestamp = (int)$timestamp; - $date = ($timestamp == 0 ? getdate() : getDate($timestamp)); - if ($date["year"] >= 1980) { - return pack("V", (($date["mday"] + ($date["mon"] << 5) + (($date["year"]-1980) << 9)) << 16) | - (($date["seconds"] >> 1) + ($date["minutes"] << 5) + ($date["hours"] << 11))); - } - return "\x00\x00\x00\x00"; - } + /** + * Calculate the 2 byte dostime used in the zip entries. + * + * @param int $timestamp + * @return 2-byte encoded DOS Date + */ + private function getDosTime($timestamp = 0) { + $timestamp = (int)$timestamp; + $date = ($timestamp == 0 ? getdate() : getDate($timestamp)); + if ($date["year"] >= 1980) { + return pack("V", (($date["mday"] + ($date["mon"] << 5) + (($date["year"]-1980) << 9)) << 16) | + (($date["seconds"] >> 1) + ($date["minutes"] << 5) + ($date["hours"] << 11))); + } + return "\x00\x00\x00\x00"; + } - /** - * Build the Zip file structures - * - * @param unknown_type $filePath - * @param unknown_type $fileComment - * @param unknown_type $gpFlags - * @param unknown_type $gzType - * @param unknown_type $timestamp - * @param unknown_type $fileCRC32 - * @param unknown_type $gzLength - * @param unknown_type $dataLength - * @param integer $extFileAttr 16 for directories, 32 for files. - */ - private function buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, $extFileAttr) { - $filePath = str_replace("\\", "/", $filePath); - $fileCommentLength = (is_null($fileComment) ? 0 : strlen($fileComment)); - $dosTime = $this->getDosTime($timestamp); - - $zipEntry = $this->localFileHeader; - $zipEntry .= "\x14\x00"; // Version needed to extract - $zipEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; - $zipEntry .= pack("VV", $gzLength, $dataLength); - $zipEntry .= pack("v", strlen($filePath) ); // File name length - $zipEntry .= "\x00\x00"; // Extra field length - $zipEntry .= $filePath; // FileName . Extra field + /** + * Build the Zip file structures + * + * @param unknown_type $filePath + * @param unknown_type $fileComment + * @param unknown_type $gpFlags + * @param unknown_type $gzType + * @param unknown_type $timestamp + * @param unknown_type $fileCRC32 + * @param unknown_type $gzLength + * @param unknown_type $dataLength + * @param integer $extFileAttr 16 for directories, 32 for files. + */ + private function buildZipEntry($filePath, $fileComment, $gpFlags, $gzType, $timestamp, $fileCRC32, $gzLength, $dataLength, $extFileAttr) { + $filePath = str_replace("\\", "/", $filePath); + $fileCommentLength = (is_null($fileComment) ? 0 : strlen($fileComment)); + $dosTime = $this->getDosTime($timestamp); + + $zipEntry = $this->localFileHeader; + $zipEntry .= "\x14\x00"; // Version needed to extract + $zipEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; + $zipEntry .= pack("VV", $gzLength, $dataLength); + $zipEntry .= pack("v", strlen($filePath) ); // File name length + $zipEntry .= "\x00\x00"; // Extra field length + $zipEntry .= $filePath; // FileName . Extra field - if (is_null($this->zipFile)) { - $this->zipData .= $zipEntry; - } else { - fwrite($this->zipFile, $zipEntry); - } - - $cdEntry = $this->centralFileHeader; - $cdEntry .= "\x00\x00"; // Made By Version - $cdEntry .= "\x14\x00"; // Version Needed to extract - $cdEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; - $cdEntry .= pack("VV", $gzLength, $dataLength); - $cdEntry .= pack("v", strlen($filePath)); // Filename length - $cdEntry .= "\x00\x00"; // Extra field length - $cdEntry .= pack("v", $fileCommentLength); // File comment length - $cdEntry .= "\x00\x00"; // Disk number start - $cdEntry .= "\x00\x00"; // internal file attributes - $cdEntry .= pack("V", $extFileAttr ); // External file attributes - $cdEntry .= pack("V", $this->offset ); // Relative offset of local header - $cdEntry .= $filePath; // FileName . Extra field - if (!is_null($fileComment)) { - $cdEntry .= $fileComment; // Comment - } + if (is_null($this->zipFile)) { + $this->zipData .= $zipEntry; + } else { + fwrite($this->zipFile, $zipEntry); + } + + $cdEntry = $this->centralFileHeader; + $cdEntry .= "\x00\x00"; // Made By Version + $cdEntry .= "\x14\x00"; // Version Needed to extract + $cdEntry .= $gpFlags . $gzType . $dosTime. $fileCRC32; + $cdEntry .= pack("VV", $gzLength, $dataLength); + $cdEntry .= pack("v", strlen($filePath)); // Filename length + $cdEntry .= "\x00\x00"; // Extra field length + $cdEntry .= pack("v", $fileCommentLength); // File comment length + $cdEntry .= "\x00\x00"; // Disk number start + $cdEntry .= "\x00\x00"; // internal file attributes + $cdEntry .= pack("V", $extFileAttr ); // External file attributes + $cdEntry .= pack("V", $this->offset ); // Relative offset of local header + $cdEntry .= $filePath; // FileName . Extra field + if (!is_null($fileComment)) { + $cdEntry .= $fileComment; // Comment + } - $this->cdRec[] = $cdEntry; - $this->offset += strlen($zipEntry) + $gzLength; - } + $this->cdRec[] = $cdEntry; + $this->offset += strlen($zipEntry) + $gzLength; + } } -?> \ No newline at end of file diff --git a/index4.php b/index4.php index bffe7b3..13ff276 100644 --- a/index4.php +++ b/index4.php @@ -1,88 +1,88 @@ -' . "\n"; // für Ungarn /////////////////////////////////// - $somecontent .= '' . "\n"; - - $lineCount = count($zeile); - for ($x = 0; $x < $lineCount; $x++) { - - $inhalt[$y][$x] = $zeile[$x]; - $inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]); - $inhalt[$y][$x] = str_replace('>', ']', str_replace('<', '[', $inhalt[$y][$x])); - if (empty($inhalt[$y][$x])) continue; - //if ($y!=1) $inhalt[$y][$x] = ''; - $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '' . "\n"; //für ungarn sonst weg } - - } - $somecontent .= ''; - if (fwrite($handle, $somecontent) === FALSE) { - echo "Cannot write to file ($filename)";exit; - } - fclose($handle); - -} -fclose($fp); - -echo printHTMLHead(); - -echo ' -
- ' . ($y - 1) . ' files created -
- Download as zip - -
'; - -echo ' - - - -'; +' . "\n"; // für Ungarn /////////////////////////////////// + $somecontent .= '' . "\n"; + + $lineCount = count($zeile); + for ($x = 0; $x < $lineCount; $x++) { + + $inhalt[$y][$x] = $zeile[$x]; + $inhalt[$y][$x] = preg_replace('/[\x00-\x1F\x7F]/u', '', $inhalt[$y][$x]); + $inhalt[$y][$x] = str_replace('>', ']', str_replace('<', '[', $inhalt[$y][$x])); + if (empty($inhalt[$y][$x])) continue; + //if ($y!=1) $inhalt[$y][$x] = ''; + $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '' . "\n"; //für ungarn sonst weg } + + } + $somecontent .= ''; + if (fwrite($handle, $somecontent) === FALSE) { + echo "Cannot write to file ($filename)";exit; + } + fclose($handle); + +} +fclose($fp); + +echo printHTMLHead(); + +echo ' +
+ ' . ($y - 1) . ' files created +
+ Download as zip + +
'; + +echo ' + + + +'; diff --git a/index6.php b/index6.php index cab2727..3a5268c 100644 --- a/index6.php +++ b/index6.php @@ -1,94 +1,91 @@ -preserveWhiteSpace = false; - $xmlDoc->formatOutput = true; - # $xmlDoc->encoding = 'utf-8'; - $xmlMainElem = $xmlDoc->createElement("record"); - $record_node = $xmlDoc->appendChild($xmlMainElem); //add record element to XML node - # $rss_node->setAttribute("version", "2.0"); //set RSS version - - $lineCount = count($zeile); - - for ($x = 0; $x < $lineCount; $x++) { - $inhalt[$y][$x] = $zeile[$x]; - if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ'; - - $record_node->appendChild(createTextDomElement($xmlDoc, trim($inhalt[1][$x]), trim($inhalt[$y][$x]))); - # $somecontent = $somecontent . '<' . tagify(transform($inhalt[1][$x])) . '>' . (($inhalt[$y][$x])) . '' . "\n"; //für ungarn sonst weg ////////////////////////////////////////////////////////////// - - } - - $somecontent = '' . $xmlDoc->saveXML($xmlDoc->documentElement); - - # $somecontent .= ''; - //if ($y>1) - //{ - if (fwrite($handle, $somecontent) === FALSE) { - echo "Cannot write to file ($filename)";exit; - } - - fclose($handle); -} -fclose($fp); - - -echo printHTMLHead(); - -echo ' -
- ' . ($y - 1) . ' files created
-
- Download as ZIP -
'; +preserveWhiteSpace = false; + $xmlDoc->formatOutput = true; + # $xmlDoc->encoding = 'utf-8'; + $xmlMainElem = $xmlDoc->createElement("record"); + $record_node = $xmlDoc->appendChild($xmlMainElem); //add record element to XML node + # $rss_node->setAttribute("version", "2.0"); //set RSS version + + $lineCount = count($zeile); + + for ($x = 0; $x < $lineCount; $x++) { + $inhalt[$y][$x] = $zeile[$x]; + if ($inhalt[$y][$x] == '') $inhalt[$y][$x] = 'ERSATZ'; + + $record_node->appendChild(createTextDomElement($xmlDoc, trim($inhalt[1][$x]), trim($inhalt[$y][$x]))); + + } + + $somecontent = '' . $xmlDoc->saveXML($xmlDoc->documentElement); + + # $somecontent .= ''; + //if ($y>1) + //{ + if (fwrite($handle, $somecontent) === FALSE) { + echo "Cannot write to file ($filename)";exit; + } + + fclose($handle); +} +fclose($fp); + + +echo printHTMLHead(); + +echo ' +
+ ' . ($y - 1) . ' files created
+
+ Download as ZIP +
'; diff --git a/values/availableFields.php b/values/availableFields.php index 5a85894..91c3978 100644 --- a/values/availableFields.php +++ b/values/availableFields.php @@ -1,1513 +1,1513 @@ - [ - "inventory_number" => [ - "required" => true, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'Only unique values allowed', - "name_human_readable" => $object_basis['inventory_number'], - "explica" => $object_basis['inv_explica'], - ], - "object_type" => [ - "required" => true, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'Keep it short! Field is needed to create valid LIDO from museum-digital entries', - "name_human_readable" => $object_basis['object_type'], - "explica" => $object_basis['oart_explica'], - ], - "object_title" => [ - "required" => true, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'Best is not to repeat the title again and again for many objects, e.g. vase, vase, vase ... better: Green vase, Blue vase, Yellow vase, ...', - "name_human_readable" => $object_basis['object_name'], - "explica" => $object_basis['oname_explica'], - ], - "object_description" => [ - "required" => true, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'A good description of the objects is fundamental to make the objects searchable in the internet', - "name_human_readable" => $object_basis['description'], - "explica" => $object_basis['obesch_explica'], - ], - "object_material_technique" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'This is a cummulative field for material and technique. It is also possible to additionally save the information separate in the fields: material_separate and technique_separate', - "name_human_readable" => $object_basis['mattech'], - "explica" => $object_basis['mattech_explica'], - ], - "object_dimensions" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'This is a cummulative field for dimensions (values and units). It is also possible to additionally save the information separate. See the block: separate dimensions', - "name_human_readable" => $object_basis['measurements'], - "explica" => $object_basis['ausmass_explica'], - ], - "object_publication" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [], - "remark" => 'Shall the object be visible directly after import?', - "name_human_readable" => $objekt['visibility'], - "explica" => '', - ], - "institution_name" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'If name of institution is given it has to be exactly the same as already known in museum-digital', - "name_human_readable" => $museum['museum_name'], - "explica" => $museum['musnam_explica'], - ], - ], - $searchvar[0][0] => [ - "object_other_title" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['object_other_title_kind_of'], - "remark" => 'If the field object_other_title is used. It has to be specified where this alternative title is used. Specification should be done within the field: object_other_title_kind_of', - "name_human_readable" => $searchvar[0][0], - "explica" => '', - ], - "object_other_title_kind_of" => [ - "required" => false, - "allowedValues" => array_values($titelart), - "dependsOn" => ['object_other_title'], - "remark" => 'This field has to be used togehter with object_other_title', - "name_human_readable" => $searchvar[0][0] . ', in: ', - "explica" => '', - ], - ], - $searchvar[46][0] => [ - "detailed_description" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['detailed_description_md', 'detailed_description_extern'], - "remark" => 'If detailed_desription is made available for an object, detailed_description_md and detailed_description_extern have to have values too', - "name_human_readable" => $searchvar[46][0], - "explica" => $object_add['ddesc_inhalt'], - ], - "detailed_description_md" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['detailed_description', 'detailed_description_extern'], - "remark" => 'Shall detailed description be visible at museum-digital? If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too', - "name_human_readable" => $object_add['ddesc_visibility_md'], - "explica" => "", - ], - "detailed_description_extern" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['detailed_description_md', 'detailed_description'], - "remark" => 'Shall later exports from museum-digital include the detailed_description?
If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too', - "name_human_readable" => $object_add['ddesc_visibility_extern'], - "explica" => "", - ], - ], - $searchvar[2][0] => [ - "inscription" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['inscription_md', 'inscription_extern'], - "remark" => 'If inscription is made available for an object, inscription_md> and inscription_extern have to have values too', - "name_human_readable" => $searchvar[2][0], - "explica" => $object_add['besch_inhalt'], - ], - "inscription_md" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['inscription_md', 'inscription_extern'], - "remark" => 'Shall a given inscription be displayed at museum-digital? If inscription is available for an object, inscription_md> and inscription_extern have to have values too', - "name_human_readable" => $object_add['besch_visibility_md'], - "explica" => "", - ], - "inscription_extern" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['inscription_md', 'inscription_extern'], - "remark" => 'Shall later exports from museum-digital inlude inscription? If inscription is available for an object, inscription_md> and inscription_extern have to have values too', - "name_human_readable" => $object_add['besch_visibility_extern'], - "explica" => "", - ], - ], - "{$searchvar[52][0]} / {$searchvar[53][0]}" => [ - "material_separate" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'Additional to collecting material and technique in a combined field (see above), the material(s) can be given here separately', - "name_human_readable" => $searchvar[52][0], - "explica" => "", - ], - "technique_separate" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'Additional to collecting material and technique in a combined field (see above), the technique(s) can be given here separately', - "name_human_readable" => $searchvar[53][0], - "explica" => "", - ], - ], - $object_add['separated_measurements'] => [ - "dimensions_separate_length_value" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_length_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_length_value'], - "explica" => "", - ], - "dimensions_separate_length_unit" => [ - "required" => false, - "allowedValues" => $laengeneinheit, - "dependsOn" => ['dimensions_separate_length_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_length_unit'], - "explica" => "", - ], - "dimensions_separate_width_value" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_width_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_width_value'], - "explica" => "", - ], - "dimensions_separate_width_unit" => [ - "required" => false, - "allowedValues" => $laengeneinheit, - "dependsOn" => ['dimensions_separate_width_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_width_unit'], - "explica" => "", - "required" => false, - ], - "dimensions_separate_height_value" => [ - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_height_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_height_value'], - "explica" => "", - ], - "dimensions_separate_height_unit" => [ - "required" => false, - "allowedValues" => $laengeneinheit, - "dependsOn" => ['dimensions_separate_height_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_height_unit'], - "explica" => "", - ], - "dimensions_separate_weight_value" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_weight_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_weight_value'], - "explica" => "", - ], - "dimensions_separate_weight_unit" => [ - "required" => false, - "allowedValues" => $gewichteinheit, - "dependsOn" => ['dimensions_separate_width_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_weight_unit'], - "explica" => $object_basis['inv_explica'], - ], - "dimensions_separate_diameter_value" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_diameter_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_diameter_value'], - "explica" => "", - ], - "dimensions_separate_diameter_unit" => [ - "required" => false, - "allowedValues" => $laengeneinheit, - "dependsOn" => ['dimensions_separate_diameter_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_diameter_unit'], - "explica" => "", - ], - "dimensions_separate_wall_thickness_value" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_wall_thickness_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_wall_size_value'], - "explica" => "", - ], - "dimensions_separate_wall_thickness_unit" => [ - "required" => false, - "allowedValues" => $laengeneinheit, - "dependsOn" => ['dimensions_separate_wall_thickness_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', - "name_human_readable" => $export['exact_measurements_wall_size_unit'], - "explica" => "", - ], - "dimensions_separate_show_md" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [ - "dimensions_separate_length_value", "dimensions_separate_length_unit", "dimensions_separate_width_value", - "dimensions_separate_width_unit", "dimensions_separate_height_value", "dimensions_separate_height_unit", - "dimensions_separate_weight_value", "dimensions_separate_weight_unit", "dimensions_separate_diameter_value", - "dimensions_separate_diameter_unit", "dimensions_separate_wall_thickness_value", "dimensions_separate_wall_thickness_unit" - ], - "remark" => 'If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be made visible at museum-digital', - "name_human_readable" => $object_basis['inventory_number'], - "explica" => "", - ], - "dimensions_separate_show_extern" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [ - "dimensions_separate_length_value", "dimensions_separate_length_unit", "dimensions_separate_width_value", - "dimensions_separate_width_unit", "dimensions_separate_height_value", "dimensions_separate_height_unit", - "dimensions_separate_weight_value", "dimensions_separate_weight_unit", "dimensions_separate_diameter_value", - "dimensions_separate_diameter_unit", "dimensions_separate_wall_thickness_value", "dimensions_separate_wall_thickness_unit" - ], - "remark" => 'If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be included in a later export from museum-digital', - "name_human_readable" => $object_basis['inventory_number'], - "explica" => "", - ], - "number_of_pieces" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'Only to be given if more than one copies of an object are available and catalogued with the same inventory number', - "name_human_readable" => $export['exact_measurements_number_pieces'], - "explica" => "", - ], - "number_of_pages" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'Only to be given for books (etc.)', - "name_human_readable" => $export['exact_measurements_number_pages'], - "explica" => "", - ], - "dimensions_separate_stamp_position" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['dimensions_separate_show_md', 'dimensions_separate_show_extern'], - "remark" => '', - "name_human_readable" => $export['exact_measurements_stamp_position'], - "explica" => "", - ], - ], - $searchvar[11][0] => [ - "comparable_objects_other_museums" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['comparable_objects_other_museums_show_md', 'comparable_objects_other_museums_show_extern'], - "remark" => 'Name of other museum and if available the inventory number of the respective object. If comparable_objects_other_museums is given comparable_objects_other_museums_show_md and comparable_objects_other_museums_show_extern have to be given too', - "name_human_readable" => $searchvar[11][0], - "explica" => $object_add['vergl_inhalt'], - ], - "comparable_objects_other_museums_show_md" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['comparable_objects_other_museums', 'comparable_objects_other_museums_show_extern'], - "remark" => 'Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be displayed at museum-digital?', - "name_human_readable" => $object_add['vergl_visibility_md'], - "explica" => "", - ], - "comparable_objects_other_museums_show_extern" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ['comparable_objects_other_museums', 'comparable_objects_other_museums_show_md'], - "remark" => 'Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be part of later exports from museum-digital?', - "name_human_readable" => $object_add['vergl_visibility_extern'], - "explica" => "", - ], - ], - $searchvar[1][0] => [ - "closer_location" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ['closer_location_as'], - "remark" => 'A place in a special relation to the object. The kind of relation has to specified in closer_location_as', - "name_human_readable" => $searchvar[1][0], - "explica" => $object_add['loka_inhalt'], - ], - "closer_location_as" => [ - "required" => false, - "allowedValues" => array_values($ortart), - "dependsOn" => ['closer_location'], - "remark" => 'A place in a special relation to the object can be given in closer_location. Here the kind of relation between object and place has to specified', - "name_human_readable" => "{$searchvar[1][0]}, {$object_add['as']}", - "explica" => "", - ], - ], - $object_add['classification'] => [ - "entry_number" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'The entry number of the object if available', - "name_human_readable" => $searchvar[12][0], - "explica" => $object_add['einu_inhalt'], - ], - "other_inventory_number" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'All other inventory numbers (older ones presumably) in one field', - "name_human_readable" => $searchvar[13][0], - "explica" => $object_add['invp_inhalt'], - ], - "subject_group" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'If the object is part of an subject group this information should be given here', - "name_human_readable" => $searchvar[16][0], - "explica" => "", - ], - "systematic" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'If the object is put into a museum-systematic the place it has there', - "name_human_readable" => $searchvar[17][0], - "explica" => "", - ], - "bundle" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'The bundle the object belongs to', - "name_human_readable" => $searchvar[14][0], - "explica" => "", - ], - "part_of" => [ - "required" => false, - "allowedValues" => [], - "remark" => 'If the object is part of something it can be given here', - "name_human_readable" => $searchvar[15][0], - "explica" => "", - ], - ], - $basis['administration'] => [ - "inclusion_when" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[19][0], - "explica" => $object_basis['inv_explica'], - ], - "inclusion_kind_of" => [ - "required" => false, - "allowedValues" => array_values($zugangsart), - "remark" => '', - "name_human_readable" => "{$searchvar[19][0]}, {$object_add['as']}", - "explica" => "", - ], - "inclusion_who" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[47][0]}", - "explica" => "", - ], - "inclusion_where" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[48][0], - "explica" => "", - ], - "registration_first_who" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[49][0], - "explica" => "", - ], - "registration_first_when" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[50][0], - "explica" => "", - ], - ], - $object_add['object_history'] => [ - "owner_previous" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[18][0], - "explica" => $object_add['vorb_inhalt'], - ], - "object_history" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[22][0], - "explica" => $object_add['obge_inhalt'], - ], - "bought_for" => [ - "required" => false, - "allowedValues" => '', - "dependsOn" => ["bought_for_currency"], - "remark" => '', - "name_human_readable" => "{$searchvar[19][0]}, {$object_add['for']}", - "explica" => $object_basis['inv_explica'], - ], - "bought_for_currency" => [ - "required" => false, - "allowedValues" => $currencies, - "dependsOn" => ["bought_for"], - "remark" => '', - "name_human_readable" => "{$searchvar[19][0]}, {$object_add['for']}", - "explica" => "", - ], - ], - $object_add['values'] => [ - "worth_determiner" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[23][0]}; {$object_add['by']}", - "explica" => "", - ], - "worth_when" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[23][0], - "explica" => "", - ], - "worth_value" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[23][0]}; {$object_add['at']}", - "explica" => "", - ], - "worth_unit" => [ - "required" => false, - "allowedValues" => $currencies, - "remark" => '', - "name_human_readable" => "{$searchvar[23][0]}; Currency", - "explica" => "", - ], - "worth_incurance_determiner" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[26][0]}; {$object_add['by']}", - "explica" => "", - ], - "worth_incurance_when" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[26][0]}", - "explica" => "", - ], - "worth_insurance_value" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => "{$searchvar[26][0]}; {$object_add['at']}", - "explica" => "", - ], - "worth_insurance_unit" => [ - "required" => false, - "allowedValues" => $currencies, - "remark" => '', - "name_human_readable" => "{$searchvar[26][0]}; Currency", - "explica" => "", - ], - ], - $object_add['state'] => [ - "state" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[29][0], - "explica" => $object_add['zust_inhalt'], - ], - "restauration" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[30][0], - "explica" => $object_add['rest_inhalt'], - ], - ], - $basis['abode'] => [ - "abode_actual" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[31][0], - "explica" => $object_add['aktu_inhalt'], - ], - "abode_regular" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[32][0], - "explica" => $object_add['stan_inhalt'], - ], - "exhibition" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[33][0], - "explica" => $object_add['aust_inhalt'], - ], - "on_loan_to" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[34][0], - "explica" => $object_add['verl_inhalt'], - ], - "on_loan_contact" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[35][0], - "explica" => $object_add['ansp_inhalt'], - ], - "on_loan_when" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[36][0], - "explica" => $object_add['vher_inhalt'], - ], - "on_loan_insurance_value" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[37][0], - "explica" => $object_add['vlei_inhalt'], - ], - "on_loan_annotation" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[38][0], - "explica" => $object_add['alei_inhalt'], - ], - ], - $basis['rights'] => [ - "rights (object)" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[39][0], - "explica" => $object_add['urhe_inhalt'], - ], - "rights_of_use" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[40][0], - "explica" => $object_add['nure_inhalt'], - ], - "rights_annotation" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[41][0], - "explica" => $object_add['arec_inhalt'], - ], - ], - $basis['remarks'] => [ - "remarks_short" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[42][0], - "explica" => $object_add['kurz_inhalt'], - ], - "remarks_long" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[43][0], - "explica" => $object_add['noti_inhalt'], - ], - "images_in_museum" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[44][0], - "explica" => $object_add['oaim_inhalt'], - ], - "documents_in_museum" => [ - "required" => false, - "allowedValues" => '', - "remark" => '', - "name_human_readable" => $searchvar[45][0], - "explica" => $object_add['odim_inhalt'], - ], - ], - $overview['links'] => [], - $basis['literature'] => [], - $basis['objectgroup'] => [], - $overview['tags'] => [], - $eventname[22] => [], - $eventname[23] => [], - $eventname[24] => [], - $overview['images'] => [], - $basis['resource'] => [], - $basis['event'] . ": " . $eventname[1] => [], - $basis['event'] . ": " . $eventname[2] => [], - $basis['event'] . ": " . $eventname[3] => [], - $basis['event'] . ": " . $eventname[4] => [], - $basis['event'] . ": " . $eventname[5] => [], - $basis['event'] . ": " . $eventname[36] => [], - $basis['event'] . ": " . $eventname[6] => [], - $basis['event'] . ": " . $eventname[7] => [], - $basis['event'] . ": " . $eventname[8] => [], - $basis['event'] . ": " . $eventname[9] => [], - $basis['event'] . ": " . $eventname[10] => [], - $basis['event'] . ": " . $eventname[11] => [], - $basis['event'] . ": " . $eventname[12] => [], - $basis['event'] . ": " . $eventname[13] => [], - $basis['event'] . ": " . $eventname[14] => [], - $basis['event'] . ": " . $eventname[15] => [], - $basis['event'] . ": " . $eventname[16] => [], - $basis['event'] . ": " . $eventname[19] => [], - $basis['event'] . ": " . $eventname[20] => [], - $basis['event'] . ": " . $eventname[21] => [], - $basis['event'] . ": " . $eventname[25] => [], - $basis['event'] . ": " . $eventname[26] => [], - $basis['event'] . ": " . $eventname[27] => [], - $basis['event'] . ": " . $eventname[28] => [], - $basis['event'] . ": " . $eventname[29] => [], - $basis['event'] . ": " . $eventname[30] => [], - $basis['event'] . ": " . $eventname[31] => [], - $basis['event'] . ": " . $eventname[32] => [], - $basis['event'] . ": " . $eventname[33] => [], - $basis['event'] . ": " . $eventname[34] => [], - $basis['event'] . ": " . $eventname[35] => [], - $basis['event'] . ": " . $eventname[37] => [], - $basis['event'] . ": " . $eventname[38] => [], -]; - - -/* - * Repeat fields - */ - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$overview['links']] = array_merge($availableFields[$overview['links']], - [ - "link_url{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["link_show{$i}"], - "remark" => '', - "name_human_readable" => $link['url'], - "explica" => $link['linklink_explica'], - ], - "link_show{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["link_url{$i}"], - "remark" => '', - "name_human_readable" => $link['text'], - "explica" => $link['linkname_explica'], - ], - ]); - -} - -for ($i = 1; $i <= 5; $i++) { - - $availableFields[$basis['literature']] = array_merge($availableFields[$basis['literature']], - [ - "literature_author{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['author'], - "explica" => $literature['autor_explica'], - ], - "literature_year{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['year'], - "explica" => $literature['jahr_explica'], - ], - "literature_title{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => '', - "name_human_readable" => $literature['title'], - "explica" => $literature['titel_explica'], - ], - "literature_place{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['place'], - "explica" => $literature['ort_explica'], - ], - "literature_abbreviation{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['abbr'], - "explica" => $literature['abbr_explica'], - ], - "literature_gnd{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['gnd'], - "explica" => $literature['gnd_explica'], - ], - "literature_isbn{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['isbn'], - "explica" => $literature['isbn_explica'], - ], - "literature_signature{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['id_in_museum'], - "explica" => $literature['id_in_museum_explica'], - ], - "literature_online{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['online'], - "explica" => $literature['online_explica'], - ], - "literature_annotation{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['annotation'], - "explica" => $literature['annotation_explica'], - ], - "literature_inlit{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["literature_title{$i}"], - "remark" => '', - "name_human_readable" => $literature['where_inside'], - "explica" => $literature['where_in_explica'], - ], - ]); - -} - -// Collection names - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$csvxml_overview['object_base_data']]["collection_name{$i}"] = [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => 'Use if object belongs to a collection. If collection is already in museum-digital, please use exactly the same name', - "name_human_readable" => $collection['name'], - "explica" => $collection['samnam_explica'], - ]; - -} - -for ($i = 1; $i <= 5; $i++) { - - $availableFields[$basis['objectgroup']] = array_merge($availableFields[$basis['objectgroup']], - [ - "object_group_name{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [], - "remark" => '', - "name_human_readable" => $link['series_name'], - "explica" => $link['seriename_explica'], - ], - "object_group_description{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["object_group_name{$i}"], - "remark" => '', - "name_human_readable" => $link['series_description'], - "explica" => $link['series_description'], - ], - "object_group_show{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["object_group_name{$i}"], - "remark" => '', - "name_human_readable" => $link['hide_objectgroup'], - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 15; $i++) { - - $availableFields[$overview['tags']]["tag{$i}"] = [ - "required" => false, - "allowedValues" => [], - "remark" => '', - "name_human_readable" => $overview['tags'], - "explica" => "", - ]; - -} - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$eventname[22]] = array_merge($availableFields[$eventname[22]], - [ - "related_place{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["related_place_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['where'], - "explica" => "", - ], - "related_place_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["related_place{$i}"], - "remark" => '', - "name_human_readable" => "{$event['where']} [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$eventname[23]] = array_merge($availableFields[$eventname[23]], - [ - "related_actor{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["related_actor_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['who'], - "explica" => "", - ], - "related_actor_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["related_actor{$i}"], - "remark" => '', - "name_human_readable" => "{$event['who']} [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - "related_actor_gnd{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["related_actor{$i}", "related_actor_sure{$i}"], - "remark" => '', - "name_human_readable" => "{$event['who']} ({$event['gnd']})", - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$eventname[24]] = array_merge($availableFields[$eventname[24]], - [ - "related_time{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["related_time_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['when'], - "explica" => "", - ], - "related_time_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["related_time{$i}"], - "remark" => '', - "name_human_readable" => $event['when'] . " [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 5; $i++) { - - $availableFields[$overview['images']] = array_merge($availableFields[$overview['images']], - [ - "image_name{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => $csvxml_overview['image_filename'], - "explica" => "", - ], - "image_description{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => $image_incha['image_description'], - "explica" => $image_incha['bildbesch_explica'], - ], - "image_owner{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "image_name{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => $image_incha['image_rightsholder'], - "explica" => $image_incha['owner_explica'], - ], - "image_creator{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => $image_incha['photographer'], - "explica" => $image_incha['creator_explica'], - ], - "image_rights{$i}" => [ - "required" => false, - "allowedValues" => array_keys($availableLicenses), - "dependsOn" => [ - "image_name{$i}", "image_owner{$i}", "image_visible{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => $image_incha['rights_status'], - "explica" => $image_incha['rechte_explica'], - ], - "image_visible{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [ - "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_main{$i}" - ], - "remark" => '', - "name_human_readable" => "{$basis['image']}: {$objekt['visibility']}", - "explica" => "", - ], - "image_main{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [ - "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}" - ], - "remark" => '', - "name_human_readable" => $object['main_image'], - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 5; $i++) { - - $availableFields[$basis['resource']] = array_merge($availableFields[$basis['resource']], - [ - "resource_media_type{$i}" => [ - "required" => false, - "allowedValues" => ['image', 'text', 'video', 'audio'], - "dependsOn" => [ - "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'Allowed values: image, text, video, audio', - "name_human_readable" => $basis['resource'] . ', ' . $tlSources['type'], - "explica" => "", - ], - "resource_fileformat{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "resource_media_type{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'e.g. pdf, mp3', - "name_human_readable" => $csvxml_overview['file_format'], - "explica" => "", - ], - "resource_location{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'In case the resource is stored externally: please include the whole path (incl. http or https) to the file. If the resource is uploaded to museum-digital: please put the filename here (e.g. file.pdf)', - "name_human_readable" => $resource_incha['image_filename'], - "explica" => "", - ], - "resource_name{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'Use, if you want to give the resource an own name. If not, you might want to repeat the object_title', - "name_human_readable" => $resource_incha['resource_name'], - "explica" => $resource_incha['bildname_explica'], - ], - "resource_description{$i}" => [ - "required" => false, - "allowedValues" => ['Use if you want to describe the resource. Might be left empty.'], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => '', - "name_human_readable" => $resource_incha['resource_description'], - "explica" => $resource_incha['bildbesch_explica'], - ], - "resource_owner{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'The owner should be named. Usually it is the institution uploading the resource.', - "name_human_readable" => $resource_incha['resource_rightsholder'], - "explica" => $resource_incha['owner_explica'], - ], - "resource_creator{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", - ], - "remark" => 'Name of the person that created the resource. Might be left empty.', - "name_human_readable" => $resource_incha['creator'], - "explica" => $resource_incha['creator_explica'], - ], - "resource_rights{$i}" => [ - "required" => false, - "allowedValues" => array_keys($availableLicenses), - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_visible{$i}", - ], - "remark" => '', - "name_human_readable" => $resource_incha['rights_status'], - "explica" => $resource_incha['rechte_explica'], - ], - "resource_visible{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => [ - "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", - ], - "remark" => 'Should the resource be publicly visible? Allowed values are either y and n', - "name_human_readable" => "{$basis['resource']}: {$objekt['visibility']}", - "explica" => "", - ], - ]); - -} - -/** - * Function for getting a simple array definition of an available field. - * - * @param string $nameTL Translation of the field name. Optional. - * @param string $explica Explanation of the field (from musdb). Optional. - * @param array $dependsOn Dependent fields. Optional. - * @param array $allowedValues Allowed values. Optional. - * @param string $remark Explanation of the field (for importer). Optional. - * @param boolean $required Determines whether the field is required. Defaults - to false. - * - * @return array - */ -function getSimpleAvailableFieldEntry(string $nameTL = "", string $explica = "", array $dependsOn = [], array $allowedValues = [], string $remark = "", bool $required = false):array { - return [ - "required" => $required, - "allowedValues" => $allowedValues, - "dependsOn" => $dependsOn, - "remark" => $remark, - "name_human_readable" => $nameTL, - "explica" => $explica, - ]; - -} - -/** - * Function for building a generic event type definition. - * - * @param string[] $event Translation variable. - * @param string[] $csvxml_overview Translation variable. - * @param string $typeName Translated name of event type. - * @param string $type Event type name (e.g. production). - * @param integer $number Number of event of this type. - * - * @return array - */ -function generateGenericFullEvent(array $event, array $csvxml_overview, string $typeName, string $type, int $number):array { - - return [ - "{$type}_when{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['when']}", "", ["{$type}_when_sure{$number}"]), - "{$type}_when_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['when']} [{$csvxml_overview['certainty']}]", "", ["{$type}_when{$number}"], ["y", "n"]), - "{$type}_who{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']}", "", ["{$type}_who_sure{$number}"]), - "{$type}_who_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']} [{$csvxml_overview['certainty']}]", "", ["{$type}_who{$number}"], ["y", "n"]), - "{$type}_who_gnd{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']} ({$event['gnd']})", "", ["{$type}_who_sure{$number}", "{$type}_who{$number}"]), - "{$type}_where{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['where']}", "", ["{$type}_where_sure{$number}"]), - "{$type}_where_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['where']} [{$csvxml_overview['certainty']}]", "", ["{$type}_where{$number}"], ["y", "n"]), - "{$type}_annotation{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['classic_annotation_intro']}", ""), - ]; - -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[1]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[1]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[1], "production", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[2]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[2]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[2], "finding", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[3]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[3]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[3], "publication", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[4]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[4]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[4], "template_creation", $i) - ); -} - -for ($i = 1; $i <= 15; $i++) { - - $availableFields[$basis['event'] . ': ' . $eventname[5]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[5]], - [ - "was_depicted_who{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["was_depicted_who_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['who'], - "explica" => "", - ], - "was_depicted_who_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["was_depicted_who{$i}"], - "remark" => '', - "name_human_readable" => $event['who'] . " [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 10; $i++) { - - $availableFields[$basis['event'] . ': ' . $eventname[36]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[36]], - [ - "was_depicted_place{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["was_depicted_place_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['where'], - "explica" => "", - ], - "was_depicted_place_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["was_depicted_place{$i}"], - "remark" => '', - "name_human_readable" => $event['where'] . " [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - ]); - -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[6]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[6]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[6], "was_used", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[7]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[7]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[7], "written", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[8]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[8]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[8], "collected", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[9]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[9]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[9], "painted", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[10]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[10]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[10], "taken", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[11]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[11]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[11], "received", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[12]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[12]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[12], "printing_plate_produced", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[13]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[13]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[13], "sent", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[14]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[14]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[14], "issued", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[15]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[15]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[15], "signed", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[16]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[16]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[16], "type_described", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[19]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[19]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[19], "drawn", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[20]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[20]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[20], "copied", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[25]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[25]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[25], "commissioned", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[26]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[26]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[26], "printed", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[27]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[27]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[27], "spoken", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[28]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[28]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[28], "sung", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[29]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[29]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[29], "decor_designed", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[30]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[30]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[30], "form_designed", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[31]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[31]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[31], "modelled", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[32]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[32]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[32], "signed_artwork", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[33]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[33]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[33], "was_mentioned", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[34]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[34]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[34], "buried", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[35]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[35]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[35], "intellectual_creation", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[37]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[37]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[37], "painted_on", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - $availableFields[$basis['event'] . ': ' . $eventname[38]] = array_merge( - $availableFields[$basis['event'] . ': ' . $eventname[38]], - generateGenericFullEvent($event, $csvxml_overview, $eventname[38], "illustrated", $i) - ); -} - -for ($i = 1; $i <= 2; $i++) { - - $availableFields[$basis['event'] . ': ' . $eventname[21]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[21]], - [ - "has_lived_when{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["has_lived_when_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['when'], - "explica" => "", - ], - "has_lived_when_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["has_lived_when{$i}"], - "remark" => '', - "name_human_readable" => $event['when'] . " [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - "has_lived_where{$i}" => [ - "required" => false, - "allowedValues" => [], - "dependsOn" => ["has_lived_where_sure{$i}"], - "remark" => '', - "name_human_readable" => $event['where'], - "explica" => "", - ], - "has_lived_where_sure{$i}" => [ - "required" => false, - "allowedValues" => ["y", "n"], - "dependsOn" => ["has_lived_where{$i}"], - "remark" => '', - "name_human_readable" => $event['where'] . " [{$csvxml_overview['certainty']}]", - "explica" => "", - ], - "has_lived_annotation{$i}" => [ - "required" => false, - "allowedValues" => '', - "dependsOn" => [], - "remark" => '', - "name_human_readable" => $event['classic_annotation_intro'], - "explica" => "", - ], - ]); - -} + [ + "inventory_number" => [ + "required" => true, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'Only unique values allowed', + "name_human_readable" => $object_basis['inventory_number'], + "explica" => $object_basis['inv_explica'], + ], + "object_type" => [ + "required" => true, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'Keep it short! Field is needed to create valid LIDO from museum-digital entries', + "name_human_readable" => $object_basis['object_type'], + "explica" => $object_basis['oart_explica'], + ], + "object_title" => [ + "required" => true, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'Best is not to repeat the title again and again for many objects, e.g. vase, vase, vase ... better: Green vase, Blue vase, Yellow vase, ...', + "name_human_readable" => $object_basis['object_name'], + "explica" => $object_basis['oname_explica'], + ], + "object_description" => [ + "required" => true, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'A good description of the objects is fundamental to make the objects searchable in the internet', + "name_human_readable" => $object_basis['description'], + "explica" => $object_basis['obesch_explica'], + ], + "object_material_technique" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'This is a cummulative field for material and technique. It is also possible to additionally save the information separate in the fields: material_separate and technique_separate', + "name_human_readable" => $object_basis['mattech'], + "explica" => $object_basis['mattech_explica'], + ], + "object_dimensions" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'This is a cummulative field for dimensions (values and units). It is also possible to additionally save the information separate. See the block: separate dimensions', + "name_human_readable" => $object_basis['measurements'], + "explica" => $object_basis['ausmass_explica'], + ], + "object_publication" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [], + "remark" => 'Shall the object be visible directly after import?', + "name_human_readable" => $objekt['visibility'], + "explica" => '', + ], + "institution_name" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'If name of institution is given it has to be exactly the same as already known in museum-digital', + "name_human_readable" => $museum['museum_name'], + "explica" => $museum['musnam_explica'], + ], + ], + $searchvar[0][0] => [ + "object_other_title" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['object_other_title_kind_of'], + "remark" => 'If the field object_other_title is used. It has to be specified where this alternative title is used. Specification should be done within the field: object_other_title_kind_of', + "name_human_readable" => $searchvar[0][0], + "explica" => '', + ], + "object_other_title_kind_of" => [ + "required" => false, + "allowedValues" => array_values($titelart), + "dependsOn" => ['object_other_title'], + "remark" => 'This field has to be used togehter with object_other_title', + "name_human_readable" => $searchvar[0][0] . ', in: ', + "explica" => '', + ], + ], + $searchvar[46][0] => [ + "detailed_description" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['detailed_description_md', 'detailed_description_extern'], + "remark" => 'If detailed_desription is made available for an object, detailed_description_md and detailed_description_extern have to have values too', + "name_human_readable" => $searchvar[46][0], + "explica" => $object_add['ddesc_inhalt'], + ], + "detailed_description_md" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['detailed_description', 'detailed_description_extern'], + "remark" => 'Shall detailed description be visible at museum-digital? If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too', + "name_human_readable" => $object_add['ddesc_visibility_md'], + "explica" => "", + ], + "detailed_description_extern" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['detailed_description_md', 'detailed_description'], + "remark" => 'Shall later exports from museum-digital include the detailed_description?
If detailed_desription is available for an object, detailed_description_md and detailed_description_extern have to have values too', + "name_human_readable" => $object_add['ddesc_visibility_extern'], + "explica" => "", + ], + ], + $searchvar[2][0] => [ + "inscription" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['inscription_md', 'inscription_extern'], + "remark" => 'If inscription is made available for an object, inscription_md> and inscription_extern have to have values too', + "name_human_readable" => $searchvar[2][0], + "explica" => $object_add['besch_inhalt'], + ], + "inscription_md" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['inscription_md', 'inscription_extern'], + "remark" => 'Shall a given inscription be displayed at museum-digital? If inscription is available for an object, inscription_md> and inscription_extern have to have values too', + "name_human_readable" => $object_add['besch_visibility_md'], + "explica" => "", + ], + "inscription_extern" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['inscription_md', 'inscription_extern'], + "remark" => 'Shall later exports from museum-digital inlude inscription? If inscription is available for an object, inscription_md> and inscription_extern have to have values too', + "name_human_readable" => $object_add['besch_visibility_extern'], + "explica" => "", + ], + ], + "{$searchvar[52][0]} / {$searchvar[53][0]}" => [ + "material_separate" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'Additional to collecting material and technique in a combined field (see above), the material(s) can be given here separately', + "name_human_readable" => $searchvar[52][0], + "explica" => "", + ], + "technique_separate" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'Additional to collecting material and technique in a combined field (see above), the technique(s) can be given here separately', + "name_human_readable" => $searchvar[53][0], + "explica" => "", + ], + ], + $object_add['separated_measurements'] => [ + "dimensions_separate_length_value" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_length_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_length_value'], + "explica" => "", + ], + "dimensions_separate_length_unit" => [ + "required" => false, + "allowedValues" => $laengeneinheit, + "dependsOn" => ['dimensions_separate_length_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_length_unit'], + "explica" => "", + ], + "dimensions_separate_width_value" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_width_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_width_value'], + "explica" => "", + ], + "dimensions_separate_width_unit" => [ + "required" => false, + "allowedValues" => $laengeneinheit, + "dependsOn" => ['dimensions_separate_width_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_width_unit'], + "explica" => "", + "required" => false, + ], + "dimensions_separate_height_value" => [ + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_height_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_height_value'], + "explica" => "", + ], + "dimensions_separate_height_unit" => [ + "required" => false, + "allowedValues" => $laengeneinheit, + "dependsOn" => ['dimensions_separate_height_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_height_unit'], + "explica" => "", + ], + "dimensions_separate_weight_value" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_weight_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_weight_value'], + "explica" => "", + ], + "dimensions_separate_weight_unit" => [ + "required" => false, + "allowedValues" => $gewichteinheit, + "dependsOn" => ['dimensions_separate_width_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_weight_unit'], + "explica" => $object_basis['inv_explica'], + ], + "dimensions_separate_diameter_value" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_diameter_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_diameter_value'], + "explica" => "", + ], + "dimensions_separate_diameter_unit" => [ + "required" => false, + "allowedValues" => $laengeneinheit, + "dependsOn" => ['dimensions_separate_diameter_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_diameter_unit'], + "explica" => "", + ], + "dimensions_separate_wall_thickness_value" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_wall_thickness_unit', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_wall_size_value'], + "explica" => "", + ], + "dimensions_separate_wall_thickness_unit" => [ + "required" => false, + "allowedValues" => $laengeneinheit, + "dependsOn" => ['dimensions_separate_wall_thickness_value', 'dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => 'If a separated value is given an entry for the respective unit is necessary. If a separated dimension entry is given, dimensions_separate_show_md and dimensions_separate_show_extern need to be filled in, too.', + "name_human_readable" => $export['exact_measurements_wall_size_unit'], + "explica" => "", + ], + "dimensions_separate_show_md" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [ + "dimensions_separate_length_value", "dimensions_separate_length_unit", "dimensions_separate_width_value", + "dimensions_separate_width_unit", "dimensions_separate_height_value", "dimensions_separate_height_unit", + "dimensions_separate_weight_value", "dimensions_separate_weight_unit", "dimensions_separate_diameter_value", + "dimensions_separate_diameter_unit", "dimensions_separate_wall_thickness_value", "dimensions_separate_wall_thickness_unit" + ], + "remark" => 'If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be made visible at museum-digital', + "name_human_readable" => $object_basis['inventory_number'], + "explica" => "", + ], + "dimensions_separate_show_extern" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [ + "dimensions_separate_length_value", "dimensions_separate_length_unit", "dimensions_separate_width_value", + "dimensions_separate_width_unit", "dimensions_separate_height_value", "dimensions_separate_height_unit", + "dimensions_separate_weight_value", "dimensions_separate_weight_unit", "dimensions_separate_diameter_value", + "dimensions_separate_diameter_unit", "dimensions_separate_wall_thickness_value", "dimensions_separate_wall_thickness_unit" + ], + "remark" => 'If one or more separate dimension-value (and -unit) is given it has to be specified if the separated entries should be included in a later export from museum-digital', + "name_human_readable" => $object_basis['inventory_number'], + "explica" => "", + ], + "number_of_pieces" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'Only to be given if more than one copies of an object are available and catalogued with the same inventory number', + "name_human_readable" => $export['exact_measurements_number_pieces'], + "explica" => "", + ], + "number_of_pages" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'Only to be given for books (etc.)', + "name_human_readable" => $export['exact_measurements_number_pages'], + "explica" => "", + ], + "dimensions_separate_stamp_position" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['dimensions_separate_show_md', 'dimensions_separate_show_extern'], + "remark" => '', + "name_human_readable" => $export['exact_measurements_stamp_position'], + "explica" => "", + ], + ], + $searchvar[11][0] => [ + "comparable_objects_other_museums" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['comparable_objects_other_museums_show_md', 'comparable_objects_other_museums_show_extern'], + "remark" => 'Name of other museum and if available the inventory number of the respective object. If comparable_objects_other_museums is given comparable_objects_other_museums_show_md and comparable_objects_other_museums_show_extern have to be given too', + "name_human_readable" => $searchvar[11][0], + "explica" => $object_add['vergl_inhalt'], + ], + "comparable_objects_other_museums_show_md" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['comparable_objects_other_museums', 'comparable_objects_other_museums_show_extern'], + "remark" => 'Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be displayed at museum-digital?', + "name_human_readable" => $object_add['vergl_visibility_md'], + "explica" => "", + ], + "comparable_objects_other_museums_show_extern" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ['comparable_objects_other_museums', 'comparable_objects_other_museums_show_md'], + "remark" => 'Necessary if comparable_objects_other_museums is given. Should the information about comparable objects be part of later exports from museum-digital?', + "name_human_readable" => $object_add['vergl_visibility_extern'], + "explica" => "", + ], + ], + $searchvar[1][0] => [ + "closer_location" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ['closer_location_as'], + "remark" => 'A place in a special relation to the object. The kind of relation has to specified in closer_location_as', + "name_human_readable" => $searchvar[1][0], + "explica" => $object_add['loka_inhalt'], + ], + "closer_location_as" => [ + "required" => false, + "allowedValues" => array_values($ortart), + "dependsOn" => ['closer_location'], + "remark" => 'A place in a special relation to the object can be given in closer_location. Here the kind of relation between object and place has to specified', + "name_human_readable" => "{$searchvar[1][0]}, {$object_add['as']}", + "explica" => "", + ], + ], + $object_add['classification'] => [ + "entry_number" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'The entry number of the object if available', + "name_human_readable" => $searchvar[12][0], + "explica" => $object_add['einu_inhalt'], + ], + "other_inventory_number" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'All other inventory numbers (older ones presumably) in one field', + "name_human_readable" => $searchvar[13][0], + "explica" => $object_add['invp_inhalt'], + ], + "subject_group" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'If the object is part of an subject group this information should be given here', + "name_human_readable" => $searchvar[16][0], + "explica" => "", + ], + "systematic" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'If the object is put into a museum-systematic the place it has there', + "name_human_readable" => $searchvar[17][0], + "explica" => "", + ], + "bundle" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'The bundle the object belongs to', + "name_human_readable" => $searchvar[14][0], + "explica" => "", + ], + "part_of" => [ + "required" => false, + "allowedValues" => [], + "remark" => 'If the object is part of something it can be given here', + "name_human_readable" => $searchvar[15][0], + "explica" => "", + ], + ], + $basis['administration'] => [ + "inclusion_when" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[19][0], + "explica" => $object_basis['inv_explica'], + ], + "inclusion_kind_of" => [ + "required" => false, + "allowedValues" => array_values($zugangsart), + "remark" => '', + "name_human_readable" => "{$searchvar[19][0]}, {$object_add['as']}", + "explica" => "", + ], + "inclusion_who" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[47][0]}", + "explica" => "", + ], + "inclusion_where" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[48][0], + "explica" => "", + ], + "registration_first_who" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[49][0], + "explica" => "", + ], + "registration_first_when" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[50][0], + "explica" => "", + ], + ], + $object_add['object_history'] => [ + "owner_previous" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[18][0], + "explica" => $object_add['vorb_inhalt'], + ], + "object_history" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[22][0], + "explica" => $object_add['obge_inhalt'], + ], + "bought_for" => [ + "required" => false, + "allowedValues" => '', + "dependsOn" => ["bought_for_currency"], + "remark" => '', + "name_human_readable" => "{$searchvar[19][0]}, {$object_add['for']}", + "explica" => $object_basis['inv_explica'], + ], + "bought_for_currency" => [ + "required" => false, + "allowedValues" => $currencies, + "dependsOn" => ["bought_for"], + "remark" => '', + "name_human_readable" => "{$searchvar[19][0]}, {$object_add['for']}", + "explica" => "", + ], + ], + $object_add['values'] => [ + "worth_determiner" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[23][0]}; {$object_add['by']}", + "explica" => "", + ], + "worth_when" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[23][0], + "explica" => "", + ], + "worth_value" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[23][0]}; {$object_add['at']}", + "explica" => "", + ], + "worth_unit" => [ + "required" => false, + "allowedValues" => $currencies, + "remark" => '', + "name_human_readable" => "{$searchvar[23][0]}; Currency", + "explica" => "", + ], + "worth_incurance_determiner" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[26][0]}; {$object_add['by']}", + "explica" => "", + ], + "worth_incurance_when" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[26][0]}", + "explica" => "", + ], + "worth_insurance_value" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => "{$searchvar[26][0]}; {$object_add['at']}", + "explica" => "", + ], + "worth_insurance_unit" => [ + "required" => false, + "allowedValues" => $currencies, + "remark" => '', + "name_human_readable" => "{$searchvar[26][0]}; Currency", + "explica" => "", + ], + ], + $object_add['state'] => [ + "state" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[29][0], + "explica" => $object_add['zust_inhalt'], + ], + "restauration" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[30][0], + "explica" => $object_add['rest_inhalt'], + ], + ], + $basis['abode'] => [ + "abode_actual" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[31][0], + "explica" => $object_add['aktu_inhalt'], + ], + "abode_regular" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[32][0], + "explica" => $object_add['stan_inhalt'], + ], + "exhibition" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[33][0], + "explica" => $object_add['aust_inhalt'], + ], + "on_loan_to" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[34][0], + "explica" => $object_add['verl_inhalt'], + ], + "on_loan_contact" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[35][0], + "explica" => $object_add['ansp_inhalt'], + ], + "on_loan_when" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[36][0], + "explica" => $object_add['vher_inhalt'], + ], + "on_loan_insurance_value" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[37][0], + "explica" => $object_add['vlei_inhalt'], + ], + "on_loan_annotation" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[38][0], + "explica" => $object_add['alei_inhalt'], + ], + ], + $basis['rights'] => [ + "rights (object)" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[39][0], + "explica" => $object_add['urhe_inhalt'], + ], + "rights_of_use" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[40][0], + "explica" => $object_add['nure_inhalt'], + ], + "rights_annotation" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[41][0], + "explica" => $object_add['arec_inhalt'], + ], + ], + $basis['remarks'] => [ + "remarks_short" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[42][0], + "explica" => $object_add['kurz_inhalt'], + ], + "remarks_long" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[43][0], + "explica" => $object_add['noti_inhalt'], + ], + "images_in_museum" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[44][0], + "explica" => $object_add['oaim_inhalt'], + ], + "documents_in_museum" => [ + "required" => false, + "allowedValues" => '', + "remark" => '', + "name_human_readable" => $searchvar[45][0], + "explica" => $object_add['odim_inhalt'], + ], + ], + $overview['links'] => [], + $basis['literature'] => [], + $basis['objectgroup'] => [], + $overview['tags'] => [], + $eventname[22] => [], + $eventname[23] => [], + $eventname[24] => [], + $overview['images'] => [], + $basis['resource'] => [], + $basis['event'] . ": " . $eventname[1] => [], + $basis['event'] . ": " . $eventname[2] => [], + $basis['event'] . ": " . $eventname[3] => [], + $basis['event'] . ": " . $eventname[4] => [], + $basis['event'] . ": " . $eventname[5] => [], + $basis['event'] . ": " . $eventname[36] => [], + $basis['event'] . ": " . $eventname[6] => [], + $basis['event'] . ": " . $eventname[7] => [], + $basis['event'] . ": " . $eventname[8] => [], + $basis['event'] . ": " . $eventname[9] => [], + $basis['event'] . ": " . $eventname[10] => [], + $basis['event'] . ": " . $eventname[11] => [], + $basis['event'] . ": " . $eventname[12] => [], + $basis['event'] . ": " . $eventname[13] => [], + $basis['event'] . ": " . $eventname[14] => [], + $basis['event'] . ": " . $eventname[15] => [], + $basis['event'] . ": " . $eventname[16] => [], + $basis['event'] . ": " . $eventname[19] => [], + $basis['event'] . ": " . $eventname[20] => [], + $basis['event'] . ": " . $eventname[21] => [], + $basis['event'] . ": " . $eventname[25] => [], + $basis['event'] . ": " . $eventname[26] => [], + $basis['event'] . ": " . $eventname[27] => [], + $basis['event'] . ": " . $eventname[28] => [], + $basis['event'] . ": " . $eventname[29] => [], + $basis['event'] . ": " . $eventname[30] => [], + $basis['event'] . ": " . $eventname[31] => [], + $basis['event'] . ": " . $eventname[32] => [], + $basis['event'] . ": " . $eventname[33] => [], + $basis['event'] . ": " . $eventname[34] => [], + $basis['event'] . ": " . $eventname[35] => [], + $basis['event'] . ": " . $eventname[37] => [], + $basis['event'] . ": " . $eventname[38] => [], +]; + + +/* + * Repeat fields + */ + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$overview['links']] = array_merge($availableFields[$overview['links']], + [ + "link_url{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["link_show{$i}"], + "remark" => '', + "name_human_readable" => $link['url'], + "explica" => $link['linklink_explica'], + ], + "link_show{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["link_url{$i}"], + "remark" => '', + "name_human_readable" => $link['text'], + "explica" => $link['linkname_explica'], + ], + ]); + +} + +for ($i = 1; $i <= 5; $i++) { + + $availableFields[$basis['literature']] = array_merge($availableFields[$basis['literature']], + [ + "literature_author{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['author'], + "explica" => $literature['autor_explica'], + ], + "literature_year{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['year'], + "explica" => $literature['jahr_explica'], + ], + "literature_title{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => '', + "name_human_readable" => $literature['title'], + "explica" => $literature['titel_explica'], + ], + "literature_place{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['place'], + "explica" => $literature['ort_explica'], + ], + "literature_abbreviation{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['abbr'], + "explica" => $literature['abbr_explica'], + ], + "literature_gnd{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['gnd'], + "explica" => $literature['gnd_explica'], + ], + "literature_isbn{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['isbn'], + "explica" => $literature['isbn_explica'], + ], + "literature_signature{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['id_in_museum'], + "explica" => $literature['id_in_museum_explica'], + ], + "literature_online{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['online'], + "explica" => $literature['online_explica'], + ], + "literature_annotation{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['annotation'], + "explica" => $literature['annotation_explica'], + ], + "literature_inlit{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["literature_title{$i}"], + "remark" => '', + "name_human_readable" => $literature['where_inside'], + "explica" => $literature['where_in_explica'], + ], + ]); + +} + +// Collection names + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$csvxml_overview['object_base_data']]["collection_name{$i}"] = [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => 'Use if object belongs to a collection. If collection is already in museum-digital, please use exactly the same name', + "name_human_readable" => $collection['name'], + "explica" => $collection['samnam_explica'], + ]; + +} + +for ($i = 1; $i <= 5; $i++) { + + $availableFields[$basis['objectgroup']] = array_merge($availableFields[$basis['objectgroup']], + [ + "object_group_name{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [], + "remark" => '', + "name_human_readable" => $link['series_name'], + "explica" => $link['seriename_explica'], + ], + "object_group_description{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["object_group_name{$i}"], + "remark" => '', + "name_human_readable" => $link['series_description'], + "explica" => $link['series_description'], + ], + "object_group_show{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["object_group_name{$i}"], + "remark" => '', + "name_human_readable" => $link['hide_objectgroup'], + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 15; $i++) { + + $availableFields[$overview['tags']]["tag{$i}"] = [ + "required" => false, + "allowedValues" => [], + "remark" => '', + "name_human_readable" => $overview['tags'], + "explica" => "", + ]; + +} + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$eventname[22]] = array_merge($availableFields[$eventname[22]], + [ + "related_place{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["related_place_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['where'], + "explica" => "", + ], + "related_place_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["related_place{$i}"], + "remark" => '', + "name_human_readable" => "{$event['where']} [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$eventname[23]] = array_merge($availableFields[$eventname[23]], + [ + "related_actor{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["related_actor_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['who'], + "explica" => "", + ], + "related_actor_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["related_actor{$i}"], + "remark" => '', + "name_human_readable" => "{$event['who']} [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + "related_actor_gnd{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["related_actor{$i}", "related_actor_sure{$i}"], + "remark" => '', + "name_human_readable" => "{$event['who']} ({$event['gnd']})", + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$eventname[24]] = array_merge($availableFields[$eventname[24]], + [ + "related_time{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["related_time_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['when'], + "explica" => "", + ], + "related_time_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["related_time{$i}"], + "remark" => '', + "name_human_readable" => $event['when'] . " [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 5; $i++) { + + $availableFields[$overview['images']] = array_merge($availableFields[$overview['images']], + [ + "image_name{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => $csvxml_overview['image_filename'], + "explica" => "", + ], + "image_description{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => $image_incha['image_description'], + "explica" => $image_incha['bildbesch_explica'], + ], + "image_owner{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "image_name{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => $image_incha['image_rightsholder'], + "explica" => $image_incha['owner_explica'], + ], + "image_creator{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => $image_incha['photographer'], + "explica" => $image_incha['creator_explica'], + ], + "image_rights{$i}" => [ + "required" => false, + "allowedValues" => array_keys($availableLicenses), + "dependsOn" => [ + "image_name{$i}", "image_owner{$i}", "image_visible{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => $image_incha['rights_status'], + "explica" => $image_incha['rechte_explica'], + ], + "image_visible{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [ + "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_main{$i}" + ], + "remark" => '', + "name_human_readable" => "{$basis['image']}: {$objekt['visibility']}", + "explica" => "", + ], + "image_main{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [ + "image_name{$i}", "image_owner{$i}", "image_rights{$i}", "image_visible{$i}" + ], + "remark" => '', + "name_human_readable" => $object['main_image'], + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 5; $i++) { + + $availableFields[$basis['resource']] = array_merge($availableFields[$basis['resource']], + [ + "resource_media_type{$i}" => [ + "required" => false, + "allowedValues" => ['image', 'text', 'video', 'audio'], + "dependsOn" => [ + "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'Allowed values: image, text, video, audio', + "name_human_readable" => $basis['resource'] . ', ' . $tlSources['type'], + "explica" => "", + ], + "resource_fileformat{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "resource_media_type{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'e.g. pdf, mp3', + "name_human_readable" => $csvxml_overview['file_format'], + "explica" => "", + ], + "resource_location{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'In case the resource is stored externally: please include the whole path (incl. http or https) to the file. If the resource is uploaded to museum-digital: please put the filename here (e.g. file.pdf)', + "name_human_readable" => $resource_incha['image_filename'], + "explica" => "", + ], + "resource_name{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'Use, if you want to give the resource an own name. If not, you might want to repeat the object_title', + "name_human_readable" => $resource_incha['resource_name'], + "explica" => $resource_incha['bildname_explica'], + ], + "resource_description{$i}" => [ + "required" => false, + "allowedValues" => ['Use if you want to describe the resource. Might be left empty.'], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => '', + "name_human_readable" => $resource_incha['resource_description'], + "explica" => $resource_incha['bildbesch_explica'], + ], + "resource_owner{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'The owner should be named. Usually it is the institution uploading the resource.', + "name_human_readable" => $resource_incha['resource_rightsholder'], + "explica" => $resource_incha['owner_explica'], + ], + "resource_creator{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", "resource_visible{$i}", + ], + "remark" => 'Name of the person that created the resource. Might be left empty.', + "name_human_readable" => $resource_incha['creator'], + "explica" => $resource_incha['creator_explica'], + ], + "resource_rights{$i}" => [ + "required" => false, + "allowedValues" => array_keys($availableLicenses), + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_visible{$i}", + ], + "remark" => '', + "name_human_readable" => $resource_incha['rights_status'], + "explica" => $resource_incha['rechte_explica'], + ], + "resource_visible{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => [ + "resource_media_type{$i}", "resource_fileformat{$i}", "resource_location{$i}", "resource_name{$i}", "resource_owner{$i}", "resource_rights{$i}", + ], + "remark" => 'Should the resource be publicly visible? Allowed values are either y and n', + "name_human_readable" => "{$basis['resource']}: {$objekt['visibility']}", + "explica" => "", + ], + ]); + +} + +/** + * Function for getting a simple array definition of an available field. + * + * @param string $nameTL Translation of the field name. Optional. + * @param string $explica Explanation of the field (from musdb). Optional. + * @param array $dependsOn Dependent fields. Optional. + * @param array $allowedValues Allowed values. Optional. + * @param string $remark Explanation of the field (for importer). Optional. + * @param boolean $required Determines whether the field is required. Defaults + to false. + * + * @return array + */ +function getSimpleAvailableFieldEntry(string $nameTL = "", string $explica = "", array $dependsOn = [], array $allowedValues = [], string $remark = "", bool $required = false):array { + return [ + "required" => $required, + "allowedValues" => $allowedValues, + "dependsOn" => $dependsOn, + "remark" => $remark, + "name_human_readable" => $nameTL, + "explica" => $explica, + ]; + +} + +/** + * Function for building a generic event type definition. + * + * @param string[] $event Translation variable. + * @param string[] $csvxml_overview Translation variable. + * @param string $typeName Translated name of event type. + * @param string $type Event type name (e.g. production). + * @param integer $number Number of event of this type. + * + * @return array + */ +function generateGenericFullEvent(array $event, array $csvxml_overview, string $typeName, string $type, int $number):array { + + return [ + "{$type}_when{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['when']}", "", ["{$type}_when_sure{$number}"]), + "{$type}_when_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['when']} [{$csvxml_overview['certainty']}]", "", ["{$type}_when{$number}"], ["y", "n"]), + "{$type}_who{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']}", "", ["{$type}_who_sure{$number}"]), + "{$type}_who_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']} [{$csvxml_overview['certainty']}]", "", ["{$type}_who{$number}"], ["y", "n"]), + "{$type}_who_gnd{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['who']} ({$event['gnd']})", "", ["{$type}_who_sure{$number}", "{$type}_who{$number}"]), + "{$type}_where{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['where']}", "", ["{$type}_where_sure{$number}"]), + "{$type}_where_sure{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['where']} [{$csvxml_overview['certainty']}]", "", ["{$type}_where{$number}"], ["y", "n"]), + "{$type}_annotation{$number}" => getSimpleAvailableFieldEntry("{$typeName}: {$event['classic_annotation_intro']}", ""), + ]; + +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[1]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[1]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[1], "production", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[2]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[2]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[2], "finding", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[3]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[3]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[3], "publication", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[4]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[4]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[4], "template_creation", $i) + ); +} + +for ($i = 1; $i <= 15; $i++) { + + $availableFields[$basis['event'] . ': ' . $eventname[5]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[5]], + [ + "was_depicted_who{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["was_depicted_who_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['who'], + "explica" => "", + ], + "was_depicted_who_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["was_depicted_who{$i}"], + "remark" => '', + "name_human_readable" => $event['who'] . " [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 10; $i++) { + + $availableFields[$basis['event'] . ': ' . $eventname[36]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[36]], + [ + "was_depicted_place{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["was_depicted_place_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['where'], + "explica" => "", + ], + "was_depicted_place_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["was_depicted_place{$i}"], + "remark" => '', + "name_human_readable" => $event['where'] . " [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + ]); + +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[6]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[6]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[6], "was_used", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[7]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[7]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[7], "written", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[8]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[8]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[8], "collected", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[9]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[9]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[9], "painted", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[10]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[10]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[10], "taken", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[11]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[11]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[11], "received", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[12]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[12]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[12], "printing_plate_produced", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[13]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[13]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[13], "sent", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[14]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[14]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[14], "issued", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[15]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[15]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[15], "signed", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[16]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[16]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[16], "type_described", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[19]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[19]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[19], "drawn", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[20]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[20]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[20], "copied", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[25]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[25]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[25], "commissioned", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[26]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[26]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[26], "printed", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[27]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[27]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[27], "spoken", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[28]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[28]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[28], "sung", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[29]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[29]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[29], "decor_designed", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[30]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[30]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[30], "form_designed", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[31]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[31]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[31], "modelled", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[32]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[32]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[32], "signed_artwork", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[33]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[33]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[33], "was_mentioned", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[34]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[34]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[34], "buried", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[35]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[35]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[35], "intellectual_creation", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[37]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[37]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[37], "painted_on", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + $availableFields[$basis['event'] . ': ' . $eventname[38]] = array_merge( + $availableFields[$basis['event'] . ': ' . $eventname[38]], + generateGenericFullEvent($event, $csvxml_overview, $eventname[38], "illustrated", $i) + ); +} + +for ($i = 1; $i <= 2; $i++) { + + $availableFields[$basis['event'] . ': ' . $eventname[21]] = array_merge($availableFields[$basis['event'] . ': ' . $eventname[21]], + [ + "has_lived_when{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["has_lived_when_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['when'], + "explica" => "", + ], + "has_lived_when_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["has_lived_when{$i}"], + "remark" => '', + "name_human_readable" => $event['when'] . " [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + "has_lived_where{$i}" => [ + "required" => false, + "allowedValues" => [], + "dependsOn" => ["has_lived_where_sure{$i}"], + "remark" => '', + "name_human_readable" => $event['where'], + "explica" => "", + ], + "has_lived_where_sure{$i}" => [ + "required" => false, + "allowedValues" => ["y", "n"], + "dependsOn" => ["has_lived_where{$i}"], + "remark" => '', + "name_human_readable" => $event['where'] . " [{$csvxml_overview['certainty']}]", + "explica" => "", + ], + "has_lived_annotation{$i}" => [ + "required" => false, + "allowedValues" => '', + "dependsOn" => [], + "remark" => '', + "name_human_readable" => $event['classic_annotation_intro'], + "explica" => "", + ], + ]); + +}