lcm_page_start(_T('title_expense_new'), '', '', 'expenses'); } /* TODO show_context_start(); show_context_case_title($case, 'followups'); show_context_case_involving($case); */ show_context_end(); // Show the errors (if any) echo show_all_errors(); echo '<form action="upd_exp.php" method="post">' . "\n"; $id_expense = _request('expense', 0); $id_comment = _request('c', 0); $status = _request('new_exp_status'); if ($status || $id_comment || _request('edit_comment')) { $obj_exp = new LcmExpenseInfoUI($id_expense); $obj_exp->printGeneral(false); // with minimal UI (no edit button) show_page_subtitle(_T('expenses_subtitle_comment'), 'expenses_comment'); $obj_comment = new LcmExpenseCommentInfoUI($id_expense, $id_comment); $obj_comment->printEdit(); } else { $obj_exp = new LcmExpenseInfoUI(_request('expense', 0)); $obj_exp->printEdit(); } echo '<button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button>\n"; echo "</form>\n"; lcm_page_end(); // Clear the errors, in case user jumps to other 'edit' page $_SESSION['errors'] = array(); $_SESSION['form_data'] = array();
function printComments($full_ui = true) { $cpt = 0; $my_list_pos = intval(_request('list_pos', 0)); $obj_acc = new LcmExpenseAccess(0, 0, $this); if ($full_ui) { show_page_subtitle(_T('expenses_subtitle_comments'), 'expenses_comments'); } if (!$obj_acc->getRead()) { echo '<p>' . "Access denied. You do not have the permission to view this information." . "</p>\n"; // TRAD (make function!) return; } for ($cpt = 0, $this->getCommentStart(); !$this->getCommentDone(); $cpt++) { $id_comment = $this->getCommentIterator(); $comment = new LcmExpenseCommentInfoUI($this->getDataInt('id_expense'), $id_comment); $comment->printGeneral(); } if (!$cpt) { echo "<p>No comments</p>"; } // TRAD // [ML] FIXME : show_list_end() had the habit of closing tables, // because everthing used to have tables. This is obviously wrong // and will be fixed when other lists are non-taled. echo "<table><tr><td></td></tr>\n"; show_list_end($my_list_pos, $this->getCommentTotal()); if ($full_ui) { if ($obj_acc->getEdit()) { echo '<p><a href="edit_exp.php?edit_comment=1&expense=' . $this->getDataInt('id_expense') . '" class="edit_lnk">' . _T('expense_button_comment') . '</a></p>' . "\n"; } } }