forked from extern/egroupware
Create template directory and set default document_dir preference of addressbook, calendar, infolog, tracker, timesheet and projectmanager
This commit is contained in:
parent
c2feef73de
commit
220af27f60
@ -273,6 +273,7 @@ class addressbook_hooks
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'default' => '/templates/addressbook',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -609,6 +609,7 @@ class calendar_hooks
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'default' => '/templates/calendar',
|
||||
);
|
||||
}
|
||||
// Import / Export for nextmatch
|
||||
|
@ -398,6 +398,7 @@ class infolog_hooks
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'default' => '/templates/infolog',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -205,3 +205,29 @@ $oProc->UpdateSequence('egw_sqlfs','fs_id');
|
||||
// Create Addressbook for Default group, by setting a group ACL from the group to itself for all rights: add, read, edit and delete
|
||||
$defaultgroup = $GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
|
||||
$GLOBALS['egw_setup']->add_acl('addressbook',$defaultgroup,$defaultgroup,1|2|4|8);
|
||||
|
||||
/**
|
||||
* Create template directory and set default document_dir preference of addressbook, calendar, infolog, tracker, timesheet and projectmanager
|
||||
*/
|
||||
$admins = $GLOBALS['egw_setup']->add_account('Admins','Admin','Group',False,False);
|
||||
|
||||
egw_vfs::$is_root = true;
|
||||
$prefs = new preferences();
|
||||
$prefs->read_repository(false);
|
||||
foreach(array('','addressbook', 'calendar', 'infolog', 'tracker', 'timesheet', 'projectmanager') as $app)
|
||||
{
|
||||
if ($app && !file_exists(EGW_SERVER_ROOT.'/'.$app)) continue;
|
||||
|
||||
// create directory and set permissions: Admins writable and other readable
|
||||
$dir = '/templates'.($app ? '/'.$app : '');
|
||||
egw_vfs::mkdir($dir, 075, STREAM_MKDIR_RECURSIVE);
|
||||
egw_vfs::chgrp($dir, abs($admins));
|
||||
egw_vfs::chmod($dir, 075);
|
||||
if (!$app) continue;
|
||||
|
||||
// set default preference for app (preserving a maybe already set document-directory)
|
||||
if ($prefs->default[$app]['document_dir']) $dir .= ' '.$prefs->default[$app]['document_dir'];
|
||||
$prefs->add($app, 'document_dir', $dir, 'default');
|
||||
}
|
||||
$prefs->save_repository(false, 'default');
|
||||
egw_vfs::$is_root = false;
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* Basic information about this app */
|
||||
$setup_info['phpgwapi']['name'] = 'phpgwapi';
|
||||
$setup_info['phpgwapi']['title'] = 'EGroupware API';
|
||||
$setup_info['phpgwapi']['version'] = '1.9.010';
|
||||
$setup_info['phpgwapi']['version'] = '1.9.011';
|
||||
$setup_info['phpgwapi']['versions']['current_header'] = '1.29';
|
||||
$setup_info['phpgwapi']['enable'] = 3;
|
||||
$setup_info['phpgwapi']['app_order'] = 1;
|
||||
|
@ -282,3 +282,33 @@ function phpgwapi_upgrade1_9_009()
|
||||
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.010';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create template directory and set default document_dir preference of addressbook, calendar, infolog, tracker, timesheet and projectmanager
|
||||
*/
|
||||
function phpgwapi_upgrade1_9_010()
|
||||
{
|
||||
$admins = $GLOBALS['egw_setup']->add_account('Admins','Admin','Group',False,False);
|
||||
|
||||
egw_vfs::$is_root = true;
|
||||
$prefs = new preferences();
|
||||
$prefs->read_repository(false);
|
||||
foreach(array('','addressbook', 'calendar', 'infolog', 'tracker', 'timesheet', 'projectmanager') as $app)
|
||||
{
|
||||
if ($app && !file_exists(EGW_SERVER_ROOT.'/'.$app)) continue;
|
||||
|
||||
// create directory and set permissions: Admins writable and other readable
|
||||
$dir = '/templates'.($app ? '/'.$app : '');
|
||||
egw_vfs::mkdir($dir, 075, STREAM_MKDIR_RECURSIVE);
|
||||
egw_vfs::chgrp($dir, abs($admins));
|
||||
egw_vfs::chmod($dir, 075);
|
||||
if (!$app) continue;
|
||||
|
||||
// set default preference for app (preserving a maybe already set document-directory)
|
||||
if ($prefs->default[$app]['document_dir']) $dir .= ' '.$prefs->default[$app]['document_dir'];
|
||||
$prefs->add($app, 'document_dir', $dir, 'default');
|
||||
}
|
||||
$prefs->save_repository(false, 'default');
|
||||
egw_vfs::$is_root = false;
|
||||
|
||||
return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.9.011';
|
||||
}
|
||||
|
@ -192,6 +192,7 @@ class timesheet_hooks
|
||||
'run_lang' => false,
|
||||
'xmlrpc' => True,
|
||||
'admin' => False,
|
||||
'default' => '/templates/timesheet',
|
||||
);
|
||||
}
|
||||
// Import / Export for nextmatch
|
||||
|
Loading…
Reference in New Issue
Block a user