* - beforeInsert($request,$roo) - before insert - jerr() will stop insert..
*
* AFTER
- * - onUpdate($old, $request,$roo) - after update // return value ignored
- * - onInsert($request,$roo) - after insert
+ * - onUpdate($old, $request,$roo, $event) - after update // return value ignored
+ * - onInsert($request,$roo, $event) - after insert
* - onDelete($req, $roo) - after delete
* - onUpload($roo)
*
return true;
}
/**
- * GET method Roo/TABLENAME.php
+ * GET method Roo/TABLENAME
*
* Generally for SELECT or Single SELECT
*
$this->checkDebug();
$this->initErrorHandling();
-
+
$tt = explode('/', $tab);
$tab = array_shift($tt);
$x = $this->dataObject($tab);
- var_dump($x); exit;
+
$_columns = !empty($_REQUEST['_columns']) ? explode(',', $_REQUEST['_columns']) : false;
if (isset( $_REQUEST['lookup'] ) && is_array($_REQUEST['lookup'] )) { // single fetch based on key/value pairs
$this->sessionState(0);
$res = $x->find();
$this->sessionState(1);
-
+
if (false === $res) {
$this->jerr($x->_lastError->toString());
if ($cols == '*') { /// did we get cols sent to us?
$cols = array_keys($x);
}
+
+ if(!is_array($cols)) {
+ $cols = explode(',', $cols);
+ }
if ($titles !== false) {
if ($titles== '*') {
$titles= array_keys($x);
}
+ if(!is_array($titles)) {
+ $titles = explode(',', $titles);
+ }
foreach($cols as $i=>$col) {
$se_config['cols'][] = array(
'header'=> isset($titles[$i]) ? $titles[$i] : $col,
if ($cols== '*') {
$cols= array_keys($x);
}
+
+ if(!is_array($titles)) {
+ $titles = explode(',', $titles);
+ }
+ if(!is_array($cols)) {
+ $cols = explode(',', $cols);
+ }
+
if ($titles !== false) {
foreach($cols as $i=>$col) {
$se_config['cols'][] = array(
}
-
//fputcsv($fh, $titles);
$titles = false;
}
}
+
+
$old = false;
// not sure if this is a good idea here...
-
+
if (!empty($_REQUEST['_ids'])) {
$ids = explode(',',$_REQUEST['_ids']);
$x->whereAddIn($this->key, $ids, 'int');
} else if (method_exists($x, 'applyFilters')) {
// always call apply filters even after update/insert...
// however arguments are not passed.
- $x->applyFilters(array(), $this->authUser, $this);
+ $x->applyFilters(array('_is_update_request' => true), $this->authUser, $this);
}
// DB_DataObject::DebugLevel(1);
if ($res === false) {
$this->jerr($x->_lastError->toString());
}
+ $ev = $this->addEvent("ADD", $x);
if (method_exists($x, 'onInsert')) {
- $x->onInsert($_REQUEST, $this);
+ $x->onInsert($_REQUEST, $this, $ev);
}
- $ev = $this->addEvent("ADD", $x);
+
if ($ev) {
$ev->audit($x);
}
if ($res === false) {
$this->jerr($x->_lastError->toString());
}
-
+ $ev = $this->addEvent("EDIT", $x);
+
if (method_exists($x, 'onUpdate')) {
- $x->onUpdate($old, $req, $this);
+ $x->onUpdate($old, $req, $this, $ev);
}
- $ev = $this->addEvent("EDIT", $x);
if ($ev) {
$ev->audit($x, $old);
}
*/
function delete($x, $req)
- {
+ {
// do we really delete stuff!?!?!?
if (empty($req['_delete'])) {
$this->jerr("Delete Requested with no value");
}
+
+
// build a list of tables to queriy for dependant data..
$map = $x->links();
}
}
+
$has_beforeDelete = method_exists($xx, 'beforeDelete');
// before delte = allows us to trash dependancies if needed..
$match_total = 0;
$q_filtered = array();
$keys = $x->keys();
- // var_dump($keys);exit;
+
foreach($q as $key=>$val) {
if (in_array($key,$keys) && !is_array($val)) {
}
-
+
switch($key) {