Commit 1e800336f8beb3fd13deab9c12f18bc2c208b287
1 parent
2f8caa1d
added support for multiselect types
Committed by: Tohir Solomons Reviewed by: Serge Meunier
Showing
2 changed files
with
23 additions
and
2 deletions
ktapi/KTAPIDocument.inc.php
| ... | ... | @@ -1255,6 +1255,10 @@ class KTAPI_Document extends KTAPI_FolderItem |
| 1255 | 1255 | // Options - Required for Custom Properties |
| 1256 | 1256 | $options = array(); |
| 1257 | 1257 | |
| 1258 | + if ($field->getInetLookupType() == 'multiwithcheckboxes' || $field->getInetLookupType() == 'multiwithlist') { | |
| 1259 | + $controltype = 'multiselect'; | |
| 1260 | + } | |
| 1261 | + | |
| 1258 | 1262 | switch ($controltype) |
| 1259 | 1263 | { |
| 1260 | 1264 | case 'lookup': |
| ... | ... | @@ -1270,6 +1274,12 @@ class KTAPI_Document extends KTAPI_FolderItem |
| 1270 | 1274 | ); |
| 1271 | 1275 | $selection= array(); |
| 1272 | 1276 | break; |
| 1277 | + case 'multiselect': | |
| 1278 | + $selection = KTAPI::get_metadata_lookup($field->getId()); | |
| 1279 | + $options = array( | |
| 1280 | + 'type' => $field->getInetLookupType() | |
| 1281 | + ); | |
| 1282 | + break; | |
| 1273 | 1283 | default: |
| 1274 | 1284 | $selection= array(); |
| 1275 | 1285 | } | ... | ... |
ktapi/ktapi.inc.php
| ... | ... | @@ -1036,8 +1036,13 @@ class KTAPI |
| 1036 | 1036 | $controltype = 'tree'; |
| 1037 | 1037 | } |
| 1038 | 1038 | } |
| 1039 | - | |
| 1040 | 1039 | $options = array(); |
| 1040 | + | |
| 1041 | + if ($field->getInetLookupType() == 'multiwithcheckboxes' || $field->getInetLookupType() == 'multiwithlist') { | |
| 1042 | + $controltype = 'multiselect'; | |
| 1043 | + } | |
| 1044 | + | |
| 1045 | + | |
| 1041 | 1046 | switch ($controltype) |
| 1042 | 1047 | { |
| 1043 | 1048 | case 'lookup': |
| ... | ... | @@ -1053,6 +1058,12 @@ class KTAPI |
| 1053 | 1058 | ); |
| 1054 | 1059 | $selection= array(); |
| 1055 | 1060 | break; |
| 1061 | + case 'multiselect': | |
| 1062 | + $selection = KTAPI::get_metadata_lookup($field->getId()); | |
| 1063 | + $options = array( | |
| 1064 | + 'type' => $field->getInetLookupType() | |
| 1065 | + ); | |
| 1066 | + break; | |
| 1056 | 1067 | default: |
| 1057 | 1068 | $selection= array(); |
| 1058 | 1069 | } |
| ... | ... | @@ -1065,7 +1076,7 @@ class KTAPI |
| 1065 | 1076 | 'description' => $field->getDescription(), |
| 1066 | 1077 | 'control_type' => $controltype, |
| 1067 | 1078 | 'selection' => $selection, |
| 1068 | - 'options' => $options, | |
| 1079 | + 'options' => $options | |
| 1069 | 1080 | ); |
| 1070 | 1081 | } |
| 1071 | 1082 | $result['fields'] = $fieldsresult; | ... | ... |