mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 15:22:17 +02:00
User request (all-in-one): the end-user can leave the request type undefined, in such a case, she can select any type of services and the request type gets computed when the requests is written to the DB. Still, this is possible to select a request type and the list of services is filled with the corresponding services. This behavior was necessary for the new user portal to work fine.
SVN:trunk[4046]
This commit is contained in:
@@ -70,7 +70,7 @@
|
|||||||
<value id="service_request">service_request</value>
|
<value id="service_request">service_request</value>
|
||||||
</values>
|
</values>
|
||||||
<sql>request_type</sql>
|
<sql>request_type</sql>
|
||||||
<default_value>incident</default_value>
|
<default_value></default_value>
|
||||||
<is_null_allowed>true</is_null_allowed>
|
<is_null_allowed>true</is_null_allowed>
|
||||||
<display_style>list</display_style>
|
<display_style>list</display_style>
|
||||||
</field>
|
</field>
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
<is_null_allowed>true</is_null_allowed>
|
<is_null_allowed>true</is_null_allowed>
|
||||||
</field>
|
</field>
|
||||||
<field id="servicesubcategory_id" xsi:type="AttributeExternalKey">
|
<field id="servicesubcategory_id" xsi:type="AttributeExternalKey">
|
||||||
<filter><![CDATA[SELECT ServiceSubcategory WHERE service_id = :this->service_id AND request_type = :this->request_type AND status != 'obsolete']]></filter>
|
<filter><![CDATA[SELECT ServiceSubcategory WHERE service_id = :this->service_id AND (ISNULL(:this->request_type) OR request_type = :this->request_type) AND status != 'obsolete']]></filter>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<attribute id="service_id"/>
|
<attribute id="service_id"/>
|
||||||
<attribute id="request_type"/>
|
<attribute id="request_type"/>
|
||||||
@@ -1196,10 +1196,21 @@
|
|||||||
<type>Overload-DBObject</type>
|
<type>Overload-DBObject</type>
|
||||||
<code><![CDATA[ public function ComputeValues()
|
<code><![CDATA[ public function ComputeValues()
|
||||||
{
|
{
|
||||||
|
|
||||||
// Compute the priority of the ticket
|
// Compute the priority of the ticket
|
||||||
$this->Set('priority', $this->ComputePriority());
|
$this->Set('priority', $this->ComputePriority());
|
||||||
|
|
||||||
|
// Compute the request_type if not already defined (by the user)
|
||||||
|
$sType = $this->Get('request_type');
|
||||||
|
if (is_null($sType) || ($sType === ''))
|
||||||
|
{
|
||||||
|
$iSvcSubcat = $this->Get('servicesubcategory_id');
|
||||||
|
if ($iSvcSubcat != 0)
|
||||||
|
{
|
||||||
|
$sType = $this->Get('servicesubcategory_id->request_type');
|
||||||
|
$this->Set('request_type', $sType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return parent::ComputeValues();
|
return parent::ComputeValues();
|
||||||
}]]></code>
|
}]]></code>
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
Reference in New Issue
Block a user