diff --git a/admin/inc/class.admin_customfields.inc.php b/admin/inc/class.admin_customfields.inc.php index daf8453629..79e3209492 100644 --- a/admin/inc/class.admin_customfields.inc.php +++ b/admin/inc/class.admin_customfields.inc.php @@ -239,7 +239,7 @@ class admin_customfields } $this->types2[$type] = $entry['name']; } - $sel_options['types'] = $sel_options['cf_type2'] = $this->types2; + $sel_options['types'] = $sel_options['cf_type2'] = ['~~all~~' => lang('All')]+$this->types2; $content['type_template'] = $this->appname . '.admin.types'; $content['content_types']['appname'] = $this->appname; @@ -756,8 +756,25 @@ class admin_customfields $rows = array(); $query['col_filter']['cf_app'] = $query['appname']; + if (!empty($t2=$query['col_filter']['cf_type2'])) + { + if ($t2 === '~~all~~') + { + $query['col_filter'][0] = 'cf_type2 IS NULL'; + } + else + { + $query['col_filter'][0] = '(cf_type2 IS NULL OR cf_type2='.$GLOBALS['egw']->db->quote($t2).')'; + } + unset($query['col_filter']['cf_type2']); + } $total = $this->so->get_rows($query, $rows, $readonlys); unset($query['col_filter']['cf_app']); + if (isset($t2)) + { + unset($query['col_filter'][0]); + $query['col_filter']['cf_type2'] = $t2; + } foreach($rows as &$row) { diff --git a/admin/templates/default/customfield_edit.xet b/admin/templates/default/customfield_edit.xet index f900f2700b..e22e0ee527 100644 --- a/admin/templates/default/customfield_edit.xet +++ b/admin/templates/default/customfield_edit.xet @@ -12,7 +12,7 @@ - + @@ -33,7 +33,7 @@ - + diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 88f7656520..f53e1f1659 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -2010,7 +2010,7 @@ class infolog_ui } } // on a type-change, set the status to the default status of that type, if the actual status is not supported by the new type - if (!array_key_exists($content['info_status'],$this->bo->status[$content['info_type']])) + if (!array_key_exists($content['info_status'],$this->bo->status[$content['info_type']] ?? [])) { $content['info_status'] = $this->bo->status['defaults'][$content['info_type']]; // Make sure we don't end up with invalid status / percent combinations