Clean code
This commit is contained in:
parent
791f5f3f62
commit
f2c4e25827
@ -444,9 +444,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
$var = false;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -481,7 +478,6 @@ if ($id)
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
@ -612,7 +608,7 @@ if ($id)
|
||||
print ' <input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||
|
||||
@ -438,8 +438,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -496,7 +494,6 @@ if ($id)
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -407,8 +407,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -437,7 +435,6 @@ if ($id)
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
|
||||
@ -236,7 +236,7 @@ $tabsqlsort[3] = "country ASC, code ASC";
|
||||
$tabsqlsort[4] = "code ASC";
|
||||
$tabsqlsort[5] = "label ASC";
|
||||
$tabsqlsort[6] = "a.type ASC, a.module ASC, a.position ASC, a.code ASC";
|
||||
$tabsqlsort[7] = "country ASC, code ASC, a.libelle ASC";
|
||||
$tabsqlsort[7] = "c.label ASC, a.code ASC, a.libelle ASC";
|
||||
$tabsqlsort[8] = "country DESC,".(!empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? ' t.position ASC,' : '')." libelle ASC";
|
||||
$tabsqlsort[9] = "label ASC";
|
||||
$tabsqlsort[10] = "country ASC, code ASC, taux ASC, recuperableonly ASC, localtax1 ASC, localtax2 ASC";
|
||||
@ -1069,6 +1069,7 @@ if ($id)
|
||||
elseif ($search_code != '' && $id == 28) $sql .= natural_search("h.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 32) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id == 3) $sql .= natural_search("r.code_region", $search_code);
|
||||
elseif ($search_code != '' && $id == 7) $sql .= natural_search("a.code", $search_code);
|
||||
elseif ($search_code != '' && $id != 9) $sql .= natural_search("code", $search_code);
|
||||
|
||||
if ($sortfield)
|
||||
@ -1107,7 +1108,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
$withentity = null;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
@ -1214,7 +1214,6 @@ if ($id)
|
||||
else $tdsoffields .= $valuetoshow;
|
||||
$tdsoffields .= '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
if ($id == 4) $tdsoffields .= '<td></td>';
|
||||
|
||||
@ -435,9 +435,6 @@ if ($id)
|
||||
// Form to add a new line
|
||||
if ($tabname[$id])
|
||||
{
|
||||
$alabelisused = 0;
|
||||
$var = false;
|
||||
|
||||
$fieldlist = explode(',', $tabfield[$id]);
|
||||
|
||||
// Line for title
|
||||
@ -461,7 +458,6 @@ if ($id)
|
||||
} else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field] == 'libelle' || $fieldlist[$field] == 'label') $alabelisused = 1;
|
||||
}
|
||||
|
||||
print '<td colspan="4">';
|
||||
@ -469,7 +465,7 @@ if ($id)
|
||||
print '</tr>';
|
||||
|
||||
// Line to enter new values
|
||||
print "<tr ".$bcnd[$var].">";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
@ -570,7 +566,7 @@ if ($id)
|
||||
print ' <input type="submit" class="button button-cancel" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||
} else {
|
||||
$tmpaction = 'view';
|
||||
$parameters = array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$parameters = array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]);
|
||||
$reshook = $hookmanager->executeHooks('viewWebsiteFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
$error = $hookmanager->error; $errors = $hookmanager->errors;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user