Skip to content
Permalink
Browse files

added log_type property 'maintenance_logs'

  • Loading branch information...
following5 committed Mar 1, 2016
1 parent 7ce0358 commit d852edd5213c3e14ffb6d1e88ccc0bc33e15fc3c
@@ -751,6 +751,11 @@ function dbv_146() // NM flags
if (!sql_field_exists('caches', 'flags_last_modified'))
sql("ALTER TABLE `caches` ADD COLUMN `flags_last_modified` datetime NOT NULL COMMENT 'via Trigger (caches)'");
}
function dbv_147()
{
if (!sql_field_exists('log_types', 'maintenance_logs'))
sql("ALTER TABLE `log_types` ADD COLUMN `maintenance_logs` tinyint(1) NOT NULL");
}
// When adding new mutations, take care that they behave well if run multiple
@@ -682,16 +682,16 @@ INSERT INTO `logentries_types` (`id`, `module`, `eventname`) VALUES ('8', 'notif
-- Table log_types
SET NAMES 'utf8';
TRUNCATE TABLE `log_types`;
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('1', 'Found', '56', 'C', '0', 'gefunden', 'found', 'log/16x16-found.png', '1', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('2', 'Not found', '497', 'C', '0', 'nicht gefunden', 'not found', 'log/16x16-dnf.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('3', 'Note', '20', 'A', '0', 'Bemerkung', 'note', 'log/16x16-note.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('7', 'Attended', '498', 'C', '0', 'teilgenommen', 'attended', 'log/16x16-attended.png', '1', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('8', 'Will attend', '499', 'C', '0', 'möchte teilnehmen', 'will attend', 'log/16x16-will_attend.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('9', 'Archived', '496', 'C', '3', 'archiviert', 'Archived', 'log/16x16-archived.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('10', 'Available', '531', 'C', '1', 'kann gesucht werden', 'Available', 'log/16x16-active.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('11', 'Temporarily not available', '532', 'C', '2', 'momentan nicht verfügbar', 'Temporarily not available', 'log/16x16-disabled.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('13', 'Locked', '2023', 'C', '6', 'gesperrt', 'Locked', 'log/16x16-locked.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`) VALUES ('14', 'Locked, invisible', '822', 'C', '7', 'gesperrt, versteckt', 'Locked, invisible', 'log/16x16-locked-invisible.png', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('1', 'Found', '56', 'C', '0', 'gefunden', 'found', 'log/16x16-found.png', '1', '1', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('2', 'Not found', '497', 'C', '0', 'nicht gefunden', 'not found', 'log/16x16-dnf.png', '0', '0', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('3', 'Note', '20', 'A', '0', 'Bemerkung', 'note', 'log/16x16-note.png', '0', '0', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('7', 'Attended', '498', 'C', '0', 'teilgenommen', 'attended', 'log/16x16-attended.png', '1', '1', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('8', 'Will attend', '499', 'C', '0', 'möchte teilnehmen', 'will attend', 'log/16x16-will_attend.png', '0', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('9', 'Archived', '496', 'C', '3', 'archiviert', 'Archived', 'log/16x16-archived.png', '0', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('10', 'Available', '531', 'C', '1', 'kann gesucht werden', 'Available', 'log/16x16-active.png', '0', '0', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('11', 'Temporarily not available', '532', 'C', '2', 'momentan nicht verfügbar', 'Temporarily not available', 'log/16x16-disabled.png', '0', '0', '1');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('13', 'Locked', '2023', 'C', '6', 'gesperrt', 'Locked', 'log/16x16-locked.png', '0', '0', '0');
INSERT INTO `log_types` (`id`, `name`, `trans_id`, `permission`, `cache_status`, `de`, `en`, `icon_small`, `allow_rating`, `require_password`, `maintenance_logs`) VALUES ('14', 'Locked, invisible', '822', 'C', '7', 'gesperrt, versteckt', 'Locked, invisible', 'log/16x16-locked-invisible.png', '0', '0', '0');

-- Table news_topics
SET NAMES 'utf8';
@@ -11,6 +11,7 @@ CREATE TABLE `log_types` (
`icon_small` varchar(255) NOT NULL,
`allow_rating` tinyint(1) NOT NULL,
`require_password` tinyint(1) NOT NULL,
`maintenance_logs` tinyint(1) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
@@ -39,6 +39,10 @@
// prepare array to indicate errors in template
$validate = array();
// log and cache type which can be combined with maintenance state flags
$rs = sql("SELECT `id` FROM `log_types` WHERE `maintenance_logs`");
$logtype_allows_nm = sql_fetch_column($rs);
// proceed loggable, if valid cache_id
$validate['logAllowed'] = true;
if ($cacheId != 0)
@@ -99,7 +103,7 @@
$ocTeamComment = (isset($_REQUEST['teamcomment'])) ? $_REQUEST['teamcomment'] != 0 : 0;
$suppressMasslogWarning = (isset($_REQUEST['suppressMasslogWarning'])) ? $_REQUEST['suppressMasslogWarning'] : ($masslogCookieSet ? $masslogCookieContent : 0);
if (!in_array($logType, array(1,2,3,10,11)) || $cache->getType() == 6)
if (!in_array($logType, $logtype_allows_nm) || $cache->getType() == 6)
$needsMaintenance = $listingOutdated = 0;
else
{
@@ -298,6 +302,7 @@
}
// prepare template and display
$tpl->assign('logtype_allows_nm', implode(',', $logtype_allows_nm));
$tpl->assign('scrollposx', isset($_REQUEST['scrollposx']) ? $_REQUEST['scrollposx'] + 0 : 0);
$tpl->assign('scrollposy', isset($_REQUEST['scrollposy']) ? $_REQUEST['scrollposy'] + 0 : 0);
$tpl->assign('validate', $validate);
@@ -11,6 +11,7 @@
<!--
var cache_needs_maintenance = {$cache_needs_maintenance + 0};
var cachetype = {$cachetype};
var logtype_allows_nm = [{$logtype_allows_nm}];
{literal}
function insertSmiley(smileySymbol, smileyPath)
@@ -26,7 +27,7 @@ function insertSmiley(smileySymbol, smileyPath)
range.text = insertText + selText;
}
/* for Firefox/Mozilla */
else if(typeof myText.selectionStart != 'undefined')
else if (typeof myText.selectionStart != 'undefined')
{
var start = myText.selectionStart;
var end = myText.selectionEnd;
@@ -46,30 +47,30 @@ function insertSmiley(smileySymbol, smileyPath)
function logtype_changed()
{
{/literal}
var logtype = document.editform.logtype.value;
var logtype = parseInt(document.editform.logtype.value);
var datecomment = document.getElementById('datecomment');
var hint = '<img src="resource2/{$opt.template.style}/images/misc/hint.gif" border="0" width="15" height="11" />';
if (logtype == "1")
if (logtype == 1)
datecomment.innerHTML = hint + "{t}When did you find the geocache?{/t}";
else if (logtype == "2")
else if (logtype == 2)
datecomment.innerHTML = hint + "{t}When did you abort the cache search?{/t}";
else
datecomment.innerHTML = "";
{literal}
if (logtype == "1" || logtype == "7")
if (logtype == 1 || logtype == 7)
{
if (document.editform.rating)
document.editform.rating.disabled = false;
}
else
{
document.editform.rating.disabled = false;
}
else
{
if (document.editform.rating)
document.editform.rating.disabled = true;
}
if (cachetype != 6 && (logtype == 1 || logtype == 2 || logtype == 3 || logtype == 10 || logtype == 11))
{
document.editform.rating.disabled = true;
}
if (cachetype != 6 && logtype_allows_nm.indexOf(logtype) >= 0)
{
document.getElementById('cache_condition').style.display = '';
document.getElementById('cache_condition_spacer').style.display = '';
}
@@ -83,7 +84,7 @@ function logtype_changed()
document.getElementById('needs_maintenance').value = (old_logtype == 10 ? 0 : 1);
old_logtype = document.editform.logtype.value;
}
return false;
return false;
}
//-->
{/literal}
@@ -249,12 +250,12 @@ function logtype_changed()
</table>
</form>
<script language="javascript" type="text/javascript">
<script type="text/javascript">
<!--
OcInitEditor();
logtype_changed();
condition_init();
var descMode = {$descMode};
var old_logtype = document.editform.logtype.value;
var old_logtype = parseInt(document.editform.logtype.value);
//-->
</script>

0 comments on commit d852edd

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