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