mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
[Secondary Groups] Change secondary groups from selected to non selected in agent edit view
This commit is contained in:
parent
efe420edfb
commit
26da63610a
@ -625,12 +625,31 @@ ui_require_jquery_file('bgiframe');
|
|||||||
|
|
||||||
function agent_manager_add_secondary_groups (event) {
|
function agent_manager_add_secondary_groups (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// TODO
|
var primary_value = $("#grupo").val()
|
||||||
|
// The selected primary value cannot be selected like secondary
|
||||||
|
if ($("#secondary_groups option:selected[value=" + primary_value + "]").length > 0) {
|
||||||
|
alert("<?php echo __("Primary group cannot be secondary too.");?>")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Move from one input to the other
|
||||||
|
$("#secondary_groups_selected option[value=0]").remove()
|
||||||
|
$("#secondary_groups option:selected").each(function(){
|
||||||
|
$(this).remove().appendTo("#secondary_groups_selected")
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function agent_manager_remove_secondary_groups (event) {
|
function agent_manager_remove_secondary_groups (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
// TODO
|
$("#secondary_groups_selected option:selected").each(function(){
|
||||||
|
$(this).remove().appendTo("#secondary_groups")
|
||||||
|
})
|
||||||
|
|
||||||
|
if ($("#secondary_groups_selected option").length == 0) {
|
||||||
|
$("#secondary_groups_selected").append($('<option>',{
|
||||||
|
value: 0,
|
||||||
|
text: "<?php echo __("None");?>"
|
||||||
|
}))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready (function() {
|
$(document).ready (function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user