Fix: bug #29526 : Numérotation Proposition Incorrecte après duplication

This commit is contained in:
Laurent Destailleur 2010-04-13 19:34:40 +00:00
parent 4846b9b98b
commit 916e3de6a7
4 changed files with 15 additions and 9 deletions

View File

@ -41,6 +41,7 @@ For users:
- Fix: Can use $ in database and login/pass values. - Fix: Can use $ in database and login/pass values.
- Fix: No error on upgrade if there is orphelins tasks. - Fix: No error on upgrade if there is orphelins tasks.
- Fix: Failed to login when user agent string was longer than 128. - Fix: Failed to login when user agent string was longer than 128.
- Fix: bug #29526 : Numérotation Proposition Incorrecte après duplication
***** ChangeLog for 2.8 compared to 2.7 ***** ***** ChangeLog for 2.8 compared to 2.7 *****

1
documents/.cvsignore Normal file
View File

@ -0,0 +1 @@
.htaccess

View File

@ -733,6 +733,10 @@ class Propal extends CommonObject
$object->id=0; $object->id=0;
$object->statut=0; $object->statut=0;
require_once(DOL_DOCUMENT_ROOT ."/societe/societe.class.php");
$objsoc=new Societe($this->db);
$objsoc->fetch($object->socid);
if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php")) if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{ {
$this->error='ErrorSetupNotComplete'; $this->error='ErrorSetupNotComplete';
@ -742,7 +746,7 @@ class Propal extends CommonObject
require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"); require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php");
$obj = $conf->global->PROPALE_ADDON; $obj = $conf->global->PROPALE_ADDON;
$modPropale = new $obj; $modPropale = new $obj;
$numpr = $modPropale->getNextValue($soc,$object); $numpr = $modPropale->getNextValue($objsoc,$object);
// Clear fields // Clear fields
$object->ref = $numpr; $object->ref = $numpr;

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* *
@ -23,7 +23,7 @@
/** /**
\file htdocs/includes/modules/propale/mod_propale_saphir.php \file htdocs/includes/modules/propale/mod_propale_saphir.php
\ingroup propale \ingroup propale
\brief Fichier contenant la classe du modèle de numérotation de référence de propale Saphir \brief File that contains the numbering module rules Saphir
\version $Id$ \version $Id$
*/ */
@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php")
/** /**
\class mod_propale_saphir \class mod_propale_saphir
\brief Classe du modèle de numérotation de référence de propale Saphir \brief Class of file that contains the numbering module rules Saphir
*/ */
class mod_propale_saphir extends ModeleNumRefPropales class mod_propale_saphir extends ModeleNumRefPropales
{ {
@ -41,7 +41,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
var $nom = 'Saphir'; var $nom = 'Saphir';
/** \brief Renvoi la description du modele de numérotation /** \brief Return description of module
* \return string Texte descripif * \return string Texte descripif
*/ */
function info() function info()
@ -79,7 +79,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
return $texte; return $texte;
} }
/** \brief Renvoi un exemple de numérotation /** \brief Renvoi un exemple de numerotation
* \return string Example * \return string Example
*/ */
function getExample() function getExample()
@ -109,7 +109,7 @@ class mod_propale_saphir extends ModeleNumRefPropales
require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php");
// On défini critere recherche compteur // On d<EFBFBD>fini critere recherche compteur
$mask=$conf->global->PROPALE_SAPHIR_MASK; $mask=$conf->global->PROPALE_SAPHIR_MASK;
if (! $mask) if (! $mask)