Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 96096 Details for
Bug 227151
Testing attachments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Some Description
patch.txt (text/plain), 2.20 KB, created by
Denis Roy
on 2008-04-15 11:15:51 EDT
(
hide
)
Description:
Some Description
Filename:
MIME Type:
Creator:
Denis Roy
Created:
2008-04-15 11:15:51 EDT
Size:
2.20 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.babel >Index: server/html/callback/setStringTranslation.php >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.babel/server/html/callback/setStringTranslation.php,v >retrieving revision 1.14 >diff -u -r1.14 setStringTranslation.php >--- server/html/callback/setStringTranslation.php 4 Mar 2008 23:22:35 -0000 1.14 >+++ server/html/callback/setStringTranslation.php 25 Mar 2008 15:02:22 -0000 >@@ -16,21 +16,23 @@ > > //print_r($_REQUEST); > >-//print_r($_POST); >+// print_r($_POST); > > $string_id = $App->getHTTPParameter("string_id", "POST"); > $translation = $App->getHTTPParameter("translation", "POST"); > > $language_id = $_SESSION["language"]; > $project_id = $_SESSION['project']; >-$language_id = $_SESSION["language"]; > $version = $_SESSION["version"]; > > $user_id = $User->userid; > >+# TODO: refactor these ifs >+$do_nothing = false; >+ > if (empty($translation) || (trim($translation) == '')) { > >- // do nothing >+ $do_nothing = true; > > } else if($_POST['translate_action'] != "all"){ > $query = "update >@@ -155,10 +157,33 @@ > created_on = NOW() > "; > $res2 = mysql_query($query,$dbh); >- } >- >- } >+ } >+ } >+} >+ >+if(!$do_nothing) { >+ # Find all string_id's that have the same binary value as the one we're translating >+ # *and* have no translation yet, and update those too. >+ $sql = "SELECT s.string_id, COUNT(t.string_id) AS tr_count >+ FROM strings AS s >+ LEFT JOIN translations AS t ON t.string_id = s.string_id AND t.language_id = '".addslashes($language_id)."' >+ WHERE BINARY s.value = (select value from strings where string_id = '".addslashes($string_id)."') >+ AND s.is_active = 1 AND t.value IS NULL GROUP BY s.string_id HAVING tr_count = 0"; >+ >+ $res = mysql_query($sql, $dbh); >+ $str_count = mysql_affected_rows(); > >+ while($myrow = mysql_fetch_assoc($res)) { >+ $sql = "insert into >+ translations >+ set >+ string_id = " . $myrow['string_id'] . ", >+ language_id = '".addslashes($language_id)."', >+ value = '".addslashes($translation)."', >+ userid = '".addslashes($user_id)."', >+ created_on = NOW()"; >+ mysql_query($sql, $dbh); >+ } > } >- >+ > ?> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
denis.roy
:
review?
Actions:
View
|
Diff
Attachments on
bug 227151
: 96096