@@ -64,7 +64,7 @@ |
||
| 64 | 64 | /** |
| 65 | 65 | * @param integer $visitorId |
| 66 | 66 | * @param array $data |
| 67 | - * @return ActiveRow |
|
| 67 | + * @return integer|null |
|
| 68 | 68 | */ |
| 69 | 69 | public function update($visitorId, array $data) |
| 70 | 70 | { |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | ->where('visitor', $visitorId) |
| 101 | 101 | ->fetchAll(); |
| 102 | 102 | |
| 103 | - if(!$result){ |
|
| 103 | + if(!$result) { |
|
| 104 | 104 | $meals .= "<div class='emptyTable' style='width:400px;'>Nejsou žádná aktuální data.</div>\n"; |
| 105 | 105 | } else { |
| 106 | - foreach($result as $mealData){ |
|
| 107 | - $meals .= "<div class='block'>".$mealData['fry_dinner'].", ".$mealData['sat_breakfast']." - ".$mealData['sat_lunch']." : ".$mealData['sat_dinner']."</div>\n"; |
|
| 106 | + foreach($result as $mealData) { |
|
| 107 | + $meals .= "<div class='block'>" . $mealData['fry_dinner'] . ", " . $mealData['sat_breakfast'] . " - " . $mealData['sat_lunch'] . " : " . $mealData['sat_dinner'] . "</div>\n"; |
|
| 108 | 108 | |
| 109 | 109 | } |
| 110 | 110 | } |
@@ -130,21 +130,21 @@ discard block |
||
| 130 | 130 | $yesNoArray = array('ne', 'ano'); |
| 131 | 131 | |
| 132 | 132 | $htmlSelect = ''; |
| 133 | - foreach(static::$dayMeal as $title => $varName){ |
|
| 133 | + foreach(static::$dayMeal as $title => $varName) { |
|
| 134 | 134 | if(preg_match('/breakfast/', $varName)) $mealIcon = 'breakfast'; |
| 135 | 135 | if(preg_match('/lunch/', $varName)) $mealIcon = 'lunch'; |
| 136 | 136 | if(preg_match('/dinner/', $varName)) $mealIcon = 'dinner'; |
| 137 | 137 | |
| 138 | - $htmlSelect .= "<span style='display:block;font-size:11px;'>".$title.":</span>\n"; |
|
| 139 | - $htmlSelect .= "<img style='width:18px;' src='".IMG_DIR."icons/".$mealIcon.".png' />\n"; |
|
| 140 | - $htmlSelect .= "<select ".$disabled." style='width:195px; font-size:11px;margin-left:5px;' name='".$varName."'>\n"; |
|
| 138 | + $htmlSelect .= "<span style='display:block;font-size:11px;'>" . $title . ":</span>\n"; |
|
| 139 | + $htmlSelect .= "<img style='width:18px;' src='" . IMG_DIR . "icons/" . $mealIcon . ".png' />\n"; |
|
| 140 | + $htmlSelect .= "<select " . $disabled . " style='width:195px; font-size:11px;margin-left:5px;' name='" . $varName . "'>\n"; |
|
| 141 | 141 | |
| 142 | - foreach ($yesNoArray as $key){ |
|
| 143 | - if($key == $mealsValue[$varName]){ |
|
| 142 | + foreach($yesNoArray as $key) { |
|
| 143 | + if($key == $mealsValue[$varName]) { |
|
| 144 | 144 | $selected = "selected"; |
| 145 | 145 | } |
| 146 | 146 | else $selected = ""; |
| 147 | - $htmlSelect .= "<option value='".$key."' ".$selected.">".$key."</option>"; |
|
| 147 | + $htmlSelect .= "<option value='" . $key . "' " . $selected . ">" . $key . "</option>"; |
|
| 148 | 148 | } |
| 149 | 149 | $htmlSelect .= "</select><br />\n"; |
| 150 | 150 | } |
@@ -131,9 +131,15 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $htmlSelect = ''; |
| 133 | 133 | foreach(static::$dayMeal as $title => $varName){ |
| 134 | - if(preg_match('/breakfast/', $varName)) $mealIcon = 'breakfast'; |
|
| 135 | - if(preg_match('/lunch/', $varName)) $mealIcon = 'lunch'; |
|
| 136 | - if(preg_match('/dinner/', $varName)) $mealIcon = 'dinner'; |
|
| 134 | + if(preg_match('/breakfast/', $varName)) { |
|
| 135 | + $mealIcon = 'breakfast'; |
|
| 136 | + } |
|
| 137 | + if(preg_match('/lunch/', $varName)) { |
|
| 138 | + $mealIcon = 'lunch'; |
|
| 139 | + } |
|
| 140 | + if(preg_match('/dinner/', $varName)) { |
|
| 141 | + $mealIcon = 'dinner'; |
|
| 142 | + } |
|
| 137 | 143 | |
| 138 | 144 | $htmlSelect .= "<span style='display:block;font-size:11px;'>".$title.":</span>\n"; |
| 139 | 145 | $htmlSelect .= "<img style='width:18px;' src='".IMG_DIR."icons/".$mealIcon.".png' />\n"; |
@@ -142,8 +148,9 @@ discard block |
||
| 142 | 148 | foreach ($yesNoArray as $key){ |
| 143 | 149 | if($key == $mealsValue[$varName]){ |
| 144 | 150 | $selected = "selected"; |
| 151 | + } else { |
|
| 152 | + $selected = ""; |
|
| 145 | 153 | } |
| 146 | - else $selected = ""; |
|
| 147 | 154 | $htmlSelect .= "<option value='".$key."' ".$selected.">".$key."</option>"; |
| 148 | 155 | } |
| 149 | 156 | $htmlSelect .= "</select><br />\n"; |
@@ -211,6 +211,8 @@ discard block |
||
| 211 | 211 | * @param string name |
| 212 | 212 | * @param mixed value |
| 213 | 213 | * @param var variable that match with value |
| 214 | + * @param string $name |
|
| 215 | + * @param integer $value |
|
| 214 | 216 | * @return string html of chceck box |
| 215 | 217 | */ |
| 216 | 218 | protected function renderHtmlCheckBox($name, $value, $checked_variable) |
@@ -266,7 +268,7 @@ discard block |
||
| 266 | 268 | } |
| 267 | 269 | |
| 268 | 270 | /** |
| 269 | - * @return Container |
|
| 271 | + * @return Nette\DI\Container |
|
| 270 | 272 | */ |
| 271 | 273 | protected function getContainer() |
| 272 | 274 | { |
@@ -405,6 +407,10 @@ discard block |
||
| 405 | 407 | return $this->getModel()->updateBy('guid', $guid, $data); |
| 406 | 408 | } |
| 407 | 409 | |
| 410 | + /** |
|
| 411 | + * @param string $key |
|
| 412 | + * @param integer $minutes |
|
| 413 | + */ |
|
| 408 | 414 | public function remember($key, $minutes, \Closure $callback) |
| 409 | 415 | { |
| 410 | 416 | // If the item exists in the cache we will just return this immediately |
@@ -447,7 +453,7 @@ discard block |
||
| 447 | 453 | } |
| 448 | 454 | |
| 449 | 455 | /** |
| 450 | - * @return string |
|
| 456 | + * @return boolean |
|
| 451 | 457 | */ |
| 452 | 458 | protected function getDebugMode() |
| 453 | 459 | { |
@@ -2,9 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Presenters; |
| 4 | 4 | |
| 5 | -use Nette, |
|
| 6 | - App\Model; |
|
| 7 | -use Nette\Utils\Strings; |
|
| 5 | +use Nette; |
|
| 6 | +use App\Model; |
|
| 8 | 7 | use Nette\Http\Request; |
| 9 | 8 | use App\Models\SunlightModel; |
| 10 | 9 | use Nette\Caching\Cache; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * category ID |
| 156 | 156 | * @var integer |
| 157 | 157 | */ |
| 158 | - protected $itemId = NULL; |
|
| 158 | + protected $itemId = null; |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * action what to do |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * database connection |
| 198 | 198 | * @var string |
| 199 | 199 | */ |
| 200 | - protected $database = NULL; |
|
| 200 | + protected $database = null; |
|
| 201 | 201 | |
| 202 | 202 | /** |
| 203 | 203 | * debug mode |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | 50 | protected $hours = [ |
| 51 | - 0 => "00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23" |
|
| 51 | + 0 => "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" |
|
| 52 | 52 | ]; |
| 53 | 53 | |
| 54 | 54 | protected $minutes = [ |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->setBacklink($backlink); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if($meetingId){ |
|
| 83 | + if($meetingId) { |
|
| 84 | 84 | $_SESSION['meetingID'] = $meetingId; |
| 85 | 85 | } elseif(!isset($_SESSION['meetingID'])) { |
| 86 | 86 | $meeting = $this->getContainer()->getService('meeting'); |
@@ -121,16 +121,16 @@ discard block |
||
| 121 | 121 | $template->expDir = EXP_DIR; |
| 122 | 122 | $template->meetDir = MEET_DIR; |
| 123 | 123 | |
| 124 | - $template->categories = $this->remember('categories:all', 10, function () { |
|
| 124 | + $template->categories = $this->remember('categories:all', 10, function() { |
|
| 125 | 125 | return $this->getContainer()->getService('category')->all(); |
| 126 | 126 | }); |
| 127 | 127 | |
| 128 | - if(isset($_SESSION[SESSION_PREFIX.'user'])) { |
|
| 129 | - $template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX.'user']); |
|
| 128 | + if(isset($_SESSION[SESSION_PREFIX . 'user'])) { |
|
| 129 | + $template->user = $this->getSunlight()->findUser($_SESSION[SESSION_PREFIX . 'user']); |
|
| 130 | 130 | } |
| 131 | 131 | $template->meeting = $meeting->getPlaceAndYear($_SESSION['meetingID']); |
| 132 | 132 | $template->menuItems = $meeting->getMenuItems(); |
| 133 | - $template->meeting_heading = $meeting->getRegHeading(); |
|
| 133 | + $template->meeting_heading = $meeting->getRegHeading(); |
|
| 134 | 134 | $template->meetingId = $this->getMeetingId(); |
| 135 | 135 | $template->backlinkUrl = $this->getBacklinkUrl(); |
| 136 | 136 | $template->backlink = $this->getBacklink(); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } else { |
| 222 | 222 | $checked = ''; |
| 223 | 223 | } |
| 224 | - $html_checkbox = "<input name='".$name."' type='checkbox' value='".$value."' ".$checked." />"; |
|
| 224 | + $html_checkbox = "<input name='" . $name . "' type='checkbox' value='" . $value . "' " . $checked . " />"; |
|
| 225 | 225 | |
| 226 | 226 | return $html_checkbox; |
| 227 | 227 | } |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $names = explode(',', $item->tutor); |
| 233 | 233 | |
| 234 | 234 | $i = 0; |
| 235 | - foreach ($mails as $mail) { |
|
| 235 | + foreach($mails as $mail) { |
|
| 236 | 236 | $mail = trim($mail); |
| 237 | 237 | $name = trim($names[$i]); |
| 238 | 238 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | // zaheshovane udaje, aby se nedali jen tak ziskat data z databaze |
| 246 | 246 | protected function formKeyHash($id, $meetingId) |
| 247 | 247 | { |
| 248 | - return ((int)$id . $meetingId) * 116 + 39147; |
|
| 248 | + return ((int) $id . $meetingId) * 116 + 39147; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | /** |
@@ -411,12 +411,12 @@ discard block |
||
| 411 | 411 | // If the item exists in the cache we will just return this immediately |
| 412 | 412 | // otherwise we will execute the given Closure and cache the result |
| 413 | 413 | // of that execution for the given number of minutes in storage. |
| 414 | - if (! is_null($data = $this->getCache()->load($key))) { |
|
| 414 | + if(!is_null($data = $this->getCache()->load($key))) { |
|
| 415 | 415 | $items = []; |
| 416 | 416 | |
| 417 | 417 | foreach($data as $item) { |
| 418 | 418 | $object = new \stdClass(); |
| 419 | - foreach ($item as $key => $value) { |
|
| 419 | + foreach($item as $key => $value) { |
|
| 420 | 420 | $object->$key = $value; |
| 421 | 421 | } |
| 422 | 422 | $items[] = $object; |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | $data = $callback(); |
| 429 | 429 | $serialized = []; |
| 430 | - foreach ($data as $item) { |
|
| 430 | + foreach($data as $item) { |
|
| 431 | 431 | $serialized[] = $item->toArray(); |
| 432 | 432 | } |
| 433 | 433 | |
@@ -300,6 +300,8 @@ |
||
| 300 | 300 | * @param array content of slect box |
| 301 | 301 | * @param var variable that match selected option |
| 302 | 302 | * @param string inline styling |
| 303 | + * @param string $name |
|
| 304 | + * @param string $inline_style |
|
| 303 | 305 | * @return string html of select box |
| 304 | 306 | */ |
| 305 | 307 | private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * @var integer |
| 25 | 25 | */ |
| 26 | - private $blockId = NULL; |
|
| 26 | + private $blockId = null; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @var Emailer |
@@ -302,9 +302,9 @@ discard block |
||
| 302 | 302 | * @param string inline styling |
| 303 | 303 | * @return string html of select box |
| 304 | 304 | */ |
| 305 | - private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
|
| 305 | + private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = null) |
|
| 306 | 306 | { |
| 307 | - if(isset($inline_style) && $inline_style != NULL){ |
|
| 307 | + if(isset($inline_style) && $inline_style != null){ |
|
| 308 | 308 | $style = " style='".$inline_style."'"; |
| 309 | 309 | } else { |
| 310 | 310 | $style = ""; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $template->day_roll = $this->renderHtmlSelectBox('day', $this->days, null, 'width:172px;'); |
| 61 | 61 | $template->hour_roll = $this->renderHtmlSelectBox('start_hour', $this->hours, date('H')); |
| 62 | 62 | $template->minute_roll = $this->renderHtmlSelectBox('start_minute', $this->minutes, date('i')); |
| 63 | - $template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H')+1); |
|
| 63 | + $template->end_hour_roll = $this->renderHtmlSelectBox('end_hour', $this->hours, date('H') + 1); |
|
| 64 | 64 | $template->end_minute_roll = $this->renderHtmlSelectBox('end_minute', $this->minutes, date('i')); |
| 65 | 65 | // is program block check box |
| 66 | 66 | $template->program_checkbox = $this->renderHtmlCheckBox('program', 1, 0); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | Debugger::log('Destroying of block successfull, result: ' . json_encode($result), Debugger::INFO); |
| 174 | 174 | $this->flashMessage('Položka byla úspěšně smazána.', 'ok'); |
| 175 | 175 | } catch(Exception $e) { |
| 176 | - Debugger::log('Destroying of block failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 176 | + Debugger::log('Destroying of block failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 177 | 177 | $this->flashMessage('Destroying of block failed, result: ' . $e->getMessage(), 'error'); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | Debugger::log('Sending email to block tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO); |
| 197 | 197 | $this->flashMessage('Email lektorovi byl odeslán..', 'ok'); |
| 198 | 198 | } catch(Exception $e) { |
| 199 | - Debugger::log('Sending email to block tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 199 | + Debugger::log('Sending email to block tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 200 | 200 | $this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error'); |
| 201 | 201 | } |
| 202 | 202 | |
@@ -304,19 +304,19 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | private function renderHtmlSelectBox($name, $select_content, $selected_option, $inline_style = NULL) |
| 306 | 306 | { |
| 307 | - if(isset($inline_style) && $inline_style != NULL){ |
|
| 308 | - $style = " style='".$inline_style."'"; |
|
| 307 | + if(isset($inline_style) && $inline_style != NULL) { |
|
| 308 | + $style = " style='" . $inline_style . "'"; |
|
| 309 | 309 | } else { |
| 310 | 310 | $style = ""; |
| 311 | 311 | } |
| 312 | - $html_select = "<select name='".$name."'".$style.">"; |
|
| 313 | - foreach ($select_content as $key => $value) { |
|
| 312 | + $html_select = "<select name='" . $name . "'" . $style . ">"; |
|
| 313 | + foreach($select_content as $key => $value) { |
|
| 314 | 314 | if($key == $selected_option) { |
| 315 | 315 | $selected = 'selected'; |
| 316 | 316 | } else { |
| 317 | 317 | $selected = ''; |
| 318 | 318 | } |
| 319 | - $html_select .= "<option value='".$key."' ".$selected.">".$value."</option>"; |
|
| 319 | + $html_select .= "<option value='" . $key . "' " . $selected . ">" . $value . "</option>"; |
|
| 320 | 320 | } |
| 321 | 321 | $html_select .= '</select>'; |
| 322 | 322 | |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Presenters; |
| 4 | 4 | |
| 5 | -use Nette\Database\Context; |
|
| 6 | 5 | use Tracy\Debugger; |
| 7 | 6 | use App\Services\Emailer; |
| 8 | 7 | use App\Models\BlockModel; |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | /** |
| 199 | - * @param integer|string $ids |
|
| 199 | + * @param integer|string $id |
|
| 200 | 200 | * @return void |
| 201 | 201 | */ |
| 202 | 202 | 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($id) |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
| 364 | - * @return Latte |
|
| 364 | + * @return \Nette\Application\UI\ITemplate |
|
| 365 | 365 | */ |
| 366 | 366 | protected function createMailTemplate() |
| 367 | 367 | { |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use App\Models\MealModel; |
| 9 | 9 | use App\Services\Emailer; |
| 10 | 10 | use App\Services\VisitorService; |
| 11 | -use Nette\Utils\Strings; |
|
| 12 | 11 | use Tracy\Debugger; |
| 13 | 12 | use Exception; |
| 14 | 13 | |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $guid = $this->getVisitorService()->create($postData); |
| 100 | 100 | $result = $this->sendRegistrationSummary($postData, $guid); |
| 101 | 101 | |
| 102 | - Debugger::log('Creation of visitor('. $guid .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 102 | + Debugger::log('Creation of visitor(' . $guid . ') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 103 | 103 | $this->flashMessage('Účastník(' . $guid . ') byl úspěšně vytvořen.', 'ok'); |
| 104 | 104 | } catch(Exception $e) { |
| 105 | - Debugger::log('Creation of visitor('. $guid .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 105 | + Debugger::log('Creation of visitor(' . $guid . ') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 106 | 106 | $this->flashMessage('Creation of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | //$result = $this->sendRegistrationSummary($visitor, $guid); |
| 128 | 128 | |
| 129 | - Debugger::log('Modification of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 129 | + Debugger::log('Modification of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 130 | 130 | $this->flashMessage('Účastník(' . $id . ') byl úspěšně upraven.', 'ok'); |
| 131 | 131 | } catch(Exception $e) { |
| 132 | - Debugger::log('Modification of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 132 | + Debugger::log('Modification of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 133 | 133 | $this->flashMessage('Modification of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -145,10 +145,10 @@ discard block |
||
| 145 | 145 | try { |
| 146 | 146 | $result = $this->getVisitorService()->delete($id); |
| 147 | 147 | |
| 148 | - Debugger::log('Destroying of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 148 | + Debugger::log('Destroying of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 149 | 149 | $this->flashMessage('Položka byla úspěšně smazána', 'ok'); |
| 150 | 150 | } catch(Exception $e) { |
| 151 | - Debugger::log('Destroying of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 151 | + Debugger::log('Destroying of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 152 | 152 | $this->flashMessage('Destroying of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | Debugger::log('E-mail was send successfully, result: ' . json_encode($result), Debugger::INFO); |
| 185 | 185 | $this->flashMessage('E-mail byl úspěšně odeslán', 'ok'); |
| 186 | 186 | } catch(Exception $e) { |
| 187 | - Debugger::log('Sending of e-mail failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 187 | + Debugger::log('Sending of e-mail failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 188 | 188 | $this->flashMessage('Sending of e-mail failed, result: ' . $e->getMessage(), 'error'); |
| 189 | 189 | } |
| 190 | 190 | |
@@ -245,10 +245,10 @@ discard block |
||
| 245 | 245 | { |
| 246 | 246 | try { |
| 247 | 247 | $result = $this->getModel()->checked($id, '1'); |
| 248 | - Debugger::log('Check of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 248 | + Debugger::log('Check of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 249 | 249 | $this->flashMessage('Položka byla úspěšně zkontrolována', 'ok'); |
| 250 | 250 | } catch(Exception $e) { |
| 251 | - Debugger::log('Check of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 251 | + Debugger::log('Check of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 252 | 252 | $this->flashMessage('Check of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 253 | 253 | } |
| 254 | 254 | |
@@ -265,10 +265,10 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | try { |
| 267 | 267 | $result = $this->getModel()->checked($id, 0); |
| 268 | - Debugger::log('Uncheck of visitor('. $id .') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 268 | + Debugger::log('Uncheck of visitor(' . $id . ') successfull, result: ' . json_encode($result), Debugger::INFO); |
|
| 269 | 269 | $this->flashMessage('Položka byla nastavena jako nekontrolována', 'ok'); |
| 270 | 270 | } catch(Exception $e) { |
| 271 | - Debugger::log('Uncheck of visitor('. $id .') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 271 | + Debugger::log('Uncheck of visitor(' . $id . ') failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 272 | 272 | $this->flashMessage('Uncheck of visitor failed, result: ' . $e->getMessage(), 'error'); |
| 273 | 273 | } |
| 274 | 274 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | protected function sendRegistrationSummary(array $visitor, $guid) |
| 382 | 382 | { |
| 383 | 383 | $recipient = [ |
| 384 | - $visitor['email'] => $visitor['name']. ' ' . $visitor['surname'], |
|
| 384 | + $visitor['email'] => $visitor['name'] . ' ' . $visitor['surname'], |
|
| 385 | 385 | ]; |
| 386 | 386 | |
| 387 | 387 | $code4bank = $this->getVisitorService()->calculateCode4Bank($visitor); |
@@ -2,10 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace App\Routers; |
| 4 | 4 | |
| 5 | -use Nette, |
|
| 6 | - Nette\Application\Routers\RouteList, |
|
| 7 | - Nette\Application\Routers\Route, |
|
| 8 | - Nette\Application\Routers\SimpleRouter; |
|
| 5 | +use Nette; |
|
| 6 | +use Nette\Application\Routers\RouteList; |
|
| 7 | +use Nette\Application\Routers\Route; |
|
| 9 | 8 | |
| 10 | 9 | |
| 11 | 10 | /** |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * Save value to local storage |
| 70 | 70 | * |
| 71 | - * @param mixed $id |
|
| 71 | + * @param string $id |
|
| 72 | 72 | * @param mixed $val |
| 73 | 73 | * @return mixed |
| 74 | 74 | */ |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Get object from local storage |
| 86 | 86 | * |
| 87 | - * @param string|int $id |
|
| 87 | + * @param string $id |
|
| 88 | 88 | * @return mixed|FALSE |
| 89 | 89 | */ |
| 90 | 90 | protected function load($id) |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | protected function save($id, $val) |
| 76 | 76 | { |
| 77 | - if ($this->useCache) { |
|
| 77 | + if($this->useCache) { |
|
| 78 | 78 | self::$storage[$id] = $val; |
| 79 | 79 | } |
| 80 | 80 | return $val; |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | protected function load($id) |
| 91 | 91 | { |
| 92 | - if ($this->useCache && array_key_exists($id, self::$storage)) { |
|
| 92 | + if($this->useCache && array_key_exists($id, self::$storage)) { |
|
| 93 | 93 | return self::$storage[$id]; |
| 94 | 94 | } |
| 95 | 95 | return FALSE; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * Use local storage (cache)? |
| 30 | 30 | * @var bool |
| 31 | 31 | */ |
| 32 | - private $useCache = TRUE; |
|
| 32 | + private $useCache = true; |
|
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * Construct |
| 44 | 44 | */ |
| 45 | - public function __construct(Skautis $skautIS = NULL) |
|
| 45 | + public function __construct(Skautis $skautIS = null) |
|
| 46 | 46 | { |
| 47 | 47 | $this->skautis = $skautIS; |
| 48 | 48 | self::$storage = array(); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | if ($this->useCache && array_key_exists($id, self::$storage)) { |
| 93 | 93 | return self::$storage[$id]; |
| 94 | 94 | } |
| 95 | - return FALSE; |
|
| 95 | + return false; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | |
| 14 | 14 | /** @var integer */ |
| 15 | - private $categoryId = NULL; |
|
| 15 | + private $categoryId = null; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @param CategoryModel $model |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | Debugger::log('Destroying of category successfull, result: ' . json_encode($result), Debugger::INFO); |
| 36 | 36 | $this->flashMessage('Položka byla úspěšně smazána', 'ok'); |
| 37 | 37 | } catch(Exception $e) { |
| 38 | - Debugger::log('Destroying of category failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 38 | + Debugger::log('Destroying of category failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 39 | 39 | $this->flashMessage('Destroying of category failed, result: ' . $e->getMessage(), 'error'); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use \Exception; |
| 6 | 6 | use Tracy\Debugger; |
| 7 | -use Nette\Database\Context; |
|
| 8 | 7 | use App\Models\CategoryModel; |
| 9 | 8 | |
| 10 | 9 | class CategoryPresenter extends BasePresenter |
@@ -417,7 +417,7 @@ |
||
| 417 | 417 | |
| 418 | 418 | $this->getPdf()->setMargins(15, 15, 10, 5); |
| 419 | 419 | $this->getPdf()->SetWatermarkImage(IMG_DIR . 'logos/watermark-waves.jpg', 0.1, ''); |
| 420 | - $this->getPdf()->showWatermarkImage = TRUE; |
|
| 420 | + $this->getPdf()->showWatermarkImage = true; |
|
| 421 | 421 | |
| 422 | 422 | $parameters = [ |
| 423 | 423 | 'result' => $badges, |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $this->redirect('Export:listing'); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - switch($type){ |
|
| 112 | + switch($type) { |
|
| 113 | 113 | case "summary": |
| 114 | 114 | $templateName = 'evidence_summary'; |
| 115 | 115 | // specific mPDF settings |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $attendanceHeader = $attendances[0]['place'] . ' ' . $attendances[0]['year']; |
| 152 | 152 | |
| 153 | 153 | // set header |
| 154 | - $this->getPdf()->SetHeader($attendanceHeader.'|sraz VS|Prezenční listina'); |
|
| 154 | + $this->getPdf()->SetHeader($attendanceHeader . '|sraz VS|Prezenční listina'); |
|
| 155 | 155 | |
| 156 | 156 | $parameters = [ |
| 157 | 157 | 'result' => $attendances, |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | public function renderMealTicket() |
| 171 | 171 | { |
| 172 | 172 | // output file name |
| 173 | - $this->filename= 'vlastni_stravenky.pdf'; |
|
| 173 | + $this->filename = 'vlastni_stravenky.pdf'; |
|
| 174 | 174 | $templateName = 'meal_ticket'; |
| 175 | 175 | |
| 176 | 176 | $mealTickets = $this->getModel()->mealTicket(); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | $namelistHeader = $nameList[0]['place'] . " " . $nameList[0]['year']; |
| 202 | 202 | |
| 203 | 203 | // set header |
| 204 | - $this->getPdf()->SetHeader($namelistHeader.'|sraz VS|Jméno, Příjmení, Přezdívka'); |
|
| 204 | + $this->getPdf()->SetHeader($namelistHeader . '|sraz VS|Jméno, Příjmení, Přezdívka'); |
|
| 205 | 205 | |
| 206 | 206 | $parameters = [ |
| 207 | 207 | 'result' => $nameList, |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $this->filename = Strings::toAscii($largeProgram['place'] . $largeProgram['year'] . '-program') . '.pdf'; |
| 259 | 259 | $templateName = 'program_large'; |
| 260 | 260 | |
| 261 | - $meetingHeader = $largeProgram['place']." ".$largeProgram['year']; |
|
| 261 | + $meetingHeader = $largeProgram['place'] . " " . $largeProgram['year']; |
|
| 262 | 262 | |
| 263 | 263 | $this->getPdf()->paperFormat = 'B1'; |
| 264 | 264 | |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | ]; |
| 320 | 320 | |
| 321 | 321 | $exportBlocks = []; |
| 322 | - foreach ($days as $day) { |
|
| 322 | + foreach($days as $day) { |
|
| 323 | 323 | $exportBlocks[$day] = $this->getBlockModel()->getExportBlocks($this->meetingId, $day); |
| 324 | 324 | } |
| 325 | 325 | |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | |
| 350 | 350 | $programHeader = $programs[0]['program']; |
| 351 | 351 | |
| 352 | - $this->getPdf()->SetHeader($programHeader.'|sraz VS|Účastnící programu'); |
|
| 352 | + $this->getPdf()->SetHeader($programHeader . '|sraz VS|Účastnící programu'); |
|
| 353 | 353 | |
| 354 | 354 | $parameters = [ |
| 355 | 355 | 'result' => $programs, |
@@ -406,9 +406,9 @@ discard block |
||
| 406 | 406 | if(!$namesStringified) { |
| 407 | 407 | $badges = $this->getModel()->nameBadges(); |
| 408 | 408 | } else { |
| 409 | - $namesStringified = preg_replace('/\s+/','',$namesStringified); |
|
| 409 | + $namesStringified = preg_replace('/\s+/', '', $namesStringified); |
|
| 410 | 410 | |
| 411 | - $names = explode(',',$namesStringified); |
|
| 411 | + $names = explode(',', $namesStringified); |
|
| 412 | 412 | foreach($names as $name) { |
| 413 | 413 | $badge['nick'] = $name; |
| 414 | 414 | $badges[] = $badge; |
@@ -530,17 +530,17 @@ discard block |
||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | // stahnuti souboru |
| 533 | - $filename = 'export-MS-'.date('Y-m-d',time()).'.xlsx'; |
|
| 533 | + $filename = 'export-MS-' . date('Y-m-d', time()) . '.xlsx'; |
|
| 534 | 534 | |
| 535 | 535 | $excel->setActiveSheetIndex(0); |
| 536 | 536 | |
| 537 | 537 | header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); |
| 538 | - header('Content-Disposition: attachment;filename="'.$filename.'"'); |
|
| 538 | + header('Content-Disposition: attachment;filename="' . $filename . '"'); |
|
| 539 | 539 | header('Cache-Control: max-age=0'); |
| 540 | 540 | |
| 541 | 541 | // If you're serving to IE over SSL, then the following may be needed |
| 542 | 542 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past |
| 543 | - header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified |
|
| 543 | + header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modified |
|
| 544 | 544 | header('Cache-Control: cache, must-revalidate'); // HTTP/1.1 |
| 545 | 545 | header('Pragma: public'); // HTTP/1.0 |
| 546 | 546 | |
@@ -558,7 +558,7 @@ discard block |
||
| 558 | 558 | { |
| 559 | 559 | $template = $this->getTemplate(); |
| 560 | 560 | |
| 561 | - foreach ($parameters as $parameter => $value) { |
|
| 561 | + foreach($parameters as $parameter => $value) { |
|
| 562 | 562 | $template->{$parameter} = $value; |
| 563 | 563 | } |
| 564 | 564 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | $template = $this->getTemplate(); |
| 581 | 581 | |
| 582 | 582 | /* debugging */ |
| 583 | - if($this->debugMode){ |
|
| 583 | + if($this->debugMode) { |
|
| 584 | 584 | echo $template; |
| 585 | 585 | exit('DEBUG_MODE'); |
| 586 | 586 | } else { |
@@ -633,7 +633,7 @@ discard block |
||
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /** |
| 636 | - * @return MaterialControl |
|
| 636 | + * @return MaterialsControl |
|
| 637 | 637 | */ |
| 638 | 638 | protected function createComponentMaterials() |
| 639 | 639 | { |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | /** |
| 644 | - * @param MaterialControl $control |
|
| 644 | + * @param MaterialsControl $control |
|
| 645 | 645 | * @return $this |
| 646 | 646 | */ |
| 647 | 647 | protected function setMaterialControl(MaterialsControl $control) |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | |
| 727 | 727 | |
| 728 | 728 | /** |
| 729 | - * @return PHPExcel |
|
| 729 | + * @return \PHPExcel |
|
| 730 | 730 | */ |
| 731 | 731 | protected function getExcel() |
| 732 | 732 | { |
@@ -734,7 +734,7 @@ discard block |
||
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | /** |
| 737 | - * @param PHPExcel $excel |
|
| 737 | + * @param \PHPExcel $excel |
|
| 738 | 738 | * @return $this |
| 739 | 739 | */ |
| 740 | 740 | protected function setExcel(\PHPExcel $excel) |
@@ -9,11 +9,11 @@ |
||
| 9 | 9 | * Never let user to set his ID himself. |
| 10 | 10 | * @author Hána František <[email protected]> |
| 11 | 11 | */ |
| 12 | -class SkautisAuthenticator extends Nette\Object implements Nette\Security\IAuthenticator |
|
| 13 | -{
|
|
| 12 | +class SkautisAuthenticator extends Nette\Object implements Nette\Security\IAuthenticator |
|
| 13 | +{ |
|
| 14 | 14 | |
| 15 | - public function authenticate(array $credentials) |
|
| 16 | - {
|
|
| 15 | + public function authenticate(array $credentials) |
|
| 16 | + { |
|
| 17 | 17 | $data = $credentials[0]; |
| 18 | 18 | return new Nette\Security\Identity($data->ID_User); |
| 19 | 19 | } |