phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: sitemgr/setup default_records.inc.php,1.3,1.4 ph


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: sitemgr/setup default_records.inc.php,1.3,1.4 phpgw_de.lang,1.10,1.11 phpgw_en.lang,1.10,1.11 phpgw_fr.lang,1.6,1.7 setup.inc.php,1.12,1.13 tables_current.inc.php,1.11,1.12 tables_update.inc.php,1.11,1.12
Date: Wed, 21 May 2003 22:36:56 -0400

Update of /cvsroot/phpgroupware/sitemgr/setup
In directory subversions:/tmp/cvs-serv6703/setup

Modified Files:
        default_records.inc.php phpgw_de.lang phpgw_en.lang 
        phpgw_fr.lang setup.inc.php tables_current.inc.php 
        tables_update.inc.php 
Log Message:
make sitemgr capable of editing multiple sites


Index: default_records.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/default_records.inc.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** default_records.inc.php     4 Mar 2003 17:26:43 -0000       1.3
--- default_records.inc.php     22 May 2003 02:36:54 -0000      1.4
***************
*** 6,15 ****
                $oProc->query("INSERT INTO phpgw_sitemgr_active_modules 
(area,cat_id,module_id) VALUES ('__PAGE__',0,$module_id)",__LINE__,__FILE__);
        }
        $oProc->query("select config_value FROM phpgw_config WHERE 
config_name='webserver_url'");
        $oProc->next_record();
        $siteurl = $oProc->f('config_value') . SEP . 'sitemgr' . SEP . 
'sitemgr-site' . SEP;
-       $oProc->query("INSERT INTO phpgw_sitemgr_preferences (name,value) 
VALUES ('sitemgr-site-url','$siteurl')");
        $sitedir = PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'sitemgr-site';
!       $oProc->query("INSERT INTO phpgw_sitemgr_preferences (name,value) 
VALUES ('sitemgr-site-dir','$sitedir')");
!       $oProc->query("INSERT INTO phpgw_sitemgr_preferences (name,value) 
VALUES ('themesel','phpgroupware')");
!       $oProc->query("INSERT INTO phpgw_sitemgr_preferences (name,value) 
VALUES ('sitelanguages','en')");
--- 6,17 ----
                $oProc->query("INSERT INTO phpgw_sitemgr_active_modules 
(area,cat_id,module_id) VALUES ('__PAGE__',0,$module_id)",__LINE__,__FILE__);
        }
+ 
+       $oProc->query("INSERT INTO phpgw_categories 
(cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description) VALUES 
(0,-1,'public','sitemgr','Default Website','This website has been add by 
setup')");
+       $site_id = 
$oProc->m_odb->get_last_insert_id('phpgw_categories','cat_id');
+       $oProc->query("UPDATE phpgw_categories SET cat_main = $site_id WHERE 
cat_id = $site_id",__LINE__,__FILE__);
+ 
        $oProc->query("select config_value FROM phpgw_config WHERE 
config_name='webserver_url'");
        $oProc->next_record();
        $siteurl = $oProc->f('config_value') . SEP . 'sitemgr' . SEP . 
'sitemgr-site' . SEP;
        $sitedir = PHPGW_INCLUDE_ROOT . SEP . 'sitemgr' . SEP . 'sitemgr-site';
!       $oProc->query("INSERT INTO phpgw_sitemgr_sites 
(site_id,site_name,site_url,site_dir,themesel,site_languages,home_page_id,anonymous_user,anonymous_passwd)
 VALUES ($site_id,'Default 
Website','$siteurl','$sitedir','phpgroupware','en',0,'anonymous','anonymous')");

Index: phpgw_de.lang
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/phpgw_de.lang,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** phpgw_de.lang       17 May 2003 03:42:30 -0000      1.10
--- phpgw_de.lang       22 May 2003 02:36:54 -0000      1.11
***************
*** 150,154 ****
  parent        sitemgr de      Übergeordnet
  password      sitemgr-site    de      Passwort
! password that you assigned for the aonymous user account.     sitemgr de      
Passwort des Annonymen Benutzer Kontos
  phpgw users   sitemgr de      phpGroupWare Benutzer
  post a message to this thread sitemgr de      Eine Nachricht in diesem Thread 
posten.
--- 150,154 ----
  parent        sitemgr de      Übergeordnet
  password      sitemgr-site    de      Passwort
! password that you assigned for the anonymous user account.    sitemgr de      
Passwort des Annonymen Benutzer Kontos
  phpgw users   sitemgr de      phpGroupWare Benutzer
  post a message to this thread sitemgr de      Eine Nachricht in diesem Thread 
posten.

Index: phpgw_en.lang
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/phpgw_en.lang,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** phpgw_en.lang       17 May 2003 03:42:30 -0000      1.10
--- phpgw_en.lang       22 May 2003 02:36:54 -0000      1.11
***************
*** 151,155 ****
  parent        sitemgr en      Parent
  password      sitemgr-site    en      Password
! password that you assigned for the aonymous user account.     sitemgr en      
Password that you assigned for the aonymous user account.
  phpgw users   sitemgr en      phpgw users
  post a message to this thread sitemgr en      Post A Message To This Thread
--- 151,155 ----
  parent        sitemgr en      Parent
  password      sitemgr-site    en      Password
! password that you assigned for the anonymous user account.    sitemgr en      
Password that you assigned for the anonymous user account.
  phpgw users   sitemgr en      phpgw users
  post a message to this thread sitemgr en      Post A Message To This Thread

Index: phpgw_fr.lang
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/phpgw_fr.lang,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** phpgw_fr.lang       17 May 2003 03:42:30 -0000      1.6
--- phpgw_fr.lang       22 May 2003 02:36:54 -0000      1.7
***************
*** 151,155 ****
  parent        sitemgr fr      Parent
  password      sitemgr-site    fr      Mot de passe
! password that you assigned for the aonymous user account.     sitemgr fr      
Le mot de passe que vous avez assigné pour le compte anonyme.
  phpgw users   sitemgr fr      Utilisateurs phpGroupWare
  post a message to this thread sitemgr fr      Poster un message dans ce fil 
de discussion
--- 151,155 ----
  parent        sitemgr fr      Parent
  password      sitemgr-site    fr      Mot de passe
! password that you assigned for the anonymous user account.    sitemgr fr      
Le mot de passe que vous avez assigné pour le compte anonyme.
  phpgw users   sitemgr fr      Utilisateurs phpGroupWare
  post a message to this thread sitemgr fr      Poster un message dans ce fil 
de discussion

Index: setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/setup.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** setup.inc.php       4 Mar 2003 17:26:43 -0000       1.12
--- setup.inc.php       22 May 2003 02:36:54 -0000      1.13
***************
*** 14,20 ****
        $setup_info['sitemgr']['name']      = 'sitemgr';
        $setup_info['sitemgr']['title']     = 'SiteMgr Web Content Manager';
!       $setup_info['sitemgr']['version']   = '0.9.15.003';
        $setup_info['sitemgr']['app_order'] = 8;
!       $setup_info['sitemgr']['tables']    = 
array('phpgw_sitemgr_pages','phpgw_sitemgr_pages_lang','phpgw_sitemgr_categories_lang','phpgw_sitemgr_preferences','phpgw_sitemgr_modules','phpgw_sitemgr_content','phpgw_sitemgr_content_lang','phpgw_sitemgr_active_modules','phpgw_sitemgr_properties');
        $setup_info['sitemgr']['enable']    = 1;
  
--- 14,20 ----
        $setup_info['sitemgr']['name']      = 'sitemgr';
        $setup_info['sitemgr']['title']     = 'SiteMgr Web Content Manager';
!       $setup_info['sitemgr']['version']   = '0.9.15.004';
        $setup_info['sitemgr']['app_order'] = 8;
!       $setup_info['sitemgr']['tables']    = 
array('phpgw_sitemgr_pages','phpgw_sitemgr_pages_lang','phpgw_sitemgr_categories_lang','phpgw_sitemgr_sites','phpgw_sitemgr_modules','phpgw_sitemgr_content','phpgw_sitemgr_content_lang','phpgw_sitemgr_active_modules','phpgw_sitemgr_properties');
        $setup_info['sitemgr']['enable']    = 1;
  

Index: tables_current.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/tables_current.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** tables_current.inc.php      4 Mar 2003 17:26:43 -0000       1.11
--- tables_current.inc.php      22 May 2003 02:36:54 -0000      1.12
***************
*** 50,64 ****
                        'uc' => array()
                ),
!               'phpgw_sitemgr_preferences' => array(
!                       'fd' => array(
!                               'pref_id' => array('type' => 'auto', 'nullable' 
=> false),
!                               'name' => array('type' => 'varchar', 
'precision' => 255),
!                               'value' => array('type' => 'text')
!                       ),
!                       'pk' => array('pref_id'),
!                       'fk' => array(),
!                       'ix' => array(),
!                       'uc' => array()
!               ),
                'phpgw_sitemgr_modules' => array(
                        'fd' => array(
--- 50,65 ----
                        'uc' => array()
                ),
! //            'phpgw_sitemgr_preferences' => array(
! //                    'fd' => array(
! //                            'pref_id' => array('type' => 'auto', 'nullable' 
=> false),
! //                            'name' => array('type' => 'varchar', 
'precision' => 255),
! //                            'value' => array('type' => 'text'),
! //                            'site_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => false),
! //                    ),
! //                    'pk' => array('pref_id'),
! //                    'fk' => array(),
! //                    'ix' => array(),
! //                    'uc' => array()
! //            ),
                'phpgw_sitemgr_modules' => array(
                        'fd' => array(
***************
*** 125,128 ****
--- 126,146 ----
                        ),
                        'pk' => array('area','cat_id','module_id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ),
+               'phpgw_sitemgr_sites' => array(
+                       'fd' => array(
+                               'site_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => false),
+                               'site_name' => array('type' => 'varchar', 
'precision' => 255),
+                               'site_url' => array('type' => 'varchar', 
'precision' => 255),
+                               'site_dir' => array('type' => 'varchar', 
'precision' => 255),
+                               'themesel' => array('type' => 'varchar', 
'precision' => 50),
+                               'site_languages' => array('type' => 'varchar', 
'precision' => 50),
+                               'home_page_id' => array('type' => 'int', 
'precision' => 4),
+                               'anonymous_user' => array('type' => 'varchar', 
'precision' => 50),
+                               'anonymous_passwd' => array('type' => 
'varchar', 'precision' => 50),
+                       ),
+                       'pk' => array('site_id'),
                        'fk' => array(),
                        'ix' => array(),

Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/sitemgr/setup/tables_update.inc.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** tables_update.inc.php       4 Mar 2003 17:26:43 -0000       1.11
--- tables_update.inc.php       22 May 2003 02:36:54 -0000      1.12
***************
*** 407,409 ****
--- 407,508 ----
        }
  
+       $test[] = '0.9.15.003';
+       function sitemgr_upgrade0_9_15_003()
+       {
+               global $setup_info,$phpgw_setup;
+               $setup_info['sitemgr']['currentver'] = '0.9.15.004';
+ 
+               $phpgw_setup->oProc->createtable('phpgw_sitemgr_sites',array(
+                       'fd' => array(
+                               'site_id' => array('type' => 'int', 'precision' 
=> 4, 'nullable' => false),
+                               'site_name' => array('type' => 'varchar', 
'precision' => 255),
+                               'site_url' => array('type' => 'varchar', 
'precision' => 255),
+                               'site_dir' => array('type' => 'varchar', 
'precision' => 255),
+                               'themesel' => array('type' => 'varchar', 
'precision' => 50),
+                               'site_languages' => array('type' => 'varchar', 
'precision' => 50),
+                               'home_page_id' => array('type' => 'int', 
'precision' => 4),
+                               'anonymous_user' => array('type' => 'varchar', 
'precision' => 50),
+                               'anonymous_passwd' => array('type' => 
'varchar', 'precision' => 50),
+                       ),
+                       'pk' => array('site_id'),
+                       'fk' => array(),
+                       'ix' => array(),
+                       'uc' => array()
+               ));
+               $db2 = $phpgw_setup->db;
+ 
+               //Create default site and hang all existing categories into it
+               $db2->query("INSERT INTO phpgw_categories 
(cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description) VALUES 
(0,-1,'public','sitemgr','Default Website','This website has been add by 
setup')");
+               $site_id = 
$db2->get_last_insert_id('phpgw_categories','cat_id');
+               $db2->query("UPDATE phpgw_categories SET cat_main = $site_id 
WHERE cat_appname = 'sitemgr'",__LINE__,__FILE__);
+               $db2->query("UPDATE phpgw_categories SET cat_parent = $site_id 
WHERE cat_appname = 'sitemgr' AND cat_parent = 0 AND cat_id != 
$site_id",__LINE__,__FILE__);
+               $db2->query("UPDATE phpgw_categories SET cat_level = cat_level 
+1 WHERE cat_appname = 'sitemgr' AND cat_id != $site_id",__LINE__,__FILE__);
+               $db2->query("INSERT INTO phpgw_sitemgr_sites 
(site_id,site_name)  VALUES ($site_id,'Default Website')");
+ 
+               //insert values from old preferences table into new sites table
+               $oldtonew = array(
+                       'sitemgr-site-url' => 'site_url',
+                       'sitemgr-site-dir' => 'site_dir',
+                       'themesel' => 'themesel',
+                       'sitelanguages' => 'site_languages',
+                       'home-page-id' => 'home_page_id',
+                       'anonymous-user' => 'anonymous_user',
+                       'anonymous-passwd' => 'anonymous_passwd'
+               );
+               foreach ($oldtonew as $old => $new)
+               {
+                       $phpgw_setup->oProc->query("SELECT value from 
phpgw_sitemgr_preferences WHERE name = '$old'");
+                       $phpgw_setup->oProc->next_record();
+                       $value = $phpgw_setup->oProc->f('value');
+                       $db2->query("UPDATE phpgw_sitemgr_sites SET $new = 
'$value' WHERE site_id = $site_id");
+               }
+ 
+               //site names and headers
+               $db2->query("SELECT site_languages from phpgw_sitemgr_sites");
+               if ($db2->next_record())
+               {
+                       $db2->f('site_languages');
+               }
+               $sitelanguages = $db2->f('site_languages');
+               $sitelanguages = explode(',',$sitelanguages);
+               $db2->query("SELECT module_id from phpgw_sitemgr_modules WHERE 
module_name='html'");
+               $db2->next_record();
+               $html_module = $db2->f('module_id');
+               $emptyarray = serialize(array());
+               $db2->query("INSERT INTO phpgw_sitemgr_content 
(area,cat_id,page_id,module_id,arguments,sort_order,viewable,actif) VALUES 
('HEADER',$site_id,0,$html_module,'$emptyarray',0,0,1)",__LINE__,__FILE__);
+               $headerblock = 
$db2->get_last_insert_id('phpgw_sitemgr_content','block_id');
+               $db2->query("INSERT INTO phpgw_sitemgr_content 
(area,cat_id,page_id,module_id,arguments,sort_order,viewable,actif) VALUES 
('FOOTER',$site_id,0,$html_module,'$emptyarray',0,0,1)",__LINE__,__FILE__);
+               $footerblock = 
$db2->get_last_insert_id('phpgw_sitemgr_content','block_id');
+ 
+               foreach ($sitelanguages as $lang)
+               {
+                       $db2->query("SELECT value from 
phpgw_sitemgr_preferences WHERE name = 'sitemgr-site-name-$lang'");
+                       if ($db2->next_record())
+                       {
+                               $name_lang = $db2->f('value');
+                               $db2->query("INSERT INTO 
phpgw_sitemgr_categories_lang (cat_id,lang,name) VALUES 
($site_id,'$lang','$name_lang')");
+                       }
+                       $db2->query("SELECT value from 
phpgw_sitemgr_preferences WHERE name = 'siteheader-$lang'");
+                       if ($db2->next_record())
+                       {
+                               $header_lang = $db2->f('value');
+                               $content = 
$db2->db_addslashes(serialize(array('htmlcontent' => 
stripslashes($header_lang))));
+               
+                               $db2->query("INSERT INTO 
phpgw_sitemgr_content_lang (block_id,lang,arguments_lang,title) VALUES 
($headerblock,'$lang','$content','Site header')",__LINE__,__FILE__);
+                       }
+                       $db2->query("SELECT value from 
phpgw_sitemgr_preferences WHERE name = 'sitefooter-$lang'");
+                       if ($db2->next_record())
+                       {
+                               $footer_lang = $db2->f('value');
+                               $content = 
$db2->db_addslashes(serialize(array('htmlcontent' => 
stripslashes($footer_lang))));
+                               
+                               $db2->query("INSERT INTO 
phpgw_sitemgr_content_lang (block_id,lang,arguments_lang,title) VALUES 
($footerblock,'$lang','$content','Site footer')",__LINE__,__FILE__);
+                       }
+               }
+                       
+               $phpgw_setup->oProc->DropTable('phpgw_sitemgr_preferences');
+ 
+               return $setup_info['sitemgr']['currentver'];
+       }
+ 
  ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]