浏览代码

Fix inherit of CommonNumRef

Laurent Destailleur 2 年之前
父节点
当前提交
15ddb9a3a8
共有 33 个文件被更改,包括 94 次插入182 次删除
  1. 0 23
      htdocs/core/class/commonnumrefgenerator.class.php
  2. 3 2
      htdocs/core/modules/barcode/doc/phpbarcode.modules.php
  3. 3 4
      htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
  4. 3 2
      htdocs/core/modules/bom/mod_bom_standard.php
  5. 3 2
      htdocs/core/modules/cheque/mod_chequereceipt_mint.php
  6. 3 2
      htdocs/core/modules/commande/mod_commande_marbre.php
  7. 1 1
      htdocs/core/modules/contract/mod_contract_magre.php
  8. 3 2
      htdocs/core/modules/contract/mod_contract_serpis.php
  9. 3 2
      htdocs/core/modules/delivery/mod_delivery_jade.php
  10. 3 2
      htdocs/core/modules/expedition/mod_expedition_safor.php
  11. 3 2
      htdocs/core/modules/expensereport/mod_expensereport_jade.php
  12. 3 2
      htdocs/core/modules/facture/mod_facture_mars.php
  13. 1 1
      htdocs/core/modules/facture/mod_facture_mercure.php
  14. 3 2
      htdocs/core/modules/facture/mod_facture_terre.php
  15. 3 2
      htdocs/core/modules/fichinter/mod_pacific.php
  16. 3 2
      htdocs/core/modules/holiday/mod_holiday_madonna.php
  17. 3 2
      htdocs/core/modules/member/mod_member_advanced.php
  18. 3 2
      htdocs/core/modules/member/mod_member_simple.php
  19. 3 2
      htdocs/core/modules/mrp/mod_mo_standard.php
  20. 3 2
      htdocs/core/modules/payment/mod_payment_cicada.php
  21. 3 2
      htdocs/core/modules/product_batch/mod_lot_standard.php
  22. 3 2
      htdocs/core/modules/product_batch/mod_sn_standard.php
  23. 3 2
      htdocs/core/modules/project/mod_project_simple.php
  24. 3 2
      htdocs/core/modules/project/task/mod_task_simple.php
  25. 4 96
      htdocs/core/modules/project/task/modules_task.php
  26. 3 2
      htdocs/core/modules/propale/mod_propale_marbre.php
  27. 3 2
      htdocs/core/modules/reception/mod_reception_beryl.php
  28. 3 2
      htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php
  29. 3 2
      htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php
  30. 3 2
      htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php
  31. 3 2
      htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php
  32. 3 2
      htdocs/core/modules/takepos/mod_takepos_ref_simple.php
  33. 4 3
      htdocs/core/modules/ticket/mod_ticket_simple.php

+ 0 - 23
htdocs/core/class/commonnumrefgenerator.class.php

@@ -96,17 +96,6 @@ abstract class CommonNumRefGenerator
 		return $langs->trans("NoDescription");
 	}
 
