From e2cbf903ba110737e01be8a20401787af3623c3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Mar 2018 10:33:23 +0100 Subject: [PATCH] Remove deprecated code --- ChangeLog | 3 +- htdocs/accountancy/admin/accountmodel.php | 8 +----- htdocs/accountancy/admin/journals_list.php | 8 +----- .../actions_adherentcard_common.class.php | 28 ------------------- htdocs/categories/class/categorie.class.php | 12 -------- .../actions_contactcard_common.class.php | 28 ------------------- .../canvas/actions_card_common.class.php | 28 ------------------- 7 files changed, 4 insertions(+), 111 deletions(-) diff --git a/ChangeLog b/ChangeLog index 752704f4e26..3e53c845d04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,8 @@ Following changes may create regressions for some external modules, but were nec * Remove triggers *_CLONE. The trigger CREATE with context 'createfromclone' is already called so this is a duplicated feature. Cloning is not a business event, the business event is CREATE, so no trigger required. * PHP 5.3 is no more supported. Minimum PHP is now 5.4+ -* Remove the old deprecated code of doActions in canvas. The doActions of hooks are already available and are better. +* Remove the old deprecated code of doActions and getInstanceDao in canvas. The doActions of standard hooks are + already available and are better. diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index f3924f73a76..9728a9524ea 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -1013,13 +1013,7 @@ if ($id) // Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); - else print $langs->trans("AlwaysActive"); - } + else print $langs->trans("AlwaysActive"); print ""; // Modify link diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 7612e7b261a..14f345a8973 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -657,13 +657,7 @@ if ($id) // Active print ''; if ($canbedisabled) print ''.$actl[$obj->active].''; - else - { - if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive"); - else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated"); - else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption"); - else print $langs->trans("AlwaysActive"); - } + else print $langs->trans("AlwaysActive"); print ""; // Modify link diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 366f6edc5ae..f49d1cecb99 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -47,34 +47,6 @@ abstract class ActionsAdherentCardCommon var $errors=array(); - /** - * Instantiation of DAO class. Init ->object - * - * @return int 0 - * @deprecated Using getInstanceDao should not be used. - */ - private function getInstanceDao() - { - dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); - - if (! is_object($this->object)) - { - $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); - if (file_exists($modelclassfile)) - { - // Include dataservice class (model) - $ret = require_once $modelclassfile; - if ($ret) - { - // Instantiate dataservice class (model) - $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); - $this->object = new $modelclassname($this->db); - } - } - } - return 0; - } - /** * Get object * diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index c0ac7f40483..bc36a5cbf94 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -653,18 +653,6 @@ class Categorie extends CommonObject if ($this->id == -1) return -2; - // For backward compatibility - if ($type == 'societe') - { - $type = 'customer'; - dol_syslog(get_class($this) . "::add_type(): type 'societe' is deprecated, please use 'customer' instead", LOG_WARNING); - } - elseif ($type == 'fournisseur') - { - $type = 'supplier'; - dol_syslog(get_class($this) . "::add_type(): type 'fournisseur' is deprecated, please use 'supplier' instead", LOG_WARNING); - } - $this->db->begin(); $sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type]; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 30684f9924b..ba96c865d1a 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -43,34 +43,6 @@ abstract class ActionsContactCardCommon var $errors=array(); - /** - * Instantiation of DAO class - * - * @return int 0 - * @deprecated Using getInstanceDao should not be used. - */ - private function getInstanceDao() - { - dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); - - if (! is_object($this->object)) - { - $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); - if (file_exists($modelclassfile)) - { - // Include dataservice class (model) - $ret = require_once $modelclassfile; - if ($ret) - { - // Instantiate dataservice class (model) - $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); - $this->object = new $modelclassname($this->db); - } - } - } - return 0; - } - /** * Get object * diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index b0874573164..37082f4140b 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -43,34 +43,6 @@ abstract class ActionsCardCommon var $errors=array(); - /** - * Instantiation of DAO class - * - * @return int 0 - * @deprecated Using getInstanceDao should not be used. - */ - private function getInstanceDao() - { - dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); - - if (! is_object($this->object)) - { - $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); - if (file_exists($modelclassfile)) - { - // Include dataservice class (model) - $ret = require_once $modelclassfile; - if ($ret) - { - // Instantiate dataservice class (model) - $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); - $this->object = new $modelclassname($this->db); - } - } - } - return 0; - } - /** * Get object from id or ref and save it into this->object *