2
0
forked from Wavyzz/dolibarr

Uniformize etrafields visibility for thirdparties card

This commit is contained in:
Laurent Destailleur
2015-03-14 13:05:28 +01:00
parent a2adeb2807
commit 2a09e34bdf
3 changed files with 42 additions and 13 deletions

View File

@@ -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

View File

@@ -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");

View File

@@ -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'));
/*
@@ -1091,7 +1093,7 @@ else
$form->select_users((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default
print '</td></tr>';
}
// Incoterms
if (!empty($conf->incoterm->enabled))
{
@@ -1101,7 +1103,7 @@ else
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''));
print '</td></tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
@@ -1226,11 +1228,11 @@ else
//Incoterms
if (!empty($conf->incoterm->enabled))
{
{
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('lcoation_incoterms', 'alpha');
}
//Local Taxes
$object->localtax1_assuj = GETPOST('localtax1assuj_value');
$object->localtax2_assuj = GETPOST('localtax2assuj_value');
@@ -1627,7 +1629,7 @@ else
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''));
print '</td></tr>';
}
// Logo
print '<tr class="hideonsmartphone">';
print '<td><label for="photoinput">'.$langs->trans("Logo").'</label></td>';
@@ -2016,7 +2018,7 @@ else
// Incoterms
if (!empty($conf->incoterm->enabled))
{
{
print '<tr><td>';
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');
@@ -2030,7 +2032,7 @@ else
{
print $form->textwithpicto($object->display_incoterms(), $object->libelle_incoterms, 1);
}
else
else
{
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms)?$object->location_incoterms:''), $_SERVER['PHP_SELF'].'?socid='.$object->id);
}