FIX Param of fetch_name_optionals_label must be object->table_element
This commit is contained in:
parent
08167b959c
commit
2076d18825
@ -116,7 +116,7 @@ $hookmanager->initHooks(array('orderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('commande');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -108,7 +108,7 @@ $hookmanager->initHooks(array('invoicereclist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('facture_rec');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -150,7 +150,7 @@ $hookmanager->initHooks(array('invoicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('facture');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -143,7 +143,7 @@ $hookmanager->initHooks(array('contactlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('contact');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -100,7 +100,7 @@ $hookmanager->initHooks(array('contractlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('contrat');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
// List of fields to search into when doing a "search in all"
|
||||
|
||||
@ -84,7 +84,7 @@ $hookmanager->initHooks(array('contractservicelist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('contratdet');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -842,7 +842,7 @@ class ExtraFields
|
||||
/**
|
||||
* Load array this->attributes, or old this->attribute_xxx like attribute_label, attribute_type, ...
|
||||
*
|
||||
* @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||
* @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
|
||||
* @param boolean $forceload Force load of extra fields whatever is status of cache.
|
||||
* @return array Array of attributes keys+label for all extra fields.
|
||||
*/
|
||||
@ -856,6 +856,7 @@ class ExtraFields
|
||||
if ($elementtype == 'thirdparty') $elementtype = 'societe';
|
||||
if ($elementtype == 'contact') $elementtype = 'socpeople';
|
||||
if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur';
|
||||
if ($elementtype == 'stock_mouvement') $elementtype = 'movement';
|
||||
|
||||
$array_name_label = array();
|
||||
|
||||
|
||||
@ -183,7 +183,7 @@ class pdf_stdmovement extends ModelePDFMovement
|
||||
/**
|
||||
* Function to build a document on disk using the generic odt module.
|
||||
*
|
||||
* @param StockMovements $object Object source to build document
|
||||
* @param MouvementStock $object Object source to build document
|
||||
* @param Translate $outputlangs Lang output object
|
||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||
* @param int $hidedetails Do not show line details
|
||||
|
||||
@ -109,7 +109,7 @@ $hookmanager->initHooks(array('expensereportlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('expensereport');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ $hookmanager->initHooks(array('interventionlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('fichinter');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ $hookmanager->initHooks(array('supplierorderlist'));
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('commande_fournisseur');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -310,7 +310,7 @@ class MyObject extends CommonObject
|
||||
foreach ($object->array_options as $key => $option)
|
||||
{
|
||||
$shortkey = preg_replace('/options_/', '', $key);
|
||||
if (!empty($extrafields->attributes[$this->element]['unique'][$shortkey]))
|
||||
if (!empty($extrafields->attributes[$this->table_element]['unique'][$shortkey]))
|
||||
{
|
||||
//var_dump($key); var_dump($clonedObj->array_options[$key]); exit;
|
||||
unset($object->array_options[$key]);
|
||||
|
||||
@ -107,7 +107,7 @@ $extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label('product');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
if (empty($action)) $action = 'list';
|
||||
|
||||
@ -122,8 +122,7 @@ $object = new Task($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
//$extrafields->fetch_name_optionals_label('projet');
|
||||
$extrafields->fetch_name_optionals_label('projet_task');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$arrayfields = array();
|
||||
/*$arrayfields=array(
|
||||
|
||||
@ -201,7 +201,7 @@ if ($action == "view_ticketlist")
|
||||
|
||||
// fetch optionals attributes and labels
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('ticket');
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
|
||||
@ -354,10 +354,10 @@ class Hook extends CommonObject
|
||||
// ...
|
||||
// Clear extrafields that are unique
|
||||
if (is_array($object->array_options) && count($object->array_options) > 0) {
|
||||
$extrafields->fetch_name_optionals_label($this->element);
|
||||
$extrafields->fetch_name_optionals_label($this->table_element);
|
||||
foreach ($object->array_options as $key => $option) {
|
||||
$shortkey = preg_replace('/options_/', '', $key);
|
||||
if (!empty($extrafields->attributes[$this->element]['unique'][$shortkey])) {
|
||||
if (!empty($extrafields->attributes[$this->table_element]['unique'][$shortkey])) {
|
||||
// var_dump($key);
|
||||
// var_dump($clonedObj->array_options[$key]);
|
||||
// exit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user