From: Nicolas Boisselier Date: Fri, 17 Jun 2016 01:11:43 +0000 (+0100) Subject: data X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=1f22ff2250c25510fc13decb10ab8519ef3ec7af;p=nb.git data --- diff --git a/etc/dbs/rent.php b/etc/dbs/rent.php index 67c2c8d5..2b0c21d7 100644 --- a/etc/dbs/rent.php +++ b/etc/dbs/rent.php @@ -11,18 +11,16 @@ $CONF['_rent'] = array( 'tables' => array( 'place' => array( - 'replace' => array ( - 'id' => 'addr.addr', - ), + #'replace' => [ 'id' => 'addr.addr' ], + 'row_parse_post' => 'place_doc', + ), + 'tenant' => array( + 'row_parse_post' => 'tenant_doc', ), 'rent' => array( 'orderby' => 'start desc, end desc', - - 'replace' => array ( - 'idtenant' => 'tenant.name', - 'idplace' => 'addr.addr', - ), + #'replace' => [ 'idtenant' => 'tenant.name', 'idplace' => 'addr.addr' ], 'row_parse_pre' => function(&$r) { $r['month'] = $r['rent'] + $r['charge']; @@ -57,6 +55,14 @@ $CONF['_rent'] = array( ), ); +$CONF['rent'] = array ( + 'order' => 5, + 'pdo' => 'sqlite:/opt/rent/rent.db', + #'_import' => '_nb', +); + +return 1; + function untilde($path) { if (!function_exists('posix_getuid')) return $path; return preg_replace_callback('/^(~)(\w+)?/',function($m){ @@ -69,6 +75,8 @@ function tenant_doc(&$r) { return rent_doc('tenant',$r); } function place_doc(&$r) { return rent_doc('place',$r); } function rent_doc($table,&$r) { + if (empty($_SERVER['DOCUMENT_ROOT'])) return; + $url = ''; foreach (['id'.$table,'id'] as $k) { if (isset($r[$k])) { @@ -106,16 +114,4 @@ function rent_doc($table,&$r) { } -#die(untilde('~/.gitconfig')); -if (!empty($_SERVER['DOCUMENT_ROOT'])) { - $CONF['_rent']['tables']['tenant'] = [ 'row_parse_post' => 'tenant_doc' ]; - $CONF['_rent']['tables']['place']['row_parse_post'] = 'place_doc'; -} - -$CONF['rent'] = array ( - 'order' => 5, - 'pdo' => 'sqlite:/opt/rent/rent.db', - #'_import' => '_nb', -); - ?>