mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
- Fix custom type & status filters giving wrong results
- Fix changing type with a custom status could lead to an invalid status for the new type
This commit is contained in:
parent
296d39a83a
commit
c8478e0635
@ -752,6 +752,15 @@ class infolog_bo
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure status is still valid if the type changes
|
||||
if($old['info_type'] != $values['info_type'] && $values['info_status'])
|
||||
{
|
||||
if(!in_array($values['info_status'], array_keys($this->status[$values['info_type']])))
|
||||
{
|
||||
$values['info_status'] = $this->status['defaults'][$values['info_type']];
|
||||
}
|
||||
}
|
||||
if ($status_only && !$undelete) // make sure only status gets writen
|
||||
{
|
||||
$set_completed = !$values['info_datecompleted'] && // set date completed of finished job, only if its not already set
|
||||
@ -833,7 +842,7 @@ class infolog_bo
|
||||
$custom = egw_customfields::get('infolog');
|
||||
foreach($custom as $c_name => $c_field)
|
||||
{
|
||||
if($c_field['type2']) $type2 = explode(',',$c_field['type2']);
|
||||
if($c_field['type2']) $type2 = is_array($c_field['type2']) ? $c_field['type2'] : explode(',',$c_field['type2']);
|
||||
if($c_field['needed'] && (!$c_field['type2'] || $c_field['type2'] && in_array($values['info_type'],$type2)))
|
||||
{
|
||||
// Required custom field
|
||||
|
@ -405,7 +405,7 @@ class infolog_ui
|
||||
}
|
||||
// If status is not valid for selected type, clear status filter
|
||||
if($query['col_filter']['info_status'] && $query['col_filter']['info_status'] != 'deleted' &&
|
||||
!in_array($query['col_filter']['info_status'], $this->bo->status[$query['col_filter']['info_type']]))
|
||||
!in_array($query['col_filter']['info_status'], array_keys($this->bo->status[$query['col_filter']['info_type']])))
|
||||
{
|
||||
$query['col_filter']['info_status'] = '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user