-
-/*
- * TODO: remaining fields to fill in...
- `client_id` int(11) default NULL, # client id (if selected)
- `cf_1_option_id` int(11) default NULL, # custom field 1 option id (if selected)
- `project_id` int(11) default NULL, # project id (if selected)
- `task_id` int(11) default NULL, # task id (if selected)
- `billable` tinyint(4) default NULL, # whether to include billable, not billable, or all records
- `invoice` tinyint(4) default NULL, # whether to include invoiced, not invoiced, or all records
- `paid_status` tinyint(4) default NULL, # whether to include paid, not paid, or all records
- `users` text default NULL, # Comma-separated list of user ids. Nothing here means "all" users.
- `period` tinyint(4) default NULL, # selected period type for report
- `period_start` date default NULL, # period start
- `period_end` date default NULL, # period end
- `show_client` tinyint(4) NOT NULL default 0, # whether to show client column
- `show_invoice` tinyint(4) NOT NULL default 0, # whether to show invoice column
- `show_paid` tinyint(4) NOT NULL default 0, # whether to show paid column
- `show_ip` tinyint(4) NOT NULL default 0, # whether to show ip column
- `show_project` tinyint(4) NOT NULL default 0, # whether to show project column
- `show_start` tinyint(4) NOT NULL default 0, # whether to show start field
- `show_duration` tinyint(4) NOT NULL default 0, # whether to show duration field
- `show_cost` tinyint(4) NOT NULL default 0, # whether to show cost field
- `show_task` tinyint(4) NOT NULL default 0, # whether to show task column
- `show_end` tinyint(4) NOT NULL default 0, # whether to show end field
- `show_note` tinyint(4) NOT NULL default 0, # whether to show note column
- `show_custom_field_1` tinyint(4) NOT NULL default 0, # whether to show custom field 1
- `show_work_units` tinyint(4) NOT NULL default 0, # whether to show work units
- `show_totals_only` tinyint(4) NOT NULL default 0, # whether to show totals only
- `group_by` varchar(20) default NULL, # group by field
- `status` tinyint(4) default 1, # favorite report status
- PRIMARY KEY (`id`)
-);
- */
+ $options['cf_1_option_id'] = $bean->getAttribute('option');
+ $options['project_id'] = $bean->getAttribute('project');
+ $options['task_id'] = $bean->getAttribute('task');
+ $options['billable'] = $bean->getAttribute('include_records');
+ $options['invoice'] = $bean->getAttribute('invoice');
+ $options['paid_status'] = $bean->getAttribute('paid_status');
+ if (is_array($bean->getAttribute('users'))) $options['users'] = join(',', $bean->getAttribute('users'));
+ $options['period'] = $bean->getAttribute('period');
+ $options['period_start'] = $bean->getAttribute('start_date');
+ $options['period_end'] = $bean->getAttribute('end_date');
+ $options['show_client'] = $bean->getAttribute('chclient');
+ $options['show_invoice'] = $bean->getAttribute('chinvoice');
+ $options['show_paid'] = $bean->getAttribute('chpaid');
+ $options['show_ip'] = $bean->getAttribute('chip');
+ $options['show_project'] = $bean->getAttribute('chproject');
+ $options['show_start'] = $bean->getAttribute('chstart');
+ $options['show_duration'] = $bean->getAttribute('chduration');
+ $options['show_cost'] = $bean->getAttribute('chcost');
+ $options['show_task'] = $bean->getAttribute('chtask');
+ $options['show_end'] = $bean->getAttribute('chfinish');
+ $options['show_note'] = $bean->getAttribute('chnote');
+ $options['show_custom_field_1'] = $bean->getAttribute('chcf_1');
+ $options['show_work_units'] = $bean->getAttribute('chunits');
+ $options['show_totals_only'] = $bean->getAttribute('chtotalsonly');
+ $options['group_by'] = $bean->getAttribute('group_by');