@@ -29,11 +29,11 @@ |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = [ |
| 32 | - ['db' => 'id', 'dt' => 0], |
|
| 33 | - ['db' => 'firstname', 'dt' => 1], |
|
| 34 | - ['db' => 'surname', 'dt' => 2], |
|
| 35 | - ['db' => 'zip', 'dt' => 3], |
|
| 36 | - ['db' => 'country', 'dt' => 4], |
|
| 32 | + ['db' => 'id', 'dt' => 0], |
|
| 33 | + ['db' => 'firstname', 'dt' => 1], |
|
| 34 | + ['db' => 'surname', 'dt' => 2], |
|
| 35 | + ['db' => 'zip', 'dt' => 3], |
|
| 36 | + ['db' => 'country', 'dt' => 4], |
|
| 37 | 37 | ]; |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } else { |
| 34 | 34 | $notificationId = getQueryStringForKey('id'); |
| 35 | 35 | $referer = getQueryStringForKey('click'); |
| 36 | - $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl().'/notification.php?id='.$notificationId.'&click='.$referer; |
|
| 36 | + $_SESSION['redirectUrl'] = siteSettings()->getSiteUrl() . '/notification.php?id=' . $notificationId . '&click=' . $referer; |
|
| 37 | 37 | header('Location: login.php'); |
| 38 | 38 | exit; |
| 39 | 39 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | // redir if notification has URL |
| 61 | 61 | $redir = notificationLink($notificationId); |
| 62 | 62 | if (!empty($redir)) { |
| 63 | - header('Location: '.$redir); |
|
| 63 | + header('Location: ' . $redir); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | // find notification |
@@ -28,13 +28,13 @@ |
||
| 28 | 28 | $currentTimestamp = $date = strftime('%F %T', time()); |
| 29 | 29 | |
| 30 | 30 | $data = [ |
| 31 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
| 32 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
| 33 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
| 34 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
| 35 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
| 36 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
| 37 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
| 31 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
| 32 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
| 33 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
| 34 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
| 35 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->sub_type->getId()], |
|
| 36 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
| 37 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
| 38 | 38 | ]; |
| 39 | 39 | |
| 40 | 40 | if (isset($this->notes)) { |
@@ -24,12 +24,12 @@ |
||
| 24 | 24 | public function createInDb(Database $db) |
| 25 | 25 | { |
| 26 | 26 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->sub_type) || empty($this->location)) { |
| 27 | - $message = 'Series name ('.$this->name.')'; |
|
| 28 | - $message .= ' or date ('.$this->datetime.')'; |
|
| 29 | - $message .= ' or series ('.$this->series.')'; |
|
| 30 | - $message .= ' or type ('.$this->type.')'; |
|
| 31 | - $message .= ' or sub_type ('.$this->sub_type.')'; |
|
| 32 | - $message .= ' or location ('.$this->location.')'; |
|
| 27 | + $message = 'Series name (' . $this->name . ')'; |
|
| 28 | + $message .= ' or date (' . $this->datetime . ')'; |
|
| 29 | + $message .= ' or series (' . $this->series . ')'; |
|
| 30 | + $message .= ' or type (' . $this->type . ')'; |
|
| 31 | + $message .= ' or sub_type (' . $this->sub_type . ')'; |
|
| 32 | + $message .= ' or location (' . $this->location . ')'; |
|
| 33 | 33 | $message .= ' cannot be empty.'; |
| 34 | 34 | |
| 35 | 35 | throw new Exception($message); |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | $currentTimestamp = $date = strftime('%F %T', time()); |
| 132 | 132 | |
| 133 | 133 | $data = [ |
| 134 | - ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
| 135 | - ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
| 136 | - ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
| 137 | - ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
| 138 | - ['field' => 'subType', 'type' => 'int', 'value' => $this->subType->getId()], |
|
| 139 | - ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
| 140 | - ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
| 134 | + ['field' => 'name', 'type' => 'string', 'value' => $this->name], |
|
| 135 | + ['field' => 'date', 'type' => 'string', 'value' => $this->datetime], |
|
| 136 | + ['field' => 'eventGroup', 'type' => 'int', 'value' => $this->series->getId()], |
|
| 137 | + ['field' => 'type', 'type' => 'int', 'value' => $this->type->getId()], |
|
| 138 | + ['field' => 'subType', 'type' => 'int', 'value' => $this->subType->getId()], |
|
| 139 | + ['field' => 'location', 'type' => 'int', 'value' => $this->location->getId()], |
|
| 140 | + ['field' => 'created', 'type' => 'datetime', 'value' => $currentTimestamp], |
|
| 141 | 141 | ]; |
| 142 | 142 | |
| 143 | 143 | if (isset($this->notes)) { |
@@ -164,23 +164,23 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $columns = [ |
| 167 | - 'id', |
|
| 168 | - 'name', |
|
| 169 | - 'date', |
|
| 170 | - 'eventGroup', |
|
| 171 | - 'type', |
|
| 172 | - 'subType', |
|
| 173 | - 'location', |
|
| 174 | - 'comment', |
|
| 175 | - 'sermonTitle', |
|
| 176 | - 'bibleVerse', |
|
| 177 | - 'deleted', |
|
| 178 | - 'created', |
|
| 179 | - 'updated', |
|
| 167 | + 'id', |
|
| 168 | + 'name', |
|
| 169 | + 'date', |
|
| 170 | + 'eventGroup', |
|
| 171 | + 'type', |
|
| 172 | + 'subType', |
|
| 173 | + 'location', |
|
| 174 | + 'comment', |
|
| 175 | + 'sermonTitle', |
|
| 176 | + 'bibleVerse', |
|
| 177 | + 'deleted', |
|
| 178 | + 'created', |
|
| 179 | + 'updated', |
|
| 180 | 180 | ]; |
| 181 | 181 | |
| 182 | 182 | $where = [ |
| 183 | - 'id = '.$id, |
|
| 183 | + 'id = '.$id, |
|
| 184 | 184 | ]; |
| 185 | 185 | |
| 186 | 186 | $result = $db->selectSingle('Event', $this->db_table, $columns, $where); |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | foreach ($rehersals as $rehersal) { |
| 110 | 110 | if (!is_a($rehersal, 'Rehersal')) { |
| 111 | - throw new Exception('Rehersal is not a Rehersal object: '.$rehersal, 1); |
|
| 111 | + throw new Exception('Rehersal is not a Rehersal object: ' . $rehersal, 1); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | $this->rehersals = $rehersals; |
@@ -117,12 +117,12 @@ discard block |
||
| 117 | 117 | public function createInDb(Database $db) |
| 118 | 118 | { |
| 119 | 119 | if (empty($this->name) || empty($this->datetime) || empty($this->series) || empty($this->type) || empty($this->subType) || empty($this->location)) { |
| 120 | - $message = 'Series name ('.$this->name.')'; |
|
| 121 | - $message .= ' or date ('.$this->datetime.')'; |
|
| 122 | - $message .= ' or series ('.$this->series.')'; |
|
| 123 | - $message .= ' or type ('.$this->type.')'; |
|
| 124 | - $message .= ' or sub_type ('.$this->subType.')'; |
|
| 125 | - $message .= ' or location ('.$this->location.')'; |
|
| 120 | + $message = 'Series name (' . $this->name . ')'; |
|
| 121 | + $message .= ' or date (' . $this->datetime . ')'; |
|
| 122 | + $message .= ' or series (' . $this->series . ')'; |
|
| 123 | + $message .= ' or type (' . $this->type . ')'; |
|
| 124 | + $message .= ' or sub_type (' . $this->subType . ')'; |
|
| 125 | + $message .= ' or location (' . $this->location . ')'; |
|
| 126 | 126 | $message .= ' cannot be empty.'; |
| 127 | 127 | |
| 128 | 128 | throw new Exception($message); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ]; |
| 181 | 181 | |
| 182 | 182 | $where = [ |
| 183 | - 'id = '.$id, |
|
| 183 | + 'id = ' . $id, |
|
| 184 | 184 | ]; |
| 185 | 185 | |
| 186 | 186 | $result = $db->selectSingle('Event', $this->db_table, $columns, $where); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function getUserEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 99 | 99 | { |
| 100 | - $this->logger->info("Fetch user GET '/user/".$args['id']."/edit'"); |
|
| 100 | + $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/edit'"); |
|
| 101 | 101 | $u = UserQuery::create()->findPK($args['id']); |
| 102 | 102 | |
| 103 | 103 | if (is_null($u)) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function getUser(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 114 | 114 | { |
| 115 | - $this->logger->info("Fetch user GET '/user/".$args['id']."'"); |
|
| 115 | + $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'"); |
|
| 116 | 116 | $u = UserQuery::create()->findPK($args['id']); |
| 117 | 117 | |
| 118 | 118 | if (is_null($u)) { |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | public function getUserWidgetOnly(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 129 | 129 | { |
| 130 | - $this->logger->info("Fetch user GET '/user/".$args['id']."'"); |
|
| 130 | + $this->logger->info("Fetch user GET '/user/" . $args['id'] . "'"); |
|
| 131 | 131 | $u = UserQuery::create()->findPK($args['id']); |
| 132 | 132 | |
| 133 | 133 | if (is_null($u)) { |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | public function getUserPasswordForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 144 | 144 | { |
| 145 | - $this->logger->info("Fetch user GET '/user/".$args['id']."/password'"); |
|
| 145 | + $this->logger->info("Fetch user GET '/user/" . $args['id'] . "/password'"); |
|
| 146 | 146 | $u = UserQuery::create()->findPK($args['id']); |
| 147 | 147 | |
| 148 | 148 | if (is_null($u)) { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | public function postUserPasswordChange(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 159 | 159 | { |
| 160 | - $this->logger->info("Create user POST '/user/".$args['id']."/password'"); |
|
| 160 | + $this->logger->info("Create user POST '/user/" . $args['id'] . "/password'"); |
|
| 161 | 161 | |
| 162 | 162 | $data = $request->getParsedBody(); |
| 163 | 163 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | public function getAllEventsWithType(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 31 | 31 | { |
| 32 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
| 32 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
| 33 | 33 | |
| 34 | 34 | $eventType = EventTypeQuery::create()->findPk($args['id']); |
| 35 | 35 | |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | public function getAllEventsWithSubType(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 42 | 42 | { |
| 43 | - $this->logger->info("Fetch event GET '/events/type/".$args['id']."'"); |
|
| 43 | + $this->logger->info("Fetch event GET '/events/type/" . $args['id'] . "'"); |
|
| 44 | 44 | |
| 45 | 45 | $eventType = EventSubTypeQuery::create()->findPk($args['id']); |
| 46 | 46 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $e = EventQuery::create()->findPk($args['id']); |
| 70 | 70 | } |
| 71 | 71 | $e->setName($data['name']); |
| 72 | - $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'].' '.$data['time'])); |
|
| 72 | + $e->setDate(DateTime::createFromFormat('d/m/Y H:i', $data['date'] . ' ' . $data['time'])); |
|
| 73 | 73 | $e->setEventTypeId($data['type']); |
| 74 | 74 | $e->setEventSubTypeId($data['subtype']); |
| 75 | 75 | $e->setLocationId($data['location']); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function getEvent(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 98 | 98 | { |
| 99 | - $this->logger->info("Fetch event GET '/event/".$args['id']."'"); |
|
| 99 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "'"); |
|
| 100 | 100 | $e = EventQuery::create()->findPK($args['id']); |
| 101 | 101 | |
| 102 | 102 | if (!$e->authoriser()->readableBy($this->auth->currentUser())) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function getEventEditForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 114 | 114 | { |
| 115 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/edit'"); |
|
| 115 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/edit'"); |
|
| 116 | 116 | $e = EventQuery::create()->findPK($args['id']); |
| 117 | 117 | $l = LocationQuery::create()->orderByName()->find(); |
| 118 | 118 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | public function getEventCopyForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 129 | 129 | { |
| 130 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/copy'"); |
|
| 130 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/copy'"); |
|
| 131 | 131 | $e = EventQuery::create()->findPK($args['id']); |
| 132 | 132 | $l = LocationQuery::create()->orderByName()->find(); |
| 133 | 133 | $et = EventTypeQuery::create()->orderByName()->find(); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | public function getEventAssignForm(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 144 | 144 | { |
| 145 | - $this->logger->info("Fetch event GET '/event/".$args['id']."/assign'"); |
|
| 145 | + $this->logger->info("Fetch event GET '/event/" . $args['id'] . "/assign'"); |
|
| 146 | 146 | $e = EventQuery::create()->findPK($args['id']); |
| 147 | 147 | $ur = UserRoleQuery::create()->find(); |
| 148 | 148 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | public function postEventAssign(ServerRequestInterface $request, ResponseInterface $response, $args) |
| 157 | 157 | { |
| 158 | - $this->logger->info("Create event people POST '/event".$args['id']."/assign'"); |
|
| 158 | + $this->logger->info("Create event people POST '/event" . $args['id'] . "/assign'"); |
|
| 159 | 159 | |
| 160 | 160 | $eventId = filter_var($args['id'], FILTER_SANITIZE_NUMBER_INT); |
| 161 | 161 | $existingUserRoles = UserRoleQuery::create()->useEventPersonQuery()->filterByEventId($eventId)->endUse()->find(); |