X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Ftemplates%2Freports.tpl;h=95b4a43642ed262ccce154f79b7eb957719b7911;hb=f9e704d00a2d21b1a94332e088f78c22da03d37c;hp=696142bf4b25c88b7e0b094c52e9f5f7df103993;hpb=05e0f5266a2959a452adfcae9d53c9729d3a3668;p=timetracker.git diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 696142bf..95b4a436 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -133,23 +133,36 @@ 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"; + } } {$forms.reportForm.open}
- +
@@ -167,9 +180,9 @@ function handleCheckboxes() {
-{if ((in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id)) || ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN))} +{if (($user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)) || ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN))} - {if in_array('cl', explode(',', $user->plugins)) && !($user->isClient() && $user->client_id)}{else}{/if} + {if $user->isPluginEnabled('cl') && !($user->isClient() && $user->client_id)}{else}{/if} {if ($custom_fields && $custom_fields->fields[0] && $custom_fields->fields[0]['type'] == CustomFields::TYPE_DROPDOWN)}{else}{/if} @@ -197,19 +210,31 @@ function handleCheckboxes() { {/if} {/if} -{if in_array('iv', explode(',', $user->plugins))} +{if $user->isPluginEnabled('iv')} + {if $user->can('manage_invoices')} + {/if} + {if $user->can('manage_invoices')} + {/if} +{/if} +{if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))} + + + + + + {/if} -{if $user->canManageTeam() || $user->isClient()} +{if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()} @@ -236,13 +261,19 @@ function handleCheckboxes() { - + - + + + + + +
{$i18n.label.client} {$i18n.label.client}  {$i18n.label.option} 
{$i18n.form.time.billable}  {$i18n.label.invoice}
{$forms.reportForm.include_records.control}  {$forms.reportForm.invoice.control}
{$i18n.label.paid_status}
{$forms.reportForm.paid_status.control}
{$i18n.label.users}
-{if in_array('cl', explode(',', $user->plugins)) || in_array('iv', explode(',', $user->plugins))} +{if $user->can('view_reports') || $user->can('view_all_reports') || $user->isPluginEnabled('cl') || $user->isPluginEnabled('iv') || $user->isPluginEnabled('ps')} - {if in_array('cl', explode(',', $user->plugins))} + {if $user->isPluginEnabled('cl')} {/if} - {if ($user->canManageTeam() || $user->isClient()) && in_array('iv', explode(',', $user->plugins))} + {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} @@ -250,7 +281,7 @@ function handleCheckboxes() { -{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,24 +292,37 @@ function handleCheckboxes() { {if ($custom_fields && $custom_fields->fields[0])} - + {else} {/if} +{if $user->isPluginEnabled('wu')} + + + + + + +{/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 (($smarty.const.TYPE_START_FINISH == $user->record_type) || ($smarty.const.TYPE_ALL == $user->record_type))}{/if}
{$i18n.form.reports.group_by}{$i18n.form.reports.group_by}
{$forms.reportForm.group_by.control} {$forms.reportForm.group_by1.control}{$forms.reportForm.group_by2.control}{$forms.reportForm.group_by3.control}
- +