X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Ftemplates%2Freports.tpl;h=a70a3f0727699bacf94ae9d610dd72c77cf7cfb8;hb=2bd9983978cf8d6263e27a531aeb33f365667e37;hp=7e4c90bdc7a89d0446ff895e987c7a73d8575739;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 7e4c90bd..a70a3f07 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -27,7 +27,7 @@ var idx = 0; idx++; {/foreach} - + // empty_label is the mandatory top option in the tasks dropdown. empty_label = '{$i18n.dropdown.all|escape:'javascript'}'; @@ -35,13 +35,13 @@ empty_label = '{$i18n.dropdown.all|escape:'javascript'}'; function inArray(needle, haystack) { var length = haystack.length; for(var i = 0; i < length; i++) { - if(haystack[i] == needle) return true; + if(haystack[i] == needle) return true; } return false; } - + // The fillTaskDropdown function populates the task combo box with -// tasks associated with a selected project_id. +// tasks associated with a selected project_id. function fillTaskDropdown(project_id) { var str_task_ids; // Get a string of comma-separated task ids. @@ -53,11 +53,11 @@ function fillTaskDropdown(project_id) { var task_ids = new Array(); // Array of task ids. task_ids = str_task_ids.split(","); } - + var dropdown = document.getElementById("task"); // Determine previously selected item. var selected_item = dropdown.options[dropdown.selectedIndex].value; - + // Remove existing content. dropdown.length = 0; // Add mandatory top option. @@ -77,7 +77,7 @@ function fillTaskDropdown(project_id) { dropdown.options[dropdown_idx+1] = new Option(task_names[i][1], task_names[i][0]); dropdown_idx++; } - } + } } // If a previously selected item is still in dropdown - select it. @@ -95,14 +95,14 @@ var assigned_projects = new Array(); {if $assigned_projects} {foreach $assigned_projects as $user_id => $projects} assigned_projects[{$user_id}] = new Array(); - {if $projects} - {foreach $projects as $idx => $project_id} - assigned_projects[{$user_id}][{$idx}] = {$project_id}; - {/foreach} + {if $projects} + {foreach $projects as $idx => $project_id} + assigned_projects[{$user_id}][{$idx}] = {$project_id}; + {/foreach} {/if} {/foreach} {/if} - + // selectAssignedUsers is called when a project is changed in project dropdown. // It selects users on the form who are assigned to this project. function selectAssignedUsers(project_id) { @@ -139,17 +139,17 @@ function selectAssignedUsers(project_id) { function handleCheckboxes() { var totalsOnlyCheckbox = document.getElementById("chtotalsonly"); if ("no_grouping" == document.getElementById("group_by").value) { - // Unmark and disable the "Totals only" checkbox. + // Unmark and disable the "Totals only" checkbox. totalsOnlyCheckbox.checked = false; totalsOnlyCheckbox.disabled = true; } else - totalsOnlyCheckbox.disabled = false; + totalsOnlyCheckbox.disabled = false; } {$forms.reportForm.open}
- +
@@ -167,9 +167,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} @@ -179,13 +179,13 @@ function handleCheckboxes() { {/if} -{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} +{if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} {if ($smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} - {/if} + {/if} {/if} {if ($smarty.const.MODE_PROJECTS == $user->tracking_mode || $smarty.const.MODE_PROJECTS_AND_TASKS == $user->tracking_mode)} @@ -197,19 +197,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->canManageTeam() || $user->isClient()} +{if ($user->can('manage_invoices') && $user->isPluginEnabled('ps'))} + + + + + + +{/if} +{if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()} @@ -236,32 +248,38 @@ function handleCheckboxes() {
{$i18n.label.client} {$i18n.label.client}  {$i18n.label.option} 
{$forms.reportForm.option.control}
{$i18n.label.project}  {$i18n.label.task}
{$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} +{/if} -{if ((($user->canManageTeam() || $user->isClient()) || in_array('ex', explode(',', $user->plugins))) && defined('COST_ON_REPORTS') && isTrue($smarty.const.COST_ON_REPORTS))} +{if ($user->can('manage_invoices') || $user->isClient()) || $user->isPluginEnabled('ex')} {else} {/if} - - + + {if ($custom_fields && $custom_fields->fields[0])} - + {else} {/if} @@ -276,9 +294,9 @@ function handleCheckboxes() {
{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.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.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} {$forms.reportForm.group_by.control}
- +
- +
@@ -298,4 +316,4 @@ function handleCheckboxes() {
-{$forms.reportForm.close} \ No newline at end of file +{$forms.reportForm.close}