* Timesheet: fix SQL error when searching and NO custom fields defined

This commit is contained in:
Ralf Becker 2014-10-01 08:19:39 +00:00
parent 72d5413131
commit f1283fcf71

View File

@ -156,7 +156,7 @@ class timesheet_bo extends so_sql_cf
{
parent::__construct(TIMESHEET_APP,'egw_timesheet',self::EXTRA_TABLE,'','ts_extra_name','ts_extra_value','ts_id');
$this->columns_to_search[] = self::EXTRA_TABLE.'.ts_extra_value';
if ($this->customfields) $this->columns_to_search[] = self::EXTRA_TABLE.'.ts_extra_value';
$this->config_data = config::read(TIMESHEET_APP);
$this->quantity_sum = $this->config_data['quantity_sum'] == 'true';
@ -448,9 +448,9 @@ class timesheet_bo extends so_sql_cf
* reimplemented to limit result to users we have grants from
*
* @param array|string $criteria array of key and data cols, OR a SQL query (content for WHERE), fully quoted (!)
* @param boolean/string $only_keys=true True returns only keys, False returns all cols. comma seperated list of keys to return
* @param boolean|string $only_keys =true True returns only keys, False returns all cols. comma seperated list of keys to return
* @param string $order_by ='' fieldnames + {ASC|DESC} separated by colons ',', can also contain a GROUP BY (if it contains ORDER BY)
* @param string/array $extra_cols='' string or array of strings to be added to the SELECT, eg. "count(*) as num"
* @param string|array $extra_cols ='' string or array of strings to be added to the SELECT, eg. "count(*) as num"
* @param string $wildcard ='' appended befor and after each criteria
* @param boolean $empty =false False=empty criteria are ignored in query, True=empty have to be empty in row
* @param string $op ='AND' defaults to 'AND', can be set to 'OR' too, then criteria's are OR'ed together
@ -780,7 +780,7 @@ class timesheet_bo extends so_sql_cf
*
* Is called as hook to participate in the linking
*
* @param int/array $entry int ts_id or array with timesheet entry
* @param int|array $entry int ts_id or array with timesheet entry
* @return string/boolean string with title, null if timesheet not found, false if no perms to view it
*/
function link_title( $entry )