mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 07:53:39 +01:00
* Add creation field to timesheet
This commit is contained in:
parent
78f4a6fb9e
commit
a23acf1dfa
@ -56,7 +56,7 @@ class timesheet_bo extends Api\Storage
|
||||
* @var array
|
||||
*/
|
||||
var $timestamps = array(
|
||||
'ts_start','ts_modified'
|
||||
'ts_start','ts_created', 'ts_modified'
|
||||
);
|
||||
/**
|
||||
* Start of today in user-time
|
||||
@ -527,7 +527,7 @@ class timesheet_bo extends Api\Storage
|
||||
parent::search($criteria,array(
|
||||
(string)$sum_ts_id[$type],"''","''","''",'MIN(ts_start)','SUM(ts_duration) AS ts_duration',
|
||||
($this->quantity_sum ? "SUM(ts_quantity) AS ts_quantity" : '0'),
|
||||
'0','NULL','0','0','0','0','0',"SUM($total_sql) AS ts_total"
|
||||
'0','NULL','0','0','0','0','0','0',"SUM($total_sql) AS ts_total"
|
||||
),'GROUP BY '.$sum_sql[$type],$sum_extra_cols,$wildcard,$empty,$op,'UNION',$filter,$join,$need_full_no_count);
|
||||
$sum_extra_cols[$type]{0} = '0';
|
||||
}
|
||||
@ -597,6 +597,10 @@ class timesheet_bo extends Api\Storage
|
||||
if (isset($new[$name]) && $new[$name] != $value) $changed[] = $name;
|
||||
}
|
||||
}
|
||||
if (!$this->data['ts_created'])
|
||||
{
|
||||
$this->data['ts_created'] = time();
|
||||
}
|
||||
if (isset($old) && !$changed)
|
||||
{
|
||||
return false;
|
||||
|
@ -27,7 +27,7 @@ class timesheet_egw_record implements importexport_iface_egw_record
|
||||
// Used in conversions
|
||||
static $types = array(
|
||||
'select-account' => array('ts_owner','ts_modifier'),
|
||||
'date-time' => array('ts_start', 'ts_modified'),
|
||||
'date-time' => array('ts_start', 'ts_created', 'ts_modified'),
|
||||
'select-cat' => array('cat_id'),
|
||||
'links' => array('pl_id'),
|
||||
'select' => array('ts_status'),
|
||||
|
@ -57,10 +57,7 @@ class timesheet_merge extends Api\Storage\Merge
|
||||
$this->parse_html_styles = Api\Storage\Customfields::use_html('timesheet');
|
||||
|
||||
$this->bo = new timesheet_bo();
|
||||
$this->date_fields += array(
|
||||
'ts_start',
|
||||
'ts_modified',
|
||||
);
|
||||
$this->date_fields += timesheet_egw_record::$types['date-time'];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -168,7 +165,11 @@ class timesheet_merge extends Api\Storage\Merge
|
||||
echo '<tr><td colspan="4"><h3>'.lang('Timesheet fields:')."</h3></td></tr>";
|
||||
|
||||
$n = 0;
|
||||
$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array('ts_total' => lang('total'));
|
||||
$fields = array('ts_id' => lang('Timesheet ID')) + $this->bo->field2label + array(
|
||||
'ts_total' => lang('total'),
|
||||
'ts_created' => lang('Created'),
|
||||
'ts_modified' => lang('Modified'),
|
||||
);
|
||||
foreach($fields as $name => $label)
|
||||
{
|
||||
if (in_array($name,array('pl_id','customfields'))) continue; // dont show them
|
||||
|
@ -19,7 +19,10 @@ class timesheet_wizard_export_csv extends importexport_wizard_basic_export_csv
|
||||
|
||||
// Field mapping
|
||||
$bo = new timesheet_bo();
|
||||
$this->export_fields = array('ts_id' => 'Timesheet ID') + $bo->field2label + array('ts_modified'=> 'Modified');
|
||||
$this->export_fields = array('ts_id' => 'Timesheet ID') + $bo->field2label + array(
|
||||
'ts_created' => 'Created',
|
||||
'ts_modified'=> 'Modified'
|
||||
);
|
||||
|
||||
// Custom fields
|
||||
unset($this->export_fields['customfields']);
|
||||
|
@ -17,7 +17,7 @@ if (!defined('TIMESHEET_APP'))
|
||||
}
|
||||
|
||||
$setup_info[TIMESHEET_APP]['name'] = TIMESHEET_APP;
|
||||
$setup_info[TIMESHEET_APP]['version'] = '16.1';
|
||||
$setup_info[TIMESHEET_APP]['version'] = '17.1';
|
||||
$setup_info[TIMESHEET_APP]['app_order'] = 5;
|
||||
$setup_info[TIMESHEET_APP]['tables'] = array('egw_timesheet','egw_timesheet_extra');
|
||||
$setup_info[TIMESHEET_APP]['enable'] = 1;
|
||||
|
@ -24,6 +24,7 @@ $phpgw_baseline = array(
|
||||
'ts_unitprice' => array('type' => 'float','precision' => '4','comment' => 'unitprice'),
|
||||
'cat_id' => array('type' => 'int','meta' => 'category','precision' => '4','default' => '0','comment' => 'category'),
|
||||
'ts_owner' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'owner of the timesheet'),
|
||||
'ts_created' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'Creation date of the timesheet'),
|
||||
'ts_modified' => array('type' => 'int','meta' => 'timestamp','precision' => '8','nullable' => False,'comment' => 'date modified ot the timesheet'),
|
||||
'ts_modifier' => array('type' => 'int','meta' => 'user','precision' => '4','nullable' => False,'comment' => 'account id of the last modifier'),
|
||||
'pl_id' => array('type' => 'int','precision' => '4','default' => '0','comment' => 'id of the linked project'),
|
||||
|
@ -131,3 +131,17 @@ function timesheet_upgrade14_1()
|
||||
{
|
||||
return $GLOBALS['setup_info']['timesheet']['currentver'] = '16.1';
|
||||
}
|
||||
|
||||
function timesheet_upgrade16_1()
|
||||
{
|
||||
$GLOBALS['egw_setup']->oProc->AddColumn('egw_timesheet','ts_created',array(
|
||||
'type' => 'int',
|
||||
'meta' => 'timestamp',
|
||||
'precision' => '8',
|
||||
'nullable' => False
|
||||
));
|
||||
// Initialize to start
|
||||
$GLOBALS['egw']->db->query('UPDATE egw_timesheet set ts_created = ts_start');
|
||||
|
||||
return $GLOBALS['setup_info']['timesheet']['currentver'] = '17.1';
|
||||
}
|
@ -134,10 +134,12 @@
|
||||
</row>
|
||||
<row class="dialogOperators">
|
||||
<description value="User" for="ts_owner"/>
|
||||
<menulist >
|
||||
<menupopup id="ts_owner" no_lang="1" class="et2_fullWidth"/>
|
||||
<hbox span="2" class="et2_fullWidth">
|
||||
<menulist>
|
||||
<menupopup id="ts_owner" no_lang="1"/>
|
||||
</menulist>
|
||||
<description/>
|
||||
<date-time id="ts_created" readonly="true" align="left"/>
|
||||
</hbox>
|
||||
<description value="Status" disabled="@no_ts_status"/>
|
||||
<menulist span="3">
|
||||
<menupopup statustext="select a status of the timesheet" id="ts_status" class="et2_fullWidth" empty_label="please select" disabled="@no_ts_status"/>
|
||||
@ -146,11 +148,12 @@
|
||||
</row>
|
||||
<row disabled="!@ts_modified" class="dialogOperators">
|
||||
<description value="Last modified"/>
|
||||
<hbox span="2" class="et2_fullWidth">
|
||||
<menulist>
|
||||
<menupopup type="select-account" id="ts_modifier" readonly="true"/>
|
||||
</menulist>
|
||||
<description/>
|
||||
<date-time id="ts_modified" readonly="true" align="left"/>
|
||||
</hbox>
|
||||
</row>
|
||||
<row class="dialogFooterToolbar">
|
||||
<hbox orient="0" span="all">
|
||||
|
@ -24,6 +24,7 @@
|
||||
<column width="60" disabled="@no_ts_unitprice"/>
|
||||
<column width="60" disabled="@no_ts_total"/>
|
||||
<column width="130" disabled="@no_owner_col"/>
|
||||
<column width="135"/>
|
||||
<column width="50"/>
|
||||
<column width="10%" disabled="@no_ts_status"/>
|
||||
<column width="15%"/>
|
||||
@ -65,6 +66,7 @@
|
||||
<textbox type="float" id="price" readonly="true" precision="2"/>
|
||||
</vbox>
|
||||
<nextmatch-filterheader id="ts_owner" no_lang="1" options="User" class="$cont[ownerClass]"/>
|
||||
<nextmatch-sortheader label="Created" id="ts_created"/>
|
||||
<nextmatch-sortheader label="ID" id="ts_id"/>
|
||||
<nextmatch-filterheader id="ts_status" options="Status"/>
|
||||
<nextmatch-customfields id="customfields"/>
|
||||
@ -86,6 +88,7 @@
|
||||
<menulist class="$cont[ownerClass]">
|
||||
<menupopup type="select-account" id="${row}[ts_owner]" readonly="true"/>
|
||||
</menulist>
|
||||
<date-time id="${row}[ts_created]" readonly="true"/>
|
||||
<description id="${row}[ts_id]"/>
|
||||
<menulist>
|
||||
<menupopup id="${row}[ts_status]" readonly="true"/>
|
||||
|
@ -91,6 +91,10 @@
|
||||
<menupopup id="ts_owner" no_lang="1" class="et2_fullWidth"/>
|
||||
</menulist>
|
||||
</row>
|
||||
<row>
|
||||
<description/>
|
||||
<date-time id="ts_created" readonly="true" align="left"/>
|
||||
</row>
|
||||
<row disabled="!@ts_modified">
|
||||
<description value="Last modified"/>
|
||||
<menulist>
|
||||
|
@ -73,6 +73,10 @@
|
||||
<menupopup id="ts_owner" no_lang="1" class="et2_fullWidth"/>
|
||||
</menulist>
|
||||
</row>
|
||||
<row>
|
||||
<description/>
|
||||
<date-time id="ts_created" readonly="true" align="left"/>
|
||||
</row>
|
||||
<row disabled="!@ts_modified">
|
||||
<description value="Last modified"/>
|
||||
<menulist>
|
||||
|
Loading…
Reference in New Issue
Block a user