#805 The label of the ticket must be computed at the last minute, just before insertion, for the Mutex to be effective

SVN:trunk[2956]
This commit is contained in:
Denis Flaven
2013-10-24 12:05:16 +00:00
parent f684cb1745
commit 864ce74cbc
6 changed files with 13 additions and 48 deletions

View File

@@ -936,15 +936,9 @@
<type>Overload-DBObject</type>
<code><![CDATA[ public function ComputeValues()
{
$sCurrRef = $this->Get('ref');
if (strlen($sCurrRef) == 0)
if ($this->IsNew())
{
$iKey = $this->GetKey();
if ($iKey < 0)
{
// Object not yet in the Database
$iKey = MetaModel::GetNextKey(get_class($this));
}
$iKey = MetaModel::GetNextKey(get_class($this));
$sName = sprintf('C-%06d', $iKey);
$this->Set('ref', $sName);
}