mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/9590] Update permissions with correct permission role
PHPBB3-9590
This commit is contained in:
parent
4fce18609f
commit
48d6abcf0a
1 changed files with 14 additions and 2 deletions
|
@ -70,6 +70,7 @@ function submitPermissions() {
|
||||||
var $form = $('form#set-permissions'),
|
var $form = $('form#set-permissions'),
|
||||||
fieldsetList = $form.find('fieldset[id^=perm]'),
|
fieldsetList = $form.find('fieldset[id^=perm]'),
|
||||||
formDataSets = [],
|
formDataSets = [],
|
||||||
|
dataSetIndex = 0,
|
||||||
$submitAllButton = $form.find('input[type=submit][name^=action]')[0],
|
$submitAllButton = $form.find('input[type=submit][name^=action]')[0],
|
||||||
$submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
$submitButton = $form.find('input[type=submit][data-clicked=true]')[0];
|
||||||
|
|
||||||
|
@ -84,10 +85,21 @@ function submitPermissions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$.each(fieldsetList, function (key, value) {
|
$.each(fieldsetList, function (key, value) {
|
||||||
|
dataSetIndex = Math.floor(key / 5);
|
||||||
|
var $fieldset = $('fieldset#' + value.id);
|
||||||
if (key % 5 === 0) {
|
if (key % 5 === 0) {
|
||||||
formDataSets[Math.floor(key / 5)] = $form.find('fieldset#' + value.id).serialize();
|
formDataSets[dataSetIndex] = $fieldset.find('select:visible, input:not([data-name])').serialize();
|
||||||
} else {
|
} else {
|
||||||
formDataSets[Math.floor(key / 5)] += '&' + $form.find('fieldset#' + value.id).serialize();
|
formDataSets[dataSetIndex] += '&' + $fieldset.find('select:visible, input:not([data-name])').serialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find proper role value
|
||||||
|
var roleInput = $fieldset.find('input[name^=role][data-name]');
|
||||||
|
if (roleInput.val()) {
|
||||||
|
formDataSets[dataSetIndex] += '&' + roleInput.attr('name') + '=' + roleInput.val();
|
||||||
|
} else {
|
||||||
|
formDataSets[dataSetIndex] += '&' + roleInput.attr('name') + '=' +
|
||||||
|
$fieldset.find('select[name="' + roleInput.attr('name') + '"]').val();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue