From b4446764f864c538b21233bd36e81c7e1a5c811d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Feb 2018 14:48:25 +0100 Subject: [PATCH] Clean code of deprecated usage --- htdocs/adherents/card.php | 4 +- htdocs/adherents/type.php | 4 +- htdocs/categories/viewcat.php | 11 +++-- htdocs/comm/action/card.php | 2 +- htdocs/comm/action/document.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/card.php | 2 +- htdocs/commande/class/commande.class.php | 4 +- .../facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contact/agenda.php | 3 +- htdocs/contact/card.php | 3 +- htdocs/contrat/card.php | 4 +- htdocs/contrat/class/contrat.class.php | 2 +- .../core/class/commondocgenerator.class.php | 10 ++-- htdocs/core/class/commonobject.class.php | 5 +- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 14 +++--- .../task/doc/doc_generic_task_odt.modules.php | 4 +- htdocs/don/card.php | 4 +- htdocs/expedition/card.php | 10 ++-- htdocs/expedition/shipment.php | 2 +- htdocs/expensereport/card.php | 2 +- htdocs/fichinter/card.php | 4 +- htdocs/fourn/commande/card.php | 2 +- htdocs/hrm/establishment/card.php | 48 +++++++++---------- htdocs/livraison/card.php | 6 +-- .../modulebuilder/template/myobject_card.php | 2 +- .../class/price_parser.class.php | 2 +- htdocs/product/inventory/card.php | 2 +- htdocs/product/stock/productlot_card.php | 2 +- htdocs/projet/card.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 4 +- htdocs/public/members/public_card.php | 2 +- htdocs/resource/class/dolresource.class.php | 2 +- htdocs/societe/card.php | 4 +- htdocs/societe/contact.php | 2 +- htdocs/supplier_proposal/card.php | 2 +- .../class/supplier_proposal.class.php | 2 +- htdocs/user/card.php | 2 +- htdocs/webservices/server_actioncomm.php | 2 +- htdocs/webservices/server_contact.php | 2 +- .../webservices/server_productorservice.php | 4 +- htdocs/webservices/server_project.php | 2 +- htdocs/webservices/server_thirdparty.php | 2 +- htdocs/website/websiteaccount_card.php | 2 +- 51 files changed, 108 insertions(+), 106 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 73f207abe91..65f9c65e641 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -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; } diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index cc9fd872062..142fdb300e2 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -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); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index 1f7b41df085..f6a0417bbda 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -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; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b89263bae01..2f59df43803 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -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) { diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 46efeb95a54..1bbe5ddc6fc 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -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) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 9c72170b880..380edc5a472 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -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; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1380b02d339..2b714bbeff8 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -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; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 54c7db7d6ca..21975439872 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -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'); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f89bcf534a2..b7ba839b144 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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; diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 84b61817a28..7a08cc6c97e 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -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; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index aba627dd8a2..0c48a4336d4 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -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; diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index c885f0869de..c513db1b49f 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -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); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 9c35714dcd5..7d024e6f096 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -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); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 0bbb509b7fa..d74c677f018 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1709,7 +1709,7 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { print ''; $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 ''; } @@ -1783,7 +1783,7 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { print ''; $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 ''; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e7bae75c3ed..0b84b05b6fd 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -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; diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index aeca3d5a102..c9c250ee1fa 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -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); }*/ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 07993bb1d97..f69e842ec81 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -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; diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 94ab828ee39..6e25c1ca730 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -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]; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0cc2fb0446f..ce95f2912c8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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]; } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index be4f5898f85..35e8ace270e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -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 diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 17e08dd4fd3..c846d7f6a23 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -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 diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 01164c47508..3d0e9e9623a 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -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; } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8fc21e0653e..82d6c746640 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -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 ''; 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 ''; if ($action == 'editline' && $lines[$i]->id == $line_id) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index d172d1034ca..0141fc1dea5 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -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'); diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 59c8b719d4e..a71ba9762b6 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1434,7 +1434,7 @@ else { $result = $object->fetch($id, $ref); - $res = $object->fetch_optionals($object->id, $extralabels); + $res = $object->fetch_optionals(); if ($result > 0) { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e7839f66da2..3eddb02c28b 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -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)); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index da3f79d94d0..15148cbcc2a 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -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); diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 3a08ae197a2..6180393e1df 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -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 ''; print $formcompany->select_ziptown(GETPOST('zipcode', 'alpha'), 'zipcode', array ( 'town', - 'selectcountry_id' + 'selectcountry_id' ), 6); print ''; print ''; - + // Town print ''; print ''.fieldLabel('Town','town',0).''; print ''; print $formcompany->select_ziptown(GETPOST('town', 'alpha'), 'town', array ( 'zipcode', - 'selectcountry_id' + 'selectcountry_id' )); print ''; print ''; @@ -234,7 +234,7 @@ if ($action == 'create') print ''; print ''; - + dol_fiche_end(); print '
'; @@ -286,12 +286,12 @@ if (($id || $ref) && $action == 'edit') print ''.fieldLabel('Zip','zipcode',0).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array ( 'town', - 'selectcountry_id' + 'selectcountry_id' ), 6) . ''; print ''.fieldLabel('Town','town',0).''; print $formcompany->select_ziptown($object->town, 'town', array ( 'zipcode', - 'selectcountry_id' + 'selectcountry_id' )) . ''; // 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 ''; - print ''; + print ''; // Status print ''.fieldLabel('Status','status',1).''; @@ -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 = '' . $langs->trans("BackToList") . ''; - + $morehtmlref='
'; $morehtmlref.='
'; - + dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'id', $morehtmlref); - - + + print '
'; //print '
'; print '
'; - print ''."\n"; + print '
'."\n"; // Name print ''; @@ -393,9 +393,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; - + print '

'; - + dol_fiche_end(); /* @@ -407,6 +407,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''.$langs->trans('Delete').''; print '
'; } - + llxFooter(); $db->close(); diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index 41091b36e08..b2218508ef6 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -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 ''; diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index bc1e9fc7d51..a82ec237006 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -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'); diff --git a/htdocs/product/dynamic_price/class/price_parser.class.php b/htdocs/product/dynamic_price/class/price_parser.class.php index c281816e99b..fc986a9e051 100644 --- a/htdocs/product/dynamic_price/class/price_parser.class.php +++ b/htdocs/product/dynamic_price/class/price_parser.class.php @@ -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]; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index e393721c47d..84db46c879f 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -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'); diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 1d9a7420740..8e639c90108 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -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")); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index ddfa1733f8c..71be9b5d4a3 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -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'); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 47de9ce2b19..11367951976 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -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 diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 49072299ac4..fb553a1b837 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -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(); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 479366ab586..3d1ccfb8fe1 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -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(); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index ce2e1c32889..49e917e4b61 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -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; } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 8f28cd12827..f21a4d1a338 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -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"), '', ''); diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index c7126c6d3bb..7db33a9bfae 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -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; } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b48c80a7a24..362834b316d 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -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; } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index d57f61045c0..32575beb8c7 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -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; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 440551bd925..c4f5c5c6ba9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -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; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index c6ae3642bc9..91eff1b5a8a 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -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; diff --git a/htdocs/user/card.php b/htdocs/user/card.php index ba327e7c9f1..aa169253fb3 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -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(); diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 4f0081551ca..a00e014d88a 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -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) { diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index fe4fcc3378f..6791864ba8b 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -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) { diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 00dcd2fe4fc..c4c4d40191e 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -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) { diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 9e10b0212ec..bc26de37601 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -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])); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 8e358e21924..c2236368d18 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -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) { diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 9918b0b3022..8daab76e38c 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -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');