Skip to content
Permalink
Browse files

#1021 - hide cache password field if log type is not found

  • Loading branch information...
teiling88 committed May 1, 2017
1 parent 8ce13b3 commit 3f6a4573ddf2dadd3c0ae97e326537ed35f3a160
Showing with 16 additions and 8 deletions.
  1. +6 −6 htdocs/editlog.php
  2. +0 −1 htdocs/log.php
  3. +10 −1 htdocs/templates2/ocstyle/log_cache.tpl
@@ -41,7 +41,7 @@
} else {
$useradmin = ($login->admin & ADMIN_USER) ? 1 : 0;
//does log with this logid exist?
//does log with this logId exist?
$log_rs = sql(
"
SELECT
@@ -325,15 +325,15 @@
// update cache status if changed by logtype
if (is_latest_log($log_record['cache_id'], $log_record['log_id'])) {
$newstatus = sqlValue(
$newStatus = sqlValue(
"SELECT `cache_status` FROM `log_types`
WHERE `id`='" . sql_escape($log_type) . "'",
false
);
if ($newstatus && $newstatus != $log_record['status']) {
if ($newStatus && $newStatus != $log_record['status']) {
sql("SET @STATUS_CHANGE_USER_ID='&1'", $login->userid);
sql(
"UPDATE `caches` SET `status`='" . sql_escape($newstatus) . "'
"UPDATE `caches` SET `status`='" . sql_escape($newStatus) . "'
WHERE `cache_id`='" . sql_escape($log_record['cache_id']) . "'"
);
}
@@ -509,7 +509,7 @@
tpl_BuildTemplate();
/**
* @param $cache_id
* @param $cacheId
* @param $logId
* @return bool
*/
@@ -522,7 +522,7 @@ function is_latest_log($cacheId, $logId)
ORDER BY `order_date` DESC, `date_created` DESC, `id` DESC
LIMIT 1",
0,
$cache_id
$cacheId
);
return ($logId == $latestLogId);
@@ -3,7 +3,6 @@
* for license information see doc/license.txt
***************************************************************************/
use AppBundle\Entity\FieldNote;
use AppBundle\Entity\GeocacheLog;
@@ -67,8 +67,17 @@ function logtype_changed()
datecomment.innerHTML = hint + "{t}When did you abort the cache search?{/t}";
else
datecomment.innerHTML = "";
{if $logpw}
if (logtype == 1)
document.getElementById("cachelisting--logpw").style.display = "block";
else
document.getElementById("cachelisting--logpw").style.display = "none";
{/if}
{literal}
if (logtype == 1 || logtype == 7)
{
if (document.editform.rating)
@@ -329,7 +338,7 @@ function show_tip(text)
{/if}
<tr><td class="spacer" colspan="2"></td></tr>
{if $logpw}
<tr>
<tr id="cachelisting--logpw">
<td colspan="2">{t}passwort to log:{/t}
<input class="input100" type="text" name="log_pw" maxlength="20" value="" /> {if !$validate.logPw}<span class="errormsg">{t}Invalid password!{/t}</span>{else}({if $cachetype==6}{t}only for attended-logs{/t}{else}{t}only for found logs{/t}{/if}){/if}
</td>

0 comments on commit 3f6a457

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