function printGeneral($show_subtitle = true, $allow_edit = true) { if ($show_subtitle) { show_page_subtitle(_T('generic_subtitle_general'), 'cases_intro'); } echo '<ul class="info">'; // TODO: fix html // Author echo '<li>' . '<span class="label2">' . _Ti('case_input_author') . '</span>' . '<span class="value2">' . get_author_link($this->data) . '</span>' . "</li>\n"; // Date start echo '<li>' . '<span class="label2">' . _Ti('time_input_date_start') . '</span>' . '<span class="value2">' . format_date($this->data['date_start']) . '</span>' . "</li>\n"; // Date end echo '<li>' . '<span class="label2">' . _Ti('time_input_date_end') . '</span>' . '<span class="value2">' . format_date($this->data['date_end']) . '</span>' . "</li>\n"; // Date length echo '<li>' . '<span class="label2">' . _Ti('time_input_length') . '</span>' . '<span class="value2">' . format_time_interval_prefs($this->data['length']) . '</span>' . "</li>\n"; // FU type echo '<li>' . '<span class="label2">' . _Ti('fu_input_type') . '</span>' . '<span class="value2">' . _Tkw('followups', $this->data['type']) . '</span>' . "</li>\n"; // Keywords show_all_keywords('followup', $this->getDataInt('id_followup')); // Conclusion for case/status change /* [ML] 2008-01-30 Should not be necessary, done by get_fu_description() if ($this->data['type'] == 'status_change' || $this->data['type'] == 'stage_change') { $tmp = lcm_unserialize($this->data['description']); var_dump($tmp); echo '<li>' . '<span class="label2">' . _Ti('fu_input_conclusion') . '</span>'; echo '<span class="value2">'; if (read_meta('case_result') == 'yes' && $tmp['result']) echo _Tkw('_crimresults', $tmp['result']) . "<br />\n"; echo _Tkw('conclusion', $tmp['conclusion']) . '</span>'; echo "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('fu_input_sentence') . '</li>' . '<span class="value2">' . _Tkw('sentence', $tmp['sentence']) . '</span>' . "</li>\n"; } */ // Description $desc = get_fu_description($this->data, false); echo '<li class="large">' . '<span class="label2">' . _Ti('fu_input_description') . '</span>' . '<span class="value2">' . $desc . '</span>' . "</li>\n"; // Sum billed (if activated from policy) if ($this->show_sum_billed == 'yes') { echo '<li>' . '<span class="label2">' . _T('fu_input_sum_billed') . '</span>' . '<span class="value2">'; echo format_money(clean_output($this->data['sumbilled'])); $currency = read_meta('currency'); echo htmlspecialchars($currency); echo '</span>'; echo "</li>\n"; } echo "</ul>\n"; }
function printGeneral($show_subtitle = true) { if ($show_subtitle) { show_page_subtitle(_T('generic_subtitle_general'), 'clients_intro'); } echo '<ul class="info">'; echo '<li>' . '<span class="label1">' . _Ti('org_input_id') . '</span>' . '<span class="value1">' . $this->getDataInt('id_org') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label1">' . _Ti('org_input_name') . '</span>' . '<span class="value1">' . $this->getDataString('name') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('org_input_court_reg') . '</span>' . '<span class="value2">' . $this->getDataString('court_reg') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('org_input_tax_number') . '</span>' . '<span class="value2">' . $this->getDataString('tax_number') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('org_input_stat_number') . '</span>' . '<span class="value2">' . $this->getDataString('stat_number') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('time_input_date_creation') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_creation'), 'full') . '</span>' . "</li>\n"; show_all_keywords('org', $this->getDataInt('id_org')); echo '<li class="large">' . '<span class="label2">' . _Ti('org_input_notes') . '</span>' . '<span class="value2">' . nl2br($this->getDataString('notes')) . '</span>' . "</li>\n"; echo "</ul>\n"; // Show client contacts (if any) show_all_contacts('org', $this->getDataInt('id_org')); }
function printGeneral($show_subtitle = true) { $meta_citizen_number = read_meta('client_citizen_number'); $meta_civil_status = read_meta('client_civil_status'); $meta_income = read_meta('client_income'); $meta_date_birth = read_meta('client_date_birth'); if ($show_subtitle) { show_page_subtitle(_T('generic_subtitle_general'), 'clients_intro'); } echo '<ul class="info">'; echo '<li>' . '<span class="label1">' . _Ti('client_input_id') . '</span>' . '<span class="value1">' . $this->getDataInt('id_client') . '</span>' . "</li>\n"; echo '<li>' . '<span class="label1">' . _Ti('person_input_name') . '</span>' . '<span class="value1">' . $this->getName() . '</span>' . "</li>\n"; if ($this->data['gender'] == 'male' || $this->getDataString('gender') == 'female') { $gender = _T('person_input_gender_' . $this->getDataString('gender')); } else { $gender = _T('info_not_available'); } if (substr($meta_date_birth, 0, 3) == 'yes') { echo "<li>" . _Ti('person_input_date_birth'); if ($birth = $this->getDataString('data_birth')) { echo format_date($birth) . " (" . _T('person_info_years_old', array('years' => years_diff($this->getDataString('date_birth')))) . ")"; } else { echo _T('info_not_available'); } echo "</li>\n"; } echo '<li>' . '<span class="label1">' . _Ti('person_input_gender') . '</span>' . '<span class="value1">' . $gender . '</span>' . "</li>\n"; if (substr($meta_citizen_number, 0, 3) == 'yes') { echo '<li>' . '<span class="label2">' . _Ti('person_input_citizen_number') . '</span>' . '<span class="value2">' . clean_output($this->getDataString('citizen_number')) . '</span>' . "</li>\n"; } if (substr($meta_civil_status, 0, 3) == 'yes') { // [ML] Patch for bug #1372138 (LCM < 0.6.4) $civil_status = $this->getDataString('civil_status', 'unknown'); echo '<li>' . '<span class="label2">' . _Ti('person_input_civil_status') . '</span>' . '<span class="value2">' . _Tkw('civilstatus', $civil_status) . '</span>' . "</li>\n"; } if (substr($meta_income, 0, 3) == 'yes') { // [ML] Patch for bug #1372138 (LCM < 0.6.4) $income = $this->getDataString('income', 'unknown'); echo '<li>' . '<span class="label2">' . _Ti('person_input_income') . '</span>' . '<span class="value2">' . _Tkw('income', $income) . '</span>' . "</li>\n"; } show_all_keywords('client', $this->getDataInt('id_client')); echo '<li>' . '<span class="label2">' . _Ti('case_input_date_creation') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_creation')) . '</span>' . "</li>\n"; echo '<li class="large">' . '<span class="label2">' . _Ti('client_input_notes') . '</span>' . '<span class="value2">' . nl2br(clean_output($this->getDataString('notes'))) . '</span>' . "</li>\n"; echo "</ul>\n"; // Show client contacts (if any) show_all_contacts('client', $this->getDataInt('id_client')); }
function printGeneral($show_subtitle = true, $allow_edit = true) { // Read site configuration preferences $case_assignment_date = read_meta('case_assignment_date'); $case_alledged_crime = read_meta('case_alledged_crime'); $case_legal_reason = read_meta('case_legal_reason'); if ($show_subtitle) { show_page_subtitle(_T('generic_subtitle_general'), 'cases_intro'); } $add = allowed($this->data['case'], 'w'); $edit = allowed($this->data['case'], 'e'); $admin = allowed($this->data['case'], 'a'); // // Show various stages info // $q = "SELECT * FROM lcm_stage WHERE id_case = " . $this->data['case'] . " ORDER BY date_creation DESC"; $result = lcm_query($q); echo '<div style="float: right; width: 180px;">'; show_page_subtitle(_T('case_subtitle_stage'), 'cases_intro'); echo '<ul>'; while ($row = lcm_fetch_array($result)) { echo '<li>' . format_date($row['date_creation'], 'date_short') . ': <br/>' . _Tkw('stage', $row['kw_case_stage']) . '</li>'; } echo "</ul>\n"; echo "</div>\n"; // // Show case info // echo '<ul class="info">'; // Case ID echo '<li>' . '<span class="label1">' . _Ti('case_input_id') . '</span>' . '<span class="value1">' . show_case_id($this->getDataInt('id_case')) . '</span>' . "</li>\n"; // Case title echo '<li>' . '<span class="label1">' . _Ti('case_input_title') . '</span>' . '<span class="value1">' . $this->getDataString('title') . '</span>' . "</li>\n"; // Show users assigned to the case $q = "SELECT id_case, a.id_author, name_first, name_middle, name_last\n\t\t\t\tFROM lcm_case_author as ca, lcm_author as a\n\t\t\t\tWHERE (id_case=" . $this->getDataInt('id_case') . "\n\t\t\t\t AND ca.id_author = a.id_author)"; $authors_result = lcm_query($q); $cpt = 0; if (lcm_num_rows($authors_result) > 1) { echo '<li>' . '<span class="label2">' . _Ti('case_input_authors') . '</span>'; } else { echo '<li>' . '<span class="label2">' . _Ti('case_input_author') . '</span>'; } while ($author = lcm_fetch_array($authors_result)) { if ($cpt) { echo "; "; } $name = htmlspecialchars(get_person_name($author)); echo '<span class="value2">' . '<a href="author_det.php?author=' . $author['id_author'] . '" class="content_link"' . ' title="' . _T('case_tooltip_view_author_details', array('author' => $name)) . '">' . $name . "</a>" . '</span>'; if ($admin) { echo '<span class="noprint">'; echo ' <a href="edit_auth.php?case=' . $this->getDataInt('id_case') . '&author=' . $author['id_author'] . '"' . ' title="' . _T('case_tooltip_view_access_rights', array('author' => $name)) . '">' . '<img src="images/jimmac/stock_access_rights-16.png" width="16" height="16" border="0" alt="" />' . '</a>'; echo "</span>\n"; } $cpt++; } // [ML] FIXME Double-check if this is OK here in all scenarios if ($admin) { echo '<span class="noprint">'; echo '<a href="sel_auth.php?case=' . $this->getDataInt('id_case') . '" title="' . _T('add_user_case') . '">' . '<img src="images/jimmac/stock_attach-16.png" width="16" height="16" border="0" alt="' . _T('add_user_case') . '" />' . '</a>'; echo "</span>\n"; } echo "</li>\n"; echo '<li>' . '<span class="label2">' . _Ti('case_input_date_creation') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_creation')) . '</span>' . "</li>\n"; if ($case_assignment_date == 'yes') { // [ML] Case is assigned/unassigned when authors are added/remove // + case is auto-assigned when created. if ($this->data['date_assignment']) { echo '<li>' . '<span class="label2">' . _Ti('case_input_date_assigned') . '</span>' . '<span class="value2">' . format_date($this->getDataString('date_assignment')) . '</span>' . "</li>\n"; } } // Total time spent on case (redundant with "reports/times") $query = "SELECT " . lcm_query_sum_time('fu.date_start', 'fu.date_end') . " as time\n\t\t\t\t\tFROM lcm_followup as fu \n\t\t\t\t\tWHERE fu.id_case = " . $this->getDataInt('id_case', '__ASSERT__') . "\n\t\t\t\t\t AND fu.hidden = 'N'"; $result = lcm_query($query); $row_tmp = lcm_fetch_array($result); echo '<li>' . '<span class="label2">' . _Ti('case_input_total_time') . '</span>' . '<span class="value2">' . format_time_interval_prefs($row_tmp['time']) . ' ' . _T('time_info_short_hour') . '</span>' . "</li>\n"; if (substr($case_legal_reason, 0, 3) == 'yes') { echo '<li>' . '<span class="label2">' . _Ti('case_input_legal_reason') . '</span>' . '<span class="value2">' . clean_output($this->getDataString('legal_reason')) . '</span>' . "</li>\n"; } if (substr($case_alledged_crime, 0, 3) == 'yes') { echo '<li>' . '<span class="label2">' . _Ti('case_input_alledged_crime') . '</span>' . '<span class="value2">' . clean_output($this->getDataString('alledged_crime')) . '</span>' . "</li>\n"; } // Keywords show_all_keywords('case', $this->getDataInt('id_case')); if ($this->data['stage']) { // There should always be a stage, but in early versions, < 0.6.0, // it might have been missing, causing a lcm_panic(). $stage = get_kw_from_name('stage', $this->getDataString('stage', '__ASSERT__')); $id_stage = $stage['id_keyword']; show_all_keywords('stage', $this->getDataInt('id_case'), $id_stage); } // Notes echo '<li class="large">' . '<span class="label2">' . _Ti('case_input_notes') . '</span>' . '<span class="value2">' . nl2br($this->getDataString('notes')) . '</span>' . "</li>\n"; // echo "</ul>\n"; // echo "<p class='normal_text'>"; if ($allow_edit && $admin) { // Show case status (if closed, only site admin can re-open) echo '<li>'; echo "<form action='edit_fu.php' method='get'>\n"; echo "<input type='hidden' name='case' value='" . $this->getDataInt('id_case') . "' />\n"; echo _Ti('case_input_status'); echo "<select name='type' class='sel_frm' onchange='lcm_show(\"submit_status\")'>\n"; // in inc/inc_acc.php $statuses = get_possible_case_statuses($this->getDataString('status')); foreach ($statuses as $s => $futype) { $sel = $s == $this->getDataString('status') ? ' selected="selected"' : ''; echo '<option value="' . $futype . '"' . $sel . '>' . _T('case_status_option_' . $s) . "</option>\n"; } echo "</select>\n"; echo "<button type='submit' name='submit' id='submit_status' value='set_status' style='visibility: hidden;' class='simple_form_btn'>" . _T('button_validate') . "</button>\n"; echo "</form>\n"; // Show case stage echo "<form action='edit_fu.php' method='get'>\n"; echo "<input type='hidden' name='case' value='" . $this->getDataInt('id_case') . "' />\n"; echo "<input type='hidden' name='type' value='stage_change' />\n"; echo _Ti('case_input_stage'); echo "<select name='stage' class='sel_frm' onchange='lcm_show(\"submit_stage\")'>\n"; $stage_kws = get_keywords_in_group_name('stage'); foreach ($stage_kws as $kw) { $sel = $kw['name'] == $this->data['stage'] ? ' selected="selected"' : ''; echo "\t\t<option value='" . $kw['name'] . "'" . "{$sel}>" . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo "</select>\n"; echo "<button type='submit' name='submit' id='submit_stage' value='set_stage' style='visibility: hidden;' class='simple_form_btn'>" . _T('button_validate') . "</button>\n"; echo "</form>\n"; echo "</li>\n"; } else { echo '<li>' . _Ti('case_input_status') . _T('case_status_option_' . $this->getDataString('status')) . "</li>\n"; echo '<li>' . _Ti('case_input_stage') . _Tkw('stage', $this->data['stage']) . "</li>\n"; } // If case closed, show conclusion if ($this->data['status'] == 'closed') { // get the last relevant conclusion $q_tmp = "SELECT * \n\t\t\t\tFROM lcm_followup\n\t\t\t\tWHERE id_case = " . $this->getDataInt('id_case') . "\n\t\t\t\tAND (type = 'conclusion'\n\t\t\t\t\t\tOR type = 'stage_change')\n\t\t\t\tORDER BY id_followup DESC \n\t\t\t\tLIMIT 1"; $r_tmp = lcm_query($q_tmp); $row_tmp = lcm_fetch_array($r_tmp); if ($row_tmp) { echo '<li>'; echo '<div style="background: #f0f0f0; padding: 4px; border: 1px solid #aaa;">'; echo _Ti('fu_input_conclusion'); echo get_fu_description($row_tmp, false); echo ' <a class="content_link" href="fu_det.php?followup=' . $row_tmp['id_followup'] . '">...</a>'; echo "</div>\n"; echo "</li>\n"; } } echo '<li>' . _Ti('case_input_collaboration'); echo "<ul style='padding-top: 1px; margin-top: 1px;'>"; echo "<li>" . _Ti('case_input_collaboration_read') . _T('info_' . ($this->getDataInt('public') ? 'yes' : 'no')) . "</li>\n"; echo "<li>" . _Ti('case_input_collaboration_write') . _T('info_' . ($this->getDataInt('pub_write') ? 'yes' : 'no')) . "</li>\n"; echo "</ul>\n"; echo "</li>\n"; echo "</ul>\n"; // clear the right column with stage info echo "<div style='clear: right;'></div>\n"; }