Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into New_invoice_default_documents

This commit is contained in:
John 2018-02-21 17:44:08 +01:00
commit 3c1803f1f2
51 changed files with 108 additions and 106 deletions

View File

@ -1003,7 +1003,7 @@ else
if ($res < 0) {
dol_print_error($db,$object->error); exit;
}
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
if ($res < 0) {
dol_print_error($db); exit;
}
@ -1272,7 +1272,7 @@ else
if ($res < 0) {
dol_print_error($db,$object->error); exit;
}
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
if ($res < 0) {
dol_print_error($db); exit;
}

View File

@ -361,7 +361,7 @@ if ($rowid > 0)
{
$object = new AdherentType($db);
$object->fetch($rowid);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
/*
* Confirmation suppression
@ -692,7 +692,7 @@ if ($rowid > 0)
{
$object = new AdherentType($db);
$object->fetch($rowid);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
$head = member_type_prepare_head($object);

View File

@ -53,11 +53,12 @@ $result = restrictedArea($user, 'categorie', $id, '&category');
$object = new Categorie($db);
$result=$object->fetch($id, $label);
$object->fetch_optionals($id,$extralabels);
if ($result <= 0)
{
dol_print_error($db,$object->error);
exit;
if ($result <= 0) {
dol_print_error($db,$object->error); exit;
}
$object->fetch_optionals();
if ($result <= 0) {
dol_print_error($db,$object->error); exit;
}
$type=$object->type;

View File

@ -934,7 +934,7 @@ if ($id > 0)
$result2=$object->fetch_projet();
$result3=$object->fetch_contact();
$result4=$object->fetch_userassigned();
$result5=$object->fetch_optionals($id,$extralabels);
$result5=$object->fetch_optionals();
if ($listUserAssignedUpdated || $donotclearsession)
{

View File

@ -100,7 +100,7 @@ if ($object->id > 0)
$result2=$object->fetch_thirdparty();
$result3=$object->fetch_contact();
$result4=$object->fetch_userassigned();
$result5=$object->fetch_optionals($id,$extralabels);
$result5=$object->fetch_optionals();
if ($result1 < 0 || $result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0)
{

View File

@ -505,7 +505,7 @@ if (empty($reshook))
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}

View File

@ -1210,7 +1210,7 @@ class Propal extends CommonObject
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
$line->fetch_optionals();
// Load dest object
$clonedObj = clone $this;

View File

@ -1804,7 +1804,7 @@ if ($action == 'create' && $user->rights->commande->creer)
$author = new User($db);
$author->fetch($object->user_author_id);
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = commande_prepare_head($object);
dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order');

View File

@ -1024,7 +1024,7 @@ class Commande extends CommonOrder
// get lines so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
$line->fetch_optionals();
// Load source object
$objFrom = clone $this;
@ -1145,7 +1145,7 @@ class Commande extends CommonOrder
$line->marque_tx = $marginInfos[2];
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
$object->lines[$i]->fetch_optionals();
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;

View File

@ -501,7 +501,7 @@ class FactureRec extends CommonInvoice
$line->price = $objp->price;
$line->remise = $objp->remise;
$extralabelsline = $line->fetch_optionals($line->id,$extrafieldsline);
$extralabelsline = $line->fetch_optionals($line->id);
// Multicurrency
$line->fk_multicurrency = $objp->fk_multicurrency;

View File

@ -1031,7 +1031,7 @@ class Facture extends CommonInvoice
$line->pa_ht = $marginInfos[0];
// get extrafields from original line
$object->lines[$i]->fetch_optionals($object->lines[$i]->rowid);
$object->lines[$i]->fetch_optionals();
foreach($object->lines[$i]->array_options as $options_key => $value)
$line->array_options[$options_key] = $value;

View File

@ -190,7 +190,8 @@ else
$object = new Contact($db);
$res=$object->fetch($id, $user);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
if ($res < 0) { dol_print_error($db,$object->error); exit; }
// Show tabs
$head = contact_prepare_head($object);

View File

@ -468,7 +468,8 @@ else
$object = new Contact($db);
$res=$object->fetch($id, $user);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
if ($res < 0) { dol_print_error($db,$object->error); exit; }
// Show tabs
$head = contact_prepare_head($object);

View File

@ -1709,7 +1709,7 @@ else
if (is_array($extralabelslines) && count($extralabelslines)>0) {
print '<tr '.$bcnd[$var].'>';
$line = new ContratLigne($db);
$line->fetch_optionals($objp->rowid,$extralabelslines);
$line->fetch_optionals($objp->rowid);
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
print '</tr>';
}
@ -1783,7 +1783,7 @@ else
if (is_array($extralabelslines) && count($extralabelslines)>0) {
print '<tr '.$bcnd[$var].'>';
$line = new ContratLigne($db);
$line->fetch_optionals($objp->rowid,$extralabelslines);
$line->fetch_optionals($objp->rowid);
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan));
print '</tr>';
}

View File

@ -795,7 +795,7 @@ class Contrat extends CommonObject
// Retreive all extrafield for contract
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabelsline);
$line->fetch_optionals();
$this->lines[$pos] = $line;
$this->lines_id_index_mapper[$line->id] = $pos;

View File

@ -203,7 +203,7 @@ abstract class CommonDocGenerator
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('societe',true);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{
@ -274,7 +274,7 @@ abstract class CommonDocGenerator
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
$object->fetch_optionals($object->id, $extralabels);
$object->fetch_optionals();
foreach($extrafields->attribute_label as $key => $label)
{
@ -457,7 +457,7 @@ abstract class CommonDocGenerator
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
@ -524,7 +524,7 @@ abstract class CommonDocGenerator
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$line->fetch_optionals($line->rowid,$extralabels);
$line->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($line,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
@ -592,7 +592,7 @@ abstract class CommonDocGenerator
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('shipment',true);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
$array_shipment = $this->fill_substitutionarray_with_extrafields($object,$array_shipment,$extrafields,$array_key,$outputlangs);
}*/

View File

@ -3670,8 +3670,7 @@ abstract class CommonObject
foreach ($this->lines as $line)
{
//Line extrafield
$line->fetch_optionals($line->id,$extralabelslines);
$line->fetch_optionals();
//if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line)))
@ -4498,7 +4497,7 @@ abstract class CommonObject
}
else
{
dol_syslog("Warning: fetch_optionals was called with param $optionsArray defined when you should pass null now", LOG_WARNING);
dol_syslog("Warning: fetch_optionals was called with param optionsArray defined when you should pass null now", LOG_WARNING);
}
$table_element = $this->table_element;

View File

@ -1185,7 +1185,7 @@ class FormMail extends Form
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
$product = new Product($this->db);
$product->fetch($line->fk_product, '', '', 1);
$product->fetch_optionals($product->id, $extralabels);
$product->fetch_optionals();
foreach ($extrafields->attribute_label as $key => $label) {
$substit_line['__PRODUCT_EXTRAFIELD_' . strtoupper($key) . '__'] = $product->array_options['options_' . $key];
}

View File

@ -5806,7 +5806,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
{
$extrafieldstmp = new ExtraFields($db);
$extralabels = $extrafieldstmp->fetch_name_optionals_label($object->table_element, true);
$object->fetch_optionals($object->id, $extralabels);
$object->fetch_optionals();
foreach ($extrafieldstmp->attribute_label as $key => $label) {
$substitutionarray['__EXTRAFIELD_' . strtoupper($key) . '__'] = $object->array_options['options_' . $key];
}

View File

@ -136,10 +136,10 @@ class doc_generic_project_odt extends ModelePDFProjects
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
return $resarray;
}
@ -198,18 +198,18 @@ class doc_generic_project_odt extends ModelePDFProjects
if ($contact['source']=='external') {
$ret[$pc.'isInternal'] = ''; // not internal
$ct = new Contact($this->db);
$ct->fetch($contact['id']);
$ret[$pc.'phone_pro'] = $ct->phone_pro;
$ret[$pc.'phone_perso'] = $ct->phone_perso;
$ret[$pc.'phone_mobile'] = $ct->phone_mobile;
// fetch external user extrafields
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php');
$extrafields=new ExtraFields($this->db);
$extralabels=$extrafields->fetch_name_optionals_label($ct->table_element, true);
$extrafields_num = $ct->fetch_optionals($ct->id, $extralabels);
$extrafields_num = $ct->fetch_optionals();
//dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: ===== Number of Extrafields found: ".$extrafields_num, LOG_DEBUG);
foreach($ct->array_options as $efkey => $efval) {
dol_syslog(get_class($this)."::get_substitutionarray_project_contacts: +++++ Extrafield ".$efkey." => ".$efval, LOG_DEBUG);
@ -217,7 +217,7 @@ class doc_generic_project_odt extends ModelePDFProjects
}
} elseif ($contact['source']=='internal') {
$ret[$pc.'isInternal'] = '1'; // this is an internal user
$ct = new User($this->db);
$ct->fetch($contact['id']);
$ret[$pc.'phone_pro'] = $ct->office_phone;
@ -1067,7 +1067,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -139,7 +139,7 @@ class doc_generic_task_odt extends ModelePDFTask
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$object->fetch_optionals();
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key,$outputlangs);
}
@ -830,7 +830,7 @@ class doc_generic_task_odt extends ModelePDFTask
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
return 1; // Success
}
else

