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',
21 $ff = HTML_FlexyFramework::get();
30 function get($args, $opts)
34 $this->transObj = DB_DataObject::Factory('core_enum');
36 $this->transObj->query('BEGIN');
38 PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($this, 'onPearError'));
40 if(empty($this->opts['group'])){
41 $this->jerr('Missing group - try add [-t {group name}]');
44 $rcpts = DB_DataObject::factory('groups')->lookupMembers("{$this->opts['group']}",'email');
47 $this->jerr("{$this->opts['group']} does not has any memeber");
50 $events = DB_DataObject::factory('Events');
53 DISTINCT(Events.action) AS action,
54 COUNT(Events.id) AS total
57 $events->whereAdd("Events.event_when > NOW() - INTERVAL 1 DAY");
59 $events->groupBy('Events.action');
60 $events->orderBy('Events.action ASC');
62 print_r($events->fetchAll('action', 'total'));exit;