Skip to content
Permalink
Browse files

restricted use of "description is up-to-date" logs

- can be logged only by the owner or if the cache is in "description is
  outdated" state

- if not logged by the owner, an additional confirmation is needed
  • Loading branch information...
following5 committed Mar 8, 2016
1 parent e54f13e commit c3ce6104333f6928b37c0ca38db06dc3ed46d963
@@ -2855,9 +2855,11 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2568', 'New coo
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2569', 'moved by %1 meters', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2570', 'moved by %1 km', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2571', 'Protect old coordinates', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2598', 'Select <i>ok</i> if you have found or checked the cache and everything is in<br />acceptable condition.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2598', 'Select <i>ok</i> if you have found or checked the cache and everything is ok.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2599', 'Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash; and can confirm<br />that everything is up-to-date.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2600', 'Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash;, have compared<br />it to the geocaching.com listing (%1) and can confirm that everything is<br />up-to-date.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2601', 'The problems of the cache description as mentioned in the <a href=\"%1\" target=\"_blank\"><img src=\"resource2/ocstyle/images/log/16x16-listing-outdated.png\" /> log entries</a> do no longer exist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2602', 'All information (coordinates, container size, difficulty, terrain, description text, encoded hints, additional waypoints) is at least up-to-date with', '2015-06-17 10:09:14');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2569', 'DE', 'verlegt um %1 Meter', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2570', 'DE', 'verlegt um %1 km', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2571', 'DE', 'Altkoordinaten schützen', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2598', 'DE', 'Wähle <i>ok</i>, wenn du den Cache gefunden oder kontrolliert hast und alles in<br />akzeptablem Zustand ist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2599', 'DE', 'Wähle <i>in Ordnung</i>, wenn du die vollständige Beschreibung \&ndash; von der Behältergroße<br />bis zu verschlüsselten Hinweisen und zusätzlichen Wegpunkten\&ndash; geprüft hast,<br >und alles auf aktuellem Stand ist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2598', 'DE', 'Wähle <i>ok</i>, wenn du den Cache gefunden oder kontrolliert hast und alles ok ist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2599', 'DE', 'Wähle <i>in Ordnung</i>, wenn du die vollständige Beschreibung \&ndash; von der Behältergroße<br />bis zu verschlüsselten Hinweisen und zusätzlichen Wegpunkten \&ndash; geprüft hast,<br >und alles auf aktuellem Stand ist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2600', 'DE', 'Wähle <i>in Ordnung</i>, wenn du die vollständige Beschreibung \&ndash; von der Behältergroße<br />bis zu verschlüsselten Hinweisen und zusätzlichen Wegpunkten \&ndash; geprüft und mit dem<br />GC-Listing (%1) verglichen hast, und alles auf aktuellem Stand ist.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2601', 'DE', 'Die in den <a href=\"%1\" target=\"_blank\"><img src=\"resource2/ocstyle/images/log/16x16-listing-outdated.png\" />-Logeinträgen</a> erwähnten Probleme mit der Cachebeschreibung bestehen nicht mehr.', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2602', 'DE', 'Alle Angaben (Koordinaten, Behältergröße, Schwierigkeit, Geländewertung, Beschreibungstext, verschlüsselte Hinweise, zusätzliche Wegpunkte) sind mindestens auf dem Stand von', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing – please do not login', '2010-08-28 11:48:07');
@@ -361,8 +361,9 @@
END IF;
UPDATE `caches` SET
`needs_maintenance` = (SELECT GREATEST(0,`needs_maintenance`-1) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=nCacheID AND (`cache_logs`.`needs_maintenance`>0 OR `cache_logs`.`type` In (9,13,14)) ORDER BY `date` DESC, `date_created` DESC LIMIT 1),
`listing_outdated` = (SELECT GREATEST(0,`listing_outdated`-1) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=nCacheID AND (`cache_logs`.`listing_outdated`>0 OR `cache_logs`.`type` In (9,13,14)) ORDER BY `date` DESC, `date_created` DESC LIMIT 1)
`needs_maintenance` = (SELECT GREATEST(0,`needs_maintenance`-1) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=nCacheID AND (`cache_logs`.`needs_maintenance`>0 OR `cache_logs`.`type` In (9,13,14)) ORDER BY `date` DESC, `date_created` DESC, `id` DESC LIMIT 1),
`listing_outdated` = (SELECT GREATEST(0,`listing_outdated`-1) FROM `cache_logs` WHERE `cache_logs`.`cache_id`=nCacheID AND (`cache_logs`.`listing_outdated`>0 OR `cache_logs`.`type` In (9,13,14)) ORDER BY `date` DESC, `date_created` DESC, `id` DESC LIMIT 1)
/* same sorting order as in caches::getListingOutdatedLogUrl() */
WHERE `caches`.`cache_id`=nCacheId;
END IF;
IF IFNULL(@deleting_user,0)=0 THEN
@@ -236,6 +236,25 @@ function getListingOutdated()
{
return $this->reCache->getValue('listing_outdated');
}
function getListingOutdatedLogUrl()
{
$url = '';
$rs = sql("
SELECT `id`, `listing_outdated`
FROM `cache_logs`
WHERE `cache_id`='&1' AND `listing_outdated`>0
ORDER BY `date` DESC, `date_created` DESC, `id` DESC",
// same sorting order as in DB function sp_update_logstat()
$this->getCacheId()
);
if ($r = sql_fetch_assoc($rs))
if ($r['listing_outdated'] == 2)
$url = 'viewlogs.php?cacheid='.$this->getCacheId().'#log'.$r['id'];
sql_free_result($rs);
return $url;
}
function setListingOutdated($value)
{
return $this->reCache->setValue('listing_outdated', $value);
@@ -98,6 +98,7 @@
$logTimeMinute = (isset($_POST['logminute'])) ? trim($_POST['logminute']) : "";
$needsMaintenance = (isset($_POST['needs_maintenance2'])) ? ($_POST['needs_maintenance2'])+0 : (isset($_POST['needs_maintenance']) ? ($_POST['needs_maintenance'])+0 : 0);
$listingOutdated = (isset($_POST['listing_outdated2'])) ? ($_POST['listing_outdated2'])+0 : (isset($_POST['listing_outdated']) ? ($_POST['listing_outdated'])+0 : 0);
$confirmListingOk = (isset($_POST['confirm_listing_ok'])) ? $_POST['confirm_listing_ok']+0 : 0;
$rateOption = (isset($_POST['ratingoption'])) ? $_POST['ratingoption']+0 : 0;
$rateCache = (isset($_POST['rating'])) ? $_POST['rating']+0 : 0;
$ocTeamComment = (isset($_REQUEST['teamcomment'])) ? $_REQUEST['teamcomment'] != 0 : 0;
@@ -110,6 +111,8 @@
if ($needsMaintenance != 1 && $needsMaintenance != 2) $needsMaintenance = 0;
if ($listingOutdated != 1 && $listingOutdated != 2) $listingOutdated = 0;
}
if ($listingOutdated == 1 && !$confirmListingOk)
$listingOutdated = 0;
// if not a found log, ignore the rating
$rateOption = ($logType == 1 || $logType == 7) + 0;
@@ -264,6 +267,7 @@
// assign values to template
// user info
$tpl->assign('userFound', $user->getStatFound());
$tpl->assign('ownerlog', $login->userid == $cache->getUserId());
// cache infos
$tpl->assign('cachename', $cache->getName());
$tpl->assign('cacheid', $cache->getCacheId());
@@ -277,6 +281,8 @@
$tpl->assign('logminute', $logTimeMinute);
// cache condition flags
$tpl->assign('cache_needs_maintenance', $cache->getNeedsMaintenance());
$tpl->assign('cache_listing_is_outdated', $cache->getListingOutdated());
$tpl->assign('cache_listing_outdated_log', $cache->getListingOutdatedLogUrl());
$tpl->assign('needs_maintenance', $needsMaintenance);
$tpl->assign('listing_outdated', $listingOutdated);
$tpl->assign('condition_history', $cache->getConditionHistory());
@@ -12,12 +12,16 @@
var cache_needs_maintenance = {$cache_needs_maintenance + 0};
var cachetype = {$cachetype};
var logtype_allows_nm = [{$logtype_allows_nm}];
var tip_general_nm = "{t}Select <i>needs maintenance</i> if the geocache was in poor condition at the<br />specified date and in urgent need of maintenance. Please explain why.{/t}<br /><div style='height:0.3em'></div>{t}Select <i>ok</i> if you have found or checked the cache and everything is in<br />acceptable condition.{/t}";
var tip_general_lo = "{if $gcwp}{t}Select <i>is outdated</i> if the geocache search is hampered by outdated information<br />in the description, e.g. the location has severely changed or the description lacks<br />important information which has been added at another geocaching website.<br />Please give details in your log.{/t}{else}{t}Select <i>is outdated</i> if the geocache search is hampered by outdated information<br />in the description, e.g. because the location has severely changed. Please give<br />details in your log.{/t}{/if}<br /><div style='height:0.3em'></div>{if $gcwp}{t 1=$gcwp}Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash;, have compared<br />it to the geocaching.com listing (%1) and can confirm that everything is<br />up-to-date.{/t}{else}{t}Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash; and can confirm<br />that everything is up-to-date.{/t}{/if}";
var tip_general_nm = "{t}Select <i>needs maintenance</i> if the geocache was in poor condition at the<br />specified date and in urgent need of maintenance. Please explain why.{/t}<br /><div style='height:0.3em'></div>{t}Select <i>ok</i> if you have found or checked the cache and everything is ok.{/t}";
var tip_general_lo = "{if $gcwp}{t}Select <i>is outdated</i> if the geocache search is hampered by outdated information<br />in the description, e.g. the location has severely changed or the description lacks<br />important information which has been added at another geocaching website.<br />Please give details in your log.{/t}{else}{t}Select <i>is outdated</i> if the geocache search is hampered by outdated information<br />in the description, e.g. because the location has severely changed. Please give<br />details in your log.{/t}{/if}{if $ownerlog || $cache_listing_is_outdated}<br /><div style='height:0.3em'></div>{if $gcwp}{t 1=$gcwp}Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash;, have compared<br />it to the geocaching.com listing (%1) and can confirm that everything is<br />up-to-date.{/t}{else}{t}Select <i>up to date</i> if you have checked the complete description &ndash; from the<br />container size to encoded hints and additoional wayoints &ndash; and can confirm<br />that everything is up-to-date.{/t}{/if}{/if}";
var tip_activate_nm = '{t}By logging "Available", you also confirm that the geocache is in good condition.{/t}';
var tip_activate_lo = '{t}By logging "Available", you also confirm that the geocache description is up-to-date.{/t}';
var tip_disable_nm = "{t}You may indicate here what is the current maintenance state of the geocache.{/t}";
var tip_disable_lo = "{t}You may indicate here if the cache description is up-to-date.{/t}";
var cache_listing_is_outdated = {$cache_listing_is_outdated} + 0;
var ownerlog = {$ownerlog} + 0;
{literal}
function insertSmiley(smileySymbol, smileyPath)
@@ -75,10 +79,13 @@ function logtype_changed()
if (document.editform.rating)
document.editform.rating.disabled = true;
}
var condition_logging = false;
if (cachetype != 6 && logtype_allows_nm.indexOf(logtype) >= 0)
{
document.getElementById('cache_condition').style.display = '';
document.getElementById('cache_condition_spacer').style.display = '';
condition_logging = true;
}
else
{
@@ -107,6 +114,20 @@ function logtype_changed()
document.getElementById('needs_maintenance2').value = nm.value;
document.getElementById('listing_outdated2').value = lo.value;
var clo_spacer = document.getElementById('confirm_listing_ok_spacer');
var clo_row = document.getElementById('confirm_listing_ok_row');
if (!condition_logging || lo.value != 1 || ownerlog || !cache_listing_is_outdated)
{
clo_spacer.style.display = 'none';
clo_row.style.display = 'none';
}
else
{
clo_spacer.style.display = '';
clo_row.style.display = '';
}
return false;
}
@@ -193,12 +214,12 @@ function show_tip(text)
<tr>
<td width="180px">{t}Date / time:{/t}</td>
<td>
<input class="input20" type="text" id="logday" name="logday" maxlength="2" value="{$logday}" onchange="condition_init()" />.
<input class="input20" type="text" id="logmonth" name="logmonth" maxlength="2" value="{$logmonth}" onchange="condition_init()" />.
<input class="input40" type="text" id="logyear" name="logyear" maxlength="4" value="{$logyear}" onchange="condition_init()" />
<input class="input20" type="text" id="logday" name="logday" maxlength="2" value="{$logday}" />.
<input class="input20" type="text" id="logmonth" name="logmonth" maxlength="2" value="{$logmonth}" />.
<input class="input40" type="text" id="logyear" name="logyear" maxlength="4" value="{$logyear}" />
&nbsp;&nbsp;&nbsp;
<input class="input20" type="text" id="loghour" name="loghour" maxlength="2" value="{$loghour}" onchange="condition_init()" /> :
<input class="input20" type="text" id="logminute" name="logminute" maxlength="2" value="{$logminute}" onchange="condition_init()" />
<input class="input20" type="text" id="loghour" name="loghour" maxlength="2" value="{$loghour}" /> :
<input class="input20" type="text" id="logminute" name="logminute" maxlength="2" value="{$logminute}" />
&nbsp;&nbsp;&nbsp; <span id="datecomment"></span>
{if $validate.dateOk==false}<br /><span class="errormsg">{t}date or time is invalid{/t}</span>{/if}
</td>
@@ -220,11 +241,18 @@ function show_tip(text)
<select id="listing_outdated" name="listing_outdated" onchange="logtype_changed()">
<option value="0" {if $listing_outdated==0}selected="selected"{/if}>{t}not specified{/t}</option>
<option value="2" {if $listing_outdated==2}selected="selected"{/if}>{t}outdated{/t}</option>
<option value="1" {if $listing_outdated==1}selected="selected"{/if}>{t}up to date{/t}</option>
{if $ownerlog || $cache_listing_is_outdated}<option value="1" {if $listing_outdated==1}selected="selected"{/if}>{t}up to date{/t}</option>{/if}
</select>
</span>
</td>
</tr>
<tr><td class="spacer" colspan="2" id="confirm_listing_ok_spacer" style="display:none"></td></tr>
<tr id="confirm_listing_ok_row" style="display:none">
<td></td>
<td>
<input type="checkbox" id="confirm_listing_ok" name="confirm_listing_ok" value="1" class="checkbox" {if $ownerlog}checked{/if}/> <label for="confirm_listing_ok">{t 1=$cache_listing_outdated_log}The problems of the cache description as mentioned in the <a href="%1" target="_blank"><img src="resource2/ocstyle/images/log/16x16-listing-outdated.png" /> log entries</a> do no longer exist.{/t} {if $gcwp}{t}All information (coordinates, container size, difficulty, terrain, description text, encoded hints, additional waypoints) is at least up-to-date with{/t} <a href="http://www.geocaching.com/seek/cache_details.aspx?wp={$gcwp}" target="_blank">{$gcwp}</a>.{/if}
</td>
</tr>
<tr id="cache_condition_spacer"><td class="spacer" colspan="2"></td></tr>
{if $isowner==false}
<tr>
@@ -306,7 +334,6 @@ function show_tip(text)
OcInitEditor();
var old_logtype = parseInt(document.editform.logtype.value);
logtype_changed();
condition_init();
var descMode = {$descMode};
//-->
</script>

0 comments on commit c3ce610

Please sign in to comment.
You can’t perform that action at this time.