// Control to upload file echo '<div class="divform">'; echo '<table class="search-table">'; echo '<tr>'; echo '<td>'; echo print_button (__('Upload a new file'), 'add_link', false, '$(\'#upload_div\').slideToggle (); return false', 'class="sub upload"'); echo '<div id="upload_div" style="display: none;" class="">'; $target_directory = 'attachment'; $action = "index.php?sec=customers&sec2=operation/leads/lead_detail&id=$id&op=files&upload=1"; $into_form = "<input type='hidden' name='directory' value='$target_directory'><b>Description</b> <input type=text name=description size=20>"; print_input_file_progress($action,$into_form,'','sub upload'); echo '</td>'; echo '</tr>'; echo '</table>'; echo '</div>'; // List of lead attachments $sql = "SELECT * FROM tattachment WHERE id_lead = $id ORDER BY timestamp DESC"; $files = get_db_all_rows_sql ($sql); echo "<div style='width: 86%; float: right;'>"; echo "<div class='divresult'>"; if ($files !== false) { $files = print_array_pagination ($files, "index.php?sec=customers&sec2=operation/leads/lead_detail&id=$id&op=files"); unset ($table);
global $config; check_login(); $id = (int) get_parameter('id'); $incident_creator = get_db_value("id_creator", "tincidencia", "id_incidencia", $id); if (!give_acl($config["id_user"], 0, "IW") && $config['id_user'] != $incident_creator) { // Doesn't have access to this page audit_db($config['id_user'], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to ticket #" . $id); include "general/noaccess.php"; return; } $title = get_db_value("titulo", "tincidencia", "id_incidencia", $id); echo '<div id="upload_result"></div>'; echo "<div id='upload_control'>"; $table->width = '100%'; $table->data = array(); $table->data[0][0] = "<span style='font-size: 10px'>" . __("Please note that you cannot upload .php or .pl files, as well other source code formats. Please compress that files prior to upload (using zip or gz)") . "</span>"; $table->data[1][0] = print_textarea('file_description', 8, 1, '', "style='resize:none'", true, __('Description')); if (defined('AJAX')) { $action = 'ajax.php?page=operation/incidents/incident_detail'; } else { $action = 'index.php?sec=incidents&sec2=operation/incidents/incident_detail'; } $into_form = print_table($table, true); $into_form .= '<div class="button" style="width: ' . $table->width . '">'; $into_form .= print_button(__('Upload'), 'upload', false, '', 'class="sub upload"', true); $into_form .= '</div>'; $into_form .= print_input_hidden('id', $id, true); $into_form .= print_input_hidden('upload_file', 1, true); // Important: Set id 'form-add-file' to form. It's used from ajax control print_input_file_progress($action, $into_form, 'id="form-add-file"', 'sub next', 'button-upload'); echo '</div>';
$table->data[1][0] = print_select($priorities, 'priority_form', 2, '', '', '', true, false, false, __('Priority')); $table->data[1][1] = print_select($types, 'id_incident_type', '', 'javascript: show_incident_type_fields(1);', 'Select', '', true, 0, true, __('Ticket type')); $table->data[2][0] = print_textarea('description', 9, 80, '', '', true, __('Description')); $action = 'index.php?sec=incidents&sec2=operation/incidents_simple/incidents'; $into_form = print_table($table, true); $into_form .= '<h3><a href="javascript:toggle_file_addition();">' . __('Add a file') . ' (' . __('Optional') . ')<div style="float:left;"><img id="file_moreless" src="images/sort_down.png" border=0> </div></a></h3>'; $into_form .= '<div id="file_addition" style="display:none"><b>' . __('File') . '</b>'; $into_form .= '___FILE___'; $into_form .= print_input_hidden('create_incident', 1, true); $into_form .= print_input_hidden('group_id', $group_id, true); $into_form .= print_textarea('file_description', 2, 10, '', '', true, __('Description')); $into_form .= "</div>"; $into_form .= "<div style='text-align:right;'>"; $into_form .= print_button(__('Create'), 'create_incident', false, '', 'style="margin-top:4px;" class="action_btn sub next"', true); $into_form .= "</div>"; echo print_input_file_progress($action, $into_form, 'id="form-add-file"', 'sub next', 'button-create_incident', true, '___FILE___'); echo "</div>"; ?> <script type="text/javascript" src="include/js/integria_incident_search.js"></script> <script type="text/javascript"> $(document).ready (function () { var id_group = '<?php echo $group_id; ?> '; var id_user = '******'id_user']; ?>
echo "<tr><td class='datos'>"; $available_directory["images"] = "images"; $available_directory["images/custom_logos"] = "images/custom_logos"; $available_directory["attachment"] = "attachment"; $available_directory["attachment/downloads"] = "attachment/downloads"; // Current directory $available_directory[$current_directory] = $current_directory; echo "<form method='post' action='index.php?sec=godmode&sec2=godmode/setup/filemgr&upload_file' enctype='multipart/form-data'>"; print_select($available_directory, 'directory', $current_directory, '', '', '', false, false, 0, __("Base directory"), "", "margin-top:3px;"); echo " <input type=submit class='sub next' style='margin-top:2px;' value='" . __("Go") . "'>"; echo "</form>"; if (is_writable($current_directory)) { echo "<td class='datos'><br>"; $action = 'index.php?sec=godmode&sec2=godmode/setup/filemgr&upload_file'; $into_form = "<input type='hidden' name='directory' value='{$current_directory}'>"; print_input_file_progress($action, $into_form, '', 'sub next', false); echo "</table>"; } else { echo "</table>"; echo "<h3 class='error'>" . __('Current directory is not writtable by HTTP Server') . "</h3>"; echo '<p>'; echo __('Please check that current directory has write rights for HTTP server'); echo "</p>"; } echo "<h1>" . __("Current directory") . " : " . $current_directory . " <a href='index.php?sec=godmode&sec2=godmode/setup/filemgr&directory={$current_directory}'><img src='images/arrow_refresh.png' border=0 title='" . __('Refresh') . "'></a></h1>"; // Upload form // List files $directoryHandler = ""; $result = array(); if (!($directoryHandler = @opendir($current_directory))) { echo "<pre>\nerror: directory \"{$current_directory}\" doesn't exist!\n</pre>\n";
print_submit_button (__('Add'), 'add_workunit_button', false, 'style="margin-top:4px;" class="sub create"'); echo "</div>"; echo "</form>"; echo "</div>"; // UPLOAD FILE FORM echo "<div style='width:$width;display:none;' id='form_file' class='form_tabs'>"; $action = ''; $into_form = print_input_hidden ('id', $incident_id, true); $into_form .= print_input_hidden ('upload_file', 1, true); $into_form .= print_textarea ('description', 2, 10, '', '', true, __('Description')); $into_form .= "<div style='text-align:right;'>"; $into_form .= print_button (__('Upload'), 'add_file', false, '', 'style="margin-top:4px;" class="action_btn sub upload"', true); $into_form .= "</div>"; echo '<b>'.__('File').'</b>'; echo '<br>'.print_input_file_progress($action, $into_form, 'id="form-add-file"', 'sub next', 'button-add_file', true); echo "</div>"; // LOADING DIV echo '<div id="loading" style="width:60%;margin-top:20;display:none;">'.__('Loading').'...</div>'; // DATA DIVS echo '<div id="details_data" class="tab_data"></div>'; echo '<div id="workunits_data" class="tab_data"></div>'; echo '<div id="files_data" class="tab_data"></div>'; // Div with the active tab name in all moment echo "<div id='active_tab' style='display:none'>$active_tab</div>"; // Div with the incident id in all moment echo "<div id='incident_id' style='display:none'>$incident_id</div>"; ?>
$action = "index.php?sec=projects&sec2=operation/projects/task_cost&id_task={$id_task}&id_project={$id_project}"; $table->id = 'cost_form'; $table->width = '90%'; $table->class = 'listing'; $table->size = array(); $table->data = array(); $table->data[0][0] = __('Bill ID'); $table->data[0][1] = print_input_text('bill_id', $bill_id, '', 15, 50, true); $table->data[1][0] = __('Amount'); $table->data[1][1] = print_input_text('amount', $amount, '', 10, 20, true); //Check $table->data[2][0] = __('Description'); $table->data[2][1] = print_input_text('description', $description, '', 60, 250, true); $table->data[3][0] = __('Attach a file'); $table->data[3][1] = '__UPLOAD_CONTROL__'; $into_form = print_table($table, true); $into_form .= '<div class="button" style="width: ' . $table->width . '">'; if ($operation == "") { $into_form .= print_button(__('Add'), "crt", false, '', 'class="sub next"', true); $into_form .= print_input_hidden('operation', "add", true); $button_name = "button-crt"; } else { $into_form .= print_input_hidden('id', $id_profile, true); $into_form .= print_input_hidden('update_profile', 1, true); $into_form .= print_button(__('Update'), "upd", false, '', 'class="sub upd"', true); $button_name = "button-upd"; } $into_form .= "</div>"; print_input_file_progress($action, $into_form, 'id="form-add-file"', 'sub next', $button_name, false, '__UPLOAD_CONTROL__'); echo "</div>"; }