浏览代码

#352 Web Service CreateTicket: Search the service subcategory given the found service_id (if not already specified)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1111 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父节点
当前提交
2552216af1
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 1 1
      test/testlist.inc.php
  2. 4 0
      webservices/webservices.basic.php

+ 1 - 1
test/testlist.inc.php

@@ -2302,7 +2302,7 @@ $aCreateTicketSpecs = array(
 			new SOAPExternalKeySearch(array(new SOAPSearchCondition('id', 1))), /* aCallerDesc */
 			new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', 'Demo'))), /* aCustomerDesc */
 			new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', 'Computers and peripherals'))), /* aServiceDesc */
-			new SOAPExternalKeySearch(array(new SOAPSearchCondition('id', 1))), /* aServiceSubcategoryDesc */
+			new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', 'Troubleshooting'))), /* aServiceSubcategoryDesc */
 			'sub product of the service', /* sProduct */
 			new SOAPExternalKeySearch(array(new SOAPSearchCondition('name', 'Hardware support'))), /* aWorkgroupDesc */
 			array(

+ 4 - 0
webservices/webservices.basic.php

@@ -132,6 +132,10 @@ class BasicServices extends WebServicesBase
 			$this->MyObjectSetExternalKey('caller_id', 'caller', $aCallerDesc, $oNewTicket, $oRes);
 	
 			$this->MyObjectSetExternalKey('service_id', 'service', $aServiceDesc, $oNewTicket, $oRes);
+			if (!array_key_exists('service_id', $aServiceSubcategoryDesc))
+			{
+				$aServiceSubcategoryDesc['service_id'] = $oNewTicket->Get('service_id');
+			}
 			$this->MyObjectSetExternalKey('servicesubcategory_id', 'servicesubcategory', $aServiceSubcategoryDesc, $oNewTicket, $oRes);
 			$this->MyObjectSetScalar('product', 'product', $sProduct, $oNewTicket, $oRes);