@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | public function getResourceEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
63 | 63 | { |
64 | - $this->logger->info("Fetch resource GET '/resource/".$args['id']."/edit'"); |
|
64 | + $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "/edit'"); |
|
65 | 65 | $d = DocumentQuery::create()->findPK($args['id']); |
66 | 66 | |
67 | 67 | if (!is_null($d)) { |
@@ -73,15 +73,15 @@ discard block |
||
73 | 73 | |
74 | 74 | public function getResourceFile(ServerRequestInterface $request, ResponseInterface $response, $args) |
75 | 75 | { |
76 | - $this->logger->info("Fetch resource GET '/resource/".$args['id']."'"); |
|
76 | + $this->logger->info("Fetch resource GET '/resource/" . $args['id'] . "'"); |
|
77 | 77 | $resource = DocumentQuery::create()->findPk($args['id']); |
78 | - $directory = __DIR__.'/../../../documents/'; |
|
78 | + $directory = __DIR__ . '/../../../documents/'; |
|
79 | 79 | |
80 | 80 | if (!is_null($resource)) { |
81 | - if (file_exists($directory.$resource->getUrl())) { |
|
82 | - $file = $directory.$resource->getUrl(); |
|
83 | - } elseif (file_exists($directory.$resource->getId())) { |
|
84 | - $file = $directory.$resource->getId(); |
|
81 | + if (file_exists($directory . $resource->getUrl())) { |
|
82 | + $file = $directory . $resource->getUrl(); |
|
83 | + } elseif (file_exists($directory . $resource->getId())) { |
|
84 | + $file = $directory . $resource->getId(); |
|
85 | 85 | } else { |
86 | 86 | return $this->view->render($response, 'error.twig'); |
87 | 87 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | ->withHeader('Content-Type', 'application/download') |
96 | 96 | ->withHeader('Content-Description', 'File Transfer') |
97 | 97 | ->withHeader('Content-Transfer-Encoding', 'binary') |
98 | - ->withHeader('Content-Disposition', 'attachment; filename="'.$resource->getUrl().'"') |
|
98 | + ->withHeader('Content-Disposition', 'attachment; filename="' . $resource->getUrl() . '"') |
|
99 | 99 | ->withHeader('Expires', '0') |
100 | 100 | ->withHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0') |
101 | 101 | ->withHeader('Pragma', 'public') |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | public function getGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
15 | 15 | { |
16 | - $this->logger->info("Fetch group GET '/group/".$args['id']."'"); |
|
16 | + $this->logger->info("Fetch group GET '/group/" . $args['id'] . "'"); |
|
17 | 17 | $events = EventQuery::create() |
18 | 18 | ->useEventPersonQuery() |
19 | 19 | ->useUserRoleQuery() |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function getGroupRoles(ServerRequestInterface $request, ResponseInterface $response, $args) |
38 | 38 | { |
39 | - $this->logger->info("Fetch group roles GET '/group/".$args['id']."/roles'"); |
|
39 | + $this->logger->info("Fetch group roles GET '/group/" . $args['id'] . "/roles'"); |
|
40 | 40 | $events = EventQuery::create() |
41 | 41 | ->useEventPersonQuery() |
42 | 42 | ->useUserRoleQuery() |
@@ -58,14 +58,14 @@ discard block |
||
58 | 58 | ->findPk($args['id']); |
59 | 59 | |
60 | 60 | // temporary redirect |
61 | - return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').'old/roles.php'); |
|
61 | + return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . 'old/roles.php'); |
|
62 | 62 | |
63 | 63 | return $this->view->render($response, 'group-roles.twig', ['events' => $events, 'group' => $group]); |
64 | 64 | } |
65 | 65 | |
66 | 66 | public function postGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
67 | 67 | { |
68 | - $this->logger->info("Create/edit group POST '/group/".$args['id']."'"); |
|
68 | + $this->logger->info("Create/edit group POST '/group/" . $args['id'] . "'"); |
|
69 | 69 | |
70 | 70 | $group = new Group(); |
71 | 71 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public function getAllEventsWithType(ServerRequestInterface $request, ResponseInterface $response, $args) |
33 | 33 | { |
34 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
34 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
35 | 35 | |
36 | 36 | $eventType = EventTypeQuery::create()->findPk($args['id']); |
37 | 37 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | public function getAllEventsWithSubType(ServerRequestInterface $request, ResponseInterface $response, $args) |
44 | 44 | { |
45 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
45 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
46 | 46 | |
47 | 47 | $eventType = EventSubTypeQuery::create()->findPk($args['id']); |
48 | 48 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $e->setCreatedBy($this->auth->currentUser()); |
86 | 86 | } |
87 | 87 | $e->setName($data['name']); |
88 | - $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'].' '.$data['time'])); |
|
88 | + $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'] . ' ' . $data['time'])); |
|
89 | 89 | $e->setEventTypeId($data['type']); |
90 | 90 | $e->setEventSubTypeId($data['subtype']); |
91 | 91 | $e->setLocationId($data['location']); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | public function getEvent(ServerRequestInterface $request, ResponseInterface $response, $args) |
120 | 120 | { |
121 | - $this->logger->info("Fetch event GET '/event/".$args['id']."'"); |
|
121 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "'"); |
|
122 | 122 | $e = EventQuery::create()->findPK($args['id']); |
123 | 123 | |
124 | 124 | if (!$e->authoriser()->readableBy($this->auth->currentUser())) { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | |
135 | 135 | public function getEventEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
136 | 136 | { |
137 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/edit'"); |
|
137 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/edit'"); |
|
138 | 138 | $e = EventQuery::create()->findPK($args['id']); |
139 | 139 | $l = LocationQuery::create()->orderByName()->find(); |
140 | 140 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | public function getEventCopyForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
151 | 151 | { |
152 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/copy'"); |
|
152 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/copy'"); |
|
153 | 153 | $e = EventQuery::create()->findPK($args['id']); |
154 | 154 | $l = LocationQuery::create()->orderByName()->find(); |
155 | 155 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | public function getEventAssignForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
166 | 166 | { |
167 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/assign'"); |
|
167 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/assign'"); |
|
168 | 168 | $e = EventQuery::create()->findPK($args['id']); |
169 | 169 | $ur = UserRoleQuery::create()->find(); |
170 | 170 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | |
178 | 178 | public function postEventAssign(ServerRequestInterface $request, ResponseInterface $response, $args) |
179 | 179 | { |
180 | - $this->logger->info("Create event people POST '/event".$args['id']."/assign'"); |
|
180 | + $this->logger->info("Create event people POST '/event" . $args['id'] . "/assign'"); |
|
181 | 181 | |
182 | 182 | $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT); |
183 | 183 | $existingUserRoles = UserRoleQuery::create()->useEventPersonQuery()->filterByEventId($eventId)->endUse()->find(); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | public function getAllEventsToPrintForGroup(ServerRequestInterface $request, ResponseInterface $response, $args) |
225 | 225 | { |
226 | - $this->logger->info("Fetch event printable page GET '/group/".$args['id']."/events'"); |
|
226 | + $this->logger->info("Fetch event printable page GET '/group/" . $args['id'] . "/events'"); |
|
227 | 227 | |
228 | 228 | $groupId = (int) $args['id']; |
229 | 229 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | |
270 | 270 | public function postEventComment(ServerRequestInterface $request, ResponseInterface $response, $args) |
271 | 271 | { |
272 | - $this->logger->info("Create event people POST '/event".$args['id']."/comment'"); |
|
272 | + $this->logger->info("Create event people POST '/event" . $args['id'] . "/comment'"); |
|
273 | 273 | |
274 | 274 | $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT); |
275 | 275 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | if ($availableCommits[0]['sha'] !== $commitHash) { |
93 | 93 | $updateAvailable = true; |
94 | 94 | |
95 | - $email = siteSettings()->getOwner().' <'.siteSettings()->getAdminEmailAddress().'>'; |
|
95 | + $email = siteSettings()->getOwner() . ' <' . siteSettings()->getAdminEmailAddress() . '>'; |
|
96 | 96 | $message = <<<'MESSAGE' |
97 | 97 | There is an update available for your installation of Rota. |
98 | 98 | |
@@ -114,23 +114,23 @@ discard block |
||
114 | 114 | WHERE |
115 | 115 | date >= CURDATE() |
116 | 116 | AND date_format( date , "%y-%m-%d" ) |
117 | - <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert.' DAY ) , "%y-%m-%d" )'; |
|
117 | + <= date_format( DATE_ADD(now(), INTERVAL '.$daysAlert . ' DAY ) , "%y-%m-%d" )'; |
|
118 | 118 | $resultEvents = mysqli_query(db(), $sqlEvents) or die(mysqli_error(db())); |
119 | 119 | $i = 0; |
120 | 120 | while ($rowEvents = mysqli_fetch_array($resultEvents, MYSQLI_ASSOC)) { |
121 | 121 | $usersNotified = notifyEveryoneForEvent($rowEvents['id']); |
122 | 122 | if (count($usersNotified) > 0) { |
123 | - $out = $out.'Automatic notifications sent to users ('.implode(', ', $usersNotified).') for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n"; |
|
123 | + $out = $out . 'Automatic notifications sent to users (' . implode(', ', $usersNotified) . ') for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n"; |
|
124 | 124 | } else { |
125 | - $out = $out.'No notifications sent for event '.$rowEvents['id'].' on '.$rowEvents['date'].".<br>\r\n"; |
|
125 | + $out = $out . 'No notifications sent for event ' . $rowEvents['id'] . ' on ' . $rowEvents['date'] . ".<br>\r\n"; |
|
126 | 126 | } |
127 | 127 | $i = $i + 1; |
128 | 128 | } |
129 | 129 | if ($i == 0) { |
130 | - $out = $out.'No events found to automatically notify for.'; |
|
130 | + $out = $out . 'No events found to automatically notify for.'; |
|
131 | 131 | } |
132 | 132 | } else { |
133 | - $out = $out.'Automatic notifications are disabled.'; |
|
133 | + $out = $out . 'Automatic notifications are disabled.'; |
|
134 | 134 | } ?> |
135 | 135 | <html> |
136 | 136 | <body> |
@@ -6,16 +6,16 @@ discard block |
||
6 | 6 | use Monolog\Handler\StreamHandler; |
7 | 7 | use Monolog\Logger; |
8 | 8 | |
9 | -include __DIR__.'/errors.php'; |
|
9 | +include __DIR__ . '/errors.php'; |
|
10 | 10 | |
11 | 11 | // setup the autoloading |
12 | -require_once __DIR__.'/../../../vendor/autoload.php'; |
|
12 | +require_once __DIR__ . '/../../../vendor/autoload.php'; |
|
13 | 13 | |
14 | 14 | // setup Propel |
15 | -require_once __DIR__.'/../../../generated-conf/config.php'; |
|
15 | +require_once __DIR__ . '/../../../generated-conf/config.php'; |
|
16 | 16 | |
17 | 17 | $defaultLogger = new Logger('defaultLogger'); |
18 | -$defaultLogger->pushHandler(new StreamHandler(__DIR__.'/../../../logs/propel.log', Logger::WARNING)); |
|
18 | +$defaultLogger->pushHandler(new StreamHandler(__DIR__ . '/../../../logs/propel.log', Logger::WARNING)); |
|
19 | 19 | |
20 | 20 | $serviceContainer->setLogger('defaultLogger', $defaultLogger); |
21 | 21 | |
@@ -64,18 +64,18 @@ discard block |
||
64 | 64 | return SettingsQuery::create()->findOne(); |
65 | 65 | } |
66 | 66 | |
67 | -include __DIR__.'/functions.auth.php'; |
|
68 | -include __DIR__.'/functions.notifications.php'; |
|
69 | -include __DIR__.'/functions.mail.php'; |
|
70 | -include __DIR__.'/functions.remove.php'; |
|
71 | -include __DIR__.'/functions.discussion.php'; |
|
72 | -include __DIR__.'/functions.event.php'; |
|
73 | -include __DIR__.'/functions.password.php'; |
|
74 | -include __DIR__.'/functions.users.php'; |
|
75 | -include __DIR__.'/functions.roles.php'; |
|
76 | -include __DIR__.'/functions.database.php'; |
|
77 | -include __DIR__.'/functions.calendars.php'; |
|
78 | -include __DIR__.'/functions.facebook.php'; |
|
67 | +include __DIR__ . '/functions.auth.php'; |
|
68 | +include __DIR__ . '/functions.notifications.php'; |
|
69 | +include __DIR__ . '/functions.mail.php'; |
|
70 | +include __DIR__ . '/functions.remove.php'; |
|
71 | +include __DIR__ . '/functions.discussion.php'; |
|
72 | +include __DIR__ . '/functions.event.php'; |
|
73 | +include __DIR__ . '/functions.password.php'; |
|
74 | +include __DIR__ . '/functions.users.php'; |
|
75 | +include __DIR__ . '/functions.roles.php'; |
|
76 | +include __DIR__ . '/functions.database.php'; |
|
77 | +include __DIR__ . '/functions.calendars.php'; |
|
78 | +include __DIR__ . '/functions.facebook.php'; |
|
79 | 79 | |
80 | 80 | date_default_timezone_set(siteSettings()->getTimeZone()); |
81 | 81 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $stat_id = $_SESSION['login_statistic_id']; |
176 | 176 | if (($stat_id != '') && ($stat_id != '0')) { |
177 | 177 | $stat = StatisticQuery::create()->findPk($stat_id); |
178 | - $stat->setDetail1($stat->getDetail1().'/'.$detail1); |
|
178 | + $stat->setDetail1($stat->getDetail1() . '/' . $detail1); |
|
179 | 179 | $stat->setDetail2($stat->getDate()->diff(new DateTime())); |
180 | 180 | $stat->save(); |
181 | 181 | |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | return 'never'; |
209 | 209 | } |
210 | 210 | |
211 | - return timeInWords($time).' ago'; |
|
211 | + return timeInWords($time) . ' ago'; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | function timeInWordsWithTense($time) |
@@ -222,9 +222,9 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | if ($time->getTimestamp() > (new DateTime())->getTimestamp()) { |
225 | - return 'in '.timeInWords($time); |
|
225 | + return 'in ' . timeInWords($time); |
|
226 | 226 | } else { |
227 | - return timeInWords($time).' ago'; |
|
227 | + return timeInWords($time) . ' ago'; |
|
228 | 228 | } |
229 | 229 | } |
230 | 230 |
@@ -21,35 +21,35 @@ discard block |
||
21 | 21 | // USER |
22 | 22 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
23 | 23 | |
24 | -$app->group('/user', function () { |
|
25 | - $this->get('s', UserController::class.':getAllUsers')->setName('users'); |
|
24 | +$app->group('/user', function() { |
|
25 | + $this->get('s', UserController::class . ':getAllUsers')->setName('users'); |
|
26 | 26 | |
27 | - $this->get('/{id}/widget-only', UserController::class.':getUserWidgetOnly')->setName('user-widget-only'); |
|
27 | + $this->get('/{id}/widget-only', UserController::class . ':getUserWidgetOnly')->setName('user-widget-only'); |
|
28 | 28 | |
29 | - $this->get('/new', UserController::class.':getNewUserForm')->setName('user-new'); |
|
30 | - $this->get('/{id}/edit', UserController::class.':getUserEditForm')->setName('user-edit'); |
|
31 | - $this->get('/{id}/password', UserController::class.':getUserPasswordForm')->setName('user-password'); |
|
29 | + $this->get('/new', UserController::class . ':getNewUserForm')->setName('user-new'); |
|
30 | + $this->get('/{id}/edit', UserController::class . ':getUserEditForm')->setName('user-edit'); |
|
31 | + $this->get('/{id}/password', UserController::class . ':getUserPasswordForm')->setName('user-password'); |
|
32 | 32 | |
33 | - $this->get('/me', UserController::class.':getCurrentUser')->setName('user-me'); |
|
34 | - $this->get('/{id}', UserController::class.':getUser')->setName('user'); |
|
33 | + $this->get('/me', UserController::class . ':getCurrentUser')->setName('user-me'); |
|
34 | + $this->get('/{id}', UserController::class . ':getUser')->setName('user'); |
|
35 | 35 | |
36 | - $this->post('[/{id}]', UserController::class.':postUser')->setName('user-post'); |
|
37 | - $this->post('/{id}/password', UserController::class.':postUserPasswordChange')->setName('user-password-post'); |
|
36 | + $this->post('[/{id}]', UserController::class . ':postUser')->setName('user-post'); |
|
37 | + $this->post('/{id}/password', UserController::class . ':postUserPasswordChange')->setName('user-password-post'); |
|
38 | 38 | |
39 | 39 | // roles |
40 | - $this->get('/{id}/roles', RoleController::class.':getAssignRolesForm')->setName('user-roles'); |
|
41 | - $this->post('/{id}/roles', RoleController::class.':postUserAssignRoles')->setName('user-assign-post'); |
|
40 | + $this->get('/{id}/roles', RoleController::class . ':getAssignRolesForm')->setName('user-roles'); |
|
41 | + $this->post('/{id}/roles', RoleController::class . ':postUserAssignRoles')->setName('user-assign-post'); |
|
42 | 42 | |
43 | 43 | // availability |
44 | - $this->get('/{id}/availability', AvailabilityController::class.':getAvailabilityForm')->setName('user-availability'); |
|
45 | - $this->post('/{id}/availability', AvailabilityController::class.':postAvailability')->setName('user-availability-post'); |
|
44 | + $this->get('/{id}/availability', AvailabilityController::class . ':getAvailabilityForm')->setName('user-availability'); |
|
45 | + $this->post('/{id}/availability', AvailabilityController::class . ':postAvailability')->setName('user-availability-post'); |
|
46 | 46 | |
47 | 47 | // calendar |
48 | - $this->group('/me/calendar', function () { |
|
49 | - $this->get('s', CalendarController::class.':getCalendarTokens')->setName('user-calendars'); |
|
50 | - $this->get('/new', CalendarController::class.':getNewCalendarForm')->setName('user-calendars'); |
|
51 | - $this->get('/{id}/revoke', CalendarController::class.':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
52 | - $this->post('/new', CalendarController::class.':postNewCalendar')->setName('user-calendar-new-post'); |
|
48 | + $this->group('/me/calendar', function() { |
|
49 | + $this->get('s', CalendarController::class . ':getCalendarTokens')->setName('user-calendars'); |
|
50 | + $this->get('/new', CalendarController::class . ':getNewCalendarForm')->setName('user-calendars'); |
|
51 | + $this->get('/{id}/revoke', CalendarController::class . ':getRevokeCalendar')->setName('user-calendar-revoke'); |
|
52 | + $this->post('/new', CalendarController::class . ':postNewCalendar')->setName('user-calendar-new-post'); |
|
53 | 53 | }); |
54 | 54 | }); |
55 | 55 | |
@@ -57,103 +57,103 @@ discard block |
||
57 | 57 | // EVENT |
58 | 58 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
59 | 59 | |
60 | -$app->group('/event', function () { |
|
61 | - $this->get('s', EventController::class.':getAllEvents')->setName('events'); |
|
62 | - $this->get('s/type/{id}', EventController::class.':getAllEventsWithType')->setName('events-eventtype'); |
|
63 | - $this->get('s/subtype/{id}', EventController::class.':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
60 | +$app->group('/event', function() { |
|
61 | + $this->get('s', EventController::class . ':getAllEvents')->setName('events'); |
|
62 | + $this->get('s/type/{id}', EventController::class . ':getAllEventsWithType')->setName('events-eventtype'); |
|
63 | + $this->get('s/subtype/{id}', EventController::class . ':getAllEventsWithSubType')->setName('events-eventsubtype'); |
|
64 | 64 | |
65 | - $this->get('s/print/info', EventController::class.':getAllEventInfoToPrint')->setName('events-print-info'); |
|
65 | + $this->get('s/print/info', EventController::class . ':getAllEventInfoToPrint')->setName('events-print-info'); |
|
66 | 66 | |
67 | - $this->get('/new', EventController::class.':getNewEventForm')->setName('event-new'); |
|
68 | - $this->get('/{id}/edit', EventController::class.':getEventEditForm')->setName('event-edit'); |
|
69 | - $this->get('/{id}/copy', EventController::class.':getEventCopyForm')->setName('event-copy'); |
|
70 | - $this->get('/{id}/assign', EventController::class.':getEventAssignForm')->setName('event-assign'); |
|
67 | + $this->get('/new', EventController::class . ':getNewEventForm')->setName('event-new'); |
|
68 | + $this->get('/{id}/edit', EventController::class . ':getEventEditForm')->setName('event-edit'); |
|
69 | + $this->get('/{id}/copy', EventController::class . ':getEventCopyForm')->setName('event-copy'); |
|
70 | + $this->get('/{id}/assign', EventController::class . ':getEventAssignForm')->setName('event-assign'); |
|
71 | 71 | |
72 | - $this->get('/{id}', EventController::class.':getEvent')->setName('event'); |
|
72 | + $this->get('/{id}', EventController::class . ':getEvent')->setName('event'); |
|
73 | 73 | |
74 | - $this->post('[/{id}]', EventController::class.':postEvent')->setName('event-post'); |
|
75 | - $this->post('/{id}/assign', EventController::class.':postEventAssign')->setName('event-assign-post'); |
|
76 | - $this->post('/{id}/comment', EventController::class.':postEventComment')->setName('event-comment-post'); |
|
74 | + $this->post('[/{id}]', EventController::class . ':postEvent')->setName('event-post'); |
|
75 | + $this->post('/{id}/assign', EventController::class . ':postEventAssign')->setName('event-assign-post'); |
|
76 | + $this->post('/{id}/comment', EventController::class . ':postEventComment')->setName('event-comment-post'); |
|
77 | 77 | }); |
78 | 78 | |
79 | 79 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
80 | 80 | // RESOURCE |
81 | 81 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
82 | 82 | |
83 | -$app->group('/resource', function () { |
|
84 | - $this->get('s', ResourceController::class.':getAllResources')->setName('resources'); |
|
83 | +$app->group('/resource', function() { |
|
84 | + $this->get('s', ResourceController::class . ':getAllResources')->setName('resources'); |
|
85 | 85 | |
86 | - $this->get('[/new]', ResourceController::class.':getNewResourceForm')->setName('resource-new'); |
|
87 | - $this->get('/{id}/edit', ResourceController::class.':getResourceEditForm')->setName('resource-edit'); |
|
86 | + $this->get('[/new]', ResourceController::class . ':getNewResourceForm')->setName('resource-new'); |
|
87 | + $this->get('/{id}/edit', ResourceController::class . ':getResourceEditForm')->setName('resource-edit'); |
|
88 | 88 | |
89 | - $this->get('/{id}', ResourceController::class.':getResourceFile')->setName('resource'); |
|
89 | + $this->get('/{id}', ResourceController::class . ':getResourceFile')->setName('resource'); |
|
90 | 90 | |
91 | - $this->post('[/{id}]', ResourceController::class.':postResource')->setName('resource-post'); |
|
91 | + $this->post('[/{id}]', ResourceController::class . ':postResource')->setName('resource-post'); |
|
92 | 92 | }); |
93 | 93 | |
94 | 94 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
95 | 95 | // ROLES & GROUPS |
96 | 96 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
97 | 97 | |
98 | -$app->group('/group', function () { |
|
99 | - $this->get('/{id}', GroupController::class.':getGroup')->setName('group'); |
|
100 | - $this->get('/{id}/roles', GroupController::class.':getGroupRoles')->setName('group-roles'); |
|
98 | +$app->group('/group', function() { |
|
99 | + $this->get('/{id}', GroupController::class . ':getGroup')->setName('group'); |
|
100 | + $this->get('/{id}/roles', GroupController::class . ':getGroupRoles')->setName('group-roles'); |
|
101 | 101 | |
102 | - $this->get('/{id}/events', EventController::class.':getAllEventsToPrintForGroup')->setName('group-events-print'); |
|
102 | + $this->get('/{id}/events', EventController::class . ':getAllEventsToPrintForGroup')->setName('group-events-print'); |
|
103 | 103 | |
104 | - $this->post('[/{id}]', GroupController::class.':postGroup')->setName('group-post'); |
|
104 | + $this->post('[/{id}]', GroupController::class . ':postGroup')->setName('group-post'); |
|
105 | 105 | }); |
106 | 106 | |
107 | 107 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
108 | 108 | // AUTH |
109 | 109 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
110 | 110 | |
111 | -$app->get('/login', AuthController::class.':getLoginForm')->setName('login'); |
|
111 | +$app->get('/login', AuthController::class . ':getLoginForm')->setName('login'); |
|
112 | 112 | |
113 | -$app->get('/login/{provider}', AuthController::class.':getLoginAuth')->setName('login-auth'); |
|
114 | -$app->get('/login/{provider}/callback', AuthController::class.':getLoginCallback')->setName('login-callback'); |
|
115 | -$app->get('/signup', PendingUserController::class.':getSignUpForm')->setName('sign-up'); |
|
116 | -$app->get('/signup/cancel', PendingUserController::class.':getSignUpCancel')->setName('sign-up-cancel'); |
|
113 | +$app->get('/login/{provider}', AuthController::class . ':getLoginAuth')->setName('login-auth'); |
|
114 | +$app->get('/login/{provider}/callback', AuthController::class . ':getLoginCallback')->setName('login-callback'); |
|
115 | +$app->get('/signup', PendingUserController::class . ':getSignUpForm')->setName('sign-up'); |
|
116 | +$app->get('/signup/cancel', PendingUserController::class . ':getSignUpCancel')->setName('sign-up-cancel'); |
|
117 | 117 | |
118 | -$app->get('/logout', AuthController::class.':getLogout')->setName('logout'); |
|
118 | +$app->get('/logout', AuthController::class . ':getLogout')->setName('logout'); |
|
119 | 119 | |
120 | -$app->post('/login', AuthController::class.':postLogin')->setName('login-post'); |
|
121 | -$app->post('/signup', PendingUserController::class.':postSignUp')->setName('sign-up-post'); |
|
120 | +$app->post('/login', AuthController::class . ':postLogin')->setName('login-post'); |
|
121 | +$app->post('/signup', PendingUserController::class . ':postSignUp')->setName('sign-up-post'); |
|
122 | 122 | |
123 | 123 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
124 | 124 | // NOTIFICATIONS |
125 | 125 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
126 | 126 | |
127 | -$app->get('/notification/{id}[/{referrer}]', NotificationController::class.':getNotificationClick')->setName('notification'); |
|
127 | +$app->get('/notification/{id}[/{referrer}]', NotificationController::class . ':getNotificationClick')->setName('notification'); |
|
128 | 128 | |
129 | 129 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
130 | 130 | // CALENDAR |
131 | 131 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
132 | 132 | |
133 | -$app->get('/calendar/{token}.{format}', CalendarController::class.':getRenderedCalendar')->setName('user-calendar'); |
|
133 | +$app->get('/calendar/{token}.{format}', CalendarController::class . ':getRenderedCalendar')->setName('user-calendar'); |
|
134 | 134 | |
135 | 135 | // legacy |
136 | -$app->get('/calendar.php', CalendarController::class.':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
136 | +$app->get('/calendar.php', CalendarController::class . ':getLegacyRenderedCalendar')->setName('user-calendar'); |
|
137 | 137 | |
138 | 138 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
139 | 139 | // OTHER |
140 | 140 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
141 | 141 | |
142 | -$app->get('/settings', function ($request, $response, $args) { |
|
142 | +$app->get('/settings', function($request, $response, $args) { |
|
143 | 143 | // Sample log message |
144 | 144 | $this->logger->info("Fetch settings GET '/settings'"); |
145 | 145 | |
146 | - $url = $this->router->pathFor('home').'old/settings.php'; |
|
146 | + $url = $this->router->pathFor('home') . 'old/settings.php'; |
|
147 | 147 | |
148 | 148 | return $response->withStatus(303)->withHeader('Location', $url); |
149 | 149 | //return $this->view->render($response, 'settings.twig', []); |
150 | 150 | })->setName('settings'); |
151 | 151 | |
152 | -$app->get('/token', function ($request, $response, $args) { |
|
152 | +$app->get('/token', function($request, $response, $args) { |
|
153 | 153 | return $response->getBody()->write(Crypt::generateToken(30)); |
154 | 154 | })->setName('token'); |
155 | 155 | |
156 | -$app->get('/', function ($request, $response, $args) { |
|
156 | +$app->get('/', function($request, $response, $args) { |
|
157 | 157 | // Sample log message |
158 | 158 | $this->logger->info("Fetch home GET '/'"); |
159 | 159 | |
@@ -173,6 +173,6 @@ discard block |
||
173 | 173 | // JOBS |
174 | 174 | // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
175 | 175 | |
176 | -$app->group('/job', function () { |
|
177 | - $this->get('/daily/{token}', JobController::class.':getDaily')->setName('job-daily'); |
|
176 | +$app->group('/job', function() { |
|
177 | + $this->get('/daily/{token}', JobController::class . ':getDaily')->setName('job-daily'); |
|
178 | 178 | }); |
@@ -19,7 +19,7 @@ |
||
19 | 19 | } |
20 | 20 | |
21 | 21 | $client = new Client(); |
22 | - $url = $site->getUrl()['base'].$this->router->pathFor('home').'old/cr_daily.php'; |
|
22 | + $url = $site->getUrl()['base'] . $this->router->pathFor('home') . 'old/cr_daily.php'; |
|
23 | 23 | $guzzleResponse = $client->get($url, [ |
24 | 24 | 'query' => [ |
25 | 25 | 'token' => $args['token'], |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | { |
12 | 12 | public function getNotificationClick(ServerRequestInterface $request, ResponseInterface $response, $args) |
13 | 13 | { |
14 | - $this->logger->info("Fetch settings GET '/notification/".$args['id']."'"); |
|
14 | + $this->logger->info("Fetch settings GET '/notification/" . $args['id'] . "'"); |
|
15 | 15 | |
16 | 16 | $n = NotificationQuery::create()->findPk($args['id']); |
17 | 17 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | return $response->withStatus(302)->withHeader('Location', $this->router->pathFor($link['route'], $link['attributes'])); |
37 | 37 | } else { |
38 | - return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home').$n->getLink()); |
|
38 | + return $response->withStatus(302)->withHeader('Location', $this->router->pathFor('home') . $n->getLink()); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | </div><!-- /.timeline-header --> |
222 | 222 | |
223 | 223 | <div class="timeline-body"> |
224 | - <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName().': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '('.$event->getBibleVerse().')' : '' ?></p> |
|
224 | + <p><strong><?php echo $event->getEventGroup() ? $event->getEventGroup()->getName() . ': ' : '' ?></strong><?php echo $event->getSermonTitle() ?> <?php echo $event->getBibleVerse() ? '(' . $event->getBibleVerse() . ')' : '' ?></p> |
|
225 | 225 | <p><strong>Location:</strong> <?php echo $event->getLocation()->getName(); ?></p> |
226 | 226 | |
227 | 227 | <?php if ($event->getComments()): ?> |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | INNER JOIN groups g ON g.id = r.groupId |
282 | 282 | INNER JOIN users u ON u.id = ur.userId |
283 | 283 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
284 | - WHERE ep.eventId = '".$event->getId()."' |
|
284 | + WHERE ep.eventId = '".$event->getId() . "' |
|
285 | 285 | AND ep.removed = 0 |
286 | 286 | ORDER BY g.name, r.name"; |
287 | 287 | |
@@ -306,16 +306,16 @@ discard block |
||
306 | 306 | } else { |
307 | 307 | echo '</ul>'; |
308 | 308 | } |
309 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
309 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
310 | 310 | echo '<ul>'; |
311 | 311 | } |
312 | 312 | |
313 | 313 | echo '<li>'; |
314 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
314 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
315 | 315 | echo $viewPeople->name; |
316 | 316 | |
317 | 317 | if ($viewPeople->rolename != '') { |
318 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
318 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
319 | 319 | } else { |
320 | 320 | // If there is no skill, we don't need to mention this. |
321 | 321 | } |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | </div><!-- /.timeline-header --> |
398 | 398 | |
399 | 399 | <div class="timeline-body"> |
400 | - <p><strong><?php echo $event->eventGroup ? $event->eventGroup.': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '('.$event->bibleVerse.')' : '' ?></p> |
|
400 | + <p><strong><?php echo $event->eventGroup ? $event->eventGroup . ': ' : '' ?></strong><?php echo $event->sermonTitle ?> <?php echo $event->bibleVerse ? '(' . $event->bibleVerse . ')' : '' ?></p> |
|
401 | 401 | <p><strong>Location:</strong> <?php echo $event->eventLocation; ?></p> |
402 | 402 | |
403 | 403 | <?php if ($event->comment != ''): ?> |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | INNER JOIN groups g ON g.id = r.groupId |
459 | 459 | INNER JOIN users u ON u.id = ur.userId |
460 | 460 | INNER JOIN eventPeople ep ON ep.userRoleId = ur.id |
461 | - WHERE ep.eventId = '".$event->id."' |
|
461 | + WHERE ep.eventId = '".$event->id . "' |
|
462 | 462 | AND ep.removed = 0 |
463 | 463 | ORDER BY g.name, r.name"; |
464 | 464 | |
@@ -483,16 +483,16 @@ discard block |
||
483 | 483 | } else { |
484 | 484 | echo '</ul>'; |
485 | 485 | } |
486 | - echo '<p><strong>'.$groupName.'</strong></p>'; |
|
486 | + echo '<p><strong>' . $groupName . '</strong></p>'; |
|
487 | 487 | echo '<ul>'; |
488 | 488 | } |
489 | 489 | |
490 | 490 | echo '<li>'; |
491 | - echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=".$viewPeople->swap."'>" : ''; |
|
491 | + echo (isset($viewPeople->swap)) ? "<s><a class='text-danger' href='swap.php?swap=" . $viewPeople->swap . "'>" : ''; |
|
492 | 492 | echo $viewPeople->name; |
493 | 493 | |
494 | 494 | if ($viewPeople->rolename != '') { |
495 | - echo ' - <em>'.$viewPeople->rolename.'</em>'; |
|
495 | + echo ' - <em>' . $viewPeople->rolename . '</em>'; |
|
496 | 496 | } else { |
497 | 497 | // If there is no skill, we don't need to mention this. |
498 | 498 | } |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | "> |
564 | 564 | <?php echo timeInWordsWithTense($event->getDate()) ?> |
565 | 565 | </span> |
566 | - <?php else: ?> |
|
566 | + <?php else : ?> |
|
567 | 567 | <span class="pull-right badge bg-red"> |
568 | 568 | never |
569 | 569 | </span> |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | <img class="img-circle" src="<?php echo getProfileImageUrl($_SESSION['userid'], 'large') ?>" alt="User Avatar"> |
629 | 629 | </div> |
630 | 630 | <!-- /.widget-user-image --> |
631 | - <h3 class="widget-user-username"><?php echo $user->getFirstName().' '.$user->getLastName() ?></h3> |
|
631 | + <h3 class="widget-user-username"><?php echo $user->getFirstName() . ' ' . $user->getLastName() ?></h3> |
|
632 | 632 | <h5 class="widget-user-desc">Account created <?php echo $user->getCreated('M. Y') ?></h5> |
633 | 633 | </div> |
634 | 634 | <div class="box-footer no-padding"> |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $userHasEmail = (strlen($user->getEmail()) > 3); |
653 | 653 | $emailRemindersEnabled = ($userHasEmail && true); // todo: add opt-out for email reminders |
654 | 654 | ?> |
655 | - Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert().' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
655 | + Email Reminders <span class="pull-right badge bg-<?php echo $emailRemindersEnabled ? 'green' : 'red' ?>"><?php echo $emailRemindersEnabled ? siteSettings()->getDaysToAlert() . ' days before' : ($userHasEmail ? 'Disabled' : 'No email address') ?></span> |
|
656 | 656 | </a> |
657 | 657 | </li> |
658 | 658 | <li> |