Clean code

This commit is contained in:
Laurent Destailleur 2023-08-06 13:39:32 +02:00
parent 38be78e87f
commit b43ca2a0ad
8 changed files with 27 additions and 39 deletions

View file

@ -42,7 +42,7 @@ class AccountingJournal extends CommonObject
public $fk_element = '';
/**
* @var int 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int Does object support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/
public $ismultientitymanaged = 0;

View file

@ -159,7 +159,7 @@ class ActionsDatapolicy extends CommonHookActions
}
/**
* Overloading the doActions function : replacing the parent's function with the one below
* Overloading the doMassActions function : replacing the parent's function with the one below
*
* @param array $parameters Hook metadatas (context, etc...)
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)

View file

@ -49,7 +49,7 @@ class MyObject extends CommonObject
public $table_element = 'mymodule_myobject';
/**
* @var int Does this object support multicompany module ?
* @var int Does this object support multicompany module ?
* 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
*/
public $ismultientitymanaged = 0;

View file

@ -83,10 +83,7 @@ if (is_numeric($entity)) {
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
// Security check
if (!isModEnabled('agenda')) {
httponly_accessforbidden('Module Agenda not enabled');
}
$object = new ActionComm($db);
// Not older than
if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
@ -142,6 +139,17 @@ if (GETPOST("module", 'alpha')) {
if (GETPOST("status", 'int')) {
$filters['status'] = GETPOST("status", 'int');
}
// Security check
if (!isModEnabled('agenda')) {
httponly_accessforbidden('Module Agenda not enabled');
}
/*
* View
*/
// Check config
if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
$user->getrights();

View file

@ -143,8 +143,6 @@ if ($action == "view" || $action == "presend" || $action == "dosubmit") {
}
}
}
//var_dump($action);
//$object->doActions($action);
// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
$triggersendname = 'CANDIDATURE_SENTBYMAIL';

View file

@ -199,8 +199,6 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
}
}
}
//var_dump($action);
//$object->doActions($action);
// Actions to send emails (for ticket, we need to manage the addfile and removefile only)
$triggersendname = 'TICKET_SENTBYMAIL';

View file

@ -74,24 +74,6 @@ class ActionsCardIndividual extends ActionsCardCommon
return $out;
}
/**
* Execute actions
* @deprecated Use the doActions of hooks instead of this.
*
* @param string $action Action
* @param int $id Id of object (may be empty for creation)
* @return int <0 if KO, >0 if OK
*/
public function doActions(&$action, $id)
{
$ret = $this->getObject($id);
$return = parent::doActions($action);
return $return;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Assign custom values for canvas (for example into this->tpl to be used by templates)

View file

@ -47,7 +47,8 @@ class Website extends CommonObject
public $table_element = 'website';
/**
* @var array Does website support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
* @var int Does this object support multicompany module ?
* 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table
*/
public $ismultientitymanaged = 1;
@ -91,18 +92,21 @@ class Website extends CommonObject
public $status;
/**
* @var integer|string date_creation
* @var integer date_creation
*/
public $date_creation;
/**
* @var integer|string date_modification
* @var integer date_modification
*/
public $date_modification;
/**
* @var integer date_modification
*/
public $tms;
/**
* @var integer
* @var integer Default home page
*/
public $fk_default_home;
@ -117,24 +121,22 @@ class Website extends CommonObject
public $fk_user_modif;
/**
* @var string
* @var string Virtual host
*/
public $virtualhost;
/**
* @var int
* @var int Use a manifest file
*/
public $use_manifest;
/**
* @var int
* @var int Postion
*/
public $position;
/**
* List of containers
*
* @var array
* @var array List of containers
*/
public $lines;