View | Details | Raw Unified | Return to bug 233001
Collapse All | Expand All

(-)server/html/callback/setStringTranslation.php (-12 / +11 lines)
Lines 63-91 Link Here
63
}else{
63
}else{
64
	//FIND ALL STRINGS THAT ARE THE SAME ACROSS VERSIONS
64
	//FIND ALL STRINGS THAT ARE THE SAME ACROSS VERSIONS
65
	$query = "select 
65
	$query = "select 
66
				string_id
66
				s.string_id
67
			  from 
67
			  from 
68
			  	strings,
68
			  	strings as s
69
			  	files 
69
			  	INNER JOIN files AS f on s.file_id = f.file_id 
70
			  	INNER JOIN files AS the_file_selected_for_translation on the_file_selected_for_translation.file_id = (select file_id from strings where string_id = '".addslashes($string_id)."') 
70
			  where 
71
			  where 
71
			  	files.file_id = strings.file_id 
72
			  	s.value = (select value from strings where string_id = '".addslashes($string_id)."')
72
			  and 
73
			  	strings.value = (select value from strings where string_id = '".addslashes($string_id)."')
74
			  and
73
			  and
75
				strings.name = (select name from strings where string_id = '".addslashes($string_id)."')		  	
74
				s.name = (select name from strings where string_id = '".addslashes($string_id)."')
76
			  and
75
			  and f.name =  the_file_selected_for_translation.name
77
			  	strings.is_active = 1
76
			  and f.project_id =  the_file_selected_for_translation.project_id
78
			  	";
77
			  and s.is_active = 1";
79
		  	
78
		  	
80
	$res = mysql_query($query,$dbh);
79
	$res = mysql_query($query,$dbh);
81
	$affected_rows += mysql_affected_rows();
80
	$affected_rows += mysql_affected_rows();
82
	
83
	while($row = mysql_fetch_assoc($res)){
81
	while($row = mysql_fetch_assoc($res)){
84
		$string_ids[] = $row['string_id'];
82
		$string_ids[] = $row['string_id'];
85
	}
83
	}
86
	
84
	
87
	//GET CURRENT TRANSLATION FOR THIS STRING
85
	//GET CURRENT TRANSLATION FOR THIS STRING
88
	$query= "select value from translations where string_id = '".addslashes($string_id)."'and language_id = '".addslashes($language_id)."' and is_active = 1 order by version limit 1";
86
	$query= "select value from translations where string_id = '".addslashes($string_id)."' and language_id = '".addslashes($language_id)."' and is_active = 1 order by version limit 1";
89
	$res = mysql_query($query,$dbh);
87
	$res = mysql_query($query,$dbh);
90
	$string_translation = "";
88
	$string_translation = "";
91
	while($row = mysql_fetch_assoc($res)){
89
	while($row = mysql_fetch_assoc($res)){
Lines 105-110 Link Here
105
				value = '".addslashes($string_translation)."'
103
				value = '".addslashes($string_translation)."'
106
			and
104
			and
107
			  	is_active = 1
105
			  	is_active = 1
106
			and language_id = '" . addslashes($language_id)."'
108
		  ";
107
		  ";
109
		
108
		
110
		$res = mysql_query($query,$dbh);
109
		$res = mysql_query($query,$dbh);

Return to bug 233001