X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=invoice_send.php;h=e94e8050fd49a8a211a884f93c831f805c0e40d5;hb=HEAD;hp=ca76f34bbe8cd615830cf56e968cf475d7835231;hpb=95356f167c97ca1a70fc78d91a9dbc7b1d258b31;p=timetracker.git diff --git a/invoice_send.php b/invoice_send.php index ca76f34b..e94e8050 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -29,10 +29,10 @@ require_once('initialize.php'); import('form.Form'); import('ttInvoiceHelper'); -import('ttSysConfig'); +import('ttUserConfig'); // Access checks. -if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_own_invoices'))) { +if (!(ttAccessAllowed('manage_invoices') || ttAccessAllowed('view_client_invoices'))) { header('Location: access_denied.php'); exit(); } @@ -48,7 +48,7 @@ if (!$invoice) { } // End of access checks. -$sc = new ttSysConfig($user->id); +$uc = new ttUserConfig(); if ($request->isPost()) { $cl_receiver = trim($request->getParameter('receiver')); @@ -56,9 +56,9 @@ if ($request->isPost()) { $cl_subject = trim($request->getParameter('subject')); $cl_comment = trim($request->getParameter('comment')); } else { - $cl_receiver = $sc->getValue(SYSC_LAST_INVOICE_EMAIL); - $cl_cc = $sc->getValue(SYSC_LAST_INVOICE_CC); - $cl_subject = $i18n->get('title.invoice').' '.$invoice['name'].', '.$user->group; + $cl_receiver = $uc->getValue(SYSC_LAST_INVOICE_EMAIL); + $cl_cc = $uc->getValue(SYSC_LAST_INVOICE_CC); + $cl_subject = $i18n->get('title.invoice').' '.$invoice['name'].', '.$user->group_name; } $form = new Form('mailForm'); @@ -78,8 +78,8 @@ if ($request->isPost()) { if ($err->no()) { // Save last invoice emails for future use. - $sc->setValue(SYSC_LAST_INVOICE_EMAIL, $cl_receiver); - $sc->setValue(SYSC_LAST_INVOICE_CC, $cl_cc); + $uc->setValue(SYSC_LAST_INVOICE_EMAIL, $cl_receiver); + $uc->setValue(SYSC_LAST_INVOICE_CC, $cl_cc); $body = ttInvoiceHelper::prepareInvoiceBody($cl_invoice_id, $cl_comment);