From 4ee09c9d5b3ce31278420ebc54d3383177400f1f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 25 Dec 2018 07:58:32 +0100 Subject: [PATCH 1/8] FIX remove old unused and deprecated function --- htdocs/core/lib/functions.lib.php | 42 ------------------------------- 1 file changed, 42 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c8c5937aaad..2b252269a0b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -39,48 +39,6 @@ include_once DOL_DOCUMENT_ROOT .'/core/lib/json.lib.php'; -/** - * Function to return value of a static property when class - * name is dynamically defined (not hard coded). - * This is because $myclass::$myvar works from PHP 5.3.0+ only - * - * @param string $class Class name - * @param string $member Name of property - * @return mixed Return value of static property - * @deprecated Dolibarr now requires 5.3.0+, use $class::$property syntax - * @see https://php.net/manual/language.oop5.static.php - */ -function getStaticMember($class, $member) -{ - dol_syslog(__FUNCTION__ . " is deprecated", LOG_WARNING); - - // This part is deprecated. Uncomment if for php 5.2.*, and comment next isset class::member - /*if (version_compare(phpversion(), '5.3.0', '<')) - { - if (is_object($class)) $class = get_class($class); - $classObj = new ReflectionClass($class); - $result = null; - - $found=0; - foreach($classObj->getStaticProperties() as $prop => $value) - { - if ($prop == $member) - { - $result = $value; - $found++; - break; - } - } - - if ($found) return $result; - }*/ - - if (isset($class::$member)) return $class::$member; - dol_print_error('','Try to get a static member "'.$member.'" in class "'.$class.'" that does not exists or is not static.'); - return null; -} - - /** * Return a DoliDB instance (database handler). * From 8f4c452075aafc1d464ad4a1b7cc0d28abfa5fde Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 25 Dec 2018 08:34:26 +0100 Subject: [PATCH 2/8] FIX replace deprecated "print_fiche_titre" with "load_fiche_titre" Signed-off-by: Regis Houssin --- htdocs/admin/export.php | 2 +- htdocs/compta/charges/index.php | 2 +- htdocs/compta/sociales/payments.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- htdocs/holiday/month_report.php | 2 +- htdocs/margin/checkMargins.php | 2 +- htdocs/variants/combinations.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index c4ad077296a..cb97502c3f8 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -57,7 +57,7 @@ llxHeader('', $langs->trans($page_name)); // Subheader $linkback = '' . $langs->trans("BackToModuleList") . ''; -print_fiche_titre($langs->trans($page_name), $linkback); +print load_fiche_titre($langs->trans($page_name), $linkback); // Configuration header diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index f0188c5ed94..86e963e50df 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -463,7 +463,7 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) print "
"; - print_fiche_titre( $langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre( $langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, s.fk_bank, u.salary as current_salary,"; $sql.= " pct.code as payment_code,"; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 936c2c9c0f2..8dc443aee6b 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -405,7 +405,7 @@ if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) print "
"; - print_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); + print load_fiche_titre($langs->trans("SalariesPayments").($year?' ('.$langs->trans("Year").' '.$year.')':''), '', ''); $sql = "SELECT s.rowid, s.amount, s.label, s.datep as datep, s.datev as datev, s.datesp, s.dateep, s.salary, u.salary as current_salary"; $sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as s, ".MAIN_DB_PREFIX."user as u"; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 15ab669bd9a..3b56e40823e 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -47,7 +47,7 @@ print ''; - print_fiche_titre($langs->trans("AdvTgtTitle")); + print load_fiche_titre($langs->trans("AdvTgtTitle")); print '
' . "\n"; print '
' . "\n"; diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 152bf554ab8..f30d5e85d7d 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -54,7 +54,7 @@ $listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->tran llxHeader('', $langs->trans('CPTitreMenu')); -print_fiche_titre($langs->trans('MenuReportMonth')); +print load_fiche_titre($langs->trans('MenuReportMonth')); $html = new Form($db); $formother = new FormOther($db); diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 850b47cee17..1fbadfdaa20 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -143,7 +143,7 @@ $title = $langs->trans("Margins"); llxHeader('', $title); -// print_fiche_titre($text); +// print load_fiche_titre($text); $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 79076e8ac50..31731261360 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -408,7 +408,7 @@ if (! empty($id) || ! empty($ref)) } else { $title = $langs->trans('EditProductCombination'); } - print_fiche_titre($title); + print load_fiche_titre($title); if ($action == 'add') { $prodattr_all = $prodattr->fetchAll(); From 1a15698f96fe88d4f0033fdb57c63ab7651290a2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 25 Dec 2018 08:36:42 +0100 Subject: [PATCH 3/8] FIX replace deprecated "print_titre" with "load_fiche_titre" Signed-off-by: Regis Houssin --- htdocs/admin/ticket.php | 8 ++++---- htdocs/admin/ticket_extrafields.php | 4 ++-- htdocs/core/tpl/advtarget.tpl.php | 2 +- htdocs/product/stock/product.php | 2 +- htdocs/ticket/class/actions_ticket.class.php | 2 +- htdocs/ticket/tpl/linkedobjectblock.tpl.php | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 5cf72b302c9..86f6250cede 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -253,7 +253,7 @@ dol_fiche_end(); * Projects Numbering model */ -print_titre($langs->trans("TicketNumberingModules")); +print load_fiche_titre($langs->trans("TicketNumberingModules")); print ''; print ''; @@ -353,7 +353,7 @@ if (!$conf->use_javascript_ajax) { print ''; print ''; } -print_titre($langs->trans("TicketParamPublicInterface")); +print load_fiche_titre($langs->trans("TicketParamPublicInterface")); print '
'; @@ -422,7 +422,7 @@ print ''; print '

'; -print_titre($langs->trans("TicketParams")); +print load_fiche_titre($langs->trans("TicketParams")); print ''; // Activate email notifications @@ -515,7 +515,7 @@ if (!$conf->use_javascript_ajax) { } // Admin var of module -print_titre($langs->trans("TicketParamMail")); +print load_fiche_titre($langs->trans("TicketParamMail")); print '
'; diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 6fa70808ec8..f63af3d2a82 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -92,7 +92,7 @@ if ($action != 'create' && $action != 'edit') { if ($action == 'create') { print "
"; - print_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; } @@ -104,7 +104,7 @@ if ($action == 'create') { /* ************************************************************************** */ if ($action == 'edit' && !empty($attrname)) { print "
"; - print_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; } diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 3b56e40823e..af8c99c3fc7 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -520,7 +520,7 @@ print '