2323use Kanboard \Plugin \Group_assign \Model \TaskProjectDuplicationModel ;
2424use Kanboard \Plugin \Group_assign \Model \TaskProjectMoveModel ;
2525use Kanboard \Plugin \Group_assign \Model \TaskRecurrenceModel ;
26+ use Kanboard \Plugin \Group_assign \Model \NewMetaMagikSubquery ;
27+ use Kanboard \Plugin \Group_assign \Model \OldMetaMagikSubquery ;
2628use PicoDb \Table ;
2729use PicoDb \Database ;
2830use Kanboard \Core \Security \Role ;
@@ -52,9 +54,15 @@ public function initialize()
5254 $ clean_appversion = preg_replace ('/\s+/ ' , '' , $ applications_version );
5355
5456 if (version_compare ($ clean_appversion , '1.2.5 ' , '> ' )) {
55- $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
56- return new NewTaskFinderModel ($ c );
57- });
57+ if (file_exists ('plugins/MetaMagik ' )){
58+ $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
59+ return new NewMetaMagikSubquery ($ c );
60+ });
61+ } else {
62+ $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
63+ return new NewTaskFinderModel ($ c );
64+ });
65+ }
5866 $ this ->container ['taskDuplicationModel ' ] = $ this ->container ->factory (function ($ c ) {
5967 return new GroupAssignTaskDuplicationModel ($ c );
6068 });
@@ -68,9 +76,15 @@ public function initialize()
6876 return new TaskRecurrenceModel ($ c );
6977 });
7078 } else {
71- $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
72- return new OldTaskFinderModel ($ c );
73- });
79+ if (file_exists ('plugins/MetaMagik ' )){
80+ $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
81+ return new OldMetaMagikSubquery ($ c );
82+ });
83+ } else {
84+ $ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
85+ return new OldTaskFinderModel ($ c );
86+ });
87+ }
7488 $ this ->container ['taskDuplicationModel ' ] = $ this ->container ->factory (function ($ c ) {
7589 return new GroupAssignTaskDuplicationModel ($ c );
7690 });
@@ -169,7 +183,7 @@ public function getPluginAuthor()
169183 }
170184 public function getPluginVersion ()
171185 {
172- return '1.7.7 ' ;
186+ return '1.7.8 ' ;
173187 }
174188 public function getPluginHomepage ()
175189 {
0 commit comments