@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | /** @var Connection $connection */ |
25 | 25 | $connection = AppKernel::Container()->get(Connection::class); |
26 | 26 | |
27 | -$id = (int) isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
28 | -$rId = (int) isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
29 | -$cacheId = (int) isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
30 | -$ownerId = (int) isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
27 | +$id = (int)isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; |
|
28 | +$rId = (int)isset($_REQUEST['rid']) ? $_REQUEST['rid'] : 0; |
|
29 | +$cacheId = (int)isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0; |
|
30 | +$ownerId = (int)isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
|
31 | 31 | |
32 | 32 | $reportData = $connection |
33 | 33 | ->fetchAssoc( |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | ['id' => $rId] |
38 | 38 | ); |
39 | 39 | |
40 | -$reporterId = (int) $reportData['userid']; |
|
41 | -$adminId = (int) $reportData['adminid']; |
|
40 | +$reporterId = (int)$reportData['userid']; |
|
41 | +$adminId = (int)$reportData['adminid']; |
|
42 | 42 | $age = $reportData['age']; |
43 | 43 | |
44 | 44 | if (isset($_REQUEST['savecomment'])) { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | ORDER BY username' |
32 | 32 | ); |
33 | 33 | |
34 | -foreach($admins as &$admin) { |
|
34 | +foreach ($admins as &$admin) { |
|
35 | 35 | $rights = []; |
36 | 36 | |
37 | 37 | if ($admin['admin'] & ADMIN_TRANSLATE) { |
@@ -3,11 +3,9 @@ |
||
3 | 3 | * for license information see LICENSE.md |
4 | 4 | ***************************************************************************/ |
5 | 5 | |
6 | -use Oc\FieldNotes\Entity\FieldNote; |
|
7 | 6 | use Oc\FieldNotes\Enum\LogType as FieldNotesLogType; |
8 | 7 | use Oc\FieldNotes\Persistence\FieldNoteEntity; |
9 | 8 | use Oc\FieldNotes\Persistence\FieldNoteService; |
10 | -use Oc\GeoCache\Entity\GeocacheLog; |
|
11 | 9 | use Oc\GeoCache\Enum\GeoCacheType; |
12 | 10 | use Oc\GeoCache\Enum\LogType as GeoCacheLogType; |
13 | 11 | use Oc\GeoCache\Enum\NeedMaintenance; |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | $fieldNoteService = AppKernel::Container()->get(FieldNoteService::class); |
50 | 50 | |
51 | 51 | $fieldNote = $fieldNoteService->fetchOneBy([ |
52 | - 'id' => (int) $_GET['fieldnoteid'], |
|
53 | - 'user_id' => (int) $user->getUserId() |
|
52 | + 'id' => (int)$_GET['fieldnoteid'], |
|
53 | + 'user_id' => (int)$user->getUserId() |
|
54 | 54 | ]); |
55 | 55 | |
56 | 56 | if ($fieldNote !== null) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | // check if masslog warning is accepted (in cookie) |
97 | 97 | $masslogCookieSet = isset($_COOKIE['ocsuppressmasslogwarn']); |
98 | 98 | if ($masslogCookieSet) { |
99 | - $masslogCookieContent = (int) $_COOKIE['ocsuppressmasslogwarn']; |
|
99 | + $masslogCookieContent = (int)$_COOKIE['ocsuppressmasslogwarn']; |
|
100 | 100 | } else { |
101 | 101 | // save masslog acception in cookie that expires on midnight if clicked |
102 | 102 | if (isset($_REQUEST['suppressMasslogWarning']) && $_REQUEST['suppressMasslogWarning'] == 1) { |
@@ -108,17 +108,17 @@ discard block |
||
108 | 108 | // logtext, logtype, logday, logmonth, logyear |
109 | 109 | |
110 | 110 | $logText = isset($_POST['logtext']) ? trim($_POST['logtext']) : ''; |
111 | - $logType = isset($_REQUEST['logtype']) ? (int) $_REQUEST['logtype'] : null; |
|
111 | + $logType = isset($_REQUEST['logtype']) ? (int)$_REQUEST['logtype'] : null; |
|
112 | 112 | $logDateDay = isset($_POST['logday']) ? trim($_POST['logday']) : ($datesaved ? $defaultLogDay : date('d')); |
113 | 113 | $logDateMonth = isset($_POST['logmonth']) ? trim($_POST['logmonth']) : ($datesaved ? $defaultLogMonth : date('m')); |
114 | 114 | $logDateYear = isset($_POST['logyear']) ? trim($_POST['logyear']) : ($datesaved ? $defaultLogYear : date('Y')); |
115 | 115 | $logTimeHour = isset($_POST['loghour']) ? trim($_POST['loghour']) : ''; |
116 | 116 | $logTimeMinute = isset($_POST['logminute']) ? trim($_POST['logminute']) : ''; |
117 | - $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int) $_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int) $_POST['needs_maintenance'] : 0); |
|
118 | - $listingOutdated = isset($_POST['listing_outdated2']) ? (int) $_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int) $_POST['listing_outdated'] : 0); |
|
119 | - $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int) $_POST['confirm_listing_ok'] : 0; |
|
120 | - $rateOption = isset($_POST['ratingoption']) ? (int) $_POST['ratingoption'] : 0; |
|
121 | - $rateCache = isset($_POST['rating']) ? (int) $_POST['rating'] : 0; |
|
117 | + $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int)$_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int)$_POST['needs_maintenance'] : 0); |
|
118 | + $listingOutdated = isset($_POST['listing_outdated2']) ? (int)$_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int)$_POST['listing_outdated'] : 0); |
|
119 | + $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int)$_POST['confirm_listing_ok'] : 0; |
|
120 | + $rateOption = isset($_POST['ratingoption']) ? (int)$_POST['ratingoption'] : 0; |
|
121 | + $rateCache = isset($_POST['rating']) ? (int)$_POST['rating'] : 0; |
|
122 | 122 | $ocTeamComment = isset($_REQUEST['teamcomment']) ? $_REQUEST['teamcomment'] != 0 : 0; |
123 | 123 | $suppressMasslogWarning = isset($_REQUEST['suppressMasslogWarning']) ? $_REQUEST['suppressMasslogWarning'] : ($masslogCookieSet ? $masslogCookieContent : 0); |
124 | 124 | |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | // if not a found log, ignore the rating |
167 | - $rateOption = (int) ($logType == 1 || $logType == 7); |
|
167 | + $rateOption = (int)($logType == 1 || $logType == 7); |
|
168 | 168 | |
169 | 169 | // get log text editor mode (from form or from userprofile) |
170 | 170 | // 1 = text; 2 = HTML; 3 = tinyMCE |
171 | 171 | if (isset($_POST['descMode'])) { |
172 | - $descMode = (int) $_POST['descMode']; // Ocprop: 2 |
|
172 | + $descMode = (int)$_POST['descMode']; // Ocprop: 2 |
|
173 | 173 | if (($descMode < 1) || ($descMode > 3)) { |
174 | 174 | $descMode = 3; |
175 | 175 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | * set seconds 00:00:01, means "00:00 was logged" |
252 | 252 | * set seconds 00:00:00, means "no time was logged" |
253 | 253 | */ |
254 | - $logTimeSecond = (int) ($logTimeHour . $logTimeMinute != '' |
|
254 | + $logTimeSecond = (int)($logTimeHour . $logTimeMinute != '' |
|
255 | 255 | && $logTimeHour == 0 |
256 | 256 | && $logTimeMinute == 0); |
257 | 257 | |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | $logDate = date( |
260 | 260 | $opt['db']['dateformat'], |
261 | 261 | mktime( |
262 | - (int) $logTimeHour, |
|
263 | - (int) $logTimeMinute, |
|
262 | + (int)$logTimeHour, |
|
263 | + (int)$logTimeMinute, |
|
264 | 264 | $logTimeSecond, |
265 | 265 | $logDateMonth, |
266 | 266 | $logDateDay, |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | if (isset($_REQUEST['fieldnoteid']) && $_REQUEST['fieldnoteid']) { |
312 | 312 | sql( |
313 | 313 | 'DELETE FROM field_note WHERE `id` = &1 AND `user_id` = &2', |
314 | - (int) $_REQUEST['fieldnoteid'], |
|
314 | + (int)$_REQUEST['fieldnoteid'], |
|
315 | 315 | $user->getUserId() |
316 | 316 | ); |
317 | 317 | |
@@ -398,8 +398,8 @@ discard block |
||
398 | 398 | |
399 | 399 | // prepare template and display |
400 | 400 | $tpl->assign('logtype_allows_nm', implode(',', $logtype_allows_nm)); |
401 | -$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int) $_REQUEST['scrollposx']: 0); |
|
402 | -$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int) $_REQUEST['scrollposy']: 0); |
|
401 | +$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int)$_REQUEST['scrollposx'] : 0); |
|
402 | +$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int)$_REQUEST['scrollposy'] : 0); |
|
403 | 403 | $tpl->assign('validate', $validate); |
404 | 404 | $tpl->assign('editlog', false); |
405 | 405 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | if ($r) { |
39 | 39 | if ($r['object_type'] == 1) { |
40 | - $check = (int) $connection |
|
40 | + $check = (int)$connection |
|
41 | 41 | ->fetchColumn( |
42 | 42 | 'SELECT COUNT(*) |
43 | 43 | FROM `cache_logs` |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | } |
64 | 64 | } elseif ($r['object_type'] == 2) { |
65 | - $check = (int) $connection |
|
65 | + $check = (int)$connection |
|
66 | 66 | ->fetchColumn( |
67 | 67 | 'SELECT COUNT(*) |
68 | 68 | FROM `caches` |
@@ -142,22 +142,22 @@ |
||
142 | 142 | |
143 | 143 | $tpl->assign('showdetails', true); |
144 | 144 | |
145 | - $r['hidden'] = (int) $connection->fetchColumn( |
|
145 | + $r['hidden'] = (int)$connection->fetchColumn( |
|
146 | 146 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`=:userId', [':userId' => $r['user_id']] |
147 | 147 | ); |
148 | - $r['hidden_active'] = (int) $connection->fetchColumn( |
|
148 | + $r['hidden_active'] = (int)$connection->fetchColumn( |
|
149 | 149 | 'SELECT COUNT(*) FROM `caches` WHERE `user_id`= :userId AND `status`=1', |
150 | 150 | [':userId' => $r['user_id']] |
151 | 151 | ); |
152 | - $r['logentries'] = (int) $connection->fetchColumn( |
|
152 | + $r['logentries'] = (int)$connection->fetchColumn( |
|
153 | 153 | 'SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`= :userId', |
154 | 154 | [':userId' => $r['user_id']] |
155 | 155 | ); |
156 | - $r['deleted_logentries'] = (int) $connection->fetchColumn( |
|
156 | + $r['deleted_logentries'] = (int)$connection->fetchColumn( |
|
157 | 157 | 'SELECT COUNT(*) FROM `cache_logs_archived` WHERE `user_id`= :userId', |
158 | 158 | [':userId' => $r['user_id']] |
159 | 159 | ); |
160 | - $r['reports'] = (int) $connection->fetchColumn( |
|
160 | + $r['reports'] = (int)$connection->fetchColumn( |
|
161 | 161 | 'SELECT COUNT(*) FROM `cache_reports` WHERE `userid`= :userId', |
162 | 162 | [':userId' => $r['user_id']] |
163 | 163 | ); |
@@ -218,10 +218,10 @@ |
||
218 | 218 | $entity->nativeName = $data['native_name']; |
219 | 219 | $entity->de = $data['de']; |
220 | 220 | $entity->en = $data['en']; |
221 | - $entity->translationId = (int) $data['trans_id']; |
|
222 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
223 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
224 | - $entity->isTranslated = (bool) $data['is_translated']; |
|
221 | + $entity->translationId = (int)$data['trans_id']; |
|
222 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
223 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
224 | + $entity->isTranslated = (bool)$data['is_translated']; |
|
225 | 225 | |
226 | 226 | return $entity; |
227 | 227 | } |
@@ -181,9 +181,9 @@ |
||
181 | 181 | $entity->name = $data['name']; |
182 | 182 | $entity->de = $data['de']; |
183 | 183 | $entity->en = $data['en']; |
184 | - $entity->translationId = (int) $data['trans_id']; |
|
185 | - $entity->listDefaultDe = (bool) $data['list_default_de']; |
|
186 | - $entity->listDefaultEn = (bool) $data['list_default_en']; |
|
184 | + $entity->translationId = (int)$data['trans_id']; |
|
185 | + $entity->listDefaultDe = (bool)$data['list_default_de']; |
|
186 | + $entity->listDefaultEn = (bool)$data['list_default_en']; |
|
187 | 187 | $entity->sortDe = $data['sort_de']; |
188 | 188 | $entity->sortEn = $data['sort_en']; |
189 | 189 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public static function fromEMail($email) |
28 | 28 | { |
29 | - $userId = (int) sql_value("SELECT `user_id` FROM `user` WHERE `email`='&1'", 0, $email); |
|
29 | + $userId = (int)sql_value("SELECT `user_id` FROM `user` WHERE `email`='&1'", 0, $email); |
|
30 | 30 | if ($userId === 0) { |
31 | 31 | return null; |
32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public static function fromUsername($username) |
43 | 43 | { |
44 | - $userId = (int) sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
44 | + $userId = (int)sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username); |
|
45 | 45 | if ($userId === 0) { |
46 | 46 | return null; |
47 | 47 | } |
@@ -28,14 +28,14 @@ |
||
28 | 28 | [':wp' => $_REQUEST['wp']] |
29 | 29 | ); |
30 | 30 | } else { |
31 | - $cacheId = isset($_REQUEST['cacheid']) ? (int) $_REQUEST['cacheid'] : -1; |
|
31 | + $cacheId = isset($_REQUEST['cacheid']) ? (int)$_REQUEST['cacheid'] : -1; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $showHistory = false; |
35 | 35 | $error = ''; |
36 | 36 | |
37 | 37 | if ($cacheId >= 0 && |
38 | - $connection->fetchColumn('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id',[':id' => $cacheId]) <> 1) |
|
38 | + $connection->fetchColumn('SELECT COUNT(*) FROM `caches` WHERE `cache_id`=:id', [':id' => $cacheId]) <> 1) |
|
39 | 39 | { |
40 | 40 | $error = $translate->t('Cache not found', '', '', 0); |
41 | 41 | } elseif ($cacheId > 0) { |