* lookup[key]=value single fetch based on a single key value lookup.
* multiple key/value can be used. eg. ontable+onid..
* _columns what to return.
+ *
+ * _no_count skip the default count query.
+ * use the number of records in the query result as the total
*
*
* JOINS:
* -- apply any query filters on data. and hide stuff not to be seen.
* -- can exit by calling $roo->jerr()
* postListExtra($_REQUEST, $roo, $array_data) : array(extra_name => data)
- * - add extra column data on the results (like new messages etc.)
+ * - add extra column to the jdata return key/value info.
* postListFilter($data, $authUser, $request) return $data
- * - add extra data to an object
+ * - modify the returned array of data (either add stuff to the data, or remove lines etc)
*
*
* toRooSingleArray($authUser, $request) : array
$xx=clone($x);
}
-
- $total = $xx->count($this->countWhat);
+ $total = false;
+ if (!isset($_REQUEST['_no_count'])) {
+ $total = $xx->count($this->countWhat);
+ }
// sorting..
//
- //var_dump($total);exit;
+ // var_dump($total);exit;
$this->applySort($x);
$fake_limit = false;
- if (!empty($_REQUEST['_distinct']) && $total < 400) {
+ if (!empty($_REQUEST['_distinct']) && $total !== false && $total < 400) {
$fake_limit = true;
}
if (!empty($_REQUEST['query']['add_blank'])) {
$ret[] = array( 'id' => 0, 'name' => '----');
- $total+=1;
+ $total === false ? false : $total+1;
}
$rooar = method_exists($x, 'toRooArray');
// filter results, and add any data that is needed...
if (method_exists($x,'postListFilter')) {
- $ret = $x->postListFilter($ret, $this->authUser, $_REQUEST);
+ $ret = $x->postListFilter($ret, $this->authUser, $_REQUEST, $this);
}
if (!empty($_REQUEST['_requestMeta']) && count($ret)) {
$meta = $this->meta($x, $ret);
if ($meta) {
+ $extra = $extra ? $extra: array();
$extra['metaData'] = $meta;
}
}
// this make take some time...
$this->sessionState(0);
// echo "<PRE>"; print_r($ret);
- $this->jdata($ret, max(count($ret), $total), $extra );
+ $this->jdata($ret, max(count($ret), $total === false ? 0 : $total), $extra );
}
// 'fillBlank' => 'gray', // set
);
//die('here');
- if (method_exists($this->do, 'toSimpleExcelColumn')) {
+ if (!empty($this->do) && method_exists($this->do, 'toSimpleExcelColumn')) {
$add = $this->do->toSimpleExcelColumn($add);
}