X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=invoice_send.php;h=e94e8050fd49a8a211a884f93c831f805c0e40d5;hb=ccf6c015e1f48d747ae697944c3d50e8fccf8080;hp=20c3c187015285a157d43cd76c4a95264a42944c;hpb=926b8d63a0be596b0c95cb55f01addae410af50c;p=timetracker.git diff --git a/invoice_send.php b/invoice_send.php index 20c3c187..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->team; + $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);