mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Only set Ticket ref if not yet present via import or synchro (#82)
New non blocking uniqueness rule on Ticket.ref to warn when having ref duplicates
This commit is contained in:
committed by
Pierre Goiffon
parent
ecd8f40c0f
commit
daa906a697
@@ -53,6 +53,14 @@
|
||||
</attributes>
|
||||
</index>
|
||||
</indexes>
|
||||
<uniqueness_rules>
|
||||
<rule if="ref">
|
||||
<attributes>
|
||||
<attribute id="ref"/>
|
||||
</attributes>
|
||||
<is_blocking>false</is_blocking>
|
||||
</rule>
|
||||
</uniqueness_rules>
|
||||
</properties>
|
||||
<fields>
|
||||
<field id="operational_status" xsi:type="AttributeMetaEnum">
|
||||
@@ -209,7 +217,7 @@
|
||||
$oMutex->Lock();
|
||||
$iNextId = MetaModel::GetNextKey(get_class($this));
|
||||
$sRef = $this->MakeTicketRef($iNextId);
|
||||
$this->Set('ref', $sRef);
|
||||
$this->SetIfNull('ref', $sRef);
|
||||
$iKey = parent::DBInsertNoReload();
|
||||
$oMutex->Unlock();
|
||||
return $iKey;
|
||||
|
||||
Reference in New Issue
Block a user