fixed not showing up langs like 'es-ca' which hasn't been in phpgw_languages (or only as just 'ca')

This commit is contained in:
Ralf Becker 2004-07-10 10:59:37 +00:00
parent 551c66d68e
commit 5ea042041c
6 changed files with 37 additions and 11 deletions

View File

@ -378,9 +378,11 @@
{ {
$sql = "SELECT lang_name FROM $languagestbl WHERE lang_id = '".$value."'"; $sql = "SELECT lang_name FROM $languagestbl WHERE lang_id = '".$value."'";
$GLOBALS['phpgw_setup']->db->query($sql); $GLOBALS['phpgw_setup']->db->query($sql);
$GLOBALS['phpgw_setup']->db->next_record(); if ($GLOBALS['phpgw_setup']->db->next_record())
{
$GLOBALS['phpgw_info']['setup']['installed_langs'][$value] = $GLOBALS['phpgw_setup']->db->f('lang_name'); $GLOBALS['phpgw_info']['setup']['installed_langs'][$value] = $GLOBALS['phpgw_setup']->db->f('lang_name');
} }
}
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Completed)'; $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Completed)';
return 10; return 10;
} }

View File

@ -14,7 +14,7 @@
/* Basic information about this app */ /* Basic information about this app */
$setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'phpgwapi';
$setup_info['phpgwapi']['version'] = '1.0.0.000'; $setup_info['phpgwapi']['version'] = '1.0.0.001';
$setup_info['phpgwapi']['versions']['current_header'] = '1.27'; $setup_info['phpgwapi']['versions']['current_header'] = '1.27';
$setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['enable'] = 3;
$setup_info['phpgwapi']['app_order'] = 1; $setup_info['phpgwapi']['app_order'] = 1;
@ -55,3 +55,4 @@

View File

@ -141,12 +141,11 @@
'phpgw_languages' => array( 'phpgw_languages' => array(
'fd' => array( 'fd' => array(
'lang_id' => array('type' => 'varchar','precision' => '5','nullable' => False), 'lang_id' => array('type' => 'varchar','precision' => '5','nullable' => False),
'lang_name' => array('type' => 'varchar','precision' => '50','nullable' => False), 'lang_name' => array('type' => 'varchar','precision' => '50','nullable' => False)
'available' => array('type' => 'char','precision' => '3','nullable' => False,'default' => 'No')
), ),
'pk' => array('lang_id'), 'pk' => array('lang_id'),
'ix' => array(),
'fk' => array(), 'fk' => array(),
'ix' => array(),
'uc' => array() 'uc' => array()
), ),
'phpgw_lang' => array( 'phpgw_lang' => array(

View File

@ -1371,4 +1371,27 @@
$GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.0.000'; $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.0.000';
return $GLOBALS['setup_info']['phpgwapi']['currentver']; return $GLOBALS['setup_info']['phpgwapi']['currentver'];
} }
$test[] = '1.0.0.000';
function phpgwapi_upgrade1_0_0_000()
{
// removing the not longer needed 'availible' column, that information is in the file setup/lang/languages
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_languages',array(
'fd' => array(
'lang_id' => array('type' => 'varchar','precision' => '5','nullable' => False),
'lang_name' => array('type' => 'varchar','precision' => '50','nullable' => False)
),
'pk' => array('lang_id'),
'ix' => array(),
'fk' => array(),
'uc' => array()
),'available');
// correcting the id for Catalan
$GLOBALS['phpgw_setup']->oProc->query("UPDATE phpgw_languages SET lang_id='es-ca' WHERE lang_id='ca'");
$GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.0.0.001';
return $GLOBALS['setup_info']['phpgwapi']['currentver'];
}
?> ?>

View File

@ -89,12 +89,11 @@
fclose($f); fclose($f);
$d = dir('./lang'); $d = dir('./lang');
while($entry=$d->read()) while($file=$d->read())
{ {
if(ereg('^phpgw_',$entry)) if(preg_match('/^phpgw_([-a-z]+).lang$/i',$file,$matches))
{ {
$z = substr($entry,6,2); $languages[$matches[1]]['available'] = True;
$languages[$z]['available'] = True;
} }
} }
$d->close(); $d->close();

View File

@ -61,7 +61,9 @@
} }
$select_box_desc = lang('Select which languages you would like to use'); $select_box_desc = lang('Select which languages you would like to use');
$select_box = ''; $select_box = '';
foreach(get_langs() as $id => $data) $languages = get_langs();
uasort($languages,create_function('$a,$b','return strcmp(@$a[\'descr\'],@$b[\'descr\']);'));
foreach($languages as $id => $data)
{ {
$select_box_langs = $select_box_langs =
@$select_box_langs @$select_box_langs