3 require_once 'Pman/Roo.php';
5 class Pman_Admin_Report_SendEventErrors extends Pman_Roo
7 static $cli_desc = "Send event errors occured in the last 24 hours";
9 static $cli_opts = array(
11 'desc' => 'group to send to',
18 'desc' => 'list of actions to exclude from report',
28 $ff = HTML_FlexyFramework::get();
37 function get($args, $opts)
42 $this->transObj = DB_DataObject::Factory('core_enum');
44 $this->transObj->query('BEGIN');
46 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
48 if(empty($this->opts['group'])){
49 $this->jerr('Missing group - try add [-t {group name}]');
52 $rcpts = DB_DataObject::factory('groups')->lookupMembers("{$this->opts['group']}",'email');
55 $this->jerr("{$this->opts['group']} does not has any memeber");
58 $events = DB_DataObject::factory('Events');
61 DISTINCT(Events.action) AS action,
62 COUNT(Events.id) AS total
65 $events->whereAdd("Events.event_when > NOW() - INTERVAL 1 DAY");
67 $events->groupBy('Events.action');
68 $events->orderBy('Events.action ASC');
70 print_r($events->fetchAll('action', 'total'));exit;