@@ -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; |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | $fieldNoteService = AppKernel::Container()->get(FieldNoteService::class); |
51 | 51 | |
52 | 52 | $fieldNote = $fieldNoteService->fetchOneBy([ |
53 | - 'id' => (int) $_GET['fieldnoteid'], |
|
54 | - 'user_id' => (int) $user->getUserId() |
|
53 | + 'id' => (int)$_GET['fieldnoteid'], |
|
54 | + 'user_id' => (int)$user->getUserId() |
|
55 | 55 | ]); |
56 | 56 | |
57 | 57 | if ($fieldNote !== null) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | // check if masslog warning is accepted (in cookie) |
98 | 98 | $masslogCookieSet = isset($_COOKIE['ocsuppressmasslogwarn']); |
99 | 99 | if ($masslogCookieSet) { |
100 | - $masslogCookieContent = (int) $_COOKIE['ocsuppressmasslogwarn']; |
|
100 | + $masslogCookieContent = (int)$_COOKIE['ocsuppressmasslogwarn']; |
|
101 | 101 | } else { |
102 | 102 | // save masslog acception in cookie that expires on midnight if clicked |
103 | 103 | if (isset($_REQUEST['suppressMasslogWarning']) && $_REQUEST['suppressMasslogWarning'] == 1) { |
@@ -109,17 +109,17 @@ discard block |
||
109 | 109 | // logtext, logtype, logday, logmonth, logyear |
110 | 110 | |
111 | 111 | $logText = isset($_POST['logtext']) ? trim($_POST['logtext']) : ''; |
112 | - $logType = isset($_REQUEST['logtype']) ? (int) $_REQUEST['logtype'] : null; |
|
112 | + $logType = isset($_REQUEST['logtype']) ? (int)$_REQUEST['logtype'] : null; |
|
113 | 113 | $logDateDay = isset($_POST['logday']) ? trim($_POST['logday']) : ($datesaved ? $defaultLogDay : date('d')); |
114 | 114 | $logDateMonth = isset($_POST['logmonth']) ? trim($_POST['logmonth']) : ($datesaved ? $defaultLogMonth : date('m')); |
115 | 115 | $logDateYear = isset($_POST['logyear']) ? trim($_POST['logyear']) : ($datesaved ? $defaultLogYear : date('Y')); |
116 | 116 | $logTimeHour = isset($_POST['loghour']) ? trim($_POST['loghour']) : ''; |
117 | 117 | $logTimeMinute = isset($_POST['logminute']) ? trim($_POST['logminute']) : ''; |
118 | - $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int) $_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int) $_POST['needs_maintenance'] : 0); |
|
119 | - $listingOutdated = isset($_POST['listing_outdated2']) ? (int) $_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int) $_POST['listing_outdated'] : 0); |
|
120 | - $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int) $_POST['confirm_listing_ok'] : 0; |
|
121 | - $rateOption = isset($_POST['ratingoption']) ? (int) $_POST['ratingoption'] : 0; |
|
122 | - $rateCache = isset($_POST['rating']) ? (int) $_POST['rating'] : 0; |
|
118 | + $needsMaintenance = isset($_POST['needs_maintenance2']) ? (int)$_POST['needs_maintenance2'] : (isset($_POST['needs_maintenance']) ? (int)$_POST['needs_maintenance'] : 0); |
|
119 | + $listingOutdated = isset($_POST['listing_outdated2']) ? (int)$_POST['listing_outdated2'] : (isset($_POST['listing_outdated']) ? (int)$_POST['listing_outdated'] : 0); |
|
120 | + $confirmListingOk = isset($_POST['confirm_listing_ok']) ? (int)$_POST['confirm_listing_ok'] : 0; |
|
121 | + $rateOption = isset($_POST['ratingoption']) ? (int)$_POST['ratingoption'] : 0; |
|
122 | + $rateCache = isset($_POST['rating']) ? (int)$_POST['rating'] : 0; |
|
123 | 123 | $ocTeamComment = isset($_REQUEST['teamcomment']) ? $_REQUEST['teamcomment'] != 0 : 0; |
124 | 124 | $suppressMasslogWarning = isset($_REQUEST['suppressMasslogWarning']) ? $_REQUEST['suppressMasslogWarning'] : ($masslogCookieSet ? $masslogCookieContent : 0); |
125 | 125 | |
@@ -165,12 +165,12 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | // if not a found log, ignore the rating |
168 | - $rateOption = (int) ($logType == 1 || $logType == 7); |
|
168 | + $rateOption = (int)($logType == 1 || $logType == 7); |
|
169 | 169 | |
170 | 170 | // get log text editor mode (from form or from userprofile) |
171 | 171 | // 1 = text; 2 = HTML; 3 = tinyMCE |
172 | 172 | if (isset($_POST['descMode'])) { |
173 | - $descMode = (int) $_POST['descMode']; // Ocprop: 2 |
|
173 | + $descMode = (int)$_POST['descMode']; // Ocprop: 2 |
|
174 | 174 | if (($descMode < EditorConstants::HTML_MODE) || ($descMode > EditorConstants::EDITOR_MODE)) { |
175 | 175 | $descMode = EditorConstants::EDITOR_MODE; |
176 | 176 | } |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * set seconds 00:00:01, means "00:00 was logged" |
249 | 249 | * set seconds 00:00:00, means "no time was logged" |
250 | 250 | */ |
251 | - $logTimeSecond = (int) ($logTimeHour . $logTimeMinute != '' |
|
251 | + $logTimeSecond = (int)($logTimeHour . $logTimeMinute != '' |
|
252 | 252 | && $logTimeHour == 0 |
253 | 253 | && $logTimeMinute == 0); |
254 | 254 | |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | $logDate = date( |
257 | 257 | $opt['db']['dateformat'], |
258 | 258 | mktime( |
259 | - (int) $logTimeHour, |
|
260 | - (int) $logTimeMinute, |
|
259 | + (int)$logTimeHour, |
|
260 | + (int)$logTimeMinute, |
|
261 | 261 | $logTimeSecond, |
262 | 262 | $logDateMonth, |
263 | 263 | $logDateDay, |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | if (isset($_REQUEST['fieldnoteid']) && $_REQUEST['fieldnoteid']) { |
309 | 309 | sql( |
310 | 310 | 'DELETE FROM field_note WHERE `id` = &1 AND `user_id` = &2', |
311 | - (int) $_REQUEST['fieldnoteid'], |
|
311 | + (int)$_REQUEST['fieldnoteid'], |
|
312 | 312 | $user->getUserId() |
313 | 313 | ); |
314 | 314 | |
@@ -395,8 +395,8 @@ discard block |
||
395 | 395 | |
396 | 396 | // prepare template and display |
397 | 397 | $tpl->assign('logtype_allows_nm', implode(',', $logtype_allows_nm)); |
398 | -$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int) $_REQUEST['scrollposx']: 0); |
|
399 | -$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int) $_REQUEST['scrollposy']: 0); |
|
398 | +$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? (int)$_REQUEST['scrollposx'] : 0); |
|
399 | +$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? (int)$_REQUEST['scrollposy'] : 0); |
|
400 | 400 | $tpl->assign('validate', $validate); |
401 | 401 | $tpl->assign('editlog', false); |
402 | 402 |
@@ -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) { |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | // current cache and log-counters |
67 | 67 | $tpl->assign( |
68 | 68 | 'count_hiddens', |
69 | - number1000((int) $connection->fetchColumn('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
69 | + number1000((int)$connection->fetchColumn('SELECT COUNT(*) AS `hiddens` FROM `caches` WHERE `status` = 1')) |
|
70 | 70 | ); |
71 | 71 | $tpl->assign( |
72 | 72 | 'count_founds', |
73 | - number1000((int) $connection->fetchColumn('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
73 | + number1000((int)$connection->fetchColumn('SELECT COUNT(*) AS `founds` FROM `cache_logs` WHERE `type` = 1')) |
|
74 | 74 | ); |
75 | 75 | $tpl->assign( |
76 | 76 | 'count_users', |
77 | 77 | number1000( |
78 | - (int) $connection->fetchColumn( |
|
78 | + (int)$connection->fetchColumn( |
|
79 | 79 | 'SELECT COUNT(*) AS `users` |
80 | 80 | FROM ( |
81 | 81 | SELECT DISTINCT `user_id` |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | // get total event count for all countries |
94 | 94 | $tpl->assign( |
95 | 95 | 'total_events', |
96 | - (int) $connection->fetchColumn( |
|
96 | + (int)$connection->fetchColumn( |
|
97 | 97 | 'SELECT COUNT(*) |
98 | 98 | FROM `caches` |
99 | 99 | WHERE `type` = 6 |