mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
2007-02-06 Sancho Lerena <slerena@artica.es>
* include/functions.php: Pagination function now works fine. * operation/incidents/incident.php, indicent_detail.: Incident update/inser goes to main incident view. More usable interface. Pagination works fine, needs to adjust SQL to use LIMIT syntax for more optimized code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@373 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
169f607b66
commit
cae70f66b5
@ -1,3 +1,12 @@
|
|||||||
|
2007-02-06 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
|
* include/functions.php: Pagination function now works fine.
|
||||||
|
|
||||||
|
* operation/incidents/incident.php, indicent_detail.: Incident
|
||||||
|
update/inser goes to main incident view. More usable
|
||||||
|
interface. Pagination works fine, needs to adjust SQL to use LIMIT
|
||||||
|
syntax for more optimized code.
|
||||||
|
|
||||||
2007-02-05 Sancho Lerena <slerena@artica.es>
|
2007-02-05 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* include/functions_db.php: Added function to get
|
* include/functions_db.php: Added function to get
|
||||||
|
@ -2,13 +2,12 @@
|
|||||||
|
|
||||||
// Pandora - the Free monitoring system
|
// Pandora - the Free monitoring system
|
||||||
// ====================================
|
// ====================================
|
||||||
// Copyright (c) 2004-2006 Sancho Lerena, slerena@gmail.com
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
||||||
// Copyright (c) 2005-2006 Artica Soluciones Tecnologicas, info@artica.es
|
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
|
||||||
// Copyright (c) 2004-2006 Raul Mateos Martin, raulofpandora@gmail.com
|
// Copyright (c) 2004-2007 Raul Mateos Martin, raulofpandora@gmail.com
|
||||||
// This program is free software; you can redistribute it and/or
|
// This program is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License
|
// modify it under the terms of the GNU General Public License
|
||||||
// as published by the Free Software Foundation; either version 2
|
// as published by the Free Software Foundation; version 2.
|
||||||
// of the License, or (at your option) any later version.
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
@ -408,7 +408,7 @@ function pagination ($count, $url, $offset ) {
|
|||||||
|
|
||||||
// This calculate index_limit, block limit for this search.
|
// This calculate index_limit, block limit for this search.
|
||||||
if (($index_page + $block_limit) > $index_counter)
|
if (($index_page + $block_limit) > $index_counter)
|
||||||
$index_limit = $index_counter - 1;
|
$index_limit = $index_counter;
|
||||||
else
|
else
|
||||||
$index_limit = $index_page + $block_limit;
|
$index_limit = $index_page + $block_limit;
|
||||||
|
|
||||||
@ -435,13 +435,14 @@ function pagination ($count, $url, $offset ) {
|
|||||||
echo " ";
|
echo " ";
|
||||||
// Show PREVIOUS button
|
// Show PREVIOUS button
|
||||||
if ($index_page > 0){
|
if ($index_page > 0){
|
||||||
$index_page_prev= ($index_page-$block_limit)*$block_size;
|
$index_page_prev= ($index_page-(floor($block_limit/2)))*$block_size;
|
||||||
if ($index_page_prev < 0)
|
if ($index_page_prev < 0)
|
||||||
$index_page_prev = 0;
|
$index_page_prev = 0;
|
||||||
echo '<a href="'.$url.'&offset='.$index_page_prev.'"><img src="images/control_rewind_blue.png"></a> ';
|
echo '<a href="'.$url.'&offset='.$index_page_prev.'"><img src="images/control_rewind_blue.png"></a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw blocks markers
|
// Draw blocks markers
|
||||||
|
// $i stores number of page
|
||||||
for ($i = $inicio_pag; $i < $index_limit; $i++) {
|
for ($i = $inicio_pag; $i < $index_limit; $i++) {
|
||||||
$inicio_bloque = ($i * $block_size);
|
$inicio_bloque = ($i * $block_size);
|
||||||
$final_bloque = $inicio_bloque + $block_size;
|
$final_bloque = $inicio_bloque + $block_size;
|
||||||
@ -449,33 +450,40 @@ function pagination ($count, $url, $offset ) {
|
|||||||
$final_bloque = ($i-1)*$block_size + $count-(($i-1) * $block_size);
|
$final_bloque = ($i-1)*$block_size + $count-(($i-1) * $block_size);
|
||||||
}
|
}
|
||||||
echo "<span>";
|
echo "<span>";
|
||||||
echo '<a href="'.$url.'&offset='.$inicio_bloque.'">';
|
|
||||||
$inicio_bloque_fake = $inicio_bloque + 1;
|
$inicio_bloque_fake = $inicio_bloque + 1;
|
||||||
// Show NEXT PAGE
|
// To Calculate last block (doesnt end with round data,
|
||||||
if (($i >= $inicio_pag + $block_limit) AND ($paginacion_maxima == 1)){
|
// it must be shown if not round to block limit)
|
||||||
echo "<img src='images/control_fastforward_blue.png'></a> ";
|
echo '<a href="'.$url.'&offset='.$inicio_bloque.'">';
|
||||||
$i = $index_counter;
|
|
||||||
}
|
|
||||||
else { // Calculate last block (doesnt end with round data, it must be shown if not round to block limit)
|
|
||||||
if ($inicio_bloque == $offset)
|
if ($inicio_bloque == $offset)
|
||||||
echo "<b>[ $i ]</b>";
|
echo "<b>[ $i ]</b>";
|
||||||
else
|
else
|
||||||
echo "[ $i ]";
|
echo "[ $i ]";
|
||||||
echo '</a> ';
|
echo '</a> ';
|
||||||
}
|
|
||||||
echo "</span>";
|
echo "</span>";
|
||||||
}
|
}
|
||||||
|
// Show NEXT PAGE (fast forward)
|
||||||
|
// Index_counter stores max of blocks
|
||||||
|
if (($paginacion_maxima == 1) AND (($index_counter - $i) > 0)) {
|
||||||
|
$prox_bloque = ($i+ceil($block_limit/2))*$block_size;
|
||||||
|
if ($prox_bloque > $count)
|
||||||
|
$prox_bloque = ($count -1) - $block_size;
|
||||||
|
echo '<a href="'.$url.'&offset='.$prox_bloque.'">';
|
||||||
|
echo "<img src='images/control_fastforward_blue.png'></a> ";
|
||||||
|
$i = $index_counter;
|
||||||
|
}
|
||||||
// if exists more registers than i can put in a page (defined by $block_size config parameter)
|
// if exists more registers than i can put in a page (defined by $block_size config parameter)
|
||||||
// get offset for index calculation
|
// get offset for index calculation
|
||||||
|
// Draw "last" block link, ajust for last block will be the same
|
||||||
}
|
// as painted in last block (last integer block).
|
||||||
// Draw "last" block link
|
|
||||||
if (($count - $block_size) > 0){
|
if (($count - $block_size) > 0){
|
||||||
echo ' <a href="'.$url.'&offset='.($count - $block_size).'">';
|
$myoffset = floor(($count-1)/ $block_size)* $block_size;
|
||||||
|
echo ' <a href="'.$url.'&offset='.$myoffset.'">';
|
||||||
echo "<img src='images/control_end_blue.png'>";
|
echo "<img src='images/control_end_blue.png'>";
|
||||||
echo "</a>";
|
echo "</a>";
|
||||||
}
|
}
|
||||||
// End div and layout
|
// End div and layout
|
||||||
|
}
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,21 +18,22 @@
|
|||||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
// Load global vars
|
// Load global vars
|
||||||
|
$accion = "";
|
||||||
require("include/config.php");
|
require("include/config.php");
|
||||||
if (comprueba_login() != 0) {
|
if (comprueba_login() != 0) {
|
||||||
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access incident viewer");
|
audit_db("Noauth",$REMOTE_ADDR, "No authenticated acces","Trying to access incident viewer");
|
||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id_usuario =$_SESSION["id_usuario"];
|
$id_usuario =$_SESSION["id_usuario"];
|
||||||
$accion = "";
|
|
||||||
if (give_acl($id_usuario, 0, "IR")!=1) {
|
if (give_acl($id_usuario, 0, "IR")!=1) {
|
||||||
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access incident viewer");
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access incident viewer");
|
||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delete incident
|
||||||
if (isset($_GET["quick_delete"])){
|
if (isset($_GET["quick_delete"])){
|
||||||
$id_inc = $_GET["quick_delete"];
|
$id_inc = $_GET["quick_delete"];
|
||||||
$sql2="SELECT * FROM tincidencia WHERE id_incidencia=".$id_inc;
|
$sql2="SELECT * FROM tincidencia WHERE id_incidencia=".$id_inc;
|
||||||
@ -52,6 +53,54 @@ if (isset($_GET["quick_delete"])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UPDATE incident
|
||||||
|
if ((isset($_GET["action"])) AND ($_GET["action"]=="update")){
|
||||||
|
$id_inc = $_POST["id_inc"];
|
||||||
|
$grupo = entrada_limpia($_POST['grupo_form']);
|
||||||
|
$usuario= entrada_limpia($_POST["usuario_form"]);
|
||||||
|
if ((give_acl($id_usuario, $grupo, "IM")==1) OR ($usuario == $id_usuario)) { // Only admins (manage incident) or owners can modify incidents
|
||||||
|
$id_author_inc = give_incident_author($id_inc);
|
||||||
|
$titulo = entrada_limpia($_POST["titulo"]);
|
||||||
|
$descripcion = entrada_limpia($_POST['descripcion']);
|
||||||
|
$origen = entrada_limpia($_POST['origen_form']);
|
||||||
|
$prioridad = entrada_limpia($_POST['prioridad_form']);
|
||||||
|
$estado = entrada_limpia($_POST["estado_form"]);
|
||||||
|
$ahora=date("Y/m/d H:i:s");
|
||||||
|
$sql = "UPDATE tincidencia SET actualizacion = '".$ahora."', titulo = '".$titulo."', origen= '".$origen."', estado = '".$estado."', id_grupo = '".$grupo."', id_usuario = '".$usuario."', prioridad = '".$prioridad."', descripcion = '".$descripcion."' WHERE id_incidencia = ".$id_inc;
|
||||||
|
$result=mysql_query($sql);
|
||||||
|
if ($result)
|
||||||
|
echo "<h3 class='suc'>".$lang_label["upd_incid_ok"]."</h3>";
|
||||||
|
} else {
|
||||||
|
audit_db($id_usuario,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to update incident");
|
||||||
|
echo "<h3 class='error'>".$lang_label["upd_incid_no"]."</h3>";
|
||||||
|
no_permission();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// INSERT incident
|
||||||
|
if ((isset($_GET["action"])) AND ($_GET["action"]=="insert")){
|
||||||
|
$grupo = entrada_limpia($_POST['grupo_form']);
|
||||||
|
$usuario= entrada_limpia($_POST["usuario_form"]);
|
||||||
|
if ((give_acl($id_usuario, $grupo, "IM") == 1) OR ($usuario == $id_usuario)) { // Only admins (manage
|
||||||
|
// Read input variables
|
||||||
|
$titulo = entrada_limpia($_POST['titulo']);
|
||||||
|
$inicio = date("Y/m/d H:i:s");
|
||||||
|
$descripcion = entrada_limpia($_POST['descripcion']);
|
||||||
|
$texto = $descripcion; // to view in textarea after insert
|
||||||
|
$origen = entrada_limpia($_POST['origen_form']);
|
||||||
|
$prioridad = entrada_limpia($_POST['prioridad_form']);
|
||||||
|
$actualizacion = $inicio;
|
||||||
|
$id_creator = $id_usuario;
|
||||||
|
$estado = entrada_limpia($_POST["estado_form"]);
|
||||||
|
$sql = " INSERT INTO tincidencia (inicio,actualizacion,titulo,descripcion,id_usuario,origen,estado,prioridad,id_grupo, id_creator) VALUES ('".$inicio."','".$actualizacion."','".$titulo."','".$descripcion."','".$usuario."','".$origen."','".$estado."','".$prioridad."','".$grupo."','".$id_creator."') ";
|
||||||
|
if (mysql_query($sql))
|
||||||
|
echo "<h3 class='suc'>".$lang_label["create_incid_ok"]."</h3>";
|
||||||
|
$id_inc=mysql_insert_id();
|
||||||
|
} else {
|
||||||
|
audit_db($id_usuario,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to create incident");
|
||||||
|
no_permission();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
$busqueda="";
|
$busqueda="";
|
||||||
if (isset($_POST["texto"]) OR (isset($_GET["texto"]))){
|
if (isset($_POST["texto"]) OR (isset($_GET["texto"]))){
|
||||||
@ -259,8 +308,7 @@ if (!mysql_num_rows($result2)) {
|
|||||||
// Fill array with data
|
// Fill array with data
|
||||||
|
|
||||||
// TOTAL incidents
|
// TOTAL incidents
|
||||||
$total_incidentes = sizeof($incident_list);
|
$total_incidentes = sizeof($incident_list) - 1;
|
||||||
|
|
||||||
$url = "index.php?sec=incidencias&sec2=operation/incidents/incident";
|
$url = "index.php?sec=incidencias&sec2=operation/incidents/incident";
|
||||||
|
|
||||||
// add form filter values for group, priority, state, and search fields: user and text
|
// add form filter values for group, priority, state, and search fields: user and text
|
||||||
|
@ -89,49 +89,6 @@ if (isset($_GET["id"])){
|
|||||||
$res4 = mysql_query($sql4);
|
$res4 = mysql_query($sql4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modify incident
|
|
||||||
if (isset($_POST["accion"])){
|
|
||||||
$id_inc = $_POST["id_inc"];
|
|
||||||
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp)) { // Only admins (manage incident) or owners can modify incidents
|
|
||||||
// Edicion !!
|
|
||||||
if ($_POST["accion"] == $lang_label["in_modinc"]){ // Modify Incident
|
|
||||||
$id_author_inc = give_incident_author($id_inc);
|
|
||||||
$titulo = entrada_limpia($_POST["titulo"]);
|
|
||||||
$descripcion = entrada_limpia($_POST['descripcion']);
|
|
||||||
$origen = entrada_limpia($_POST['origen']);
|
|
||||||
$prioridad = entrada_limpia($_POST['prioridad']);
|
|
||||||
$grupo = entrada_limpia($_POST['grupo']);
|
|
||||||
$usuario= entrada_limpia($_POST["usuario"]);
|
|
||||||
$estado = entrada_limpia($_POST["estado"]);
|
|
||||||
$ahora=date("Y/m/d H:i:s");
|
|
||||||
$sql = "UPDATE tincidencia SET actualizacion = '".$ahora."', titulo = '".$titulo."', origen= '".$origen."', estado = '".$estado."', id_grupo = '".$grupo."', id_usuario = '".$usuario."', prioridad = '".$prioridad."', descripcion = '".$descripcion."' WHERE id_incidencia = ".$id_inc;
|
|
||||||
$result=mysql_query($sql);
|
|
||||||
if ($result) echo "<h3 class='suc'>".$lang_label["upd_incid_ok"]."</h3>";
|
|
||||||
// Re-read data for correct presentation
|
|
||||||
// Obtain group of this incident
|
|
||||||
$sql1='SELECT * FROM tincidencia WHERE id_incidencia = '.$id_inc;
|
|
||||||
$result=mysql_query($sql1);
|
|
||||||
$row=mysql_fetch_array($result);
|
|
||||||
// Get values
|
|
||||||
$titulo = $row["titulo"];
|
|
||||||
$texto = $row["descripcion"];
|
|
||||||
$inicio = $row["inicio"];
|
|
||||||
$actualizacion = $row["actualizacion"];
|
|
||||||
$estado = $row["estado"];
|
|
||||||
$prioridad = $row["prioridad"];
|
|
||||||
$origen = $row["origen"];
|
|
||||||
$usuario = $row["id_usuario"];
|
|
||||||
$nombre_real = dame_nombre_real($usuario);
|
|
||||||
$id_grupo = $row["id_grupo"];
|
|
||||||
$grupo = dame_nombre_grupo($id_grupo);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
audit_db($id_author_inc,$REMOTE_ADDR,"ACL Forbidden","User ".$_SESSION["id_usuario"]." try to update incident");
|
|
||||||
echo "<h3 class='error'>".$lang_label["upd_incid_no"]."</h3>";
|
|
||||||
no_permission();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Delete note
|
// Delete note
|
||||||
if (isset($_GET["id_nota"])){
|
if (isset($_GET["id_nota"])){
|
||||||
$note_user = give_note_author ($_GET["id_nota"]);
|
$note_user = give_note_author ($_GET["id_nota"]);
|
||||||
@ -190,30 +147,10 @@ if (isset($_GET["id"])){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // Not given id
|
} // else Not given id
|
||||||
// Insert data !
|
// Create incident from event... read event data
|
||||||
if (isset($_POST["accion"]) and ($_POST["accion"] == $lang_label["create"])) {
|
elseif (isset($_GET["insert_form"])){
|
||||||
$iduser_temp=$_SESSION['id_usuario'];
|
|
||||||
// Read input variables
|
|
||||||
$titulo = entrada_limpia($_POST['titulo']);
|
|
||||||
$inicio = date("Y/m/d H:i:s");
|
|
||||||
$descripcion = entrada_limpia($_POST['descripcion']);
|
|
||||||
$texto = $descripcion; // to view in textarea after insert
|
|
||||||
$origen = entrada_limpia($_POST['origen']);
|
|
||||||
$prioridad = entrada_limpia($_POST['prioridad']);
|
|
||||||
$grupo = entrada_limpia($_POST['grupo']);
|
|
||||||
$usuario= entrada_limpia($_SESSION["id_usuario"]);
|
|
||||||
$actualizacion = $inicio;
|
|
||||||
$id_creator = $iduser_temp;
|
|
||||||
$estado = 0; // if the indicent is new, state (estado) is 0
|
|
||||||
$sql = " INSERT INTO tincidencia (inicio,actualizacion,titulo,descripcion,id_usuario,origen,estado,prioridad,id_grupo, id_creator) VALUES ('".$inicio."','".$actualizacion."','".$titulo."','".$descripcion."','".$usuario."','".$origen."','".$estado."','".$prioridad."','".$grupo."','".$id_creator."') ";
|
|
||||||
if (give_acl($iduser_temp, $grupo, "IW")==1){
|
|
||||||
if (mysql_query($sql)) echo "<h3 class='suc'>".$lang_label["create_incid_ok"]."</h3>";
|
|
||||||
$id_inc=mysql_insert_id();
|
|
||||||
} else
|
|
||||||
no_permission();
|
|
||||||
// INSERT FORM.
|
|
||||||
} elseif (isset($_GET["insert_form"])){
|
|
||||||
$iduser_temp=$_SESSION['id_usuario'];
|
$iduser_temp=$_SESSION['id_usuario'];
|
||||||
$titulo = "";
|
$titulo = "";
|
||||||
if (isset($_GET["from_event"])){
|
if (isset($_GET["from_event"])){
|
||||||
@ -240,7 +177,8 @@ if (isset($_GET["id"])){
|
|||||||
no_permission();
|
no_permission();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ********************************************************************************************************
|
// ********************************************************************************************************
|
||||||
// ********************************************************************************************************
|
// ********************************************************************************************************
|
||||||
@ -248,9 +186,9 @@ if (isset($_GET["id"])){
|
|||||||
// ********************************************************************************************************
|
// ********************************************************************************************************
|
||||||
|
|
||||||
if ($creacion_incidente == 0)
|
if ($creacion_incidente == 0)
|
||||||
echo "<form name='accion_form' method='POST' action='index.php?sec=incidencias&sec2=operation/incidents/incident_detail&id=".$id_inc."'>";
|
echo "<form name='accion_form' method='POST' action='index.php?sec=incidencias&sec2=operation/incidents/incident&action=update'>";
|
||||||
else
|
else
|
||||||
echo "<form name='accion_form' method='POST' action='index.php?sec=incidencias&sec2=operation/incidents/incident_detail'>";
|
echo "<form name='accion_form' method='POST' action='index.php?sec=incidencias&sec2=operation/incidents/incident&action=insert'>";
|
||||||
|
|
||||||
if (isset($id_inc)) {
|
if (isset($id_inc)) {
|
||||||
echo "<input type='hidden' name='id_inc' value='".$id_inc."'>";
|
echo "<input type='hidden' name='id_inc' value='".$id_inc."'>";
|
||||||
@ -272,7 +210,7 @@ echo '<td class="datos2"><b>'.$lang_label["updated_at"].'</b>';
|
|||||||
echo "<td class='datos2'><i>".$actualizacion."</i>";
|
echo "<td class='datos2'><i>".$actualizacion."</i>";
|
||||||
echo '<tr><td class="datos"><b>'.$lang_label["in_openedby"].'</b><td class="datos">';
|
echo '<tr><td class="datos"><b>'.$lang_label["in_openedby"].'</b><td class="datos">';
|
||||||
if ((give_acl($id_user, $id_grupo, "IM")==1) OR ($usuario == $id_user)) {
|
if ((give_acl($id_user, $id_grupo, "IM")==1) OR ($usuario == $id_user)) {
|
||||||
echo "<select name='usuario' class='w200'>";
|
echo "<select name='usuario_form' class='w200'>";
|
||||||
echo "<option value='".$usuario."'>".$usuario." - ".dame_nombre_real($usuario);
|
echo "<option value='".$usuario."'>".$usuario." - ".dame_nombre_real($usuario);
|
||||||
$sql1='SELECT * FROM tusuario ORDER BY id_usuario';
|
$sql1='SELECT * FROM tusuario ORDER BY id_usuario';
|
||||||
$result=mysql_query($sql1);
|
$result=mysql_query($sql1);
|
||||||
@ -282,7 +220,7 @@ if ((give_acl($id_user, $id_grupo, "IM")==1) OR ($usuario == $id_user)) {
|
|||||||
echo "</select>";
|
echo "</select>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "<input type=hidden name='usuario' value='".$usuario."'>";
|
echo "<input type=hidden name='usuario_form2' value='".$usuario."'>";
|
||||||
echo $usuario." - (<i><a href='index.php?sec=usuario&sec2=operation/users/user_edit&ver=".$usuario."'>".$nombre_real."</a></i>)";
|
echo $usuario." - (<i><a href='index.php?sec=usuario&sec2=operation/users/user_edit&ver=".$usuario."'>".$nombre_real."</a></i>)";
|
||||||
}
|
}
|
||||||
// Tipo de estado
|
// Tipo de estado
|
||||||
@ -293,9 +231,9 @@ else {
|
|||||||
// 13 - Cerrada / Closed
|
// 13 - Cerrada / Closed
|
||||||
|
|
||||||
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
||||||
echo '<td class="datos"><b>'.$lang_label["status"].'</b><td class="datos"><select name="estado" class="w135">';
|
echo '<td class="datos"><b>'.$lang_label["status"].'</b><td class="datos"><select name="estado_form" class="w135">';
|
||||||
else
|
else
|
||||||
echo '<td class="datos"><b>'.$lang_label["status"].'</b><td class="datos"><select disabled name="estado" class="w135">';
|
echo '<td class="datos"><b>'.$lang_label["status"].'</b><td class="datos"><select disabled name="estado_form" class="w135">';
|
||||||
|
|
||||||
switch ( $estado ){
|
switch ( $estado ){
|
||||||
case 0: echo '<option value="0">'.$lang_label["in_state_0"]; break;
|
case 0: echo '<option value="0">'.$lang_label["in_state_0"]; break;
|
||||||
@ -314,9 +252,9 @@ echo '</select>';
|
|||||||
|
|
||||||
// Only owner could change source or user with Incident management privileges
|
// Only owner could change source or user with Incident management privileges
|
||||||
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
||||||
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b><td class="datos2"><select name="origen" class="w135">';
|
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b><td class="datos2"><select name="origen_form" class="w135">';
|
||||||
else
|
else
|
||||||
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b><td class="datos2"><select disabled name="origen" class="w135">';
|
echo '<tr><td class="datos2"><b>'.$lang_label["source"].'</b><td class="datos2"><select disabled name="origen_form" class="w135">';
|
||||||
|
|
||||||
// Fill combobox with source (origen)
|
// Fill combobox with source (origen)
|
||||||
if ($origen != "")
|
if ($origen != "")
|
||||||
@ -330,9 +268,9 @@ echo "</select>";
|
|||||||
|
|
||||||
// Group combo
|
// Group combo
|
||||||
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
||||||
echo '<td class="datos2"><b>'.$lang_label["group"].'</b><td class="datos2"><select name="grupo" class="w135">';
|
echo '<td class="datos2"><b>'.$lang_label["group"].'</b><td class="datos2"><select name="grupo_form" class="w135">';
|
||||||
else
|
else
|
||||||
echo '<td class="datos2"><b>'.$lang_label["group"].'</b><td class="datos2"><select disabled name="grupo" class="w135">';
|
echo '<td class="datos2"><b>'.$lang_label["group"].'</b><td class="datos2"><select disabled name="grupo_form" class="w135">';
|
||||||
if ($id_grupo != 0)
|
if ($id_grupo != 0)
|
||||||
echo "<option value='".$id_grupo."'>".$grupo;
|
echo "<option value='".$id_grupo."'>".$grupo;
|
||||||
$sql1='SELECT * FROM tgrupo ORDER BY nombre';
|
$sql1='SELECT * FROM tgrupo ORDER BY nombre';
|
||||||
@ -344,9 +282,9 @@ while ($row=mysql_fetch_array($result)){
|
|||||||
|
|
||||||
echo '</select><tr>';
|
echo '</select><tr>';
|
||||||
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
if ((give_acl($iduser_temp, $id_grupo, "IM")==1) OR ($usuario == $iduser_temp))
|
||||||
echo '<td class="datos"><b>'.$lang_label["priority"].'</b><td class="datos"><select name="prioridad" class="w135">';
|
echo '<td class="datos"><b>'.$lang_label["priority"].'</b><td class="datos"><select name="prioridad_form" class="w135">';
|
||||||
else
|
else
|
||||||
echo '<td class="datos"><b>'.$lang_label["priority"].'</b><td class="datos"><select disabled name="prioridad" class="w135">';
|
echo '<td class="datos"><b>'.$lang_label["priority"].'</b><td class="datos"><select disabled name="prioridad_form" class="w135">';
|
||||||
|
|
||||||
switch ( $prioridad ){
|
switch ( $prioridad ){
|
||||||
case 0: echo '<option value="0">'.$lang_label["informative"]; break;
|
case 0: echo '<option value="0">'.$lang_label["informative"]; break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user