X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=report_send.php;h=526457bf4eafb2a57a7f80824e22f6e3cd9032c2;hb=19f479eb795f39d331fbfe33ab20534112555630;hp=b420b3aca1bd62c11c8b404e83565afaea01e1af;hpb=fd0872d9e582113346fa1e93557f370286c5c9f2;p=timetracker.git diff --git a/report_send.php b/report_send.php index b420b3ac..526457bf 100644 --- a/report_send.php +++ b/report_send.php @@ -29,16 +29,16 @@ require_once('initialize.php'); import('form.Form'); import('form.ActionForm'); -import('ttSysConfig'); +import('ttUserConfig'); import('ttReportHelper'); // Access check. -if (!ttAccessAllowed('view_own_reports')) { +if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports'))) { header('Location: access_denied.php'); exit(); } -$sc = new ttSysConfig($user->id); +$uc = new ttUserConfig(); if ($request->isPost()) { $cl_receiver = trim($request->getParameter('receiver')); @@ -46,8 +46,8 @@ if ($request->isPost()) { $cl_subject = trim($request->getParameter('subject')); $cl_comment = trim($request->getParameter('comment')); } else { - $cl_receiver = $sc->getValue(SYSC_LAST_REPORT_EMAIL); - $cl_cc = $sc->getValue(SYSC_LAST_REPORT_CC); + $cl_receiver = $uc->getValue(SYSC_LAST_REPORT_EMAIL); + $cl_cc = $uc->getValue(SYSC_LAST_REPORT_CC); $cl_subject = $i18n->get('form.mail.report_subject'); } @@ -67,13 +67,15 @@ if ($request->isPost()) { if ($err->no()) { // Save last report emails for future use. - $sc->setValue(SYSC_LAST_REPORT_EMAIL, $cl_receiver); - $sc->setValue(SYSC_LAST_REPORT_CC, $cl_cc); + $uc->setValue(SYSC_LAST_REPORT_EMAIL, $cl_receiver); + $uc->setValue(SYSC_LAST_REPORT_CC, $cl_cc); // Obtain session bean with report attributes. $bean = new ActionForm('reportBean', new Form('reportForm')); + $options = ttReportHelper::getReportOptions($bean); + // Prepare report body. - $body = ttReportHelper::prepareReportBody($bean, $cl_comment); + $body = ttReportHelper::prepareReportBody($options, $cl_comment); import('mail.Mailer'); $mailer = new Mailer();