Remove deprecated code
This commit is contained in:
parent
7462708911
commit
e2cbf903ba
@ -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
|
* 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.
|
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+
|
* 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.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1013,13 +1013,7 @@ if ($id)
|
|||||||
// Active
|
// Active
|
||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||||
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 "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
|
|||||||
@ -657,13 +657,7 @@ if ($id)
|
|||||||
// Active
|
// Active
|
||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||||
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 "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
|
|||||||
@ -47,34 +47,6 @@ abstract class ActionsAdherentCardCommon
|
|||||||
var $errors=array();
|
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
|
* Get object
|
||||||
*
|
*
|
||||||
|
|||||||
@ -653,18 +653,6 @@ class Categorie extends CommonObject
|
|||||||
|
|
||||||
if ($this->id == -1) return -2;
|
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();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type];
|
$sql = "INSERT INTO " . MAIN_DB_PREFIX . "categorie_" . $this->MAP_CAT_TABLE[$type];
|
||||||
|
|||||||
@ -43,34 +43,6 @@ abstract class ActionsContactCardCommon
|
|||||||
var $errors=array();
|
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
|
* Get object
|
||||||
*
|
*
|
||||||
|
|||||||
@ -43,34 +43,6 @@ abstract class ActionsCardCommon
|
|||||||
var $errors=array();
|
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
|
* Get object from id or ref and save it into this->object
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user