├── assets └── css │ └── timetrackingeditor.css ├── Schema ├── Mysql.php ├── Postgres.php └── Sqlite.php ├── Test ├── PluginTest.php └── TimetrackingeditorTest.php ├── Filter ├── SubtaskIdFilter.php ├── SubtaskTasksFilter.php └── SubtaskTitleFilter.php ├── Console ├── AllSubtaskTimeTrackingExportCommand.php └── SubtaskTimeTrackingExportCommand.php ├── Template ├── menu.php ├── remove.php ├── stop.php ├── start.php ├── edit.php ├── create.php ├── time_tracking_editor.php └── subtask │ └── table.php ├── Formatter └── SubtaskAutoCompleteFormatter.php ├── Controller ├── SubtaskStatusController.php ├── SubtaskAjaxController.php └── TimeTrackingEditorController.php ├── Model ├── SubtaskTimeTrackingCreationModel.php ├── SubtaskTimeTrackingModel.php └── SubtaskTimeTrackingEditModel.php ├── README.md ├── Validator └── SubtaskTimeTrackingValidator.php ├── Plugin.php ├── Html.php └── Export └── SubtaskTimeTrackingExport.php /assets/css/timetrackingeditor.css: -------------------------------------------------------------------------------- 1 | .right { 2 | text-align: right; 3 | } 4 | -------------------------------------------------------------------------------- /Schema/Mysql.php: -------------------------------------------------------------------------------- 1 | exec("ALTER TABLE subtasks add time_billable INT default 0"); 10 | } 11 | 12 | function version_1($pdo) 13 | { 14 | $pdo->exec("ALTER TABLE subtask_time_tracking add comment TEXT"); 15 | $pdo->exec("ALTER TABLE subtask_time_tracking add is_billable TINYINT"); 16 | } 17 | -------------------------------------------------------------------------------- /Schema/Postgres.php: -------------------------------------------------------------------------------- 1 | exec("ALTER TABLE subtasks add time_billable INTEGER default 0"); 10 | } 11 | 12 | function version_1($pdo) 13 | { 14 | $pdo->exec("ALTER TABLE subtask_time_tracking add comment TEXT"); 15 | $pdo->exec("ALTER TABLE subtask_time_tracking add is_billable BOOLEAN"); 16 | } 17 | -------------------------------------------------------------------------------- /Schema/Sqlite.php: -------------------------------------------------------------------------------- 1 | exec("ALTER TABLE subtasks add time_billable NUMERIC default 0"); 10 | } 11 | 12 | function version_1($pdo) 13 | { 14 | $pdo->exec("ALTER TABLE subtask_time_tracking add comment TEXT"); 15 | $pdo->exec("ALTER TABLE subtask_time_tracking add is_billable INTEGER"); 16 | } 17 | -------------------------------------------------------------------------------- /Test/PluginTest.php: -------------------------------------------------------------------------------- 1 | container); 9 | $this->assertSame(null, $plugin->initialize()); 10 | $this->assertSame(null, $plugin->onStartup()); 11 | $this->assertNotEmpty($plugin->getPluginName()); 12 | $this->assertNotEmpty($plugin->getPluginDescription()); 13 | $this->assertNotEmpty($plugin->getPluginAuthor()); 14 | $this->assertNotEmpty($plugin->getPluginVersion()); 15 | $this->assertNotEmpty($plugin->getPluginHomepage()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Filter/SubtaskIdFilter.php: -------------------------------------------------------------------------------- 1 | query->eq(SubtaskModel::TABLE.'.id', $this->value); 37 | return $this; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Console/AllSubtaskTimeTrackingExportCommand.php: -------------------------------------------------------------------------------- 1 | setName('export:allsubtaskstimetracking') 18 | ->setDescription('Subtasks Time Tracking CSV export for all events'); 19 | } 20 | 21 | protected function execute(InputInterface $input, OutputInterface $output) 22 | { 23 | $data = $this->subtaskTimeTrackingExport->exportAll(); 24 | 25 | if (is_array($data)) { 26 | Html::output($data); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Template/menu.php: -------------------------------------------------------------------------------- 1 |
= t('There is nothing to show.') ?>
17 | 18 || = $subtask_paginator->order(t('User'), 'username') ?> | 21 |= $subtask_paginator->order(t('Subtask'), 'subtask_title') ?> | 22 |= $subtask_paginator->order(t('Start'), 'start') ?> | 23 |= $subtask_paginator->order(t('End'), 'end') ?> | 24 |= $subtask_paginator->order(t('Time spent'), \Kanboard\Model\SubtaskTimeTrackingModel::TABLE.'.time_spent') ?> | 25 |26 | |
|---|---|---|---|---|---|
| = $this->url->link($this->text->e($record['user_fullname'] ?: $record['username']), 'UserViewController', 'show', array('user_id' => $record['user_id'])) ?> 30 | 31 | 32 | 33 | = $this->app->tooltipMarkdown($record['comment']) ?> 34 | | 35 |= t($record['subtask_title']) ?> | 36 |= $this->dt->datetime($record['start']) ?> | 37 |= $this->dt->datetime($record['end']) ?> | 38 |= n($record['time_spent']).' '.t('hours') ?> | 39 |40 | user->isCurrentUser($record['user_id'])) { ?> 41 | = $this->render('timetrackingeditor:menu', array( 42 | 'task' => $task, 43 | 'subtask_id' => $record['subtask_id'], 44 | 'id' => $record['id'] 45 | )) ?> 46 | 47 | | 48 |
| = t('Title') ?> | 9 |= t('Assignee') ?> | 10 |= t('Time tracking') ?> | 11 | 12 |13 | | 14 | 15 | |
|---|---|---|---|---|
| 21 | 22 | 23 | = $this->subtask->renderToggleStatus($task, $subtask, "table") ?> 24 | 25 | = $this->subtask->getTitle($subtask) ?> 26 | 27 | | 28 |29 | 30 | = $this->text->e($subtask['name'] ?: $subtask['username']) ?> 31 | 32 | | 33 |
34 |
|
68 |
69 | 70 | = $this->render('subtask/menu', array( 71 | 'task' => $task, 72 | 'subtask' => $subtask, 73 | )) ?> 74 | | 75 |76 | = $this->modal->medium("clock-o", t('New'), 'TimeTrackingEditorController', 77 | 'create', array( 78 | 'plugin' => 'Timetrackingeditor', 79 | 'task_id' => $task['id'], 80 | 'project_id' => $task['project_id'], 81 | 'subtask_id' => $subtask['id'])) ?> 82 | | 83 | 84 | 85 |
| ".$value." | "); 134 | } 135 | fwrite($fp,"