projects
/
misc
/
kostenrechnung
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move JOIN processor into function
[misc/kostenrechnung]
/
lib
/
general.php
diff --git
a/lib/general.php
b/lib/general.php
index
837a4b8
..
94365d8
100644
(file)
--- a/
lib/general.php
+++ b/
lib/general.php
@@
-187,6
+187,14
@@
function debug_info()
return $html;
}
return $html;
}
+function grid_sql_join($mask)
+{
+ if (array_key_exists('join', $mask)) {
+ return ' JOIN ' . join(' JOIN ', $mask['join']);
+ }
+ return '';
+}
+
function grid_sql($name, $mask)
{
$fields = array();
function grid_sql($name, $mask)
{
$fields = array();
@@
-199,7
+207,7
@@
function grid_sql($name, $mask)
$_SESSION['grid_' . $name] = sprintf("SELECT %s FROM %s",
implode(',', $fields), $mask['table']);
$_SESSION['grid_' . $name] = sprintf("SELECT %s FROM %s",
implode(',', $fields), $mask['table']);
- if (array_key_exists('join', $mask)) $_SESSION['grid_' . $name] .=
' JOIN ' . join(' JOIN ', $mask['join']
);
+ if (array_key_exists('join', $mask)) $_SESSION['grid_' . $name] .=
grid_sql_join($mask
);
if (array_key_exists('where', $mask)) $_SESSION['grid_' . $name] .= ' WHERE ' . $mask['where'];
}
if (array_key_exists('where', $mask)) $_SESSION['grid_' . $name] .= ' WHERE ' . $mask['where'];
}