浏览代码

Fixed issue in create from mail

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@871 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 年之前
父节点
当前提交
835b578beb
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      webservices/createfrommail.php

+ 7 - 1
webservices/createfrommail.php

@@ -48,6 +48,7 @@ define('DEFAULT_URGENCY', '2');
 define('DEFAULT_SERVICE_ID', 2);
 define('DEFAULT_SERVICE_ID', 2);
 define('DEFAULT_SUBSERVICE_ID', 12);
 define('DEFAULT_SUBSERVICE_ID', 12);
 define('DEFAULT_PRODUCT', 'Request via eMail');
 define('DEFAULT_PRODUCT', 'Request via eMail');
+define('DEFAULT_WORKGROUP_ID', 5);
 
 
 require_once('../application/application.inc.php');
 require_once('../application/application.inc.php');
 require_once('../application/startup.inc.php');
 require_once('../application/startup.inc.php');
@@ -93,7 +94,8 @@ function CreateTicket($sSenderEmail, $sSubject, $sBody)
 			$oTicket->Set('product', DEFAULT_PRODUCT);
 			$oTicket->Set('product', DEFAULT_PRODUCT);
 			$oTicket->Set('service_id', DEFAULT_SERVICE_ID); //  Can be replaced by a search for a valid service for this 'org_id'
 			$oTicket->Set('service_id', DEFAULT_SERVICE_ID); //  Can be replaced by a search for a valid service for this 'org_id'
 			$oTicket->Set('servicesubcategory_id', DEFAULT_SUBSERVICE_ID); // Same as above...
 			$oTicket->Set('servicesubcategory_id', DEFAULT_SUBSERVICE_ID); // Same as above...
-	
+			$oTicket->Set('workgroup_id', DEFAULT_WORKGROUP_ID); // Same as above...
+
 			// Record the change information about the object
 			// Record the change information about the object
 			$oMyChange = MetaModel::NewObject("CMDBChange");
 			$oMyChange = MetaModel::NewObject("CMDBChange");
 			$oMyChange->Set("date", time());
 			$oMyChange->Set("date", time());
@@ -181,6 +183,10 @@ for($index = 1; $index <= $iNbMessages; $index++)
 		}
 		}
 	}
 	}
 
 
+	// Bug: depending on the email, the email address could be found in :
+	// email => 'john.foo@combodo.com'
+	// name  => 'john foo <john.foo@combodo.com>
+
 	$oTicket = CreateTicket($aSender['email'], $sSubject, $sTextBody);
 	$oTicket = CreateTicket($aSender['email'], $sSubject, $sTextBody);
 	if ($oTicket != null)
 	if ($oTicket != null)
 	{
 	{