function install_step_1() { install_html_start('AUTO', '', 1); echo "<h3><small>" . _T('install_step_one') . "</small> " . _T('install_title_sql_connection') . "</h3>\n"; echo show_all_errors($_SESSION['errors']); echo "<p class='simple_text'>" . _T('install_info_sql_connection') . " " . lcm_help("install_database") . "</p>\n"; $db_address = _session('db_address', 'localhost'); $db_login = _session('db_login'); $db_password = _session('db_password'); $db_choice = _session('db_choice'); // Fetch the previous configuration data to make things easier (if possible) $lcm_config_prefix = isset($_SERVER['LcmConfigDir']) ? $_SERVER['LcmConfigDir'] : 'inc/config'; if (@file_exists($lcm_config_prefix . '/inc_connect_install.php')) { $s = @join('', @file($lcm_config_prefix . '/inc_connect_install.php')); if (ereg("mysql_connect\\([\"'](.*)[\"'],[\"'](.*)[\"'],[\"'](.*)[\"']\\)", $s, $regs)) { $db_address = $regs[1]; $db_login = $regs[2]; } else { if (ereg("lcm_connect_db\\('(.*)','(.*)','(.*)','(.*)','(.*)'\\)", $s, $regs)) { $db_address = $regs[1]; if ($port_db = $regs[2]) { $db_address .= ':' . $port_db; } $db_login = $regs[3]; } } } echo "<form action='install.php' method='post'>\n"; echo "<input type='hidden' name='step' value='2' />\n"; echo "<fieldset class='fs_box'>\n"; echo "<div><label for='db_address'><strong>" . f_err_star('address') . _T('install_database_address') . "</strong></label></div>\n"; echo "<input type='text' id='db_address' name='db_address' value=\"{$db_address}\" size='40' class='txt_lmnt' />\n"; echo "<br />\n"; echo "<br />\n"; echo "<div><label for='db_login'><strong>" . f_err_star('login') . _T('install_connection_login') . "</strong></label></div>\n"; echo "<input type='text' id='db_login' name='db_login' value=\"{$db_login}\" size='40' class='txt_lmnt' />\n"; echo "<br />\n"; echo "<br />\n"; echo "<div><label for='db_password'><strong>" . f_err_star('password') . _T('install_connection_password') . "</strong></label></div>\n"; echo "<input type='password' id='db_password' name='db_password' value=\"{$db_password}\" size='40' class='txt_lmnt' />\n"; // Afaik, there is no way to get a list of databases in PgSQL // without logging in first, and to login, you must provide DBname if (preg_match("/^PostgreSQL/", lcm_sql_server_info())) { echo "<br />\n"; echo "<br />\n"; echo "<div><label for='db_choice'><strong>" . f_err_star('dbname') . "Database name" . "</strong></label></div>\n"; // TRAD echo "<input type='text' id='db_choice' name='db_choice' value=\"{$db_choice}\" size='40' class='txt_lmnt' />\n"; } echo "</fieldset>\n"; echo "<div align='" . $GLOBALS['lcm_lang_right'] . "'>" . "<button type='submit' name='Next'>" . _T('button_next') . " >></button> " . "</div>\n"; echo "</form>\n"; install_html_end(); }
$interval = ( ($_SESSION['form_data']['end_time']!='0000-00-00 00:00:00') ? strtotime($_SESSION['form_data']['start_time']) - strtotime($_SESSION['form_data']['reminder']) : 0); echo get_time_interval_inputs($name, $interval); echo " " . _T('time_info_before_start'); echo f_err_star('reminder'); echo "</td>\n"; } echo "</tr>\n"; */ ?> <!-- Appointment title --> <tr><td valign="top"><?php echo f_err_star('title') . _T('app_input_title'); ?> </td> <td><input type="text" <?php echo $title_onfocus . $dis; ?> name="title" size="50" value="<?php echo clean_output($_SESSION['form_data']['title']) . "\" /></td></tr>\n"; ?> <!-- Appointment type --> <tr><td><?php echo _T('app_input_type'); ?> </td> <td><select <?php
function printEdit() { $id_comment = $this->getDataInt('id_comment', 0); echo '<input type="hidden" name="edit_comment" value="1" />' . "\n"; echo '<input type="hidden" name="id_expense" value="' . $this->getDataInt('id_expense') . '" />' . "\n"; if ($id_comment) { echo "<!-- id_comment = {$id_comment} -->\n"; echo '<input type="hidden" name="id_comment" value="' . $id_comment . '" />' . "\n"; } echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n"; echo '<tr>'; 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"; }
function printEdit() { // Get site preferences $client_name_middle = read_meta('client_name_middle'); $client_citizen_number = read_meta('client_citizen_number'); $client_civil_status = read_meta('client_civil_status'); $client_income = read_meta('client_income'); $meta_date_birth = read_meta('client_date_birth'); echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n"; if ($this->getDataInt('id_client')) { echo "<tr><td>" . _T('client_input_id') . "</td>\n"; echo "<td>" . $this->getDataInt('id_client') . '<input type="hidden" name="id_client" value="' . $this->getDataInt('id_client') . '" /></td></tr>' . "\n"; } // Client name echo '<tr><td>' . f_err_star('name_first') . _T('person_input_name_first') . '</td>' . "\n"; echo '<td><input name="name_first" value="' . clean_output($this->getDataString('name_first')) . '" class="search_form_txt" /></td></tr>' . "\n"; // [ML] always show middle name, if any, no matter the configuration if ($this->getDataString('name_middle') || substr($client_name_middle, 0, 3) == 'yes') { echo '<tr><td>' . f_err_star('name_middle') . _T('person_input_name_middle') . '</td>' . "\n"; echo '<td><input name="name_middle" value="' . clean_output($this->getDataString('name_middle')) . '" class="search_form_txt" /></td></tr>' . "\n"; } echo '<tr><td>' . f_err_star('name_last') . _T('person_input_name_last') . '</td>' . "\n"; echo '<td><input name="name_last" value="' . clean_output($this->getDataString('name_last')) . '" class="search_form_txt" /></td></tr>' . "\n"; if (substr($meta_date_birth, 0, 3) == 'yes') { echo "<tr>\n"; echo "<td>" . f_err_star('date_birth') . _Ti('person_input_date_birth') . "</td>\n"; echo "<td>" . get_date_inputs('date_birth', $this->getDataString('date_birth'), true) . "</td>\n"; echo "</tr>\n"; } echo '<tr><td>' . f_err_star('gender') . _T('person_input_gender') . '</td>' . "\n"; echo '<td><select name="gender" class="sel_frm">' . "\n"; $opt_sel_male = $opt_sel_female = $opt_sel_unknown = ''; if ($this->getDataString('gender') == 'male') { $opt_sel_male = 'selected="selected" '; } else { if ($this->getDataString('gender') == 'female') { $opt_sel_female = 'selected="selected" '; } else { $opt_sel_unknown = 'selected="selected" '; } } echo '<option ' . $opt_sel_unknown . 'value="unknown">' . _T('info_not_available') . "</option>\n"; echo '<option ' . $opt_sel_male . 'value="male">' . _T('person_input_gender_male') . "</option>\n"; echo '<option ' . $opt_sel_female . 'value="female">' . _T('person_input_gender_female') . "</option>\n"; echo "</select>\n"; echo "</td></tr>\n"; if ($this->getDataString('id_client')) { echo "<tr>\n"; echo '<td>' . _Ti('time_input_date_creation') . '</td>'; echo '<td>' . format_date($this->getDataString('date_creation'), 'full') . '</td>'; echo "</tr>\n"; } if (substr($client_citizen_number, 0, 3) == 'yes') { echo "<tr>\n"; echo '<td>' . f_err_star('citizen_number') . _T('person_input_citizen_number') . '</td>'; echo '<td><input name="citizen_number" value="' . clean_output($this->getDataString('citizen_number')) . '" class="search_form_txt" /></td>'; echo "</tr>\n"; } if (substr($client_civil_status, 0, 3) == 'yes') { echo "<tr>\n"; echo '<td>' . f_err_star('civil_status') . _Ti('person_input_civil_status') . '</td>'; echo '<td>'; echo '<select name="civil_status">'; if (!$this->getDataInt('id_client')) { echo '<option value=""></option>'; } $kwg = get_kwg_from_name('civilstatus'); $all_kw = get_keywords_in_group_name('civilstatus'); // A bit overkill, but if the user made the error of not entering // a valid civil_status, make sure that the field stays empty if (!$this->getDataString('civil_status') || !count($_SESSION['errors'])) { if ($this->getDataInt('id_client')) { $this->data['civil_status'] = $all_kw['unknown']['name']; } else { $this->data['civil_status'] = $kwg['suggest']; } } foreach ($all_kw as $kw) { $sel = $this->getDataString('civil_status') == $kw['name'] ? ' selected="selected"' : ''; echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T($kw['title']) . '</option>'; } echo '</select>'; echo '</td>'; echo "</tr>\n"; } if (substr($client_income, 0, 3) == 'yes') { echo "<tr>\n"; echo '<td>' . f_err_star('income') . _Ti('person_input_income') . '</td>'; echo '<td>'; echo '<select name="income">'; if (!$this->getDataInt('id_client')) { echo '<option value=""></option>'; } $kwg = get_kwg_from_name('income'); $all_kw = get_keywords_in_group_name('income'); if (!$this->getDataString('income') && !count($_SESSION['errors'])) { if ($this->getDataInt('id_client')) { $this->data['income'] = $all_kw['unknown']['name']; } else { $this->data['income'] = $kwg['suggest']; } } foreach ($all_kw as $kw) { $sel = $this->getDataString('income') == $kw['name'] ? ' selected="selected"' : ''; echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T($kw['title']) . '</option>'; } echo '</select>'; echo '</td>'; echo "</tr>\n"; } // // Keywords, if any // show_edit_keywords_form('client', $this->getDataInt('id_client')); // Notes echo "<tr>\n"; echo "<td>" . f_err_star('client_notes') . _Ti('client_input_notes') . "</td>\n"; echo '<td><textarea name="client_notes" id="input_client_notes" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('notes')) . "</textarea>\n" . "</td>\n"; echo "</tr>\n"; // // Contacts (e-mail, phones, etc.) // echo "<tr>\n"; echo '<td colspan="2" align="center" valign="middle">'; show_page_subtitle(_T('client_subtitle_contacts')); echo '</td>'; echo "</tr>\n"; show_edit_contacts_form('client', $this->getDataInt('id_client')); echo "</table>\n"; }
function printEdit() { global $prefs; $admin = allowed($this->getDataInt('id_case'), 'a'); // FIXME $edit = allowed($this->getDataInt('id_case'), 'e'); // FIXME $write = allowed($this->getDataInt('id_case'), 'w'); // FIXME (put in constructor) // FIXME: not sure whether this works as previously $dis = isDisabled(!($admin || $edit)); echo '<table class="tbl_usr_dtl" width="99%">' . "\n"; echo '<tr><td>'; echo f_err_star('date_start') . _T('fu_input_date_start'); echo "</td>\n"; echo "<td>"; $name = $admin || $edit ? 'start' : ''; echo get_date_inputs($name, $this->data['date_start'], false); echo ' ' . _T('time_input_time_at') . ' '; echo get_time_inputs($name, $this->data['date_start']); echo "</td>\n"; echo "</tr>\n"; echo "<tr><td>"; echo f_err_star('date_end') . ($prefs['time_intervals'] == 'absolute' ? _T('fu_input_date_end') : _T('fu_input_time_length')); echo "</td>\n"; echo '<td>'; if ($prefs['time_intervals'] == 'absolute') { // Buggy code, so isolated most important cases if ($this->data['id_followup'] == 0) { $name = 'end'; } elseif ($edit) { $name = 'end'; } else { // user can 'finish' entering data $name = $admin || $edit && $this->data['date_end'] == '0000-00-00 00:00:00' ? 'end' : ''; } echo get_date_inputs($name, $this->data['date_end']); echo ' '; echo _T('time_input_time_at') . ' '; echo get_time_inputs($name, $this->data['date_end']); } else { $name = ''; // Buggy code, so isolated most important cases if ($this->getDataInt('id_followup') == 0) { $name = 'delta'; } elseif ($edit) { $name = 'delta'; } else { // user can 'finish' entering data $name = $admin || $edit && $this->getDataString('date_end') == '0000-00-00 00:00:00' ? 'delta' : ''; } if (empty($_SESSION['errors'])) { $interval = $this->getDataString('date_end') != '0000-00-00 00:00:00' ? strtotime($this->getDataString('date_end')) - strtotime($this->getDataString('date_start')) : 0; echo get_time_interval_inputs($name, $interval); } else { echo get_time_interval_inputs_from_array($name, $this->data); } } echo "</td>\n"; echo "</tr>\n"; // Show 'conclusion' options if ($this->show_conclusion) { $kws_conclusion = get_keywords_in_group_name('conclusion'); $kws_result = get_keywords_in_group_name('_crimresults'); echo "<tr>\n"; echo "<td>" . _Ti('fu_input_conclusion') . "</td>\n"; echo '<td>'; // Result if (read_meta('case_result') == 'yes') { echo '<select ' . $dis . ' name="result" size="1" class="sel_frm">' . "\n"; $default = ''; if ($this->data['result']) { $default = $this->data['result']; } foreach ($kws_result as $kw) { $sel = isSelected($kw['name'] == $default); echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo "</select><br/>\n"; } // Conclusion echo '<select ' . $dis . ' name="conclusion" size="1" class="sel_frm">' . "\n"; $default = ''; if ($this->data['conclusion']) { $default = $this->data['conclusion']; } foreach ($kws_conclusion as $kw) { $sel = isSelected($kw['name'] == $default); echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo "</select>\n"; echo "</td>\n"; echo "</tr>\n"; // If guilty, what sentence? $kws_sentence = get_keywords_in_group_name('sentence'); echo "<tr>\n"; echo "<td>" . _Ti('fu_input_sentence') . "</td>\n"; echo '<td>'; echo '<select ' . $dis . ' name="sentence" size="1" class="sel_frm">' . "\n"; $default = ''; if ($this->data['sentence']) { $default = $this->data['sentence']; } echo "<!-- " . $default . " -->\n"; foreach ($kws_sentence as $kw) { $sel = $kw['name'] == $default ? ' selected="selected"' : ''; echo '<option ' . $sel . ' value="' . $kw['name'] . '">' . _T(remove_number_prefix($kw['title']), array('currency' => read_meta('currency'))) . "</option>\n"; } echo "</select>\n"; // If sentence, for how much? echo '<input type="text" name="sentence_val" size="10" value="' . $this->data['sentence_val'] . '" />'; echo "</td>\n"; echo "</tr>\n"; } if (_request('submit') == 'set_status' || is_status_change($this->getDataString('type'))) { // Change status echo "<tr>\n"; echo "<td>" . _T('case_input_status') . "</td>\n"; echo "<td>"; echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n"; echo _T('kw_followups_' . $this->data['type'] . '_title'); echo "</td>\n"; echo "</tr>\n"; } elseif (_request('submit') == 'set_stage' || $this->getDataString('type') == 'stage_change') { // Change stage echo "<tr>\n"; echo "<td>" . _T('fu_input_next_stage') . "</td>\n"; echo "<td>"; echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n"; // This is to compensate an old bug, when 'case stage' was not stored in fu.description // and therefore editing a follow-up would not give correct information. // Bug was in CVS of 0.4.3 between 19-20 April 2005. Should not affect many people. if ($s = $this->getDataString('new_stage')) { echo '<input type="hidden" name="new_stage" value="' . $s . '" />' . "\n"; echo _Tkw('stage', $s); } else { echo "New stage information not available"; } echo "</td>\n"; echo "</tr>\n"; if ($s = $this->getDataString('new_stage')) { // Update stage keywords (if any) $stage = get_kw_from_name('stage', $s); $id_stage = $stage['id_keyword']; show_edit_keywords_form('stage', $this->data['id_case'], $id_stage); } } elseif ($this->getDataString('type') == 'assignment' || $this->getDataString('type') == 'unassignment') { // Do not allow assignment/un-assignment follow-ups to be changed echo "<tr>\n"; echo "<td>" . _T('fu_input_next_stage') . "</td>\n"; echo "<td>"; echo '<input type="hidden" name="type" value="' . $this->getDataString('type') . '" />' . "\n"; echo _Tkw('followups', $this->getDataString('type')); echo "</td>\n"; echo "</tr>\n"; } else { // The usual follow-up echo "<tr>\n"; echo "<td>" . _T('fu_input_type') . "</td>\n"; echo "<td>"; echo '<select ' . $dis . ' name="type" size="1" class="sel_frm">' . "\n"; $default_fu = get_suggest_in_group_name('followups'); $futype_kws = get_keywords_in_group_name('followups'); $kw_found = false; foreach ($futype_kws as $kw) { $sel = isSelected($kw['name'] == $default_fu); if ($sel) { $kw_found = true; } echo '<option value="' . $kw['name'] . '"' . $sel . '>' . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } // Exotic case where the FU keyword was hidden by the administrator, // but an old follow-up using that keyword is being edited. if (!$kw_found) { echo '<option selected="selected" value="' . $default_fu . '">' . _Tkw('followups', $default_fu) . "</option>\n"; } echo "</select>\n"; echo "</td>\n"; echo "</tr>\n"; } // Keywords (if any) show_edit_keywords_form('followup', $this->getDataInt('id_followup')); // Description echo "<tr>\n"; echo '<td valign="top">' . f_err_star('description') . _T('fu_input_description') . "</td>\n"; echo '<td>'; if ($this->getDataString('type') == 'assignment' || $this->getDataString('type') == 'unassignment') { // Do not allow edit of assignment echo '<input type="hidden" name="description" value="' . $this->getDataString('description') . '" />' . "\n"; echo get_fu_description($this->data); } else { echo '<textarea ' . $dis . ' name="description" rows="15" cols="60" class="frm_tarea">'; echo clean_output($this->getDataString('description')); echo "</textarea>"; } echo "</td></tr>\n"; // Sum billed field if ($this->show_sum_billed == "yes") { echo '<tr>'; echo '<td>' . _T('fu_input_sum_billed') . "</td>\n"; echo '<td>'; echo '<input ' . $dis . ' name="sumbilled" ' . 'value="' . clean_output($this->getDataString('sumbilled')) . '" ' . 'class="search_form_txt" size="10" />'; // [ML] If we do this we may as well make a function // out of it, but not sure where to place it :-) // This code is also in config_site.php $currency = read_meta('currency'); if (empty($currency)) { $current_lang = $GLOBALS['lang']; $GLOBALS['lang'] = read_meta('default_language'); $currency = _T('currency_default_format'); $GLOBALS['lang'] = $current_lang; } echo htmlspecialchars($currency); echo "</td></tr>\n"; } echo "</table>\n\n"; // XXX FIXME: Should probably be in some function "is_system_fu" // or even "is_deletable" if ($this->getDataInt('id_followup') && allowed($this->data['id_case'], 'a') && !(is_status_change($this->data['type']) || $this->data['type'] == 'assignment' || $this->data['type'] == 'unassignment')) { $checked = $this->getDataString('hidden') == 'Y' ? ' checked="checked" ' : ''; echo '<p class="normal_text">'; echo '<input type="checkbox"' . $checked . ' name="delete" id="box_delete" />'; echo '<label for="box_delete">' . _T('fu_info_delete') . '</label>'; echo "</p>\n"; } // Add followup appointment if (!_request('followup')) { echo "<!-- Add appointment? -->\n"; echo '<p class="normal_text">'; echo '<input type="checkbox" name="add_appointment" id="box_new_app" onclick="display_block(\'new_app\', \'flip\')" />'; echo '<label for="box_new_app">' . _T('fu_info_add_future_activity') . '</label>'; echo "</p>\n"; echo '<div id="new_app" style="display: none;">'; echo '<table class="tbl_usr_dtl" width="99%">' . "\n"; echo "<!-- Start time -->\n\t\t<tr><td>"; echo _T('time_input_date_start'); echo "</td><td>"; echo get_date_inputs('app_start', $this->data['app_start_time'], false); echo ' ' . _T('time_input_time_at') . ' '; echo get_time_inputs('app_start', $this->data['app_start_time']); echo f_err_star('app_start_time'); echo "</td></tr>\n"; echo "<!-- End time -->\n\t\t<tr><td>"; echo $prefs['time_intervals'] == 'absolute' ? _T('time_input_date_end') : _T('app_input_time_length'); echo "</td><td>"; if ($prefs['time_intervals'] == 'absolute') { echo get_date_inputs('app_end', $this->data['app_end_time']); echo ' ' . _T('time_input_time_at') . ' '; echo get_time_inputs('app_end', $this->data['app_end_time']); echo f_err_star('app_end_time'); } else { $interval = $this->data['app_end_time'] != '0000-00-00 00:00:00' ? strtotime($this->data['app_end_time']) - strtotime($this->data['app_start_time']) : 0; // echo _T('calendar_info_time') . ' '; echo get_time_interval_inputs('app_delta', $interval); echo f_err_star('app_end_time'); } echo "</td></tr>\n"; /* [ML] Removing, not useful for now echo "<!-- Reminder -->\n\t\t<tr><td>"; echo (($prefs['time_intervals'] == 'absolute') ? _T('app_input_reminder_time') : _T('app_input_reminder_offset')); echo "</td><td>"; if ($prefs['time_intervals'] == 'absolute') { echo get_date_inputs('app_reminder', $this->data['app_reminder']); echo ' ' . _T('time_input_time_at') . ' '; echo get_time_inputs('app_reminder', $this->data['app_reminder']); echo f_err_star('app_reminder'); } else { $interval = ( ($this->data['app_end_time']!='0000-00-00 00:00:00') ? strtotime($this->data['app_start_time']) - strtotime($this->data['app_reminder']) : 0); // echo _T('calendar_info_time') . ' '; echo get_time_interval_inputs('app_rem_offset', $interval); echo " " . _T('time_info_before_start'); echo f_err_star('app_reminder'); } echo "</td></tr>\n"; */ // TODO: [ML] a bit of testing to see if this survives an error on new case // I suspect it doesn't.. echo "<!-- Appointment title -->\n\t\t<tr><td>"; echo f_err_star('app_title') . _T('app_input_title'); echo "</td><td>"; echo '<input type="text" ' . $dis . ' name="app_title" size="50" value="'; echo clean_output($this->getDataString('app_title')) . '" class="search_form_txt" />'; echo "</td></tr>\n"; echo "<!-- Appointment type -->\n\t\t<tr><td>"; echo _T('app_input_type'); echo "</td><td>"; echo '<select ' . $dis . ' name="app_type" size="1" class="sel_frm">'; global $system_kwg; if ($_SESSION['fu_app_data']['type']) { $default_app = $_SESSION['fu_app_data']['type']; } else { $app_kwg = get_kwg_from_name('appointments'); $default_app = $app_kwg['suggest']; } $opts = array(); foreach ($system_kwg['appointments']['keywords'] as $kw) { $opts[$kw['name']] = _T(remove_number_prefix($kw['title'])); } asort($opts); foreach ($opts as $k => $opt) { $sel = isSelected($k == $default_app); echo "<option value='{$k}'{$sel}>{$opt}</option>\n"; } echo '</select>'; echo "</td></tr>\n"; echo "<!-- Appointment description -->\n"; echo "<tr><td valign=\"top\">"; echo _T('app_input_description'); echo "</td><td>"; echo '<textarea ' . $dis . ' name="app_description" rows="5" cols="60" class="frm_tarea">'; echo clean_output($this->getDataString('app_description')); echo '</textarea>'; echo "</td></tr>\n"; echo "</table>\n"; echo "</div>\n"; } }
echo "This report will use the custom report in '" . $_SESSION['form_data']['filecustom'] . "'"; } // TRAD echo ": " . $rep_specs->getDescription() . "</p>\n"; } echo "<fieldset class=\"info_box\">\n"; echo "<form action='upd_rep.php' method='post'>\n"; if ($_SESSION['form_data']['filecustom']) { echo '<input type="hidden" name="filecustom" value="' . $_SESSION['form_data']['filecustom'] . '" />' . "\n"; } if ($_SESSION['form_data']['id_report']) { echo "<strong>" . _Ti('rep_input_id') . "</strong> " . $_SESSION['form_data']['id_report'] . "\n\t\t<input type=\"hidden\" name=\"id_report\" value=\"" . $_SESSION['form_data']['id_report'] . "\">\n"; // [ML] echo " | \n"; } // Title of report echo "<p>" . f_err_star('title') . "<strong>" . _Ti('rep_input_title') . "</strong><br />"; echo '<input name="title" value="' . clean_output($_SESSION['form_data']['title']) . '" class="search_form_txt"></p>' . "\n"; // Description echo '<p>' . "<strong>" . _Ti('rep_input_description') . "</strong><br />\n"; echo '<textarea name="description" rows="5" cols="40" class="frm_tarea">'; echo $_SESSION['form_data']['description']; echo "</textarea></p>\n"; // Notes echo '<p>' . "<strong>" . _Ti('rep_input_notes') . "</strong><br />\n"; echo '<textarea name="notes" rows="5" cols="40" class="frm_tarea">'; echo $_SESSION['form_data']['notes']; echo "</textarea></p>\n"; // if ($admin || !read_meta('case_read_always') || !read_meta('case_write_always')) { // echo "\t<tr><td>" . _T('public') . "</td> // <td> // <table>
function show_new_contact($num_new, $type_person, $ctype = "__add__", $exceptions = array()) { $all_contact_types = get_kwg_all('contact'); // There may be a config error, or admin removed all contact types if (!count($all_contact_types)) { return; } echo "<tr>\n"; // Contact type (either specific or 'Add contact') echo '<td align="left" valign="top">' . f_err_star('new_contact_' . $num_new); if ($ctype == "__add__") { echo _Ti('generic_input_contact_other'); } else { $c = get_kwg_from_name($ctype); echo f_err_star('contact_' . $c['name']); echo _Ti(remove_number_prefix($c['title'])); echo $c['policy'] != 'optional' ? '<br/>(' . _T('keywords_input_policy_' . $c['policy']) . ')' : ''; } echo '</td>'; echo '<td align="left" valign="top">'; // Avoids that the values in these fields get lost when there is an error after submitting the form $value = ''; $type = ''; if (isset($_SESSION['form_data']['new_contact_type_name'][$num_new])) { $type = $_SESSION['form_data']['new_contact_type_name'][$num_new]; } if (isset($_SESSION['form_data']['new_contact_value'][$num_new])) { $value = $_SESSION['form_data']['new_contact_value'][$num_new]; } if ($ctype == "__add__") { echo "<div>\n"; echo '<select name="new_contact_type_name[]" id="new_contact_type_' . $num_new . '" class="sel_frm">' . "\n"; echo "<option value=''>" . " ... " . "</option>\n"; foreach ($all_contact_types as $contact) { if (!($contact['quantity'] == 'one' && isset($exceptions[$contact['name']]) && $type != $contact['name'])) { $sel = isSelected($type == $contact['name']); echo "<option value='" . $contact['name'] . "' {$sel}>" . _T($contact['title']) . "</option>\n"; } } echo "</select>\n"; echo "</div>\n"; echo "<div>\n"; echo '<input type="text" size="40" name="new_contact_value[]" id="new_contact_value_' . $num_new . '" '; echo ' value="' . $value . '" '; echo 'class="search_form_txt" />' . "\n"; echo "</div>\n"; } else { echo '<input name="new_contact_type_name[]" id="new_contact_type_name_' . $num_new . '" ' . 'type="hidden" value="' . $ctype . '" />' . "\n"; echo '<input name="new_contact_value[]" id="new_contact_value_' . $num_new . '" type="text" ' . 'class="search_form_txt" size="35" value="' . $value . '"/> '; } echo "</td>\n"; echo "</tr>\n"; }
function printEdit() { echo '<table width="99%" border="0" align="center" cellpadding="5" cellspacing="0" class="tbl_usr_dtl">' . "\n"; // Organisation ID if ($this->getDataInt('id_org')) { echo "<tr>\n"; echo "<td>" . _Ti('org_input_id') . "</td>\n"; echo "<td>" . $this->getDataInt('id_org') . '<input type="hidden" name="id_org" value="' . $this->getDataInt('id_org') . '" />' . "</td>\n"; echo "</tr>\n"; } // Organisation name echo "<tr>\n"; echo "<td>" . f_err_star('name') . _Ti('org_input_name') . "</td>\n"; echo '<td><input name="name" value="' . clean_output($this->getDataString('name')) . '" class="search_form_txt" />' . "</td>\n"; echo "</tr>\n"; // Court registration number echo "<tr>\n"; echo "<td>" . f_err_star('court_reg') . _Ti('org_input_court_reg') . "</td>\n"; echo '<td><input name="court_reg" value="' . clean_output($this->getDataString('court_reg')) . '" class="search_form_txt" />' . "</td>\n"; echo "</tr>\n"; // Tax number echo "<tr>\n"; echo "<td>" . f_err_star('tax_number') . _Ti('org_input_tax_number') . "</td>\n"; echo '<td><input name="tax_number" value="' . clean_output($this->getDataString('tax_number')) . '" class="search_form_txt" />' . "</td>\n"; echo "</tr>\n"; // Statistical number echo "<tr>\n"; echo "<td>" . f_err_star('stat_number') . _Ti('org_input_stat_number') . "</td>\n"; echo '<td><input name="stat_number" value="' . clean_output($this->getDataString('stat_number')) . '" class="search_form_txt" />' . "</td>\n"; echo "</tr>\n"; // Creation date if ($this->getDataInt('id_org')) { echo "<tr>\n"; echo '<td>' . _Ti('time_input_date_creation') . '</td>'; echo '<td>' . format_date($this->getDataString('date_creation'), 'full') . '</td>'; echo "</tr>\n"; } // // Keywords, if any // show_edit_keywords_form('org', $this->getDataInt('id_org')); // Notes echo "<tr>\n"; echo "<td>" . f_err_star('notes') . _Ti('org_input_notes') . "</td>\n"; echo '<td><textarea name="notes" id="input_notes" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('notes')) . "</textarea>\n" . "</td>\n"; echo "</tr>\n"; // // Contacts (e-mail, phones, etc.) // echo "<tr>\n"; echo '<td colspan="2" align="center" valign="middle">'; show_page_subtitle(_T('client_subtitle_contacts')); echo '</td>'; echo "</tr>\n"; show_edit_contacts_form('org', $this->getDataInt('id_org')); echo "</table>\n"; }
function print_registration_form() { install_html_start(_T('pass_title_register'), 'login'); $link = new Link(); $url = $link->getUrl(); echo '<p align="left" class="normal_text">' . _T('pass_info_why_register') . "</p>\n"; echo show_all_errors(); echo "<form method='post' action='{$url}' style='border: 0px; margin: 0px;'>\n"; echo '<input type="hidden" name="register" value="data" />' . "\n"; echo "<fieldset><label><b>" . _T('info_your_contact_information') . "</b><br></label>\n"; // [ML] Altough not most problematic, could be better. But if someone // fixes here, please fix install.php also (step 4) echo "<table border='0'>\n"; echo "<tr>\n"; echo "<td>\n\t\t\t<label for='name_first'>" . f_err_star('name_first') . _Ti('person_input_name_first') . "</label><br />\n\t\t\t<input type='text' style='width: 100%;' id='name_first' name='name_first' class='formo' value='" . _session('name_first') . "' size='20'>\n\t\t</td>\n"; echo "<td>\n\t\t\t<label for='name_last'>" . f_err_star('name_last') . _Ti('person_input_name_last') . "</label><br />\n\t\t\t<input type='text' style='width: 100%;' id='name_last' name='name_last' class='formo' value='" . _session('name_last') . "' size='20'>\n\t\t</td>\n"; echo "</tr>\n"; echo "<tr>\n"; echo "<td colspan='2'>"; echo "<p><label for='email'>" . f_err_star('email') . _Ti('input_email') . "</label><br />"; echo "<input type='text' id='email' name='email' class='formo' value='" . _session('email') . "' size='40'></p>\n"; echo "<p><label for='username'>" . f_err_star('username') . _Ti('authoredit_input_username') . "</label> "; echo "<small>" . _T('info_more_than_three') . "</small><br />"; echo "<input type='text' id='username' name='username' class='formo' value='" . _session('username') . "' size='40'></p>\n"; echo "<small>" . _T('pass_info_password_by_mail') . "</small>\n"; echo "</fieldset>\n"; echo "<p align=\"right\">"; echo '<button type="submit" name="Validate">' . _T('button_validate') . "</button>"; echo "</p>"; echo "</form>\n"; $_SESSION['form_data'] = array(); $_SESSION['errors'] = array(); }
function show_edit_keywords_form($type_obj, $id_obj, $id_obj_sec = 0) { include_lcm('inc_access'); if (!$GLOBALS['legal_obj'][$type_obj]) { lcm_panic("Invalid object type requested"); } if ($id_obj) { // // Show current keywords (already attached to object) // $current_kws = get_keywords_applied_to($type_obj, $id_obj, $id_obj_sec); $cpt = 0; foreach ($current_kws as $kw) { $kwg = get_kwg_from_id($kw['id_group']); $show_kw_value = false; echo "<tr>\n"; echo "<td>" . "<label for=\"kw_value_{$type_obj}{$cpt}\">" . f_err_star('kwg' . $kwg['id_group']) . _Ti(remove_number_prefix($kwg['title'])) . "</label>" . "<br />(" . _T('keywords_input_policy_' . $kwg['policy']) . ")" . "</td>\n"; echo "<td>"; $kw_for_kwg = get_keywords_in_group_id($kwg['id_group']); if (count($kw_for_kwg)) { echo '<input type="hidden" name="kwg_id_' . $type_obj . '[]" value="' . $kwg['id_group'] . '" />' . "\n"; echo '<input type="hidden" name="kw_entry_' . $type_obj . '[]" value="' . $kw['id_entry'] . '" />' . "\n"; echo '<select id="kw_value_' . $type_obj . $cpt . '" name="kw_value_' . $type_obj . '[]">'; echo '<option value="">' . '' . "</option>\n"; foreach ($kw_for_kwg as $kw1) { if ($kw1['hasvalue'] == 'Y') { $show_kw_value = true; } $sel = ''; if (isset($_SESSION['form_data']['kw_value_' . $type_obj][$cpt]) && $_SESSION['form_data']['kw_value_' . $type_obj][$cpt] == $kw1['id_keyword']) { $sel = ' selected="selected" '; } elseif ($kw1['id_keyword'] == $kw['id_keyword']) { $sel = ' selected="selected" '; } echo '<option value="' . $kw1['id_keyword'] . '"' . $sel . '>' . _T(remove_number_prefix($kw1['title'])) . "</option>\n"; } echo "</select>\n"; } // Check if keyword policy = mandatory, and quantity = one $kwg = get_kwg_from_id($kw['id_group']); if (!($kwg['policy'] == 'mandatory' && $kwg['quantity'] == 'one')) { echo '<label for="kw_del_' . $type_obj . $cpt . '">' . '<img src="images/jimmac/stock_trash-16.png" width="16" height="16" alt="Delete?" title="Delete?" />' . '</label> <input type="checkbox" id="kw_del_' . $type_obj . $cpt . '" name="kw_del_' . $type_obj . $cpt . '"/>'; } if ($show_kw_value) { // Use value if submitted with the form, else use previous one if (isset($_SESSION['form_data']['kw_entryval_' . $type_obj . $cpt])) { $tmp_value = $_SESSION['form_data']['kw_entryval_' . $type_obj . $cpt]; } else { $tmp_value = $kw['value']; } echo "<br />\n"; echo '<input type="text" name="kw_entryval_' . $type_obj . $cpt . '" ' . 'value="' . $tmp_value . '" />' . "\n"; } echo "</td>\n"; echo "</tr>\n"; $cpt++; } } // // New keywords // $kwg_for_case = get_kwg_applicable_for($type_obj, $id_obj, $id_obj_sec); $cpt_kw = 0; foreach ($kwg_for_case as $kwg) { echo "<tr>\n"; echo '<td><label for="new_keyword_' . $type_obj . $cpt_kw . '">' . f_err_star('keyword_' . $type_obj . $cpt_kw) . f_err_star('kwg' . $kwg['id_group']) . _Ti(remove_number_prefix($kwg['title'])) . '</label>' . "<br />(" . _T('keywords_input_policy_' . $kwg['policy']) . ")</td>\n"; echo "<td>"; $kw_for_kwg = get_keywords_in_group_id($kwg['id_group']); if (count($kw_for_kwg)) { $obj_id_ajax = 'kw_' . create_random_password(15, time()); echo '<input type="hidden" name="new_kwg_' . $type_obj . '_id[]" value="' . $kwg['id_group'] . '" />' . "\n"; echo '<select id="new_keyword_' . $type_obj . $cpt_kw . '" ' . 'name="new_keyword_' . $type_obj . '_value[]" ' . "onchange=\"getKeywordInfo('get_kwg_in','" . $kwg['name'] . "', '{$type_obj}', {$id_obj}, 0, '{$obj_id_ajax}')\"" . '>'; echo '<option value="">' . '' . "</option>\n"; $show_kw_value = false; foreach ($kw_for_kwg as $kw) { if ($kw['hasvalue'] == 'Y') { $show_kw_value = true; } // For default value, use the form_data (if present), else use suggested keyword $sel = ''; if (isset($_SESSION['form_data']['new_keyword_' . $type_obj . '_value'][$cpt_kw]) && $_SESSION['form_data']['new_keyword_' . $type_obj . '_value'][$cpt_kw] == $kw['id_keyword']) { $sel = ' selected="selected" '; } elseif ($kwg['suggest'] == $kw['name']) { $sel = ' selected="selected" '; } // $sel = ($kwg['suggest'] == $kw['name'] ? ' selected="selected" ' : ''); echo '<option ' . $sel . ' value="' . $kw['id_keyword'] . '">' . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo "</select>\n"; if ($show_kw_value) { $tmp_value = ''; if (isset($_SESSION['form_data']['new_kw_entryval_' . $type_obj . $cpt_kw])) { $tmp_value = $_SESSION['form_data']['new_kw_entryval_' . $type_obj . $cpt_kw]; } echo "<br />\n"; echo '<input type="text" name="new_kw_entryval_' . $type_obj . $cpt_kw . '" ' . 'value="' . $tmp_value . '" />' . "\n"; } echo '<div id="' . $obj_id_ajax . '"></div>' . "\n"; } else { // // Sub-keyword group(s), since no top-level keywords // $sub_kwgs = get_subgroups_in_group_id($kwg['id_group']); if (count($sub_kwgs)) { echo '<input type="hidden" name="nop_kwg_' . $type_obj . '_id[]" value="' . $kwg['id_group'] . '" />' . "\n"; $obj_id_ajax = 'kw_' . create_random_password(15, time()); $sel_id = 'nop_kwg_' . $type_obj . $cpt_kw; $sel_name = 'nop_keyword_' . $type_obj . '_value[]'; echo "<select id=\"{$sel_id}\" name=\"{$sel_name}\" " . "onchange=\"getKeywordInfo('get_kwg_in', this.value, '{$type_obj}', {$id_obj}, 0, '{$obj_id_ajax}')\"" . '>'; echo '<option value="">' . '' . "</option>\n"; foreach ($sub_kwgs as $sg) { echo '<option value="' . $sg['name'] . '">' . _T(remove_number_prefix($sg['title'])) . "</option>\n"; } echo "</select>\n"; echo '<div id="' . $obj_id_ajax . '"></div>' . "\n"; } echo '<div id="keywords_in_group_data' . $kwg['id_group'] . '"></div>' . "\n"; } echo "</td>\n"; echo "</tr>\n"; $cpt_kw++; } }
function printEdit() { // 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'); $case_allow_modif = read_meta('case_allow_modif'); echo '<table class="tbl_usr_dtl">' . "\n"; // Case ID (if editing existing case) if ($this->getDataInt('id_case')) { echo "<tr>" . "<td>" . _T('case_input_id') . "</td>" . "<td>" . $this->getDataInt('id_case') . '<input type="hidden" name="id_case" value="' . $this->getDataInt('id_case') . '" />' . "</td></tr>\n"; } echo '<tr><td><label for="input_case_title">' . f_err_star('title') . _T('case_input_title') . "</label></td>\n"; echo '<td><input size="35" name="title" id="input_case_title" value="' . clean_output($this->getDataString('title')) . '" class="search_form_txt" />'; echo "</td></tr>\n"; // Date of earlier assignment if ($case_assignment_date == 'yes') { echo "<tr>\n"; echo "<td>" . f_err_star('date_assignment') . _Ti('case_input_date_assigned') . "</td>\n"; echo "<td>" . get_date_inputs('assignment', $this->getDataString('date_assignment'), false) . "</td>\n"; echo "</tr>\n"; } // Legal reason if (substr($case_legal_reason, 0, 3) == 'yes') { echo '<tr><td><label for="input_legal_reason">' . f_err_star('legal_reason') . _T('case_input_legal_reason') . "</label>" . ($case_legal_reason == 'yes_mandatory' ? '<br/>(' . _T('keywords_input_policy_mandatory') . ')' : '') . "</td>\n"; echo '<td>'; echo '<textarea name="legal_reason" id="input_legal_reason" class="frm_tarea" rows="2" cols="60">'; echo clean_output($this->getDataString('legal_reason')); echo "</textarea>"; echo "</td>\n"; echo "</tr>\n"; } // Alledged crime if (substr($case_alledged_crime, 0, 3) == 'yes') { echo '<tr><td><label for="input_alledged_crime">' . f_err_star('alledged_crime') . _T('case_input_alledged_crime') . "</label>" . ($case_alledged_crime == 'yes_mandatory' ? '<br/>(' . _T('keywords_input_policy_mandatory') . ')' : '') . "</td>\n"; echo '<td>'; echo '<textarea name="alledged_crime" id="input_alledged_crime" class="frm_tarea" rows="2" cols="60">'; echo clean_output($this->getDataString('alledged_crime')); echo '</textarea>'; echo "</td>\n"; echo "</tr>\n"; } // Keywords (if any) show_edit_keywords_form('case', $this->getDataInt('id_case')); $id_stage = 0; // new case, stage not yet known if ($this->getDataString('stage')) { $stage = get_kw_from_name('stage', $this->getDataString('stage', '__ASSERT__')); $id_stage = $stage['id_keyword']; } show_edit_keywords_form('stage', $this->getDataInt('id_case'), $id_stage); // Notes echo "<tr>\n"; echo "<td><label for='input_case_notes'>" . f_err_star('case_notes') . _Ti('case_input_notes') . "</label></td>\n"; echo '<td><textarea name="case_notes" id="input_case_notes" class="frm_tarea" rows="3" cols="60">' . clean_output($this->getDataString('notes')) . "</textarea>\n" . "</td>\n"; echo "</tr>\n"; // Case status echo '<tr><td><label for="input_status">' . f_err_star('status') . _Ti('case_input_status') . "</label></td>\n"; echo '<td>'; echo '<select name="status" id="input_status" class="sel_frm">' . "\n"; $statuses = $this->getDataInt('id_case') ? array('draft', 'open', 'suspended', 'closed', 'merged') : array('draft', 'open'); foreach ($statuses as $s) { $sel = $s == $this->getDataString('status') ? ' selected="selected"' : ''; echo '<option value="' . $s . '"' . $sel . ">" . _T('case_status_option_' . $s) . "</option>\n"; } echo "</select></td>\n"; echo "</tr>\n"; // Case stage if (!$this->getDataString('stage')) { $this->data['stage'] = get_suggest_in_group_name('stage'); } $kws = get_keywords_in_group_name('stage'); echo '<tr><td><label for="input_stage">' . f_err_star('stage') . _T('case_input_stage') . "</label></td>\n"; echo '<td><select name="stage" id="input_stage" class="sel_frm">' . "\n"; foreach ($kws as $kw) { $sel = $kw['name'] == $this->data['stage'] ? ' selected="selected"' : ''; echo "\t\t\t\t<option value='" . $kw['name'] . "'" . "{$sel}>" . _T(remove_number_prefix($kw['title'])) . "</option>\n"; } echo "</select></td>\n"; echo "</tr>\n"; // Public access rights // FIXME FIXME FIXME if ($this->data['admin'] || read_meta('case_read_always') != 'yes' || read_meta('case_write_always') != 'yes') { $dis = isDisabled(!allowed($this->getDataInt('id_case'), 'a')); echo '<tr><td colspan="2">' . _T('case_input_collaboration') . ' <br /><ul>'; if (read_meta('case_read_always') != 'yes' || $GLOBALS['author_session']['status'] == 'admin') { echo '<li style="list-style-type: none;">'; echo '<input type="checkbox" name="public" id="case_public_read" value="yes"'; if ($_SESSION['form_data']['public']) { echo ' checked="checked"'; } echo "{$dis} />"; echo '<label for="case_public_read">' . _T('case_input_collaboration_read') . "</label></li>\n"; } if (read_meta('case_write_always') != 'yes' || _session('admin')) { echo '<li style="list-style-type: none;">'; echo '<input type="checkbox" name="pub_write" id="case_public_write" value="yes"'; if (_session('pub_write')) { echo ' checked="checked"'; } echo "{$dis} />"; echo '<label for="case_public_write">' . _T('case_input_collaboration_write') . "</label></li>\n"; } echo "</ul>\n"; echo "</td>\n"; echo "</tr>\n"; } echo "</table>\n"; }
function show_keyword_id($id_keyword = 0) { if (!$id_keyword) { if (!intval($_REQUEST['id_group']) > 0) { lcm_panic("missing valid id_group for new keyword"); } $kwg = get_kwg_from_id($_REQUEST['id_group']); // Suggest a keyword name: kwgnameNN, where NN = numeric sequence $all_kws = get_keywords_in_group_name($kwg['name'], false); $cpt = sprintf("%02d", count($all_kws) + 1); while (get_kw_from_name($kwg['name'], $kwg['name'] . $cpt)) { $cpt = sprintf("%02d", ++$cpt); } $kw['name'] = $kwg['name'] . $cpt; $kw['title'] = ''; $kw['description'] = ''; $kw['id_group'] = $kwg['id_group']; $kw['ac_author'] = 'Y'; $kw['hasvalue'] = 'N'; $kw['type'] = $kwg['type']; lcm_page_start(_T('title_keyword_new')); } else { $kw = get_kw_from_id($id_keyword); $kwg = get_kwg_from_id($kw['id_group']); lcm_page_start(_T('title_keyword_edit')); } echo show_all_errors($_SESSION['errors']); if (!$id_keyword) { echo "<ul style=\"padding-left: 0.5em; padding-top: 0.2; padding-bottom: 0.2; font-size: 12px;\">\n"; echo '<li style="list-style-type: none;">' . _T('keywords_input_for_group') . " " . '<a class="content_link" href="keywords.php?action=edit_group&id_group=' . $kwg['id_group'] . '">' . _T($kwg['title']) . "</a></li>\n"; echo "</ul>\n"; } echo '<fieldset class="info_box">'; echo '<form action="keywords.php" method="post">' . "\n"; echo '<input type="hidden" name="action" value="update_keyword" />' . "\n"; echo '<input type="hidden" name="id_keyword" value="' . $id_keyword . '" />' . "\n"; echo '<input type="hidden" name="id_group" value="' . $kw['id_group'] . '" />' . "\n"; // for new keyword only // Name (only for new keywords, must be unique and cannot be changed) echo "<strong>" . f_err_star('name') . _T('keywords_input_name') . "</strong> " . "(short identifier, unique to this keyword group)" . "<br />\n"; // TRAD $disabled = isDisabled($id_keyword); echo '<input ' . $disabled . ' type="text" id="kw_name" name="kw_name" size="45" value="' . $kw['name'] . '" class="search_form_txt" />' . "\n"; echo "<br /><br />\n"; // Title echo "<strong>" . f_err_star('title') . _T('keywords_input_title') . "</strong><br />\n"; echo "<input type='text' id='kw_title' name='kw_title' size='45' value='" . $kw['title'] . "' class='search_form_txt' />\n"; echo "<br /><br />\n"; // Description echo "<strong>" . _T('keywords_input_description') . "</strong><br />\n"; echo "<textarea id='kw_desc' name='kw_desc' rows='2' cols='45' wrap='soft' class='frm_tarea'>"; echo $kw['description']; echo "</textarea>\n"; // Ac_author echo '<ul class="info">'; echo '<li>' . _T('keywords_info_kw_ac_author') . ' ' . get_yes_no('kw_ac_author', $kw['ac_author']) . "</li>\n"; if (!$id_keyword || $id_keyword && $kwg['type'] != 'system') { echo '<li>' . "Does the keyword have a specific value?" . ' ' . get_yes_no('kw_hasvalue', $kw['hasvalue']) . "</li>\n"; } echo '<button name="submit" type="submit" value="submit" class="simple_form_btn">' . _T('button_validate') . "</button>\n"; echo "</form>\n"; echo '</fieldset>'; // destroy error messages $_SESSION['errors'] = array(); lcm_page_end(); exit; }
function show_report_field_edit($type, $rep_info) { $src_type = $rep_info[$type . '_src_type']; $src_name = $rep_info[$type . '_src_name']; if ($src_type == 'table' && $src_name && !preg_match('/^lcm_/', $src_name)) { $src_name = 'lcm_' . $src_name; } // Extract source type, if any if ($src_type && $src_name) { if ($src_type == 'keyword') { $kwg = get_kwg_from_name($src_name); echo '<p class="normal_text">' . _Ti('rep_info_source_' . $src_type) . " (" . _T('rep_info_table_lcm_' . $kwg['type']) . ") " . _T(remove_number_prefix($kwg['title'])); } else { echo "<p class='normal_text'>" . _Ti('rep_info_source_' . $src_type) . _T('rep_info_table_' . $src_name); } // Show list of fields for line/col, if any $my_id = $type == 'col' ? 'id_column' : 'id_line'; $my_fields = array(); $query = "SELECT " . $my_id . ", f.id_field, f.description \n\t\t\tFROM lcm_rep_" . $type . " as rl, lcm_fields as f\n\t\t\tWHERE id_report = " . $rep_info['id_report'] . "\n\t\t\tAND rl.id_field = f.id_field\n\t\t\tORDER BY col_order, " . $my_id . " ASC"; $result_fields = lcm_query($query); if (lcm_num_rows($result_fields)) { echo "</p>\n"; echo "<table border='0' class='tbl_usr_dtl' width='99%'>\n"; while ($field = lcm_fetch_array($result_fields)) { echo "<tr>\n"; echo "<td>" . _Th($field['description']) . "</td>\n"; echo "<td><a href='upd_rep_field.php?rep=" . $rep_info['id_report'] . "&" . "remove=" . $type . "&" . $my_id . "=" . $field[$my_id] . "' class='content_link'>" . "X" . "</a></td>\n"; // ACCESSIBILITY echo "</tr>\n"; array_push($my_fields, $field['id_field']); } echo "</table>\n"; } else { if (!$rep_info['filecustom']) { // Allow to change the source table echo ' <a href="upd_rep_field.php?rep=' . $rep_info['id_report'] . '&unselect_' . $type . '=1" class="content_link">' . "X" . '</a>'; // TRAD ACCESSIBILITY echo "</p>\n"; } } // Add field (if line_src_type == table) // TODO: add 'not in (...existing fields..) $query = "SELECT *\n\t\t\tFROM lcm_fields\n\t\t\tWHERE table_name = '" . $src_name . "'"; $result = lcm_query($query); if (lcm_num_rows($result)) { echo "\n<br />\n\n"; echo "<form action='upd_rep_field.php' name='frm_" . $type . "_additem' method='get'>\n"; echo "<input name='rep' value='" . $rep_info['id_report'] . "' type='hidden' />\n"; echo "<input name='add' value='" . $type . "' type='hidden' />\n"; echo "<table border='0' class='tbl_usr_dtl' width='99%'>\n"; echo "<tr>\n"; echo "<th class='heading'>" . _Ti('rep_input_item_add') . "</th>\n"; echo "<td>\n"; echo "<select name='id_field' class='sel_frm'>"; echo "<option value=''>...</option>\n"; while ($row = lcm_fetch_array($result)) { echo "<option value='" . $row['id_field'] . "'>" . _Th($row['description']) . "</option>\n"; } echo "</select>\n"; echo "<button class='simple_form_btn' name='validate_" . $type . "_additem'>" . _T('button_validate') . "</button>\n"; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; echo "</form>\n"; } } else { if (!$src_type || $src_type != 'keyword') { echo "<form action='upd_rep_field.php' name='frm_" . $type . "_source' method='post'>\n"; echo "<input name='rep' value='" . $rep_info['id_report'] . "' type='hidden' />\n"; echo '<p class="normal_text">' . f_err_star('rep_' . $type) . _Ti('rep_info_source_table'); echo "<input name='select_" . $type . "_type' value='table' type='hidden' />\n"; echo "<select name='select_" . $type . "_name' class='sel_frm'>\n\t\t\t\t<option value='author'>" . _T('rep_info_table_lcm_author') . "</option>\n\t\t\t\t<option value='case'>" . _T('rep_info_table_lcm_case') . "</option>\n\t\t\t\t<option value='stage'>" . _T('rep_info_table_lcm_stage') . "</option>\n\t\t\t\t<option value='client'>" . _T('rep_info_table_lcm_client') . "</option>\n\t\t\t\t<option value='followup'>" . _T('rep_info_table_lcm_followup') . "</option>\n\t\t\t\t</select>\n"; echo "<button class='simple_form_btn' name='validate_" . $type . "_source'>" . _T('button_validate') . "</button>\n"; echo "</p>\n"; echo "</form>\n"; } if (!$src_type) { echo '<p class="normal_text">' . _T('info_or') . "</p>\n"; } if (!$src_type || $src_type != 'table') { echo "<form action='upd_rep_field.php' name='frm_" . $type . "_source' method='post'>\n"; echo "<input name='rep' value='" . $rep_info['id_report'] . "' type='hidden' />\n"; echo "<p class='normal_text'>" . _Ti('rep_info_source_keyword'); echo "<input name='select_" . $type . "_type' value='keyword' type='hidden' />\n"; // Restrict list of keywords if custom report if ($rep_info['filecustom']) { include_custom_report($rep_info['filecustom']); $obj = new CustomReportSpecs(); $info = $type == 'line' ? $obj->getReportLine() : $obj->getReportCol(); if (substr($info['name'], 0, 4) == 'FOR:') { $choices = split(':', $info['name']); $all_kwgs = get_kwg_all($choices[1], true); } else { lcm_panic("Error in custom report specifications."); } } else { $all_kwgs = get_kwg_all('', true); } echo "<select name='select_" . $type . "_name' class='sel_frm'>\n"; echo "<option value=''>...</option>\n"; foreach ($all_kwgs as $kwg) { echo "<option value='" . $kwg['name'] . "'>" . _T('rep_info_table_lcm_' . $kwg['type']) . " - " . _T(remove_number_prefix($kwg['title'])) . "</option>\n"; } echo "</select>\n"; echo "<button class='simple_form_btn' name='validate_" . $type . "_source_kw'>" . _T('button_validate') . "</button>\n"; echo "</p>\n"; echo "</form>\n"; } } }
function show_attachments_upload($type, $id_type, $filename = '', $description = '') { if (!($type == 'case' || $type == 'client' || $type == 'org')) { lcm_panic("unknown type -" . $type . "-"); } echo '<div class="prefs_column_menu_head">' . _T('generic_subtitle_document_add') . "</div>\n"; // echo '<form enctype="multipart/form-data" action="attach_file.php" method="post">' . "\n"; // echo '<input type="hidden" name="' . $type . '" value="' . $id_type . '" />' . "\n"; echo '<input type="hidden" name="MAX_FILE_SIZE" value="' . $GLOBALS['max_file_upload_size'] . '" />' . "\n"; echo '<strong>' . f_err_star('file') . _Ti('file_input_name') . "</strong><br />"; echo '<input type="file" name="filename" size="40" value="' . $filename . '" />' . "<br />\n"; echo '<strong>' . _Ti('file_input_description') . "</strong><br />\n"; echo '<input type="text" name="description" class="search_form_txt" value="' . $description . '" /> ' . "\n"; // echo '<input type="submit" name="submit" value="' . _T('button_validate') . '" class="search_form_btn" />' . "\n"; // echo "</form>\n"; }
<td align="left" valign="top">' . f_err_star('password_current') . _T('authorconf_input_password_current') . '</td> <td align="left" valign="top"><input name="usr_old_passwd" type="password" class="search_form_txt" id="usr_old_passwd" size="35" /></td> </tr>' . "\n"; } ?> <tr> <td align="left" valign="top"><?php echo f_err_star('password_confirm') . _T('authorconf_input_password_new'); ?> </td> <td align="left" valign="top"><input name="usr_new_passwd" type="password" class="search_form_txt" id="usr_new_passwd" size="35" /></td> </tr> <tr> <td align="left" valign="top"><?php echo f_err_star('password_confirm') . _T('authorconf_input_password_confirm'); ?> </td> <td align="left" valign="top"><input name="usr_retype_passwd" type="password" class="search_form_txt" id="usr_retype_passwd" size="35" /></td> </tr> <?php } /* is_newpass_allowed() */ ?> <tr><td align="left" valign="top"><?php echo _Ti('authoredit_input_status'); ?> </td> <td align="left" valign="top">
$_SESSION['fu_data'] = array(); } // Get case details $q = "SELECT * FROM lcm_case WHERE id_case={$case}"; $result = lcm_query($q); // Check if the case exists if (!($row = lcm_fetch_array($result))) { die("There is no such case."); } // Check if the stage is changed if ($row['stage'] == $stage) { header('Location: ' . $GLOBALS['HTTP_REFERER']); exit; } // Start the page lcm_page_start('Changing case stage: ' . $row['title']); // TRAD // Show the errors (if any) echo show_all_errors($_SESSION['errors']); // Write form echo "<form action='upd_fu.php' method='post'>\n\t<table class='tbl_usr_dtl' width='99%'>\n\t\t<tr><td>" . _Ti('time_input_date_start') . "</td>\n\t\t\t<td>"; $date_start = date('Y-m-d H:i:s'); echo get_date_inputs('start', $date_start, false); echo ' ' . _T('time_input_time_at') . ' '; echo get_time_inputs('start', $date_start); echo ' ' . f_err_star('date_start', $errors); echo "</td>\n"; echo "</tr><tr>\n"; echo "<td>" . "Type:" . "</td>\n\t\t\t<td><input type='hidden' name='type' value='stage_change'>" . _T('kw_followups_stage_change_title') . "</td>\n\t\t</tr>\n\t\t<tr><td valign='top'>" . f_err_star('description') . "Description:" . "</td>\n\t\t\t<td><textarea name='description' rows='15' cols='40' class='frm_tarea'>" . $_SESSION['fu_data']['description'] . "</textarea></td>\n\t\t</tr>\n"; echo "\t</table>\n\n\t<p><button name='submit' type='submit' value='submit' class='simple_form_btn'>" . _T('button_validate') . "</button></p>\n\n\t<input type='hidden' name='id_case' value='{$case}'>\n\t<input type='hidden' name='new_stage' value='{$stage}'>\n\t<input type='hidden' name='ref_edit_fu' value='" . $GLOBALS['HTTP_REFERER'] . "'>\n</form>\n"; lcm_page_end();