$headers[0]['order'] = 'no_order'; $headers[1]['title'] = _Th('person_input_name'); $headers[1]['order'] = 'order_name'; $headers[1]['default'] = 'ASC'; show_list_start($headers); // Process the output of the query for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { echo "<tr>"; // Show checkbox echo "<td width='1%' class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo "<input type='checkbox' name='clients[]' value='" . $row['id_client'] . "'>"; echo "</td>\n"; // Show client name echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo '<a href="client_det.php?client=' . $row['id_client'] . '" class="content_link">'; echo highlight_matches(clean_output($row['name_first'] . ' ' . $row['name_middle'] . ' ' . $row['name_last']), $find_client_string); echo "</a>"; echo "</td>\n"; echo "</tr>\n"; } echo "<tr>\n"; echo '<td colspan="2"><p><a href="edit_client.php?attach_case=' . $case . '" class="create_new_lnk">' . _T('client_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_client" value="<?php
$headers[0]['title'] = ""; $headers[0]['order'] = 'no_order'; $headers[1]['title'] = _Th('org_input_name'); $headers[1]['order'] = 'order_name'; $headers[1]['default'] = 'ASC'; show_list_start($headers); for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { echo "<tr>\n"; // 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
function printList() { global $prefs; // Select cases of which the current user is author $q = "SELECT e.id_expense, e.id_case, e.id_author, e.status, e.type, \n\t\t\t\te.description, e.date_creation, e.date_update, e.pub_read,\n\t\t\t\te.pub_write, a.name_first, a.name_middle, a.name_last,\n\t\t\t\tcount(ec.id_expense) as nb_comments, c.title as case_title\n\t\t\tFROM lcm_expense as e\n\t\t\tLEFT JOIN lcm_expense_comment as ec ON (ec.id_expense = e.id_expense)\n\t\t\tLEFT JOIN lcm_author as a ON (a.id_author = e.id_author) \n\t\t\tLEFT JOIN lcm_case as c ON (c.id_case = e.id_case) "; $q .= " WHERE (1=1 "; if ($this->search) { $q .= " AND ("; if (is_numeric($this->search)) { $q .= " e.id_expense = " . $this->search . " OR "; } $q .= " e.description LIKE '%" . $this->search . "%' "; $q .= " )"; } if ($this->id_case) { $q .= " AND e.id_case = " . $this->id_case; } $q .= ")"; // // Apply filters to SQL // // Case owner TODO // $q .= " AND " . $q_owner; // Period (date_creation) to show if ($prefs['case_period'] < 1900) { // since X days // $q .= " AND TO_DAYS(NOW()) - TO_DAYS(date_creation) < " . $prefs['case_period']; $q .= " AND " . lcm_query_subst_time('e.date_creation', 'NOW()') . ' < ' . $prefs['case_period'] * 3600 * 24; } else { // for year X $q .= " AND " . lcm_query_trunc_field('e.date_creation', 'year') . ' = ' . $prefs['case_period']; } $q .= " GROUP BY e.id_expense, e.id_case, e.id_author, e.status, e.type, e.description, e.date_creation, e.date_update, e.pub_read, e.pub_write, a.name_first, a.name_middle, a.name_last, c.title "; // // Sort // $sort_clauses = array(); $sort_allow = array('ASC' => 1, 'DESC' => 1); // Sort by request type if ($sort_allow[_request('type_order')]) { $sort_clauses[] = "type " . _request('type_order'); } if ($sort_allow[_request('status_order')]) { $sort_clauses[] = "status " . _request('status_order'); } // Sort cases by creation or update date if ($sort_allow[_request('date_order')]) { $sort_clauses[] = "date_creation " . _request('date_order'); } elseif ($sort_allow[_request('upddate_order')]) { $sort_clauses[] = "date_update " . _request('upddate_order'); } if (count($sort_clauses)) { $q .= " ORDER BY " . implode(', ', $sort_clauses); } else { $q .= " ORDER BY date_creation DESC"; } // default sort $result = lcm_query($q); // Check for correct start position of the list $this->number_of_rows = lcm_num_rows($result); if ($this->list_pos >= $this->number_of_rows) { $this->list_pos = 0; } // Position to the page info start if ($this->list_pos > 0) { if (!lcm_data_seek($result, $this->list_pos)) { lcm_panic("Error seeking position " . $this->list_pos . " in the result"); } } for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { $css = $i % 2 ? "dark" : "light"; echo "<tr>\n"; // Expense ID echo "<td class='tbl_cont_" . $css . "'>"; echo highlight_matches($row['id_expense'], $this->search); echo "</td>\n"; // Author echo "<td class='tbl_cont_" . $css . "'>"; echo get_person_initials($row); echo "</td>\n"; // Attached to case.. echo "<td class='tbl_cont_" . $css . "'>"; if ($row['id_case']) { echo '<abbr title="' . $row['case_title'] . '">' . $row['id_case'] . '</a>'; } echo "</td>\n"; // Date creation echo "<td class='tbl_cont_" . $css . "'>"; echo format_date($row['date_creation'], 'short'); echo "</td>\n"; // Type echo "<td class='tbl_cont_" . $css . "'>"; echo _Tkw('_exptypes', $row['type']); echo "</td>\n"; // Description global $fu_desc_len; // configure via my_options.php with $GLOBALS['fu_desc_len'] = NNN; $more_desc = _request('more_desc', 0); $desc_length = isset($fu_desc_len) && $fu_desc_len > 0 ? $fu_desc_len : 256; $description = $row['description']; if ($more_desc || strlen(lcm_utf8_decode($row['description'])) < $desc_length) { $description = $row['description']; } else { $description = substr($row['description'], 0, $desc_length) . '...'; } echo "<td class='tbl_cont_" . $css . "'>"; echo '<a class="content_link" href="exp_det.php?expense=' . $row['id_expense'] . '">'; echo nl2br(highlight_matches($description, $this->search)); echo "</a>"; echo "</td>\n"; // # Comments echo "<td class='tbl_cont_" . $css . "'>"; echo $row['nb_comments']; echo "</td>\n"; // Date update echo "<td class='tbl_cont_" . $css . "'>"; if ($row['date_update'] != $row['date_creation']) { echo format_date($row['date_update'], 'short'); } echo "</td>\n"; // Status echo "<td class='tbl_cont_" . $css . "'>"; echo _T('expense_status_option_' . $row['status']); echo "</td>\n"; echo "</tr>\n"; } }
die("Error seeking position {$list_pos} in the result"); } } $headers = array(); $headers[0]['title'] = _Th('person_input_name'); $headers[0]['order'] = 'order_title'; $headers[0]['default'] = 'ASC'; show_list_start($headers); // Process the output of the query for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { // Show report title echo "<tr><td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; if (true) { echo '<a href="rep_det.php?rep=' . $row['id_report'] . '" class="content_link">'; } echo highlight_matches(clean_output(remove_number_prefix($row['title'])), $find_rep_string); if (true) { echo '</a>'; } echo "</td>\n"; echo "</tr>\n"; } show_list_end($list_pos, $number_of_rows); echo '<p><a href="edit_rep.php?rep=0" class="create_new_lnk">' . _T('rep_button_new') . "</a></p>\n"; // // Custom reports (plugins) // $custom_reports = array(); $handle = opendir("inc/config/custom/reports"); while (($f = readdir($handle)) != '') { if (is_file("inc/config/custom/reports/" . $f)) {
if ($list_pos >= $number_of_rows) { $list_pos = 0; } // Position to the page info start if ($list_pos > 0) { if (!lcm_data_seek($result, $list_pos)) { lcm_panic("Error seeking position {$list_pos} in the result"); } } // Output table tags show_listclient_start(); for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { echo "<tr>\n"; echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">' . $row['id_client'] . "</td>\n"; echo '<td class="tbl_cont_' . ($i % 2 ? "dark" : "light") . '">'; echo '<a href="client_det.php?client=' . $row['id_client'] . '" class="content_link">'; $fullname = clean_output(get_person_name($row)); echo highlight_matches($fullname, $find_client_string); echo "</a>\n"; echo "</td>\n"; echo "</tr>\n"; } show_listclient_end($list_pos, $number_of_rows); ?> <p><a href="edit_client.php" class="create_new_lnk"><?php echo _T('client_button_new'); ?> </a></p> <br /><br /> <?php lcm_page_end();
lcm_panic("Error seeking position {$list_pos} in the result"); } } $headers = array(); $headers[0]['title'] = _Th('person_input_name'); $headers[0]['order'] = 'order_name_first'; $headers[0]['default'] = 'ASC'; $headers[1]['title'] = _Th('authoredit_input_status'); $headers[1]['order'] = 'order_status'; $headers[1]['default'] = ''; show_list_start($headers); // Process the output of the query for ($i = 0; $i < $prefs['page_rows'] && ($row = lcm_fetch_array($result)); $i++) { // Author name echo "<tr>\n"; echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo '<a href="author_det.php?author=' . $row['id_author'] . '" class="content_link">'; echo highlight_matches(get_person_name($row), $find_author_string); echo "</a></td>\n"; // Author status echo "<td class='tbl_cont_" . ($i % 2 ? "dark" : "light") . "'>"; echo _T('authoredit_input_status_' . $row['status']); echo "</td>\n"; echo "</tr>\n"; } show_list_end($list_pos, $number_of_rows); // New author button if ($GLOBALS['author_session']['status'] == 'admin') { echo '<p><a href="edit_author.php?author=0" class="create_new_lnk">' . _T('authoredit_button_new') . "</a></p>\n"; } lcm_page_end();
<a style="font-size: 10px;" href="javascript:void(0);" onclick="insertEntityLink(<?php echo $ae->Entity->id; ?> , <?php echo $article['id']; ?> );">link</a> <?php echo entity_link($ae->Entity, null, true, null, array('target' => '_blank')); ?> <?php if ($excerpt = excerpt_matches($article->getCleanerBody(), array($ae['original_name']))) { ?> (<?php echo highlight_matches($excerpt, array($ae['original_name'])); ?> ) <?php } ?> <br /> <?php } ?> <br /> <?php echo submit_tag('Save', 'class=button_small'); ?> </form>
<?php if (isset($search)) { ?> <?php $terms = explode(' ', str_replace('*', '', $search)); ?> <em><?php echo highlight_matches($entity['blurb'], $terms); ?> </em> <?php if ($summary = excerpt_matches($entity['summary'], $terms)) { ?> <div class="search-summary"><?php echo highlight_matches($summary, $terms); ?> </div> <?php } ?> <?php } else { ?> <em><?php echo $entity['blurb']; ?> </em> <?php } ?>
function show_listcase_item($item, $cpt, $find_case_string = '', $url = '__DEFAULT__', $url_extra = '') { include_lcm('inc_acc'); $ac_read = allowed($item['id_case'], 'r'); $ac_edit = allowed($item['id_case'], 'e'); $css = $cpt % 2 ? "dark" : "light"; if ($url == '__DEFAULT__') { $url = 'case_det.php?case=' . $item['id_case']; } echo "<tr>\n"; // Case ID echo "<td class='tbl_cont_" . $css . "'>"; echo highlight_matches(show_case_id($item['id_case']), $find_case_string); echo "</td>\n"; // Date creation echo "<td class='tbl_cont_" . $css . "'>"; echo format_date($item['date_creation'], 'date_short'); echo "</td>\n"; // Title echo "<td class='tbl_cont_" . $css . "'>"; if ($ac_read) { echo '<a href="' . $url . '" class="content_link" ' . $url_extra . '>'; } echo highlight_matches(clean_output($item['title']), $find_case_string); if (allowed($item['id_case'], 'r')) { echo '</a>'; } echo "</td>\n"; // Status echo "<td class='tbl_cont_" . $css . "'>"; if ($item['status']) { echo _T('case_status_option_' . $item['status']); } echo "</td>\n"; echo "</tr>\n"; }