♻️ Make ticket reference generation working with new sub-classes (#78)

This commit is contained in:
Molkobain
2019-05-17 11:21:24 +02:00
committed by OИUЯd da silva
parent d9bf3339d2
commit af332a34d6
7 changed files with 78 additions and 25 deletions

View File

@@ -902,6 +902,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'C-%06d';
}
]]></code>
</method>
<method id="SetClosureDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -452,6 +452,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'C-%06d';
}
]]></code>
</method>
<method id="SetApprovalDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -947,6 +947,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'I-%06d';
}
]]></code>
</method>
<method id="SetAssignedDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -362,6 +362,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'P-%06d';
}
]]></code>
</method>
<method id="SetAssignedDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -1074,6 +1074,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'R-%06d';
}
]]></code>
</method>
<method id="SetAssignedDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -1086,6 +1086,17 @@
</states>
</lifecycle>
<methods>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'R-%06d';
}
]]></code>
</method>
<method id="SetAssignedDate">
<comment><![CDATA[/**
* To be deprecated: use SetCurrentDate() instead

View File

@@ -223,31 +223,18 @@
<code><![CDATA[
protected function MakeTicketRef($iNextId)
{
switch(get_class($this))
{
case 'UserRequest':
$sFormat = 'R-%06d';
break;
case 'Incident':
$sFormat = 'I-%06d';
break;
case 'Change':
case 'RoutineChange':
case 'EmergencyChange':
case 'NormalChange':
$sFormat = 'C-%06d';
break;
case 'Problem':
$sFormat = 'P-%06d';
break;
default:
$sFormat = 'T-%06d';
}
return sprintf($sFormat, $iNextId);
return sprintf(static::GetTicketRefFormat(), $iNextId);
}
]]></code>
</method>
<method id="GetTicketRefFormat">
<static>true</static>
<access>public</access>
<type>Overload-DBObject</type>
<code><![CDATA[
public static function GetTicketRefFormat()
{
return 'T-%06d';
}
]]></code>
</method>