Hide total in columns
This commit is contained in:
17
Template/board/column_dropdown.php
Normal file
17
Template/board/column_dropdown.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php if ($this->FinanceHelper->isEnabled($column['project_id']) && $this->user->hasProjectAccess('ProjectEditController', 'edit', $column['project_id'])): ?>
|
||||
<?php /* Rendered here (outside the menu <ul>) by the only column-menu hook, then moved into the
|
||||
column's real dropdown <ul> by Asset/js/relocate.js so it sits next to the native
|
||||
entries. Hidden until relocated to avoid a flash in the header. */ ?>
|
||||
<?php $hidden = $this->FinanceHelper->isTotalHidden($column['project_id'], $column['id']); ?>
|
||||
<li class="financebuddy-menu-item" style="display: none;">
|
||||
<?= $this->url->link(
|
||||
$hidden
|
||||
? '<i class="fa fa-eye fa-fw"></i> '.t('Show column total')
|
||||
: '<i class="fa fa-eye-slash fa-fw"></i> '.t('Hide column total'),
|
||||
'FinanceColumnController',
|
||||
'toggleTotal',
|
||||
array('plugin' => 'FinanceBuddy', 'project_id' => $column['project_id'], 'column_id' => $column['id']),
|
||||
true
|
||||
) ?>
|
||||
</li>
|
||||
<?php endif ?>
|
||||
@@ -7,6 +7,11 @@ if (empty($column['project_id']) || ! $this->FinanceHelper->isEnabled($column['p
|
||||
return;
|
||||
}
|
||||
|
||||
// Per-column opt-out, toggled from the column dropdown menu.
|
||||
if ($this->FinanceHelper->isTotalHidden($column['project_id'], $column['id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$net = $this->FinanceHelper->columnNet($column);
|
||||
|
||||
if ($net > 0) {
|
||||
|
||||
Reference in New Issue
Block a user