|
@@ -180,6 +180,7 @@ class ClientChoiceLoader implements ChoiceLoaderInterface
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
$choices = $this->webservice->getChoices($this->webserviceParameter, $params, true, array(), $limit);
|
|
|
|
|
|
$result = [];
|
|
@@ -199,6 +200,47 @@ class ClientChoiceLoader implements ChoiceLoaderInterface
|
|
|
return $result;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Get first n choices
|
|
|
+ *
|
|
|
+ * @param string $filter
|
|
|
+ *
|
|
|
+ * @return array
|
|
|
+ */
|
|
|
+ public function getChoicesListActive($filter)
|
|
|
+ {
|
|
|
+ $params = array();
|
|
|
+ $limit = 100;
|
|
|
+
|
|
|
+ if ($filter !== false) {
|
|
|
+ $params['qb-criteria'] = "";
|
|
|
+ $params['orWhere'] = "";
|
|
|
+ $params['externalId'] = urlencode($filter);
|
|
|
+ $params['name'] = urlencode($filter);
|
|
|
+ if ($this->filterTenancy) {
|
|
|
+ $params['tenancyId'] = $this->tenancyService->getTenancyIdCurrent();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $choices = $this->webservice->getChoices('client_active', $params, true, array(), $limit);
|
|
|
+
|
|
|
+ $result = [];
|
|
|
+ $cnt = 0;
|
|
|
+
|
|
|
+ $filter = mb_strtolower($filter);
|
|
|
+ $filter_len = mb_strlen($filter);
|
|
|
+
|
|
|
+ foreach ($choices as $label => $id) {
|
|
|
+ $result[$label] = $id;
|
|
|
+ $cnt++;
|
|
|
+ if ($cnt == $limit) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Validate whether a choice exists
|
|
|
*/
|