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

This commit is contained in:
Nathan Gray 2014-08-18 20:22:11 +00:00
parent 9bc4c4a38f
commit 64fbc7810f
2 changed files with 20 additions and 12 deletions

View File

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

View File

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