-	/**
-	 *	Returns an example of numbering
-	 *
-	 *	@return     string      Example
-	 */
-	public function getExample()
-	{
-		global $langs;
-		return $langs->trans("NoExample");
-	}
-
 	/**
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
@@ -119,18 +108,6 @@ abstract class CommonNumRefGenerator
 		return true;
 	}
 
-	/**
-	 *	Returns next assigned value
-	 *
-	 *	@param	Object		$object		Object we need next value for
-	 *	@return	string      Valeur
-	 */
-	public function getNextValue($object)
-	{
-		global $langs;
-		return $langs->trans("NotAvailable");
-	}
-
 	/**
 	 *	Returns version of numbering module
 	 *

+ 3 - 2
htdocs/core/modules/barcode/doc/phpbarcode.modules.php

@@ -74,9 +74,10 @@ class modPhpbarcode extends ModeleBarCode
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *	@return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $langs;
 

+ 3 - 4
htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php

@@ -70,12 +70,11 @@ class modTcpdfbarcode extends ModeleBarCode
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *	@return		boolean		false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
-		global $langs;
-
 		return true;
 	}
 

+ 3 - 2
htdocs/core/modules/bom/mod_bom_standard.php

@@ -75,9 +75,10 @@ class mod_bom_standard extends ModeleNumRefBoms
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/cheque/mod_chequereceipt_mint.php

@@ -72,9 +72,10 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/commande/mod_commande_marbre.php

@@ -87,9 +87,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 1 - 1
htdocs/core/modules/contract/mod_contract_magre.php

@@ -123,7 +123,7 @@ class mod_contract_magre extends ModelNumRefContracts
 	 */
 	public function getNextValue($objsoc, $contract)
 	{
-		global $db, $conf;
+		global $db;
 
 		require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
 

+ 3 - 2
htdocs/core/modules/contract/mod_contract_serpis.php

@@ -85,9 +85,10 @@ class mod_contract_serpis extends ModelNumRefContracts
 	/**
 	 *	Test if existing numbers make problems with numbering
 	 *
-	 *	@return     boolean     false if conflit, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/delivery/mod_delivery_jade.php

@@ -85,9 +85,10 @@ class mod_delivery_jade extends ModeleNumRefDeliveryOrder
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $langs, $conf, $db;
 

+ 3 - 2
htdocs/core/modules/expedition/mod_expedition_safor.php

@@ -80,9 +80,10 @@ class mod_expedition_safor extends ModelNumRefExpedition
 	/**
 	 *	Test if existing numbers make problems with numbering
 	 *
-	 *	@return     boolean     false if conflit, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/expensereport/mod_expensereport_jade.php

@@ -81,9 +81,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/facture/mod_facture_mars.php

@@ -95,9 +95,10 @@ class mod_facture_mars extends ModeleNumRefFactures
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $langs, $conf, $db;
 

+ 1 - 1
htdocs/core/modules/facture/mod_facture_mercure.php

@@ -111,7 +111,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
 	 */
 	public function getExample()
 	{
-		global $conf, $langs, $mysoc;
+		global $mysoc;
 
 		$old_code_client = $mysoc->code_client;
 		$old_code_type = $mysoc->typent_code;

+ 3 - 2
htdocs/core/modules/facture/mod_facture_terre.php

@@ -111,9 +111,10 @@ class mod_facture_terre extends ModeleNumRefFactures
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $langs, $conf, $db;
 

+ 3 - 2
htdocs/core/modules/fichinter/mod_pacific.php

@@ -81,9 +81,10 @@ class mod_pacific extends ModeleNumRefFicheinter
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $langs, $conf, $db;
 

+ 3 - 2
htdocs/core/modules/holiday/mod_holiday_madonna.php

@@ -86,9 +86,10 @@ class mod_holiday_madonna extends ModelNumRefHolidays
 	/**
 	 *	Test if existing numbers make problems with numbering
 	 *
-	 *	@return     boolean     false if conflit, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/member/mod_member_advanced.php

@@ -86,9 +86,10 @@ class mod_member_advanced extends ModeleNumRefMembers
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *   @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/member/mod_member_simple.php

@@ -86,9 +86,10 @@ class mod_member_simple extends ModeleNumRefMembers
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *   @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/mrp/mod_mo_standard.php

@@ -75,9 +75,10 @@ class mod_mo_standard extends ModeleNumRefMos
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/payment/mod_payment_cicada.php

@@ -82,9 +82,10 @@ class mod_payment_cicada extends ModeleNumRefPayments
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *  @param  Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/product_batch/mod_lot_standard.php

@@ -76,9 +76,10 @@ class mod_lot_standard extends ModeleNumRefBatch
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/product_batch/mod_sn_standard.php

@@ -76,9 +76,10 @@ class mod_sn_standard extends ModeleNumRefBatch
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/project/mod_project_simple.php

@@ -84,9 +84,10 @@ class mod_project_simple extends ModeleNumRefProjects
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *   @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/project/task/mod_task_simple.php

@@ -84,9 +84,10 @@ class mod_task_simple extends ModeleNumRefTask
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 4 - 96
htdocs/core/modules/project/task/modules_task.php

@@ -24,7 +24,9 @@
  *      \brief      File that contain parent class for task models
  *                  and parent class for task numbering models
  */
+
 require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/commonnumrefgenerator.class.php';
 
 
 /**
@@ -32,12 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
  */
 abstract class ModelePDFTask extends CommonDocGenerator
 {
-	/**
-	 * @var string Error code (or message)
-	 */
-	public $error = '';
-
-
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
 	/**
 	 *  Return list of active generation modules
@@ -64,95 +60,7 @@ abstract class ModelePDFTask extends CommonDocGenerator
 /**
  *  Classe mere des modeles de numerotation des references de projets
  */
-abstract class ModeleNumRefTask
+abstract class ModeleNumRefTask extends CommonNumRefGenerator
 {
-	/**
-	 * @var string Version
-	 */
-	public $version = '';
-
-	/**
-	 * @var string Error code (or message)
-	 */
-	public $error = '';
-
-	/**
-	 *  Return if a module can be used or not
-	 *
-	 *  @return		boolean     true if module can be used
-	 */
-	public function isEnabled()
-	{
-		return true;
-	}
-
-	/**
-	 *  Returns the default description of the numbering pattern
-	 *
-	 *  @return     string      Descriptive text
-	 */
-	public function info()
-	{
-		global $langs;
-		$langs->load("projects");
-		return $langs->trans("NoDescription");
-	}
-
-	/**
-	 *  Return an example of numbering
-	 *
-	 *  @return     string      Example
-	 */
-	public function getExample()
-	{
-		global $langs;
-		$langs->load("projects");
-		return $langs->trans("NoExample");
-	}
-
-	/**
-	 *  Checks if the numbers already in the database do not
-	 *  cause conflicts that would prevent this numbering working.
-	 *
-	 *  @return     boolean     false if conflict, true if ok
-	 */
-	public function canBeActivated()
-	{
-		return true;
-	}
-
-	/**
-	 *  Renvoi prochaine valeur attribuee
-	 *
-	 *	@param	Societe		$objsoc		Object third party
-	 *	@param	Project		$project	Object project
-	 *	@return	string					Valeur
-	 */
-	public function getNextValue($objsoc, $project)
-	{
-		global $langs;
-		return $langs->trans("NotAvailable");
-	}
-
-	/**
-	 *  Renvoi version du module numerotation
-	 *
-	 *  @return     string      Valeur
-	 */
-	public function getVersion()
-	{
-		global $langs;
-		$langs->load("admin");
-
-		if ($this->version == 'development') {
-			return $langs->trans("VersionDevelopment");
-		}
-		if ($this->version == 'experimental') {
-			return $langs->trans("VersionExperimental");
-		}
-		if ($this->version == 'dolibarr') {
-			return DOL_VERSION;
-		}
-		return $langs->trans("NotAvailable");
-	}
+	// No overload code
 }

+ 3 - 2
htdocs/core/modules/propale/mod_propale_marbre.php

@@ -84,9 +84,10 @@ class mod_propale_marbre extends ModeleNumRefPropales
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/reception/mod_reception_beryl.php

@@ -60,9 +60,10 @@ class mod_reception_beryl extends ModelNumRefReception
 	/**
 	 *	Test if existing numbers make problems with numbering
 	 *
-	 *	@return     boolean     false if conflit, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_cactus.php

@@ -90,9 +90,10 @@ class mod_facture_fournisseur_cactus extends ModeleNumRefSuppliersInvoices
 	/**
 	 * 	Tests if the numbers already in the database do not cause conflicts that would prevent this numbering.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/supplier_order/mod_commande_fournisseur_muguet.php

@@ -96,9 +96,10 @@ class mod_commande_fournisseur_muguet extends ModeleNumRefSuppliersOrders
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php

@@ -82,9 +82,10 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php

@@ -84,9 +84,10 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *  @return     boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 3 - 2
htdocs/core/modules/takepos/mod_takepos_ref_simple.php

@@ -84,9 +84,10 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos
 	 *  Test if the numbers already in the database do not cause any conflicts that will prevent this
 	 *  of conflicts that will prevent this numbering from working.
 	 *
-	 * @return     boolean     false if KO (there is a conflict), true if OK
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if KO (there is a conflict), true if OK
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 

+ 4 - 3
htdocs/core/modules/ticket/mod_ticket_simple.php

@@ -80,9 +80,10 @@ class mod_ticket_simple extends ModeleNumRefTicket
 	 *  Checks if the numbers already in the database do not
 	 *  cause conflicts that would prevent this numbering working.
 	 *
-	 *   @return boolean     false if conflict, true if ok
+	 *	@param	Object		$object		Object we need next value for
+	 *  @return boolean     			false if conflict, true if ok
 	 */
-	public function canBeActivated()
+	public function canBeActivated($object)
 	{
 		global $conf, $langs, $db;
 
@@ -121,7 +122,7 @@ class mod_ticket_simple extends ModeleNumRefTicket
 	 */
 	public function getNextValue($objsoc, $ticket)
 	{
-		global $db, $conf;
+		global $db;
 
 		// First, we get the max value
 		$posindice = strlen($this->prefix) + 6;