Browse Source

Clean code

Laurent Destailleur 1 year ago
parent
commit
b43ca2a0ad

+ 1 - 1
htdocs/accountancy/class/accountingjournal.class.php

@@ -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;
 

+ 1 - 1
htdocs/datapolicy/class/actions_datapolicy.class.php

@@ -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...)

+ 1 - 1
htdocs/modulebuilder/template/class/myobject.class.php

@@ -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;

+ 12 - 4
htdocs/public/agenda/agendaexport.php

@@ -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();

+ 0 - 2
htdocs/public/recruitment/view.php

@@ -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';

+ 0 - 2
htdocs/public/ticket/view.php

@@ -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';

+ 0 - 18
htdocs/societe/canvas/individual/actions_card_individual.class.php

@@ -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)

+ 12 - 10
htdocs/website/class/website.class.php

@@ -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;