Commit 9bd4a5319e0a7b3001a35e25874098b1630d138b

Authored by Tohir Solomons
1 parent f3dd0f05

Replaced default control type of 'string' with correct one.

Add options per control type
Updated WSDL

Committed by: Tohir Solomons
Reviewed by: Megan Watson
ktapi/KTAPIDocument.inc.php
... ... @@ -1238,7 +1238,11 @@ class KTAPI_Document extends KTAPI_FolderItem
1238 1238 $value = $fieldvalue->getValue();
1239 1239 }
1240 1240  
1241   - $controltype = 'string';
  1241 + // Old
  1242 + //$controltype = 'string';
  1243 + // Replace with true
  1244 + $controltype = strtolower($field->getDataType());
  1245 +
1242 1246 if ($field->getHasLookup())
1243 1247 {
1244 1248 $controltype = 'lookup';
... ... @@ -1247,7 +1251,10 @@ class KTAPI_Document extends KTAPI_FolderItem
1247 1251 $controltype = 'tree';
1248 1252 }
1249 1253 }
1250   -
  1254 +
  1255 + // Options - Required for Custom Properties
  1256 + $options = array();
  1257 +
1251 1258 switch ($controltype)
1252 1259 {
1253 1260 case 'lookup':
... ... @@ -1256,6 +1263,13 @@ class KTAPI_Document extends KTAPI_FolderItem
1256 1263 case 'tree':
1257 1264 $selection = KTAPI::get_metadata_tree($field->getId());
1258 1265 break;
  1266 + case 'large text':
  1267 + $options = array(
  1268 + 'ishtml' => $field->getIsHTML(),
  1269 + 'maxlength' => $field->getMaxLength()
  1270 + );
  1271 + $selection= array();
  1272 + break;
1259 1273 default:
1260 1274 $selection= array();
1261 1275 }
... ... @@ -1268,7 +1282,8 @@ class KTAPI_Document extends KTAPI_FolderItem
1268 1282 'blankvalue' => $value=='' ? '1' : '0',
1269 1283 'description' => $field->getDescription(),
1270 1284 'control_type' => $controltype,
1271   - 'selection' => $selection
  1285 + 'selection' => $selection,
  1286 + 'options' => $options,
1272 1287  
1273 1288 );
1274 1289  
... ...
ktapi/ktapi.inc.php
... ... @@ -1024,7 +1024,10 @@ class KTAPI
1024 1024 $value = 'n/a';
1025 1025  
1026 1026  
1027   - $controltype = 'string';
  1027 + //$controltype = 'string';
  1028 +
  1029 + // Replace with true
  1030 + $controltype = strtolower($field->getDataType());
1028 1031 if ($field->getHasLookup())
1029 1032 {
1030 1033 $controltype = 'lookup';
... ... @@ -1033,7 +1036,8 @@ class KTAPI
1033 1036 $controltype = 'tree';
1034 1037 }
1035 1038 }
1036   -
  1039 +
  1040 + $options = array();
1037 1041 switch ($controltype)
1038 1042 {
1039 1043 case 'lookup':
... ... @@ -1042,6 +1046,13 @@ class KTAPI
1042 1046 case 'tree':
1043 1047 $selection = KTAPI::get_metadata_tree($field->getId());
1044 1048 break;
  1049 + case 'large text':
  1050 + $options = array(
  1051 + 'ishtml' => $field->getIsHTML(),
  1052 + 'maxlength' => $field->getMaxLength()
  1053 + );
  1054 + $selection= array();
  1055 + break;
1045 1056 default:
1046 1057 $selection= array();
1047 1058 }
... ... @@ -1053,7 +1064,8 @@ class KTAPI
1053 1064 'value' => $value,
1054 1065 'description' => $field->getDescription(),
1055 1066 'control_type' => $controltype,
1056   - 'selection' => $selection
  1067 + 'selection' => $selection,
  1068 + 'options' => $options,
1057 1069 );
1058 1070 }
1059 1071 $result['fields'] = $fieldsresult;
... ...
ktwebservice/webservice.php
... ... @@ -435,6 +435,12 @@ class KTWebService
435 435 'item' => "{urn:$this->namespace}kt_metadata_selection_item"
436 436 )
437 437 );
  438 +
  439 + $this->__typedef["{urn:$this->namespace}kt_metadata_options"] =
  440 + array(
  441 + 'ishtml' => 'string',
  442 + 'maxlength' => 'string'
  443 + );
438 444  
439 445 $this->__typedef["{urn:$this->namespace}kt_metadata_field"] =
440 446 array(
... ... @@ -443,7 +449,8 @@ class KTWebService
443 449 'value' => 'string' ,
444 450 'description' => 'string' ,
445 451 'control_type' => 'string' ,
446   - 'selection' => "{urn:$this->namespace}kt_metadata_selection"
  452 + 'selection' => "{urn:$this->namespace}kt_metadata_selection",
  453 + 'options' => "{urn:$this->namespace}kt_metadata_options"
447 454 );
448 455  
449 456 $this->__typedef["{urn:$this->namespace}kt_metadata_fields"] =
... ...