@@ -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) { |
@@ -163,9 +163,9 @@ |
||
| 163 | 163 | // add photo |
| 164 | 164 | |
| 165 | 165 | $student |
| 166 | - ->addMediaFromBase64($request->data['userPicture']) |
|
| 167 | - ->usingFileName('profilePicture.jpg') |
|
| 168 | - ->toMediaCollection('profile-picture'); |
|
| 166 | + ->addMediaFromBase64($request->data['userPicture']) |
|
| 167 | + ->usingFileName('profilePicture.jpg') |
|
| 168 | + ->toMediaCollection('profile-picture'); |
|
| 169 | 169 | |
| 170 | 170 | Log::info('Profile picture added to the student profile'); |
| 171 | 171 | |
@@ -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', |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $q->where('firstname', 'like', '%'.$searchTerm.'%') |
| 53 | 53 | ->orWhere('lastname', 'like', '%'.$searchTerm.'%') |
| 54 | 54 | ->orWhere('email', 'like', '%'.$searchTerm.'%') |
| 55 | - ->orWhere('idnumber', 'like', '%'.$searchTerm.'%'); |
|
| 55 | + ->orWhere('idnumber', 'like', '%'.$searchTerm.'%'); |
|
| 56 | 56 | }); |
| 57 | 57 | }); |
| 58 | 58 | }, |
@@ -86,20 +86,20 @@ discard block |
||
| 86 | 86 | 'name' => 'noresult', |
| 87 | 87 | 'label'=> __('No Result'), |
| 88 | 88 | ], |
| 89 | - false, |
|
| 90 | - function () { |
|
| 91 | - CRUD::addClause('noResult'); |
|
| 92 | - }); |
|
| 89 | + false, |
|
| 90 | + function () { |
|
| 91 | + CRUD::addClause('noResult'); |
|
| 92 | + }); |
|
| 93 | 93 | |
| 94 | 94 | CRUD::addFilter([ |
| 95 | 95 | 'type' => 'simple', |
| 96 | 96 | 'name' => 'hideparents', |
| 97 | 97 | 'label'=> __('Hide Parents'), |
| 98 | 98 | ], |
| 99 | - false, |
|
| 100 | - function () { |
|
| 101 | - CRUD::addClause('real'); |
|
| 102 | - }); |
|
| 99 | + false, |
|
| 100 | + function () { |
|
| 101 | + CRUD::addClause('real'); |
|
| 102 | + }); |
|
| 103 | 103 | |
| 104 | 104 | CRUD::addFilter([ |
| 105 | 105 | 'name' => 'period_id', |
@@ -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() |
@@ -110,39 +110,39 @@ discard block |
||
| 110 | 110 | 'name' => 'from_to', |
| 111 | 111 | 'label'=> __('Date range'), |
| 112 | 112 | ], |
| 113 | - false, |
|
| 114 | - function ($value) { // if the filter is active, apply these constraints |
|
| 115 | - $dates = json_decode($value); |
|
| 116 | - |
|
| 117 | - if ($dates->from) { |
|
| 118 | - CRUD::addClause('where', 'start', '>=', $dates->from); |
|
| 119 | - } |
|
| 120 | - if ($dates->to) { |
|
| 121 | - CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59'); |
|
| 122 | - } |
|
| 123 | - }); |
|
| 113 | + false, |
|
| 114 | + function ($value) { // if the filter is active, apply these constraints |
|
| 115 | + $dates = json_decode($value); |
|
| 116 | + |
|
| 117 | + if ($dates->from) { |
|
| 118 | + CRUD::addClause('where', 'start', '>=', $dates->from); |
|
| 119 | + } |
|
| 120 | + if ($dates->to) { |
|
| 121 | + CRUD::addClause('where', 'start', '<=', $dates->to.' 23:59:59'); |
|
| 122 | + } |
|
| 123 | + }); |
|
| 124 | 124 | |
| 125 | 125 | CRUD::addFilter([ |
| 126 | 126 | 'type' => 'simple', |
| 127 | 127 | 'name' => 'orphan', |
| 128 | 128 | 'label'=> __('Events with no course'), |
| 129 | 129 | ], |
| 130 | - false, |
|
| 131 | - function ($value) { // if the filter is active, apply these constraints |
|
| 132 | - $this->crud->query->where('course_id', null); |
|
| 133 | - }, |
|
| 134 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 135 | - }); |
|
| 130 | + false, |
|
| 131 | + function ($value) { // if the filter is active, apply these constraints |
|
| 132 | + $this->crud->query->where('course_id', null); |
|
| 133 | + }, |
|
| 134 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 135 | + }); |
|
| 136 | 136 | |
| 137 | 137 | CRUD::addFilter([ |
| 138 | 138 | 'type' => 'simple', |
| 139 | 139 | 'name' => 'unassigned', |
| 140 | 140 | 'label'=> __('Events with no teacher'), |
| 141 | 141 | ], |
| 142 | - false, |
|
| 143 | - function ($value) { // if the filter is active, apply these constraints |
|
| 144 | - $this->crud->query->where('teacher_id', null); |
|
| 145 | - }); |
|
| 142 | + false, |
|
| 143 | + function ($value) { // if the filter is active, apply these constraints |
|
| 144 | + $this->crud->query->where('teacher_id', null); |
|
| 145 | + }); |
|
| 146 | 146 | |
| 147 | 147 | CRUD::addFilter([ // select2 filter |
| 148 | 148 | 'name' => 'teacher_id', |
@@ -153,8 +153,8 @@ discard block |
||
| 153 | 153 | }, function ($value) { // if the filter is active |
| 154 | 154 | CRUD::addClause('where', 'teacher_id', $value); |
| 155 | 155 | }, |
| 156 | - function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 157 | - }); |
|
| 156 | + function () { // if the filter is NOT active (the GET parameter "checkbox" does not exit) |
|
| 157 | + }); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | public function store(Request $request) |
@@ -136,11 +136,11 @@ |
||
| 136 | 136 | ], function () { |
| 137 | 137 | return EnrollmentStatusType::all()->pluck('name', 'id')->toArray(); |
| 138 | 138 | }, |
| 139 | - function ($values) { // if the filter is active |
|
| 140 | - foreach (json_decode($values) as $key => $value) { |
|
| 141 | - CRUD::addClause('orWhere', 'status_id', $value); |
|
| 142 | - } |
|
| 143 | - }); |
|
| 139 | + function ($values) { // if the filter is active |
|
| 140 | + foreach (json_decode($values) as $key => $value) { |
|
| 141 | + CRUD::addClause('orWhere', 'status_id', $value); |
|
| 142 | + } |
|
| 143 | + }); |
|
| 144 | 144 | |
| 145 | 145 | CRUD::addFilter([ |
| 146 | 146 | 'name' => 'period_id', |
@@ -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() |