projects
/
Pman.Core
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix #8131 - chinese translations
[Pman.Core]
/
RooPostTrait.php
diff --git
a/RooPostTrait.php
b/RooPostTrait.php
index
f48c96d
..
3389036
100644
(file)
--- a/
RooPostTrait.php
+++ b/
RooPostTrait.php
@@
-2,6
+2,8
@@
trait Pman_Core_RooPostTrait {
trait Pman_Core_RooPostTrait {
+ var $old;
+
/**
* POST method Roo/TABLENAME
* -- creates, updates, or deletes data.
/**
* POST method Roo/TABLENAME
* -- creates, updates, or deletes data.
@@
-170,7
+172,8
@@
trait Pman_Core_RooPostTrait {
$affects = array();
$affects = array();
- $all_links = $GLOBALS['_DB_DATAOBJECT']['LINKS'][$x->_database];
+ $all_links = $x->databaseLinks();
+
foreach($all_links as $tbl => $links) {
foreach($links as $col => $totbl_col) {
$to = explode(':', $totbl_col);
foreach($all_links as $tbl => $links) {
foreach($links as $col => $totbl_col) {
$to = explode(':', $totbl_col);
@@
-186,8
+189,13
@@
trait Pman_Core_RooPostTrait {
// echo '<PRE>';print_r($affects);exit;
// DB_Dataobject::debugLevel(1);
// echo '<PRE>';print_r($affects);exit;
// DB_Dataobject::debugLevel(1);
-
- $clean = create_function('$v', 'return (int)$v;');
+ if (function_exists('create_function')) {
+ $clean = create_function('$v', 'return (int)$v;');
+ } else {
+ $clean = function($v) {
+ return (int)$v;
+ };
+ }
$bits = array_map($clean, explode(',', $req['_delete']));
$bits = array_map($clean, explode(',', $req['_delete']));
@@
-282,7
+290,7
@@
trait Pman_Core_RooPostTrait {
}
}
- $this->
add
DeleteEvent($x);
+ $this->
log
DeleteEvent($x);
$xx->delete();
$xx->delete();
@@
-299,7
+307,7
@@
trait Pman_Core_RooPostTrait {
}
}
- function
add
DeleteEvent($object)
+ function
log
DeleteEvent($object)
{
DB_DataObject::Factory('Events')->logDeletedRecord($object);
{
DB_DataObject::Factory('Events')->logDeletedRecord($object);
@@
-395,7
+403,7
@@
trait Pman_Core_RooPostTrait {
{
$this->permitError = true; // allow it to fail without dieing
{
$this->permitError = true; // allow it to fail without dieing
- $lock = DB_DataObjecT::factory('
C
ore_locking');
+ $lock = DB_DataObjecT::factory('
c
ore_locking');
$this->permitError = false;
if (is_a($lock,'DB_DataObject') && $this->authUser) {
$this->permitError = false;
if (is_a($lock,'DB_DataObject') && $this->authUser) {
@@
-434,7
+442,7
@@
trait Pman_Core_RooPostTrait {
// edit it anyways...
// can we find the user's lock.
// edit it anyways...
// can we find the user's lock.
- $lock = DB_DataObjecT::factory('
C
ore_locking');
+ $lock = DB_DataObjecT::factory('
c
ore_locking');
$lock->on_id = $x->{$this->key};
$lock->on_table= strtolower($x->tableName());
$lock->person_id = $this->authUser->id;
$lock->on_id = $x->{$this->key};
$lock->on_table= strtolower($x->tableName());
$lock->person_id = $this->authUser->id;
@@
-449,7
+457,7
@@
trait Pman_Core_RooPostTrait {
$x->modified_by != $this->authUser->id
)
{
$x->modified_by != $this->authUser->id
)
{
- $p = DB_DataObject::factory('
P
erson');
+ $p = DB_DataObject::factory('
core_p
erson');
$p->get($x->modified_by);
$this->jerr($p->name . " saved the record since you started editing,\nDo you really want to update it?", array('needs_confirm' => true));
$p->get($x->modified_by);
$this->jerr($p->name . " saved the record since you started editing,\nDo you really want to update it?", array('needs_confirm' => true));