SiT! Bugs - SiT!
View Issue Details
0001945SiT!incidentspublic2014-06-12 14:282014-06-12 14:30
Frans 
 
normalminorsometimes
newopen 
LinuxCentOS2.6+later
3.67 LTS 
 
0001945: Duplicated incidents
The users (engineers) are complaining about duplicated incidents.
I suspect they do a refresh of the page which assigns the incident to an engineer.
This refresh causes the duplication of the incident --> Reproducible.
The users pretend they don't do that (but I do not believe them).
Anyways, I included a test before creating the incident.
In the file incident_add.php, before the "insert into incidents",
I check the existence of an incident with the same title,
from the same user and for the same contact registrated
within the last three minutes.


    $lapso = $now - 180; // 180 sec = 3 min
    $ya_existe = exec_sql ("select id value from incidents where title = '{$incidenttitle}' and owner = '{$sit[2]}' and contact = '{$contactid}' and opened > {$lapso} ; ");
    if ($ya_existe != "")
        {
        $nombre = contact_realname ($contactid);
        $message = "Already exists an incident with title: {$incidenttitle}
Created by yourself for the contact {$nombre}
The incident number is ".$ya_existe.".";
        html_redirect ("main.php", FALSE, $message);
        return;
        }
No tags attached.
Issue History
2014-06-12 14:28FransNew Issue
2014-06-12 14:30FransNote Added: 0004945

Notes
(0004945)
Frans   
2014-06-12 14:30   
function exec_sql($sql) // Devuelve un solo campo de un solo registro ! El nombre del campo = "value".
    {
    $val = "";
    $result = mysql_query($sql);
    if (mysql_error()) trigger_error($sql." -- ".mysql_error(), E_USER_WARNING);
    
    // debug_log ("Frans exec_sql = ".$sql);
    
    if ($result != false)
        {
        if (mysql_num_rows($result) > 0)
            {
            $inf = mysql_fetch_object($result);

            // debug_log("Frans exec_sql inf.value = ".$inf->value);
        
            $val = $inf->value;
            }
        mysql_free_result($result);
        }
    return $val;
    }