';
echo ''.__('Incident').' | ';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_input_text ("titulo", $titulo,'', 70);
} else {
html_print_input_text_extended ("titulo", $titulo, "", "", 70, "", false, "", "readonly");
}
echo ' |
';
echo ''.__('Opened at').' | '.date ($config['date_format'], $inicio).' | ';
echo ''.__('Updated at').' | '.date ($config['date_format'], $actualizacion).' |
';
echo ''.__('Owner').' | ';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135");
} else {
html_print_select (users_get_info (), "usuario_form", $usuario, '', 'SYSTEM', '', false, false, true, "w135", true);
}
echo ' | '.__('Status').' | ';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135');
} else {
html_print_select (incidents_get_status (), "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
}
echo ' |
';
echo ''.__('Source').' | ';
$fields = array ();
$return = db_get_all_rows_sql ("SELECT origen FROM torigen ORDER BY origen");
if ($return === false)
$return[0] = $estado; //Something must be displayed
foreach ($return as $row) {
$fields[$row["origen"]] = $row["origen"];
}
// Only owner could change source or user with Incident management privileges
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135');
} else {
html_print_select ($fields, "origen_form", $origen, '', '', '', false, false, false, 'w135', true);
}
echo ' | '.__('Group').' | ';
// Group combo
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, false, 'w135');
} else {
html_print_select_groups($config["id_user"], "IR", true, "grupo_form", $id_grupo, '', '', '', false, false, true, 'w135', true);
}
echo ' |
'.__('Priority').' | ';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135');
}
else {
html_print_select (incidents_get_priorities (), "prioridad_form", $prioridad, '', '', '', false, false, false, 'w135', true);
}
echo ' | '.__('Creator').' | ';
if (empty ($id_creator)) {
echo 'SYSTEM';
} else {
echo $id_creator.' ('.get_user_fullname($id_creator).')';
}
$agents_incidents = agents_get_agents(false, array('id_agente', 'nombre'));
if ($agents_incidents === false) {
$agents_incidents = array();
}
foreach ($agents_incidents as $agent_incident) {
$result_agent_incidents[$agent_incident['id_agente']] = $agent_incident['nombre'];
}
echo ' |
'.__('Agent').' | ';
html_print_input_hidden('id_agent', $id_agent);
html_print_input_text_extended ('agent', agents_get_name ($id_agent), 'text-agent', '', 30, 100, false, '', array('style' => 'background: url(images/lightning.png) no-repeat right;'));
ui_print_help_tip(__("Type at least two characters to search"), false);
//html_print_select ($result_agent_incidents, "incident_agents", $id_agent, '', __('None'), 0, false, false, false, 'w135', false);
echo ' |
';
if ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;"');
}
else {
html_print_textarea ("descripcion", 15, 80, $texto, 'style="height:200px;" disabled');
}
echo ' |
';
// Only if user is the used who opened incident or (s)he is admin
if (isset ($id_inc) AND ((check_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"]))) {
html_print_submit_button (__('Update incident'), "accion", false, 'class="sub upd"');
} elseif (check_acl ($config["id_user"], $id_grupo, "IW")) {
html_print_submit_button (__('Create'), "accion", false, 'class="sub wand"');
} else {
html_print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
}
echo "