* - postListExtra - add extra column data on the results (like new messages etc.)
* -postListFilter($data, $authUser, $request) return $data - add extra data to an object
*
- * - toRooSingleArray($authUser) // single fetch, add data..
+ * - toRooSingleArray($authUser, $request) // single fetch, add data..
* - toRooArray($request) /// toArray if you need to return different data.. for a list fetch.
*
*
$this->jerr("PERMISSION DENIED");
}
- $this->jok(method_exists($x, 'toRooSingleArray') ? $x->toRooSingleArray($this->authUser) : $x->toArray());
+ $this->jok(method_exists($x, 'toRooSingleArray') ? $x->toRooSingleArray($this->authUser, $_REQUEST) : $x->toArray());
}
if (isset($_REQUEST['_delete'])) {
}
-
- if ($lock->find(true)) {
- if (empty($_REQUEST['_lock_id']) || $lock->id != $_REQUEST['_lock_id']) {
-
- $this->jerr("
-
- }
-
- }
+
$this->jerr('Unable to load referenced table, check the links config: ' .$ka[0]);
}
$chk->{$ka[1]} = $xx->$pk;
- if ($chk->count()) {
- $this->jerr('Delete Dependant records first ('. $ka[0]. ':' . $ka[1] .'='.$xx->$pk.')');
+ $matches = $chk->count();
+ if ($matches) {
+ $chk->limit(1);
+ $o = $chk->fetchAll();
+ $desc = $ka[0]. ':' . $ka[1] .'='.$xx->$pk
+ if (method_exists($chk, 'toEventString')) {
+ $desc = $ka[0] . ' : ' $o[0]->toEventString();
+ }
+
+
+ $this->jerr('Delete Dependant records first ('. $desc.')');
}
}
// finally log it..
function loadMap($do, $filter=false, $distinct = false)
{
//DB_DataObject::debugLevel(1);
+
+ $this->countWhat = false;
+
$conf = array();
$this->init();
//$ff->DB_DataObject['ini_'. $db->database()];
//echo '<PRE>';print_r($do->links());exit;
//var_dump($mods);
-
+ /*
if (in_array('Builder', $mods) ) {
foreach(in_array('Builder', $mods) ? scandir($this->rootDir.'/Pman') : $mods as $m) {
$map = $conf[$do->tableName()];
}
} else {
+ */
$map = $do->links();
- }
+ //}
$do->selectAdd(); // we need thsi as normally it's only cleared by an empty selectAs call.
$selectAs = array(array( $xx , '%s', false));
- $this->countWhat = false;
+
$has_distinct = false;
if ($filter || $distinct) {
$cols = array();