View File

@ -411,7 +411,7 @@ if (! empty($id) && $action == 'edit')
if ($result < 0) {
dol_print_error($db,$object->error); exit;
}
$result=$object->fetch_optionals($object->id,$extralabels);
$result=$object->fetch_optionals();
if ($result < 0) {
dol_print_error($db); exit;
}
@ -539,7 +539,7 @@ if (! empty($id) && $action != 'edit')
if ($result < 0) {
dol_print_error($db,$object->error); exit;
}
$result=$object->fetch_optionals($object->id,$extralabels);
$result=$object->fetch_optionals();
if ($result < 0) {
dol_print_error($db); exit;
}

View File

@ -1068,7 +1068,7 @@ if ($action == 'create')
// copy from order
$orderExtrafields = new Extrafields($db);
$orderExtrafieldLabels = $orderExtrafields->fetch_name_optionals_label($object->table_element);
if ($object->fetch_optionals($object->id, $orderExtrafieldLabels) > 0) {
if ($object->fetch_optionals() > 0) {
$expe->array_options = array_merge($expe->array_options, $object->array_options);
}
print $object->showOptionals($extrafields, 'edit');
@ -1605,9 +1605,9 @@ if ($action == 'create')
$orderLineExtrafields = new Extrafields($db);
$orderLineExtrafieldLabels = $orderLineExtrafields->fetch_name_optionals_label($object->table_element_line);
$srcLine = new OrderLine($db);
$srcLine->fetch_optionals($line->id,$orderLineExtrafieldLabels); // fetch extrafields also available in orderline
$srcLine->fetch_optionals($line->id); // fetch extrafields also available in orderline
$line = new ExpeditionLigne($db);
$line->fetch_optionals($object->id,$extralabelslines);
$line->fetch_optionals($line->id);
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
print '<tr class="oddeven">';
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>$colspan),$indiceAsked);
@ -1661,7 +1661,7 @@ else if ($id || $ref)
$soc = new Societe($db);
$soc->fetch($object->socid);
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head=shipping_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
@ -2451,7 +2451,7 @@ else if ($id || $ref)
if (is_array($extralabelslines) && count($extralabelslines)>0) {
$colspan= empty($conf->productbatch->enabled) ? 5 : 6;
$line = new ExpeditionLigne($db);
$line->fetch_optionals($lines[$i]->id,$extralabelslines);
$line->fetch_optionals($lines[$i]->id);
print '<tr class="oddeven">';
if ($action == 'editline' && $lines[$i]->id == $line_id)
{

View File

@ -247,7 +247,7 @@ if ($id > 0 || ! empty($ref))
$author = new User($db);
$author->fetch($object->user_author_id);
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = commande_prepare_head($object);
dol_fiche_head($head, 'shipping', $langs->trans("CustomerOrder"), -1, 'order');

View File

@ -1434,7 +1434,7 @@ else
{
$result = $object->fetch($id, $ref);
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
if ($result > 0)
{

View File

@ -1476,7 +1476,7 @@ else if ($id > 0 || ! empty($ref))
$extrafieldsline = new ExtraFields($db);
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
$line->fetch_optionals($line->rowid, $extralabelslines);
$line->fetch_optionals();
print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>5));
@ -1521,7 +1521,7 @@ else if ($id > 0 || ! empty($ref))
$extrafieldsline = new ExtraFields($db);
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($line->table_element);
$line->fetch_optionals($line->rowid, $extralabelslines);
$line->fetch_optionals();
print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>5));

