* Admin/Mail: fix saving mail-accounts for multiple accounts

This commit is contained in:
Ralf Becker 2018-05-04 15:05:36 +02:00
parent fba069e4b6
commit ba366467b0
3 changed files with 6 additions and 4 deletions

View File

@ -347,9 +347,7 @@
<row class="emailadmin_no_user dialogHeader2">
<description for="account_id" value="Valid for"/>
<hbox>
<menulist>
<menupopup type="select-account" id="account_id" onchange="app.admin.account_hide_not_applying" options="Everyone,both"/>
</menulist>
<select type="select-account" id="account_id" onchange="app.admin.account_hide_not_applying" options="Everyone,both" multiple="dynamic"/>
<buttononly label="Select multiple" id="button[multiple]" onclick="app.admin.edit_multiple" options="users"/>
<checkbox label="account editable by user" id="acc_user_editable"/>
</hbox>

View File

@ -25,6 +25,8 @@
var et2_selectbox = (function(){ "use strict"; return et2_inputWidget.extend(
{
attributes: {
// todo fully implement attr[multiple] === "dynamic" to render widget with a button to switch to multiple
// as it is used in account_id selection in admin >> mailaccount (app.admin.edit_multiple method client-side)
"multiple": {
"name": "multiple",
"type": "boolean",

View File

@ -23,6 +23,8 @@ use calendar_timezones;
* eTemplate select widget
*
* @todo unavailable cats (eg. private cats of an other user) need to be preserved!
* @todo fully implement attr[multiple] === "dynamic" to render widget with a button to switch to multiple
* as it is used in account_id selection in admin >> mailaccount (app.admin.edit_multiple method client-side)
*/
class Select extends Etemplate\Widget
{
@ -148,7 +150,7 @@ class Select extends Etemplate\Widget
if ($child->type == 'option') $allowed[] = (string)$child->attrs['value'];
}
if (!$multiple ) $allowed[] = '';
if (!$multiple || $this->attrs['multiple'] === "dynamic") $allowed[] = '';
foreach((array) $value as $val)
{