Default timesheet history to on

This commit is contained in:
Nathan Gray 2012-10-23 16:59:14 +00:00
parent 2d3c11ab3c
commit e8318b2442
2 changed files with 35 additions and 7 deletions

View File

@ -158,7 +158,11 @@ class timesheet_ui extends timesheet_bo
break; break;
case 'undelete': case 'undelete':
if($content['ts_status'] == self::DELETED_STATUS) unset($content['ts_status']); if($content['ts_status'] == self::DELETED_STATUS)
{
unset($content['ts_status']);
$this->data['ts_status'] = '';
}
$button = 'apply'; $button = 'apply';
// fall through // fall through
case 'save': case 'save':
@ -385,10 +389,6 @@ class timesheet_ui extends timesheet_bo
), ),
); );
$sel_options['status'] = $this->field2label; $sel_options['status'] = $this->field2label;
if($this->config_data['history'])
{
$sel_options['status'][self::DELETED_STATUS] = 'Deleted';
}
// the actual title-blur is either the preserved title blur (if we are called from infolog entry), // the actual title-blur is either the preserved title blur (if we are called from infolog entry),
// or the preserved project-blur comming from the current selected project // or the preserved project-blur comming from the current selected project
@ -422,7 +422,7 @@ class timesheet_ui extends timesheet_bo
} }
$sel_options['ts_owner'] = $edit_grants; $sel_options['ts_owner'] = $edit_grants;
$sel_options['ts_status'] = $this->status_labels; $sel_options['ts_status'] = $this->status_labels;
if($this->config_data['history']) if($this->config_data['history'] && $content['ts_status'] == self::DELETED_STATUS)
{ {
$sel_options['ts_status'][self::DELETED_STATUS] = 'Deleted'; $sel_options['ts_status'][self::DELETED_STATUS] = 'Deleted';
} }
@ -786,7 +786,8 @@ class timesheet_ui extends timesheet_bo
if ($query['selectcols'] && strpos($query['selectcols'],'ts_unitprice')===false) $rows['no_ts_unitprice'] = 1; if ($query['selectcols'] && strpos($query['selectcols'],'ts_unitprice')===false) $rows['no_ts_unitprice'] = 1;
if ($query['selectcols'] && strpos($query['selectcols'],'ts_total')===false) $rows['no_ts_total'] = 1; if ($query['selectcols'] && strpos($query['selectcols'],'ts_total')===false) $rows['no_ts_total'] = 1;
} }
$rows['no_ts_status'] = strpos($query['selectcols'], 'ts_status') === false || $query['no_status']; $rows['no_ts_status'] = strpos($query['selectcols'], 'ts_status') === false && !$this->config_data['history'] ||
$query['no_status'];
return $total; return $total;
} }

View File

@ -0,0 +1,27 @@
<?php
/**
* TimeSheet - Default records
*
* @link http://www.egroupware.org
* @author Nathan Gray
* @package timesheet
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
*/
foreach(array(
'history' => 'history',
) as $name => $value)
{
$GLOBALS['egw_setup']->db->insert(
$GLOBALS['egw_setup']->config_table,
array(
'config_app' => 'timesheet',
'config_name' => $name,
'config_value' => $value,
),array(
'config_app' => 'timesheet',
'config_name' => $name,
),__LINE__,__FILE__
);
}