Example #1
0
    $PROJECT_ID = $items[0];
    $VERSION = $items[1];
}
$LANGUAGE_ID = getHTTPParameter("language_id");
$SUBMIT = getHTTPParameter("submit");
$sql = "SELECT DISTINCT pv_m.project_id, pv_m.version FROM project_versions AS pv_m INNER JOIN map_files as m ON pv_m.project_id = m.project_id AND pv_m.version = m.version WHERE pv_m.is_active UNION SELECT DISTINCT pv_s.project_id, pv_s.version FROM project_versions AS pv_s INNER JOIN project_source_locations as s ON pv_s.project_id = s.project_id AND pv_s.version = s.version WHERE pv_s.is_active ORDER BY project_id ASC, version DESC";
$rs_p_list = mysql_query($sql, $dbh);
$sql = "SELECT language_id, IF(locale <> '', CONCAT(CONCAT(CONCAT(name, ' ('), locale), ')'), name) as name FROM languages WHERE is_active AND iso_code != 'en' ORDER BY name";
$rs_l_list = mysql_query($sql, $dbh);
$where = "";
if ($PROJECT_ID != "") {
    $where = addAndIfNotNull($where) . " p.project_id = ";
    $where .= returnQuotedString(sqlSanitize($PROJECT_ID, $dbh));
}
if ($LANGUAGE_ID != "") {
    $where = addAndIfNotNull($where) . " l.language_id = ";
    $where .= returnQuotedString(sqlSanitize($LANGUAGE_ID, $dbh));
}
if ($VERSION != "") {
    $where = addAndIfNotNull($where) . "p.version = ";
    $where .= returnQuotedString(sqlSanitize($VERSION, $dbh));
}
if ($where != "") {
    $where = " WHERE " . $where;
}
$sql = "SELECT p.project_id, p.version, l.name, l.locale, p.pct_complete FROM project_progress AS p INNER JOIN languages AS l ON l.language_id = p.language_id {$where} ORDER BY p.pct_complete DESC, p.project_id, p.version, l.name";
$rs_p_stat = mysql_query($sql, $dbh);
global $addon;
$addon->callHook("head");
include $incfile;
$addon->callHook("footer");
Example #2
0
$sql = "SELECT language_id, IF(locale <> '', CONCAT(CONCAT(CONCAT(name, ' ('), locale), ')'), name) as name FROM languages WHERE is_active AND iso_code != 'en' ORDER BY name";
$rs_l_list = mysql_query($sql, $dbh);
$where = " t.is_active ";
if ($PROJECT_ID != "") {
    $where = addAndIfNotNull($where) . " f.project_id = ";
    $where .= returnQuotedString(sqlSanitize($PROJECT_ID, $dbh));
}
if ($LANGUAGE_ID != "") {
    $where = addAndIfNotNull($where) . " t.language_id = ";
    $where .= returnQuotedString(sqlSanitize($LANGUAGE_ID, $dbh));
}
if ($VERSION != "") {
    $where = addAndIfNotNull($where) . "f.version = ";
    $where .= returnQuotedString(sqlSanitize($VERSION, $dbh));
}
if ($USERID != "") {
    $where = addAndIfNotNull($where) . "u.userid = ";
    $where .= sqlSanitize($USERID, $dbh);
}
if ($FUZZY == 1) {
    $where = addAndIfNotNull($where) . "t.possibly_incorrect = 1 ";
}
if ($where != "") {
    $where = " WHERE " . $where;
}
$sql = "SELECT \r\n  s.name AS string_key, s.value as string_value, \r\n  t.value as translation,\r\n  t.possibly_incorrect as fuzzy, \r\n  IF(u.last_name <> '' AND u.first_name <> '', \r\n  \tCONCAT(CONCAT(first_name, ' '), u.last_name), \r\n  \tIF(u.first_name <> '', u.first_name, u.last_name)) AS who,\r\n  u.userid, \r\n  t.created_on, l.iso_code as language,\r\n  f.project_id, f.version, f.name\r\nFROM \r\n  translations as t \r\n  LEFT JOIN strings as s on s.string_id = t.string_id \r\n  LEFT JOIN files as f on s.file_id = f.file_id \r\n  LEFT JOIN users as u on u.userid = t.userid\r\n  LEFT JOIN languages as l on l.language_id = t.language_id \r\n{$where}\r\nORDER BY t.created_on desc \r\nLIMIT {$LIMIT}";
$rs_p_stat = mysql_query($sql, $dbh);
global $addon;
$addon->callHook("head");
include $incfile;
$addon->callHook("footer");