From 62827e6cf470449c117624058fb36ad94804bcc0 Mon Sep 17 00:00:00 2001 From: emkael Date: Tue, 5 May 2020 14:25:42 +0200 Subject: Time tracking related plugins --- plugins/TimeMachine/Template/analytic/sidebar.php | 46 ++++++++++ .../Template/analytic/spent_time_by_dates.php | 100 +++++++++++++++++++++ .../analytic/time_comparison_by_categories.php | 84 +++++++++++++++++ .../analytic/time_comparison_by_swimlane.php | 84 +++++++++++++++++ plugins/TimeMachine/Template/subtask/edit.php | 28 ++++++ plugins/TimeMachine/Template/subtask/menu.php | 21 +++++ 6 files changed, 363 insertions(+) create mode 100644 plugins/TimeMachine/Template/analytic/sidebar.php create mode 100644 plugins/TimeMachine/Template/analytic/spent_time_by_dates.php create mode 100644 plugins/TimeMachine/Template/analytic/time_comparison_by_categories.php create mode 100644 plugins/TimeMachine/Template/analytic/time_comparison_by_swimlane.php create mode 100644 plugins/TimeMachine/Template/subtask/edit.php create mode 100644 plugins/TimeMachine/Template/subtask/menu.php (limited to 'plugins/TimeMachine/Template') diff --git a/plugins/TimeMachine/Template/analytic/sidebar.php b/plugins/TimeMachine/Template/analytic/sidebar.php new file mode 100644 index 00000000..cc04bc1d --- /dev/null +++ b/plugins/TimeMachine/Template/analytic/sidebar.php @@ -0,0 +1,46 @@ + + +
  • app->checkMenuSelection('AnalyticsTimesController', 'timeComparisonBySwimlane') ?>> + modal->replaceLink( + t('Estimated vs actual time / Swimlanes'), + 'AnalyticsTimesController', + 'timeComparisonBySwimlane', + array( + 'plugin' => 'TimeMachine', + 'project_id' => $project['id'] + ) + ) + ?> +
  • +
  • app->checkMenuSelection('AnalyticsTimesController', 'timeComparisonByCategories') ?>> + modal->replaceLink( + t('Estimated vs actual time / Categories'), + 'AnalyticsTimesController', + 'timeComparisonByCategories', + array( + 'plugin' => 'TimeMachine', + 'project_id' => $project['id'] + ) + ) + ?> +
  • + +
  • app->checkMenuSelection('AnalyticsTimesController', 'timeComparisonByDates') ?>> + modal->replaceLink( + t('Spent time / Dates'), + 'AnalyticsTimesController', + 'timeComparisonByDates', + array( + 'plugin' => 'TimeMachine', + 'project_id' => $project['id'] + ) + ) + ?> +
  • \ No newline at end of file diff --git a/plugins/TimeMachine/Template/analytic/spent_time_by_dates.php b/plugins/TimeMachine/Template/analytic/spent_time_by_dates.php new file mode 100644 index 00000000..47fa657c --- /dev/null +++ b/plugins/TimeMachine/Template/analytic/spent_time_by_dates.php @@ -0,0 +1,100 @@ + + + + +
    + + $metric) : ?> + + + + + : format($userFormat) ?> -> format($userFormat) ?> + +
    + +
    + form->csrf() ?> + getTimestamp() ?> + getTimestamp() ?> + form->date(t('Start date'), 'from', $values) ?> + form->date(t('End date'), 'to', $values) ?> + modal->submitButtons(array('submitLabel' => t('Execute'))) ?> +
    + +

    + + isEmpty()): ?> +

    + isEmpty()): ?> + app->component('chart-project-analytics-spent-time-by-dates', array( + 'metrics' => $spentTime, + 'labelSpent' => t('Hours Spent'), + 'labelClosed' => t('Closed'), + 'labelOpen' => t('Open'), + )) ?> + + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + + + + +
    order(t('Id'), 'tasks.id') ?>order(t('Categories'), 'tasks.category_id') ?>order(t('Swimlane'), 'tasks.swimlane_id') ?>order(t('Title'), 'tasks.title') ?>order(t('Status'), 'tasks.is_active') ?>order(t('Hours Spent'), 'tasks.time_spent') ?>
    + url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + text->e($categories[$task['category_id']]) ?> + + text->e($swimlanes[$task['swimlane_id']]) ?> + + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + + + + + + + + + text->e($metrics[$task['id']][$isActive]['stt_time_spent']) ?> + + text->e($metrics[$task['id']][$isActive]['time_spent']) ?> +
    + + + diff --git a/plugins/TimeMachine/Template/analytic/time_comparison_by_categories.php b/plugins/TimeMachine/Template/analytic/time_comparison_by_categories.php new file mode 100644 index 00000000..fc838374 --- /dev/null +++ b/plugins/TimeMachine/Template/analytic/time_comparison_by_categories.php @@ -0,0 +1,84 @@ + + + + +
    + $metricByCategories) : ?> +

    + + +
    + + +

    + + isEmpty()): ?> +

    + isEmpty()): ?> + app->component('chart-project-analytics-time-comparison', array( + 'metrics' => $metrics, + 'labelSpent' => t('Hours Spent'), + 'labelEstimated' => t('Hours Estimated'), + 'labelClosed' => t('Closed'), + 'labelOpen' => t('Open'), + )) ?> + + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + +
    order(t('Id'), 'tasks.id') ?>order(t('Categories'), 'tasks.category_id') ?>order(t('Title'), 'tasks.title') ?>order(t('Status'), 'tasks.is_active') ?>order(t('Estimated Time'), 'tasks.time_estimated') ?>order(t('Actual Time'), 'tasks.time_spent') ?>
    + url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + text->e($categories[$task['category_id']]) ?> + + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + + + + + + + text->e($task['time_estimated']) ?> + + text->e($task['time_spent']) ?> +
    + + + + diff --git a/plugins/TimeMachine/Template/analytic/time_comparison_by_swimlane.php b/plugins/TimeMachine/Template/analytic/time_comparison_by_swimlane.php new file mode 100644 index 00000000..95fd7a41 --- /dev/null +++ b/plugins/TimeMachine/Template/analytic/time_comparison_by_swimlane.php @@ -0,0 +1,84 @@ + + + + +
    + $metricBySwimlane) : ?> +

    + + +
    + + +

    + + isEmpty()): ?> +

    + isEmpty()): ?> + app->component('chart-project-analytics-time-comparison', array( + 'metrics' => $metrics, + 'labelSpent' => t('Hours Spent'), + 'labelEstimated' => t('Hours Estimated'), + 'labelClosed' => t('Closed'), + 'labelOpen' => t('Open'), + )) ?> + + + + + + + + + + + getCollection() as $task): ?> + + + + + + + + + +
    order(t('Id'), 'tasks.id') ?>order(t('Swimlane'), 'tasks.swimlane_id') ?>order(t('Title'), 'tasks.title') ?>order(t('Status'), 'tasks.is_active') ?>order(t('Estimated Time'), 'tasks.time_estimated') ?>order(t('Actual Time'), 'tasks.time_spent') ?>
    + url->link('#'.$this->text->e($task['id']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + text->e($swimlanes[$task['swimlane_id']]) ?> + + url->link($this->text->e($task['title']), 'TaskViewController', 'show', array('task_id' => $task['id'], 'project_id' => $task['project_id']), false, '', t('View this task')) ?> + + + + + + + + text->e($task['time_estimated']) ?> + + text->e($task['time_spent']) ?> +
    + + + + diff --git a/plugins/TimeMachine/Template/subtask/edit.php b/plugins/TimeMachine/Template/subtask/edit.php new file mode 100644 index 00000000..7f20075c --- /dev/null +++ b/plugins/TimeMachine/Template/subtask/edit.php @@ -0,0 +1,28 @@ + + +
    + form->csrf() ?> + + subtask->renderTitleField($values, $errors, array('autofocus')) ?> + subtask->renderAssigneeField($users_list, $values, $errors) ?> + subtask->renderTimeEstimatedField($values, $errors) ?> + subtask->renderTimeSpentField($values, $errors) ?> +
    +

    Time Tracking details

    + $sttt) :?> + +
    + : + helper->form->datetime(t('Start Date'), 'start-'.$sttt['id'], $sttt, $errorsSttt) ?> + helper->form->datetime(t('End Date'), 'end-'.$sttt['id'], $sttt, $errorsSttt) ?> + / : +
    + +
    + + hook->render('template:subtask:form:edit', array('values' => $values, 'errors' => $errors)) ?> + + modal->submitButtons() ?> +
    diff --git a/plugins/TimeMachine/Template/subtask/menu.php b/plugins/TimeMachine/Template/subtask/menu.php new file mode 100644 index 00000000..5f8a41f8 --- /dev/null +++ b/plugins/TimeMachine/Template/subtask/menu.php @@ -0,0 +1,21 @@ + + \ No newline at end of file -- cgit v1.2.3