Completed
Push — master ( 118c60...254398 )
by Litera
03:47
created
app/components/Forms/ProgramForm.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 	}
62 62
 
63 63
 	/**
64
-	 * @param  array $defaults
65
-	 * @return AnnotationForm
64
+	 * @param  ActiveRow $defaults
65
+	 * @return ProgramForm
66 66
 	 */
67 67
 	public function setDefaults(ActiveRow $defaults): ProgramForm
68 68
 	{
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 
191 191
 	/**
192
-	 * @param BlockRepository $blockRepository
192
+	 * @param BlockRepository $repository
193 193
 	 *
194 194
 	 * @return self
195 195
 	 */
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	}
210 210
 
211 211
 	/**
212
-	 * @param CategoryRepository $categoryRepository
212
+	 * @param CategoryRepository $repository
213 213
 	 *
214 214
 	 * @return self
215 215
 	 */
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Components\Forms;
4 4
 
5
-use App\Models\MeetingModel;
6 5
 use App\Repositories\BlockRepository;
7 6
 use App\Repositories\CategoryRepository;
8 7
 use Nette\Application\UI\Form;
Please login to merge, or discard this patch.
app/components/ProgramVisitorsControl.php 1 patch
Doc Comments   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
 	}
24 24
 
25 25
 	/**
26
-	 * @param  string $mealColumn
27
-	 * @param  string $mealName
28 26
 	 * @return void
29 27
 	 */
30 28
 	public function render(int $programId)
Please login to merge, or discard this patch.
app/presenters/ProgramPresenter.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
425 425
 	}
426 426
 
427 427
 	/**
428
-	 * @param  ProgramRepository $model
429 428
 	 * @return $this
430 429
 	 */
431 430
 	protected function setProgramRepository(ProgramRepository $repository):self
Please login to merge, or discard this patch.
app/components/Forms/Factories/IProgramFormFactory.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,9 +10,9 @@
 block discarded – undo
10 10
 interface IProgramFormFactory
11 11
 {
12 12
 
13
-    /**
14
-     * @return \App\Forms\ProgramForm
15
-     */
16
-    public function create(): ProgramForm;
13
+	/**
14
+	 * @return \App\Forms\ProgramForm
15
+	 */
16
+	public function create(): ProgramForm;
17 17
 
18 18
 }
Please login to merge, or discard this patch.
app/models/ProgramModel.php 3 patches
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Braces   +28 added lines, -14 removed lines patch added patch discarded remove patch
@@ -114,8 +114,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
app/components/Forms/RegistrationForm.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,6 @@
 block discarded – undo
25 25
 	protected $userService;
26 26
 
27 27
 	/**
28
-	 * @param ProvinceModel $model
29 28
 	 */
30 29
 	public function __construct(
31 30
 		ProvinceModel $province,
Please login to merge, or discard this patch.
app/components/Forms/VisitorForm.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -459,7 +459,7 @@
 block discarded – undo
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
 	{
Please login to merge, or discard this patch.
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/models/VisitorModel.php 3 patches
Doc Comments   +17 added lines, -15 removed lines patch added patch discarded remove patch
@@ -204,11 +204,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 	{
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,8 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/presenters/BasePresenter.php 2 patches
Unused Use Statements   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,10 +2,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -480,19 +480,19 @@
 block discarded – undo
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
Please login to merge, or discard this patch.