mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
#754 Prevent UserRequests to have themselves set as Parent Request (and same for Incidents)
SVN:trunk[2913]
This commit is contained in:
@@ -1200,6 +1200,19 @@
|
||||
$this->Set('close_date', time());
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_incident_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:Incident/Error:CannotAssignParentIncidentIdToSelf');
|
||||
}
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputePriority">
|
||||
<comment>/** Compute the priority of the ticket based on its impact and urgency
|
||||
|
||||
@@ -234,6 +234,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:Incident/Stimulus:ev_close+' => '',
|
||||
'Class:Incident/Stimulus:ev_reopen' => 'Re-open',
|
||||
'Class:Incident/Stimulus:ev_reopen+' => '',
|
||||
'Class:Incident/Error:CannotAssignParentIncidentIdToSelf' => 'Cannot assign the Parent incident to the incident itself',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -192,6 +192,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'Class:Incident/Stimulus:ev_close+' => '',
|
||||
'Class:Incident/Stimulus:ev_reopen' => 'Ré-ouvrir',
|
||||
'Class:Incident/Stimulus:ev_reopen+' => '',
|
||||
'Class:Incident/Error:CannotAssignParentIncidentIdToSelf' => 'L\'Incident parent ne peut pas être assigné à lui même',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -1589,6 +1589,19 @@
|
||||
$this->Set('approver_id', UserRights::GetUserId());
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:UserRequest/Error:CannotAssignParentRequestIdToSelf');
|
||||
}
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputePriority">
|
||||
<comment>/** Compute the priority of the ticket based on its impact and urgency
|
||||
|
||||
@@ -260,6 +260,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:UserRequest/Stimulus:ev_reopen+' => '',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval' => 'Wait for approval',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval+' => '',
|
||||
'Class:UserRequest/Error:CannotAssignParentRequestIdToSelf' => 'Cannot assign the Parent request to the request itself',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'Class:UserRequest/Stimulus:ev_reopen+' => '',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval' => 'Attendre une approbation',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval+' => '',
|
||||
'Class:UserRequest/Error:CannotAssignParentRequestIdToSelf' => 'La Requête parente ne peut pas être assignée à elle même',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -1576,6 +1576,19 @@
|
||||
$this->Set('approver_id', UserRights::GetUserId());
|
||||
return true;
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="DoCheckToWrite">
|
||||
<static>false</static>
|
||||
<access>public</access>
|
||||
<type>Overload-DBObject</type>
|
||||
<code><![CDATA[public function DoCheckToWrite()
|
||||
{
|
||||
parent::DoCheckToWrite();
|
||||
if (!$this->IsNew() && ($this->Get('parent_request_id') == $this->GetKey()))
|
||||
{
|
||||
$this->m_aCheckIssues[] = Dict::Format('Class:UserRequest/Error:CannotAssignParentRequestIdToSelf');
|
||||
}
|
||||
}]]></code>
|
||||
</method>
|
||||
<method id="ComputePriority">
|
||||
<comment>/** Compute the priority of the ticket based on its impact and urgency
|
||||
|
||||
@@ -263,6 +263,7 @@ Dict::Add('EN US', 'English', 'English', array(
|
||||
'Class:UserRequest/Stimulus:ev_reopen+' => '',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval' => 'Wait for approval',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval+' => '',
|
||||
'Class:UserRequest/Error:CannotAssignParentRequestIdToSelf' => 'Cannot assign the Parent request to the request itself',
|
||||
));
|
||||
|
||||
|
||||
|
||||
@@ -214,6 +214,7 @@ Dict::Add('FR FR', 'French', 'Français', array(
|
||||
'Class:UserRequest/Stimulus:ev_reopen+' => '',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval' => 'Attendre une approbation',
|
||||
'Class:UserRequest/Stimulus:ev_wait_for_approval+' => '',
|
||||
'Class:UserRequest/Error:CannotAssignParentRequestIdToSelf' => 'La Requête parente ne peut pas être assignée à elle même',
|
||||
));
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user