mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-18 16:18:47 +02:00
#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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user