View File

@ -1642,7 +1642,7 @@ elseif (! empty($object->id))
$author = new User($db);
$author->fetch($object->user_author_id);
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
$head = ordersupplier_prepare_head($object);

View File

@ -93,7 +93,7 @@ else if ($action == 'add')
$object->fk_user_author = $user->id;
$object->datec = dol_now();
$id = $object->create($user);
@ -123,7 +123,7 @@ else if ($action == 'add')
else if ($action == 'update')
{
$error = 0;
if (! $cancel) {
$name = GETPOST('name', 'alpha');
@ -132,7 +132,7 @@ else if ($action == 'update')
$error ++;
}
if (empty($error))
if (empty($error))
{
$object->name = GETPOST('name', 'alpha');
$object->address = GETPOST('address', 'alpha');
@ -141,7 +141,7 @@ else if ($action == 'update')
$object->country_id = GETPOST('country_id', 'int');
$object->fk_user_mod = $user->id;
$object->status = GETPOST('status','int');
$result = $object->update($user);
if ($result > 0)
@ -201,18 +201,18 @@ if ($action == 'create')
print '<td>';
print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array (
'town',
'selectcountry_id'
'selectcountry_id'
), 6);
print '</td>';
print '</tr>';
// Town
print '<tr>';
print '<td>'.fieldLabel('Town','town',0).'</td>';
print '<td>';
print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array (
'zipcode',
'selectcountry_id'
'selectcountry_id'
));
print '</td>';
print '</tr>';
@ -234,7 +234,7 @@ if ($action == 'create')
print '</td></tr>';
print '</table>';
dol_fiche_end();
print '<div class="center">';
@ -286,12 +286,12 @@ if (($id || $ref) && $action == 'edit')
print '<tr><td>'.fieldLabel('Zip','zipcode',0).'</td><td>';
print $formcompany->select_ziptown($object->zip, 'zipcode', array (
'town',
'selectcountry_id'
'selectcountry_id'
), 6) . '</tr>';
print '<tr><td>'.fieldLabel('Town','town',0).'</td><td>';
print $formcompany->select_ziptown($object->town, 'town', array (
'zipcode',
'selectcountry_id'
'selectcountry_id'
)) . '</td></tr>';
// Country
@ -300,7 +300,7 @@ if (($id || $ref) && $action == 'edit')
print $form->select_country($object->fk_country,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td>';
print '</tr>';
print '</tr>';
// Status
print '<tr><td>'.fieldLabel('Status','status',1).'</td><td>';
@ -325,11 +325,11 @@ if (($id || $ref) && $action == 'edit')
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = establishment_prepare_head($object);
dol_fiche_head($head, 'card', $langs->trans("Establishment"), -1, 'building');
// Confirmation to delete
if ($action == 'delete')
{
@ -337,22 +337,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Object card
// ------------------------------------------------------------
$linkback = '<a href="' . DOL_URL_ROOT . '/hrm/admin/admin_establishment.php' . (! empty($socid) ? '?socid=' . $socid : '') . '">' . $langs->trans("BackToList") . '</a>';
$morehtmlref='<div class="refidno">';
$morehtmlref.='</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', $morehtmlref);
print '<div class="fichecenter">';
//print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>';
print '<table class="border centpercent">'."\n";
print '<table class="border centpercent">'."\n";
// Name
print '<tr>';
@ -393,9 +393,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '</table>';
print '</div>';
print '<div class="clearboth"></div><br>';
dol_fiche_end();
/*
@ -407,6 +407,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?action=delete&id='.$id.'">'.$langs->trans('Delete').'</a>';
print '</div>';
}
llxFooter();
$db->close();

View File

@ -571,7 +571,7 @@ else
// copy from expedition
$expeditionExtrafields = new Extrafields($db);
$expeditionExtrafieldLabels = $expeditionExtrafields->fetch_name_optionals_label($expedition->table_element);
if ($expedition->fetch_optionals($object->origin_id, $expeditionExtrafieldLabels) > 0) {
if ($expedition->fetch_optionals($object->origin_id) > 0) {
$object->array_options = array_merge($object->array_options, $expedition->array_options);
}
}
@ -674,12 +674,12 @@ else
$colspan=2;
$mode = ($object->statut == 0) ? 'edit' : 'view';
$line = new LivraisonLigne($db);
$line->fetch_optionals($object->lines[$i]->id,$extralabelslines);
$line->fetch_optionals($object->lines[$i]->id);
if ($action = 'create_delivery') {
$srcLine = new ExpeditionLigne($db);
$expeditionLineExtrafields = new Extrafields($db);
$expeditionLineExtrafieldLabels = $expeditionLineExtrafields->fetch_name_optionals_label($srcLine->table_element);
$srcLine->fetch_optionals($expedition->lines[$i]->id,$expeditionLineExtrafieldLabels);
$srcLine->fetch_optionals($expedition->lines[$i]->id);
$line->array_options = array_merge($line->array_options, $srcLine->array_options);
}
print '<tr class="oddeven">';

View File

@ -228,7 +228,7 @@ if (($id || $ref) && $action == 'edit')
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = myobjectPrepareHead($object);
dol_fiche_head($head, 'card', $langs->trans("MyObject"), -1, 'myobject@mymodule');

View File

@ -156,7 +156,7 @@ class PriceParser
//Retrieve all extrafield for product and add it to values
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('product', true);
$product->fetch_optionals($product->id, $extralabels);
$product->fetch_optionals();
foreach ($extrafields->attribute_label as $key=>$label)
{
$values["extrafield_".$key] = $product->array_options['options_'.$key];

View File

@ -194,7 +194,7 @@ if (($id || $ref) && $action == 'edit')
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = inventoryPrepareHead($object);
dol_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'inventory');

View File

@ -305,7 +305,7 @@ if ($action == 'create')
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create')))
{
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
//print load_fiche_titre($langs->trans("Batch"));

View File

@ -660,7 +660,7 @@ elseif ($object->id > 0)
* Show or edit
*/
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
// To verify role of users
$userAccess = $object->restrictedProjectArea($user,'read');

View File

@ -207,7 +207,7 @@ if ($id > 0 || ! empty($ref))
{
$object->fetch($id, $ref);
$object->fetch_thirdparty();
$res=$object->fetch_optionals($object->id,$extralabels_projet);
$res=$object->fetch_optionals();
// To verify role of users

View File

@ -97,7 +97,7 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id,$ref) > 0)
{
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();

View File

@ -207,7 +207,7 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id,$ref) > 0)
{
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();

View File

@ -288,13 +288,13 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{
$result=$projectstatic->fetch($projectidforalltimes);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$res=$projectstatic->fetch_optionals($object->id,$extralabels_projet);
$res=$projectstatic->fetch_optionals();
}
elseif ($object->fetch($id, $ref) >= 0)
{
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$res=$projectstatic->fetch_optionals($object->id,$extralabels_projet);
$res=$projectstatic->fetch_optionals();
$object->project = clone $projectstatic;
}

View File

@ -77,7 +77,7 @@ if ($id > 0)
{
$res=$object->fetch($id);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
print load_fiche_titre($langs->trans("MemberCard"), '', '');

View File

@ -566,7 +566,7 @@ class Dolresource extends CommonObject
// Retreive all extrafield for thirdparty
// fetch optionals attributes and labels
$line->fetch_optionals($line->id,$extralabels);
$line->fetch_optionals();
$this->lines[] = $line;
}

View File

@ -1418,7 +1418,7 @@ else
if ($socid)
{
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
//if ($res < 0) { dol_print_error($db); exit; }
$head = societe_prepare_head($object);
@ -2011,7 +2011,7 @@ else
* View
*/
if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels);
if (!empty($object->id)) $res=$object->fetch_optionals();
//if ($res < 0) { dol_print_error($db); exit; }

View File

@ -150,7 +150,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
else
{
if (!empty($object->id)) $res=$object->fetch_optionals($object->id,$extralabels);
if (!empty($object->id)) $res=$object->fetch_optionals();
//if ($res < 0) { dol_print_error($db); exit; }

View File

@ -358,7 +358,7 @@ if (empty($reshook))
// Extrafields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) {
$lines[$i]->fetch_optionals($lines[$i]->rowid);
$lines[$i]->fetch_optionals();
$array_options = $lines[$i]->array_options;
}

View File

@ -1042,7 +1042,7 @@ class SupplierProposal extends CommonObject
// get extrafields so they will be clone
foreach($this->lines as $line)
$line->fetch_optionals($line->rowid);
$line->fetch_optionals();
// Load source object
$objFrom = clone $this;

View File

@ -1176,7 +1176,7 @@ else
{
$object->fetch($id, '', '', 1);
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
$res=$object->fetch_optionals();
// Check if user has rights
$object->getrights();

View File

@ -306,7 +306,7 @@ function getActionComm($authentication,$id)
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('actioncomm',true);
//Get extrafield values
$actioncomm->fetch_optionals($actioncomm->id,$extralabels);
$actioncomm->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{

View File

@ -311,7 +311,7 @@ function getContact($authentication,$id,$ref_ext)
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('socpeople',true);
//Get extrafield values
$contact->fetch_optionals($contact->id,$extralabels);
$contact->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{

View File

@ -425,7 +425,7 @@ function getProductOrService($authentication,$id='',$ref='',$ref_ext='',$lang=''
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
//Get extrafield values
$product->fetch_optionals($product->id,$extralabels);
$product->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{
@ -1096,7 +1096,7 @@ function getProductsForCategory($authentication,$id,$lang='')
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('product',true);
//Get extrafield values
$obj->fetch_optionals($obj->id,$extralabels);
$obj->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{

View File

@ -377,7 +377,7 @@ function getProject($authentication,$id='',$ref='')
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
//Get extrafield values
$project->fetch_optionals($project->id,$extralabels);
$project->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{
$project_result_fields=array_merge($project_result_fields,array('options_'.$key => $project->array_options['options_'.$key]));

View File

@ -357,7 +357,7 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
$extrafields=new ExtraFields($db);
$extralabels=$extrafields->fetch_name_optionals_label('societe',true);
//Get extrafield values
$thirdparty->fetch_optionals($thirdparty->id,$extralabels);
$thirdparty->fetch_optionals();
foreach($extrafields->attribute_label as $key=>$label)
{

View File

@ -221,7 +221,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
{
if ($object->fk_soc >0 && empty($socid)) $socid = $object->fk_soc;
$res = $object->fetch_optionals($object->id, $extralabels);
$res = $object->fetch_optionals();
$head = websiteaccountPrepareHead($object);
dol_fiche_head($head, 'card', $langs->trans("WebsiteAccount"), -1, 'websiteaccount@website');