[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: phpgwapi/inc class.setup_detection.inc.php,1.6.
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: phpgwapi/inc class.setup_detection.inc.php,1.6.2.1,1.6.2.2 class.setup_translation.inc.php,1.3.2.2,1.3.2.3 class.translation_sql.inc.php,1.8.4.1,1.8.4.2 |
Date: |
Wed, 02 Apr 2003 11:57:02 -0500 |
Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv5800/inc
Modified Files:
Tag: Version-0_9_16-branch
class.setup_detection.inc.php class.setup_translation.inc.php
class.translation_sql.inc.php
Log Message:
changed table-names from lang & languages to phpgw_lang & phpgw_languages (like
in 0.9.15.002)
Index: class.setup_detection.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup_detection.inc.php,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -C2 -r1.6.2.1 -r1.6.2.2
*** class.setup_detection.inc.php 27 Mar 2003 00:00:39 -0000 1.6.2.1
--- class.setup_detection.inc.php 2 Apr 2003 16:56:58 -0000 1.6.2.2
***************
*** 338,353 ****
$GLOBALS['setup_info'] =
$GLOBALS['phpgw_setup']->detection->get_db_versions($GLOBALS['setup_info']);
}
!
if($GLOBALS['phpgw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'],
'0.9.15.002'))
{
$langtbl = 'lang';
! $langstbl = 'languages';
}
else
{
$langtbl = 'phpgw_lang';
! $langstbl = 'phpgw_languages';
}
!
! $GLOBALS['phpgw_setup']->db->query("SELECT DISTINCT
lang FROM $langtbl",__LINE__,__FILE__);
if($GLOBALS['phpgw_setup']->db->num_rows() == 0)
{
--- 338,353 ----
$GLOBALS['setup_info'] =
$GLOBALS['phpgw_setup']->detection->get_db_versions($GLOBALS['setup_info']);
}
!
if($GLOBALS['phpgw_setup']->alessthanb($GLOBALS['setup_info']['phpgwapi']['currentver'],
'0.9.14.501') ||
!
ereg('0\.9\.15\.00[01]{1,1}',$GLOBALS['setup_info']['phpgwapi']['currentver']))
{
$langtbl = 'lang';
! $languagestbl = 'languages';
}
else
{
$langtbl = 'phpgw_lang';
! $languagestbl = 'phpgw_languages';
}
! $GLOBALS['phpgw_setup']->db->query($q = "SELECT
DISTINCT lang FROM $langtbl",__LINE__,__FILE__);
if($GLOBALS['phpgw_setup']->db->num_rows() == 0)
{
***************
*** 364,368 ****
while(list($key, $value) =
each($GLOBALS['phpgw_info']['setup']['installed_langs']))
{
! $sql = "SELECT lang_name FROM $langstbl
WHERE lang_id = '".$value."'";
$GLOBALS['phpgw_setup']->db->query($sql);
$GLOBALS['phpgw_setup']->db->next_record();
--- 364,368 ----
while(list($key, $value) =
each($GLOBALS['phpgw_info']['setup']['installed_langs']))
{
! $sql = "SELECT lang_name FROM
$languagestbl WHERE lang_id = '".$value."'";
$GLOBALS['phpgw_setup']->db->query($sql);
$GLOBALS['phpgw_setup']->db->next_record();
Index: class.setup_translation.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.setup_translation.inc.php,v
retrieving revision 1.3.2.2
retrieving revision 1.3.2.3
diff -C2 -r1.3.2.2 -r1.3.2.3
*** class.setup_translation.inc.php 1 Apr 2003 00:29:02 -0000 1.3.2.2
--- class.setup_translation.inc.php 2 Apr 2003 16:56:58 -0000 1.3.2.3
***************
*** 32,36 ****
{
var $langarray;
- var $langtbl = 'phpgw_lang';
/*!
--- 32,35 ----
***************
*** 43,51 ****
$ConfigLang =
get_var('ConfigLang',Array('POST','COOKIE'));
- if
($this->alessb($GLOBALS['phpgw_info']['server']['versions']['phpgwapi'],'0.9.15.002'))
- {
- $this->langtbl = 'lang';
- }
-
if(!$ConfigLang)
{
--- 42,45 ----
***************
*** 81,102 ****
}
- function alessb($a,$b) // cant use version for
class.setup.inc.php as not yet set
- {
- $a = explode('.',$a);
- $b = explode('.',$b);
-
- foreach($a as $i => $aa)
- {
- $bb = intval($b[$i]);
- $aa = intval($aa);
-
- if ($aa != $bb)
- {
- return $aa < $bb;
- }
- }
- return False;
- }
-
/*!
@function translate
--- 75,78 ----
***************
*** 149,153 ****
echo '<br>get_langs(): checking db...' . "\n";
}
! $GLOBALS['phpgw_setup']->db->query("SELECT
DISTINCT(lang) FROM $this->langtbl",__LINE__,__FILE__);
$langs = array();
--- 125,129 ----
echo '<br>get_langs(): checking db...' . "\n";
}
! $GLOBALS['phpgw_setup']->db->query("SELECT
DISTINCT(lang) FROM phpgw_lang",__LINE__,__FILE__);
$langs = array();
***************
*** 174,182 ****
echo '<br>drop_langs(): Working on: ' .
$appname;
}
! $GLOBALS['phpgw_setup']->db->query("SELECT
COUNT(message_id) FROM $this->langtbl WHERE
app_name='$appname'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
if($GLOBALS['phpgw_setup']->db->f(0))
{
! $GLOBALS['phpgw_setup']->db->query("DELETE FROM
$this->langtbl WHERE app_name='$appname'",__LINE__,__FILE__);
return True;
}
--- 150,158 ----
echo '<br>drop_langs(): Working on: ' .
$appname;
}
! $GLOBALS['phpgw_setup']->db->query("SELECT
COUNT(message_id) FROM phpgw_lang WHERE app_name='$appname'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
if($GLOBALS['phpgw_setup']->db->f(0))
{
! $GLOBALS['phpgw_setup']->db->query("DELETE FROM
phpgw_lang WHERE app_name='$appname'",__LINE__,__FILE__);
return True;
}
***************
*** 229,233 ****
$content =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM $this->langtbl WHERE
message_id='$message_id' and lang='"
.
$GLOBALS['phpgw_setup']->db_lang . "'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
--- 205,209 ----
$content =
$GLOBALS['phpgw_setup']->db->db_addslashes(chop($content));
!
$GLOBALS['phpgw_setup']->db->query("SELECT COUNT(*) FROM phpgw_lang WHERE
message_id='$message_id' and lang='"
.
$GLOBALS['phpgw_setup']->db_lang . "'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
***************
*** 239,246 ****
if($DEBUG)
{
! echo
"<br>add_langs(): adding - INSERT INTO $this->langtbl VALUES
('$message_id','$app_name','"
. $GLOBALS['phpgw_setup']->db_lang . "','$content')";
}
!
$GLOBALS['phpgw_setup']->db->query("INSERT INTO $this->langtbl VALUES
('$message_id','$app_name','"
.
$GLOBALS['phpgw_setup']->db_lang . "','$content')",__LINE__,__FILE__);
}
--- 215,222 ----
if($DEBUG)
{
! echo
"<br>add_langs(): adding - INSERT INTO phpgw_lang VALUES
('$message_id','$app_name','"
. $GLOBALS['phpgw_setup']->db_lang . "','$content')";
}
!
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_lang VALUES
('$message_id','$app_name','"
.
$GLOBALS['phpgw_setup']->db_lang . "','$content')",__LINE__,__FILE__);
}
Index: class.translation_sql.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/class.translation_sql.inc.php,v
retrieving revision 1.8.4.1
retrieving revision 1.8.4.2
diff -C2 -r1.8.4.1 -r1.8.4.2
*** class.translation_sql.inc.php 31 Mar 2003 20:41:01 -0000 1.8.4.1
--- class.translation_sql.inc.php 2 Apr 2003 16:56:58 -0000 1.8.4.2
***************
*** 54,58 ****
$userlang = 'en';
}
! $sql = "select message_id,content from lang
where lang like '".$userlang."' ".
"and (app_name like
'".$GLOBALS['phpgw_info']['flags']['currentapp']."' or app_name like 'common'
or app_name like 'all')";
--- 54,58 ----
$userlang = 'en';
}
! $sql = "select message_id,content from
phpgw_lang where lang like '".$userlang."' ".
"and (app_name like
'".$GLOBALS['phpgw_info']['flags']['currentapp']."' or app_name like 'common'
or app_name like 'all')";
***************
*** 113,117 ****
$userlang = 'en';
}
! $sql = "select message_id,content from lang where lang
like '".$userlang."' and app_name like '".$app."'";
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
$GLOBALS['phpgw']->db->next_record();
--- 113,117 ----
$userlang = 'en';
}
! $sql = "select message_id,content from phpgw_lang where
lang like '".$userlang."' and app_name like '".$app."'";
$GLOBALS['phpgw']->db->query($sql,__LINE__,__FILE__);
$GLOBALS['phpgw']->db->next_record();
***************
*** 122,125 ****
--- 122,139 ----
$GLOBALS['phpgw']->db->next_record();
}
+ }
+
+ function get_installed_langs()
+ {
+ $GLOBALS['phpgw']->db->query("SELECT DISTINCT
l.lang,ln.lang_name FROM phpgw_lang l,phpgw_languages ln WHERE l.lang =
ln.lang_id",__LINE__,__FILE__);
+ if (!$GLOBALS['phpgw']->db->num_rows())
+ {
+ return False;
+ }
+ while ($GLOBALS['phpgw']->db->next_record())
+ {
+ $langs[$GLOBALS['phpgw']->db->f('lang')] =
$GLOBALS['phpgw']->db->f('lang_name');
+ }
+ return $langs;
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: phpgwapi/inc class.setup_detection.inc.php,1.6.2.1,1.6.2.2 class.setup_translation.inc.php,1.3.2.2,1.3.2.3 class.translation_sql.inc.php,1.8.4.1,1.8.4.2,
Ralf Becker <address@hidden> <=