#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);
}

View File

@@ -611,15 +611,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);
}

View File

@@ -1264,15 +1264,9 @@
// Compute the priority of the ticket
$this->Set('priority', $this->ComputePriority());
$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('I-%06d', $iKey);
$this->Set('ref', $sName);
}

View File

@@ -503,15 +503,9 @@
// Compute the priority of the ticket
$this->Set('priority', $this->ComputePriority());
$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('P-%06d', $iKey);
$this->Set('ref', $sName);
}

View File

@@ -1670,15 +1670,10 @@
// Compute the priority of the ticket
$this->Set('priority', $this->ComputePriority());
$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));
}
// Object not yet in the Database
$iKey = MetaModel::GetNextKey(get_class($this));
$sName = sprintf('R-%06d', $iKey);
$this->Set('ref', $sName);
}

View File

@@ -1657,15 +1657,9 @@
// Compute the priority of the ticket
$this->Set('priority', $this->ComputePriority());
$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('R-%06d', $iKey);
$this->Set('ref', $sName);
}