// if (isset($_SESSION['followup'])) { lcm_page_start(_T('title_fu_edit'), '', '', 'cases_followups'); } else { if (isset($_REQUEST['type'])) { if ($_REQUEST['type'] == 'stage_change') { lcm_page_start(_T('title_fu_change_stage'), '', '', 'cases_intro#stage'); } else { lcm_page_start(_T('title_fu_change_status'), '', '', 'cases_intro#status'); } } else { lcm_page_start(_T('title_fu_new'), '', '', 'cases_followups'); } } show_context_start(); show_context_case_title($case, 'followups'); show_context_case_involving($case); // For 'change status' // FIXME (for edit existing fu?) if ($_REQUEST['submit'] == 'set_status') { show_context_item(_Ti('fu_input_current_status') . _T('case_status_option_' . $row['status'])); } // For 'change stage' if (isset($old_stage) && $old_stage) { show_context_item(_Ti('fu_input_current_stage') . _Tkw('stage', $old_stage)); } // Show stage information [ML] Not very efficient, I know, but I prefer to avoid spagetti if ($_SESSION['form_data']['case_stage']) { // if editing an existing followup.. $stage_info = get_kw_from_name('stage', $_SESSION['form_data']['case_stage']); $id_stage = $stage_info['id_keyword']; show_context_stage($case, $id_stage);
if ($find_org_string) { // XXX add more criteria ? (id, tax num, etc.) // should be centralised with function, i.e. get_sql_find_org($string) $q .= " AND (name LIKE '%{$find_org_string}%')"; } $q .= ")"; // Sort organisations by name $order_name = 'ASC'; if (_request('order_name') == 'ASC' || _request('order_name') == 'DESC') { $order_name = _request('order_name'); } $q .= " ORDER BY name " . $order_name; $result = lcm_query($q); lcm_page_start(_T('title_case_add_org')); show_context_start(); show_context_case_title($case); show_context_case_involving($case); show_context_end(); // Get the number of rows in the result $number_of_rows = lcm_num_rows($result); // Check for correct start position of the list $list_pos = intval(_request('list_pos', 0)); 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)) { die("Error seeking position {$list_pos} in the result"); } }
} // [ML] not clean hack, fix "delete" option if (!empty($_SESSION['errors'])) { if ($_SESSION['form_data']['hidden']) { $_SESSION['form_data']['hidden'] = 'Y'; } } if (_session('id_app', 0) > 0) { lcm_page_start(_T('title_app_edit'), '', '', 'tools_agenda'); } else { lcm_page_start(_T('title_app_new'), '', '', 'tools_agenda'); } if (_session('id_case', 0) > 0) { // Show a bit of background on the case show_context_start(); show_context_case_title(_session('id_case')); show_context_case_involving(_session('id_case')); show_context_end(); } // Show the errors (if any) echo show_all_errors(); // Disable inputs when edit is not allowed for the field $ac = get_ac_app($app, _session('id_case')); $admin = $ac['a']; $write = $ac['w']; $edit = $ac['e']; $dis = $edit ? '' : 'disabled="disabled"'; ?> <form action="upd_app.php" method="post"> <table class="tbl_usr_dtl" width="99%">
function printEdit() { echo '<input type="hidden" name="id_case" value="' . $this->getDataInt('id_case') . '" />' . "\n"; echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n"; // TODO: // Ajouter auteur, etc. // Ajouter "approved by" si id_admin != 0 show_context_start(); show_context_case_title($this->getDataInt('id_case'), 'exps'); show_context_end(); if ($this->getDataInt('id_expense')) { echo "<tr><td>" . _T('expense_input_id') . "</td>\n"; echo "<td>" . $this->getDataInt('id_expense') . '<input type="hidden" name="id_expense" value="' . $this->getDataInt('id_expense') . '" /></td></tr>' . "\n"; } echo '<tr><td>' . f_err_star('description') . _T('expense_input_description') . '</td>' . "\n"; echo '<td><textarea name="description" id="input_expense_description" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('description')) . "</textarea>\n" . "</td>\n"; echo "</tr>\n"; echo '<tr><td>' . f_err_star('type') . _T('expense_input_type') . '</td>' . "\n"; echo '<td>'; echo '<select ' . $dis . ' name="type" size="1" class="sel_frm">' . "\n"; $default_exp = $this->getDataString('type', get_suggest_in_group_name('_exptypes')); $exptype_kws = get_keywords_in_group_name('_exptypes'); foreach ($exptype_kws as $kw) { $sel = isSelected($kw['name'] == $default_exp); if ($sel) { $kw_found = true; } echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo '</td></tr>' . "\n"; echo '<tr><td>' . f_err_star('cost') . _T('expense_input_cost') . '</td>' . "\n"; echo '<td>'; echo '<input type="text" name="cost" value="' . $this->getDataFloat('cost') . '" class="search_form_txt" size="10" />'; echo ' ' . htmlspecialchars(read_meta('currency')); echo "</td></tr>\n"; // Show comment box only if new expense (not edit) if (!$this->getDataInt('id_expense')) { echo "<tr>\n"; echo "<td>" . f_err_star('comment') . _Ti('expense_input_comment') . "</td>\n"; echo '<td><textarea name="comment" id="input_expense_comment" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('comment')) . "</textarea>\n" . "</td>\n"; echo "</tr>\n"; } echo "</table>\n"; }
} else { die("There's no such follow-up!"); } } else { die("Which follow-up?"); } // For 'edit case' button + 'undelete' message $case_allow_modif = read_meta('case_allow_modif'); $edit = allowed($fu_data['id_case'], 'e'); $admin = allowed($fu_data['id_case'], 'a'); lcm_page_start(_T('title_fu_view'), '', '', 'cases_followups'); echo '<fieldset class="info_box">'; // Show a bit of background on the case $case = $fu_data['id_case']; show_context_start(); show_context_case_title($fu_data['id_case']); show_context_case_stage($fu_data['id_case'], $fu_data['id_followup']); show_context_case_involving($fu_data['id_case']); // Show parent appointment, if any // [ML] todo put in inc_presentation $q = "SELECT app.*\n\t\tFROM lcm_app_fu as af, lcm_app as app\n\t\tWHERE af.id_followup = {$followup} \n\t\t AND af.id_app = app.id_app \n\t\t AND af.relation = 'child'"; $res_app = lcm_query($q); if ($app = lcm_fetch_array($res_app)) { echo '<li style="list-style-type: none;">' . _T('fu_input_parent_appointment') . ' '; echo '<a class="content_link" href="app_det.php?app=' . $app['id_app'] . '">' . _Tkw('appointments', $app['type']) . ' (' . $app['title'] . ') from ' . format_date($app['start_time']) . "</a></li>\n"; // TRAD } // Show child appointment, if any $q = "SELECT app.* \n\t\tFROM lcm_app_fu as af, lcm_app as app\n\t\tWHERE af.id_followup = {$followup} \n\t\t AND af.id_app = app.id_app \n\t\t AND af.relation = 'parent'"; $res_app = lcm_query($q); if ($app = lcm_fetch_array($res_app)) {