X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=WEB-INF%2Ftemplates%2Freports.tpl;h=95b4a43642ed262ccce154f79b7eb957719b7911;hb=32e0397e34d3092eb2b89411ab97ee288f88038a;hp=ce804dc575fcdb601ce10cba3b7e6902a8f15257;hpb=61d8edb3db70bd197ed6b988727394633b0cecf9;p=timetracker.git diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index ce804dc5..95b4a436 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -133,17 +133,30 @@ function selectAssignedUsers(project_id) { } } -// handleCheckboxes - unmarks and disables the "Totals only" checkbox when -// "no grouping" is selected in the associated dropdown. -// In future we need to improve this function and hide not relevant elements completely. +// handleCheckboxes - unmarks and hides the "Totals only" checkbox when +// "no grouping" is selected in the associated group by dropdowns. function handleCheckboxes() { var totalsOnlyCheckbox = document.getElementById("chtotalsonly"); - if ("no_grouping" == document.getElementById("group_by").value) { - // Unmark and disable the "Totals only" checkbox. + var totalsOnlyLabel = document.getElementById("totals_only_label"); + var groupBy1 = document.getElementById("group_by1"); + var groupBy2 = document.getElementById("group_by2"); + var groupBy3 = document.getElementById("group_by3"); + var grouping = false; + if ((groupBy1 != null && "no_grouping" != groupBy1.value) || + (groupBy2 != null && "no_grouping" != groupBy2.value) || + (groupBy3 != null && "no_grouping" != groupBy3.value)) { + grouping = true; + } + if (grouping) { + // Show the "Totals only" checkbox. + totalsOnlyCheckbox.style.visibility = "visible"; + totalsOnlyLabel.style.visibility = "visible"; + } else { + // Unmark and hide the "Totals only" checkbox. totalsOnlyCheckbox.checked = false; - totalsOnlyCheckbox.disabled = true; - } else - totalsOnlyCheckbox.disabled = false; + totalsOnlyCheckbox.style.visibility = "hidden"; + totalsOnlyLabel.style.visibility = "hidden"; + } } @@ -201,15 +214,27 @@ function handleCheckboxes() {
{/if} - {if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')} + {if ($user->can('manage_invoices') || $user->isClient()) && $user->isPluginEnabled('iv')} | + {/if} + {if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))} + | + {/if} + {if $user->can('view_reports') || $user->can('view_all_reports')} + | {/if} | {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)}{/if} | {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}{/if} | -{if ((($user->canManageTeam() || $user->isClient()) || $user->isPluginEnabled('ex')) && defined('COST_ON_REPORTS') && isTrue($smarty.const.COST_ON_REPORTS))} +{if ($user->can('manage_invoices') || $user->isClient()) || $user->isPluginEnabled('ex')} | {else} | @@ -261,19 +292,32 @@ function handleCheckboxes() { | {if (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}{/if} | {if ($custom_fields && $custom_fields->fields[0])} - | + | {else} | {/if} +{if $user->isPluginEnabled('wu')} + |
+ | + | + | + |