Пример #1
0
// Start page
//
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'];
Пример #2
0
 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";
 }