mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Implement sub_app attribute for customfields widget, in order to be able to store sub-app's specific customfields
This commit is contained in:
parent
9746e1533e
commit
11c03702dd
@ -127,7 +127,7 @@ class admin_customfields
|
||||
{
|
||||
// determine appname
|
||||
$this->appname = $this->appname ? $this->appname : ($_GET['appname'] ? $_GET['appname'] : ($content['appname'] ? $content['appname'] : false));
|
||||
if(!$this->appname) die(lang('Error! No appname found'));
|
||||
if(!$this->appname || !Api\Link::get_registry($this->appname, 'title')) die(lang('Error! No appname found'));
|
||||
|
||||
$this->use_private = !isset($_GET['use_private']) || (boolean)$_GET['use_private'] || $content['use_private'];
|
||||
|
||||
|
@ -48,6 +48,11 @@ var et2_customfields_list = (function(){ "use strict"; return et2_valueWidget.ex
|
||||
'private': {
|
||||
ignore: true,
|
||||
type: 'boolean'
|
||||
},
|
||||
'sub_app': {
|
||||
'name': 'sub app name',
|
||||
'type': "string",
|
||||
'description': "Name of sub application"
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -126,6 +126,7 @@ class Customfields extends Transformer
|
||||
if(!$app)
|
||||
{
|
||||
$app =& $this->setElementAttribute(self::GLOBAL_VALS, 'app', $GLOBALS['egw_info']['flags']['currentapp']);
|
||||
if ($this->attrs['sub-app']) $app .= '-'.$this->attrs['sub-app'];
|
||||
$customfields =& $this->setElementAttribute(self::GLOBAL_VALS, 'customfields', Api\Storage\Customfields::get($app));
|
||||
}
|
||||
|
||||
@ -283,7 +284,7 @@ class Customfields extends Transformer
|
||||
$widget->id = self::$prefix.$fname;
|
||||
$widget->attrs['type'] = $type;
|
||||
$widget->set_attrs($xml);
|
||||
|
||||
|
||||
// some type-specific (default) attributes
|
||||
switch($type)
|
||||
{
|
||||
@ -402,7 +403,7 @@ class Customfields extends Transformer
|
||||
// Arrays are not valid, but leave filemanager alone, we'll catch it
|
||||
// when saving. This allows files for new entries.
|
||||
if (is_array($valid) && $field_settings['type'] !== 'filemanager') $valid = implode(',', $valid);
|
||||
|
||||
|
||||
// NULL is valid for most fields, but not custom fields due to backend handling
|
||||
// See so_sql_cf->save()
|
||||
if (is_null($valid)) $valid = false;
|
||||
|
Loading…
Reference in New Issue
Block a user