From d3dc6615db42246be08c761627721f2c728a3057 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Oct 2023 21:49:08 +0200 Subject: [PATCH] Remove deprecated use of ->modelpdf (good is ->model_pdf) --- htdocs/comm/action/class/api_agendaevents.class.php | 1 - htdocs/comm/propal/class/propal.class.php | 1 - htdocs/commande/class/commande.class.php | 3 --- htdocs/compta/facture/class/facture-rec.class.php | 1 - htdocs/compta/facture/class/facture.class.php | 4 ---- htdocs/compta/payment_vat/card.php | 2 +- htdocs/contrat/card.php | 3 +-- htdocs/contrat/class/contrat.class.php | 3 --- htdocs/core/class/commonobject.class.php | 6 ------ htdocs/delivery/class/delivery.class.php | 1 - htdocs/don/class/don.class.php | 1 - htdocs/expedition/class/expedition.class.php | 3 --- htdocs/expensereport/class/expensereport.class.php | 2 -- htdocs/fichinter/class/fichinter.class.php | 3 --- htdocs/fichinter/class/fichinterrec.class.php | 3 +-- htdocs/fourn/class/fournisseur.commande.class.php | 1 - htdocs/fourn/class/fournisseur.facture-rec.class.php | 4 ++-- htdocs/fourn/class/fournisseur.facture.class.php | 1 - .../stock/stocktransfer/class/stocktransfer.class.php | 4 ++-- htdocs/projet/class/project.class.php | 1 - htdocs/projet/class/task.class.php | 2 -- htdocs/reception/class/reception.class.php | 1 - htdocs/societe/class/societe.class.php | 1 - htdocs/supplier_proposal/class/supplier_proposal.class.php | 1 - htdocs/user/class/user.class.php | 5 +++++ 25 files changed, 12 insertions(+), 46 deletions(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index eef28e3516b..16fcf9d9d4e 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -406,7 +406,6 @@ class AgendaEvents extends DolibarrApi unset($object->region_id); unset($object->actions); unset($object->lines); - unset($object->modelpdf); return $object; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 9676c352e44..af9221b3d8e 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1667,7 +1667,6 @@ class Propal extends CommonObject $this->project = null; // Clear if another value was already set by fetch_projet $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->note = $obj->note_private; // TODO deprecated $this->note_private = $obj->note_private; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ec4456abfba..fc3dcc13af8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1949,7 +1949,6 @@ class Commande extends CommonOrder $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->mode_reglement_id = $obj->fk_mode_reglement; $this->mode_reglement_code = $obj->mode_reglement_code; @@ -4144,8 +4143,6 @@ class Commande extends CommonOrder if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->COMMANDE_ADDON_PDF)) { $modele = $conf->global->COMMANDE_ADDON_PDF; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 32d8d141206..160f54e5ece 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -606,7 +606,6 @@ class FactureRec extends CommonInvoice $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; - $this->modelpdf = $obj->model_pdf; // deprecated $this->model_pdf = $obj->model_pdf; //$this->special_code = $obj->special_code; $this->frequency = $obj->frequency; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c07dc2c59a2..65cd10fb58d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1154,7 +1154,6 @@ class Facture extends CommonInvoice $facture->note_public = $this->note_public; $facture->note_private = $this->note_private; $facture->ref_client = $this->ref_client; - $facture->modelpdf = $this->model_pdf; // deprecated $facture->model_pdf = $this->model_pdf; $facture->fk_project = $this->fk_project; $facture->cond_reglement_id = $this->cond_reglement_id; @@ -2222,7 +2221,6 @@ class Facture extends CommonInvoice $this->fk_user_valid = $obj->fk_user_valid; $this->fk_user_modif = $obj->fk_user_modif; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->last_main_doc = $obj->last_main_doc; $this->situation_cycle_ref = $obj->situation_cycle_ref; $this->situation_counter = $obj->situation_counter; @@ -5214,8 +5212,6 @@ class Facture extends CommonInvoice if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->$thisTypeConfName)) { $modele = $conf->global->$thisTypeConfName; } elseif (!empty($conf->global->FACTURE_ADDON_PDF)) { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index bd431f65dae..c170d15cd72 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -102,7 +102,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->tax->char $outputlangs->setDefaultLang($_REQUEST['lang_id']); } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - $fac->generateDocument($fac->modelpdf, $outputlangs); + $fac->generateDocument($fac->model_pdf, $outputlangs); } } diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 15b36b6a71c..ca2a1a686ba 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -182,7 +182,6 @@ if (empty($reshook)) { } } - // Si ajout champ produit predefini if (GETPOST('mode') == 'predefined') { $date_start = ''; $date_end = ''; @@ -897,7 +896,7 @@ if (empty($reshook)) { if ($ret < 0) { $error++; } - + var_dump($object);exit; if (!$error) { $result = $object->insertExtraFields('CONTRACT_MODIFY'); if ($result < 0) { diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 2ae01b2fc3a..ba85ee103b7 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -726,7 +726,6 @@ class Contrat extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->fk_projet = $obj->fk_project; // deprecated $this->fk_project = $obj->fk_project; @@ -2537,8 +2536,6 @@ class Contrat extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->CONTRACT_ADDON_PDF)) { $modele = $conf->global->CONTRACT_ADDON_PDF; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 35440444842..685fb74a464 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -480,11 +480,6 @@ abstract class CommonObject */ public $fk_account; - /** - * @var string Open ID - */ - public $openid; - /** * @var string Public note * @see update_note() @@ -2979,7 +2974,6 @@ abstract class CommonObject $resql = $this->db->query($sql); if ($resql) { $this->model_pdf = $modelpdf; - $this->modelpdf = $modelpdf; // For bakward compatibility return 1; } else { dol_print_error($this->db); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index e188526ef58..fb92c912aff 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -349,7 +349,6 @@ class Delivery extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->origin = $obj->origin; // May be 'shipping' $this->origin_id = $obj->origin_id; // May be id of shipping diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 0d9a9e043fd..5f6a699915d 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -687,7 +687,6 @@ class Don extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated // Retrieve all extrafield // fetch optionals attributes and labels diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 412f192ac54..18761de10b6 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -616,7 +616,6 @@ class Expedition extends CommonObject $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->fk_delivery_address = $obj->fk_address; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->shipping_method_id = $obj->fk_shipping_method; $this->shipping_method = $obj->shipping_method; $this->tracking_number = $obj->tracking_number; @@ -2475,8 +2474,6 @@ class Expedition extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->EXPEDITION_ADDON_PDF)) { $modele = $conf->global->EXPEDITION_ADDON_PDF; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 68a8ba1910b..1947470adf9 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2431,8 +2431,6 @@ class ExpenseReport extends CommonObject if (!dol_strlen($modele)) { if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { $modele = $conf->global->EXPENSEREPORT_ADDON_PDF; } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 86d936416e0..d0b1f4295da 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -475,7 +475,6 @@ class Fichinter extends CommonObject $this->note_public = $obj->note_public; $this->note_private = $obj->note_private; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->fk_contrat = $obj->fk_contrat; $this->entity = $obj->entity; @@ -711,8 +710,6 @@ class Fichinter extends CommonObject if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->FICHEINTER_ADDON_PDF)) { $modele = $conf->global->FICHEINTER_ADDON_PDF; } diff --git a/htdocs/fichinter/class/fichinterrec.class.php b/htdocs/fichinter/class/fichinterrec.class.php index f29e1e17eec..8d6b65b5c6b 100644 --- a/htdocs/fichinter/class/fichinterrec.class.php +++ b/htdocs/fichinter/class/fichinterrec.class.php @@ -302,8 +302,7 @@ class FichinterRec extends Fichinter $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->user_author = $obj->fk_user_author; - $this->model_pdf = !empty($obj->model_pdf) ? $obj->model_pdf : ""; - $this->modelpdf = !empty($obj->model_pdf) ? $obj->model_pdf : ""; // deprecated + $this->model_pdf = empty($obj->model_pdf) ? "" : $obj->model_pdf; $this->rang = !empty($obj->rang) ? $obj->rang : ""; $this->special_code = !empty($obj->special_code) ? $obj->special_code : ""; $this->frequency = $obj->frequency; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 73ddde7d896..6f251175786 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -468,7 +468,6 @@ class CommandeFournisseur extends CommonOrder $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated //Incoterms $this->fk_incoterms = $obj->fk_incoterms; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 940b3bf169d..3ded6e8fc61 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -581,7 +581,7 @@ class FactureFournisseurRec extends CommonInvoice $sql .= ', f.fk_mode_reglement, p.code as mode_reglement_code, p.libelle as mode_reglement_libelle'; $sql .= ', f.fk_cond_reglement, c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc'; $sql .= ', f.date_lim_reglement'; - $sql .= ', f.note_private, f.note_public, f.modelpdf'; + $sql .= ', f.note_private, f.note_public, f.modelpdf as model_pdf'; $sql .= ', f.fk_multicurrency, f.multicurrency_code, f.multicurrency_tx, f.multicurrency_total_ht, f.multicurrency_total_tva, f.multicurrency_total_ttc'; $sql .= ', f.usenewprice, f.frequency, f.unit_frequency, f.date_when, f.date_last_gen, f.nb_gen_done, f.nb_gen_max, f.auto_validate'; $sql .= ', f.generate_pdf'; @@ -635,7 +635,7 @@ class FactureFournisseurRec extends CommonInvoice $this->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement); $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; - $this->model_pdf = $obj->modelpdf; + $this->model_pdf = $obj->model_pdf; // Multicurrency $this->fk_multicurrency = $obj->fk_multicurrency; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 5dbf7b179e7..0ee31784a16 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -960,7 +960,6 @@ class FactureFournisseur extends CommonInvoice $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->import_key = $obj->import_key; //Incoterms diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 6d29d5e34e6..71fef05f245 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -975,8 +975,8 @@ class StockTransfer extends CommonObject if (!dol_strlen($modele)) { $modele = 'eagle'; - if ($this->modelpdf) { - $modele = $this->modelpdf; + if ($this->model_pdf) { + $modele = $this->model_pdf; } elseif (!empty($conf->global->STOCKTRANSFER_ADDON_PDF)) { $modele = $conf->global->STOCKTRANSFER_ADDON_PDF; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index b5e7bf8af29..271269fa837 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -736,7 +736,6 @@ class Project extends CommonObject $this->opp_percent = $obj->opp_percent; $this->budget_amount = $obj->budget_amount; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->usage_opportunity = (int) $obj->usage_opportunity; $this->usage_task = (int) $obj->usage_task; $this->usage_bill_time = (int) $obj->usage_bill_time; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index b8e449f0748..1581ca82d7e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2222,8 +2222,6 @@ class Task extends CommonObjectLine if (!empty($this->model_pdf)) { $modele = $this->model_pdf; - } elseif (!empty($this->modelpdf)) { // deprecated - $modele = $this->modelpdf; } elseif (!empty($conf->global->PROJECT_TASK_ADDON_PDF)) { $modele = $conf->global->PROJECT_TASK_ADDON_PDF; } diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 76bf825ce83..3445af305c6 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -412,7 +412,6 @@ class Reception extends CommonObject $this->date_reception = $this->db->jdate($obj->date_reception); // Date real $this->date_delivery = $this->db->jdate($obj->date_delivery); // Date planed $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->shipping_method_id = $obj->fk_shipping_method; $this->tracking_number = $obj->tracking_number; $this->origin = ($obj->origin ? $obj->origin : 'commande'); // For compatibility diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 676e91857f4..7bda2fe4280 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1988,7 +1988,6 @@ class Societe extends CommonObject $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->default_lang = $obj->default_lang; $this->logo = $obj->logo; $this->logo_squarred = $obj->logo_squarred; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 72a4f663cc7..1cf59d79001 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1251,7 +1251,6 @@ class SupplierProposal extends CommonObject $this->socid = $obj->fk_soc; $this->fk_project = $obj->fk_project; $this->model_pdf = $obj->model_pdf; - $this->modelpdf = $obj->model_pdf; // deprecated $this->note = $obj->note_private; // TODO deprecated $this->note_private = $obj->note_private; $this->note_public = $obj->note_public; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index cee6eb07465..13d7c8c3f14 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -90,6 +90,11 @@ class User extends CommonObject public $status; + /** + * @var string Open ID + */ + public $openid; + public $ldap_sid; public $search_sid; public $employee;