Fix scrutinizer bugs

This commit is contained in:
Laurent Destailleur 2018-03-16 00:16:32 +01:00
parent 6f95a7c2b1
commit 5a397fff72
4 changed files with 5 additions and 4 deletions

View File

@ -505,7 +505,7 @@ class Account extends CommonObject
* @param int $notrigger 1=Disable triggers * @param int $notrigger 1=Disable triggers
* @return int < 0 if KO, > 0 if OK * @return int < 0 if KO, > 0 if OK
*/ */
function create(User $user = null, $notrigger=0) function create(User $user, $notrigger=0)
{ {
global $langs,$conf, $hookmanager; global $langs,$conf, $hookmanager;

View File

@ -263,7 +263,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
public $always_enabled; public $always_enabled;
/** /**
* @var bool Module is enabled globally (Multicompany support) * @var int Module is enabled globally (Multicompany support)
*/ */
public $core_enabled; public $core_enabled;

View File

@ -52,7 +52,7 @@ class modSyslog extends DolibarrModules
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module) // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Activate debug logs (syslog)"; $this->description = "Activate debug logs (syslog)";
// Can be enabled / disabled only in the main company // Can be enabled / disabled only in the main company
$this->core_enabled = true; $this->core_enabled = 1;
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr'; $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase) // Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)

View File

@ -624,8 +624,9 @@ if (empty($reshook))
$card=$cu->sources->retrieve("$source"); $card=$cu->sources->retrieve("$source");
if ($card) if ($card)
{ {
$card->delete();
// $card->detach(); Does not work with card_, only with src_ // $card->detach(); Does not work with card_, only with src_
if (method_exists($card, 'detach')) $card->detach();
else $card->delete();
} }
$url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id; $url=DOL_URL_ROOT.'/societe/paymentmodes.php?socid='.$object->id;