// if not empty on_table
if(!empty($q['person_table'])){
$jt = DB_DataObject::factory($q['person_table']);
-
- $this->_join = "LEFT JOIN {$jt->tableName()} AS join_person_id_id ON (join_person_id_id.id=Events.person_id)";
+
+ $keys = $jt->keys();
+
+ $this->_join = "LEFT JOIN {$jt->tableName()} AS join_person_id_id ON (join_person_id_id.{$keys[0]}=Events.person_id)";
$this->selectAdd();
$this->selectAs();
if (method_exists($jt,'nameColumn')) {
$this->selectAdd("join_person_id_id.{$jt->nameColumn()} as person_id_name");
}
+
+ if (method_exists($jt,'emailColumn')) {
+ $this->selectAdd("join_person_id_id.{$jt->emailColumn()} as person_id_email");
+ }
} else {
$this->writeEventLog();
}
- function writeEventLog()
+ function writeEventLog($extra_data = '')
{
$ff = HTML_FlexyFramework::get();
if (empty($ff->Pman['event_log_dir'])) {
print_r("failed to copy {$f['tmp_name']}...\n");
}
}
-
- file_put_contents($file, json_encode(array(
+ $out = array(
'REQUEST_URI' => empty($_SERVER['REQUEST_URI']) ? 'cli' : $_SERVER['REQUEST_URI'],
'HTTP_USER_AGENT' => empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'],
'GET' => empty($_GET) ? array() : $_GET,
'POST' =>$p,
'FILES' => $files,
- )));
+ );
+ if (!empty($extra_data)) {
+ $out['EXTRA'] = $extra_data;
+ }
+
+ file_put_contents($file, json_encode($out));
}