foreach ($incident_list as $incident) { $class = $rows_per_page == $row + 1 ? "class='nobborder'" : ""; ?> <tr <?php if ($row++ % 2) { echo 'bgcolor="#EFEFEF"'; } ?> valign="middle"> <td <?php echo $class; ?> > <?php $enabled = Incident::user_incident_perms($conn, $incident->get_id(), 'closed') == false ? "disabled='disabled'" : ""; ?> <input type="checkbox" name="ticket<?php echo $row; ?> " value="<?php echo $incident->get_id() . "_" . $incident->get_priority(); ?> " <?php $enabled; ?> /> </td> <td <?php
if (!ossim_valid($tag, OSS_DIGIT, 'illegal:' . _("Tag"))) { $error = ossim_get_error_clean(); echo "error###" . $error; exit; } } //DB connection $db = new ossim_db(); $conn = $db->connect(); $ids = explode(",", $selected_incidents); $ids_updated = array(); $size = count($ids); if (is_array($ids) && $size > 0) { for ($i = 0; $i < $size; $i++) { $incident_id = $ids[$i]; if ($incident_id != "" && Incident::user_incident_perms($conn, $incident_id, 'show')) { if ($action == 'apply_tags') { $res = Incident::insert_incident_tag($conn, $incident_id, $tag); } else { $res = Incident::delete_incident_tags($conn, $incident_id); } if ($res === TRUE) { $ids_updated[$incident_id] = $incident_id; } } } if ($action == 'apply_tags') { $incident_tag = new Incident_tag($conn); if (count($ids) != count($ids_updated)) { echo "OK###DB Error###" . implode(",", $ids_updated) . "###"; } else {
$page = 1; } // First time we visit this page, show by default only Open incidents // when GET() returns NULL, means that the param is not set if (GET('status') === NULL) { $status = 'Open'; } // Close selected tickets if (GET('close') == _('Close selected')) { foreach ($_GET as $k => $cst_inc_id) { if (preg_match("/^ticket\\d+/", $k) && $cst_inc_id != '') { list($cst_incident) = Incident::search($conn, array('incident_id' => $cst_inc_id)); if (is_object($cst_incident) && !empty($cst_incident)) { //Incident is not already closed $cst_prev_status = $cst_incident->get_status(); if ($cst_prev_status != 'Closed' && Incident::user_incident_perms($conn, $cst_inc_id, 'closed')) { $cst_status = 'Closed'; $cst_priority = $cst_incident->get_priority(); $cst_user = Session::get_session_user(); $cst_description = sprintf(_('Ticket automatically closed by %s'), $cst_user); $cst_action = sprintf(_('Change ticket status from %s to Closed'), ucfirst($cst_incident->get_status())); $cst_transferred = NULL; $cst_tags = $cst_incident->get_tags(); Incident_ticket::insert($conn, $cst_inc_id, $cst_status, $cst_priority, $cst_user, $cst_description, $cst_action, $cst_transferred, $cst_tags); } } } } } $criteria = array('ref' => $ref, 'type' => $type, 'title' => $title, 'submitter' => $submitter, 'in_charge' => $in_charge, 'with_text' => $with_text, 'status' => $status, 'priority_str' => $priority, 'attach_name' => $attachment, 'related_to_user' => $related_to_user, 'tag' => $tag); ?>
$data['data'] = $validation_errors; } else { $data['status'] = 'OK'; Incident_ticket::delete($conn, $ticket_id); $db->close(); header("Location: incident.php?id={$incident_id}&edit={$edit}"); exit; } } } elseif ($action == 'e_subscription') { $incident_id = $_POST['incident_id'] = GET('incident_id'); $login = POST('login'); $validate = array('incident_id' => array('validation' => 'OSS_DIGIT', 'e_message' => 'illegal:' . _('Incident ID')), 'login' => array('validation' => 'OSS_USER_2', 'e_message' => 'illegal:' . _('Email changes to'))); $validation_errors = validate_form_fields('POST', $validate); if (is_array($validation_errors) && empty($validation_errors)) { if (!Incident::user_incident_perms($conn, $incident_id, $action)) { $validation_errors['extended_validatation'] = _('You are not allowed to subscribe a new user because you are neither *admin* or the ticket owner'); } } if (POST('ajax_validation_all') == TRUE) { $data['data'] = $validation_errors; if (is_array($validation_errors) && !empty($validation_errors)) { $data['status'] = 'error'; echo json_encode($data); } else { $data['status'] = 'OK'; echo json_encode($data); } exit; } else { if (is_array($validation_errors) && !empty($validation_errors)) {
<img align='absmiddle' src="../repository/images/editdocu.gif" border='0'/> <a href="../repository/index.php"><?php echo _("New document"); ?> </a> </th> </tr> </table> </td> <td valign='top'> <table width="100%" class="noborder"> <tr> <td style='white-space:nowrap;'> <?php if (Incident::user_incident_perms($conn, $id, 'delincident')) { $edit_action = "<a href='newincident.php?action=edit&ref={$ref}&incident_id={$id}&edit=1'>\n\t\t\t\t\t\t\t\t\t<img src='../vulnmeter/images/pencil.png' border='0' align='absmiddle' title='" . _("Edit ticket") . "'></a>"; $delete_action = "<a onClick=\"delete_ticket('{$id}');\"><img src='../pixmaps/delete.gif' border='0' align='absmiddle' title='" . _("Delete ticket") . "'></a>"; } else { $edit_action = "<span class='disabled'>\n\t\t\t\t\t\t\t\t\t<img src='../vulnmeter/images/pencil.png' border='0' align='absmiddle' title='" . _("Edit ticket") . "'></span>"; $delete_action = "<span class='disabled'><img src='../pixmaps/delete.gif' border='0' align='absmiddle' title='" . _("Delete ticket") . "'></span>"; } echo $edit_action; echo $delete_action; ?> <a href='#anchor'><img src="../pixmaps/tables/table_row_insert.png" border="0" align="absmiddle" title="<?php echo _("New comment"); ?> "></a> </td>
$order_mode = 'DESC'; } if ($page == "" || $page <= 0) { $page = 1; } // First time we visit this page, show by default only Open incidents // when GET() returns NULL, means that the param is not set if (GET('status') === null) { $status = 'Open'; } // Close selected tickets if (GET('close') == _("Close selected")) { foreach ($_GET as $k => $v) { if (preg_match("/^ticket\\d+/", $k) && $v != "") { $idprio = explode("_", $v); if (is_numeric($idprio[0]) && is_numeric($idprio[1]) && Incident::user_incident_perms($conn, $idprio[0], 'closed')) { Incident_ticket::insert($conn, $idprio[0], "Closed", $idprio[1], Session::get_session_user(), " ", "", "", array(), null); } } } } $criteria = array('ref' => $ref, 'type' => $type, 'title' => $title, 'submitter' => $submitter, 'in_charge' => $in_charge, 'with_text' => $with_text, 'status' => $status, 'priority_str' => $priority, 'attach_name' => $attachment, 'related_to_user' => $related_to_user, 'tag' => $tag); ?> <!-- filter --> <form name="filter" id="filter" method="GET" action="<?php echo $_SERVER["SCRIPT_NAME"]; ?> "> <input type="hidden" name="page" id="page" value=""/> <?php