[221971]
diff --git a/babel-setup.sql b/babel-setup.sql
index 32af4d5..e411010 100644
--- a/babel-setup.sql
+++ b/babel-setup.sql
@@ -395,6 +395,7 @@
insert into languages set iso_code = 'hi', name = "Hindi";
insert into languages set iso_code = 'ro', name = "Romanian";
insert into languages set iso_code = 'uk', name = "Ukrainian";
+insert into languages set iso_code = 'es_CA', name = "Spanish-Catalonian";
insert into project_versions set project_id = "eclipse", version = "3.4", is_active = 1;
diff --git a/html/content/en_stats.php b/html/content/en_stats.php
new file mode 100644
index 0000000..866777e
--- /dev/null
+++ b/html/content/en_stats.php
@@ -0,0 +1,94 @@
+<div id="maincontent">
+<div id="midcolumn">
+
+<style>
+.head {
+ background-color: SteelBlue;
+ color: white;
+ margin: 0px;
+ font-size: 14px;
+ padding: 2px;
+}
+
+.odd {
+ background-color: LightSteelBlue;
+}
+
+.foot {
+ background-color: LightGray;
+}
+
+.
+</style>
+
+<h1><?= $pageTitle ?></h1>
+<form method="post">
+<table>
+<tr><td>Show only this project</td>
+ <td><select name="project_version">
+ <option value="">All projects</option>
+<?php
+ while($myrow = mysql_fetch_assoc($rs_p_list)) {
+ $selected = "";
+ if($myrow['project_id'] . "|" . $myrow['version'] == $PROJECT_ID . "|" . $VERSION) {
+ $selected = 'selected="selected"';
+ }
+ echo "<option value='" . $myrow['project_id'] . "|" . $myrow['version'] . "' $selected>" . $myrow['project_id'] . " " . $myrow['version'] . "</option>";
+ }
+ ?></select></td>
+ <td>Show only this language</td>
+ <td><select name="language_id">
+ <option value="">All languages</option>
+<?php
+ while($myrow = mysql_fetch_assoc($rs_l_list)) {
+ $selected = "";
+ if($myrow['language_id'] == $LANGUAGE_ID) {
+ $selected = 'selected="selected"';
+ }
+ echo "<option value='" . $myrow['language_id'] . "' $selected>" . $myrow['name'] . "</option>";
+ }
+ ?></select></td>
+ </tr>
+ <tr><td colspan="4"><input type="submit" value="Apply filter" /></td></tr></table></form>
+<table cellspacing=1 cellpadding=2 border=0 width="950">
+<tr class="head">
+<?php
+ $i = 0;
+ while($i < mysql_num_fields($rs_p_stat)) {
+ $meta = mysql_fetch_field($rs_p_stat, $i);
+ $align = "";
+ if($meta->numeric) {
+ $align="align='right'";
+ }
+ echo "<td $align><b>" . $meta->name . "</b></td>";
+ $i++;
+ }
+ ?></tr>
+<?php
+ $rowcount=0;
+ while($myrow = mysql_fetch_assoc($rs_p_stat)) {
+ $rowcount++;
+ $class="";
+ if($rowcount % 2) {
+ $class="class='odd'";
+ }
+ echo "<tr $class>";
+ $i = 0;
+ while($i < mysql_num_fields($rs_p_stat)) {
+ $meta = mysql_fetch_field($rs_p_stat, $i);
+ $align = "";
+ if($meta->numeric) {
+ $align="align='right'";
+ }
+
+ echo "<td $align>" . $myrow[$meta->name] . "</td>";
+ $i++;
+ }
+ echo "</tr>";
+ }
+ ?>
+ <tr class="foot">
+ <td colspan="<?= $i ?>"> <?= $rowcount ?> row<?= $rowcount > 1 || $rowcount == 0 ? "s" : "" ?> found.</td>
+ </tr>
+ </table>
+
\ No newline at end of file
diff --git a/html/fragments/top_translators.php b/html/fragments/top_translators.php
index 3488698..722aa53 100644
--- a/html/fragments/top_translators.php
+++ b/html/fragments/top_translators.php
@@ -28,5 +28,8 @@
}
?>
</dl>
+ <br />
+ <a href="stats.php">More stats...</a>
</div>
- <br style='clear: both;'>
+
+<br style='clear: both;'>
diff --git a/html/stats.php b/html/stats.php
new file mode 100644
index 0000000..ef2db1e
--- /dev/null
+++ b/html/stats.php
@@ -0,0 +1,81 @@
+<?php
+/*******************************************************************************
+ * Copyright (c) 2008 Eclipse Foundation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eclipse Foundation - Initial API and implementation
+*******************************************************************************/
+include("global.php");
+
+InitPage("");
+
+global $User;
+global $App, $dbh;
+
+$pageTitle = "Babel - Translation statistics";
+$pageKeywords = "";
+$incfile = "content/en_stats.php";
+
+$PROJECT_VERSION = $App->getHTTPParameter("project_version");
+$PROJECT_ID = "";
+$VERSION = "";
+
+if($PROJECT_VERSION != "") {
+
+ $items = explode("|", $PROJECT_VERSION);
+ $PROJECT_ID = $items[0];
+ $VERSION = $items[1];
+}
+$LANGUAGE_ID= $App->getHTTPParameter("language_id");
+$SUBMIT = $App->getHTTPParameter("submit");
+
+$sql = "SELECT project_id, version FROM project_versions WHERE is_active ORDER BY project_id ASC, version DESC";
+$rs_p_list = mysql_query($sql, $dbh);
+
+$sql = "SELECT language_id, name FROM languages WHERE is_active ORDER BY name";
+$rs_l_list = mysql_query($sql, $dbh);
+
+if($SUBMIT == "showfiles") {
+ $incfile = "content/en_map_files_show.php";
+ $sql = "SELECT project_id, version, filename, location FROM map_files WHERE is_active = 1
+ AND project_id = " . $App->returnQuotedString($App->sqlSanitize($PROJECT_ID, $dbh)) . "
+ AND version = " . $App->returnQuotedString($App->sqlSanitize($VERSION, $dbh));
+ $rs_map_file_list = mysql_query($sql, $dbh);
+ include($incfile);
+}
+else {
+
+ $where = "";
+
+ if($PROJECT_ID != "") {
+ $where = $App->addAndIfNotNull($where) . " p.project_id = ";
+ $where .= $App->returnQuotedString($App->sqlSanitize($PROJECT_ID, $dbh));
+ }
+ if($LANGUAGE_ID != "") {
+ $where = $App->addAndIfNotNull($where) . " l.language_id = ";
+ $where .= $App->returnQuotedString($App->sqlSanitize($LANGUAGE_ID, $dbh));
+ }
+ if($VERSION != "") {
+ $where = $App->addAndIfNotNull($where) . "p.version = ";
+ $where .= $App->returnQuotedString($App->sqlSanitize($VERSION, $dbh));
+ }
+
+ if($where != "") {
+ $where = " WHERE " . $where;
+ }
+
+ $sql = "SELECT p.project_id, p.version, l.name, 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);
+
+ include("head.php");
+ include($incfile);
+ include("foot.php");
+}
+
+
+
+?>
\ No newline at end of file