@@ -14,7 +14,6 @@ |
||
| 14 | 14 | use App\Repositories\ProgramRepository; |
| 15 | 15 | use App\Services\Emailer; |
| 16 | 16 | use Nette\Utils\ArrayHash; |
| 17 | -use Tracy\Debugger; |
|
| 18 | 17 | use Exception; |
| 19 | 18 | |
| 20 | 19 | /** |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | /** |
| 119 | 119 | * Stores program into storage |
| 120 | 120 | * |
| 121 | - * @param Nette\Utils\ArrayHash $program |
|
| 121 | + * @param ArrayHash $program |
|
| 122 | 122 | * @return boolean |
| 123 | 123 | */ |
| 124 | 124 | public function actionCreate(ArrayHash $program) |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | * Updates program in storage |
| 151 | 151 | * |
| 152 | 152 | * @param int $id |
| 153 | - * @param Nette\Utils\ArrayHash $program |
|
| 154 | - * @return boolean |
|
| 153 | + * @param ArrayHash $program |
|
| 154 | + * @return integer|null |
|
| 155 | 155 | */ |
| 156 | 156 | public function actionUpdate(int $id, ArrayHash $program) |
| 157 | 157 | { |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | /** |
| 328 | - * @return AProgramOverviewControl |
|
| 328 | + * @return IProgramOverviewControl |
|
| 329 | 329 | */ |
| 330 | 330 | protected function createComponentProgramOverview(): IProgramOverviewControl |
| 331 | 331 | { |
@@ -425,7 +425,6 @@ discard block |
||
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | /** |
| 428 | - * @param ProgramRepository $model |
|
| 429 | 428 | * @return $this |
| 430 | 429 | */ |
| 431 | 430 | protected function setProgramRepository(ProgramRepository $repository):self |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ->limit(10) |
| 66 | 66 | ->fetchAll(); |
| 67 | 67 | |
| 68 | - if(!$blocks){ |
|
| 68 | + if(!$blocks) { |
|
| 69 | 69 | $html = ""; |
| 70 | 70 | } else { |
| 71 | 71 | /* |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $checked_flag = false; |
| 82 | 82 | $html_input = ""; |
| 83 | - foreach($blocks as $data){ |
|
| 83 | + foreach($blocks as $data) { |
|
| 84 | 84 | // full program capacity with visitors |
| 85 | 85 | $fullProgramData = $this->database |
| 86 | 86 | ->query('SELECT COUNT(visitor) AS visitors FROM `kk_visitor-program` AS visprog |
@@ -94,21 +94,21 @@ discard block |
||
| 94 | 94 | ->where('program ? AND visitor ?', $data['id'], $vid) |
| 95 | 95 | ->fetch(); |
| 96 | 96 | |
| 97 | - if($program){ |
|
| 97 | + if($program) { |
|
| 98 | 98 | $checked = "checked='checked'"; |
| 99 | 99 | $checked_flag = true; |
| 100 | 100 | } else { |
| 101 | 101 | $checked = ""; |
| 102 | 102 | } |
| 103 | 103 | // if the capacity is full |
| 104 | - if($fullProgramData['visitors'] >= $data['capacity']){ |
|
| 105 | - $html_input .= "<input id='".$data['id'].$blockId."' ".$checked." disabled type='radio' name='blck_".$blockId."' value='".$data['id']."' />\n"; |
|
| 104 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 105 | + $html_input .= "<input id='" . $data['id'] . $blockId . "' " . $checked . " disabled type='radio' name='blck_" . $blockId . "' value='" . $data['id'] . "' />\n"; |
|
| 106 | 106 | $fullProgramInfo = " (NELZE ZAPSAT - kapacita programu je již naplněna!)"; |
| 107 | 107 | } else { |
| 108 | - $html_input .= "<input id='".$data['id'].$blockId."' ".$checked." type='radio' name='blck_".$blockId."' value='".$data['id']."' /> \n"; |
|
| 108 | + $html_input .= "<input id='" . $data['id'] . $blockId . "' " . $checked . " type='radio' name='blck_" . $blockId . "' value='" . $data['id'] . "' /> \n"; |
|
| 109 | 109 | $fullProgramInfo = ""; |
| 110 | 110 | } |
| 111 | - $html_input .= '<label for="'.$data['id'].$blockId.'">'.$data['name'].'</label>'; |
|
| 111 | + $html_input .= '<label for="' . $data['id'] . $blockId . '">' . $data['name'] . '</label>'; |
|
| 112 | 112 | $html_input .= $fullProgramInfo; |
| 113 | 113 | $html_input .= "<br />\n"; |
| 114 | 114 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if(!$checked_flag) $checked = "checked='checked'"; |
| 118 | 118 | else $checked = ""; |
| 119 | 119 | |
| 120 | - $html .= "<input ".$checked." type='radio' name='blck_".$blockId."' value='0' /> Nebudu přítomen <br />\n"; |
|
| 120 | + $html .= "<input " . $checked . " type='radio' name='blck_" . $blockId . "' value='0' /> Nebudu přítomen <br />\n"; |
|
| 121 | 121 | $html .= $html_input; |
| 122 | 122 | |
| 123 | 123 | $html .= "</div>\n"; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | $html = ""; |
| 139 | 139 | } else { |
| 140 | 140 | $html = "<table>\n"; |
| 141 | - foreach($exportPrograms as $data){ |
|
| 141 | + foreach($exportPrograms as $data) { |
|
| 142 | 142 | $html .= "<tr>"; |
| 143 | 143 | //// resim kapacitu programu a jeho naplneni navstevniky |
| 144 | 144 | $fullProgramData = $this->database |
@@ -149,16 +149,16 @@ discard block |
||
| 149 | 149 | AND vis.deleted = ?', |
| 150 | 150 | $data['id'], '0')->fetch(); |
| 151 | 151 | |
| 152 | - if($fullProgramData['visitors'] >= $data['capacity']){ |
|
| 152 | + if($fullProgramData['visitors'] >= $data['capacity']) { |
|
| 153 | 153 | //$html .= "<input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 154 | - $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span> (kapacita programu je naplněna!)"; |
|
| 154 | + $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>" . $fullProgramData['visitors'] . "/" . $data['capacity'] . "</span> (kapacita programu je naplněna!)"; |
|
| 155 | 155 | } |
| 156 | 156 | else { |
| 157 | 157 | //$html .= "<input type='radio' name='".$id."' value='".$data['id']."' /> \n"; |
| 158 | - $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span>"; |
|
| 158 | + $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>" . $fullProgramData['visitors'] . "/" . $data['capacity'] . "</span>"; |
|
| 159 | 159 | } |
| 160 | 160 | $html .= "<td style='min-width:270px;'>"; |
| 161 | - $html .= "<a rel='programDetail' href='".PRJ_DIR."program/?id=".$data['id']."&cms=edit&page=export' title='".$data['name']."'>".$data['name']."</a>\n"; |
|
| 161 | + $html .= "<a rel='programDetail' href='" . PRJ_DIR . "program/?id=" . $data['id'] . "&cms=edit&page=export' title='" . $data['name'] . "'>" . $data['name'] . "</a>\n"; |
|
| 162 | 162 | $html .= "</td>"; |
| 163 | 163 | $html .= "<td>"; |
| 164 | 164 | $html .= $fullProgramInfo; |
@@ -188,13 +188,13 @@ discard block |
||
| 188 | 188 | ->order('day ASC, from ASC') |
| 189 | 189 | ->fetchAll(); |
| 190 | 190 | |
| 191 | - if(!$progSql){ |
|
| 191 | + if(!$progSql) { |
|
| 192 | 192 | $programs .= "<div class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</div>\n"; |
| 193 | 193 | } else { |
| 194 | 194 | //// prasarnicka kvuli programu raftu - resim obsazenost dohromady u dvou polozek |
| 195 | 195 | //$raftCountSql = "SELECT COUNT(visitor) AS raft FROM `kk_visitor-program` WHERE program='56|57'"; |
| 196 | 196 | |
| 197 | - foreach($progSql as $progData){ |
|
| 197 | + foreach($progSql as $progData) { |
|
| 198 | 198 | //nemoznost volit predsnemovni dikusi |
| 199 | 199 | if($progData['id'] == 63) $notDisplayed = "style='display:none;'"; |
| 200 | 200 | //obsazenost raftu |
@@ -205,8 +205,8 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | */ |
| 207 | 207 | else $notDisplayed = ""; |
| 208 | - $programs .= "<div ".$notDisplayed.">".$progData['day'].", ".$progData['from']." - ".$progData['to']." : ".$progData['name']."</div>\n"; |
|
| 209 | - if($progData['program'] == 1) $programs .= "<div ".$notDisplayed.">".$this->getExportPrograms($progData['id'])."</div>"; |
|
| 208 | + $programs .= "<div " . $notDisplayed . ">" . $progData['day'] . ", " . $progData['from'] . " - " . $progData['to'] . " : " . $progData['name'] . "</div>\n"; |
|
| 209 | + if($progData['program'] == 1) $programs .= "<div " . $notDisplayed . ">" . $this->getExportPrograms($progData['id']) . "</div>"; |
|
| 210 | 210 | $programs .= "<br />"; |
| 211 | 211 | } |
| 212 | 212 | } |
@@ -307,20 +307,20 @@ discard block |
||
| 307 | 307 | ->fetchAll(); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - public static function getPdfPrograms($id, $vid, $database){ |
|
| 310 | + public static function getPdfPrograms($id, $vid, $database) { |
|
| 311 | 311 | $result = $database |
| 312 | 312 | ->table('kk_programs') |
| 313 | 313 | ->where('block ? AND deleted ?', $id, '0') |
| 314 | 314 | ->limit(10) |
| 315 | 315 | ->fetchAll(); |
| 316 | 316 | |
| 317 | - if(!$result){ |
|
| 317 | + if(!$result) { |
|
| 318 | 318 | $html = ""; |
| 319 | 319 | } else { |
| 320 | 320 | |
| 321 | 321 | $html = "<div class='program'>\n"; |
| 322 | 322 | |
| 323 | - foreach($result as $data){ |
|
| 323 | + foreach($result as $data) { |
|
| 324 | 324 | $rows = $database |
| 325 | 325 | ->table('kk_visitor-program') |
| 326 | 326 | ->where('program ? AND visitor ?', $data->id, $vid) |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | return $html; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - public function getProgramsLarge($id){ |
|
| 336 | + public function getProgramsLarge($id) { |
|
| 337 | 337 | $result = $this->database |
| 338 | 338 | ->query('SELECT progs.name AS name, |
| 339 | 339 | cat.style AS style |
@@ -347,8 +347,8 @@ discard block |
||
| 347 | 347 | else { |
| 348 | 348 | $html = "<table>"; |
| 349 | 349 | $html .= " <tr>"; |
| 350 | - foreach($result as $data){ |
|
| 351 | - $html .= "<td class='category cat-".$data['style']."' >".$data['name']."</td>\n"; |
|
| 350 | + foreach($result as $data) { |
|
| 351 | + $html .= "<td class='category cat-" . $data['style'] . "' >" . $data['name'] . "</td>\n"; |
|
| 352 | 352 | } |
| 353 | 353 | $html .= " </tr>\n"; |
| 354 | 354 | $html .= "</table>\n"; |
@@ -369,8 +369,8 @@ discard block |
||
| 369 | 369 | |
| 370 | 370 | if(!$result) $html = ""; |
| 371 | 371 | else { |
| 372 | - foreach($result as $data){ |
|
| 373 | - $html .= $data['name'].",\n"; |
|
| 372 | + foreach($result as $data) { |
|
| 373 | + $html .= $data['name'] . ",\n"; |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | return $html; |
@@ -114,8 +114,11 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | // pokud uz jednou bylo zaskrtnuto, nezaskrtavam znovu |
| 117 | - if(!$checked_flag) $checked = "checked='checked'"; |
|
| 118 | - else $checked = ""; |
|
| 117 | + if(!$checked_flag) { |
|
| 118 | + $checked = "checked='checked'"; |
|
| 119 | + } else { |
|
| 120 | + $checked = ""; |
|
| 121 | + } |
|
| 119 | 122 | |
| 120 | 123 | $html .= "<input ".$checked." type='radio' name='blck_".$blockId."' value='0' /> Nebudu přítomen <br />\n"; |
| 121 | 124 | $html .= $html_input; |
@@ -152,8 +155,7 @@ discard block |
||
| 152 | 155 | if($fullProgramData['visitors'] >= $data['capacity']){ |
| 153 | 156 | //$html .= "<input disabled type='radio' name='".$id."' value='".$data['id']."' />\n"; |
| 154 | 157 | $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span> (kapacita programu je naplněna!)"; |
| 155 | - } |
|
| 156 | - else { |
|
| 158 | + } else { |
|
| 157 | 159 | //$html .= "<input type='radio' name='".$id."' value='".$data['id']."' /> \n"; |
| 158 | 160 | $fullProgramInfo = "<span style='font-size:12px; font-weight:bold;'>".$fullProgramData['visitors']."/".$data['capacity']."</span>"; |
| 159 | 161 | } |
@@ -196,7 +198,9 @@ discard block |
||
| 196 | 198 | |
| 197 | 199 | foreach($progSql as $progData){ |
| 198 | 200 | //nemoznost volit predsnemovni dikusi |
| 199 | - if($progData['id'] == 63) $notDisplayed = "style='display:none;'"; |
|
| 201 | + if($progData['id'] == 63) { |
|
| 202 | + $notDisplayed = "style='display:none;'"; |
|
| 203 | + } |
|
| 200 | 204 | //obsazenost raftu |
| 201 | 205 | /* |
| 202 | 206 | elseif($raftCountData['raft'] >= 18){ |
@@ -204,9 +208,13 @@ discard block |
||
| 204 | 208 | else $notDisplayed = ""; |
| 205 | 209 | } |
| 206 | 210 | */ |
| 207 | - else $notDisplayed = ""; |
|
| 211 | + else { |
|
| 212 | + $notDisplayed = ""; |
|
| 213 | + } |
|
| 208 | 214 | $programs .= "<div ".$notDisplayed.">".$progData['day'].", ".$progData['from']." - ".$progData['to']." : ".$progData['name']."</div>\n"; |
| 209 | - if($progData['program'] == 1) $programs .= "<div ".$notDisplayed.">".$this->getExportPrograms($progData['id'])."</div>"; |
|
| 215 | + if($progData['program'] == 1) { |
|
| 216 | + $programs .= "<div ".$notDisplayed.">".$this->getExportPrograms($progData['id'])."</div>"; |
|
| 217 | + } |
|
| 210 | 218 | $programs .= "<br />"; |
| 211 | 219 | } |
| 212 | 220 | } |
@@ -307,7 +315,8 @@ discard block |
||
| 307 | 315 | ->fetchAll(); |
| 308 | 316 | } |
| 309 | 317 | |
| 310 | - public static function getPdfPrograms($id, $vid, $database){ |
|
| 318 | + public static function getPdfPrograms($id, $vid, $database) |
|
| 319 | + { |
|
| 311 | 320 | $result = $database |
| 312 | 321 | ->table('kk_programs') |
| 313 | 322 | ->where('block ? AND deleted ?', $id, '0') |
@@ -325,7 +334,9 @@ discard block |
||
| 325 | 334 | ->table('kk_visitor-program') |
| 326 | 335 | ->where('program ? AND visitor ?', $data->id, $vid) |
| 327 | 336 | ->fetchAll(); |
| 328 | - if($rows) $html .= $data['name']; |
|
| 337 | + if($rows) { |
|
| 338 | + $html .= $data['name']; |
|
| 339 | + } |
|
| 329 | 340 | } |
| 330 | 341 | $html .= "</div>\n"; |
| 331 | 342 | } |
@@ -333,7 +344,8 @@ discard block |
||
| 333 | 344 | return $html; |
| 334 | 345 | } |
| 335 | 346 | |
| 336 | - public function getProgramsLarge($id){ |
|
| 347 | + public function getProgramsLarge($id) |
|
| 348 | + { |
|
| 337 | 349 | $result = $this->database |
| 338 | 350 | ->query('SELECT progs.name AS name, |
| 339 | 351 | cat.style AS style |
@@ -343,8 +355,9 @@ discard block |
||
| 343 | 355 | LIMIT 10', |
| 344 | 356 | $id, '0')->fetchAll(); |
| 345 | 357 | |
| 346 | - if(!$result) $html = ""; |
|
| 347 | - else { |
|
| 358 | + if(!$result) { |
|
| 359 | + $html = ""; |
|
| 360 | + } else { |
|
| 348 | 361 | $html = "<table>"; |
| 349 | 362 | $html .= " <tr>"; |
| 350 | 363 | foreach($result as $data){ |
@@ -367,8 +380,9 @@ discard block |
||
| 367 | 380 | |
| 368 | 381 | $html = ''; |
| 369 | 382 | |
| 370 | - if(!$result) $html = ""; |
|
| 371 | - else { |
|
| 383 | + if(!$result) { |
|
| 384 | + $html = ""; |
|
| 385 | + } else { |
|
| 372 | 386 | foreach($result as $data){ |
| 373 | 387 | $html .= $data['name'].",\n"; |
| 374 | 388 | } |
@@ -219,7 +219,7 @@ |
||
| 219 | 219 | * |
| 220 | 220 | * @return string html of a table |
| 221 | 221 | */ |
| 222 | - public function getData($program_id = NULL) |
|
| 222 | + public function getData($program_id = null) |
|
| 223 | 223 | { |
| 224 | 224 | if(isset($program_id)) { |
| 225 | 225 | $data = $this->database |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | protected $userService; |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | - * @param ProvinceModel $model |
|
| 29 | 28 | */ |
| 30 | 29 | public function __construct( |
| 31 | 30 | ProvinceModel $province, |
@@ -459,7 +459,7 @@ |
||
| 459 | 459 | |
| 460 | 460 | /** |
| 461 | 461 | * @param array $programs |
| 462 | - * @return array |
|
| 462 | + * @return boolean |
|
| 463 | 463 | */ |
| 464 | 464 | protected function filterFilledCapacity(array $programs = []): array |
| 465 | 465 | { |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public $onVisitorSave; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var Closure |
|
| 30 | - */ |
|
| 31 | - public $onVisitorReset; |
|
| 28 | + /** |
|
| 29 | + * @var Closure |
|
| 30 | + */ |
|
| 31 | + public $onVisitorReset; |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @var ProvinceModel |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected $programFields = []; |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * VisitorForm constructor. |
|
| 65 | - * @param ProvinceModel $province |
|
| 66 | - * @param ProgramRepository $program |
|
| 67 | - * @param BlockModel $block |
|
| 68 | - * @param MeetingModel $meeting |
|
| 69 | - */ |
|
| 63 | + /** |
|
| 64 | + * VisitorForm constructor. |
|
| 65 | + * @param ProvinceModel $province |
|
| 66 | + * @param ProgramRepository $program |
|
| 67 | + * @param BlockModel $block |
|
| 68 | + * @param MeetingModel $meeting |
|
| 69 | + */ |
|
| 70 | 70 | public function __construct( |
| 71 | 71 | ProvinceModel $province, |
| 72 | 72 | ProgramRepository $program, |
@@ -128,15 +128,15 @@ discard block |
||
| 128 | 128 | ->getLabelPrototype()->setAttribute('class', 'required'); |
| 129 | 129 | $form->addEmail('email', 'E-mail:') |
| 130 | 130 | ->setRequired(static::MESSAGE_REQUIRED) |
| 131 | - ->setAttribute('size', 30) |
|
| 131 | + ->setAttribute('size', 30) |
|
| 132 | + ->getLabelPrototype()->setAttribute('class', 'required'); |
|
| 133 | + $form->addTbDatePicker('birthday', 'Datum narození:', null, 16) |
|
| 134 | + ->setRequired(static::MESSAGE_REQUIRED) |
|
| 135 | + ->setFormat('d.m.Y') |
|
| 136 | + ->setAttribute('placeholder', 'dd. mm. rrrr') |
|
| 137 | + ->setAttribute('id', 'birthday') |
|
| 138 | + ->setAttribute('class', 'datePicker') |
|
| 132 | 139 | ->getLabelPrototype()->setAttribute('class', 'required'); |
| 133 | - $form->addTbDatePicker('birthday', 'Datum narození:', null, 16) |
|
| 134 | - ->setRequired(static::MESSAGE_REQUIRED) |
|
| 135 | - ->setFormat('d.m.Y') |
|
| 136 | - ->setAttribute('placeholder', 'dd. mm. rrrr') |
|
| 137 | - ->setAttribute('id', 'birthday') |
|
| 138 | - ->setAttribute('class', 'datePicker') |
|
| 139 | - ->getLabelPrototype()->setAttribute('class', 'required'); |
|
| 140 | 140 | $form->addText('street', 'Ulice:', 30) |
| 141 | 141 | ->setRequired(static::MESSAGE_REQUIRED) |
| 142 | 142 | ->addRule(Form::MAX_LENGTH, static::MESSAGE_MAX_LENGTH, 30) |
@@ -179,53 +179,53 @@ discard block |
||
| 179 | 179 | ->setAttribute('placeholder', 'Vaše nabídka na sdílení dobré praxe (co u vás umíte dobře a jste ochotni se o to podělit)'); |
| 180 | 180 | $form->addTextArea('question2', 'Počet a typy lodí:', 50, 8) |
| 181 | 181 | ->setAttribute('placeholder', 'Počet a typy lodí, které sebou přivezete (vyplňte pokud ano)'); |
| 182 | - $form->addText('bill', 'Zaplaceno:', 30) |
|
| 183 | - ->setDefaultValue(0); |
|
| 184 | - $form->addText('cost', 'Poplatek:', 30) |
|
| 185 | - ->setDefaultValue($this->getMeetingModel()->getPrice('cost')); |
|
| 182 | + $form->addText('bill', 'Zaplaceno:', 30) |
|
| 183 | + ->setDefaultValue(0); |
|
| 184 | + $form->addText('cost', 'Poplatek:', 30) |
|
| 185 | + ->setDefaultValue($this->getMeetingModel()->getPrice('cost')); |
|
| 186 | 186 | |
| 187 | 187 | $form = $this->buildProgramSwitcher($form); |
| 188 | 188 | |
| 189 | 189 | $form->addHidden('mid', $this->getMeetingId()); |
| 190 | - $form->addHidden('meeting', $this->getMeetingId()); |
|
| 190 | + $form->addHidden('meeting', $this->getMeetingId()); |
|
| 191 | 191 | $form->addHidden('backlink'); |
| 192 | 192 | |
| 193 | - $form->addSubmit('save', 'Uložit') |
|
| 194 | - ->setAttribute('class', 'btn-primary') |
|
| 195 | - ->onClick[] = [$this, 'processSave']; |
|
| 196 | - $form->addSubmit('reset', 'Storno') |
|
| 197 | - ->setAttribute('class', 'btn-reset') |
|
| 198 | - ->onClick[] = [$this, 'processReset']; |
|
| 193 | + $form->addSubmit('save', 'Uložit') |
|
| 194 | + ->setAttribute('class', 'btn-primary') |
|
| 195 | + ->onClick[] = [$this, 'processSave']; |
|
| 196 | + $form->addSubmit('reset', 'Storno') |
|
| 197 | + ->setAttribute('class', 'btn-reset') |
|
| 198 | + ->onClick[] = [$this, 'processReset']; |
|
| 199 | 199 | |
| 200 | 200 | |
| 201 | - $form = $this->setupRendering($form); |
|
| 201 | + $form = $this->setupRendering($form); |
|
| 202 | 202 | |
| 203 | 203 | $form->onSuccess[] = [$this, 'processForm']; |
| 204 | 204 | |
| 205 | 205 | return $form; |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - /** |
|
| 209 | - * @param SubmitButton $button |
|
| 210 | - * @return void |
|
| 211 | - */ |
|
| 212 | - public function processSave(SubmitButton $button) |
|
| 213 | - { |
|
| 214 | - $visitor = $button->getForm()->getValues(); |
|
| 215 | - |
|
| 216 | - $this->onVisitorSave($this, $visitor); |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - /** |
|
| 220 | - * @param SubmitButton $button |
|
| 221 | - * @return void |
|
| 222 | - */ |
|
| 223 | - public function processReset(SubmitButton $button) |
|
| 224 | - { |
|
| 225 | - $visitor = $button->getForm()->getValues(); |
|
| 226 | - |
|
| 227 | - $this->onVisitorReset($this, $visitor); |
|
| 228 | - } |
|
| 208 | + /** |
|
| 209 | + * @param SubmitButton $button |
|
| 210 | + * @return void |
|
| 211 | + */ |
|
| 212 | + public function processSave(SubmitButton $button) |
|
| 213 | + { |
|
| 214 | + $visitor = $button->getForm()->getValues(); |
|
| 215 | + |
|
| 216 | + $this->onVisitorSave($this, $visitor); |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + /** |
|
| 220 | + * @param SubmitButton $button |
|
| 221 | + * @return void |
|
| 222 | + */ |
|
| 223 | + public function processReset(SubmitButton $button) |
|
| 224 | + { |
|
| 225 | + $visitor = $button->getForm()->getValues(); |
|
| 226 | + |
|
| 227 | + $this->onVisitorReset($this, $visitor); |
|
| 228 | + } |
|
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | 231 | * @param Form $form |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | $programBlocks = $this->fetchProgramBlocks(); |
| 237 | 237 | |
| 238 | - foreach ($programBlocks as $block) { |
|
| 238 | + foreach($programBlocks as $block) { |
|
| 239 | 239 | |
| 240 | 240 | $programsInBlock = $this->getProgramRepository()->findByBlockId($block->id); |
| 241 | 241 | |
@@ -243,13 +243,13 @@ discard block |
||
| 243 | 243 | 0 => 'Nebudu přítomen' |
| 244 | 244 | ]; |
| 245 | 245 | |
| 246 | - foreach ($programsInBlock as $program) { |
|
| 246 | + foreach($programsInBlock as $program) { |
|
| 247 | 247 | $programs[$program->id] = $program->name; |
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | $form->addRadioList( |
| 251 | 251 | 'blck_' . $block->id, |
| 252 | - $block->day . ', ' . $block->from .' - ' . $block->to .' : ' . $block->name, |
|
| 252 | + $block->day . ', ' . $block->from . ' - ' . $block->to . ' : ' . $block->name, |
|
| 253 | 253 | $programs |
| 254 | 254 | )->setDefaultValue(0) |
| 255 | 255 | ->setDisabled($this->filterFilledCapacity($programs)); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | 'ano' => 'ano', |
| 270 | 270 | ]; |
| 271 | 271 | |
| 272 | - foreach ($this->fetchMeals() as $name => $label) { |
|
| 272 | + foreach($this->fetchMeals() as $name => $label) { |
|
| 273 | 273 | $this->setMealField($name); |
| 274 | 274 | $form->addSelect($name, $label . ':', $yesNoArray); |
| 275 | 275 | } |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | { |
| 401 | 401 | $programBlocks = $this->fetchProgramBlocks(); |
| 402 | 402 | |
| 403 | - foreach ($programBlocks as $block) { |
|
| 403 | + foreach($programBlocks as $block) { |
|
| 404 | 404 | $programFieldName = 'blck_' . $block->id; |
| 405 | 405 | $this->setProgramField($programFieldName); |
| 406 | 406 | } |
@@ -415,7 +415,7 @@ discard block |
||
| 415 | 415 | { |
| 416 | 416 | $meals = $this->fetchMeals(); |
| 417 | 417 | |
| 418 | - foreach ($meals as $name => $label) { |
|
| 418 | + foreach($meals as $name => $label) { |
|
| 419 | 419 | $this->setMealField($name); |
| 420 | 420 | } |
| 421 | 421 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | { |
| 466 | 466 | return array_keys( |
| 467 | 467 | array_filter($programs, function($name, $id) { |
| 468 | - if ($id) { |
|
| 468 | + if($id) { |
|
| 469 | 469 | $visitorsOnProgram = $this->getProgramRepository()->countVisitors($id); |
| 470 | 470 | $programCapacity = $this->getProgramRepository()->find($id)->capacity; |
| 471 | 471 | |
@@ -204,11 +204,9 @@ discard block |
||
| 204 | 204 | /** |
| 205 | 205 | * Modify a visitor |
| 206 | 206 | * |
| 207 | - * @param int $visitor_id ID of a visitor |
|
| 208 | - * @param array $db_data Visitor's database data |
|
| 209 | - * @param array $meals_data Data of meals |
|
| 210 | - * @param array $programs_data Program's data |
|
| 211 | - * @return mixed TRUE or array of errors |
|
| 207 | + * @param int $visitorId ID of a visitor |
|
| 208 | + * @param array $programs Program's data |
|
| 209 | + * @return integer TRUE or array of errors |
|
| 212 | 210 | */ |
| 213 | 211 | public function modify(int $visitorId, array $visitor, array $meals, array $programs) |
| 214 | 212 | { |
@@ -246,10 +244,8 @@ discard block |
||
| 246 | 244 | /** |
| 247 | 245 | * Modify a visitor |
| 248 | 246 | * |
| 249 | - * @param int $visitor_id ID of a visitor |
|
| 250 | - * @param array $db_data Visitor's database data |
|
| 251 | - * @param array $meals_data Data of meals |
|
| 252 | - * @param array $programs_data Program's data |
|
| 247 | + * @param int $visitor ID of a visitor |
|
| 248 | + * @param array $programs Program's data |
|
| 253 | 249 | * @return mixed TRUE or array of errors |
| 254 | 250 | */ |
| 255 | 251 | public function modifyByGuid($guid, $visitor, $meals, $programs) |
@@ -320,7 +316,8 @@ discard block |
||
| 320 | 316 | * Delete one or multiple record/s |
| 321 | 317 | * |
| 322 | 318 | * @param int ID/s of record |
| 323 | - * @return boolean |
|
| 319 | + * @param integer $id |
|
| 320 | + * @return integer|null |
|
| 324 | 321 | */ |
| 325 | 322 | public function delete($id) |
| 326 | 323 | { |
@@ -337,7 +334,9 @@ discard block |
||
| 337 | 334 | * |
| 338 | 335 | * @param int ID/s of record |
| 339 | 336 | * @param int 0 | 1 |
| 340 | - * @return boolean |
|
| 337 | + * @param integer $id |
|
| 338 | + * @param string $value |
|
| 339 | + * @return integer|null |
|
| 341 | 340 | */ |
| 342 | 341 | public function checked($id, $value) |
| 343 | 342 | { |
@@ -407,7 +406,9 @@ discard block |
||
| 407 | 406 | * |
| 408 | 407 | * @param int ID/s of visitor |
| 409 | 408 | * @param string type of payment (pay | advance) |
| 410 | - * @return string error message or true |
|
| 409 | + * @param integer $ids |
|
| 410 | + * @param string $type |
|
| 411 | + * @return integer|null error message or true |
|
| 411 | 412 | */ |
| 412 | 413 | public function payCharge($ids, $type) |
| 413 | 414 | { |
@@ -431,7 +432,8 @@ discard block |
||
| 431 | 432 | * Get recipients by ids |
| 432 | 433 | * |
| 433 | 434 | * @param mixed ID of visitor |
| 434 | - * @return mixed result |
|
| 435 | + * @param integer $ids |
|
| 436 | + * @return \Nette\Database\IRow[] result |
|
| 435 | 437 | */ |
| 436 | 438 | public function getRecipients($ids) |
| 437 | 439 | { |
@@ -457,7 +459,7 @@ discard block |
||
| 457 | 459 | } |
| 458 | 460 | |
| 459 | 461 | /** |
| 460 | - * @return Row |
|
| 462 | + * @return \Nette\Database\IRow[] |
|
| 461 | 463 | */ |
| 462 | 464 | public function all() |
| 463 | 465 | { |
@@ -523,7 +525,7 @@ discard block |
||
| 523 | 525 | |
| 524 | 526 | /** |
| 525 | 527 | * @param int ID of visitor |
| 526 | - * @return mixed result |
|
| 528 | + * @return \Nette\Database\IRow[] result |
|
| 527 | 529 | */ |
| 528 | 530 | public function findVisitorPrograms(int $visitorId) |
| 529 | 531 | { |
@@ -3,10 +3,8 @@ |
||
| 3 | 3 | namespace App\Models; |
| 4 | 4 | |
| 5 | 5 | use Nette\Database\Context; |
| 6 | -use Nette\Utils\Strings; |
|
| 7 | 6 | use \Exception; |
| 8 | 7 | use DateTime; |
| 9 | -use Tracy\Debugger; |
|
| 10 | 8 | |
| 11 | 9 | /** |
| 12 | 10 | * Visitor |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // visitor's id is empty and i must add one |
| 164 | 164 | $meals_data['visitor'] = $ID_visitor; |
| 165 | 165 | |
| 166 | - if($ID_visitor){ |
|
| 166 | + if($ID_visitor) { |
|
| 167 | 167 | // gets data from database |
| 168 | 168 | $program_blocks = $this->Blocks->getProgramBlocks($DB_data['meeting']); |
| 169 | 169 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | protected function convertToDateTime($datetime): DateTime |
| 451 | 451 | { |
| 452 | - if (is_string($datetime)) { |
|
| 452 | + if(is_string($datetime)) { |
|
| 453 | 453 | $datetime = new DateTime($datetime); |
| 454 | 454 | } |
| 455 | 455 | |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | ->group('email') |
| 500 | 500 | ->fetchAll(); |
| 501 | 501 | |
| 502 | - foreach($emails as $item){ |
|
| 502 | + foreach($emails as $item) { |
|
| 503 | 503 | $recipientMailAddresses .= $item['email'] . ",\n"; |
| 504 | 504 | } |
| 505 | 505 | |
@@ -2,10 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Presenters; |
| 4 | 4 | |
| 5 | -use Nette, |
|
| 6 | - App\Model; |
|
| 5 | +use Nette; |
|
| 6 | +use App\Model; |
|
| 7 | 7 | use Nette\Utils\ArrayHash; |
| 8 | -use Nette\Utils\Strings; |
|
| 9 | 8 | use Nette\Http\Request; |
| 10 | 9 | use App\Models\SunlightModel; |
| 11 | 10 | use Nette\Caching\Cache; |
@@ -480,19 +480,19 @@ |
||
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | - /** |
|
| 484 | - * @param Nette\Utils\ArrayHash $array |
|
| 485 | - * @return self |
|
| 486 | - */ |
|
| 487 | - protected function setBacklinkFromArray(ArrayHash $array): self |
|
| 488 | - { |
|
| 489 | - if(array_key_exists('backlink', $array) && !empty($array['backlink'])) { |
|
| 490 | - $this->setBacklink($array['backlink']); |
|
| 491 | - unset($array['backlink']); |
|
| 492 | - } |
|
| 493 | - |
|
| 494 | - return $this; |
|
| 495 | - } |
|
| 483 | + /** |
|
| 484 | + * @param Nette\Utils\ArrayHash $array |
|
| 485 | + * @return self |
|
| 486 | + */ |
|
| 487 | + protected function setBacklinkFromArray(ArrayHash $array): self |
|
| 488 | + { |
|
| 489 | + if(array_key_exists('backlink', $array) && !empty($array['backlink'])) { |
|
| 490 | + $this->setBacklink($array['backlink']); |
|
| 491 | + unset($array['backlink']); |
|
| 492 | + } |
|
| 493 | + |
|
| 494 | + return $this; |
|
| 495 | + } |
|
| 496 | 496 | |
| 497 | 497 | /** |
| 498 | 498 | * Flashes success message |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | /** |
| 146 | 146 | * Process data from form |
| 147 | 147 | * |
| 148 | - * @return void |
|
| 148 | + * @return string |
|
| 149 | 149 | */ |
| 150 | 150 | public function actionCreate($visitor) |
| 151 | 151 | { |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | 172 | * @param string $guid |
| 173 | - * @return void |
|
| 173 | + * @return string |
|
| 174 | 174 | */ |
| 175 | 175 | public function actionUpdate($guid, $visitor) |
| 176 | 176 | { |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
| 264 | - * @return RegistrationFormControl |
|
| 264 | + * @return RegistrationForm |
|
| 265 | 265 | */ |
| 266 | 266 | protected function createComponentRegistrationForm(): RegistrationForm |
| 267 | 267 | { |
@@ -390,7 +390,6 @@ discard block |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
| 393 | - * @param EventService $skautisEvent |
|
| 394 | 393 | * |
| 395 | 394 | * @return self |
| 396 | 395 | */ |
@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use App\Components\Forms\Factories\IRegistrationFormFactory; |
| 16 | 16 | use App\Services\SkautIS\EventService; |
| 17 | 17 | use Nette\Utils\ArrayHash; |
| 18 | -use Skautis\Wsdl\WsdlException; |
|
| 19 | 18 | use App\Models\SettingsModel; |
| 20 | 19 | |
| 21 | 20 | /** |
@@ -55,20 +55,20 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected $skautisEventService; |
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * @var MealModel |
|
| 60 | - */ |
|
| 58 | + /** |
|
| 59 | + * @var MealModel |
|
| 60 | + */ |
|
| 61 | 61 | private $mealModel; |
| 62 | 62 | |
| 63 | - /** |
|
| 64 | - * @var ProgramRepository |
|
| 65 | - */ |
|
| 63 | + /** |
|
| 64 | + * @var ProgramRepository |
|
| 65 | + */ |
|
| 66 | 66 | private $programRepository; |
| 67 | 67 | |
| 68 | - protected $error = FALSE; |
|
| 69 | - protected $hash = NULL; |
|
| 70 | - private $user; |
|
| 71 | - private $event; |
|
| 68 | + protected $error = FALSE; |
|
| 69 | + protected $hash = NULL; |
|
| 70 | + private $user; |
|
| 71 | + private $event; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * @param MeetingModel $meetingModel |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
| 110 | - * Injector |
|
| 111 | - * |
|
| 112 | - * @param IRegistrationFormFactory $factory |
|
| 113 | - */ |
|
| 110 | + * Injector |
|
| 111 | + * |
|
| 112 | + * @param IRegistrationFormFactory $factory |
|
| 113 | + */ |
|
| 114 | 114 | public function injectRegistrationFormFactory(IRegistrationFormFactory $factory) |
| 115 | 115 | { |
| 116 | 116 | $this->registrationFormFactory = $factory; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $control = $this->registrationFormFactory->create(); |
| 269 | 269 | $control->setMeetingId($this->getMeetingId()); |
| 270 | 270 | $control->onRegistrationSave[] = function(RegistrationForm $control, $visitor) { |
| 271 | - $guid = $this->getParameter('guid'); |
|
| 271 | + $guid = $this->getParameter('guid'); |
|
| 272 | 272 | |
| 273 | 273 | if($guid) { |
| 274 | 274 | $guid = $this->actionUpdate($guid, $visitor); |
@@ -422,23 +422,23 @@ discard block |
||
| 422 | 422 | return $this; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | - /** |
|
| 426 | - * @return ProgramRepository |
|
| 427 | - */ |
|
| 428 | - protected function getProgramRepository(): ProgramRepository |
|
| 429 | - { |
|
| 430 | - return $this->programRepository; |
|
| 431 | - } |
|
| 432 | - |
|
| 433 | - /** |
|
| 434 | - * @param ProgramRepository $repository |
|
| 435 | - * @return RegistrationPresenter |
|
| 436 | - */ |
|
| 437 | - protected function setProgramRepository(ProgramRepository $repository): self |
|
| 438 | - { |
|
| 439 | - $this->programRepository = $repository; |
|
| 440 | - |
|
| 441 | - return $this; |
|
| 442 | - } |
|
| 425 | + /** |
|
| 426 | + * @return ProgramRepository |
|
| 427 | + */ |
|
| 428 | + protected function getProgramRepository(): ProgramRepository |
|
| 429 | + { |
|
| 430 | + return $this->programRepository; |
|
| 431 | + } |
|
| 432 | + |
|
| 433 | + /** |
|
| 434 | + * @param ProgramRepository $repository |
|
| 435 | + * @return RegistrationPresenter |
|
| 436 | + */ |
|
| 437 | + protected function setProgramRepository(ProgramRepository $repository): self |
|
| 438 | + { |
|
| 439 | + $this->programRepository = $repository; |
|
| 440 | + |
|
| 441 | + return $this; |
|
| 442 | + } |
|
| 443 | 443 | |
| 444 | 444 | } |
@@ -65,8 +65,8 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | private $programRepository; |
| 67 | 67 | |
| 68 | - protected $error = FALSE; |
|
| 69 | - protected $hash = NULL; |
|
| 68 | + protected $error = false; |
|
| 69 | + protected $hash = null; |
|
| 70 | 70 | private $user; |
| 71 | 71 | private $event; |
| 72 | 72 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | /** |
| 93 | 93 | * Process data from form |
| 94 | 94 | * |
| 95 | - * @return void |
|
| 95 | + * @return boolean |
|
| 96 | 96 | */ |
| 97 | 97 | public function actionCreate($visitor) |
| 98 | 98 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * Process data from editing |
| 115 | 115 | * |
| 116 | 116 | * @param integer $id |
| 117 | - * @return void |
|
| 117 | + * @return boolean |
|
| 118 | 118 | */ |
| 119 | 119 | public function actionUpdate($id, $visitor) |
| 120 | 120 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | /** |
| 192 | - * @param integer|string $ids |
|
| 192 | + * @param integer|string $id |
|
| 193 | 193 | * @return void |
| 194 | 194 | */ |
| 195 | 195 | public function actionPay($id) |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | /** |
| 221 | - * @param string|interger $ids |
|
| 221 | + * @param string|interger $id |
|
| 222 | 222 | * @return void |
| 223 | 223 | */ |
| 224 | 224 | public function actionAdvance(int $id = null) |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /** |
| 346 | - * @return VisitorFormControl |
|
| 346 | + * @return VisitorForm |
|
| 347 | 347 | */ |
| 348 | 348 | protected function createComponentVisitorForm(): VisitorForm |
| 349 | 349 | { |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | } |
| 374 | 374 | |
| 375 | 375 | /** |
| 376 | - * @return Latte |
|
| 376 | + * @return \Nette\Application\UI\ITemplate |
|
| 377 | 377 | */ |
| 378 | 378 | protected function createMailTemplate() |
| 379 | 379 | { |
@@ -208,9 +208,9 @@ |
||
| 208 | 208 | $this->flashSuccess('Platba byla zaplacena.'); |
| 209 | 209 | } catch(Exception $e) { |
| 210 | 210 | $this->logError('Visitor: Action pay for id %s failed, result: %s', [ |
| 211 | - json_encode($id), |
|
| 212 | - $e->getMessage() |
|
| 213 | - ]); |
|
| 211 | + json_encode($id), |
|
| 212 | + $e->getMessage() |
|
| 213 | + ]); |
|
| 214 | 214 | $this->flashFailure('Visitor: Action pay for id ' . $id . ' failed, result: ' . $e->getMessage()); |
| 215 | 215 | } |
| 216 | 216 | |
@@ -100,10 +100,10 @@ discard block |
||
| 100 | 100 | $guid = $this->getVisitorRepository()->create($visitor); |
| 101 | 101 | $result = $this->sendRegistrationSummary($visitor, $guid); |
| 102 | 102 | |
| 103 | - $this->logInfo('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result)); |
|
| 103 | + $this->logInfo('Creation of visitor(' . $guid . ') successfull, result: ' . json_encode($result)); |
|
| 104 | 104 | $this->flashSuccess('Účastník(' . $guid . ') byl úspěšně vytvořen.'); |
| 105 | 105 | } catch(Exception $e) { |
| 106 | - $this->logError('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage()); |
|
| 106 | + $this->logError('Creation of visitor(' . $guid . ') failed, result: ' . $e->getMessage()); |
|
| 107 | 107 | $this->flashError('Creation of visitor failed, result: ' . $e->getMessage()); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -122,10 +122,10 @@ discard block |
||
| 122 | 122 | $result = $this->getVisitorRepository()->update($id, $visitor); |
| 123 | 123 | $result = $this->sendRegistrationSummary($visitor, $id); |
| 124 | 124 | |
| 125 | - $this->logInfo('Modification of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 125 | + $this->logInfo('Modification of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 126 | 126 | $this->flashSuccess('Účastník(' . $id . ') byl úspěšně upraven.'); |
| 127 | 127 | } catch(Exception $e) { |
| 128 | - $this->logError('Modification of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 128 | + $this->logError('Modification of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 129 | 129 | $this->flashFailure('Modification of visitor failed, result: ' . $e->getMessage()); |
| 130 | 130 | $result = false; |
| 131 | 131 | } |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | try { |
| 143 | 143 | $result = $this->getVisitorRepository()->delete($id); |
| 144 | 144 | |
| 145 | - $this->logInfo('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 145 | + $this->logInfo('Destroying of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 146 | 146 | $this->flashSuccess('Položka byla úspěšně smazána'); |
| 147 | 147 | } catch(Exception $e) { |
| 148 | - $this->logError('Destroying of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 148 | + $this->logError('Destroying of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 149 | 149 | $this->flashFailure('Destroying of visitor failed, result: ' . $e->getMessage()); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | $this->logInfo('E-mail was send successfully, result: ' . json_encode($result)); |
| 182 | 182 | $this->flashSuccess('E-mail byl úspěšně odeslán'); |
| 183 | 183 | } catch(Exception $e) { |
| 184 | - $this->logError('Sending of e-mail failed, result: ' . $e->getMessage()); |
|
| 184 | + $this->logError('Sending of e-mail failed, result: ' . $e->getMessage()); |
|
| 185 | 185 | $this->flashFailure('Sending of e-mail failed, result: ' . $e->getMessage()); |
| 186 | 186 | } |
| 187 | 187 | |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | json_encode($id), |
| 242 | 242 | $e->getMessage(), |
| 243 | 243 | ]); |
| 244 | - $this->flashFailure('Zaplacení zálohy pro účastníka s id '.json_encode($id).' neprošlo: '.$e->getMessage()); |
|
| 244 | + $this->flashFailure('Zaplacení zálohy pro účastníka s id ' . json_encode($id) . ' neprošlo: ' . $e->getMessage()); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $this->redirect(self::REDIRECT_DEFAULT); |
@@ -257,10 +257,10 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | try { |
| 259 | 259 | $result = $this->getVisitorRepository()->setChecked($id); |
| 260 | - $this->logInfo('Check of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 260 | + $this->logInfo('Check of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 261 | 261 | $this->flashSuccess('Položka byla úspěšně zkontrolována'); |
| 262 | 262 | } catch(Exception $e) { |
| 263 | - $this->logError('Check of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 263 | + $this->logError('Check of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 264 | 264 | $this->flashFailure('Check of visitor failed, result: ' . $e->getMessage()); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -277,10 +277,10 @@ discard block |
||
| 277 | 277 | { |
| 278 | 278 | try { |
| 279 | 279 | $result = $this->getVisitorRepository()->setUnchecked($id); |
| 280 | - $this->logInfo('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result)); |
|
| 280 | + $this->logInfo('Uncheck of visitor(' . $id . ') successfull, result: ' . json_encode($result)); |
|
| 281 | 281 | $this->flashSuccess('Položka byla nastavena jako nekontrolována'); |
| 282 | 282 | } catch(Exception $e) { |
| 283 | - $this->logError('Uncheck of visitor('. $id .') failed, result: ' . $e->getMessage()); |
|
| 283 | + $this->logError('Uncheck of visitor(' . $id . ') failed, result: ' . $e->getMessage()); |
|
| 284 | 284 | $this->flashFailure('Uncheck of visitor failed, result: ' . $e->getMessage()); |
| 285 | 285 | } |
| 286 | 286 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * @param int $id |
| 56 | - * @return Nette\Database\Table\ActiveRow |
|
| 56 | + * @return ActiveRow |
|
| 57 | 57 | */ |
| 58 | 58 | public function find(int $id): ActiveRow |
| 59 | 59 | { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | /** |
| 82 | 82 | * @param int $programId |
| 83 | - * @return array |
|
| 83 | + * @return ActiveRow |
|
| 84 | 84 | */ |
| 85 | 85 | public function findTutor(int $programId): ActiveRow |
| 86 | 86 | { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
| 100 | - * @param Nette\Utils\ArrayHash $program |
|
| 100 | + * @param ArrayHash $program |
|
| 101 | 101 | * @return boolean |
| 102 | 102 | */ |
| 103 | 103 | public function create(ArrayHash $program) |
@@ -108,8 +108,8 @@ discard block |
||
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * @param Nette\Utils\ArrayHash $program |
|
| 112 | - * @return boolean |
|
| 111 | + * @param ArrayHash $program |
|
| 112 | + * @return integer|null |
|
| 113 | 113 | */ |
| 114 | 114 | public function update(int $id, ArrayHash $program) |
| 115 | 115 | { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | /** |
| 122 | 122 | * @param int $id |
| 123 | - * @return boolean |
|
| 123 | + * @return integer|null |
|
| 124 | 124 | */ |
| 125 | 125 | public function delete(int $id) |
| 126 | 126 | { |
@@ -157,8 +157,8 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | - * @param Nette\Utils\ArrayHash $program |
|
| 161 | - * @return Nette\Utils\ArrayHash |
|
| 160 | + * @param ArrayHash $program |
|
| 161 | + * @return ArrayHash |
|
| 162 | 162 | */ |
| 163 | 163 | protected function transformDisplayInRegValue(ArrayHash $program): ArrayHash |
| 164 | 164 | { |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | return $this->getProgramModel()->findByVisitorId($visitorId); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * @param int $blockId |
|
| 74 | - * @return array |
|
| 75 | - */ |
|
| 76 | - public function findByBlockId(int $blockId): array |
|
| 77 | - { |
|
| 78 | - return $this->getProgramModel()->findByBlockId($blockId); |
|
| 72 | + /** |
|
| 73 | + * @param int $blockId |
|
| 74 | + * @return array |
|
| 75 | + */ |
|
| 76 | + public function findByBlockId(int $blockId): array |
|
| 77 | + { |
|
| 78 | + return $this->getProgramModel()->findByBlockId($blockId); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -127,13 +127,13 @@ discard block |
||
| 127 | 127 | return $this->getProgramModel()->delete($id); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - /** |
|
| 131 | - * @param int $programId |
|
| 132 | - * @return int |
|
| 133 | - */ |
|
| 134 | - public function countVisitors(int $programId): int |
|
| 135 | - { |
|
| 136 | - return $this->getProgramModel()->countProgramVisitors($programId); |
|
| 130 | + /** |
|
| 131 | + * @param int $programId |
|
| 132 | + * @return int |
|
| 133 | + */ |
|
| 134 | + public function countVisitors(int $programId): int |
|
| 135 | + { |
|
| 136 | + return $this->getProgramModel()->countProgramVisitors($programId); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |