'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'];
),
);
+$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){
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])) {
}
-#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',
-);
-
?>