// Prohibit deleting invoiced records.
if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
$errors->add($i18n->getKey('error.period_locked'));
}
- if ($errors->isEmpty()) {
+ if ($errors->no()) {
// Mark the record as deleted.
if (ttExpenseHelper::markDeleted($cl_id, $user->getActiveUser())) {
header('Location: expenses.php');
header('Location: expenses.php');
exit();
}
-}
+} // POST
$form = new Form('expenseItemForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));