mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
#747: protects against the non-existence of the UserRequest class (which is not always installed).
SVN:trunk[2811]
This commit is contained in:
@@ -1452,28 +1452,31 @@
|
|||||||
$sUserString = CMDBChange::GetCurrentUserName();
|
$sUserString = CMDBChange::GetCurrentUserName();
|
||||||
$oMyChange->Set("userinfo", $sUserString."(automatic resolution)");
|
$oMyChange->Set("userinfo", $sUserString."(automatic resolution)");
|
||||||
$iChangeId = $oMyChange->DBInsert();
|
$iChangeId = $oMyChange->DBInsert();
|
||||||
$sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
|
if (MetaModel::IsValidClass('UserRequest'))
|
||||||
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
|
{
|
||||||
array(),
|
$sOQL = "SELECT UserRequest WHERE parent_request_id=:ticket";
|
||||||
array(
|
$oChildRequestSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL),
|
||||||
'ticket' => $this->GetKey(),
|
array(),
|
||||||
)
|
array(
|
||||||
);
|
'ticket' => $this->GetKey(),
|
||||||
//automatically resolve child requests
|
)
|
||||||
while($oRequest = $oChildRequestSet->Fetch())
|
);
|
||||||
{
|
//automatically resolve child requests
|
||||||
if ( $oRequest->Get('status') != 'resolved')
|
while($oRequest = $oChildRequestSet->Fetch())
|
||||||
{
|
{
|
||||||
$oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id'));
|
if ( $oRequest->Get('status') != 'resolved')
|
||||||
$oRequest->set('service_id',$this->Get('service_id'));
|
{
|
||||||
$oRequest->set('team_id',$this->Get('team_id'));
|
$oRequest->set('servicesubcategory_id',$this->Get('servicesubcategory_id'));
|
||||||
$oRequest->set('agent_id',$this->Get('agent_id'));
|
$oRequest->set('service_id',$this->Get('service_id'));
|
||||||
$oRequest->set('resolution_code',$this->Get('resolution_code'));
|
$oRequest->set('team_id',$this->Get('team_id'));
|
||||||
$oRequest->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
$oRequest->set('agent_id',$this->Get('agent_id'));
|
||||||
$oRequest->ApplyStimulus('ev_autoresolve');
|
$oRequest->set('resolution_code',$this->Get('resolution_code'));
|
||||||
$oRequest->DBUpdateTracked($oMyChange);
|
$oRequest->set('solution','Automatically resolved by incident:[[Incident:'.$this->Get('ref').']]');
|
||||||
}
|
$oRequest->ApplyStimulus('ev_autoresolve');
|
||||||
}
|
$oRequest->DBUpdateTracked($oMyChange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//automatically resolve child incidents
|
//automatically resolve child incidents
|
||||||
$sOQL = "SELECT Incident WHERE parent_incident_id=:ticket";
|
$sOQL = "SELECT Incident WHERE parent_incident_id=:ticket";
|
||||||
@@ -1507,6 +1510,8 @@
|
|||||||
<type>LifecycleAction</type>
|
<type>LifecycleAction</type>
|
||||||
<code><![CDATA[ public function UpdateChildRequestLog()
|
<code><![CDATA[ public function UpdateChildRequestLog()
|
||||||
{
|
{
|
||||||
|
if (!MetaModel::IsValidClass('UserRequest')) return true; // Do nothing
|
||||||
|
|
||||||
$sLogPublic = utils::ReadPostedParam('attr_public_log', null,false,'raw_data');
|
$sLogPublic = utils::ReadPostedParam('attr_public_log', null,false,'raw_data');
|
||||||
if ( $sLogPublic != null)
|
if ( $sLogPublic != null)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user