mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Adapt the webservice to either 1.x or 2.x datamodels
SVN:trunk[2389]
This commit is contained in:
@@ -107,11 +107,12 @@ class BasicServices extends WebServicesBase
|
||||
}
|
||||
UserRights::Login($sLogin);
|
||||
|
||||
|
||||
if (!class_exists('Incident'))
|
||||
{
|
||||
$oRes = new WebServiceResult();
|
||||
$oRes->LogError("The class Incident does not exist. Did you install the Incident Management (ITIL) module ?");
|
||||
return $oRes;
|
||||
return $oRes->ToSoapStructure();
|
||||
}
|
||||
|
||||
$aCallerDesc = self::SoapStructToExternalKeySearch($oCallerDesc);
|
||||
|
||||
@@ -134,10 +134,11 @@ class WebServiceResult
|
||||
*/
|
||||
public function AddResultObject($sLabel, $oObject)
|
||||
{
|
||||
$oAppContext = new ApplicationContext();
|
||||
$this->m_aResult[$sLabel] = array(
|
||||
'id' => $oObject->GetKey(),
|
||||
'name' => $oObject->GetRawName(),
|
||||
'url' => $oObject->GetHyperlink(),
|
||||
'url' => $oAppContext->MakeObjectUrl(get_class($oObject), $oObject->GetKey(), null, false), // Raw URL without HTML tags
|
||||
);
|
||||
}
|
||||
|
||||
@@ -297,7 +298,7 @@ abstract class WebServicesBase
|
||||
if (is_object($oAttDef))
|
||||
{
|
||||
$iMaxSize = $oAttDef->GetMaxSize();
|
||||
if ($iMaxSize)
|
||||
if ($iMaxSize && (strlen($sValue) > $iMaxSize))
|
||||
{
|
||||
$sValue = substr($sValue, 0, $iMaxSize);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user