@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function register() |
53 | 53 | { |
54 | - $this->reportable(function (Throwable $e) { |
|
54 | + $this->reportable(function(Throwable $e) { |
|
55 | 55 | // |
56 | 56 | }); |
57 | 57 | |
58 | 58 | // Redirect to the login page |
59 | - $this->renderable(function (AuthenticationException $e) { |
|
59 | + $this->renderable(function(AuthenticationException $e) { |
|
60 | 60 | $jaxon = app()->make(Jaxon::class); |
61 | 61 | $jaxon->ajaxResponse()->redirect(route('login')); |
62 | 62 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | }); |
65 | 65 | |
66 | 66 | // Show the error message in a dialog |
67 | - $this->renderable(function (MessageException $e) { |
|
67 | + $this->renderable(function(MessageException $e) { |
|
68 | 68 | $jaxon = app()->make(Jaxon::class); |
69 | 69 | $ajaxResponse = $jaxon->ajaxResponse(); |
70 | 70 | $ajaxResponse->clearCommands(); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | private function getChargeTypes(int $group = -1) |
67 | 67 | { |
68 | - if($group < 0) |
|
68 | + if ($group < 0) |
|
69 | 69 | { |
70 | 70 | // All possible values |
71 | 71 | return [ |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | private function getChargePeriods(int $group = -1) |
87 | 87 | { |
88 | - if($group < 0) |
|
88 | + if ($group < 0) |
|
89 | 89 | { |
90 | 90 | // All possible values |
91 | 91 | return [ |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'title' => trans('common.actions.cancel'), |
145 | 145 | 'class' => 'btn btn-tertiary', |
146 | 146 | 'click' => 'close', |
147 | - ],[ |
|
147 | + ], [ |
|
148 | 148 | 'title' => trans('common.actions.add'), |
149 | 149 | 'class' => 'btn btn-primary', |
150 | 150 | 'click' => $this->rq()->add($group), |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | 'title' => trans('common.actions.cancel'), |
177 | 177 | 'class' => 'btn btn-tertiary', |
178 | 178 | 'click' => 'close', |
179 | - ],[ |
|
179 | + ], [ |
|
180 | 180 | 'title' => trans('common.actions.save'), |
181 | 181 | 'class' => 'btn btn-primary', |
182 | 182 | 'click' => $this->rq()->create($group, pm()->form('charge-form')), |
@@ -191,19 +191,19 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function create(int $group, array $formValues) |
193 | 193 | { |
194 | - if($group !== self::GROUP_FIXED && $group !== self::GROUP_VARIABLE) |
|
194 | + if ($group !== self::GROUP_FIXED && $group !== self::GROUP_VARIABLE) |
|
195 | 195 | { |
196 | 196 | $this->response; |
197 | 197 | } |
198 | 198 | // Set the missing field in each item of the charge array. |
199 | - if($group === self::GROUP_FIXED) // Fixed charge |
|
199 | + if ($group === self::GROUP_FIXED) // Fixed charge |
|
200 | 200 | { |
201 | 201 | $formValues['type'] = ChargeModel::TYPE_FEE; |
202 | 202 | } |
203 | - if($group === self::GROUP_VARIABLE) // Variable charge |
|
203 | + if ($group === self::GROUP_VARIABLE) // Variable charge |
|
204 | 204 | { |
205 | 205 | $formValues['period'] = ChargeModel::PERIOD_NONE; |
206 | - if(empty($formValues['fixed'])) |
|
206 | + if (empty($formValues['fixed'])) |
|
207 | 207 | { |
208 | 208 | $formValues['amount'] = 0; |
209 | 209 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | 'title' => trans('common.actions.cancel'), |
239 | 239 | 'class' => 'btn btn-tertiary', |
240 | 240 | 'click' => 'close', |
241 | - ],[ |
|
241 | + ], [ |
|
242 | 242 | 'title' => trans('common.actions.save'), |
243 | 243 | 'class' => 'btn btn-primary', |
244 | 244 | 'click' => $this->rq()->update($charge->id, pm()->form('charge-form')), |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | // These fields cannot be changed |
259 | 259 | $formValues['type'] = $charge->type; |
260 | 260 | $formValues['period'] = $charge->period; |
261 | - if(empty($formValues['fixed'])) |
|
261 | + if (empty($formValues['fixed'])) |
|
262 | 262 | { |
263 | 263 | $formValues['amount'] = 0; |
264 | 264 | } |
@@ -196,13 +196,17 @@ |
||
196 | 196 | $this->response; |
197 | 197 | } |
198 | 198 | // Set the missing field in each item of the charge array. |
199 | - if($group === self::GROUP_FIXED) // Fixed charge |
|
199 | + if($group === self::GROUP_FIXED) { |
|
200 | + // Fixed charge |
|
200 | 201 | { |
201 | 202 | $formValues['type'] = ChargeModel::TYPE_FEE; |
202 | 203 | } |
203 | - if($group === self::GROUP_VARIABLE) // Variable charge |
|
204 | + } |
|
205 | + if($group === self::GROUP_VARIABLE) { |
|
206 | + // Variable charge |
|
204 | 207 | { |
205 | 208 | $formValues['period'] = ChargeModel::PERIOD_NONE; |
209 | + } |
|
206 | 210 | if(empty($formValues['fixed'])) |
207 | 211 | { |
208 | 212 | $formValues['amount'] = 0; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | 'title' => trans('common.actions.cancel'), |
104 | 104 | 'class' => 'btn btn-tertiary', |
105 | 105 | 'click' => 'close', |
106 | - ],[ |
|
106 | + ], [ |
|
107 | 107 | 'title' => trans('common.actions.save'), |
108 | 108 | 'class' => 'btn btn-primary', |
109 | 109 | 'click' => $this->rq()->create(pm()->form('round-form')), |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | 'title' => trans('common.actions.cancel'), |
135 | 135 | 'class' => 'btn btn-tertiary', |
136 | 136 | 'click' => 'close', |
137 | - ],[ |
|
137 | + ], [ |
|
138 | 138 | 'title' => trans('common.actions.save'), |
139 | 139 | 'class' => 'btn btn-primary', |
140 | 140 | 'click' => $this->rq()->update($round->id, pm()->form('round-form')), |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $this->response->html('section-title', trans('tontine.menus.tontines')); |
62 | 62 | $this->response->html('content-home', $this->view()->render('tontine.pages.tontine.home')); |
63 | 63 | |
64 | - if(($tontine = $this->tenantService->tontine())) |
|
64 | + if (($tontine = $this->tenantService->tontine())) |
|
65 | 65 | { |
66 | 66 | $this->selectTontine($tontine); |
67 | 67 | } |
68 | - if(($round = $this->tenantService->round())) |
|
68 | + if (($round = $this->tenantService->round())) |
|
69 | 69 | { |
70 | 70 | $this->selectRound($round); |
71 | 71 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'title' => trans('common.actions.cancel'), |
117 | 117 | 'class' => 'btn btn-tertiary', |
118 | 118 | 'click' => 'close', |
119 | - ],[ |
|
119 | + ], [ |
|
120 | 120 | 'title' => trans('common.actions.save'), |
121 | 121 | 'class' => 'btn btn-primary', |
122 | 122 | 'click' => $this->rq()->create(pm()->form('tontine-form')), |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'title' => trans('common.actions.cancel'), |
163 | 163 | 'class' => 'btn btn-tertiary', |
164 | 164 | 'click' => 'close', |
165 | - ],[ |
|
165 | + ], [ |
|
166 | 166 | 'title' => trans('common.actions.save'), |
167 | 167 | 'class' => 'btn btn-primary', |
168 | 168 | 'click' => $this->rq()->update($tontine->id, pm()->form('tontine-form')), |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'title' => trans('common.actions.close'), |
38 | 38 | 'class' => 'btn btn-tertiary', |
39 | 39 | 'click' => 'close', |
40 | - ],[ |
|
40 | + ], [ |
|
41 | 41 | 'title' => trans('common.actions.save'), |
42 | 42 | 'class' => 'btn btn-primary', |
43 | 43 | 'click' => $this->rq()->saveTontine(pm()->select('tontine_id')->toInt()), |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function saveTontine(int $tontineId) |
51 | 51 | { |
52 | - if(!($tontine = $this->tontineService->getTontine($tontineId))) |
|
52 | + if (!($tontine = $this->tontineService->getTontine($tontineId))) |
|
53 | 53 | { |
54 | 54 | return $this->response; |
55 | 55 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->selectTontine($tontine); |
61 | 61 | |
62 | - if($tontine->rounds->count() === 0) |
|
62 | + if ($tontine->rounds->count() === 0) |
|
63 | 63 | { |
64 | 64 | $this->dialog->hide(); |
65 | 65 | $this->notify->info(trans('tontine.messages.selected', ['tontine' => $tontine->name])); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | public function showRounds() |
74 | 74 | { |
75 | - if(!($tontine = $this->tenantService->tontine())) |
|
75 | + if (!($tontine = $this->tenantService->tontine())) |
|
76 | 76 | { |
77 | 77 | return $this->response; |
78 | 78 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | 'title' => trans('common.actions.close'), |
84 | 84 | 'class' => 'btn btn-tertiary', |
85 | 85 | 'click' => 'close', |
86 | - ],[ |
|
86 | + ], [ |
|
87 | 87 | 'title' => trans('common.actions.save'), |
88 | 88 | 'class' => 'btn btn-primary', |
89 | 89 | 'click' => $this->rq()->saveRound(pm()->select('round_id')->toInt()), |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | |
96 | 96 | public function saveRound(int $roundId) |
97 | 97 | { |
98 | - if(!($tontine = $this->tenantService->tontine())) |
|
98 | + if (!($tontine = $this->tenantService->tontine())) |
|
99 | 99 | { |
100 | 100 | return $this->response; |
101 | 101 | } |
102 | - if(!($round = $this->tontineService->getRound($roundId))) |
|
102 | + if (!($round = $this->tontineService->getRound($roundId))) |
|
103 | 103 | { |
104 | 104 | return $this->response; |
105 | 105 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'title' => trans('common.actions.cancel'), |
80 | 80 | 'class' => 'btn btn-tertiary', |
81 | 81 | 'click' => 'close', |
82 | - ],[ |
|
82 | + ], [ |
|
83 | 83 | 'title' => trans('common.actions.save'), |
84 | 84 | 'class' => 'btn btn-primary', |
85 | 85 | 'click' => $this->rq()->create(pm()->form('member-form')), |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'click' => 'close', |
113 | 113 | ]]; |
114 | 114 | $useFaker = config('jaxon.app.faker', false); |
115 | - if($useFaker) |
|
115 | + if ($useFaker) |
|
116 | 116 | { |
117 | 117 | $buttons[] = [ |
118 | 118 | 'title' => '<i class="fa fa-fill"></i>', |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $members = array_map(function($value) { |
141 | 141 | $values = explode(";", trim($value, " \t\n\r;")); |
142 | - if(count($values) === 0 || trim($values[0]) === '') |
|
142 | + if (count($values) === 0 || trim($values[0]) === '') |
|
143 | 143 | { |
144 | 144 | return []; |
145 | 145 | } |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | 'phone' => '', |
150 | 150 | ]; |
151 | 151 | // The next values are either the phone number or the email, in any order. |
152 | - foreach([1, 2] as $count) |
|
152 | + foreach ([1, 2] as $count) |
|
153 | 153 | { |
154 | - if(count($values) > $count) |
|
154 | + if (count($values) > $count) |
|
155 | 155 | { |
156 | 156 | $field = strpos($values[$count], '@') !== false ? 'email' : 'phone'; |
157 | 157 | $member[$field] = trim($values[$count]); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | 'title' => trans('common.actions.cancel'), |
194 | 194 | 'class' => 'btn btn-tertiary', |
195 | 195 | 'click' => 'close', |
196 | - ],[ |
|
196 | + ], [ |
|
197 | 197 | 'title' => trans('common.actions.save'), |
198 | 198 | 'class' => 'btn btn-primary', |
199 | 199 | 'click' => $this->rq()->update($member->id, pm()->form('member-form')), |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function selectCurrencies(string $countryCode) |
17 | 17 | { |
18 | - $html= $this->view()->render('tontine.pages.tontine.currency', [ |
|
18 | + $html = $this->view()->render('tontine.pages.tontine.currency', [ |
|
19 | 19 | 'currencies' => $this->localeService->getCountryCurrencies($countryCode) |
20 | 20 | ]); |
21 | 21 | $this->response->html('select_currency_container', $html); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function show(SessionModel $session) |
68 | 68 | { |
69 | - if(!$this->tontineService->hasPoolWithAuction()) |
|
69 | + if (!$this->tontineService->hasPoolWithAuction()) |
|
70 | 70 | { |
71 | 71 | return $this->response; |
72 | 72 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function togglePayment(string $auctionId) |
130 | 130 | { |
131 | - if($this->session->closed) |
|
131 | + if ($this->session->closed) |
|
132 | 132 | { |
133 | 133 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
134 | 134 | return $this->response; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $this->target()->args()[0] : $this->bag('meeting')->get('pool.id'); |
79 | 79 | $this->pool = $this->remitmentService->getPool($poolId); |
80 | 80 | |
81 | - if(!$this->session || !$this->pool || $this->session->disabled($this->pool)) |
|
81 | + if (!$this->session || !$this->pool || $this->session->disabled($this->pool)) |
|
82 | 82 | { |
83 | 83 | $this->notify->error(trans('tontine.session.errors.disabled'), trans('common.titles.error')); |
84 | 84 | $this->pool = null; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ]); |
99 | 99 | $this->response->html('meeting-remitments', $html); |
100 | 100 | |
101 | - if(!$this->pool->remit_planned) |
|
101 | + if (!$this->pool->remit_planned) |
|
102 | 102 | { |
103 | 103 | $this->jq('#btn-new-remitment')->click($this->rq()->addRemitment(0)); |
104 | 104 | } |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | |
127 | 127 | public function createRemitment(int $payableId) |
128 | 128 | { |
129 | - if($this->session->closed) |
|
129 | + if ($this->session->closed) |
|
130 | 130 | { |
131 | 131 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
132 | 132 | return $this->response; |
133 | 133 | } |
134 | - if(!$this->pool->remit_planned || $this->pool->remit_auction) |
|
134 | + if (!$this->pool->remit_planned || $this->pool->remit_auction) |
|
135 | 135 | { |
136 | 136 | // Only when remitments are planned and without auctions. |
137 | 137 | return $this->response; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | public function addRemitment(int $payableId) |
150 | 150 | { |
151 | - if($this->session->closed) |
|
151 | + if ($this->session->closed) |
|
152 | 152 | { |
153 | 153 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
154 | 154 | return $this->response; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'title' => trans('common.actions.cancel'), |
170 | 170 | 'class' => 'btn btn-tertiary', |
171 | 171 | 'click' => 'close', |
172 | - ],[ |
|
172 | + ], [ |
|
173 | 173 | 'title' => trans('common.actions.save'), |
174 | 174 | 'class' => 'btn btn-primary', |
175 | 175 | 'click' => $this->rq()->saveRemitment(pm()->form('remitment-form')), |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function saveRemitment(array $formValues) |
186 | 186 | { |
187 | - if($this->session->closed) |
|
187 | + if ($this->session->closed) |
|
188 | 188 | { |
189 | 189 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
190 | 190 | $this->dialog->hide(); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $this->dialog->hide(); |
208 | 208 | |
209 | 209 | // Refresh the auction page |
210 | - if($this->pool->remit_auction) |
|
210 | + if ($this->pool->remit_auction) |
|
211 | 211 | { |
212 | 212 | $this->cl(Auction::class)->show($this->session); |
213 | 213 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function deleteRemitment(int $payableId) |
225 | 225 | { |
226 | - if($this->session->closed) |
|
226 | + if ($this->session->closed) |
|
227 | 227 | { |
228 | 228 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
229 | 229 | return $this->response; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $this->remitmentService->deleteRemitment($this->pool, $this->session, $payableId); |
233 | 233 | |
234 | 234 | // Refresh the auction page |
235 | - if($this->pool->remit_auction) |
|
235 | + if ($this->pool->remit_auction) |
|
236 | 236 | { |
237 | 237 | $this->cl(Auction::class)->show($this->session); |
238 | 238 | } |