Skip to content
Permalink
Browse files

disable 'needs maintenance' comments after DNF

  • Loading branch information...
following5 committed Mar 20, 2016
1 parent 0a01556 commit ca9b844215d5ccb39e2fe0e3b6f6d422ba72f03f
Showing with 26 additions and 12 deletions.
  1. +10 −1 htdocs/log.php
  2. +16 −11 htdocs/templates2/ocstyle/log_cache.tpl
@@ -303,9 +303,18 @@
// show number of found on log page
$tpl->assign('showstatfounds', $user->showStatFounds());
$tpl->assign('logpw', $cache->requireLogPW());
// smiley list
$tpl->assign('smilies', $smiley_a);
$tpl->assign('smileypath', $opt['template']['smiley']);
// DNF state
$dnf_by_logger = sql_value("
SELECT `type` FROM `cache_logs`
WHERE `cache_id`='&1' AND `user_id`='&2' AND `type` IN (1,2)
ORDER BY `order_date` DESC, `date_created` DESC, `id` DESC
LIMIT 1",
0, $cache->getCacheId(), $login->userid) == 2;
$tpl->assign('dnf_by_logger', $dnf_by_logger);
}
else
{
@@ -22,6 +22,7 @@ var tip_dnf_nm = "{t}If you are sure that the geocache is gone, and the owner do
var cache_listing_is_outdated = {$cache_listing_is_outdated} + 0;
var ownerlog = {$ownerlog} + 0;
var dnf_by_logger = {$dnf_by_logger+0} && !ownerlog;
{literal}
@@ -98,15 +99,17 @@ function logtype_changed()
var nm = document.getElementById('needs_maintenance');
var lo = document.getElementById('listing_outdated');
if ((new_logtype == 2) != (old_logtype == 2))
if (((new_logtype == 2) != (old_logtype == 2)) ||
(dnf_by_logger && (new_logtype == 3) != (old_logtype == 3)))
{
nm.value = "0";
nm.disabled = (new_logtype == 2);
nm.className = (new_logtype == 2 ? 'disabled' : '');
var nmdisable = !ownerlog && ((new_logtype == 2) || (new_logtype == 3 && dnf_by_logger));
nm.disabled = nmdisable;
nm.className = (nmdisable ? 'disabled' : '');
lo.value = "0";
lo.disabled = (new_logtype == 2);
lo.className = (new_logtype == 2 ? 'disabled' : '');
lo.disabled = (!ownerlog && new_logtype == 2);
lo.className = (!ownerlog && new_logtype == 2 ? 'disabled' : '');
}
if ((new_logtype == 10) != (old_logtype == 10))
@@ -145,23 +148,25 @@ function logtype_changed()
function show_nm_tip()
{
if (document.editform.logtype.value == "10")
var logtype = document.editform.logtype.value;
if (logtype == "10")
show_tip(tip_activate_nm);
else if (document.editform.logtype.value == "11")
else if (logtype == "11")
show_tip(tip_disable_nm);
else if (document.editform.logtype.value == "2")
else if (!ownerlog && (logtype == "2" || (dnf_by_logger && logtype == 3)))
show_tip(tip_dnf_nm);
else
show_tip(tip_general_nm);
}
function show_lo_tip()
{
if (document.editform.logtype.value == "10")
var logtype = document.editform.logtype.value;
if (logtype == "10")
show_tip(tip_activate_lo);
else if (document.editform.logtype.value == "11")
else if (logtype == "11")
show_tip(tip_disable_lo);
else if (document.editform.logtype.value != "2")
else if (logtype != "2" || ownerlog)
show_tip(tip_general_lo);
}

0 comments on commit ca9b844

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