示例#1
0
 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";
     }
 }
示例#2
0
    // TRAD
    echo join(', ', $clients);
    echo "<br />\n";
}
// Show edit appointment button
if ($ac['e']) {
    echo '<br /><a href="edit_app.php?app=' . $row['id_app'] . '" class="create_new_lnk">' . _T('app_button_edit') . "</a><br />\n";
}
if ($row['id_case'] > 0) {
    // Show parent followup ([ML] fu.type necessary for short-desc)
    $q = "SELECT a.id_followup, fu.description, fu.type\n\t\t\t\tFROM lcm_app_fu as a, lcm_followup as fu\n\t\t\t\tWHERE a.id_app = " . $row['id_app'] . "\n\t\t\t  \t  AND a.id_followup = fu.id_followup\n\t\t\t\t  AND a.relation = 'parent'";
    $res_fu = lcm_query($q);
    if (lcm_num_rows($res_fu) > 0) {
        // Show parent followup title
        $fu = lcm_fetch_array($res_fu);
        $short_description = get_fu_description($fu);
        echo '<br />Consequent to:' . ' <a class="content_link" href="fu_det.php?followup=' . $fu['id_followup'] . '">' . $short_description . "</a><br />\n";
        // TRAD
    }
    // Show child followup
    $q = "SELECT lcm_app_fu.id_followup,lcm_followup.description FROM lcm_app_fu,lcm_followup\n\t\t\tWHERE lcm_app_fu.id_app=" . $row['id_app'] . "\n\t\t\t\tAND lcm_app_fu.id_followup=lcm_followup.id_followup\n\t\t\t\tAND lcm_app_fu.relation='child'";
    $res_fu = lcm_query($q);
    if (lcm_num_rows($res_fu) > 0) {
        // Show child followup title
        $fu = lcm_fetch_array($res_fu);
        $title_length = $prefs['screen'] == "wide" ? 48 : 115;
        if (strlen(lcm_utf8_decode($fu['description'])) < $title_length) {
            $short_description = $fu['description'];
        } else {
            $short_description = substr($fu['description'], 0, $title_length) . '...';
        }
示例#3
0
    // Id followup
    // echo '<td class="tbl_cont_' . $css . '"><img src="images/lcm/dotted_angle.gif" width="15" height="15" align="left" />&nbsp;' . $row['id_followup'] . '</td>';
    // Start date
    echo '<td class="tbl_cont_' . $css . '">' . format_date($row['date_start'], 'short') . '</td>';
    // Time
    echo '<td class="tbl_cont_' . $css . '">';
    $fu_date_end = vider_date($row['date_end']);
    if ($prefs['time_intervals'] == 'absolute') {
        if ($fu_date_end) {
            echo format_date($row['date_end'], 'short');
        }
    } else {
        $fu_time = $fu_date_end ? strtotime($row['date_end']) - strtotime($row['date_start']) : 0;
        echo format_time_interval_prefs($fu_time);
    }
    echo '</td>';
    // Author initials
    echo '<td class="tbl_cont_' . $css . '">' . get_person_initials($row) . '</td>';
    // Type
    echo '<td class="tbl_cont_' . $css . '">' . _Tkw('followups', $row['type']) . '</td>';
    // Description
    $short_description = get_fu_description($row);
    echo '<td class="tbl_cont_' . $css . '">';
    echo '<a href="fu_det.php?followup=' . $row['id_followup'] . '" class="content_link">' . $short_description . '</a>';
    echo '</td>';
    echo "</tr>\n";
}
show_list_end($fu_list_pos, $number_of_rows, false, 'fu');
echo "</p>\n";
echo '<p><a href="edit_case.php?case=0" class="create_new_lnk">' . _T('case_button_new') . "</a></p>\n";
lcm_page_end();
示例#4
0
 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 '&nbsp;<a href="edit_auth.php?case=' . $this->getDataInt('id_case') . '&amp;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']) . '&nbsp;' . _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";
 }
示例#5
0
function show_listfu_item($item, $cpt, $screen = 'general')
{
    global $prefs;
    echo "<tr>\n";
    // Id case
    if ($screen == 'case') {
        echo '<td valign="top"><abbr title="' . $item['title'] . '">' . $item['id_case'] . '</abbr></td>';
    } else {
        echo '<td valign="top">' . $item['id_followup'] . '</abbr></td>';
    }
    // Start date
    echo '<td valign="top">' . format_date($item['date_start'], 'short') . '</td>';
    // Time
    echo '<td valign="top">';
    $fu_date_end = vider_date($item['date_end']);
    if ($prefs['time_intervals'] == 'absolute') {
        if ($fu_date_end) {
            echo format_date($item['date_end'], 'short');
        }
    } else {
        $fu_time = $fu_date_end ? strtotime($item['date_end']) - strtotime($item['date_start']) : 0;
        echo format_time_interval($fu_time, $prefs['time_intervals_notation'] == 'hours_only');
    }
    echo '</td>';
    // Author initials
    if ($screen != 'author') {
        echo '<td valign="top">' . get_person_initials($item) . '</td>';
    }
    // Type
    echo '<td valign="top">' . _Tkw('followups', $item['type']) . '</td>';
    // Description
    $cut_fu = isset($_REQUEST['more_fu_desc']) && $_REQUEST['more_fu_desc'] ? false : true;
    $short_description = get_fu_description($item, $cut_fu);
    if ($item['hidden'] == 'Y') {
        $short_description .= ' <img src="images/jimmac/stock_trash-16.png" ' . 'height="16" width="16" border="0" ' . 'title="' . _T('fu_info_is_deleted') . '" ' . 'alt="' . _T('fu_info_is_deleted') . '" />';
    }
    echo '<td valign="top">';
    echo '<a href="fu_det.php?followup=' . $item['id_followup'] . '" class="content_link">' . $short_description . '</a>';
    echo '</td>';
    echo "</tr>\n";
}
示例#6
0
$report->printHeaderValueEnd();
if ($rep_info['filecustom']) {
    $report->run();
}
for ($cpt_lines = $cpt_col = 0; $result && ($row = lcm_fetch_array($result)); $cpt_lines++) {
    $report->printStartLine();
    foreach ($row as $key => $val) {
        if (!is_numeric($key) && $key != 'LCM_HIDE_ID') {
            $cpt_items = 0;
            $css = 'class="tbl_cont_' . ($cpt_lines % 2 ? "light" : "dark") . '"';
            $align = 'align="left"';
            //
            // Special cases
            //
            if ($my_headers[$cpt_col]['field_name'] == 'description') {
                $val = get_fu_description($row);
            }
            if ($val == "1" && preg_match("/^LCM_SQL:special:(.*)/", $key, $regs)) {
                $deps = join_tables($my_line_table, '', $row['LCM_HIDE_ID'], 0, $report, $report->getSpecial($regs[1]));
                $q_col = $report->getSpecial($regs[1]);
                // Fetch special rule
                $q_col .= $deps[2];
                // WHERE [...]
                $allow_zoom = false;
                $zooming = false;
                // [ML] Limit zooming to queries involving cases, because we have no
                // test cases for other uses
                if (preg_match("/lcm_case/", $q_col)) {
                    $allow_zoom = true;
                }
                if (isset($_REQUEST['zoom' . $cpt_lines . "-" . $cpt_col])) {