diff --git a/resources/setup/default_records.inc.php b/resources/setup/default_records.inc.php new file mode 100644 index 0000000000..b8eded1513 --- /dev/null +++ b/resources/setup/default_records.inc.php @@ -0,0 +1,29 @@ + + * @version $Id$ + */ + + $resources_table_prefix = 'egw_resources'; + + // Add a general category for resources + $oProc->query("INSERT INTO {$GLOBALS['egw_setup']->cats_table} (cat_parent,cat_owner,cat_access,cat_appname,cat_name,cat_description,last_mod) VALUES (0,-1,'public','resources','General resources','This category has been added by setup',".time().")"); + $cat_id = $oProc->m_odb->get_last_insert_id($GLOBALS['egw_setup']->cats_table,'cat_id'); + + // 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); + + // 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',$cat_id,1,'cat_src',-1)"); + $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Meeting room 2',$cat_id,1,'cat_src',-1)"); + $res_id = $oProc->m_odb->get_last_insert_id($resources_table_prefix,'res_id'); + $oProc->query("INSERT INTO {$resources_table_prefix} (name,cat_id,bookable,picture_src,accessory_of) VALUES ( 'Fixed Beamer',$cat_id,0,'cat_src',$res_id)"); + + diff --git a/resources/setup/setup.inc.php b/resources/setup/setup.inc.php index 5fea9dbe32..5b5c189ffb 100755 --- a/resources/setup/setup.inc.php +++ b/resources/setup/setup.inc.php @@ -13,7 +13,7 @@ $setup_info['resources']['name'] = 'resources'; $setup_info['resources']['title'] = 'Resources'; $setup_info['resources']['version'] = '0.0.1.020'; - $setup_info['resources']['app_order'] = 1; + $setup_info['resources']['app_order'] = 5; $setup_info['resources']['tables'] = array('egw_resources'); $setup_info['resources']['enable'] = 1; @@ -40,23 +40,9 @@ ); $setup_info['resources']['depends'][] = array( // cause eTemplates is not in the api yet 'appname' => 'etemplate', - 'versions' => Array('1.0.0','1.0.1','1.2') + 'versions' => Array('1.0.1','1.2') ); $setup_info['resources']['depends'][] = array( // cause of vfs psuedoprotocol is not fully in the api yet 'appname' => 'filemanager', 'versions' => Array('1.0.0','1.0.1','1.2') ); - - - - - - - - - - - - - -