Skip to content

Commit

Permalink
issue opencaching#601 upload fieldnotes
Browse files Browse the repository at this point in the history
  • Loading branch information
hxdimpf committed Dec 1, 2023
1 parent 34975e3 commit 4785220
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions okapi/core/OkapiServiceRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class OkapiServiceRunner
'services/caches/formatters/garmin',
'services/caches/formatters/ggz',
'services/caches/map/tile',
'services/draftlogs/upload_fieldnotes',
'services/logs/capabilities',
'services/logs/delete',
'services/logs/edit',
Expand Down
31 changes: 31 additions & 0 deletions okapi/services/apisrv/installation/WebService.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,38 @@ public static function call(OkapiRequest $request)
$result['has_image_positions'] = Settings::get('OC_BRANCH') == 'oc.de';
$result['has_ratings'] = Settings::get('OC_BRANCH') == 'oc.pl';
$result['geocache_passwd_max_length'] = Db::field_length('caches', 'logpw');
if (Settings::get('OC_BRANCH') == 'oc.de') {
$result['has_draft_logs'] = true;
$result['has_lists'] = true;
$result['cache_types'] = self::getCacheTypes();
$result['log_types'] = self::getLogTypes();

}

return Okapi::formatted_response($request, $result);
}

private static function getCacheTypes() {
$rs = Db::query("
SELECT name
FROM cache_type;
");
$cache_types = [];
while ($row = Db::fetch_assoc($rs)) {
$cache_types[] = $row['name'];
}
return $cache_types;
}

private static function getLogTypes() {
$rs = Db::query("
SELECT name
FROM log_types;
");
$log_types = [];
while ($row = Db::fetch_assoc($rs)) {
$log_types[] = $row['name'];
}
return $log_types;
}
}

0 comments on commit 4785220

Please sign in to comment.