$custom_reports = array(); $handle = opendir("inc/config/custom/reports"); while (($f = readdir($handle)) != '') { if (is_file("inc/config/custom/reports/" . $f)) { // matches: custom/reports/alpha-num_name.php if (preg_match("/^([_a-zA-Z0-9]+)\\.php/", $f, $regs)) { $custom_reports[] = $regs[1]; } } } if (count($custom_reports)) { show_page_subtitle("Custom reports", 'reports_custom'); // TRAD echo '<p class="normal_text">'; $headers = array(); $headers[0]['title'] = _Th('rep_input_title'); // $headers[0]['order'] = 'order_ctitle'; // $headers[0]['default'] = 'ASC'; show_list_start($headers); for ($i = 0; $i < $prefs['page_rows'] && $custom_reports[$i]; $i++) { echo "<tr><td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; // TODO: how to extract name of report? // an 'include(report) + $report->get_name() would be overkill.. echo '<a class="content_link" href="edit_rep.php?filecustom=' . $custom_reports[$i] . '">' . $custom_reports[$i] . '</a>'; echo "</td>\n"; echo "</tr>\n"; } show_list_end($list_pos2, $number_of_rows2, 'custom'); echo "</p>\n"; } lcm_page_end();
// Show checkbox echo "<td width='1%' class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo "<input type='checkbox' name='orgs[]' value='" . $row['id_org'] . "'>"; echo "</td>\n"; // Show org name echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo '<a href="org_det.php?org=' . $row['id_org'] . '" class="content_link">'; echo highlight_matches(clean_output($row['name']), $find_org_string); echo "</a>"; echo "</td>\n"; echo "</tr>\n"; } echo "<tr>\n"; echo '<td colspan="2"><p><a href="edit_org.php?attach_case=' . $case . '" class="create_new_lnk">' . _T('org_button_new_for_case') . '</a></p></td>' . "\n"; echo "</tr>\n"; show_list_end($list_pos, $number_of_rows); ?> <input type="hidden" name="case" value="<?php echo $case; ?> "> <input type="hidden" name="ref_sel_org" value="<?php echo $_SERVER['HTTP_REFERER']; ?> "> <p><button name="submit" type="submit" value="submit" class="simple_form_btn"><?php echo _T('button_validate'); ?> </button></p>
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"; } } }
$show_all = false; } elseif ($list_pos == 'all') { $show_all = true; } // Show page of the list for ($i = 0; ($i < $prefs['page_rows'] || $show_all) && ($row = lcm_fetch_array($result)); $i++) { $css = ' class="tbl_cont_' . ($i % 2 ? 'dark' : 'light') . '"'; echo "<tr>\n"; echo "<td {$css}>" . format_date($row['start_time'], 'short') . '</td>'; echo "<td {$css}>" . ($prefs['time_intervals'] == 'absolute' ? format_date($row['end_time'], 'short') : format_time_interval_prefs(strtotime($row['end_time']) - strtotime($row['start_time']))) . '</td>'; echo "<td {$css}>" . _Tkw('appointments', $row['type']) . '</td>'; echo "<td {$css}>" . '<a href="app_det.php?app=' . $row['id_app'] . '" class="content_link">' . $row['title'] . '</a></td>'; echo "<td {$css}>" . format_date($row['reminder'], 'short') . '</td>'; echo "</tr>\n"; } show_list_end($list_pos, $number_of_rows, true); } echo "<p><a href=\"edit_app.php?case={$case}&app=0\" class=\"create_new_lnk\">" . _T('app_button_new') . "</a></p>\n"; echo "</p>\n"; echo "</fieldset>\n"; break; // // Time spent on case by authors // // // Time spent on case by authors // case 'times': // List authors on the case $show_more_times = _request('more_times') ? true : false; $q = "SELECT\n\t\t\t\t\t\ta.id_author, name_first, name_middle, name_last,\n\t\t\t\t\t\tsum(IF(UNIX_TIMESTAMP(fu.date_end) > 0,\n\t\t\t\t\t\t\tUNIX_TIMESTAMP(fu.date_end)-UNIX_TIMESTAMP(fu.date_start), 0)) as time,\n\t\t\t\t\t\tsum(sumbilled) as sumbilled\n\t\t\t\t\tFROM lcm_author as a, lcm_followup as fu\n\t\t\t\t\tWHERE fu.id_author = a.id_author\n\t\t\t\t\t AND fu.id_case = {$case}\n\t\t\t\t\t AND fu.hidden = 'N'\n\t\t\t\t\tGROUP BY fu.id_author";
// Id followup // echo '<td class="tbl_cont_' . $css . '"><img src="images/lcm/dotted_angle.gif" width="15" height="15" align="left" /> ' . $row['id_followup'] . '</td>'; // Start date echo '<td class="tbl_cont_' . $css . '">' . format_date($row['date_start'], 'short') . '</td>'; // Time echo '<td class="tbl_cont_' . $css . '">'; $fu_date_end = vider_date($row['date_end']); if ($prefs['time_intervals'] == 'absolute') { if ($fu_date_end) { echo format_date($row['date_end'], 'short'); } } else { $fu_time = $fu_date_end ? strtotime($row['date_end']) - strtotime($row['date_start']) : 0; echo format_time_interval_prefs($fu_time); } echo '</td>'; // Author initials echo '<td class="tbl_cont_' . $css . '">' . get_person_initials($row) . '</td>'; // Type echo '<td class="tbl_cont_' . $css . '">' . _Tkw('followups', $row['type']) . '</td>'; // Description $short_description = get_fu_description($row); echo '<td class="tbl_cont_' . $css . '">'; echo '<a href="fu_det.php?followup=' . $row['id_followup'] . '" class="content_link">' . $short_description . '</a>'; echo '</td>'; echo "</tr>\n"; } show_list_end($fu_list_pos, $number_of_rows, false, 'fu'); echo "</p>\n"; echo '<p><a href="edit_case.php?case=0" class="create_new_lnk">' . _T('case_button_new') . "</a></p>\n"; lcm_page_end();
function printFollowups($show_filters = false) { $cpt = 0; $my_list_pos = intval(_request('list_pos', 0)); show_page_subtitle(_T('case_subtitle_followups'), 'cases_followups'); // Show filters (if not shown in ajaxed page) if ($show_filters) { // By default, show from "case creation date" to NOW(). $link = new Link(); $link->delVar('date_start_day'); $link->delVar('date_start_month'); $link->delVar('date_start_year'); $link->delVar('date_end_day'); $link->delVar('date_end_month'); $link->delVar('date_end_year'); echo $link->getForm(); $date_end = get_datetime_from_array($_REQUEST, 'date_end', 'end', '0000-00-00 00:00:00'); // date('Y-m-d H:i:s')); $date_start = get_datetime_from_array($_REQUEST, 'date_start', 'start', '0000-00-00 00:00:00'); // $row['date_creation']); echo _Ti('time_input_date_start'); echo get_date_inputs('date_start', $date_start); echo _Ti('time_input_date_end'); echo get_date_inputs('date_end', $date_end); echo ' <button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button>\n"; echo "</form>\n"; echo "<div style='margin-bottom: 4px;'> </div>\n"; // FIXME patch for now (leave small space between filter and list) } show_listfu_start('general', false); for ($cpt = 0, $this->getFollowupStart(); !$this->getFollowupDone(); $cpt++) { $item = $this->getFollowupIterator(); show_listfu_item($item, $cpt); } if (!$cpt) { echo "No followups"; } // TRAD show_list_end($my_list_pos, $this->getFollowupTotal(), true); }
function show_listcase_end($current_pos = 0, $number_of_rows = 0) { show_list_end($current_pos, $number_of_rows); }