@@ -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; |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | { |
| 44 | 44 | $id = __FUNCTION__; |
| 45 | 45 | // cache by the request |
| 46 | - if (!($res = $this->load($id))) { |
|
| 46 | + if(!($res = $this->load($id))) { |
|
| 47 | 47 | $res = $this->save($id, $this->skautis->user->UserDetail()); |
| 48 | 48 | } |
| 49 | 49 | return $res; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function updateSkautISRole($id) |
| 60 | 60 | { |
| 61 | 61 | $unitId = $this->skautis->user->LoginUpdate(array("ID_UserRole" => $id, "ID" => $this->skautis->getToken())); |
| 62 | - if ($unitId) { |
|
| 62 | + if($unitId) { |
|
| 63 | 63 | $this->skautis->setRoleId($id); |
| 64 | 64 | $this->skautis->setUnitId($unitId->ID_Unit); |
| 65 | 65 | } |
@@ -157,17 +157,17 @@ discard block |
||
| 157 | 157 | )); |
| 158 | 158 | |
| 159 | 159 | // returns boolean if certain function for verifying is set |
| 160 | - if ($ID_Action !== NULL) { |
|
| 161 | - if ($res instanceof stdClass) { |
|
| 160 | + if($ID_Action !== NULL) { |
|
| 161 | + if($res instanceof stdClass) { |
|
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | - if (is_array($res)) { |
|
| 164 | + if(is_array($res)) { |
|
| 165 | 165 | return true; |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | - if (is_array($res)) { |
|
| 168 | + if(is_array($res)) { |
|
| 169 | 169 | $tmp = array(); |
| 170 | - foreach ($res as $v) { |
|
| 170 | + foreach($res as $v) { |
|
| 171 | 171 | $tmp[$v->ID] = $v; |
| 172 | 172 | } |
| 173 | 173 | return $tmp; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | * @return void |
| 9 | 9 | */ |
| 10 | 10 | function dd() { |
| 11 | - array_map(function ($x){ |
|
| 11 | + array_map(function($x) { |
|
| 12 | 12 | (\Tracy\Debugger::dump($x)); |
| 13 | 13 | }, func_get_args()); |
| 14 | 14 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | Debugger::log('Destroying of program successfull, result: ' . json_encode($result), Debugger::INFO); |
| 140 | 140 | $this->flashMessage('Položka byla úspěšně smazána.', 'ok'); |
| 141 | 141 | } catch(Exception $e) { |
| 142 | - Debugger::log('Destroying of program failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 142 | + Debugger::log('Destroying of program failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 143 | 143 | $this->flashMessage('Smazání programu se nezdařilo, result: ' . $e->getMessage(), 'error'); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | Debugger::log('Sending email to program tutor successfull, result: ' . json_encode($recipients) . ', ' . $tutors->guid, Debugger::INFO); |
| 183 | 183 | $this->flashMessage('Email lektorovi byl odeslán..', 'ok'); |
| 184 | 184 | } catch(Exception $e) { |
| 185 | - Debugger::log('Sending email to program tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 185 | + Debugger::log('Sending email to program tutor failed, result: ' . $e->getMessage(), Debugger::ERROR); |
|
| 186 | 186 | $this->flashMessage('Email lektorovi nebyl odeslán, result: ' . $e->getMessage(), 'error'); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | $template->error_material = ''; |
| 244 | 244 | $template->display_in_reg_checkbox = $this->renderHtmlCheckBox('display_in_reg', 0, 1); |
| 245 | 245 | $template->block_select = $this->getBlockModel()->renderHtmlSelect(null); |
| 246 | - $template->selectedCategory = null; |
|
| 246 | + $template->selectedCategory = null; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | /** |
@@ -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 | |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | Debugger::log('Settings: mail type ' . $id . ' succesfully send to recipient ' . $recipient, Debugger::INFO); |
| 68 | 68 | $this->flashMessage('Settings: mail type ' . $id . ' succesfully send.', 'ok'); |
| 69 | - } catch (Exception $e) { |
|
| 69 | + } catch(Exception $e) { |
|
| 70 | 70 | Debugger::log('Settings: mail type ' . $id . ' send to recipient ' . $recipient . ' failed, result: ' . $e->getMessage(), Debugger::ERROR); |
| 71 | 71 | $this->flashMessage('Settings: mail type ' . $id . ' send to recipient failed, result: ' . $e->getMessage(), 'error'); |
| 72 | 72 | } |
@@ -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 { |
@@ -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 | |
@@ -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 | |