Fix phpcs

This commit is contained in:
Laurent Destailleur 2021-07-06 19:02:03 +02:00
parent 70fa742939
commit 9fc2d9fc03
8 changed files with 15 additions and 17 deletions

View File

@ -321,7 +321,7 @@ if ($object->ismultientitymanaged == 1) {
foreach ($search as $key => $val) {
if (array_key_exists($key, $object->fields)) {
if ($key == 'status' && $search[$key] == -1) {
continue;
continue;
}
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {

View File

@ -783,7 +783,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
try {
$dom = new DOMDocument;
$dom->loadHTML($out, LIBXML_ERR_NONE|LIBXML_HTML_NOIMPLIED|LIBXML_HTML_NODEFDTD|LIBXML_NONET|LIBXML_NOWARNING|LIBXML_NOXMLDECL);
} catch(Exception $e) {
} catch (Exception $e) {
//print $e->getMessage();
return 'InvalidHTMLString';
}

View File

@ -1675,15 +1675,15 @@ if ($action == 'create') {
print '<tr>';
print '<td class="titlefield">'.$langs->trans("User").'</td>';
print '<td>';
if ($object->fk_user_author > 0) {
$userauthor = new User($db);
$result = $userauthor->fetch($object->fk_user_author);
if ($result < 0) {
dol_print_error('', $userauthor->error);
} elseif ($result > 0) {
print $userauthor->getNomUrl(-1);
}
}
if ($object->fk_user_author > 0) {
$userauthor = new User($db);
$result = $userauthor->fetch($object->fk_user_author);
if ($result < 0) {
dol_print_error('', $userauthor->error);
} elseif ($result > 0) {
print $userauthor->getNomUrl(-1);
}
}
print '</td></tr>';
// Period

View File

@ -139,7 +139,7 @@ $dataseries = dol_sort_array($dataseries, 1, 'desc');
$KEEPNFIRST = 7; // Keep first $KEEPNFIRST one + 1 with the remain
$i = 0;
if (count($dataseries) > ($KEEPNFIRST + 1)) {
foreach($dataseries as $key => $val) {
foreach ($dataseries as $key => $val) {
if ($i < $KEEPNFIRST) {
$i++;
continue;

View File

@ -4984,4 +4984,3 @@ function migrate_export_import_profiles($mode = 'export')
print '<tr class="trforrunsql" style=""><td class="wordbreak" colspan="4">'.$langs->trans("NothingToDo")."</td></tr>\n";
}
}

View File

@ -236,8 +236,8 @@ foreach ($search as $key => $val) {
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
if ($search[$key] == '-1' || $search[$key] === '0') {
$search[$key] = '';
}
$search[$key] = '';
}
$mode_search = 2;
}
if ($search[$key] != '') {

View File

@ -707,7 +707,6 @@ if ($action == "updatereduction") {
// Reload data
$invoice->fetch($placeid);
} elseif ($action == 'update_reduction_global') {
foreach ($invoice->lines as $line) {
$result = $invoice->updateline($line->id, $line->desc, $line->subprice, $line->qty, $number, $line->date_start, $line->date_end, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, $line->fk_parent_line, 0, $line->fk_fournprice, $line->pa_ht, $line->label, $line->special_code, $line->array_options, $line->situation_percent, $line->fk_unit);

View File

@ -3223,7 +3223,7 @@ class User extends CommonObject
if (preg_match('/'.$keyfilter1.'/', $val['fullpath']) || preg_match('/'.$keyfilter2.'/', $val['fullpath'])
|| preg_match('/'.$keyfilter3.'/', $val['fullpath']) || preg_match('/'.$keyfilter4.'/', $val['fullpath'])) {
unset($this->users[$key]);
}
}
}
}