@@ -208,8 +208,8 @@ |
||
| 208 | 208 | foreach ($course->enrollments as $enrollment) { |
| 209 | 209 | // if a student has no attendance record for the class (event) |
| 210 | 210 | $hasNotAttended = $course->attendance->where('student_id', $enrollment->student_id) |
| 211 | - ->where('event_id', $event->id) |
|
| 212 | - ->isEmpty(); |
|
| 211 | + ->where('event_id', $event->id) |
|
| 212 | + ->isEmpty(); |
|
| 213 | 213 | |
| 214 | 214 | // count one and break loop |
| 215 | 215 | if ($hasNotAttended) { |
@@ -136,8 +136,8 @@ |
||
| 136 | 136 | }); |
| 137 | 137 | }); |
| 138 | 138 | }, |
| 139 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 140 | - }); |
|
| 139 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 140 | + }); |
|
| 141 | 141 | |
| 142 | 142 | CRUD::addFilter([ // select2_multiple filter |
| 143 | 143 | 'name' => 'notenrolled', |
@@ -75,20 +75,20 @@ |
||
| 75 | 75 | }, function ($value) { // if the filter is active |
| 76 | 76 | CRUD::addClause('where', 'teacher_id', $value); |
| 77 | 77 | }, |
| 78 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 79 | - }); |
|
| 78 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 79 | + }); |
|
| 80 | 80 | |
| 81 | 81 | CRUD::addFilter([ // daterange filter |
| 82 | 82 | 'type' => 'date_range', |
| 83 | 83 | 'name' => 'from_to', |
| 84 | 84 | 'label'=> __('Date range'), |
| 85 | 85 | ], |
| 86 | - false, |
|
| 87 | - function ($value) { // if the filter is active, apply these constraints |
|
| 88 | - $dates = json_decode($value); |
|
| 89 | - CRUD::addClause('where', 'date', '>=', $dates->from); |
|
| 90 | - CRUD::addClause('where', 'date', '<=', $dates->to.' 23:59:59'); |
|
| 91 | - }); |
|
| 86 | + false, |
|
| 87 | + function ($value) { // if the filter is active, apply these constraints |
|
| 88 | + $dates = json_decode($value); |
|
| 89 | + CRUD::addClause('where', 'date', '>=', $dates->from); |
|
| 90 | + CRUD::addClause('where', 'date', '<=', $dates->to.' 23:59:59'); |
|
| 91 | + }); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | protected function setupCreateOperation() |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | protected function mapWebRoutes() |
| 53 | 53 | { |
| 54 | 54 | Route::middleware('web') |
| 55 | - ->namespace($this->namespace) |
|
| 56 | - ->group(base_path('routes/web.php')); |
|
| 55 | + ->namespace($this->namespace) |
|
| 56 | + ->group(base_path('routes/web.php')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /** |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | protected function mapApiRoutes() |
| 67 | 67 | { |
| 68 | 68 | Route::prefix('api') |
| 69 | - ->middleware('api') |
|
| 70 | - ->namespace($this->namespace) |
|
| 71 | - ->group(base_path('routes/api.php')); |
|
| 69 | + ->middleware('api') |
|
| 70 | + ->namespace($this->namespace) |
|
| 71 | + ->group(base_path('routes/api.php')); |
|
| 72 | 72 | } |
| 73 | 73 | } |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | 'name' => 'action', |
| 93 | 93 | 'label'=> 'Action', |
| 94 | 94 | ], |
| 95 | - false, |
|
| 96 | - function () { // if the filter is active |
|
| 97 | - CRUD::addClause('where', 'action', true); |
|
| 98 | - }); |
|
| 95 | + false, |
|
| 96 | + function () { // if the filter is active |
|
| 97 | + CRUD::addClause('where', 'action', true); |
|
| 98 | + }); |
|
| 99 | 99 | |
| 100 | 100 | CRUD::addFilter([ // dropdown filter |
| 101 | 101 | 'name' => 'type', |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | ], function ($value) { // if the filter is active |
| 110 | 110 | CRUD::addClause('where', 'commentable_type', '=', $value); |
| 111 | 111 | }, |
| 112 | - function () { // if the filter is not active |
|
| 113 | - CRUD::addClause('where', 'commentable_type', '=', Student::class); |
|
| 114 | - $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
|
| 115 | - }); |
|
| 112 | + function () { // if the filter is not active |
|
| 113 | + CRUD::addClause('where', 'commentable_type', '=', Student::class); |
|
| 114 | + $this->crud->getRequest()->request->add(['commentable_type' => Student::class]); // to make the filter look active |
|
| 115 | + }); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | public function setupUpdateOperation() |
@@ -228,8 +228,8 @@ |
||
| 228 | 228 | $user = Student::where('id', $this->guard()->user()->id)->first(); |
| 229 | 229 | |
| 230 | 230 | $user |
| 231 | - ->addMedia($request->fileToUpload) |
|
| 232 | - ->toMediaCollection('profile-picture'); |
|
| 231 | + ->addMedia($request->fileToUpload) |
|
| 232 | + ->toMediaCollection('profile-picture'); |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // if the user has been selected for a forced update, move to the next step |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | // add photo |
| 170 | 170 | if($request->data['userPicture']) { |
| 171 | 171 | $student |
| 172 | - ->addMediaFromBase64($request->data['userPicture']) |
|
| 173 | - ->usingFileName('profilePicture.jpg') |
|
| 174 | - ->toMediaCollection('profile-picture'); |
|
| 172 | + ->addMediaFromBase64($request->data['userPicture']) |
|
| 173 | + ->usingFileName('profilePicture.jpg') |
|
| 174 | + ->toMediaCollection('profile-picture'); |
|
| 175 | 175 | |
| 176 | 176 | Log::info('Profile picture added to the student profile'); |
| 177 | 177 | } |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | CRUD::addClause('where', 'period_id', $value); |
| 240 | 240 | }, |
| 241 | 241 | function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
| 242 | - $period = \App\Models\Period::get_default_period()->id; |
|
| 243 | - CRUD::addClause('where', 'period_id', $period); |
|
| 244 | - $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
| 245 | - } |
|
| 242 | + $period = \App\Models\Period::get_default_period()->id; |
|
| 243 | + CRUD::addClause('where', 'period_id', $period); |
|
| 244 | + $this->crud->getRequest()->request->add(['period_id' => $period]); // to make the filter look active |
|
| 245 | + } |
|
| 246 | 246 | ); |
| 247 | 247 | |
| 248 | 248 | CRUD::addFilter( |
@@ -253,8 +253,8 @@ discard block |
||
| 253 | 253 | ], |
| 254 | 254 | false, |
| 255 | 255 | function () { |
| 256 | - CRUD::addClause('parent'); |
|
| 257 | - } |
|
| 256 | + CRUD::addClause('parent'); |
|
| 257 | + } |
|
| 258 | 258 | ); |
| 259 | 259 | |
| 260 | 260 | $this->crud->addFilter([ |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | 'type' => 'number' |
| 381 | 381 | ], $currency), |
| 382 | 382 | |
| 383 | - [ |
|
| 383 | + [ |
|
| 384 | 384 | 'name' => 'volume', // The db column name |
| 385 | 385 | 'label' => __('Presential volume'), // Table column heading |
| 386 | 386 | 'suffix' => 'h', |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'entity' => 'teacher', // the method that defines the relationship in your Model |
| 84 | 84 | 'attribute' => 'name', // foreign key attribute that is shown to user |
| 85 | 85 | 'model' => Teacher::class, // foreign key model |
| 86 | - 'searchLogic' => false, |
|
| 86 | + 'searchLogic' => false, |
|
| 87 | 87 | ], |
| 88 | 88 | |
| 89 | 89 | [ |
@@ -117,39 +117,39 @@ discard block |
||
| 117 | 117 | 'name' => 'from_to', |
| 118 | 118 | 'label'=> __('Date range'), |
| 119 | 119 | ], |
| 120 | - false, |
|
| 121 | - function ($value) { // if the filter is active, apply these constraints |
|
| 122 | - $dates = json_decode($value); |
|
| 123 | - |
|
| 124 | - if ($dates->from) { |
|
| 125 | - CRUD::addClause('where', 'start', '>=', $dates->from); |
|
| 126 | - } |
|
| 127 | - if ($dates->to) { |
|
| 128 | - CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59'); |
|
| 129 | - } |
|
| 130 | - }); |
|
| 120 | + false, |
|
| 121 | + function ($value) { // if the filter is active, apply these constraints |
|
| 122 | + $dates = json_decode($value); |
|
| 123 | + |
|
| 124 | + if ($dates->from) { |
|
| 125 | + CRUD::addClause('where', 'start', '>=', $dates->from); |
|
| 126 | + } |
|
| 127 | + if ($dates->to) { |
|
| 128 | + CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59'); |
|
| 129 | + } |
|
| 130 | + }); |
|
| 131 | 131 | |
| 132 | 132 | CRUD::addFilter([ |
| 133 | 133 | 'type' => 'simple', |
| 134 | 134 | 'name' => 'orphan', |
| 135 | 135 | 'label'=> __('Events with no course'), |
| 136 | 136 | ], |
| 137 | - false, |
|
| 138 | - function ($value) { // if the filter is active, apply these constraints |
|
| 139 | - $this->crud->query->where('course_id', null); |
|
| 140 | - }, |
|
| 141 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 142 | - }); |
|
| 137 | + false, |
|
| 138 | + function ($value) { // if the filter is active, apply these constraints |
|
| 139 | + $this->crud->query->where('course_id', null); |
|
| 140 | + }, |
|
| 141 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 142 | + }); |
|
| 143 | 143 | |
| 144 | 144 | CRUD::addFilter([ |
| 145 | 145 | 'type' => 'simple', |
| 146 | 146 | 'name' => 'unassigned', |
| 147 | 147 | 'label'=> __('Events with no teacher'), |
| 148 | 148 | ], |
| 149 | - false, |
|
| 150 | - function ($value) { // if the filter is active, apply these constraints |
|
| 151 | - $this->crud->query->where('teacher_id', null); |
|
| 152 | - }); |
|
| 149 | + false, |
|
| 150 | + function ($value) { // if the filter is active, apply these constraints |
|
| 151 | + $this->crud->query->where('teacher_id', null); |
|
| 152 | + }); |
|
| 153 | 153 | |
| 154 | 154 | CRUD::addFilter([ // select2 filter |
| 155 | 155 | 'name' => 'teacher_id', |
@@ -160,8 +160,8 @@ discard block |
||
| 160 | 160 | }, function ($value) { // if the filter is active |
| 161 | 161 | CRUD::addClause('where', 'teacher_id', $value); |
| 162 | 162 | }, |
| 163 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 164 | - }); |
|
| 163 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 164 | + }); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | public function store(Request $request) |