31
31
32
32
class Plugin extends Base
33
33
{
34
-
35
34
public function initialize ()
36
35
{
37
- //Events & Changes
36
+ //Events & Changes
38
37
$ this ->template ->setTemplateOverride ('task/changes ' , 'group_assign:task/changes ' );
39
-
38
+
40
39
//Notifications
41
40
$ this ->container ['userNotificationFilterModel ' ] = $ this ->container ->factory (function ($ c ) {
42
41
return new NewUserNotificationFilterModel ($ c );
43
42
});
44
43
45
44
//Helpers
46
45
$ this ->helper ->register ('newTaskHelper ' , '\Kanboard\Plugin\Group_assign\Helper\NewTaskHelper ' );
47
- $ this ->helper ->register ('smallAvatarHelperExtend ' , '\Kanboard\Plugin\Group_assign\Helper\SmallAvatarHelperExtend ' );
48
-
49
-
46
+ $ this ->helper ->register ('sizeAvatarHelperExtend ' , '\Kanboard\Plugin\Group_assign\Helper\SizeAvatarHelperExtend ' );
47
+
48
+
50
49
//Models and backward compatibility
51
-
52
50
$ applications_version = str_replace ('v ' , '' , APP_VERSION );
53
51
if (strpos (APP_VERSION , 'master ' ) !== false && file_exists ('ChangeLog ' )) { $ applications_version = trim (file_get_contents ('ChangeLog ' , false , null , 8 , 6 ), ' ' ); }
54
52
$ clean_appversion = preg_replace ('/\s+/ ' , '' , $ applications_version );
55
-
53
+
56
54
if (version_compare ($ clean_appversion , '1.2.5 ' , '> ' )) {
57
55
if (file_exists ('plugins/MetaMagik ' )){
58
56
$ this ->container ['taskFinderModel ' ] = $ this ->container ->factory (function ($ c ) {
@@ -98,44 +96,49 @@ public function initialize()
98
96
return new TaskRecurrenceModel ($ c );
99
97
});
100
98
}
101
-
99
+
102
100
//Task - Template - details.php
103
101
$ this ->template ->hook ->attach ('template:task:details:third-column ' , 'group_assign:task/details ' );
104
102
$ this ->template ->hook ->attach ('template:task:details:third-column ' , 'group_assign:task/multi ' );
105
-
103
+
106
104
//Forms - task_creation.php and task_modification.php
107
105
$ this ->template ->setTemplateOverride ('task_creation/show ' , 'group_assign:task_creation/show ' );
108
106
$ this ->template ->setTemplateOverride ('task_modification/show ' , 'group_assign:task_modification/show ' );
109
-
107
+
110
108
//Board
111
109
$ this ->template ->hook ->attach ('template:board:private:task:before-title ' , 'group_assign:board/group ' );
112
- $ this ->template ->hook ->attach ('template:board:private:task:before-title ' , 'group_assign:board/multi ' );
110
+
111
+ if ($ this ->configModel ->get ('boardcustomizer_compactlayout ' , '' ) == 'enable ' ) {
112
+ $ this ->template ->hook ->attach ('template:board:private:task:before-avatar ' , 'group_assign:board/multi ' );
113
+ } else {
114
+ $ this ->template ->hook ->attach ('template:board:private:task:before-title ' , 'group_assign:board/multi ' );
115
+ }
113
116
$ groupmodel = $ this ->projectGroupRoleModel ;
114
117
$ this ->template ->hook ->attachCallable ('template:app:filters-helper:after ' , 'group_assign:board/filter ' , function ($ array = array ()) use ($ groupmodel ) {
115
118
if (!empty ($ array ) && $ array ['id ' ] >= 1 ){
116
119
return ['grouplist ' => array_column ($ groupmodel ->getGroups ($ array ['id ' ]), 'name ' )];
117
120
} else {
118
121
return ['grouplist ' => array ()];
119
122
}
120
- });
121
-
123
+ });
124
+
122
125
//Filter
123
126
$ this ->container ->extend ('taskLexer ' , function ($ taskLexer , $ c ) {
124
127
$ taskLexer ->withFilter (TaskAllAssigneeFilter::getInstance ()->setDatabase ($ c ['db ' ])
125
128
->setCurrentUserId ($ c ['userSession ' ]->getId ()));
126
129
return $ taskLexer ;
127
130
});
128
-
131
+
129
132
//Actions
130
133
$ this ->actionManager ->register (new EmailGroup ($ this ->container ));
131
134
$ this ->actionManager ->register (new EmailGroupDue ($ this ->container ));
132
135
$ this ->actionManager ->register (new EmailOtherAssignees ($ this ->container ));
133
136
$ this ->actionManager ->register (new EmailOtherAssigneesDue ($ this ->container ));
134
137
$ this ->actionManager ->register (new AssignGroup ($ this ->container ));
135
-
138
+
136
139
//Params
137
140
$ this ->template ->setTemplateOverride ('action_creation/params ' , 'group_assign:action_creation/params ' );
138
-
141
+
139
142
//CSS
140
143
$ this ->hook ->on ('template:layout:css ' , array ('template ' => 'plugins/Group_assign/Assets/css/group_assign.css ' ));
141
144
@@ -144,30 +147,30 @@ public function initialize()
144
147
145
148
//Calendar Events
146
149
$ container = $ this ->container ;
147
-
150
+
148
151
$ this ->hook ->on ('controller:calendar:user:events ' , function ($ user_id , $ start , $ end ) use ($ container ) {
149
152
$ model = new GroupAssignCalendarModel ($ container );
150
153
return $ model ->getUserCalendarEvents ($ user_id , $ start , $ end ); // Return new events
151
154
});
152
-
155
+
153
156
//Roles
154
157
155
158
$ this ->template ->hook ->attach ('template:config:application ' , 'group_assign:config/toggle ' );
156
-
157
- if ($ this ->configModel ->get ('enable_am_group_management ' , '2 ' ) == 1 ) {
159
+
160
+ if ($ this ->configModel ->get ('enable_am_group_management ' , '2 ' ) == 1 ) {
158
161
$ this ->applicationAccessMap ->add ('GroupListController ' , '* ' , Role::APP_MANAGER );
159
162
$ this ->applicationAccessMap ->add ('GroupCreationController ' , '* ' , Role::APP_MANAGER );
160
- $ this ->template ->setTemplateOverride ('header/user_dropdown ' , 'group_assign:header/user_dropdown ' );
163
+ $ this ->template ->setTemplateOverride ('header/user_dropdown ' , 'group_assign:header/user_dropdown ' );
161
164
}
162
165
163
166
164
167
}
165
-
168
+
166
169
public function onStartup ()
167
170
{
168
171
Translator::load ($ this ->languageModel ->getCurrentLanguage (), __DIR__ .'/Locale ' );
169
172
}
170
-
173
+
171
174
public function getClasses ()
172
175
{
173
176
return [
@@ -191,7 +194,7 @@ public function getPluginAuthor()
191
194
}
192
195
public function getPluginVersion ()
193
196
{
194
- return '1.7.11 ' ;
197
+ return '1.7.12 ' ;
195
198
}
196
199
public function getPluginHomepage ()
197
200
{
0 commit comments