summaryrefslogtreecommitdiff
path: root/plugins/InternalID/Plugin.php
blob: 02c6adcaec9103eb6bd414d55766339362015553 (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
<?php

namespace Kanboard\Plugin\InternalID;

use Kanboard\Core\Plugin\Base;
use Kanboard\Core\Translator;

class Plugin extends Base
{
    public function initialize()
    {
        $queryHook = function($query) {
            $query
                ->addColumns(Model\InternalTaskIDModel::TABLE.'.internal_task_id')
                ->join(Model\InternalTaskIDModel::TABLE, 'id', 'id', $this->taskModel::TABLE);
            return $query;
        };
        $this->hook->on('task:query:extended', $queryHook);
    }

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

    public function getPluginName()
    {
        return 'Internal ID';
    }

    public function getPluginDescription()
    {
        return t('Internal (per-project) task numbers');
    }

    public function getPluginAuthor()
    {
        return 'mkl';
    }

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

    public function getPluginHomepage()
    {
        return 'https://kanban.intranet/';
    }

    public function getClasses() {
        return array(
            'Plugin\InternalID\Model' => array(
                'InternalTaskIDModel',
            )
        );
    }
}