mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
#1022 Do cascade the resolution of an incident to its child requests + rework of the lifecycle/actions to ease the extensibility (New handlers: Rest, Copy, SetCurrentDate, SetCurrentUser, SetElapsedTime)
SVN:trunk[3423]
This commit is contained in:
@@ -130,7 +130,7 @@ class appUserPreferences extends DBObject
|
|||||||
/**
|
/**
|
||||||
* Call this function if the user has changed (like when doing a logoff...)
|
* Call this function if the user has changed (like when doing a logoff...)
|
||||||
*/
|
*/
|
||||||
static public function Reset()
|
static public function ResetPreferences()
|
||||||
{
|
{
|
||||||
self::$oUserPrefs = null;
|
self::$oUserPrefs = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ abstract class DBObject implements iDisplay
|
|||||||
if ($sAttCode == 'finalclass')
|
if ($sAttCode == 'finalclass')
|
||||||
{
|
{
|
||||||
// Ignore it - this attribute is set upon object creation and that's it
|
// Ignore it - this attribute is set upon object creation and that's it
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||||
@@ -416,6 +416,9 @@ abstract class DBObject implements iDisplay
|
|||||||
|
|
||||||
// Make sure we do not reload it anymore... before saving it
|
// Make sure we do not reload it anymore... before saving it
|
||||||
$this->RegisterAsDirty();
|
$this->RegisterAsDirty();
|
||||||
|
|
||||||
|
// This function is eligible as a lifecycle action: returning true upon success is a must
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetLabel($sAttCode)
|
public function GetLabel($sAttCode)
|
||||||
@@ -2075,7 +2078,7 @@ abstract class DBObject implements iDisplay
|
|||||||
{
|
{
|
||||||
if (is_string($actionHandler))
|
if (is_string($actionHandler))
|
||||||
{
|
{
|
||||||
// Old (pre-2.0.4) action definition without any parameter
|
// Old (pre-2.1.0) action definition without any parameter
|
||||||
$aActionCallSpec = array($this, $sActionHandler);
|
$aActionCallSpec = array($this, $sActionHandler);
|
||||||
|
|
||||||
if (!is_callable($aActionCallSpec))
|
if (!is_callable($aActionCallSpec))
|
||||||
@@ -2183,6 +2186,70 @@ abstract class DBObject implements iDisplay
|
|||||||
$this->Set($sAttCode, $oSW);
|
$this->Set($sAttCode, $oSW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle action: Recover the default value (aka when an object is being created)
|
||||||
|
*/
|
||||||
|
public function Reset($sAttCode)
|
||||||
|
{
|
||||||
|
$oAttDef = MetaModel::GetAttributeDef(get_class($this), $sAttCode);
|
||||||
|
$this->Set($sAttCode, $oAttDef->GetDefaultValue());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle action: Copy an attribute to another
|
||||||
|
*/
|
||||||
|
public function Copy($sDestAttCode, $sSourceAttCode)
|
||||||
|
{
|
||||||
|
$this->Set($sDestAttCode, $this->Get($sSourceAttCode));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle action: Set the current date/time for the given attribute
|
||||||
|
*/
|
||||||
|
public function SetCurrentDate($sAttCode)
|
||||||
|
{
|
||||||
|
$this->Set($sAttCode, time());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle action: Set the current logged in user for the given attribute
|
||||||
|
*/
|
||||||
|
public function SetCurrentUser($sAttCode)
|
||||||
|
{
|
||||||
|
$this->Set($sAttCode, UserRights::GetUserId());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lifecycle action: Set the time elapsed since a reference point
|
||||||
|
*/
|
||||||
|
public function SetElapsedTime($sAttCode, $sRefAttCode, $sWorkingTimeComputer = null)
|
||||||
|
{
|
||||||
|
if (is_null($sWorkingTimeComputer))
|
||||||
|
{
|
||||||
|
$sWorkingTimeComputer = class_exists('SLAComputation') ? 'SLAComputation' : 'DefaultWorkingTimeComputer';
|
||||||
|
}
|
||||||
|
$oComputer = new $sWorkingTimeComputer();
|
||||||
|
$aCallSpec = array($oComputer, 'GetOpenDuration');
|
||||||
|
if (!is_callable($aCallSpec))
|
||||||
|
{
|
||||||
|
throw new CoreException("Unknown class/verb '$sWorkingTimeComputer/GetOpenDuration'");
|
||||||
|
}
|
||||||
|
|
||||||
|
$iStartTime = AttributeDateTime::GetAsUnixSeconds($this->Get($sRefAttCode));
|
||||||
|
$oStartDate = new DateTime('@'.$iStartTime); // setTimestamp not available in PHP 5.2
|
||||||
|
$oEndDate = new DateTime(); // now
|
||||||
|
$iElapsed = call_user_func($aCallSpec, $this, $oStartDate, $oEndDate);
|
||||||
|
|
||||||
|
$this->Set($sAttCode, $iElapsed);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create query parameters (SELECT ... WHERE service = :this->service_id)
|
* Create query parameters (SELECT ... WHERE service = :this->service_id)
|
||||||
* to be used with the APIs DBObjectSearch/DBObjectSet
|
* to be used with the APIs DBObjectSearch/DBObjectSet
|
||||||
|
|||||||
@@ -478,7 +478,7 @@ class CheckStopWatchThresholds implements iBackgroundProcess
|
|||||||
{
|
{
|
||||||
if (is_string($def))
|
if (is_string($def))
|
||||||
{
|
{
|
||||||
// Old method (pre-2.0.4) non typed parameters
|
// Old method (pre-2.1.0) non typed parameters
|
||||||
$aValues[] = $def;
|
$aValues[] = $def;
|
||||||
}
|
}
|
||||||
else // if(is_array($def))
|
else // if(is_array($def))
|
||||||
|
|||||||
@@ -902,6 +902,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>StimulusUserAction</type>
|
<type>StimulusUserAction</type>
|
||||||
@@ -912,6 +916,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="ResetRejectReason">
|
<method id="ResetRejectReason">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -1679,7 +1687,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -1713,7 +1724,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -3099,7 +3113,10 @@
|
|||||||
<target>validated</target>
|
<target>validated</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>ResetRejectReason</verb>
|
<verb>Reset</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">reason</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -3236,7 +3253,10 @@
|
|||||||
<target>approved</target>
|
<target>approved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>ResetRejectReason</verb>
|
<verb>Reset</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">reason</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -3336,7 +3356,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -3369,7 +3392,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -3985,7 +4011,10 @@
|
|||||||
<target>approved</target>
|
<target>approved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>ResetRejectReason</verb>
|
<verb>Reset</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">reason</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -4085,7 +4114,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -4119,7 +4151,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
|
|||||||
@@ -280,10 +280,16 @@
|
|||||||
<target>approved</target>
|
<target>approved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetApprovalDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">approval_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>ResetRejectReason</verb>
|
<verb>Reset</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">reject_reason</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -408,7 +414,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -445,6 +454,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetApprovalDate">
|
<method id="SetApprovalDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -455,6 +468,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="ResetRejectReason">
|
<method id="ResetRejectReason">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -465,6 +482,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
|
|||||||
@@ -485,7 +485,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -497,10 +500,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -560,7 +575,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -568,10 +586,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -587,10 +617,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -607,7 +649,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -615,10 +660,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -630,10 +687,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -669,10 +738,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -766,7 +847,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -779,10 +863,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -838,6 +934,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetAssignedDate">
|
<method id="SetAssignedDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -848,6 +948,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetLastPendingDate">
|
<method id="SetLastPendingDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -858,6 +962,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetResolveDate">
|
<method id="SetResolveDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() and SetElapsedTime() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -870,6 +978,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -973,20 +1085,17 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="resolveChilds">
|
<method id="resolveChilds">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use ResolveChildTickets() instead
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
<code><![CDATA[ public function resolveChilds($sStimulusCode)
|
<code><![CDATA[ public function resolveChilds($sStimulusCode)
|
||||||
{
|
{
|
||||||
|
|
||||||
$oMyChange = MetaModel::NewObject("CMDBChange");
|
|
||||||
$oMyChange->Set("date", time());
|
|
||||||
$sUserString = CMDBChange::GetCurrentUserName();
|
|
||||||
$oMyChange->Set("userinfo", $sUserString."(automatic resolution)");
|
|
||||||
$iChangeId = $oMyChange->DBInsert();
|
|
||||||
if (MetaModel::IsValidClass('UserRequest'))
|
if (MetaModel::IsValidClass('UserRequest'))
|
||||||
{
|
{
|
||||||
$sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
|
$sOQL = "SELECT UserRequest WHERE parent_incident_id=:ticket";
|
||||||
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
|
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
|
||||||
array(),
|
array(),
|
||||||
array(
|
array(
|
||||||
@@ -1005,7 +1114,7 @@
|
|||||||
$oRequest->set('resolution_code',$this->Get('resolution_code'));
|
$oRequest->set('resolution_code',$this->Get('resolution_code'));
|
||||||
$oRequest->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
$oRequest->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
||||||
$oRequest->ApplyStimulus('ev_autoresolve');
|
$oRequest->ApplyStimulus('ev_autoresolve');
|
||||||
$oRequest->DBUpdateTracked($oMyChange);
|
$oRequest->DBUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1029,13 +1138,70 @@
|
|||||||
$oIncident->set('resolution_code',$this->Get('resolution_code'));
|
$oIncident->set('resolution_code',$this->Get('resolution_code'));
|
||||||
$oIncident->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
$oIncident->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
||||||
$oIncident->ApplyStimulus('ev_autoresolve');
|
$oIncident->ApplyStimulus('ev_autoresolve');
|
||||||
$oIncident->DBUpdateTracked($oMyChange);
|
$oIncident->DBUpdate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
|
<method id="ResolveChildTickets">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Cascade the resolution to child User Request and Incidents
|
||||||
|
* @return true (returning false would stop the ongoing transition)
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>LifecycleAction</type>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
<code><![CDATA[ public function ResolveChildTickets()
|
||||||
|
{
|
||||||
|
if (MetaModel::IsValidClass('UserRequest'))
|
||||||
|
{
|
||||||
|
// Automatically resolve child requests
|
||||||
|
$sOQL = "SELECT UserRequest WHERE parent_incident_id = :ticket AND status != 'resolved'";
|
||||||
|
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('ticket' => $this->GetKey()));
|
||||||
|
while($oRequest = $oChildRequestSet->Fetch())
|
||||||
|
{
|
||||||
|
$oRequest->ResolveFrom($this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Automatically resolve child incidents
|
||||||
|
$sOQL = "SELECT Incident WHERE parent_incident_id = :ticket AND status != 'resolved'";
|
||||||
|
$oChildIncidentSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('ticket' => $this->GetKey()));
|
||||||
|
while($oIncident = $oChildIncidentSet->Fetch())
|
||||||
|
{
|
||||||
|
$oIncident->ResolveFrom($this);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
|
<method id="ResolveFrom">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Resolve the ticket from another resolved ticket
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>Internal</type>
|
||||||
|
<code><![CDATA[ public function ResolveFrom($oParentTicket)
|
||||||
|
{
|
||||||
|
if ($this->Get('status') != 'resolved')
|
||||||
|
{
|
||||||
|
$this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
|
||||||
|
$this->Set('service_id', $oParentTicket->Get('service_id'));
|
||||||
|
$this->Set('team_id', $oParentTicket->Get('team_id'));
|
||||||
|
$this->Set('agent_id', $oParentTicket->Get('agent_id'));
|
||||||
|
$this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
|
||||||
|
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
|
||||||
|
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
|
||||||
|
$this->ApplyStimulus('ev_autoresolve');
|
||||||
|
$this->DBUpdate();
|
||||||
|
}
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
<method id="UpdateChildRequestLog">
|
<method id="UpdateChildRequestLog">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
|
|||||||
@@ -259,7 +259,10 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -311,7 +314,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -345,6 +351,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetAssignedDate">
|
<method id="SetAssignedDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -355,6 +365,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetResolveDate">
|
<method id="SetResolveDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -365,6 +379,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
|
|||||||
@@ -509,7 +509,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -525,10 +528,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -547,7 +562,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -591,7 +609,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -599,10 +620,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -618,10 +651,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -638,7 +683,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -646,10 +694,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -661,10 +721,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -705,7 +777,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -713,10 +788,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -761,10 +848,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -857,7 +956,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -870,10 +972,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -929,6 +1043,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetAssignedDate">
|
<method id="SetAssignedDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -939,6 +1057,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetLastPendingDate">
|
<method id="SetLastPendingDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -949,6 +1071,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetResolveDate">
|
<method id="SetResolveDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() and SetElapsedTime() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -961,6 +1087,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -971,6 +1101,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetApprover">
|
<method id="SetApprover">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentUser() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -1075,6 +1209,9 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="resolveChilds">
|
<method id="resolveChilds">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use ResolveChildTickets() instead
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -1106,6 +1243,52 @@
|
|||||||
|
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
|
<method id="ResolveChildTickets">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Cascade the resolution to child User Request
|
||||||
|
* @return true (returning false would stop the ongoing transition)
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>LifecycleAction</type>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
<code><![CDATA[ public function ResolveChildTickets()
|
||||||
|
{
|
||||||
|
// Automatically resolve child requests
|
||||||
|
$sOQL = "SELECT UserRequest WHERE parent_request_id = :ticket AND status != 'resolved'";
|
||||||
|
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('ticket' => $this->GetKey()));
|
||||||
|
while($oRequest = $oChildRequestSet->Fetch())
|
||||||
|
{
|
||||||
|
$oRequest->ResolveFrom($this);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
|
<method id="ResolveFrom">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Resolve the ticket from another resolved ticket
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>Internal</type>
|
||||||
|
<code><![CDATA[ public function ResolveFrom($oParentTicket)
|
||||||
|
{
|
||||||
|
if ($this->Get('status') != 'resolved')
|
||||||
|
{
|
||||||
|
$this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
|
||||||
|
$this->Set('service_id', $oParentTicket->Get('service_id'));
|
||||||
|
$this->Set('team_id', $oParentTicket->Get('team_id'));
|
||||||
|
$this->Set('agent_id', $oParentTicket->Get('agent_id'));
|
||||||
|
$this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
|
||||||
|
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
|
||||||
|
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
|
||||||
|
$this->ApplyStimulus('ev_autoresolve');
|
||||||
|
$this->DBUpdate();
|
||||||
|
}
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
<method id="UpdateChildRequestLog">
|
<method id="UpdateChildRequestLog">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
|
|||||||
@@ -522,7 +522,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -538,10 +541,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -560,7 +575,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -607,7 +625,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -615,10 +636,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -634,10 +667,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -654,7 +699,10 @@
|
|||||||
<target>pending</target>
|
<target>pending</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetLastPendingDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">last_pending_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -662,10 +710,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -677,10 +737,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -721,7 +793,10 @@
|
|||||||
<target>assigned</target>
|
<target>assigned</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetAssignedDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">assignment_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -729,10 +804,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -777,10 +864,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -876,7 +975,10 @@
|
|||||||
<target>closed</target>
|
<target>closed</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetClosureDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">close_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -889,10 +991,22 @@
|
|||||||
<target>resolved</target>
|
<target>resolved</target>
|
||||||
<actions>
|
<actions>
|
||||||
<action>
|
<action>
|
||||||
<verb>SetResolveDate</verb>
|
<verb>SetCurrentDate</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">resolution_date</param>
|
||||||
|
</params>
|
||||||
</action>
|
</action>
|
||||||
<action>
|
<action>
|
||||||
<verb>resolveChilds</verb>
|
<verb>SetElapsedTime</verb>
|
||||||
|
<params>
|
||||||
|
<param xsi:type="string">time_spent</param>
|
||||||
|
<param xsi:type="string">start_date</param>
|
||||||
|
<param xsi:type="string">DefaultWorkingTimeComputer</param>
|
||||||
|
</params>
|
||||||
|
</action>
|
||||||
|
<action>
|
||||||
|
<verb>ResolveChildTickets</verb>
|
||||||
|
<params/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
</transition>
|
</transition>
|
||||||
@@ -948,6 +1062,10 @@
|
|||||||
</lifecycle>
|
</lifecycle>
|
||||||
<methods>
|
<methods>
|
||||||
<method id="SetAssignedDate">
|
<method id="SetAssignedDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -958,6 +1076,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetLastPendingDate">
|
<method id="SetLastPendingDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -968,6 +1090,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetResolveDate">
|
<method id="SetResolveDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() and SetElapsedTime() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -980,6 +1106,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetClosureDate">
|
<method id="SetClosureDate">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentDate() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -990,6 +1120,10 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="SetApprover">
|
<method id="SetApprover">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use SetCurrentUser() instead
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -1093,6 +1227,9 @@
|
|||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
<method id="resolveChilds">
|
<method id="resolveChilds">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* To be deprecated: use ResolveChildTickets() instead
|
||||||
|
*/]]></comment>
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
@@ -1124,6 +1261,52 @@
|
|||||||
|
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
|
<method id="ResolveChildTickets">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Cascade the resolution to child User Request
|
||||||
|
* @return true (returning false would stop the ongoing transition)
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>LifecycleAction</type>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
<code><![CDATA[ public function ResolveChildTickets()
|
||||||
|
{
|
||||||
|
// Automatically resolve child requests
|
||||||
|
$sOQL = "SELECT UserRequest WHERE parent_request_id = :ticket AND status != 'resolved'";
|
||||||
|
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL), array(), array('ticket' => $this->GetKey()));
|
||||||
|
while($oRequest = $oChildRequestSet->Fetch())
|
||||||
|
{
|
||||||
|
$oRequest->ResolveFrom($this);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
|
<method id="ResolveFrom">
|
||||||
|
<comment><![CDATA[/**
|
||||||
|
* Resolve the ticket from another resolved ticket
|
||||||
|
* @return void
|
||||||
|
*/]]></comment>
|
||||||
|
<static>false</static>
|
||||||
|
<access>public</access>
|
||||||
|
<type>Internal</type>
|
||||||
|
<code><![CDATA[ public function ResolveFrom($oParentTicket)
|
||||||
|
{
|
||||||
|
if ($this->Get('status') != 'resolved')
|
||||||
|
{
|
||||||
|
$this->Set('servicesubcategory_id', $oParentTicket->Get('servicesubcategory_id'));
|
||||||
|
$this->Set('service_id', $oParentTicket->Get('service_id'));
|
||||||
|
$this->Set('team_id', $oParentTicket->Get('team_id'));
|
||||||
|
$this->Set('agent_id', $oParentTicket->Get('agent_id'));
|
||||||
|
$this->Set('resolution_code', $oParentTicket->Get('resolution_code'));
|
||||||
|
$sParent = '[['.get_class($oParentTicket).':'.$oParentTicket->Get('ref').']]';
|
||||||
|
$this->Set('solution', Dict::Format('Tickets:ResolvedFrom', $sParent, MetaModel::GetName(get_class($oParentTicket))));
|
||||||
|
$this->ApplyStimulus('ev_autoresolve');
|
||||||
|
$this->DBUpdate();
|
||||||
|
}
|
||||||
|
}]]></code>
|
||||||
|
</method>
|
||||||
<method id="UpdateChildRequestLog">
|
<method id="UpdateChildRequestLog">
|
||||||
<static>false</static>
|
<static>false</static>
|
||||||
<access>public</access>
|
<access>public</access>
|
||||||
|
|||||||
@@ -213,7 +213,7 @@
|
|||||||
}
|
}
|
||||||
]]></code>
|
]]></code>
|
||||||
</method>
|
</method>
|
||||||
</methods>
|
</methods>
|
||||||
<presentation>
|
<presentation>
|
||||||
<details>
|
<details>
|
||||||
<items>
|
<items>
|
||||||
@@ -772,6 +772,40 @@
|
|||||||
</argument>
|
</argument>
|
||||||
</arguments>
|
</arguments>
|
||||||
</method>
|
</method>
|
||||||
|
<method id="SetCurrentUser">
|
||||||
|
<arguments>
|
||||||
|
<argument>
|
||||||
|
<label>Field Code</label>
|
||||||
|
<type>attcode</type>
|
||||||
|
<mandatory>true</mandatory>
|
||||||
|
<description>The field, in the current object, to set to
|
||||||
|
the current logged in user</description>
|
||||||
|
</argument>
|
||||||
|
</arguments>
|
||||||
|
</method>
|
||||||
|
<method id="SetElapsedTime">
|
||||||
|
<arguments>
|
||||||
|
<argument>
|
||||||
|
<label>Field Code</label>
|
||||||
|
<type>attcode</type>
|
||||||
|
<mandatory>true</mandatory>
|
||||||
|
<description>The field, in the current object, to set to
|
||||||
|
the time elapsed since the date given by the reference field</description>
|
||||||
|
</argument>
|
||||||
|
<argument>
|
||||||
|
<label>Reference Field Code</label>
|
||||||
|
<type>attcode</type>
|
||||||
|
<mandatory>true</mandatory>
|
||||||
|
<description>The reference date or date/time</description>
|
||||||
|
</argument>
|
||||||
|
<argument>
|
||||||
|
<label>Working hours</label>
|
||||||
|
<type>attcode</type>
|
||||||
|
<mandatory>false</mandatory>
|
||||||
|
<description>Leave empty to rely on the standard working hours scheme, or set to "DefaultWorkingTimeComputer" to force a 24x7 scheme</description>
|
||||||
|
</argument>
|
||||||
|
</arguments>
|
||||||
|
</method>
|
||||||
<method id="Reset">
|
<method id="Reset">
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>
|
<argument>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// Copyright (C) 2010-2012 Combodo SARL
|
// Copyright (C) 2010-2014 Combodo SARL
|
||||||
//
|
//
|
||||||
// This file is part of iTop.
|
// This file is part of iTop.
|
||||||
//
|
//
|
||||||
@@ -179,13 +179,5 @@ Dict::Add('EN US', 'English', 'English', array(
|
|||||||
'Ticket:SLA' => 'SLA report',
|
'Ticket:SLA' => 'SLA report',
|
||||||
'WorkOrder:Details' => 'Details',
|
'WorkOrder:Details' => 'Details',
|
||||||
'WorkOrder:Moreinfo' => 'More information',
|
'WorkOrder:Moreinfo' => 'More information',
|
||||||
|
'Tickets:ResolvedFrom' => 'Automatically resolved from %1$s'
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -164,6 +164,5 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
|||||||
'Ticket:SLA' => 'Rapport SLA',
|
'Ticket:SLA' => 'Rapport SLA',
|
||||||
'WorkOrder:Details' => 'Détails',
|
'WorkOrder:Details' => 'Détails',
|
||||||
'WorkOrder:Moreinfo' => 'Informations complémentaires',
|
'WorkOrder:Moreinfo' => 'Informations complémentaires',
|
||||||
|
'Tickets:ResolvedFrom' => 'Résolu via %1$s'
|
||||||
));
|
));
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1247,12 +1247,12 @@ EOF;
|
|||||||
{
|
{
|
||||||
$sParamType = 'string';
|
$sParamType = 'string';
|
||||||
}
|
}
|
||||||
$aActionParams[] = "array('type' => '$sType', 'value' => ".self::QuoteForPHP($oParam->textContent).")";
|
$aActionParams[] = "array('type' => '$sParamType', 'value' => ".self::QuoteForPHP($oParam->textContent).")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Old (pre 2.0.4) format, when no parameter is specified, assume 1 parameter: reference sStimulusCode
|
// Old (pre 2.1.0) format, when no parameter is specified, assume 1 parameter: reference sStimulusCode
|
||||||
$aActionParams[] = "array('type' => 'reference', 'value' => 'sStimulusCode')";
|
$aActionParams[] = "array('type' => 'reference', 'value' => 'sStimulusCode')";
|
||||||
}
|
}
|
||||||
$sActionParams = 'array('.implode(', ', $aActionParams).')';
|
$sActionParams = 'array('.implode(', ', $aActionParams).')';
|
||||||
|
|||||||
Reference in New Issue
Block a user