diff --git a/admin/inc/class.admin_customfields.inc.php b/admin/inc/class.admin_customfields.inc.php index daba24c140..150bc3a8d8 100644 --- a/admin/inc/class.admin_customfields.inc.php +++ b/admin/inc/class.admin_customfields.inc.php @@ -459,7 +459,6 @@ class admin_customfields $readonlys = array(); //echo 'customfields=
'; print_r($this->fields); echo "\n"; - $content['cf_order'] = (count($this->fields)+1) * 10; $content['use_private'] = $this->use_private; $content['use_readonly'] = $this->use_readonly; @@ -471,18 +470,32 @@ class admin_customfields { $content['cf_private'] = explode(',',$content['cf_private']); } - if($content['cf_name']) + if($content['cf_readonly']) { - $readonlys['cf_name'] = true; - } - if ($content['cf_type'] === 'serial') - { - $readonlys['cf_values'] = true; // only allow to set start-value, but not change it after + $content['cf_readonly'] = explode(',',$content['cf_readonly']); } if (!isset($GLOBALS['egw_info']['apps'][$content['cf_type']]) || $content['cf_type'] === 'filemanager') { $content['cf_values'] = json_decode($content['cf_values'], true); } + if ($_GET['action'] ?? null === 'copy') + { + unset($content['cf_id'], $cf_id); + $content['cf_name'] = lang('Copy of').' '.$content['cf_name']; + $content['cf_order'] += 5; // behind copied field + $readonlys['button[delete]'] = true; + } + else + { + if($content['cf_name']) + { + $readonlys['cf_name'] = true; + } + if ($content['cf_type'] === 'serial') + { + $readonlys['cf_values'] = true; // only allow to set start-value, but not change it after + } + } } else { @@ -572,6 +585,13 @@ class admin_customfields 'group' => $group=1, 'disableClass' => 'th', ), + 'copy' => array( + 'caption' => 'Copy', + 'allowOnMultiple' => false, + 'url' => 'menuaction='.$edit.'&cf_id=$id&use_private='.$this->use_private.'&action=copy', + 'popup' => '500x380', + 'group' => $group, + ), 'add' => array( 'caption' => 'Add', 'url' => 'menuaction='.$edit.'&appname='.$this->appname.'&use_private='.$this->use_private, diff --git a/admin/lang/egw_de.lang b/admin/lang/egw_de.lang index 073550e4ae..0fdc4d2b0b 100644 --- a/admin/lang/egw_de.lang +++ b/admin/lang/egw_de.lang @@ -244,6 +244,7 @@ connection is not secure! everyone can read eg. your credentials. admin de Die V continue admin de Weiter cookie domain (default empty means use full domain name, for sitemgr eg. ".domain.com" allows to use the same cookie for egw.domain.com and www.domain.com) admin de Cookie Domain