From 1c63160f1e42f9f8ce9ecf438aaf6b1f19469aee Mon Sep 17 00:00:00 2001 From: Sobak Date: Mon, 23 Jun 2014 08:34:48 +0200 Subject: [PATCH] Recognize n/a as a missing revision number; separate files without rev number and critical files --- include/lib_revcheck.inc.php | 6 ++++-- www/revcheck.php | 10 ++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/lib_revcheck.inc.php b/include/lib_revcheck.inc.php index be78041..61a86bb 100644 --- a/include/lib_revcheck.inc.php +++ b/include/lib_revcheck.inc.php @@ -235,7 +235,7 @@ function get_misstags($idx, $lang) d.name AS dir, b.size AS en_size, a.size AS trans_size, a.name AS name FROM files a, dirs d LEFT JOIN files b ON a.dir = b.dir AND a.name = b.name - WHERE a.lang="'.$lang.'" AND b.lang="en" AND a.revision IS NULL + WHERE a.lang="'.$lang.'" AND b.lang="en" AND (a.revision IS NULL OR a.revision = "n/a") AND a.size IS NOT NULL AND a.dir = d.id'; $result = $idx->query($sql); @@ -453,6 +453,8 @@ function get_stats_critical($idx, $lang) ) ) ) + AND + a.revision != "n/a" AND a.size is not NULL AND @@ -554,7 +556,7 @@ function get_stats_notag($idx, $lang) AND b.lang="en" AND - a.revision is NULL + (a.revision is NULL OR a.revision = "n/a") AND a.size is not NULL AND diff --git a/www/revcheck.php b/www/revcheck.php index 7bdce8b..fda0c0f 100644 --- a/www/revcheck.php +++ b/www/revcheck.php @@ -162,11 +162,11 @@ TRANSLATORS_HEAD; $misstags = get_misstags($dbhandle, $lang); $num = count($misstags); if (!$num) { - echo '

Good, all files contain revision comments.

'; + echo '

Good, all files contain revision numbers.

'; } else { echo ''; - echo ''; + echo ''; echo ''; $last_dir = false; @@ -191,16 +191,14 @@ TRANSLATORS_HEAD; array (REV_CRITICAL, 'Critical files'), array (REV_WIP, 'Work in progress'), array (REV_NOREV, 'Files without revision number'), - array (REV_NOTAG, 'Files without revision tag'), array (REV_NOTRANS, 'Files available for translation') ); $file_summary_array = array( REV_UPTODATE => array(0,0), - REV_NOREV => array(0,0), REV_CRITICAL => array(0,0), REV_OLD => array(0,0), - REV_NOTAG => array(0,0), + REV_NOREV => array(0,0), REV_NOTRANS => array(0,0), REV_CREDIT => array(0,0), REV_WIP => array(0,0) @@ -210,7 +208,7 @@ TRANSLATORS_HEAD; $file_summary_array[REV_CRITICAL] = get_stats_critical($dbhandle, $lang); $file_summary_array[REV_UPTODATE] = get_stats_uptodate($dbhandle, $lang); $file_summary_array[REV_OLD] = get_stats_old($dbhandle, $lang); - $file_summary_array[REV_NOTAG] = get_stats_notag($dbhandle, $lang); + $file_summary_array[REV_NOREV] = get_stats_notag($dbhandle, $lang); $file_summary_array[REV_NOTRANS] = get_stats_notrans($dbhandle, $lang); echo '
Files without Revision-comment ('.$num.' files):Sizes in kB
Files without EN-Revision number ('.$num.' files):Sizes in kB
en'.$lang.'diff
';