mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 19:33:54 +01:00
Now using the wrappers in schema_proc
This commit is contained in:
parent
bee1d3fa6f
commit
308d38eaa4
@ -32,12 +32,12 @@
|
||||
global $phpgw_setup, $phpgw_setup;
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
$oProc->m_odb->query("select distinct($field) from $table");
|
||||
if ($oProc->m_odb->num_rows())
|
||||
$oProc->query("select distinct($field) from $table");
|
||||
if ($oProc->num_rows())
|
||||
{
|
||||
while ($oProc->m_odb->next_record())
|
||||
while ($oProc->next_record())
|
||||
{
|
||||
$owner[count($owner)] = $phpgw_setup->db->f($field);
|
||||
$owner[count($owner)] = $oProc->f($field);
|
||||
}
|
||||
if($phpgw_setup->alessthanb($setup_info['phpgwapi']['currentver'],'0.9.10pre4'))
|
||||
{
|
||||
@ -49,9 +49,9 @@
|
||||
}
|
||||
for($i=0;$i<count($owner);$i++)
|
||||
{
|
||||
$oProc->m_odb->query("SELECT account_id FROM $acctstbl WHERE account_lid='".$owner[$i]."'");
|
||||
$oProc->m_odb->next_record();
|
||||
$oProc->m_odb->query("UPDATE $table SET $field=".$oProc->m_odb->f("account_id")." WHERE $field='".$owner[$i]."'");
|
||||
$oProc->query("SELECT account_id FROM $acctstbl WHERE account_lid='".$owner[$i]."'");
|
||||
$oProc->next_record();
|
||||
$oProc->query("UPDATE $table SET $field=".$oProc->f("account_id")." WHERE $field='".$owner[$i]."'");
|
||||
}
|
||||
}
|
||||
$oProc->AlterColumn($table, $field, array('type' => 'int', 'precision' => 4, 'nullable' => false, 'default' => 0));
|
||||
@ -121,16 +121,16 @@
|
||||
global $setup_info, $phpgw_setup;
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
$db2 = $oProc->m_odb;
|
||||
$db3 = $oProc->m_odb;
|
||||
$db2 = $oProc;
|
||||
$db3 = $oProc;
|
||||
|
||||
$oProc->m_odb->query('SELECT oldid,newid FROM phpgw_temp_groupmap',__LINE__,__FILE__);
|
||||
if($oProc->m_odb->num_rows())
|
||||
$oProc->query('SELECT oldid,newid FROM phpgw_temp_groupmap',__LINE__,__FILE__);
|
||||
if($oProc->num_rows())
|
||||
{
|
||||
while($oProc->m_odb->next_record())
|
||||
while($oProc->next_record())
|
||||
{
|
||||
$old_group_id = $oProc->m_odb->f(0);
|
||||
$new_group_id = $oProc->m_odb->f(1);
|
||||
$old_group_id = $oProc->f(0);
|
||||
$new_group_id = $oProc->f(1);
|
||||
$db2->query("SELECT ab_access,ab_id FROM addressbook WHERE ab_access LIKE '%,".$old_group_id.",%'",__LINE__,__FILE__);
|
||||
if($db2->num_rows())
|
||||
{
|
||||
@ -223,7 +223,7 @@
|
||||
global $setup_info, $phpgw_setup;
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
$db1 = $oProc->m_odb;
|
||||
$db1 = $oProc;
|
||||
|
||||
$oProc->CreateTable(
|
||||
'phpgw_addressbook', array(
|
||||
@ -346,13 +346,13 @@
|
||||
. $fields['adr_locality']."','".$fields['adr_region']."','".$fields['adr_postalcode']."','"
|
||||
. $fields['owner'] ."')";
|
||||
|
||||
$oProc->m_odb->query($sql);
|
||||
$oProc->query($sql);
|
||||
|
||||
while (list($name,$value) = each($extra))
|
||||
{
|
||||
$sql = "INSERT INTO phpgw_addressbook_extra VALUES ('".$fields['id']."','" . $fields['owner'] . "','"
|
||||
. addslashes($name) . "','" . addslashes($value) . "')";
|
||||
$oProc->m_odb->query($sql);
|
||||
$oProc->query($sql);
|
||||
}
|
||||
}
|
||||
$setup_info['addressbook']['currentver'] = '0.9.10pre13';
|
||||
@ -367,7 +367,7 @@
|
||||
global $setup_info, $phpgw_setup;
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
$db1 = $phpgw_setup->db;
|
||||
$db1 = $oProc;
|
||||
|
||||
$oProc->AddColumn('phpgw_addressbook', 'url', array('type' => 'varchar', 'precision' => 128));
|
||||
$oProc->AddColumn('phpgw_addressbook', 'bday', array('type' => 'varchar', 'precision' => 32));
|
||||
@ -375,50 +375,50 @@
|
||||
$oProc->AlterColumn('phpgw_addressbook_extra', 'contact_value', array('type' => 'text'));
|
||||
|
||||
$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='url'";
|
||||
$phpgw_setup->db->query($sql,__LINE__,__FILE__);
|
||||
$oProc->query($sql,__LINE__,__FILE__);
|
||||
|
||||
while($phpgw_setup->db->next_record())
|
||||
while($oProc->next_record())
|
||||
{
|
||||
$cid = $phpgw_setup->db->f('contact_id');
|
||||
$cvalu = $phpgw_setup->db->f('contact_value');
|
||||
$cid = $oProc->f('contact_id');
|
||||
$cvalu = $oProc->f('contact_value');
|
||||
if ($cid && $cvalu)
|
||||
{
|
||||
$update = "UPDATE phpgw_addressbook set url='" . $cvalu . "' WHERE id=" . $cid;
|
||||
$oProc->m_odb->query($update);
|
||||
$oProc->query($update);
|
||||
$delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='url'";
|
||||
$oProc->m_odb->query($delete);
|
||||
$oProc->query($delete);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='bday'";
|
||||
$phpgw_setup->db->query($sql,__LINE__,__FILE__);
|
||||
$oProc->query($sql,__LINE__,__FILE__);
|
||||
|
||||
while($phpgw_setup->db->next_record())
|
||||
while($oProc->next_record())
|
||||
{
|
||||
$cid = $phpgw_setup->db->f('contact_id');
|
||||
$cvalu = $phpgw_setup->db->f('contact_value');
|
||||
$cid = $oProc->f('contact_id');
|
||||
$cvalu = $oProc->f('contact_value');
|
||||
if ($cid && $cvalu)
|
||||
{
|
||||
$update = "UPDATE phpgw_addressbook set bday='" . $cvalu . "' WHERE id=" . $cid;
|
||||
$oProc->m_odb->query($update);
|
||||
$oProc->query($update);
|
||||
$delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='bday'";
|
||||
$oProc->m_odb->query($delete);
|
||||
$oProc->query($delete);
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='notes'";
|
||||
$phpgw_setup->db->query($sql,__LINE__,__FILE__);
|
||||
$oProc->query($sql,__LINE__,__FILE__);
|
||||
|
||||
while($phpgw_setup->db->next_record())
|
||||
while($oProc->next_record())
|
||||
{
|
||||
$cid = $phpgw_setup->db->f('contact_id');
|
||||
$cvalu = $phpgw_setup->db->f('contact_value');
|
||||
$cid = $oProc->f('contact_id');
|
||||
$cvalu = $oProc->f('contact_value');
|
||||
if ($cvalu)
|
||||
{
|
||||
$update = "UPDATE phpgw_addressbook set note='" . $cvalu . "' WHERE id=" . $cid;
|
||||
$oProc->m_odb->query($update);
|
||||
$oProc->query($update);
|
||||
$delete = "DELETE FROM phpgw_addressbook_extra WHERE contact_id=" . $cid . " AND contact_name='notes'";
|
||||
$oProc->m_odb->query($delete);
|
||||
$oProc->query($delete);
|
||||
}
|
||||
}
|
||||
$setup_info['addressbook']['currentver'] = '0.9.10pre14';
|
||||
@ -478,7 +478,7 @@
|
||||
global $setup_info, $phpgw_setup;
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
$db = $db1 = $oProc->m_odb;
|
||||
$db = $db1 = $oProc;
|
||||
|
||||
$oProc->RenameTable('phpgw_addressbook', 'phpgw_addressbook_old');
|
||||
$oProc->CreateTable(
|
||||
@ -540,29 +540,29 @@
|
||||
)
|
||||
);
|
||||
|
||||
$oProc->m_odb->query("SELECT * FROM phpgw_addressbook_old");
|
||||
while ($oProc->m_odb->next_record())
|
||||
$oProc->query("SELECT * FROM phpgw_addressbook_old");
|
||||
while ($oProc->next_record())
|
||||
{
|
||||
$fields['id'] = $oProc->m_odb->f("id");
|
||||
$fields['owner'] = $oProc->m_odb->f("owner");
|
||||
$fields['n_given'] = $oProc->m_odb->f("firstname");
|
||||
$fields['n_family'] = $oProc->m_odb->f("lastname");
|
||||
$fields['email'] = $oProc->m_odb->f("d_email");
|
||||
$fields['email_type'] = $oProc->m_odb->f("d_emailtype");
|
||||
$fields['tel_home'] = $oProc->m_odb->f("hphone");
|
||||
$fields['tel_work'] = $oProc->m_odb->f("wphone");
|
||||
$fields['tel_fax'] = $oProc->m_odb->f("fax");
|
||||
$fields['fn'] = $oProc->m_odb->f("fn");
|
||||
$fields['org_name'] = $oProc->m_odb->f("org_name");
|
||||
$fields['title'] = $oProc->m_odb->f("title");
|
||||
$fields['adr_one_street'] = $oProc->m_odb->f("adr_street");
|
||||
$fields['adr_one_locality'] = $oProc->m_odb->f("adr_locality");
|
||||
$fields['adr_one_region'] = $oProc->m_odb->f("adr_region");
|
||||
$fields['adr_one_postalcode'] = $oProc->m_odb->f("adr_postalcode");
|
||||
$fields['adr_one_countryname'] = $oProc->m_odb->f("adr_countryname");
|
||||
$fields['bday'] = $oProc->m_odb->f("bday");
|
||||
$fields['note'] = $oProc->m_odb->f("note");
|
||||
$fields['url'] = $oProc->m_odb->f("url");
|
||||
$fields['id'] = $oProc->f("id");
|
||||
$fields['owner'] = $oProc->f("owner");
|
||||
$fields['n_given'] = $oProc->f("firstname");
|
||||
$fields['n_family'] = $oProc->f("lastname");
|
||||
$fields['email'] = $oProc->f("d_email");
|
||||
$fields['email_type'] = $oProc->f("d_emailtype");
|
||||
$fields['tel_home'] = $oProc->f("hphone");
|
||||
$fields['tel_work'] = $oProc->f("wphone");
|
||||
$fields['tel_fax'] = $oProc->f("fax");
|
||||
$fields['fn'] = $oProc->f("fn");
|
||||
$fields['org_name'] = $oProc->f("org_name");
|
||||
$fields['title'] = $oProc->f("title");
|
||||
$fields['adr_one_street'] = $oProc->f("adr_street");
|
||||
$fields['adr_one_locality'] = $oProc->f("adr_locality");
|
||||
$fields['adr_one_region'] = $oProc->f("adr_region");
|
||||
$fields['adr_one_postalcode'] = $oProc->f("adr_postalcode");
|
||||
$fields['adr_one_countryname'] = $oProc->f("adr_countryname");
|
||||
$fields['bday'] = $oProc->f("bday");
|
||||
$fields['note'] = $oProc->f("note");
|
||||
$fields['url'] = $oProc->f("url");
|
||||
|
||||
$sql="INSERT INTO phpgw_addressbook (org_name,n_given,n_family,fn,email,email_type,title,tel_work,"
|
||||
. "tel_home,tel_fax,adr_one_street,adr_one_locality,adr_one_region,adr_one_postalcode,adr_one_countryname,"
|
||||
@ -578,27 +578,27 @@
|
||||
|
||||
$db->query("DROP TABLE phpgw_addressbook_old");
|
||||
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_home='' where tel_home='n' OR tel_home='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_work='' where tel_work='n' OR tel_work='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_cell='' where tel_cell='n' OR tel_cell='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_voice='' where tel_voice='n' OR tel_voice='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_fax='' where tel_fax='n' OR tel_fax='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_car='' where tel_car='n' OR tel_car='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_pager='' where tel_pager='n' OR tel_pager='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_msg='' where tel_msg='n' OR tel_msg='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_bbs='' where tel_bbs='n' OR tel_bbs='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_modem='' where tel_modem='n' OR tel_modem='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_prefer='' where tel_prefer='n' OR tel_prefer='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_video='' where tel_video='n' OR tel_video='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set tel_isdn='' where tel_isdn='n' OR tel_isdn='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_home='' where tel_home='n' OR tel_home='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_work='' where tel_work='n' OR tel_work='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_cell='' where tel_cell='n' OR tel_cell='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_voice='' where tel_voice='n' OR tel_voice='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_fax='' where tel_fax='n' OR tel_fax='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_car='' where tel_car='n' OR tel_car='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_pager='' where tel_pager='n' OR tel_pager='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_msg='' where tel_msg='n' OR tel_msg='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_bbs='' where tel_bbs='n' OR tel_bbs='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_modem='' where tel_modem='n' OR tel_modem='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_prefer='' where tel_prefer='n' OR tel_prefer='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_video='' where tel_video='n' OR tel_video='y'");
|
||||
$oProc->query("update phpgw_addressbook set tel_isdn='' where tel_isdn='n' OR tel_isdn='y'");
|
||||
|
||||
$sql = "SELECT * FROM phpgw_addressbook_extra WHERE contact_name='mphone'";
|
||||
$oProc->m_odb->query($sql,__LINE__,__FILE__);
|
||||
$oProc->query($sql,__LINE__,__FILE__);
|
||||
|
||||
while($oProc->m_odb->next_record())
|
||||
while($oProc->next_record())
|
||||
{
|
||||
$cid = $oProc->m_odb->f('contact_id');
|
||||
$cvalu = $oProc->m_odb->f('contact_value');
|
||||
$cid = $oProc->f('contact_id');
|
||||
$cvalu = $oProc->f('contact_value');
|
||||
if ($cvalu)
|
||||
{
|
||||
$update = "UPDATE phpgw_addressbook set tel_cell='" . $cvalu . "' WHERE id=" . $cid;
|
||||
@ -655,12 +655,12 @@
|
||||
|
||||
$oProc->AddColumn('phpgw_addressbook', 'adr_two_countryname', array('type' => 'varchar', 'precision' => 64));
|
||||
|
||||
$oProc->m_odb->query("update phpgw_addressbook set adr_one_type='' where adr_one_type='n' OR adr_one_type='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set adr_two_type='' where adr_two_type='n' OR adr_two_type='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set adr_two_region='' where adr_two_region='n' OR adr_two_region='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set adr_two_postalcode='' where adr_two_postalcode='n' OR adr_two_postalcode='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set email_home='' where email_home='n' OR email_home='y'");
|
||||
$oProc->m_odb->query("update phpgw_addressbook set email_home_type='' where email_home_type='n' OR email_home_type='y'");
|
||||
$oProc->query("update phpgw_addressbook set adr_one_type='' where adr_one_type='n' OR adr_one_type='y'");
|
||||
$oProc->query("update phpgw_addressbook set adr_two_type='' where adr_two_type='n' OR adr_two_type='y'");
|
||||
$oProc->query("update phpgw_addressbook set adr_two_region='' where adr_two_region='n' OR adr_two_region='y'");
|
||||
$oProc->query("update phpgw_addressbook set adr_two_postalcode='' where adr_two_postalcode='n' OR adr_two_postalcode='y'");
|
||||
$oProc->query("update phpgw_addressbook set email_home='' where email_home='n' OR email_home='y'");
|
||||
$oProc->query("update phpgw_addressbook set email_home_type='' where email_home_type='n' OR email_home_type='y'");
|
||||
|
||||
$setup_info['addressbook']['currentver'] = '0.9.10pre18';
|
||||
return $setup_info['addressbook']['currentver'];
|
||||
@ -729,7 +729,7 @@
|
||||
|
||||
$oProc = $phpgw_setup->oProc;
|
||||
|
||||
$oProc->m_odb->query("UPDATE phpgw_addressbook SET tid='n' WHERE tid is null");
|
||||
$oProc->query("UPDATE phpgw_addressbook SET tid='n' WHERE tid is null");
|
||||
|
||||
$setup_info['addressbook']['currentver'] = '0.9.10pre24';
|
||||
return $setup_info['addressbook']['currentver'];
|
||||
|
Loading…
Reference in New Issue
Block a user