Skip to content

Commit 5ef7bb3

Browse files
committed
update backward compatibility code
1 parent 5899424 commit 5ef7bb3

File tree

1 file changed

+8
-35
lines changed

1 file changed

+8
-35
lines changed

Plugin.php

Lines changed: 8 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -45,40 +45,13 @@ public function initialize()
4545
$this->helper->register('smallAvatarHelperExtend', '\Kanboard\Plugin\Group_assign\Helper\SmallAvatarHelperExtend');
4646

4747

48-
//Models
49-
if (function_exists('\Schema\version_132') && DB_DRIVER == 'mysql') {
50-
$this->container['taskFinderModel'] = $this->container->factory(function ($c) {
51-
return new NewTaskFinderModel($c);
52-
});
53-
$this->container['taskDuplicationModel'] = $this->container->factory(function ($c) {
54-
return new GroupAssignTaskDuplicationModel($c);
55-
});
56-
$this->container['taskProjectDuplicationModel '] = $this->container->factory(function ($c) {
57-
return new TaskProjectDuplicationModel ($c);
58-
});
59-
$this->container['taskProjectMoveModel '] = $this->container->factory(function ($c) {
60-
return new TaskProjectMoveModel ($c);
61-
});
62-
$this->container['taskRecurrenceModel '] = $this->container->factory(function ($c) {
63-
return new TaskRecurrenceModel ($c);
64-
});
65-
} else if (function_exists('\Schema\version_119') && DB_DRIVER == 'sqlite') {
66-
$this->container['taskFinderModel'] = $this->container->factory(function ($c) {
67-
return new NewTaskFinderModel($c);
68-
});
69-
$this->container['taskDuplicationModel'] = $this->container->factory(function ($c) {
70-
return new GroupAssignTaskDuplicationModel($c);
71-
});
72-
$this->container['taskProjectDuplicationModel '] = $this->container->factory(function ($c) {
73-
return new TaskProjectDuplicationModel ($c);
74-
});
75-
$this->container['taskProjectMoveModel '] = $this->container->factory(function ($c) {
76-
return new TaskProjectMoveModel ($c);
77-
});
78-
$this->container['taskRecurrenceModel '] = $this->container->factory(function ($c) {
79-
return new TaskRecurrenceModel ($c);
80-
});
81-
} else if (function_exists('\Schema\version_110') && DB_DRIVER == 'postgres') {
48+
//Models and backward compatibility
49+
50+
$applications_version = str_replace('v', '', APP_VERSION);
51+
if (strpos(APP_VERSION, 'master') !== false && file_exists('ChangeLog')) { $applications_version = trim(file_get_contents('ChangeLog', false, null, 8, 6), ' '); }
52+
$clean_appversion = preg_replace('/\s+/', '', $applications_version);
53+
54+
if (version_compare($clean_appversion, '1.2.5', '>')) {
8255
$this->container['taskFinderModel'] = $this->container->factory(function ($c) {
8356
return new NewTaskFinderModel($c);
8457
});
@@ -196,7 +169,7 @@ public function getPluginAuthor()
196169
}
197170
public function getPluginVersion()
198171
{
199-
return '1.7.6';
172+
return '1.7.7';
200173
}
201174
public function getPluginHomepage()
202175
{

0 commit comments

Comments
 (0)