- // TODO: improve this, perhaps by refactoring elsewhere.
- $cl_fav_report = (int) $request->getParameter('fav_report');
- $fav_report = ttFavReportHelper::getReport($cl_fav_report);
- if ($user->getUser() != $fav_report['user_id']) {
+ $cl_fav_report_id = (int) $request->getParameter('fav_report');
+ if (!ttFavReportHelper::get($cl_fav_report_id)) {
$form->addInput(array('type'=>'combobox',
'name'=>'fav_report',
'style'=>'width: 250px;',
$form->addInput(array('type'=>'combobox',
'name'=>'fav_report',
'style'=>'width: 250px;',
'data'=>$fav_reports,
'datakeys'=>array('id','name'),
'empty'=>array(''=>$i18n->get('dropdown.select'))
'data'=>$fav_reports,
'datakeys'=>array('id','name'),
'empty'=>array(''=>$i18n->get('dropdown.select'))
if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->get('error.field'), $i18n->get('label.schedule'));
if (!ttValidEmail($cl_email)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
if (!ttValidEmail($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
if (!ttValidCronSpec($cl_cron_spec)) $err->add($i18n->get('error.field'), $i18n->get('label.schedule'));
if (!ttValidEmail($cl_email)) $err->add($i18n->get('error.field'), $i18n->get('label.email'));
if (!ttValidEmail($cl_cc, true)) $err->add($i18n->get('error.field'), $i18n->get('label.cc'));
if (ttNotificationHelper::insert(array(
'cron_spec' => $cl_cron_spec,
'next' => $next,
if (ttNotificationHelper::insert(array(
'cron_spec' => $cl_cron_spec,
'next' => $next,