+
<?php
/**
* Table Definition for core_watch
###END_AUTOCODE
/** make sure there is a watch for this user.. */
+
+ function applyFilters($q,$au, $roo)
+ {
+ if (!empty($q['_list_actions'])) {
+ $this->listActions($roo,$q);
+ }
+ //die("apply filters");
+ if (!empty($q['_split_event_name'])) {
+ $this->selectAdd("
+
+ substr( event, substring_index(event, '.')) as event_left,
+ substr( event, 0, substring_index(event, '.')) as event_right
+
+ ");
+
+
+
+ }
+
+ }
+
+ function toRooSingleArray($au,$q)
+ {
+ $ret = $this->toArray();
+ if (empty($q['_split_event_name'])) {
+ return $ret;
+ }
+ $bits = explode('.', $this->event);
+ $ret['event_left'] = $bits[0];
+ $ret['event_right'] = $bits[1];
+ // check core enu.
+ if (!empty($ret['event_right'])) {
+ $ce = DB_DataObject::factory('core_enum')->lookup($q['_split_event_name'], $ret['event_right']);
+ $ret['event_right_display_name'] = $ce;
+ }
+
+
+
+
+ }
+
+ function listActions($roo, $q) {
+
+ //print_r($q);
+ $d = DB_DataObject::Factory($q['on_table']);
+ $ret = array();
+
+ foreach(get_class_methods($d) as $m) {
+ //var_dump($m);
+ if (!preg_match('/^notify/', $m)) {
+ continue;
+ }
+ $ret[] = array(
+ 'display_name' => preg_replace('/^notify/', '' , $m),
+ 'name' => $q['on_table'] .':'. $m
+ );
+ }
+ $roo->jdata($ret);
+ }
+
/**
*
* Create a watch...
*
*/
+
+
+
function ensureNotify( $ontable, $onid, $person_id, $whereAdd)
{
//DB_DAtaObject::debugLevel(1);