mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°7552 - Adjust linkedset display as tag endpoint to return only necessary data
This commit is contained in:
@@ -795,10 +795,12 @@ JS;
|
|||||||
* Search objects via an oql and a friendly name search string
|
* Search objects via an oql and a friendly name search string
|
||||||
*
|
*
|
||||||
* @return JsonPage
|
* @return JsonPage
|
||||||
|
* @used-by LinkedSet attribute when in tag display
|
||||||
*/
|
*/
|
||||||
public function OperationSearch(): JsonPage
|
public function OperationSearch(): JsonPage
|
||||||
{
|
{
|
||||||
$oPage = new JsonPage();
|
$oPage = new JsonPage();
|
||||||
|
$oPage->SetOutputDataOnly(true);
|
||||||
|
|
||||||
// Retrieve query params
|
// Retrieve query params
|
||||||
$sObjectClass = utils::ReadParam('object_class', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
$sObjectClass = utils::ReadParam('object_class', '', false, utils::ENUM_SANITIZATION_FILTER_STRING);
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
|
|||||||
|
|
||||||
// Handle errors
|
// Handle errors
|
||||||
if(!me.settings.hasError){
|
if(!me.settings.hasError){
|
||||||
me.toggleErrorClass(!res.data.success);
|
me.toggleErrorClass(!res.success);
|
||||||
if(!res.data.success) return;
|
if(!res.success) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve current input value
|
// Retrieve current input value
|
||||||
@@ -120,7 +120,7 @@ let oWidget{{ oUIBlock.GetId() }} = $('#{{ oUIBlock.GetId() }}').selectize({
|
|||||||
me.optionsBeforeFilter = options;
|
me.optionsBeforeFilter = options;
|
||||||
options = options.filter(item => (typeof(item.force) !== "undefined" && item.force === true) || aSelectedItems.includes(item['{{ oDataProvider.GetDataValueField() }}']));
|
options = options.filter(item => (typeof(item.force) !== "undefined" && item.force === true) || aSelectedItems.includes(item['{{ oDataProvider.GetDataValueField() }}']));
|
||||||
// Merge kept and new values
|
// Merge kept and new values
|
||||||
options = $.merge(options, res.data.search_data);
|
options = $.merge(options, res.search_data);
|
||||||
// Compute groups
|
// Compute groups
|
||||||
$.each(options, function(index, value) {
|
$.each(options, function(index, value) {
|
||||||
me.addOptionGroup(value['{{ oDataProvider.GetGroupField() }}'], {
|
me.addOptionGroup(value['{{ oDataProvider.GetGroupField() }}'], {
|
||||||
|
|||||||
Reference in New Issue
Block a user