phpcs-errors:226 phpunit-status:successful
This commit is contained in:
Joshua Ramon Enslin 2020-07-21 23:33:42 +02:00 committed by Stefan Rohde-Enslin
parent 8896b01434
commit 4db3c1ba9c

View File

@ -200,7 +200,7 @@ $crosscheck1 = ['object_other_title','detailed_description','detailed_descriptio
$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;
foreach ($crosscheck1 as $tCrossCheck) {
foreach ($crosscheck1 as $l => $tCrossCheck) {
if (in_array($tCrossCheck, $erstezeile)) {
@ -215,11 +215,11 @@ foreach ($crosscheck1 as $tCrossCheck) {
}
for ($l = 0; $l < count($eventpart); $l++) {
if (in_array($eventpart[$l], $erstezeile)) {
foreach ($eventpart as $l => $tEventPart) {
if (in_array($tEventPart, $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 '<br>Tag <b>' . $eventpartsure[$l] . '</b> given but no entry for <b>' . $eventpart[$l] . '</b> (row ' . $j . ')';
if ($inhalt[$j][array_search($eventpartsure[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($tEventPart, $erstezeile)] == '') {
echo '<br>Tag <b>' . $eventpartsure[$l] . '</b> given but no entry for <b>' . $tEventPart . '</b> (row ' . $j . ')';
$depcon_error++;
}
}
@ -227,8 +227,7 @@ for ($l = 0; $l < count($eventpart); $l++) {
}
if (in_array('dimensions_separate_show_md', $erstezeile)) {
for ($j = 1; $j < ($y + 1); $j++)
{
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 '<br>Tag <b>dimensions_separate_show_md</b> given but no separate values available (row ' . $j . ')';
$depcon_error = $depcon_error + 1;
@ -305,13 +304,12 @@ for ($i = 2; $i <= $y; $i++) {
if (isset($errormessage) and $errormessage != '') {
echo '<b style="color:#990000;">Columns with controlled values contain invalid values !</b>';
for ($i = 0; $i < count ($errormessage); $i++) {
echo '<br>' . $errormessage[$i];
$error = $error + 1;
foreach ($errormessage as $tMsg) {
echo '<br>' . $tMsg;
$error++;
}
}
else
{
else {
echo '<i style="font-style:normal;color:#009900;">Values in controlled fields are all valid !</i>';
}
@ -332,36 +330,35 @@ if ($hasanyimage > 0) {
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]++;
$maimg = $hatimg = 0;
foreach ($imagemain as $im => $tMainImage) {
if ($inhalt[$i][$tMainImage] != '') $hatimg++;
}
if ($hatimg[$i] > 0) {
if ($hatimg > 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;
foreach ($imagemain as $im => $tMainImage) {
if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {
$maimg++;
$merk = $im;
}
}
// if there is exacly one main-image, is it visible?
if ($maimg[$i] == 1) {
if ($maimg == 1) {
if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') {
$errormessage[] = '<b style="font-weight:normal;color:#990000">Main image in row ' . $i . ' is not visible</b>';
}
}
}
if ($maimg == 0 and $hatimg > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There is no visible main image given in row ' . $i . '</b>';
if ($maimg > 1 and $hatimg > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There are ' . $maimg . ' main images given in row ' . $i . '</b>';
}
if ($i > 1 and $maimg[$i] == 0 and $hatimg[$i] > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There is no visible main image given in row ' . $i . '</b>';
if ($i > 1 and $maimg[$i] > 1 and $hatimg[$i] > 0) $errormessage[] = '<b style="font-weight:normal;color:#990000">There are ' . $maimg[$i] . ' main images given in row ' . $i . '</b>';
}
if (isset($errormessage) and $errormessage != '') {
if (!empty($errormessage)) {
echo '<b style="color:#990000;">There is not one main image for each object !</b>';
for ($i = 0; $i < count($errormessage); $i++) {
echo '<br>' . $errormessage[$i];
foreach ($errormessage as $tMsg) {
echo '<br>' . $tMsg;
$error++;
}
}