Refactoring - cleaning up whitespace
[timetracker.git] / invoice_send.php
index 1dd2323..18d8db6 100644 (file)
@@ -70,14 +70,14 @@ if ($request->getMethod() == 'POST') {
   if (!ttValidEmailList($cl_cc, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.cc'));
   if (!ttValidString($cl_subject)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.subject'));
   if (!ttValidString($cl_comment, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.comment'));
-  
-  if ($errors->isEmpty()) {
+
+  if ($errors->no()) {
     // Save last invoice emails for future use.
     $sc->setValue(SYSC_LAST_INVOICE_EMAIL, $cl_receiver);
-       $sc->setValue(SYSC_LAST_INVOICE_CC, $cl_cc);
-               
-       $body = ttInvoiceHelper::prepareInvoiceBody($cl_invoice_id, $cl_comment);
-       
+    $sc->setValue(SYSC_LAST_INVOICE_CC, $cl_cc);
+
+    $body = ttInvoiceHelper::prepareInvoiceBody($cl_invoice_id, $cl_comment);
+
     import('mail.Mailer');
     $mailer = new Mailer();
     $mailer->setCharSet(CHARSET);
@@ -92,11 +92,10 @@ if ($request->getMethod() == 'POST') {
     else
       $errors->add($i18n->getKey('error.mail_send'));
   }
-}
+} // POST
 
 $smarty->assign('title', $i18n->getKey('title.send_invoice'));
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"');
 $smarty->assign('content_page_name', 'mail.tpl');
 $smarty->display('index.tpl');
-?>
\ No newline at end of file