diff --git a/ktapi/KTAPIDocument.inc.php b/ktapi/KTAPIDocument.inc.php index 8787596..7266032 100644 --- a/ktapi/KTAPIDocument.inc.php +++ b/ktapi/KTAPIDocument.inc.php @@ -1238,7 +1238,11 @@ class KTAPI_Document extends KTAPI_FolderItem $value = $fieldvalue->getValue(); } - $controltype = 'string'; + // Old + //$controltype = 'string'; + // Replace with true + $controltype = strtolower($field->getDataType()); + if ($field->getHasLookup()) { $controltype = 'lookup'; @@ -1247,7 +1251,10 @@ class KTAPI_Document extends KTAPI_FolderItem $controltype = 'tree'; } } - + + // Options - Required for Custom Properties + $options = array(); + switch ($controltype) { case 'lookup': @@ -1256,6 +1263,13 @@ class KTAPI_Document extends KTAPI_FolderItem case 'tree': $selection = KTAPI::get_metadata_tree($field->getId()); break; + case 'large text': + $options = array( + 'ishtml' => $field->getIsHTML(), + 'maxlength' => $field->getMaxLength() + ); + $selection= array(); + break; default: $selection= array(); } @@ -1268,7 +1282,8 @@ class KTAPI_Document extends KTAPI_FolderItem 'blankvalue' => $value=='' ? '1' : '0', 'description' => $field->getDescription(), 'control_type' => $controltype, - 'selection' => $selection + 'selection' => $selection, + 'options' => $options, ); diff --git a/ktapi/ktapi.inc.php b/ktapi/ktapi.inc.php index 0545fed..e867883 100644 --- a/ktapi/ktapi.inc.php +++ b/ktapi/ktapi.inc.php @@ -1024,7 +1024,10 @@ class KTAPI $value = 'n/a'; - $controltype = 'string'; + //$controltype = 'string'; + + // Replace with true + $controltype = strtolower($field->getDataType()); if ($field->getHasLookup()) { $controltype = 'lookup'; @@ -1033,7 +1036,8 @@ class KTAPI $controltype = 'tree'; } } - + + $options = array(); switch ($controltype) { case 'lookup': @@ -1042,6 +1046,13 @@ class KTAPI case 'tree': $selection = KTAPI::get_metadata_tree($field->getId()); break; + case 'large text': + $options = array( + 'ishtml' => $field->getIsHTML(), + 'maxlength' => $field->getMaxLength() + ); + $selection= array(); + break; default: $selection= array(); } @@ -1053,7 +1064,8 @@ class KTAPI 'value' => $value, 'description' => $field->getDescription(), 'control_type' => $controltype, - 'selection' => $selection + 'selection' => $selection, + 'options' => $options, ); } $result['fields'] = $fieldsresult; diff --git a/ktwebservice/webservice.php b/ktwebservice/webservice.php index bc70e67..958aa43 100644 --- a/ktwebservice/webservice.php +++ b/ktwebservice/webservice.php @@ -435,6 +435,12 @@ class KTWebService 'item' => "{urn:$this->namespace}kt_metadata_selection_item" ) ); + + $this->__typedef["{urn:$this->namespace}kt_metadata_options"] = + array( + 'ishtml' => 'string', + 'maxlength' => 'string' + ); $this->__typedef["{urn:$this->namespace}kt_metadata_field"] = array( @@ -443,7 +449,8 @@ class KTWebService 'value' => 'string' , 'description' => 'string' , 'control_type' => 'string' , - 'selection' => "{urn:$this->namespace}kt_metadata_selection" + 'selection' => "{urn:$this->namespace}kt_metadata_selection", + 'options' => "{urn:$this->namespace}kt_metadata_options" ); $this->__typedef["{urn:$this->namespace}kt_metadata_fields"] =