mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 17:38:19 +01:00
make defautl-records complay with the (hard to understand) setup-rules
after a phonecall with ralf i do understand 1% more of how setup works :-)
This commit is contained in:
parent
f7b3b2cd3f
commit
d972768efc
@ -10,26 +10,22 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
|
require_once(EGW_INCLUDE_ROOT. '/importexport/inc/class.bodefinitions.inc.php');
|
||||||
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.accounts.inc.php');
|
|
||||||
require_once(EGW_INCLUDE_ROOT. '/phpgwapi/inc/class.translation.inc.php');
|
|
||||||
|
|
||||||
// some globals we need
|
// This sets up $GLOBALS['egw']->accounts and $GLOBALS['egw']->db
|
||||||
if ( !is_object($GLOBALS['egw']->accounts) ) $GLOBALS['egw']->accounts = new accounts();
|
$GLOBALS['egw_setup']->setup_account_object();
|
||||||
if ( !is_object($GLOBALS['egw']->translation) ) $GLOBALS['egw']->translation = new translation();
|
|
||||||
if ( !is_object($GLOBALS['egw']->db)) $GLOBALS['egw']->db = $GLOBALS['egw_setup']->db;
|
|
||||||
|
|
||||||
// apps, whose definitions should be installed automatically
|
// Fetch translation object
|
||||||
// i don't know how to ask setup which apps are / ore are going to be installed.
|
$GLOBALS['egw_setup']->translation->setup_translation_sql();
|
||||||
$appnames = array (
|
if ( !is_object($GLOBALS['egw']->translation) ) $GLOBALS['egw']->translation = $GLOBALS['egw_setup']->translation->sql;
|
||||||
'addressbook',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ($appnames as $appname) {
|
// step through every source code intstalled app
|
||||||
$defdir = EGW_INCLUDE_ROOT. "/$appname/importexport/definitions";
|
$egwdir = dir(EGW_INCLUDE_ROOT);
|
||||||
|
while (false !== ($appdir = $egwdir->read())) {
|
||||||
|
$defdir = EGW_INCLUDE_ROOT. "/$appdir/importexport/definitions";
|
||||||
if ( !is_dir( $defdir ) ) continue;
|
if ( !is_dir( $defdir ) ) continue;
|
||||||
$d = dir($defdir);
|
|
||||||
|
|
||||||
// step through each file in appdir
|
// step through each file in defdir of app
|
||||||
|
$d = dir($defdir);
|
||||||
while (false !== ($entry = $d->read())) {
|
while (false !== ($entry = $d->read())) {
|
||||||
$file = $defdir. '/'. $entry;
|
$file = $defdir. '/'. $entry;
|
||||||
list( $filename, $extension) = explode('.',$entry);
|
list( $filename, $extension) = explode('.',$entry);
|
||||||
|
Loading…
Reference in New Issue
Block a user