2008-11-10 Sancho Lerena <slerena@artica.es>

* operation/incidents/incident.php
        operation/incidents/incident_detail.php: Fixed some bugs in
        incident management that makes unusable the incident sytem
        Thanks to Esben for reporting this bug that was introduced
        only few days before closing 2.0 version :(



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1233 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2008-11-10 17:35:27 +00:00
parent b42e8b0cd9
commit 83d6d22492
3 changed files with 51 additions and 38 deletions

View File

@ -1,5 +1,11 @@
2008-11-10 Sancho Lerena <slerena@artica.es>
* operation/incidents/incident.php
operation/incidents/incident_detail.php: Fixed some bugs in
incident management that makes unusable the incident sytem
Thanks to Esben for reporting this bug that was introduced
only few days before closing 2.0 version :(
* include/funcions_db.php: Reference to inexistant table
tagent_data_image has been deleted and fixed notice.

View File

@ -89,7 +89,7 @@ if ((isset ($_GET["action"])) AND ($_GET["action"] == "update")) {
// INSERT incident
if ((isset ($_GET["action"])) AND ($_GET["action"] == "insert")) {
$grupo = get_parameter_post ("grupo_form");
$grupo = get_parameter_post ("grupo_form", 1);
if (give_acl ($config['id_user'], $grupo, "IM")) {
// Read input variables
$titulo = get_parameter_post ("titulo");
@ -98,8 +98,7 @@ if ((isset ($_GET["action"])) AND ($_GET["action"] == "insert")) {
$prioridad = get_parameter_post ("prioridad_form");
$id_creator = $config['id_user'];
$estado = get_parameter_post ("estado_form");
$sql = sprintf ("INSERT INTO tincidencia (inicio,actualizacion,titulo,descripcion,id_usuario,origen,estado,prioridad,id_grupo,id_creator) VALUES
(NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s')".$titulo,$descripcion,$config["id_user"],$origen,$estado,$prioridad,$grupo,$config["id_user"]);
$sql = sprintf ("INSERT INTO tincidencia (inicio, actualizacion, titulo, descripcion, id_usuario, origen, estado, prioridad, id_grupo, id_creator) VALUES (NOW(), NOW(), '%s', '%s', '%s', '%s', %d, %d, '%s', '%s')", $titulo, $descripcion, $config["id_user"], $origen, $estado, $prioridad, $grupo, $config["id_user"]);
$id_inc = process_sql ($sql, "insert_id");
if ($id_inc === false) {
@ -227,6 +226,8 @@ if ($count < 1) {
// TOTAL incidents
$url = "index.php?sec=incidencias&sec2=operation/incidents/incident";
$estado = -1;
// add form filter values for group, priority, state, and search fields: user and text
if ($grupo != -1)
$url .= "&grupo=".$grupo;

View File

@ -30,6 +30,9 @@ if (! give_acl ($config["id_user"], 0, "IR")) {
exit;
}
$inicio = date('Y-m-d H:i:s');
$actualizacion = date('Y-m-d H:i:s');
// EDITION MODE
if (isset ($_GET["id"])) {
$id_inc = get_parameter_get ("id");
@ -270,9 +273,9 @@ foreach ($return as $row) {
// Only owner could change source or user with Incident management privileges
if ((give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR ($usuario == $config["id_user"])) {
print_select ($fields, "estado_form", $estado, '', '', '', false, false, false, 'w135');
print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135');
} else {
print_select ($fields, "estado_form", $estado, '', '', '', false, false, false, 'w135', true);
print_select ($fields, "origen_form", $estado, '', '', '', false, false, false, 'w135', true);
}
echo '</td><td class="datos2"><b>'.__('Group').'</b></td><td class="datos2">';
@ -325,6 +328,8 @@ if (isset ($id_inc) AND (give_acl ($config["id_user"], $id_grupo, "IM") == 1) OR
print_submit_button (__('Submit'), "accion", true, 'class="sub upd"');
}
echo "</div></form>";
if (isset ($id_inc)) {
echo '<div>';
print_submit_button (__('Add note'), "note_control", false, 'class="sub next"');
echo '</div><div>';
@ -362,7 +367,7 @@ foreach ($result as $row) {
echo '</td><td>'.safe_input ($row["nota"]).'</td></tr>';
}
echo '</table>';
}
// ************************************************************
// Files attached to this incident
@ -417,8 +422,9 @@ unset ($table);
// Upload control
// ************************************************************
// Upload control
if (give_acl($config["id_user"], $id_grupo, "IW")==1){
if ((give_acl($config["id_user"], $id_grupo, "IW")==1) AND (isset ($id_inc))) {
echo '<div>';
print_submit_button (__('Add attachment'), "attachment", false, 'class="sub next"');
echo '</div>';