summaryrefslogtreecommitdiff
path: root/plugins/Timetrackingeditor/Plugin.php
blob: f36403fb982fd96580d566751448b3cd8748e9de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php

namespace Kanboard\Plugin\Timetrackingeditor;

use Kanboard\Core\Translator;
use Kanboard\Core\Plugin\Base;
use Kanboard\Plugin\Timetrackingeditor\Helper\SubtaskHelper;
use Kanboard\Plugin\Timetrackingeditor\Model\SubtaskTimeTrackingModel;
use Kanboard\Plugin\Timetrackingeditor\Console\AllSubtaskTimeTrackingExportCommand;

class Plugin extends Base
{
    public function initialize()
    {
      $this->hook->on("template:layout:css", array("template" => "plugins/Timetrackingeditor/assets/css/timetrackingeditor.css"));
      $this->template->setTemplateOverride('task/time_tracking_details', 'timetrackingeditor:time_tracking_editor');
      $this->template->setTemplateOverride('subtask/table', 'timetrackingeditor:subtask/table');

      # $this->helper->register("subtask", "Kanboard\Plugin\Timetrackingeditor\Helper\SubtaskHelper");

      $this->container["cli"]->add(new AllSubtaskTimeTrackingExportCommand($this->container));
    }

    public function onStartup()
    {
        Translator::load($this->languageModel->getCurrentLanguage(), __DIR__.'/Locale');
    }

    public function getClasses()
    {
      return array(
        'Plugin\Timetrackingeditor\Model' => array(
            'SubtaskTimeTrackingCreationModel',
            'SubtaskTimeTrackingEditModel',
            'SubtaskTimeTrackingModel',
        ),
        'Plugin\Timetrackingeditor\Filter' => array(
          'SubtaskFilter',
          'SubtaskTaskFilter',
          'SubtaskTitleFilter'
        ),
        'Plugin\Timetrackingeditor\Console' => array(
          'AllSubtaskTimeTrackingExportCommand'
        ),
        'Plugin\Timetrackingeditor\Controller' => array(
          'SubtaskStatusController',
          'SubtaskAjaxController',
          'TimeTrackingEditorController'
        ),
        'Plugin\Timetrackingeditor\Export' => array(
          'SubtaskTimeTrackingExport'
        ),
        'Plugin\Timetrackingeditor\Validator' => array(
          'SubtaskTimeTrackingValidator'
        ),
        'Plugin\Timetrackingeditor\Formatter' => array(
          'SubtaskAutoCompleteFormatter'
        ),
      );
    }

    public function getPluginName()
    {
        return 'TimeTrackingEditor';
    }

    public function getPluginDescription()
    {
        return t('Allows Editing of TimeTracking Values');
    }

    public function getPluginAuthor()
    {
        return 'Thomas Stinner';
    }

    public function getPluginVersion()
    {
        return '1.0.21';
    }

    public function getPluginHomepage()
    {
        return 'https://github.com/stinnux/kanboard-timetrackingeditor';
    }

    public function getCompatibleVersion()
    {
	 return '>=1.2.4';
    }
}