Commit 7d3ea3b9 authored by Xavier Perseguers's avatar Xavier Perseguers
Browse files

[BUGFIX] Last edit is not computed correctly

Change-Id: Id24d39c041b84e8f4d37d9a6ca7f6fcfb9c0d0f1
Reviewed-on: http://review.typo3.org/41959

Reviewed-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers's avatarXavier Perseguers <xavier@typo3.org>
parent 7e25257b
......@@ -157,28 +157,17 @@ function lastedit() {
local PROJECT="$1"
local LANGUAGE="$2"
# XP/19.06.2013: Using filesystem instead of database
#timestamp=$(mysqlpipe "SELECT p.id, p.code, l.code AS lang, u.mtime, UNIX_TIMESTAMP(u.mtime) AS tstamp
# FROM pootle_app_project AS p
# LEFT JOIN pootle_app_translationproject as tp ON p.id = tp.project_id
# LEFT JOIN pootle_store_store AS s ON tp.id = s.translation_project_id
# LEFT JOIN pootle_store_unit AS u ON s.id = u.store_id
# INNER JOIN pootle_app_language l ON l.id = tp.language_id
# WHERE ( u.state = 50 OR u.state = 200 )
# AND p.code = '$PROJECT'
# AND l.code = '$LANGUAGE'
# GROUP BY p.id, l.code;" \
#| awk '{ print $6 }')
LANGUAGE_DIR=${POOTLE_PO}/${PROJECT}/${LANGUAGE}
if [ -d ${LANGUAGE_DIR} ]; then
timestamp=$(find ${LANGUAGE_DIR} -type f -printf '%T@ %p\n' \
| grep -v "./.translation_index" \
| sort -n \
| tail -n 1 \
| cut -f1 -d.
)
fi
timestamp=$(mysqlpipe "SELECT p.id, p.code, l.code AS lang, MAX(u.mtime), UNIX_TIMESTAMP(MAX(u.mtime)) AS tstamp
FROM pootle_app_project AS p
LEFT JOIN pootle_app_translationproject as tp ON p.id = tp.project_id
LEFT JOIN pootle_store_store AS s ON tp.id = s.translation_project_id
LEFT JOIN pootle_store_unit AS u ON s.id = u.store_id
INNER JOIN pootle_app_language l ON l.id = tp.language_id
WHERE ( u.state = 50 OR u.state = 200 )
AND p.code = '$PROJECT'
AND l.code = '$LANGUAGE'
GROUP BY p.id, l.code;" \
| awk '{ print $6 }')
if [ -z "$timestamp" ]; then
echo 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment