@@ -69,7 +69,7 @@ |
||
69 | 69 | |
70 | 70 | $course = Course::with('evaluationType')->find($enrollment->course_id); |
71 | 71 | |
72 | - $skills = $course->skills->map(function ($skill, $key) use ($student_skills) { |
|
72 | + $skills = $course->skills->map(function($skill, $key) use ($student_skills) { |
|
73 | 73 | $skill['status'] = $student_skills->where('skill_id', $skill->id)->first()->skill_scale_id ?? null; |
74 | 74 | return $skill; |
75 | 75 | })->groupBy('skill_type_id'); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $this->crud->allowAccess(['showstudentphotoroster']); |
33 | 33 | $this->crud->setOperationSetting('setFromDb', true); |
34 | 34 | |
35 | - $this->crud->operation('showstudentphotoroster', function () { |
|
35 | + $this->crud->operation('showstudentphotoroster', function() { |
|
36 | 36 | $this->crud->loadDefaultOperationSettingsFromConfig(); |
37 | 37 | }); |
38 | 38 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | protected function setupListOperation() |
34 | 34 | { |
35 | 35 | CRUD::setColumns([ |
36 | - [ // skill type |
|
36 | + [// skill type |
|
37 | 37 | 'label' => 'Type', // Table column heading |
38 | 38 | 'type' => 'select', |
39 | 39 | 'name' => 'skill_type', // the method that defines the relationship in your Model |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | 'type' => 'text', |
47 | 47 | 'name' => 'name', |
48 | 48 | ], |
49 | - [ // skill level |
|
49 | + [// skill level |
|
50 | 50 | 'label' => 'Level', // Table column heading |
51 | 51 | 'type' => 'select', |
52 | 52 | 'name' => 'level', // the method that defines the relationship in your Model |
@@ -58,23 +58,23 @@ discard block |
||
58 | 58 | |
59 | 59 | CRUD::enableExportButtons(); |
60 | 60 | |
61 | - CRUD::addFilter([ // select2 filter |
|
61 | + CRUD::addFilter([// select2 filter |
|
62 | 62 | 'name' => 'level_id', |
63 | 63 | 'type' => 'select2', |
64 | 64 | 'label'=> 'Level', |
65 | - ], function () { |
|
65 | + ], function() { |
|
66 | 66 | return Level::all()->pluck('name', 'id')->toArray(); |
67 | - }, function ($value) { // if the filter is active |
|
67 | + }, function($value) { // if the filter is active |
|
68 | 68 | CRUD::addClause('where', 'level_id', $value); |
69 | 69 | }); |
70 | 70 | |
71 | - CRUD::addFilter([ // select2 filter |
|
71 | + CRUD::addFilter([// select2 filter |
|
72 | 72 | 'name' => 'skill_type_id', |
73 | 73 | 'type' => 'select2', |
74 | 74 | 'label'=> 'Type', |
75 | - ], function () { |
|
75 | + ], function() { |
|
76 | 76 | return SkillType::all()->pluck('name', 'id')->toArray(); |
77 | - }, function ($value) { // if the filter is active |
|
77 | + }, function($value) { // if the filter is active |
|
78 | 78 | CRUD::addClause('where', 'skill_type_id', $value); |
79 | 79 | }); |
80 | 80 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | CRUD::setValidation(StoreRequest::class); |
85 | 85 | CRUD::addFields([ |
86 | - [ // skill type |
|
86 | + [// skill type |
|
87 | 87 | 'label' => 'Type', // Table column heading |
88 | 88 | 'type' => 'select', |
89 | 89 | 'name' => 'skill_type_id', // the db column for the foreign key |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | 'type' => 'text', |
97 | 97 | 'name' => 'name', |
98 | 98 | ], |
99 | - [ // skill level |
|
99 | + [// skill level |
|
100 | 100 | 'label' => 'Level', // Table column heading |
101 | 101 | 'type' => 'select', |
102 | 102 | 'name' => 'level_id', // the db column for the foreign key |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'type' => "relationship", |
110 | 110 | 'name' => 'skill_type', // the method on your model that defines the relationship |
111 | 111 | 'ajax' => true, |
112 | - 'inline_create' => [ // specify the entity in singular |
|
112 | + 'inline_create' => [// specify the entity in singular |
|
113 | 113 | 'entity' => 'skilltype', // the entity in singular |
114 | 114 | // OPTIONALS |
115 | 115 | 'force_select' => true, // should the inline-created entry be immediately selected? |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | CRUD::addClause('internal'); |
57 | 57 | $permissions = backpack_user()->getAllPermissions(); |
58 | 58 | |
59 | - if (! $permissions->contains('name', 'courses.edit')) { |
|
59 | + if (!$permissions->contains('name', 'courses.edit')) { |
|
60 | 60 | CRUD::denyAccess(['update', 'create']); |
61 | 61 | } |
62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | |
67 | 67 | CRUD::addButtonFromView('line', 'children_badge', 'children_badge', 'beginning'); |
68 | 68 | |
69 | - if (! $permissions->contains('name', 'courses.delete')) { |
|
69 | + if (!$permissions->contains('name', 'courses.delete')) { |
|
70 | 70 | CRUD::denyAccess(['delete']); |
71 | 71 | } |
72 | 72 | |
@@ -188,13 +188,13 @@ discard block |
||
188 | 188 | 'name' => 'rhythm_id', |
189 | 189 | 'type' => 'select2', |
190 | 190 | 'label'=> __('Rhythm'), |
191 | - ], function () { |
|
191 | + ], function() { |
|
192 | 192 | return Rhythm::all()->pluck('name', 'id')->toArray(); |
193 | - }, function ($value) { |
|
193 | + }, function($value) { |
|
194 | 194 | // if the filter is active |
195 | 195 | CRUD::addClause('where', 'rhythm_id', $value); |
196 | 196 | }, |
197 | - function () { |
|
197 | + function() { |
|
198 | 198 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
199 | 199 | }); |
200 | 200 | |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | 'name' => 'teacher_id', |
203 | 203 | 'type' => 'select2', |
204 | 204 | 'label'=> __('Teacher'), |
205 | - ], function () { |
|
205 | + ], function() { |
|
206 | 206 | return Teacher::all()->pluck('name', 'id')->toArray(); |
207 | - }, function ($value) { |
|
207 | + }, function($value) { |
|
208 | 208 | // if the filter is active |
209 | 209 | CRUD::addClause('where', 'teacher_id', $value); |
210 | 210 | }, |
211 | - function () { |
|
211 | + function() { |
|
212 | 212 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
213 | 213 | }); |
214 | 214 | |
@@ -216,13 +216,13 @@ discard block |
||
216 | 216 | 'name' => 'level_id', |
217 | 217 | 'type' => 'select2', |
218 | 218 | 'label'=> __('Level'), |
219 | - ], function () { |
|
219 | + ], function() { |
|
220 | 220 | return Level::all()->pluck('name', 'id')->toArray(); |
221 | - }, function ($value) { |
|
221 | + }, function($value) { |
|
222 | 222 | // if the filter is active |
223 | 223 | CRUD::addClause('where', 'level_id', $value); |
224 | 224 | }, |
225 | - function () { |
|
225 | + function() { |
|
226 | 226 | // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
227 | 227 | }); |
228 | 228 | |
@@ -231,13 +231,13 @@ discard block |
||
231 | 231 | 'type' => 'select2', |
232 | 232 | 'label'=> __('Period'), |
233 | 233 | ], |
234 | - function () { |
|
234 | + function() { |
|
235 | 235 | return \App\Models\Period::all()->sortByDesc('id')->pluck('name', 'id')->toArray(); |
236 | 236 | }, |
237 | - function ($value) { // if the filter is active |
|
237 | + function($value) { // if the filter is active |
|
238 | 238 | CRUD::addClause('where', 'period_id', $value); |
239 | 239 | }, |
240 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
240 | + function() { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
241 | 241 | $period = \App\Models\Period::get_default_period()->id; |
242 | 242 | CRUD::addClause('where', 'period_id', $period); |
243 | 243 | $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | ); |
246 | 246 | |
247 | 247 | CRUD::addFilter( |
248 | - [ // add a "simple" filter called Draft |
|
248 | + [// add a "simple" filter called Draft |
|
249 | 249 | 'type' => 'simple', |
250 | 250 | 'name' => 'parent', |
251 | 251 | 'label'=> __('Hide Children Courses'), |
252 | 252 | ], |
253 | 253 | false, |
254 | - function () { |
|
254 | + function() { |
|
255 | 255 | CRUD::addClause('parent'); |
256 | 256 | } |
257 | 257 | ); |
@@ -262,10 +262,10 @@ discard block |
||
262 | 262 | 'label' => __('Start') |
263 | 263 | ], |
264 | 264 | false, |
265 | - function ($value) { // if the filter is active, apply these constraints |
|
265 | + function($value) { // if the filter is active, apply these constraints |
|
266 | 266 | $dates = json_decode($value); |
267 | 267 | $this->crud->addClause('where', 'start_date', '>=', $dates->from); |
268 | - $this->crud->addClause('where', 'start_date', '<=', $dates->to . ' 23:59:59'); |
|
268 | + $this->crud->addClause('where', 'start_date', '<=', $dates->to.' 23:59:59'); |
|
269 | 269 | }); |
270 | 270 | |
271 | 271 | $this->crud->addFilter([ |
@@ -274,10 +274,10 @@ discard block |
||
274 | 274 | 'label' => __('End') |
275 | 275 | ], |
276 | 276 | false, |
277 | - function ($value) { // if the filter is active, apply these constraints |
|
277 | + function($value) { // if the filter is active, apply these constraints |
|
278 | 278 | $dates = json_decode($value); |
279 | 279 | $this->crud->addClause('where', 'end_date', '>=', $dates->from); |
280 | - $this->crud->addClause('where', 'end_date', '<=', $dates->to . ' 23:59:59'); |
|
280 | + $this->crud->addClause('where', 'end_date', '<=', $dates->to.' 23:59:59'); |
|
281 | 281 | }); |
282 | 282 | } |
283 | 283 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | ], |
354 | 354 | |
355 | 355 | |
356 | - [ // repeatable |
|
356 | + [// repeatable |
|
357 | 357 | 'name' => 'sublevels', |
358 | 358 | 'label' => __('Course sublevels'), |
359 | 359 | 'type' => 'repeatable', |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | 'default' => Period::get_enrollments_period()->end, |
511 | 511 | ], |
512 | 512 | |
513 | - [ // repeatable |
|
513 | + [// repeatable |
|
514 | 514 | 'name' => 'times', |
515 | 515 | 'label' => __('Course Schedule'), |
516 | 516 | 'type' => 'repeatable', |
@@ -573,14 +573,14 @@ discard block |
||
573 | 573 | 'init_rows' => 0, // number of empty rows to be initialized, by default 1 |
574 | 574 | ], |
575 | 575 | |
576 | - [ // view |
|
576 | + [// view |
|
577 | 577 | 'name' => 'custom-ajax-button', |
578 | 578 | 'type' => 'view', |
579 | 579 | 'view' => 'courses/schedule-preset-alert', |
580 | 580 | 'tab' => __('Schedule'), |
581 | 581 | ], |
582 | 582 | |
583 | - [ // select_from_array |
|
583 | + [// select_from_array |
|
584 | 584 | 'name' => 'schedulepreset', |
585 | 585 | 'label' => __('Schedule Preset'), |
586 | 586 | 'type' => 'select_from_array', |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | } |
605 | 605 | |
606 | 606 | if ($this->crud->getCurrentEntry()->children->count() > 0) { |
607 | - CRUD::addField([ // view |
|
607 | + CRUD::addField([// view |
|
608 | 608 | 'name' => 'custom-ajax-button', |
609 | 609 | 'type' => 'view', |
610 | 610 | 'view' => 'courses/parent-course-alert' |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | } |
613 | 613 | |
614 | 614 | if ($this->crud->getCurrentEntry()->parent_course_id !== null) { |
615 | - CRUD::addField([ // view |
|
615 | + CRUD::addField([// view |
|
616 | 616 | 'name' => 'custom-ajax-button', |
617 | 617 | 'type' => 'view', |
618 | 618 | 'view' => 'courses/child-course-alert' |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | class EvaluationTypeCrudController extends CrudController |
16 | 16 | { |
17 | 17 | use ListOperation; |
18 | - use CreateOperation {store as traitStore;} |
|
19 | - use UpdateOperation {update as traitUpdate;} |
|
18 | + use CreateOperation {store as traitStore; } |
|
19 | + use UpdateOperation {update as traitUpdate; } |
|
20 | 20 | use DeleteOperation; |
21 | 21 | |
22 | 22 | public function setup() |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | CRUD::addField(['name' => 'name', 'label' => 'Name', 'type' => 'text']); |
37 | 37 | |
38 | - CRUD::addField([ // Select2Multiple = n-n relationship (with pivot table) |
|
38 | + CRUD::addField([// Select2Multiple = n-n relationship (with pivot table) |
|
39 | 39 | 'label' => __('Grade Types'), |
40 | 40 | 'type' => 'select2_multiple', |
41 | 41 | 'name' => 'gradeTypes', // the method that defines the relationship in your Model |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | 'select_all' => true, // show Select All and Clear buttons? |
49 | 49 | ]); |
50 | 50 | |
51 | - CRUD::addField([ // Select2Multiple = n-n relationship (with pivot table) |
|
51 | + CRUD::addField([// Select2Multiple = n-n relationship (with pivot table) |
|
52 | 52 | 'label' => __('Skills'), |
53 | 53 | 'type' => 'select2_multiple', |
54 | 54 | 'name' => 'skills', // the method that defines the relationship in your Model |
@@ -18,10 +18,9 @@ |
||
18 | 18 | public $lastname; |
19 | 19 | public $listId; |
20 | 20 | |
21 | - public function __construct(Student|Contact $user, $listId = null) |
|
21 | + public function __construct(Student | Contact $user, $listId = null) |
|
22 | 22 | { |
23 | - $listId = $listId ? $listId : |
|
24 | - $this->email = $user->email; |
|
23 | + $listId = $listId ? $listId : $this->email = $user->email; |
|
25 | 24 | $this->name = $user->firstname; |
26 | 25 | $this->lastname = $user->lastname; |
27 | 26 | $this->listId = $listId; |