Create & use a flag 'no_actions' to disable actions for sum rows

This commit is contained in:
Nathan Gray 2014-08-11 23:13:02 +00:00
parent 0fa3ad831b
commit cc04f0b89c
2 changed files with 20 additions and 12 deletions

View File

@ -634,20 +634,24 @@ var et2_dataview_controller = Class.extend({
var links = null;
// Get the action links if the links callback is set
if (this.self._linkCallback)
// Look for a flag in the row to avoid actions. Use for sums or extra header rows.
if(!_data.no_actions)
{
links = this.self._linkCallback.call(
this.self._context,
_data,
this.entry.idx,
this.entry.uid
);
}
// Get the action links if the links callback is set
if (this.self._linkCallback)
{
links = this.self._linkCallback.call(
this.self._context,
_data,
this.entry.idx,
this.entry.uid
);
}
// Register the row in the selection manager
this.self._selectionMgr.registerRow(this.entry.uid, this.entry.idx,
tr, links);
// Register the row in the selection manager
this.self._selectionMgr.registerRow(this.entry.uid, this.entry.idx,
tr, links);
}
// Invalidate the current row entry
this.entry.row.invalidate();

View File

@ -705,6 +705,10 @@ class timesheet_ui extends timesheet_bo
// Remove fake modified date, it breaks nextmatch checks
unset($row['ts_modified']);
// Set flag to avoid actions on these rows
$row['no_actions'] = true;
switch($row['ts_id'])
{
case 0: // day-sum