From f893854986d74ddeae506ae22cd15eb99f53572f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Sep 2019 14:24:13 +0200 Subject: [PATCH] Fix remove warnings --- htdocs/contact/class/contact.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 6 ++---- htdocs/core/lib/bank.lib.php | 1 - htdocs/core/lib/donation.lib.php | 2 +- htdocs/core/lib/multicurrency.lib.php | 2 +- htdocs/core/lib/ticket.lib.php | 2 +- htdocs/datapolicy/lib/datapolicy.lib.php | 4 +++- htdocs/dav/dav.lib.php | 4 ++-- htdocs/emailcollector/lib/emailcollector.lib.php | 2 ++ htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php | 2 ++ htdocs/product/inventory/lib/inventory.lib.php | 2 +- htdocs/takepos/lib/takepos.lib.php | 4 +++- htdocs/website/lib/websiteaccount.lib.php | 2 ++ 13 files changed, 21 insertions(+), 14 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index c73ceaf13ee..ebfafa698b7 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1008,7 +1008,7 @@ class Contact extends CommonObject // Removed extrafields if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { // For avoid conflicts if trigger used - $result=$this->deleteExtraFields($this); + $result=$this->deleteExtraFields(); if ($result < 0) $error++; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index c6bc31956d6..9316dcbfeb6 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -549,15 +549,13 @@ function calendars_prepare_head($param) $h++; - $object=new stdClass(); - // Show more tabs from modules // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'agenda', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'agenda', 'remove'); return $head; } diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php index f117bc24daf..54d1c491878 100644 --- a/htdocs/core/lib/bank.lib.php +++ b/htdocs/core/lib/bank.lib.php @@ -163,7 +163,6 @@ function bank_admin_prepare_head($object) */ function various_payment_prepare_head($object) { - global $db, $langs, $conf; $h = 0; diff --git a/htdocs/core/lib/donation.lib.php b/htdocs/core/lib/donation.lib.php index 91c41ffcced..7b78ac96b91 100644 --- a/htdocs/core/lib/donation.lib.php +++ b/htdocs/core/lib/donation.lib.php @@ -80,7 +80,7 @@ function donation_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->don->dir_output . '/' . get_exdir($filename, 2, 0, 1, $object, 'donation'). '/'. dol_sanitizeFileName($object->ref); + $upload_dir = $conf->don->dir_output . '/' . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$h][0] = DOL_URL_ROOT.'/don/document.php?id='.$object->id; diff --git a/htdocs/core/lib/multicurrency.lib.php b/htdocs/core/lib/multicurrency.lib.php index 339ca2d01bc..e44511fcb97 100644 --- a/htdocs/core/lib/multicurrency.lib.php +++ b/htdocs/core/lib/multicurrency.lib.php @@ -40,7 +40,7 @@ function multicurrencyAdminPrepareHead() $head[$h][2] = 'settings'; $h++; - complete_head_from_modules($conf, $langs, $object, $head, $h, 'multicurrency'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'multicurrency'); return $head; } diff --git a/htdocs/core/lib/ticket.lib.php b/htdocs/core/lib/ticket.lib.php index 84be86f4a15..c1d42bf25b7 100644 --- a/htdocs/core/lib/ticket.lib.php +++ b/htdocs/core/lib/ticket.lib.php @@ -59,7 +59,7 @@ function ticketAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@ticket:/ticket/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'ticketadmin'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'ticketadmin'); return $head; } diff --git a/htdocs/datapolicy/lib/datapolicy.lib.php b/htdocs/datapolicy/lib/datapolicy.lib.php index b72417d7ff9..1ea83696a1b 100644 --- a/htdocs/datapolicy/lib/datapolicy.lib.php +++ b/htdocs/datapolicy/lib/datapolicy.lib.php @@ -48,7 +48,9 @@ function datapolicyAdminPrepareHead() $h++; } - complete_head_from_modules($conf, $langs, $object, $head, $h, 'datapolicy'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'datapolicy', 'remove'); return $head; } diff --git a/htdocs/dav/dav.lib.php b/htdocs/dav/dav.lib.php index 3c213f400c1..058fc635fc7 100644 --- a/htdocs/dav/dav.lib.php +++ b/htdocs/dav/dav.lib.php @@ -63,9 +63,9 @@ function dav_admin_prepare_head() // Entries must be declared in modules descriptor with line // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab // $this->tabs = array('entity:-tabname); to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav'); - complete_head_from_modules($conf, $langs, $object, $head, $h, 'admindav', 'remove'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'admindav', 'remove'); return $head; } diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index e7cc3bcb3a0..e9cb3984819 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -81,5 +81,7 @@ function emailcollectorPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'emailcollector', 'remove'); + return $head; } diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php index e1af0259062..d9ea2f110cd 100644 --- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php +++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php @@ -79,5 +79,7 @@ function myobjectPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'myobject@mymodule', 'remove'); + return $head; } diff --git a/htdocs/product/inventory/lib/inventory.lib.php b/htdocs/product/inventory/lib/inventory.lib.php index 175c772cb61..ad2e8193449 100644 --- a/htdocs/product/inventory/lib/inventory.lib.php +++ b/htdocs/product/inventory/lib/inventory.lib.php @@ -50,7 +50,7 @@ function inventoryAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@inventory:/inventory/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'inventory'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'inventory'); return $head; } diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php index 691f118d2cb..024e1fb9ae5 100644 --- a/htdocs/takepos/lib/takepos.lib.php +++ b/htdocs/takepos/lib/takepos.lib.php @@ -52,7 +52,9 @@ function takeposAdminPrepareHead() //$this->tabs = array( // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' //); // to remove a tab - complete_head_from_modules($conf, $langs, $object, $head, $h, 'takepos'); + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); + + complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); return $head; } diff --git a/htdocs/website/lib/websiteaccount.lib.php b/htdocs/website/lib/websiteaccount.lib.php index 0b63be45188..8ade5eee288 100644 --- a/htdocs/website/lib/websiteaccount.lib.php +++ b/htdocs/website/lib/websiteaccount.lib.php @@ -79,5 +79,7 @@ function websiteaccountPrepareHead($object) //); // to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website'); + complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website', 'remove'); + return $head; }