[TikiWiki-commits] [Git][tikiwiki/tiki][master] [ENH] UserSelector field: Allow user search without group selection in Tracker UserSelector field
Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.cvs |
|---|---|
| Message-ID | <696a83bb5302d_2c1817d0-367@gitlab-sidekiq-low-urgency-cpu-bound-v2-858b4f5cb4-xnw8n.mail> |
Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki
Commits:
768c82ae by Landry Bitege at 2026-01-16T18:21:25+00:00
[ENH] UserSelector field: Allow user search without group selection in Tracker UserSelector field
---
* [ENH] UserSelector field: Allow user search without group selection in Tracker UserSelector field
See merge request tikiwiki/tiki!9019
- - - - -
1 changed file:
- templates/trackerinput/userselector_grouped.tpl
Changes:
=====================================
templates/trackerinput/userselector_grouped.tpl
=====================================
@@ -1,15 +1,17 @@
<div class="row">
<div class="col-sm">
{tr}Filter by group:{/tr}
- <select id="user_group_selector_{$field.fieldId}" multiple="multiple" class="form-select">
+ {*NOTE: `placeholder` is not valid for <select>, but this is currently the only way found to change the default "Select" label generated by el-select without modifying it. If a better solution is found, feel free to replace this.*}
+ <select id="user_group_selector_{$field.fieldId}" multiple="multiple" class="form-select" placeholder="Any">
{section name=ix loop=$data.groups}
<option value="{$data.groups[ix]|escape}" {if (in_array($data.groups[ix], $data.selected_groups))}selected{/if}>{$data.groups[ix]}</option>
{/section}
</select>
</div>
{if $field.options_map.inputtype === 't'}
- <div class="mt-2" />
- {jstransfer_list data=[] defaultSelected=$data.selected_users fieldName="{$field.html_name}" filterable=$field.options_map.filterable filterPlaceholder=$field.options_map.filterPlaceholder sourceListTitle=$field.options_map.sourceListTitle targetListTitle=$field.options_map.targetListTitle ordering=$field.options_map.ordering cardinalityParam=$field.validationParam validationMessage=$field.validationMessage}
+ <div class="mt-2">
+ {jstransfer_list data=[] defaultSelected=$data.selected_users fieldName="{$field.html_name}" filterable=$field.options_map.filterable filterPlaceholder=$field.options_map.filterPlaceholder sourceListTitle=$field.options_map.sourceListTitle targetListTitle=$field.options_map.targetListTitle ordering=$field.options_map.ordering cardinalityParam=$field.validationParam validationMessage=$field.validationMessage}
+ </div>
{else}
<div class="col-sm-6">
{tr}Select user(s):{/tr}
@@ -34,9 +36,15 @@
url.searchParams.set('groups', $(this).val().join(','));
$selector.attr('data-remote-source-url', url.toString());
} else {
- $.map($(this).val(), function(group) {
- $.extend(group_users, users{{$field.fieldId}}[group] || {});
- });
+ if ($(this).val().length === 0) {
+ $.each(users{{$field.fieldId}}, function(group, users) {
+ $.extend(group_users, users);
+ });
+ } else {
+ $.map($(this).val(), function(group) {
+ $.extend(group_users, users{{$field.fieldId}}[group] || {});
+ });
+ }
var all_users = Object.keys(group_users);
var $group_selector = $("#user_group_selector_{{$field.fieldId}}"),
@@ -45,7 +53,6 @@
$selector.removeClass("disabled").prop("disabled", false);
$("#info").addClass("d-none");
} else {
- $("#info").text("{{'You need first to select a group'|tra}}");
if (group_selected.length > 0) {
$("#info").text("{{'No user found in the group(s).'|tra}}");
}
@@ -57,9 +64,6 @@
var to_remove = $.map(selected, function(user) {
return $.inArray(user, all_users) < 0 ? user : null;
});
- if (to_remove.length > 0 && ! confirm(tr("Please confirm if you want to remove the following users:")+" "+to_remove.join(', '))) {
- return;
- }
$selector.empty();
$.map(all_users, function(user){
return {value: user, label: group_users[user]};
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/768c82ae20df728e342968648164663004a6bd4c
--
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/768c82ae20df728e342968648164663004a6bd4c
You're receiving this email because of your account on gitlab.com.
_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs