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: ...@@ -104,7 +104,7 @@ job_php-7.2:
image: php:7.2-apache image: php:7.2-apache
stage: test stage: test
script: 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 - chmod +x /usr/local/bin/phpunit
- phpunit --coverage-text --colors=never - phpunit --coverage-text --colors=never
only: only:
......
...@@ -51,11 +51,21 @@ class AutoCompleteController ...@@ -51,11 +51,21 @@ class AutoCompleteController
$fields = ['firstname', 'lastname']; $fields = ['firstname', 'lastname'];
$fields = AutoCompleteController::getInsensitiveFieldsForRequest(['fields' => $fields]); $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([ $requestData = AutoCompleteController::getDataForRequest([
'search' => $queryParams['search'], 'search' => $queryParams['search'],
'fields' => $fields, 'fields' => $fields,
'where' => ['status not in (?)', 'mode not in (?)'], 'where' => $where,
'data' => [['DEL', 'SPD'], ['root_invisible', 'rest']], 'data' => $data,
'fieldsNumber' => 2, 'fieldsNumber' => 2,
]); ]);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<div *ngFor="let redirectModel of userDestTemplates; index as i" id="{{redirectModel.object_id}}" <div *ngFor="let redirectModel of userDestTemplates; index as i" id="{{redirectModel.object_id}}"
class="form-group"> class="form-group">
<plugin-autocomplete [labelPlaceholder]="('lang.newDest' | translate) + ' : ' + redirectModel.title" <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'" [targetSearchKey]="'idToDisplay'" [subInfoKey]="'descriptionToDisplay'"
(triggerEvent)="setRedirectUserListModels(i, $event)" singleMode required></plugin-autocomplete> (triggerEvent)="setRedirectUserListModels(i, $event)" singleMode required></plugin-autocomplete>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment