projects
/
Pman.Base
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed locked
[Pman.Base]
/
Pman
/
Roo.php
diff --git
a/Pman/Roo.php
b/Pman/Roo.php
index
344bbb0
..
ee0e571
100644
(file)
--- a/
Pman/Roo.php
+++ b/
Pman/Roo.php
@@
-42,7
+42,14
@@
require_once 'Pman.php';
class Pman_Roo extends Pman
{
class Pman_Roo extends Pman
{
- /**
+
+ /* EVENTUALLY - move this stuff here..
+ * use Pman_Core_RooTrait,
+ Pman_Core_RooGetTrait,
+ Pman_Core_RooPostTrait,
+ Pman_Core_RooJsonOutputTrait;
+ */
+ /**
* if set to an array (when extending this, then you can restrict which tables are available
*/
var $validTables = false;
* if set to an array (when extending this, then you can restrict which tables are available
*/
var $validTables = false;
@@
-56,16
+63,21
@@
class Pman_Roo extends Pman
var $do = false; // the dataobject being worked on..
var $do = false; // the dataobject being worked on..
+
+ var $countWhat; // set in loadMap
+ var $colsJname;
+ var $old;
+
function getAuth()
{
parent::getAuth(); // load company!
$au = $this->getAuthUser();
if (!$au) {
function getAuth()
{
parent::getAuth(); // load company!
$au = $this->getAuthUser();
if (!$au) {
- $this->jerr
(
"Not authenticated", array('authFailure' => true));
+ $this->jerr
or("LOGIN-NOAUTH",
"Not authenticated", array('authFailure' => true));
}
if (!$au->pid() ) { // not set up yet..
}
if (!$au->pid() ) { // not set up yet..
- $this->jerr
(
"Not authenticated", array('authFailure' => true));
+ $this->jerr
or("LOGIN-NOAUTH",
"Not authenticated", array('authFailure' => true));
}
}
@@
-176,13
+188,9
@@
class Pman_Roo extends Pman
$this->init(); // from pman.
//DB_DataObject::debuglevel(1);
HTML_FlexyFramework::get()->generateDataobjectsCache($this->isDev && !empty($_REQUEST['isDev']));
$this->init(); // from pman.
//DB_DataObject::debuglevel(1);
HTML_FlexyFramework::get()->generateDataobjectsCache($this->isDev && !empty($_REQUEST['isDev']));
-
-
-
+
// debugging...
// debugging...
-
-
-
+
if ( $this->checkDebugPost()) {
if ( $this->checkDebugPost()) {
@@
-199,7
+207,8
@@
class Pman_Roo extends Pman
$tab = array_shift($tt);
$x = $this->dataObject($tab);
$tab = array_shift($tt);
$x = $this->dataObject($tab);
- $_columns = !empty($_REQUEST['_columns']) ? explode(',', $_REQUEST['_columns']) : false;
+ $_columns = !empty($_REQUEST['_columns']) && is_string($_REQUEST['_columns']) ? explode(',', $_REQUEST['_columns']) : false;
+
if (isset( $_REQUEST['lookup'] ) && is_array($_REQUEST['lookup'] )) { // single fetch based on key/value pairs
$this->selectSingle($x, $_REQUEST['lookup'],$_REQUEST);
if (isset( $_REQUEST['lookup'] ) && is_array($_REQUEST['lookup'] )) { // single fetch based on key/value pairs
$this->selectSingle($x, $_REQUEST['lookup'],$_REQUEST);
@@
-253,7
+262,7
@@
class Pman_Roo extends Pman
$this->setFilters($x,$_REQUEST);
if (!$this->checkPerm($x,'S', $_REQUEST)) {
$this->setFilters($x,$_REQUEST);
if (!$this->checkPerm($x,'S', $_REQUEST)) {
- $this->jerr
(
"PERMISSION DENIED (g)");
+ $this->jerr
or("NOTICE-NOPERM",
"PERMISSION DENIED (g)");
}
//print_r($x);
}
//print_r($x);
@@
-927,7
+936,7
@@
class Pman_Roo extends Pman
if (method_exists($x, 'setFromRoo')) {
$res = $x->setFromRoo($req, $this);
if (is_string($res)) {
if (method_exists($x, 'setFromRoo')) {
$res = $x->setFromRoo($req, $this);
if (is_string($res)) {
- $this->jerr
(
$res);
+ $this->jerr
or("NOTICE-INSERT",
$res);
}
} else {
$x->setFrom($req);
}
} else {
$x->setFrom($req);
@@
-1202,7
+1211,7
@@
class Pman_Roo extends Pman
$x->whereAdd($this->key .' IN ('. implode(',', $bits) .')');
if (!$x->find()) {
$x->whereAdd($this->key .' IN ('. implode(',', $bits) .')');
if (!$x->find()) {
- $this->jerr
(
"Nothing found to delete");
+ $this->jerr
or("NOTICE-DELETE",
"Nothing found to delete");
}
$errs = array();
while ($x->fetch()) {
}
$errs = array();
while ($x->fetch()) {
@@
-1281,7
+1290,7
@@
class Pman_Roo extends Pman
if (method_exists($chk, 'toEventString')) {
$desc .= ' : ' . $o[0]->toEventString();
}
if (method_exists($chk, 'toEventString')) {
$desc .= ' : ' . $o[0]->toEventString();
}
- $this->jerr
(
"Delete Dependant records ($match_total found), " .
+ $this->jerr
or("NOTICE-DELETE-DEP",
"Delete Dependant records ($match_total found), " .
"first is ( $desc )");
}
"first is ( $desc )");
}
@@
-1330,8
+1339,7
@@
class Pman_Roo extends Pman
function loadMap($do, $cfg =array()) //$onlycolumns=false, $distinct = false)
{
function loadMap($do, $cfg =array()) //$onlycolumns=false, $distinct = false)
{
-
- //DB_DataObject::debugLevel(5);
+ //DB_DataObject::debugLevel(5);
$onlycolumns = !empty($cfg['columns']) ? $cfg['columns'] : false;
$distinct = !empty($cfg['distinct']) ? $cfg['distinct'] : false;
$excludecolumns = !empty($cfg['exclude']) ? $cfg['exclude'] : array();
$onlycolumns = !empty($cfg['columns']) ? $cfg['columns'] : false;
$distinct = !empty($cfg['distinct']) ? $cfg['distinct'] : false;
$excludecolumns = !empty($cfg['exclude']) ? $cfg['exclude'] : array();
@@
-1587,7
+1595,8
@@
class Pman_Roo extends Pman
}
$tab = str_replace('/', '',$tab); // basic protection??
}
$tab = str_replace('/', '',$tab); // basic protection??
- $pm = HTML_FlexyFramework::get()->Pman;
+ $ff = HTML_FlexyFramework::get();
+ $pm = isset($ff->Pman) ? $ff->Pman : array();
if (isset($pm['roo_alias'])) {
$map = array_flip($pm['roo_alias']);
if (isset($pm['roo_alias'])) {
$map = array_flip($pm['roo_alias']);