From 8feca792f14479dfec6163e702966dbb78528e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 18:07:37 +0100 Subject: [PATCH 01/12] Update mouvementstock.class.php --- htdocs/product/stock/class/mouvementstock.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 39a9bb94bed..1135c0aa3fc 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -89,7 +89,8 @@ class MouvementStock extends CommonObject } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + /** * Add a movement of stock (in one direction only) * * @param User $user User object @@ -111,8 +112,9 @@ class MouvementStock extends CommonObject * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) * @return int <0 if KO, 0 if fk_product is null, >0 if OK */ - private function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0) + protected function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0) { + // phpcs:enable global $conf, $langs; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; From 7bcc4e877553ea42f67a64fe0467befb77c8b7ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 18:21:48 +0100 Subject: [PATCH 02/12] Update mouvementstock.class.php --- htdocs/product/stock/class/mouvementstock.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 1135c0aa3fc..99008aa9277 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -112,7 +112,7 @@ class MouvementStock extends CommonObject * @param int $id_product_batch Id product_batch (when skip_batch is false and we already know which record of product_batch to use) * @return int <0 if KO, 0 if fk_product is null, >0 if OK */ - protected function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0) + public function _create($user, $fk_product, $entrepot_id, $qty, $type, $price = 0, $label = '', $inventorycode = '', $datem = '', $eatby = '', $sellby = '', $batch = '', $skip_batch = false, $id_product_batch = 0) { // phpcs:enable global $conf, $langs; From 5dc3cbcdfc9988de4c47c6b37bee56b6f17793fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 18:22:59 +0100 Subject: [PATCH 03/12] remove warning --- htdocs/theme/eldy/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index db4b494179d..30870438475 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1839,7 +1839,7 @@ a.tmenuimage { $found=1; break; } - else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité + elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité { $url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); $found=1; From bdba88a6d56949ac1660ce00586f1a1d6ff0ca8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 18:23:52 +0100 Subject: [PATCH 04/12] remove warning --- htdocs/theme/md/style.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 85918a43245..781b72200b4 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1819,7 +1819,7 @@ foreach($mainmenuusedarray as $val) $found=1; break; } - else if (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité + elseif (file_exists($dirroot."/".$val."/img/".$val.".png")) // Retro compatibilité { $url=dol_buildpath('/'.$val.'/img/'.$val.'.png', 1); $found=1; From f283782445093a5fc46a7d6dd18847673dd7003a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 19:57:46 +0100 Subject: [PATCH 05/12] change visibility --- htdocs/adherents/class/api_members.class.php | 5 +++-- .../adherents/class/api_memberstypes.class.php | 5 +++-- htdocs/api/class/api_documents.class.php | 17 +++++++++-------- htdocs/api/class/api_setup.class.php | 4 +++- htdocs/bom/class/api_bom.class.php | 4 +++- .../categories/class/api_categories.class.php | 5 +++-- .../action/class/api_agendaevents.class.php | 5 +++-- .../comm/propal/class/api_proposals.class.php | 5 +++-- htdocs/commande/class/api_orders.class.php | 5 +++-- .../bank/class/api_bankaccounts.class.php | 4 +++- .../compta/facture/class/api_invoices.class.php | 5 +++-- htdocs/contrat/class/api_contracts.class.php | 5 +++-- htdocs/don/class/api_donations.class.php | 5 +++-- htdocs/expedition/class/api_shipments.class.php | 5 +++-- .../class/api_expensereports.class.php | 5 +++-- .../fichinter/class/api_interventions.class.php | 5 +++-- .../fourn/class/api_supplier_invoices.class.php | 5 +++-- .../fourn/class/api_supplier_orders.class.php | 5 +++-- .../template/class/api_mymodule.class.php | 4 +++- htdocs/product/class/api_products.class.php | 5 +++-- .../stock/class/api_stockmovements.class.php | 5 +++-- .../stock/class/api_warehouses.class.php | 5 +++-- htdocs/projet/class/api_projects.class.php | 5 +++-- htdocs/projet/class/api_tasks.class.php | 5 +++-- htdocs/societe/class/api_contacts.class.php | 5 +++-- htdocs/societe/class/api_thirdparties.class.php | 4 +++- .../class/api_supplier_proposals.class.php | 5 +++-- htdocs/ticket/class/api_tickets.class.php | 6 +++--- htdocs/user/class/api_users.class.php | 4 +++- 29 files changed, 93 insertions(+), 59 deletions(-) diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 6025f2a2985..6948bce1e25 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -288,15 +288,16 @@ class Members extends DolibarrApi return $member; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); // Remove the subscriptions because they are handled as a subresource. diff --git a/htdocs/adherents/class/api_memberstypes.class.php b/htdocs/adherents/class/api_memberstypes.class.php index 43fd2635fb4..abfaf84993d 100644 --- a/htdocs/adherents/class/api_memberstypes.class.php +++ b/htdocs/adherents/class/api_memberstypes.class.php @@ -266,15 +266,16 @@ class MembersTypes extends DolibarrApi return $membertype; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->array_options); diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 19bd61c641b..f4a7084b336 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -274,7 +274,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->societe->multidir_output[$object->entity] . "/" . $object->id; } - else if ($modulepart == 'adherent' || $modulepart == 'member') + elseif ($modulepart == 'adherent' || $modulepart == 'member') { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; @@ -290,7 +290,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->adherent->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'member'); } - else if ($modulepart == 'propal' || $modulepart == 'proposal') + elseif ($modulepart == 'propal' || $modulepart == 'proposal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; @@ -306,7 +306,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->propal->multidir_output[$object->entity] . "/" . get_exdir(0, 0, 0, 1, $object, 'propal'); } - else if ($modulepart == 'commande' || $modulepart == 'order') + elseif ($modulepart == 'commande' || $modulepart == 'order') { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; @@ -322,7 +322,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->commande->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'commande'); } - else if ($modulepart == 'shipment' || $modulepart == 'expedition') + elseif ($modulepart == 'shipment' || $modulepart == 'expedition') { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; @@ -338,7 +338,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->expedition->dir_output . "/sending/" . get_exdir(0, 0, 0, 1, $object, 'shipment'); } - else if ($modulepart == 'facture' || $modulepart == 'invoice') + elseif ($modulepart == 'facture' || $modulepart == 'invoice') { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; @@ -354,7 +354,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->facture->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'invoice'); } - else if ($modulepart == 'produit' || $modulepart == 'product') + elseif ($modulepart == 'produit' || $modulepart == 'product') { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -370,7 +370,7 @@ class Documents extends DolibarrApi $upload_dir = $conf->product->dir_output . "/" . get_exdir(0, 0, 0, 1, $object, 'product'); } - else if ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') + elseif ($modulepart == 'agenda' || $modulepart == 'action' || $modulepart == 'event') { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; @@ -600,7 +600,8 @@ class Documents extends DolibarrApi * @return array * @throws RestException */ - private function _validate_file($data) { + private function _validate_file($data) + { // phpcs:enable $result = array(); foreach (Documents::$DOCUMENT_FIELDS as $field) { diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 766cf79f7be..783ec6540e3 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -273,14 +273,16 @@ class Setup extends DolibarrApi return $list; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->error); diff --git a/htdocs/bom/class/api_bom.class.php b/htdocs/bom/class/api_bom.class.php index 4bb4f1a96ab..4d13475be1a 100644 --- a/htdocs/bom/class/api_bom.class.php +++ b/htdocs/bom/class/api_bom.class.php @@ -283,14 +283,16 @@ class BillOfMaterialsApi extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable $object = parent::_cleanObjectDatas($object); /*unset($object->note); diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 434b7ba1d24..c975236f930 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -261,15 +261,16 @@ class Categories extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param Categorie $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); // Remove fields not relevent to categories diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index b6df9ec7d96..ec899d72ae1 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -313,15 +313,16 @@ class AgendaEvents extends DolibarrApi return $event; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->usermod); diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 33122986187..9145b8eb151 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -782,15 +782,16 @@ class Proposals extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->note); diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 2bd942a3c34..24508d6fb11 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -838,15 +838,16 @@ class Orders extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->note); diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index 04692fb4e44..72ba4c82db1 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -248,14 +248,16 @@ class BankAccounts extends DolibarrApi return $account; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->rowid); diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 6c4c94fc2ce..d68c3d40338 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1417,15 +1417,16 @@ class Invoices extends DolibarrApi return $paiement_id; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->note); diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 6f4a2041670..00d168a0db4 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -633,15 +633,16 @@ class Contracts extends DolibarrApi + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->address); diff --git a/htdocs/don/class/api_donations.class.php b/htdocs/don/class/api_donations.class.php index 06ddd5616c0..8762f763da7 100644 --- a/htdocs/don/class/api_donations.class.php +++ b/htdocs/don/class/api_donations.class.php @@ -326,15 +326,16 @@ class Donations extends DolibarrApi return $this->_cleanObjectDatas($this->don); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->note); diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 73923105c7d..0c8f8717aea 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -610,15 +610,16 @@ class Shipments extends DolibarrApi } */ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->thirdparty); // id already returned diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 35ce9f9a4a2..cb5a438bc21 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -489,15 +489,16 @@ class ExpenseReports extends DolibarrApi ); }*/ + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->barcode_type); diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index d49f58ed52e..2702ad6c55e 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -417,15 +417,16 @@ class Interventions extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->statuts_short); diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index 3f94401bc9d..416f7e11e94 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -333,15 +333,16 @@ class SupplierInvoices extends DolibarrApi ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param Object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->rowid); diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 9a898fae3a7..42f7eccf608 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -330,15 +330,16 @@ class SupplierOrders extends DolibarrApi ); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param Object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->rowid); diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index cdb5a4b74f4..566fe56affb 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -280,14 +280,16 @@ class MyModuleApi extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable $object = parent::_cleanObjectDatas($object); /*unset($object->note); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index c95bcdcb8f4..756bbde5b29 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -468,15 +468,16 @@ class Products extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->regeximgext); diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index 4c5971b8cc4..12cf15110fe 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -274,15 +274,16 @@ class StockMovements extends DolibarrApi + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param MouvementStock $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); // Remove useless data diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index 18286cea931..e0a05af4226 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -243,15 +243,16 @@ class Warehouses extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param Entrepot $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); // Remove the subscriptions because they are handled as a subresource. diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 532f46ccfe4..9680cd66591 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -534,15 +534,16 @@ class Projects extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->titre); diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 40c3e78f7e6..9fafcb98343 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -547,15 +547,16 @@ class Tasks extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->barcode_type); diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 97fc83a3545..772d8d3fe10 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -379,15 +379,16 @@ class Contacts extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param Object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->total_ht); diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 3cc1dd51b1a..954535d1c87 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1626,14 +1626,16 @@ $reshook = $hookmanager->executeHooks('replaceThirdparty', array( } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->nom); // ->name already defined and nom deprecated diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 15f4278bf49..5ac77fe85bb 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -190,15 +190,16 @@ class Supplierproposals extends DolibarrApi } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); unset($object->name); diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 005d8084f31..fedadd2c96e 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -513,7 +513,7 @@ class Tickets extends DolibarrApi return $ticket; } - + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * @@ -523,9 +523,9 @@ class Tickets extends DolibarrApi * @todo use an array for properties to clean * */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { - + // phpcs:enable $object = parent::_cleanObjectDatas($object); // Other attributes to clean diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index 625fd913f5e..17e22a314ef 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -354,14 +354,16 @@ class Users extends DolibarrApi return $this->useraccount->delete(DolibarrApiAccess::$user); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore /** * Clean sensible object datas * * @param object $object Object to clean * @return array Array of cleaned object properties */ - private function _cleanObjectDatas($object) + protected function _cleanObjectDatas($object) { + // phpcs:enable global $conf; $object = parent::_cleanObjectDatas($object); From 16c73af0cb131d3860f6945a61619a15c2a99f4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 20:16:18 +0100 Subject: [PATCH 06/12] remove test ticketlog --- test/phpunit/TicketTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/TicketTest.php b/test/phpunit/TicketTest.php index 175ced68bda..b5bfd9212e9 100644 --- a/test/phpunit/TicketTest.php +++ b/test/phpunit/TicketTest.php @@ -341,7 +341,7 @@ class TicketTest extends PHPUnit_Framework_TestCase * @depends testTicketFetch * The depends says test is run only if previous is ok */ - public function testTicketcreateTicketLog($localobject) + /*public function testTicketcreateTicketLog($localobject) { global $conf,$user,$langs,$db; $conf=$this->savconf; @@ -357,7 +357,7 @@ class TicketTest extends PHPUnit_Framework_TestCase $this->assertGreaterThan(0, $result); return $localobject; - } + }*/ /** * testTicketclose From 2f3c3aeb05e2cc649884cda8cb5c2d6eb4ff5c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 21:24:48 +0100 Subject: [PATCH 07/12] test --- test/phpunit/MouvementStockTest.php | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index 597f4b88de6..b6acdfd11b1 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -162,27 +162,27 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase // Do a list of movement into warehouse 1 - // Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9 - $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.9, 'Movement for unit test 1', 'Inventory Code Test'); + // Create an input movement (type = 3) of price 9.9 -> should update PMP to 9.9 + $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.9, 'Movement for unit test 1'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.7, 'Movement for unit test 2', 'Inventory Code Test'); + // Create an input movement (type = 3) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 + $result=$localobject->reception($user, $product1id, $warehouse1id, 10, 9.7, 'Movement for unit test 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->livraison($user, $product1id, $warehouse1id, 5, 999, 'Movement for unit test 3', 'Inventory Code Test'); + // Create an output movement (type = 2) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 + $result=$localobject->livraison($user, $product1id, $warehouse1id, 5, 999, 'Movement for unit test 3'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 + // Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 $result=$localobject->_create($user, $product1id, $warehouse1id, 1, 0, 0, 'Input from transfer', 'Transfert X'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 + // Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 $result=$localobject->_create($user, $product1id, $warehouse1id, -2, 1, 0, 'Output from transfer', 'Transfert Y'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); @@ -190,27 +190,27 @@ class MouvementStockTest extends PHPUnit_Framework_TestCase // Do same but into warehouse 2 - // Create an input movement (type = 3) of price 9.9 -> shoul dupdate PMP to 9.9 - $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.9, 'Movement for unit test 1 wh 2', 'Inventory Code Test 2'); + // Create an input movement (type = 3) of price 9.9 -> should update PMP to 9.9 + $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.9, 'Movement for unit test 1 wh 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an input movement (type = 3) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.7, 'Movement for unit test 2 wh 2', 'Inventory Code Test 2'); + // Create an input movement (type = 3) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 + $result=$localobject->reception($user, $product1id, $warehouse2id, 10, 9.7, 'Movement for unit test 2 wh 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 2) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 - $result=$localobject->livraison($user, $product1id, $warehouse2id, 5, 999, 'Movement for unit test 3 wh 2', 'Inventory Code Test 2'); + // Create an output movement (type = 2) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 + $result=$localobject->livraison($user, $product1id, $warehouse2id, 5, 999, 'Movement for unit test 3 wh 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 + // Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 $result=$localobject->_create($user, $product1id, $warehouse2id, 1, 0, 0, 'Input from transfer wh 2', 'Transfert X 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); - // Create an output movement (type = 1) of price 9.7 -> shoul dupdate PMP to 9.9/9.7 = 9.8 + // Create an output movement (type = 1) of price 9.7 -> should update PMP to 9.9/9.7 = 9.8 $result=$localobject->_create($user, $product1id, $warehouse2id, -2, 1, 0, 'Output from transfer wh 2', 'Transfert Y 2'); print __METHOD__." result=".$result."\n"; $this->assertLessThan($result, 0); From e8b21887e2f186659cf75f2dfd49b48a908617b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 21:41:00 +0100 Subject: [PATCH 08/12] phpcs --- htdocs/admin/security.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 6c3ed1f294b..df2d2b09ee6 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -497,7 +497,7 @@ print ''; print ''; print '
'; -if (GETPOST('info','int') > 0) +if (GETPOST('info', 'int') > 0) { if (function_exists('password_hash')) { From 023992f2e14758743265bc7d1a34753a11318db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 23:06:23 +0100 Subject: [PATCH 09/12] Update list.php --- htdocs/ticket/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 0b3a1c101e8..3a0e8fea9d6 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -580,7 +580,7 @@ foreach($object->fields as $key => $val) if ($key == 'fk_statut') $cssforfield.=($cssforfield?' ':'').'center'; if (! empty($arrayfields['t.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield?'class="'.$cssforfield.'"':''), $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; + print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, '', $sortfield, $sortorder, ($cssforfield?$cssforfield.' ':''))."\n"; } } // Extra fields From 162f2614e5527d9d0aaadb728bc90e171264a8f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 4 Mar 2019 23:25:23 +0100 Subject: [PATCH 10/12] Update mymodulewidget1.php --- htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php index 7416eb1c35e..087f102daef 100644 --- a/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php +++ b/htdocs/modulebuilder/template/core/boxes/mymodulewidget1.php @@ -186,7 +186,7 @@ class mymodulewidget1 extends ModeleBoxes 'tr' => 'class="left"', 'text' => '' ), - 0 => array( // TR + 1 => array( // TR 'tr' => 'class="left"', 'text' => '' ) From ef10a3206906707ec88bf36b3c493a593c2a0a4f Mon Sep 17 00:00:00 2001 From: Lionel VESSILLER Date: Tue, 5 Mar 2019 11:18:44 +0100 Subject: [PATCH 11/12] Fix authorize long references in Beluga PDF model (uses Landscape mode) --- .../project/doc/pdf_beluga.modules.php | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index f24f400f2af..95bba01ad23 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -54,6 +54,12 @@ if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/com class pdf_beluga extends ModelePDFProjects { + /** + * Page orientation + * @var string 'P' or 'Portait' (default), 'L' or 'Landscape' + */ + private $orientation = ''; + /** * Issuer * @var Societe @@ -79,8 +85,14 @@ class pdf_beluga extends ModelePDFProjects // Dimension page pour format A4 $this->type = 'pdf'; $formatarray=pdf_getFormat(); - $this->page_largeur = $formatarray['width']; - $this->page_hauteur = $formatarray['height']; + $this->orientation = 'L'; + if ($this->orientation == 'L' || $this->orientation == 'Landscape') { + $this->page_largeur = $formatarray['height']; + $this->page_hauteur = $formatarray['width']; + } else { + $this->page_largeur = $formatarray['width']; + $this->page_hauteur = $formatarray['height']; + } $this->format = array($this->page_largeur,$this->page_hauteur); $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10; $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10; @@ -95,13 +107,22 @@ class pdf_beluga extends ModelePDFProjects $this->emetteur=$mysoc; if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang, -2); // By default if not defined - // Defini position des colonnes - $this->posxref=$this->marge_gauche+1; - $this->posxdate=$this->marge_gauche+25; - $this->posxsociety=$this->marge_gauche+45; - $this->posxamountht=$this->marge_gauche+110; - $this->posxamountttc=$this->marge_gauche+135; - $this->posxstatut=$this->marge_gauche+165; + // Defini position des colonnes + if ($this->orientation == 'L' || $this->orientation == 'Landscape') { + $this->posxref=$this->marge_gauche+1; + $this->posxdate=$this->marge_gauche+105; + $this->posxsociety=$this->marge_gauche+125; + $this->posxamountht=$this->marge_gauche+190; + $this->posxamountttc=$this->marge_gauche+215; + $this->posxstatut=$this->marge_gauche+245; + } else { + $this->posxref=$this->marge_gauche+1; + $this->posxdate=$this->marge_gauche+25; + $this->posxsociety=$this->marge_gauche+45; + $this->posxamountht=$this->marge_gauche+110; + $this->posxamountttc=$this->marge_gauche+135; + $this->posxstatut=$this->marge_gauche+165; + } if ($this->page_largeur < 210) // To work with US executive format { $this->posxref-=20; @@ -217,7 +238,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page - $pdf->AddPage(); + $pdf->AddPage($this->orientation); if (! empty($tplidx)) $pdf->useTemplate($tplidx); $pagenb++; $this->_pagehead($pdf, $object, 1, $outputlangs); @@ -433,7 +454,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore=$pdf->getPage(); // Description of line @@ -469,7 +490,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->rollbackTransaction(true); $pageposafter=$pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // Label $pdf->SetXY($this->posxref, $curY); $posybefore=$pdf->GetY(); @@ -480,7 +501,7 @@ class pdf_beluga extends ModelePDFProjects { if ($i == ($num-1)) // No more lines, and no space left to show total, so we create a new page { - $pdf->AddPage('', '', true); + $pdf->AddPage($this->orientation, '', true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposafter+1); @@ -495,9 +516,9 @@ class pdf_beluga extends ModelePDFProjects { $pdf->rollbackTransaction(true); $pageposafter=$pageposbefore; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. - $pdf->AddPage('', '', true); + $pdf->AddPage($this->orientation, '', true); if (! empty($tplidx)) $pdf->useTemplate($tplidx); if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $pdf->setPage($pageposafter+1); @@ -505,7 +526,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage + $heightoftitleline + 1; // Label @@ -528,7 +549,7 @@ class pdf_beluga extends ModelePDFProjects $pageposafter=$pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -628,7 +649,7 @@ class pdf_beluga extends ModelePDFProjects $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, 1, 0); // The only function to edit the bottom margin of current page to set it. if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } } From 2ebffb2ffe2fc03c47f9379d4b7c99154d34cacd Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Tue, 5 Mar 2019 16:29:53 +0100 Subject: [PATCH 12/12] FIX: date in ticket.class.php dolibarize date --- htdocs/ticket/class/ticket.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 0eb1de8f8d2..c603c0489cb 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -528,9 +528,12 @@ class Ticket extends CommonObject $this->severity_label = $label_severity; $this->datec = $this->db->jdate($obj->datec); + $this->date_creation = $this->db->jdate($obj->datec); $this->date_read = $this->db->jdate($obj->date_read); + $this->date_validation = $this->db->jdate($obj->date_read); $this->date_close = $this->db->jdate($obj->date_close); $this->tms = $this->db->jdate($obj->tms); + $this->date_modification = $this->db->jdate($obj->tms); $this->fetch_optionals();