Skip to content
Permalink
Browse files

add recommendation flag to log notification email; updates #1090

  • Loading branch information...
following5 committed Aug 29, 2017
1 parent 94216fd commit d113c5fee2f68aed976750d56822312ab690a3d6
@@ -71,10 +71,12 @@ public function t($message, $style, $resource_name, $line, $plural = '', $count
ON `sys_trans`.`id`=`sys_trans_text`.`trans_id`
AND `sys_trans_text`.`lang`='&1'
WHERE `sys_trans`.`text`='&2' LIMIT 1", $lang, $search, $message);
$trans = '';
if ($r = sql_fetch_array($rs)) {
$trans = $r[0];
} else {
// string is missing in sys_trans
$trans = $message;
}
sql_free_result($rs);
@@ -312,15 +312,16 @@ function process_owner_log($user_id, $log_id)
`cache_logs`.`listing_outdated`,
`user`.`username`,
`caches`.`name` `cachename`,
`caches`.`wp_oc`
FROM
`cache_logs`,
`user`,
`caches`
WHERE
`cache_logs`.`user_id`=`user`.`user_id` AND
`cache_logs`.`cache_id`=`caches`.`cache_id` AND
`cache_logs`.`id` ='&1'",
`caches`.`wp_oc`,
`cr`.`user_id` IS NOT NULL AS `recommendation`
FROM `cache_logs`
JOIN `user` ON `cache_logs`.`user_id`=`user`.`user_id`
JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `cache_rating` `cr` ON
`cr`.`cache_id`=`cache_logs`.`cache_id` AND
`cr`.`rating_date`=`cache_logs`.`date` AND
`cache_logs`.`type` IN (1,7)
WHERE `cache_logs`.`id` ='&1'",
$log_id
);
$rLog = sql_fetch_array($rsLog);
@@ -347,14 +348,15 @@ function process_owner_log($user_id, $log_id)
'',
1,
$language
) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n";
) . ' {action}{recommendation}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n\n" . '{text}' . "\n\n\n\n";
$watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext);
$watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext);
$watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
$watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
$watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
$watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext);
$watchtext = insert_recommendation($rLog, $language, $watchtext);
$watchtext = insert_maintenance_flags($rLog, $language, $watchtext);
$domain = sqlValue("SELECT `domain` FROM `user` WHERE `user_id`='" . sql_escape($user_id) . "'", null);
@@ -395,11 +397,15 @@ function process_log_watch($user_id, $log_id)
`cache_logs`.`listing_outdated`,
`user`.`username`,
`caches`.`name` `cachename`,
`caches`.`wp_oc`
FROM
`cache_logs`,
`user`,
`caches`
`caches`.`wp_oc`,
`cr`.`user_id` IS NOT NULL AS `recommendation`
FROM `cache_logs`
JOIN `user` ON `cache_logs`.`user_id`=`user`.`user_id`
JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `cache_rating` `cr` ON
`cr`.`cache_id`=`cache_logs`.`cache_id` AND
`cr`.`rating_date`=`cache_logs`.`date` AND
`cache_logs`.`type` IN (1,7)
WHERE
`cache_logs`.`user_id`=`user`.`user_id` AND
`cache_logs`.`cache_id`=`caches`.`cache_id` AND
@@ -430,14 +436,15 @@ function process_log_watch($user_id, $log_id)
'',
1,
$language
) . ' {action}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n{cachelists}\n" . '{text}' . "\n\n\n\n";
) . ' {action}{recommendation}{maintenance_flags}' . "\n" . '{shortlink_url}{wp_oc}' . "\n{cachelists}\n" . '{text}' . "\n\n\n\n";
$watchtext = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['logdate'])), $watchtext);
$watchtext = mb_ereg_replace('{wp_oc}', $rLog['wp_oc'], $watchtext);
$watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
$watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
$watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
$watchtext = mb_ereg_replace('{action}', get_logtype_name($rLog['type'], $language), $watchtext);
$watchtext = insert_recommendation($rLog, $language, $watchtext);
$watchtext = insert_maintenance_flags($rLog, $language, $watchtext);
$rsLists = sql(
@@ -497,6 +504,17 @@ function process_log_watch($user_id, $log_id)
);
}
function insert_recommendation($rLog, $language, $watchtext)
{
global $translate;
$rtext =
$rLog['recommendation']
? ', ' . $translate->t('Recommendation', '', basename(__FILE__), __LINE__, '', 1, $language)
: '';
return mb_ereg_replace('{recommendation}', $rtext, $watchtext);
}
/**
* @param string $watchtext
*/
@@ -1952,3 +1952,4 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2655', 'Insert:
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2656', 'as first picture', '2017-08-20 19:30:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2657', 'after "%1"', '2017-08-20 19:30:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2658', 'as last picture', '2017-08-20 19:30:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2659', 'Recommendation', '2017-08-20 19:30:00');
@@ -1950,3 +1950,4 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2656', 'DE', 'als erstes Bild', '2017-08-20 19:30:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2657', 'DE', 'nach „%1“', '2017-08-20 19:30:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2658', 'DE', 'als letztes Bild', '2017-08-20 19:30:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2659', 'DE', 'Empfehlung', '2017-08-20 19:30:00');
@@ -1538,3 +1538,4 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2519', 'ES', 'Gauß-Krüger', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2522', 'ES', 'OConly', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2603', 'ES', 'Más de 2 años', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2659', 'ES', 'Recomendacion', '2010-12-09 00:17:56');
@@ -1908,4 +1908,4 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2611', 'FR', 'Votre rapport de géocache pour', '0000-00-00 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2612', 'FR', 'convertir', '0000-00-00 00:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2613', 'FR', 'waypoint', '2010-08-28 11:48:08');

INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2659', 'FR', 'Recommandation', '2010-10-04 00:17:39');
@@ -1761,4 +1761,5 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2522', 'IT', 'OConly', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2603', 'IT', 'Più di 12 anni fa', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2607', 'IT', 'Titolo:', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2659', 'IT', 'Raccomandazione', '2015-06-17 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('922', 'JA', 'JA', '2011-05-15 16:04:51');
@@ -912,4 +912,6 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2522', 'NL', 'OConly', '2013-11-03 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2603', 'NL', 'Meer dan 2 jaar geleden', '2013-11-03
10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2659', 'NL', 'Aanbeveling', '2013-11-03
10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('922', 'NO', 'NO', '2011-05-15 11:46:21');

0 comments on commit d113c5f

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