Esempio n. 1
0
function api_mark_updated_incident($return_type, $params)
{
    $id_incident = $params[0];
    $extra_info = $params[1];
    $description = 'Updated';
    $result = db_process_sql_update('tincident_track', array('extra_info' => $extra_info), array('id_incident' => $id_incident, 'description' => $description));
    echo $result;
    return;
}
Esempio n. 2
0
             }
             fclose($files_h);
         } else {
             $return["status"] = "error";
             $return["message"] = __("An error ocurred while reading a file.");
             echo json_encode($return);
             return;
         }
     } else {
         $return["status"] = "error";
         $return["message"] = __("The package does not exist");
         echo json_encode($return);
         return;
     }
     if ($is_package) {
         $res = db_process_sql_update('tconfig', array('value' => $package_num), array('token' => 'current_package'));
     }
     $return["status"] = "success";
     echo json_encode($return);
     return;
 }
 $check_install_package = (bool) get_parameter("check_install_package");
 if ($check_install_package) {
     // 1 second
     //sleep(1);
     // Half second
     usleep(500000);
     ob_clean();
     $package = (string) get_parameter("package");
     // All files extracted
     $files_total = $package . "/files.txt";
			}
			if ($keep_cost == "true") {
				$values['have_cost'] = $wu_data['have_cost'];
			}
			if ($keep_public == "true") {
				$values['public'] = $wu_data['public'];
			}
			
			$result = db_process_sql_update('tworkunit', $values, array('id'=>$id));

			$id_workunit_task = get_db_sql ("SELECT id_task FROM tworkunit_task WHERE id_workunit = $id");
			$values_task['id_task'] = $id_task;
			if ($id_task == 0) { //No change option
				$values_task['id_task'] = $id_workunit_task;
			}
			$result_task = db_process_sql_update('tworkunit_task', $values_task, array('id_workunit'=>$id));
			if ($result && $result_task) {
				$msg = __('Succesfully updated');
			}
			else {
				$msg = __('Error in update');
				break;
			}
		}
		echo json_encode($msg);
		return;
		
	}
}

$id_user = $config["id_user"];
Esempio n. 4
0
     if ($config["email_on_incident_update"] == 0) {
         //add emails updates
         mail_incident($id_ticket, $owner, "", 0, 0);
     }
 }
 if ($old_incident['prioridad'] != $values['prioridad']) {
     incident_tracking($id_ticket, INCIDENT_PRIORITY_CHANGED, $values['prioridad']);
 }
 if ($old_incident['resolution'] != $values['resolution']) {
     incident_tracking($id_ticket, INCIDENT_RESOLUTION_CHANGED, $values['resolution']);
 }
 if ($old_incident['estado'] != $values['estado']) {
     if ($values['estado'] == 7) {
         $values_close['closed_by'] = $config['id_user'];
         $values_close['cierre'] = date('Y:m:d H:i:s');
         db_process_sql_update('tincidencia', $values_close, array('id_incidencia' => $id_ticket));
     }
     incident_tracking($id_ticket, INCIDENT_STATUS_CHANGED, $values['estado']);
 }
 if ($old_incident['id_usuario'] != $values['id_usuario']) {
     incident_tracking($id_ticket, INCIDENT_USER_CHANGED, $values['id_usuario']);
 }
 audit_db($old_incident['id_usuario'], $config["REMOTE_ADDR"], "Ticket updated", "User " . $config['id_user'] . " ticket updated #" . $id_ticket);
 if ($medal_option) {
     switch ($medal_option) {
         case 1:
             //Add gold medal
             incident_tracking($id_ticket, INCIDENT_GOLD_MEDAL_ADDED, $values['id_usuario']);
             audit_db($config['id_user'], $config["REMOTE_ADDR"], "Gold medal added", "Gold medal added by user " . $config['id_user'] . " to the ticket #" . $id_ticket);
             break;
         case 2: