| ' . $langs->trans($value) . ' | ' . $extrafields->showInputField($key, '', '', '', '', '', 0, 'product_fournisseur_price') . ' |
';
+ if (! empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
+ print '| attributes["product_fournisseur_price"]['required'][$key] ? ' class="fieldrequired"' : '') . '>' . $langs->trans($value) . ' | ' . $extrafields->showInputField($key, '', '', '', '', '', 0, 'product_fournisseur_price') . ' |
';
+ }
}
} else {
$resql = $db->fetch_object($resql);
foreach ($extralabels as $key => $value) {
- print '| ' . $langs->trans($value) . ' | ' . $extrafields->showInputField($key, $resql->{$key}, '', '', '', '', 0, 'product_fournisseur_price') . ' |
';
+ if (! empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && ($extrafields->attributes["product_fournisseur_price"]['list'][$key] == 1 || $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 3 || ($action == "update_price" && $extrafields->attributes["product_fournisseur_price"]['list'][$key] == 4))) {
+ print '| attributes["product_fournisseur_price"]['required'][$key] ? ' class="fieldrequired"' : '') . '>' . $langs->trans($value) . ' | ' . $extrafields->showInputField($key, $resql->{$key}, '', '', '', '', 0, 'product_fournisseur_price') . ' |
';
+ }
}
}
@@ -796,7 +800,7 @@ SCRIPT;
print "\n\n";
- if ($action != 'add_price' && $action != 'updateprice')
+ if ($action != 'add_price' && $action != 'update_price')
{
$parameters=array();
$reshook=$hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
@@ -862,8 +866,11 @@ SCRIPT;
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label("product_fournisseur_price");
- foreach ($extralabels as $extrafield) {
- print_liste_field_titre($extrafield, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ foreach ($extralabels as $key => $value) {
+ // Show field if not hidden
+ if (! empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
+ print_liste_field_titre($value, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
+ }
}
if (is_object($hookmanager))
@@ -983,13 +990,17 @@ SCRIPT;
// Extrafields
$resql = $db->query("SELECT * FROM " . MAIN_DB_PREFIX . "product_fournisseur_price_extrafields WHERE fk_object = " . $productfourn->product_fourn_price_id);
if ($db->num_rows($resql) != 1) {
- foreach ($extralabels as $extrafield) {
- print "
| ";
+ foreach ($extralabels as $key => $value) {
+ if (! empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
+ print "
| ";
+ }
}
} else {
$resql = $db->fetch_object($resql);
foreach ($extralabels as $key => $value) {
- print "
" . $extrafields->showOutputField($key, $resql->{$key}) . " | ";
+ if (! empty($extrafields->attributes["product_fournisseur_price"]['list'][$key]) && $extrafields->attributes["product_fournisseur_price"]['list'][$key] != 3) {
+ print '
' . $extrafields->showOutputField($key, $resql->{$key}) . " | ";
+ }
}
}
@@ -1003,7 +1014,7 @@ SCRIPT;
print '
';
if ($usercancreate)
{
- print ''.img_edit()."";
+ print ''.img_edit()."";
print ' ';
print ''.img_picto($langs->trans("Remove"), 'delete').'';
}
|