Fix bug
phpcs-errors:226 phpunit-status:successful
This commit is contained in:
parent
8896b01434
commit
4db3c1ba9c
|
@ -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'];
|
$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;
|
$depcon_error = 0;
|
||||||
foreach ($crosscheck1 as $tCrossCheck) {
|
foreach ($crosscheck1 as $l => $tCrossCheck) {
|
||||||
|
|
||||||
if (in_array($tCrossCheck, $erstezeile)) {
|
if (in_array($tCrossCheck, $erstezeile)) {
|
||||||
|
|
||||||
|
@ -215,11 +215,11 @@ foreach ($crosscheck1 as $tCrossCheck) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for ($l = 0; $l < count($eventpart); $l++) {
|
foreach ($eventpart as $l => $tEventPart) {
|
||||||
if (in_array($eventpart[$l], $erstezeile)) {
|
if (in_array($tEventPart, $erstezeile)) {
|
||||||
for ($j = 1; $j < ($y + 1); $j++) {
|
for ($j = 1; $j < ($y + 1); $j++) {
|
||||||
if ($inhalt[$j][array_search($eventpartsure[$l], $erstezeile)] !== '' and $inhalt[$j][array_search($eventpart[$l], $erstezeile)] == '') {
|
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>' . $eventpart[$l] . '</b> (row ' . $j . ')';
|
echo '<br>Tag <b>' . $eventpartsure[$l] . '</b> given but no entry for <b>' . $tEventPart . '</b> (row ' . $j . ')';
|
||||||
$depcon_error++;
|
$depcon_error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -227,8 +227,7 @@ for ($l = 0; $l < count($eventpart); $l++) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array('dimensions_separate_show_md', $erstezeile)) {
|
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)] == '') {
|
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 . ')';
|
echo '<br>Tag <b>dimensions_separate_show_md</b> given but no separate values available (row ' . $j . ')';
|
||||||
$depcon_error = $depcon_error + 1;
|
$depcon_error = $depcon_error + 1;
|
||||||
|
@ -305,13 +304,12 @@ for ($i = 2; $i <= $y; $i++) {
|
||||||
|
|
||||||
if (isset($errormessage) and $errormessage != '') {
|
if (isset($errormessage) and $errormessage != '') {
|
||||||
echo '<b style="color:#990000;">Columns with controlled values contain invalid values !</b>';
|
echo '<b style="color:#990000;">Columns with controlled values contain invalid values !</b>';
|
||||||
for ($i = 0; $i < count ($errormessage); $i++) {
|
foreach ($errormessage as $tMsg) {
|
||||||
echo '<br>' . $errormessage[$i];
|
echo '<br>' . $tMsg;
|
||||||
$error = $error + 1;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
echo '<i style="font-style:normal;color:#009900;">Values in controlled fields are all valid !</i>';
|
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++)
|
for ($i = 1; $i <= $y; $i++)
|
||||||
{
|
{
|
||||||
if ($i > 1) {
|
if ($i > 1) {
|
||||||
$maimg[$i] = 0;
|
|
||||||
//check if in a row any image_name is given
|
//check if in a row any image_name is given
|
||||||
$hatimg[$i] = 0;
|
$maimg = $hatimg = 0;
|
||||||
for ($im = 0; $im < count($imagemain); $im++)
|
foreach ($imagemain as $im => $tMainImage) {
|
||||||
{
|
if ($inhalt[$i][$tMainImage] != '') $hatimg++;
|
||||||
if ($inhalt[$i][$imagemain[$im]['name']] != '') $hatimg[$i]++;
|
|
||||||
}
|
}
|
||||||
if ($hatimg[$i] > 0) {
|
if ($hatimg > 0) {
|
||||||
// first check: how many main-images?
|
// first check: how many main-images?
|
||||||
for ($im = 0; $im < count($imagemain); $im++)
|
foreach ($imagemain as $im => $tMainImage) {
|
||||||
{
|
if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {
|
||||||
if ($inhalt[$i][$imagemain[$im]['main']] == 'y') {$maimg[$i]++;$merk = $im;
|
$maimg++;
|
||||||
|
$merk = $im;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if there is exacly one main-image, is it visible?
|
// if there is exacly one main-image, is it visible?
|
||||||
if ($maimg[$i] == 1) {
|
if ($maimg == 1) {
|
||||||
if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') {
|
if ($inhalt[$i][$imagemain[$merk]['visible']] == 'n') {
|
||||||
$errormessage[] = '<b style="font-weight:normal;color:#990000">Main image in row ' . $i . ' is not visible</b>';
|
$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>';
|
echo '<b style="color:#990000;">There is not one main image for each object !</b>';
|
||||||
for ($i = 0; $i < count($errormessage); $i++) {
|
foreach ($errormessage as $tMsg) {
|
||||||
echo '<br>' . $errormessage[$i];
|
echo '<br>' . $tMsg;
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user