Skip to content
Snippets Groups Projects
Verified Commit e61480f6 authored by Damien's avatar Damien
Browse files

FEAT #15399 TIME 1:00 Autocomplete with entity when deleting user

parent 1c66b70f
No related branches found
No related tags found
No related merge requests found
......@@ -104,7 +104,7 @@ job_php-7.2:
image: php:7.2-apache
stage: test
script:
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-8.phar
- curl --location -s --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit-9.phar
- chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never
only:
......
......@@ -51,11 +51,21 @@ class AutoCompleteController
$fields = ['firstname', 'lastname'];
$fields = AutoCompleteController::getInsensitiveFieldsForRequest(['fields' => $fields]);
$where = ['status not in (?)', 'mode not in (?)'];
$data = [['DEL', 'SPD'], ['root_invisible', 'rest']];
if (!empty($queryParams['inEntity'])) {
if (is_numeric($queryParams['inEntity'])) {
$entity = EntityModel::getById(['select' => ['entity_id'], 'id' => $queryParams['inEntity']]);
$queryParams['inEntity'] = $entity['entity_id'];
}
$where[] = 'id in (SELECT user_id FROM users_entities WHERE entity_id = ?)';
$data[] = $queryParams['inEntity'];
}
$requestData = AutoCompleteController::getDataForRequest([
'search' => $queryParams['search'],
'fields' => $fields,
'where' => ['status not in (?)', 'mode not in (?)'],
'data' => [['DEL', 'SPD'], ['root_invisible', 'rest']],
'where' => $where,
'data' => $data,
'fieldsNumber' => 2,
]);
......
......@@ -12,7 +12,7 @@
<div *ngFor="let redirectModel of userDestTemplates; index as i" id="{{redirectModel.object_id}}"
class="form-group">
<plugin-autocomplete [labelPlaceholder]="('lang.newDest' | translate) + ' : ' + redirectModel.title"
[labelList]="('lang.availableUsers' | translate)" [routeDatas]="['/rest/autocomplete/users']"
[labelList]="('lang.availableUsers' | translate)" [routeDatas]="['/rest/autocomplete/users?inEntity=' + redirectModel.entity_id]"
[targetSearchKey]="'idToDisplay'" [subInfoKey]="'descriptionToDisplay'"
(triggerEvent)="setRedirectUserListModels(i, $event)" singleMode required></plugin-autocomplete>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment