NEW - bug 221281: Restore list index after safing translation
https://bugs.eclipse.org/bugs/show_bug.cgi?id=221281
diff --git a/html/callback/getCurrentStringTranslation.php b/html/callback/getCurrentStringTranslation.php
index ebf29f5..a60ca54 100644
--- a/html/callback/getCurrentStringTranslation.php
+++ b/html/callback/getCurrentStringTranslation.php
@@ -14,7 +14,7 @@
require_once("cb_global.php");
$string_id = $App->getHTTPParameter("string_id", "POST");
-
+$stringTableIndex = $App->getHTTPParameter("stringTableIndex", "POST");
if(isset($_SESSION['language']) and isset($_SESSION['version']) and isset($_SESSION['project'])){
$language = $_SESSION['language'];
@@ -131,6 +131,8 @@
?>
<form id='translation-form'>
<input type="hidden" name="string_id" value="<?=$line['string_id'];?>">
+ <input type="hidden" name="stringTableIndex" value="<?=$stringTableIndex;?>">
+
<div id="english-area" class="side-component">
<h4>English String</h4>
<div style='margin-bottom: .5em;'>
diff --git a/html/callback/setStringTranslation.php b/html/callback/setStringTranslation.php
index 5b4c56e..bfd5cae 100644
--- a/html/callback/setStringTranslation.php
+++ b/html/callback/setStringTranslation.php
@@ -16,7 +16,7 @@
//print_r($_REQUEST);
-print_r($_POST);
+//print_r($_POST);
$string_id = $App->getHTTPParameter("string_id", "POST");
$translation = $App->getHTTPParameter("translation", "POST");
@@ -57,7 +57,7 @@
";
$res = mysql_query($query,$dbh);
- print $query;
+// print $query;
}else{
//FIND ALL STRINGS THAT ARE THE SAME ACROSS VERSIONS
$query = "select
diff --git a/html/js/projectString.js b/html/js/projectString.js
index 8d25dd8..05b4a70 100644
--- a/html/js/projectString.js
+++ b/html/js/projectString.js
@@ -15,7 +15,6 @@
getAjaxProjectStrings : function(){
-
if(!YAHOO.languageManager.getSelected() ||
!YAHOO.projectManager.getSelected() ||
!YAHOO.versionManager.getSelected() ||
@@ -126,7 +125,13 @@
}
this.selected = selec;
this.selected.selected();
+ },
+
+ updateStringTableCurrentTranslation: function(stringTableIndex,trans){
+ this.tableDom.rows[stringTableIndex].cells[1].innerHTML = trans;
}
+
+//$stringTableIndex
};
function projectString(dataIn){
@@ -141,7 +146,7 @@
}
projectString.prototype.clicked = function(e){
- showTranslateStringForm(this.data['stringId']);
+ showTranslateStringForm(this.data['stringId'],this.domElem.rowIndex);
YAHOO.projectStringsManager.updateSelected(this);
}
projectString.prototype.createHTML = function(tableDom){
diff --git a/html/js/translation.js b/html/js/translation.js
index 577f9db..72b9b53 100644
--- a/html/js/translation.js
+++ b/html/js/translation.js
@@ -15,7 +15,7 @@
YAHOO.tranlsation.posted = false;
-function showTranslateStringForm(stringIdIn){
+function showTranslateStringForm(stringIdIn,stringTableIndex){
var callback =
{
start:function(eventType, args){
@@ -30,7 +30,7 @@
YAHOO.log('failed!');
}
}
- YAHOO.util.Connect.asyncRequest('POST', "callback/getCurrentStringTranslation.php", callback, "string_id="+stringIdIn);
+ YAHOO.util.Connect.asyncRequest('POST', "callback/getCurrentStringTranslation.php", callback, "string_id="+stringIdIn+"&stringTableIndex="+stringTableIndex);
}
function setupTranslatFormCB(){
@@ -51,17 +51,17 @@
function translateAll(e){
- translationSumbit("all");
+ translationSumbit("all",document.getElementById('translation-form').stringTableIndex.value);
}
function translateOnlySameTranslations(e){
- translationSumbit("onlysame")
+ translationSumbit("onlysame",document.getElementById('translation-form').stringTableIndex.value)
}
function translationSumbitStop(e){
YAHOO.util.Event.stopEvent(e);
}
-function translationSumbit(allornot){
+function translationSumbit(allornot,translationIndex){
var target = document.getElementById('translation-form');
var callback =
@@ -69,7 +69,7 @@
start:function(eventType, args){
},
success: function(o) {
- YAHOO.projectStringsManager.getAjaxProjectStrings();
+ YAHOO.projectStringsManager.updateStringTableCurrentTranslation(translationIndex,target.translation.value);
},
failure: function(o) {
YAHOO.log('failed!');