Author: ralfbecker
Date: Sat Mar 31 11:34:45 2012
New Revision: 38731
URL: http://svn.stylite.de/viewvc/egroupware?rev=38731&view=rev
Log:
add locations category required for CalDAV to distinguish between locations and resources, when updating from 1.8
Modified:
trunk/resources/setup/default_records.inc.php
trunk/resources/setup/tables_update.inc.php
Modified: trunk/resources/setup/default_records.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/resources/setup/default_records.inc.php?rev=38731&r1=38730&r2=38731&view=diff
==============================================================================
--- trunk/resources/setup/default_records.inc.php (original)
+++ trunk/resources/setup/default_records.inc.php Sat Mar 31 11:34:45 2012
@@ -22,6 +22,7 @@
$defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
$GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup);
$GLOBALS['egw_setup']->add_acl('resources',"L$cat_id",$defaultgroup,399);
+$GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399);
// Add two rooms to give user an idea of what resources is...
$oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Meeting room 1',$locations_cat_id,1,'cat_src',-1)");
Modified: trunk/resources/setup/tables_update.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/resources/setup/tables_update.inc.php?rev=38731&r1=38730&r2=38731&view=diff
==============================================================================
--- trunk/resources/setup/tables_update.inc.php (original)
+++ trunk/resources/setup/tables_update.inc.php Sat Mar 31 11:34:45 2012
@@ -318,7 +318,20 @@
{
return $GLOBALS['setup_info']['resources']['currentver'] = '1.8';
}
+
+
function resources_upgrade1_8()
{
+ // add location category required for CalDAV to distinguish between locations and resources
+ $GLOBALS['egw_setup']->db->insert($GLOBALS['egw_setup']->cats_table,array('cat_parent' => 0, 'cat_owner' => categories::GLOBAL_ACCOUNT,'cat_access' => 'public','cat_appname' => 'resources','cat_name' => 'Locations','cat_description' => 'This category has been added by setup','last_mod' => time()),false,__LINE__,__FILE__);
+ $locations_cat_id = $GLOBALS['egw_setup']->db->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id');
+ config::save_value('location_cats', $locations_cat_id, 'resources');
+
+ // Give default group all rights to this general cat
+ $defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
+ $GLOBALS['egw_setup']->add_acl('resources','run',$defaultgroup);
+ $GLOBALS['egw_setup']->add_acl('resources',"L$cat_id",$defaultgroup,399);
+ $GLOBALS['egw_setup']->add_acl('resources',"L$locations_cat_id",$defaultgroup,399);
+
return $GLOBALS['setup_info']['resources']['currentver'] = '1.9.001';
}
|