Index: trunk/core/units/phrases/phrases_config.php
===================================================================
diff -u -r1636 -r2210
--- trunk/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 1636)
+++ trunk/core/units/phrases/phrases_config.php (.../phrases_config.php) (revision 2210)
@@ -69,7 +69,7 @@
'CalculatedFields' => Array(
'' => Array(
- 'PrimaryValue' => 'pri.Translation',
+ 'PrimaryTranslation' => 'pri.Translation',
),
),
@@ -78,7 +78,9 @@
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)'),
- 'ItemSQLs' => Array( ''=>'SELECT *, 0 AS PrimaryValue FROM %s',),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)',),
'ListSortings' => Array(
'' => Array(
@@ -104,7 +106,7 @@
),
'VirtualFields' => Array(
- 'PrimaryValue' => Array(),
+ 'PrimaryTranslation' => Array(),
'LangFile' => Array(),
'ImportOverwrite' => Array(),
),
@@ -115,7 +117,7 @@
'Fields' => Array(
'Phrase' => Array( 'title'=>'la_col_Label', 'data_block' => 'grid_checkbox_td'),
'Translation' => Array( 'title'=>'la_col_Translation' ),
- 'PrimaryValue' => Array( 'title'=>'la_col_PrimaryValue' ),
+ 'PrimaryTranslation' => Array( 'title'=>'la_col_PrimaryValue' ),
'PhraseType' => Array( 'title'=>'la_col_PhraseType' ),
'LastChanged' => Array( 'title'=>'la_col_LastChanged' ),
'Module' => Array( 'title'=>'la_col_Module' ),
Index: trunk/kernel/units/phrases/phrases_config.php
===================================================================
diff -u -r1636 -r2210
--- trunk/kernel/units/phrases/phrases_config.php (.../phrases_config.php) (revision 1636)
+++ trunk/kernel/units/phrases/phrases_config.php (.../phrases_config.php) (revision 2210)
@@ -69,7 +69,7 @@
'CalculatedFields' => Array(
'' => Array(
- 'PrimaryValue' => 'pri.Translation',
+ 'PrimaryTranslation' => 'pri.Translation',
),
),
@@ -78,7 +78,9 @@
FROM %1$s
LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)'),
- 'ItemSQLs' => Array( ''=>'SELECT *, 0 AS PrimaryValue FROM %s',),
+ 'ItemSQLs' => Array( ''=>' SELECT %1$s.* %2$s
+ FROM %1$s
+ LEFT JOIN '.TABLE_PREFIX.'Phrase pri ON (%1$s.Phrase = pri.Phrase) AND (pri.LanguageId = 1)',),
'ListSortings' => Array(
'' => Array(
@@ -104,7 +106,7 @@
),
'VirtualFields' => Array(
- 'PrimaryValue' => Array(),
+ 'PrimaryTranslation' => Array(),
'LangFile' => Array(),
'ImportOverwrite' => Array(),
),
@@ -115,7 +117,7 @@
'Fields' => Array(
'Phrase' => Array( 'title'=>'la_col_Label', 'data_block' => 'grid_checkbox_td'),
'Translation' => Array( 'title'=>'la_col_Translation' ),
- 'PrimaryValue' => Array( 'title'=>'la_col_PrimaryValue' ),
+ 'PrimaryTranslation' => Array( 'title'=>'la_col_PrimaryValue' ),
'PhraseType' => Array( 'title'=>'la_col_PhraseType' ),
'LastChanged' => Array( 'title'=>'la_col_LastChanged' ),
'Module' => Array( 'title'=>'la_col_Module' ),
Index: trunk/kernel/units/phrases/phrases_event_handler.php
===================================================================
diff -u -r1859 -r2210
--- trunk/kernel/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 1859)
+++ trunk/kernel/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 2210)
@@ -19,6 +19,12 @@
$object->SetDBField('Phrase',$label);
$object->SetDBField('LanguageId', $this->Application->GetVar('m_lang') );
$object->SetDBField('PhraseType',1);
+
+ $primary_language = $this->Application->GetDefaultLanguageId();
+ $live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
+ $sql = 'SELECT Translation FROM %s WHERE Phrase = %s';
+ $primary_value = $this->Conn->GetOne( sprintf($sql, $live_table, $this->Conn->qstr($label) ) );
+ $object->SetDBField('PrimaryTranslation', $primary_value);
}
$last_module = $this->Application->GetVar('last_module');
Index: trunk/core/units/phrases/phrases_event_handler.php
===================================================================
diff -u -r1859 -r2210
--- trunk/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 1859)
+++ trunk/core/units/phrases/phrases_event_handler.php (.../phrases_event_handler.php) (revision 2210)
@@ -19,6 +19,12 @@
$object->SetDBField('Phrase',$label);
$object->SetDBField('LanguageId', $this->Application->GetVar('m_lang') );
$object->SetDBField('PhraseType',1);
+
+ $primary_language = $this->Application->GetDefaultLanguageId();
+ $live_table = $this->Application->getUnitOption($event->Prefix, 'TableName');
+ $sql = 'SELECT Translation FROM %s WHERE Phrase = %s';
+ $primary_value = $this->Conn->GetOne( sprintf($sql, $live_table, $this->Conn->qstr($label) ) );
+ $object->SetDBField('PrimaryTranslation', $primary_value);
}
$last_module = $this->Application->GetVar('last_module');
Index: trunk/kernel/admin_templates/regional/phrases_edit.tpl
===================================================================
diff -u -r1662 -r2210
--- trunk/kernel/admin_templates/regional/phrases_edit.tpl (.../phrases_edit.tpl) (revision 1662)
+++ trunk/kernel/admin_templates/regional/phrases_edit.tpl (.../phrases_edit.tpl) (revision 2210)
@@ -59,6 +59,7 @@
">
+