Uniformize etrafields visibility for thirdparties card
This commit is contained in:
parent
a2adeb2807
commit
2a09e34bdf
@ -68,10 +68,15 @@ if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="nom";
|
||||
$cancelbutton = GETPOST('cancel');
|
||||
|
||||
$object = new Client($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('commcard','globalcard'));
|
||||
|
||||
$object = new Societe($db);
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -425,9 +430,9 @@ if ($id > 0)
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Level of prospect
|
||||
if ($object->client == 2 || $object->client == 3)
|
||||
{
|
||||
// Level of prospect
|
||||
print '<tr><td class="nowrap">';
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
|
||||
print $langs->trans('ProspectLevel');
|
||||
@ -453,7 +458,16 @@ if ($id > 0)
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Sales representative
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
|
||||
// Sales representative
|
||||
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
|
||||
|
||||
// Module Adherent
|
||||
|
||||
@ -52,9 +52,13 @@ $result = restrictedArea($user, 'societe&fournisseur', $id, '&societe');
|
||||
$object = new Fournisseur($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('suppliercard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Action
|
||||
*/
|
||||
@ -253,7 +257,16 @@ if ($object->id > 0)
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// Module Adherent
|
||||
// Other attributes
|
||||
$parameters=array('socid'=>$object->id, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook) && ! empty($extrafields->attribute_label))
|
||||
{
|
||||
print $object->showOptionals($extrafields);
|
||||
}
|
||||
|
||||
// Module Adherent
|
||||
if (! empty($conf->adherent->enabled))
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
@ -63,6 +63,10 @@ $extrafields = new ExtraFields($db);
|
||||
// fetch optionals attributes and labels
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
|
||||
|
||||
|
||||
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
|
||||
$object->getCanvas($socid);
|
||||
$canvas = $object->canvas?$object->canvas:GETPOST("canvas");
|
||||
@ -77,8 +81,6 @@ if (! empty($canvas))
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas);
|
||||
|
||||
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||
$hookmanager->initHooks(array('thirdpartycard','globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user