Skip to content

Commit

Permalink
do not display publication in to his parent list
Browse files Browse the repository at this point in the history
  • Loading branch information
aynsix committed Jun 6, 2024
1 parent c4e5d20 commit ad5c1b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,15 @@ public function listPublicationAction(PhraseaApplication $app, Request $request)

if ($request->get('format') == 'pub-list') {
$publicationsList = [];

foreach ($publications as $key => $publication) {
$publicationsList[$key]['id'] = $basePath . '/' . $publication['id'];
$publicationsList[$key]['text'] = $publication['title'];
$excludePublication = $request->get('exclude');

$key = 0;
foreach ($publications as $publication) {
if ($excludePublication != $publication['id']) {
$publicationsList[$key]['id'] = $basePath . '/' . $publication['id'];
$publicationsList[$key]['text'] = $publication['title'];
$key++;
}
}

$pagination = ['more' => false];
Expand Down
7 changes: 4 additions & 3 deletions templates/web/prod/WorkZone/ExposeEdit.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,8 @@
exposeName: exposeName,
format: 'pub-list',
editable: 1,
page: params.page || 1
page: params.page || 1,
exclude: '{{ publication.id }}'
};
},
processResults: function (data) {
Expand All @@ -243,9 +244,9 @@
pagination: data.pagination
};
},
delay: 250
delay: 1000,
},
dropdownParent: $('#publication-data-form-edit')
dropdownParent: $('#publication-data-form-edit'),
});
{% if publication.capabilities.operator %}
Expand Down
2 changes: 1 addition & 1 deletion templates/web/prod/WorkZone/ExposeNew.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
pagination: data.pagination
};
},
delay: 250
delay: 1000
},
dropdownParent: $('#publication-data-form')
});
Expand Down

0 comments on commit ad5c1b4

Please sign in to comment.