<!-- End of page title and user details -->
<!-- Output errors -->
-{if $errors->yes()}
+{if $err->yes()}
<table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
<tr>
<td class="error">
- {foreach $errors->getErrors() as $error}
+ {foreach $err->getErrors() as $error}
{$error.message}<br> {* No need to escape as they are not coming from user and may contain a link. *}
{/foreach}
</td>
<!-- End of output errors -->
<!-- Output messages -->
-{if $messages->yes()}
+{if $msg->yes()}
<table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
<tr>
<td class="info_message">
- {foreach $messages->getErrors() as $message}
+ {foreach $msg->getErrors() as $message}
{$message.message}<br> {* No need to escape. *}
{/foreach}
</td>
<!-- End of top image -->
<!-- Output errors -->
-{if $errors->yes()}
+{if $err->yes()}
<table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
<tr>
<td class="error">
- {foreach $errors->getErrors() as $error}
+ {foreach $err->getErrors() as $error}
{$error.message}<br> {* No need to escape as they are not coming from user and may contain a link. *}
{/foreach}
</td>
<!-- End of output errors -->
<!-- Output messages -->
-{if $messages->yes()}
+{if $msg->yes()}
<table cellspacing="4" cellpadding="7" width="{$tab_width}" border="0">
<tr>
<td class="info_message">
- {foreach $messages->getErrors() as $message}
+ {foreach $msg->getErrors() as $message}
{$message.message}<br> {* No need to escape. *}
{/foreach}
</td>
$import = new ttImportHelper($err);
$import->importXml();
- if ($err->no())
- $messages->add($i18n->getKey('form.import.success'));
+ if ($err->no()) $msg->add($i18n->getKey('form.import.success'));
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()) );
$request = new ttHttpRequest();
import('form.ActionErrors');
-$err = new ActionErrors();
-$messages = new ActionErrors();
+$err = new ActionErrors(); // Error messages for user.
+$msg = new ActionErrors(); // Notification messages (not errrors) for user.
// Create an instance of ttUser class. This gets us most of user details.
import('ttUser');
// Assign things for smarty to use in template files.
$smarty->assign('i18n', $i18n->keys);
-$smarty->assign('errors', $err);
-$smarty->assign('messages', $messages);
+$smarty->assign('err', $err);
+$smarty->assign('msg', $msg);
// TODO: move this code out of here to the files that use it.
$mailer->setReceiverCC($cl_cc);
$mailer->setSendType(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
- $messages->add($i18n->getKey('form.mail.invoice_sent'));
+ $msg->add($i18n->getKey('form.mail.invoice_sent'));
else
$err->add($i18n->getKey('error.mail_send'));
}
if (($cl_start == $cl_finish) && ($cl_duration == '0:00')) {
$cl_finish = '';
$cl_duration = '';
- $messages->add($i18n->getKey('form.time_edit.uncompleted'));
+ $msg->add($i18n->getKey('form.time_edit.uncompleted'));
}
}
$mailer->setReceiverCC($cl_cc);
$mailer->setSendType(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
- $messages->add($i18n->getKey('form.mail.report_sent'));
+ $msg->add($i18n->getKey('form.mail.report_sent'));
else
$err->add($i18n->getKey('error.mail_send'));
}
if (($cl_start == $cl_finish) && ($cl_duration == '0:00')) {
$cl_finish = '';
$cl_duration = '';
- $messages->add($i18n->getKey('form.time_edit.uncompleted'));
+ $msg->add($i18n->getKey('form.time_edit.uncompleted'));
}
}