WIP allow to place custom-fields in tabs: add noVfsSelect option to filemanager custom-field and some docu tooltip for filemanager options

This commit is contained in:
ralf
2024-03-27 17:44:57 +02:00
parent 254fdc0fa3
commit a63aaad8e9
4 changed files with 37 additions and 30 deletions

View File

@@ -926,30 +926,34 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
this.rows[attrs.id] = cf[0];
jQuery(widget.getDOMNode(widget)).css('vertical-align','top');
// Add a link to existing VFS file
const required = attrs.needed ?? attrs.required;
delete attrs.needed;
const select_attrs = {
...attrs,
// Filemanager select
...{
path: '~',
mode: widget.options.multiple ? 'open-multiple' : 'open',
method: 'EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_existing',
methodId: attrs.path,
buttonLabel: this.egw().lang('Link')
},
type: 'et2-vfs-select',
required: required
// should we show the VfsSelect
if (!field.values || typeof field.values !== 'object' || !field.values.noVfsSelect)
{
// Add a link to existing VFS file
const required = attrs.needed ?? attrs.required;
delete attrs.needed;
const select_attrs = {
...attrs,
// Filemanager select
...{
path: '~',
mode: widget.options.multiple ? 'open-multiple' : 'open',
method: 'EGroupware\\Api\\Etemplate\\Widget\\Link::ajax_link_existing',
methodId: attrs.path,
buttonLabel: this.egw().lang('Link')
},
type: 'et2-vfs-select',
required: required
}
select_attrs.id = attrs.id + '_vfs_select';
// This controls where the button is placed in the DOM
this.rows[select_attrs.id] = cf[0];
// Do not store in the widgets list, one name for multiple widgets would cause problems
widget = <Et2VfsSelectButton>loadWebComponent(select_attrs.type, select_attrs, this);
jQuery(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
}
select_attrs.id = attrs.id + '_vfs_select';
// This controls where the button is placed in the DOM
this.rows[select_attrs.id] = cf[0];
// Do not store in the widgets list, one name for multiple widgets would cause problems
widget = <Et2VfsSelectButton>loadWebComponent(select_attrs.type, select_attrs, this);
jQuery(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
}
return false;
}