Example #1
0
 public function insertIntoIncident(Incident $tableau)
 {
     echo "TEST : " . $tableau->getDescription();
     try {
         $count = $this->db->exec("INSERT INTO Incident(Description, Type, Id, Adresse, Severite, Reference, Image)\n                                  VALUES ({$tableau}-> getDescription(), {$tableau->getType}(), 1,\n                                          {$tableau->getAdresse}(), {$tableau->getSeverite}(), {$tableau->getReference}(),\n                                          {$tableau->getImgURI}());") or die(print_r($this->db->errorInfo(), true));
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
     return "Nombre de lignes insérées : " . $count;
 }
 public function select_incident($id)
 {
     //echo $id;
     $incident = new Incident();
     $result = $incident->select_incident($id);
     if ($result) {
         return View::make('incident')->with('incident', $result);
     } else {
         return "data tidak ada";
     }
 }
 /**
  * @param null $params
  * @return FieldList
  */
 public function getFrontendFields($params = NULL)
 {
     $fields = new FieldList();
     $config = new FrontEndGridFieldConfig_RecordEditor(20);
     $gf = new FrontEndGridField('Incidents', 'Incidents', Incident::get(), $config);
     $fields->add($gf);
     return $fields;
 }
function get_open_tickets($conn)
{
    Incident::search($conn, array('status' => 'not_closed'), 'life_time', 'ASC', 1, 10);
    $tickets = Incident::search_count($conn);
    $return['error'] = FALSE;
    $return['output'] = intval($tickets);
    return $return;
}
Example #5
0
 public function updateParent()
 {
     if ($this->object_type == "ticket") {
         $ticket = Ticket::find($this->object_id);
         $ticket->status_id = $this->status_id;
         $ticket->save();
     } else {
         if ($this->object_type == "incident") {
             $ticket = Incident::find($this->object_id);
             $ticket->status_id = $this->status_id;
             $ticket->save();
         }
     }
 }
Example #6
0
 public function insertIntoIncident(Incident &$incident)
 {
     $description = $incident->getDescription();
     $type = $incident->getType();
     $adresse = $incident->getAdresse();
     $severite = $incident->getReference();
     $reference = $incident->getReference();
     $target = $incident->getImgURI();
     try {
         $count = $this->db->exec("INSERT INTO Mairie.Incident(Description, Type, Adresse, Severite, Reference, Image)\n                                      VALUES ('{$description}',\n                                              '{$type}',\n                                              '{$adresse}',\n                                              '{$severite}',\n                                              '{$reference}',\n                                              '{$target}');") or die(print_r($this->db->errorInfo(), true));
     } catch (PDOException $e) {
         echo $e->getMessage();
     }
     return "Nombre de lignes insérées : " . $count;
 }
Example #7
0
        } else {
            $data = "['" . _("No tickets") . "',0]";
            $colors = '"#E9967A"';
        }
        break;
    case 'ticketTags':
        $type_graph = 'pie';
        $legend = empty($_GET['legend']) ? "w" : GET('legend');
        $ticket_by_tags = Incident::incidents_by_tag($conn, null, $user);
        $i = 0;
        if (is_array($ticket_by_tags) && !empty($ticket_by_tags)) {
            if ($i < 10) {
                foreach ($ticket_by_tags as $type => $ocurrences) {
                    $type_short = strlen($type) > 28 ? substr($type, 0, 25) . " [...]" : $type;
                    $data[] = "['" . $type_short . "'," . $ocurrences . "]";
                    $links[] = Menu::get_menu_url("../incidents/index.php?tag=" . Incident::get_id_by_tag($conn, $type) . "&status=not_closed", 'analysis', 'tickets', 'tickets');
                }
            } else {
                break;
            }
            $data = implode(",", $data);
            $links = "'" . implode("','", $links) . "'";
        } else {
            $data = "['" . _("No tickets") . "',0]";
            $colors = '"#E9967A"';
        }
        break;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
Example #8
0
					<td class="blackp" style="font-size:8px;border:0px" align="center" nowrap='nowrap'><?php 
echo $ava_date;
?>
</td>
					<td class="blackp" nowrap='nowrap' style="text-align:right"><?php 
echo _("High Prio");
?>
:</td>
					<td class="blackp" style="text-align:left">
						<a href="../forensics/base_qry_main.php?clear_allcriteria=1&num_result_rows=-1&submit=Query+DB&current_view=-1&sort_order=time_d&ip=<?php 
echo urlencode($host);
?>
&date_range=All" class="blackp">
							<?php 
$bgcolor = Incident::get_priority_bgcolor($ava_highprio);
$fgcolor = Incident::get_priority_fgcolor($ava_highprio);
$ava_highprio = empty($ava_highprio) ? " - " : $ava_highprio;
?>
							<table class="transparent" width='20' bgcolor="<?php 
echo $bgcolor;
?>
">
								<tr>
									<td style="text-align:center;color:<?php 
echo $fgcolor;
?>
" bgcolor="<?php 
echo $bgcolor;
?>
" width='20' class='blackp'>
										<b><?php 
Example #9
0
						</td>
					</tr>
				</table>
			</td>
			<!-- end ticket contents -->
       
			<!-- ticket summary -->
			<td style="border-top-width: 0px; width: 230px" valign="top">
				<table class="noborder">
					<tr>
						<th><strong><?php 
    echo _("Status");
    ?>
: </strong></th>
						<td nowrap='nowrap' style="text-align:left;padding-left:5px;"><?php 
    Incident::colorize_status($status);
    ?>
</td>
					</tr>
					
					<tr valign="middle">
						<th><strong><?php 
    echo _("Priority");
    ?>
: </strong></th>
						<td nowrap='nowrap' style="text-align:left;">
							<table class="noborder"><tr><td><?php 
    echo $prio_box;
    ?>
</td><td> - <?php 
    echo $prio_str;
Example #10
0
                $default_value = $custom_values[$field['name']]->get_content();
                $type = $custom_values[$field['name']]->get_type();
                $id = $custom_values[$field['name']]->get_id();
            } else {
                $default_value = null;
            }
            $wf1_types = array('Select box', 'Date', 'Date Range', 'Checkbox', 'Radio button');
            if (in_array($field['type'], $wf1_types)) {
                $class_wf = array('wfl1', 'wfr1');
            } else {
                $class_wf = array('wfl2', 'wfr2');
            }
            echo "<div class='" . $class_wf[0] . "'>";
            if (!empty($default_value) && $type == 'File') {
                echo "<div style='padding-bottom: 3px; text-align: left' id='delfile_" . $params['id'] . "'>";
                echo Incident::format_custom_field($id, $incident_id, $default_value, $type);
                echo "<span style='margin-left: 3px'>\n\t\t\t\t\t\t\t\t<a style='cursor:pointer' onclick=\"delete_file('" . $params['id'] . "')\"><img src='../pixmaps/delete.gif' align='absmiddle' title='" . _("Delete File") . "'/></a>\n\t\t\t\t\t\t\t  </span>";
                echo "</div>";
                echo "<input type='hidden' name='del_" . $params['name'] . "' id='del_" . $params['id'] . "' value='0'/>";
            }
            echo $form_builder->draw_element($field['type'], $default_value);
            echo "</div>";
            $req_f_inherent = array('Check True/False', 'Check Yes/No', 'Asset', 'Slider');
            $mandatory = $field['required'] == 1 && !in_array($field['type'], $req_f_inherent) ? "<span>(*)</span>" : "";
            echo "<div class='" . $class_wf[1] . "'>" . $mandatory . "</div>";
            echo "</td>";
            echo "</tr>\n";
            $cont++;
        }
    }
}
Example #11
0
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "IncidentsIncidents");
$id = intval(GET('id'));
ossim_valid($id, OSS_NULLABLE, OSS_ALPHA, OSS_SCORE, 'illegal:' . _("id"));
if (ossim_error()) {
    echo ossim_error();
    exit;
}
if (!empty($id)) {
    $db = new ossim_db();
    $conn = $db->connect();
    $result = $conn->Execute("SELECT incident_id FROM incident_file WHERE id={$id}");
    $ticket_id = $result->fields["incident_id"];
    $incident_list = Incident::search($conn, array('incident_id' => $ticket_id));
    if (count($incident_list) != 1) {
        echo ossim_error(_("Invalid ticket ID or insufficient permissions"));
        exit;
    }
    if ($files = Incident_file::get_list($conn, "WHERE id = {$id}")) {
        $type = $files[0]->get_type();
        $fname = $files[0]->get_name();
        header("Content-type: {$type}");
        header('Content-Disposition: attachment; filename="' . $fname . '"');
        print $files[0]->get_content();
    }
    $db->close($conn);
} else {
    echo ossim_error(_("Invalid Incident ID"));
    exit;
Example #12
0
                break;
            case 'workunit':
                $workunit = new Workunit();
                $workunit->show();
                break;
            case 'workorders':
                $workorders = new Workorders();
                $workorders->show();
                break;
            case 'workorder':
                $workorder = new Workorder();
                $workorder->show();
                break;
            case 'incidents':
                $incidents = new Incidents();
                $incidents->show();
                break;
            case 'incident':
                $incident = new Incident();
                $incident->show();
                break;
            case 'calendars':
                $calendars = new Calendars();
                $calendars->show();
                break;
            default:
                $home = new Home();
                $home->show();
        }
        break;
}
            <?php 
echo $service_data['version'] != '' ? $service_data['version'] : '-';
?>
        </div>
    
        <div class='tray_title'><?php 
echo _('Vulnerabilities');
?>
</div>
        <div class='tray_content'>
            <?php 
if (count($vulns) > 0) {
    ?>
<ul class='tray_list_vulns'><?php 
    foreach ($vulns as $vuln) {
        $risk_data = Incident::get_risk_info($vuln['risk']);
        $risk_name = $risk_data[2];
        ?>
                    <li>
                        <div class='vuln_<?php 
        echo $risk_name;
        ?>
'>&nbsp;</div>
                        <?php 
        echo $vuln['msg'];
        ?>
                    </li>
                    <?php 
    }
    ?>
</ul><?php 
<table cellpadding="0" cellspacing="0" border="0" class="" style="margin:5px;width:100%;">
<tr> 
<th>事件分类:</th>
<td style="padding: 12px; border:none">
<?php 
foreach (Incident::getTypeDefines() as $key => $typeName) {
    ?>
<br><input type="radio" name="arr[type]" value="<?php 
    echo $key;
    ?>
"><?php 
    echo $typeName;
    ?>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <?php 
    $res = Incident::getLableDefines();
    $labelName = $res[$typeName];
    $labelCategory = DAL::get()->find_by_name('LabelCategory', $labelName);
    $labels = $labelCategory->labels;
    if (false == empty($labels)) {
        foreach ($labels as $label) {
            if ($label->isDeleted == false) {
                ?>
<input type="radio" name="arr[title]" value="<?php 
                echo $label->name;
                ?>
"><?php 
                echo $label->name;
                ?>
&nbsp;&nbsp;&nbsp;
            <?php 
            $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)) {
            $data['status'] = 'error';
            $data['data'] = $validation_errors;
        } else {
            $data['status'] = 'OK';
            $action = POST('s_action');
            if ($action == 'subscribe') {
                Incident::insert_subscription($conn, $incident_id, $login);
            } elseif ($action == 'unsubscribe') {
                Incident::delete_subscriptions($conn, $incident_id, $login);
            }
            $db->close();
            header("Location: incident.php?id={$incident_id}&edit={$edit}");
            exit;
        }
    }
}
if (is_array($data['data']) && !empty($data['data'])) {
    $txt_error = "<div>" . _('We found the following errors') . ":</div>\n\t\t\t\t\t\t  <div style='padding:0px 3px 3px 15px;'>" . implode("<br/>", $data['data']) . "</div>";
    $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => FALSE), 'style' => 'width: 80%; margin: 20px auto; text-align: left;');
    $nt = new Notification('nt_1', $config_nt);
    $nt->show();
}
Example #16
0
    }
}
//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 {
            echo "OK###Tag added###";
        }
        echo "<div style='color:grey; font-size: 10px; padding-bottom: 3px;'>" . $incident_tag->get_html_tag($tag) . "</div>";
    } else {
Example #17
0
 }
 $param_filters["assets"] = array();
 if (empty($param_filters['user'])) {
     if (is_array($assets_filters["assets"]['host'])) {
         foreach ($assets_filters["assets"]['host'] as $k => $v) {
             $param_filters["assets"][$k] = $v['ip'];
         }
     }
     if (is_array($assets_filters["assets"]['net'])) {
         foreach ($assets_filters["assets"]['net'] as $k => $v) {
             $param_filters["assets"][$k] = $v['ip'];
         }
     }
 }
 $operator = $chart_info['type'] != '' ? $chart_info['type'] : 'max';
 $list = Incident::get_list_filtered($conn, $param_filters["assets"], " AND incident.status = 'Open'", $param_filters["user"]);
 if (is_array($list) && !empty($list)) {
     $min = 10;
     $max = 0;
     $avg = 0;
     foreach ($list as $t) {
         if ($t->get_priority() < $min) {
             $min = $t->get_priority();
         }
         if ($t->get_priority() > $max) {
             $max = $t->get_priority();
         }
         $avg += $t->get_priority();
     }
     switch ($operator) {
         case 'min':
Example #18
0
}
while (!$rs->EOF) {
    $values = $rs->fields["Today"] . "," . $rs->fields["Yesterd"] . "," . $rs->fields["2DAgo"] . "," . $rs->fields["Week"] . "," . $rs->fields["2Weeks"];
    $rs->MoveNext();
}
// Tickets
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => "CURDATE()"), "", "", 1, 99999999);
$today = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), INTERVAL -1 DAY)", "CURDATE()")), "", "", 1, 999999999);
$yday = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_2Ago . ")", $_2Ago_interv)), "", "", 1, 999999999);
$ago2 = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_Week . ")", $_Week_interv)), "", "", 1, 999999999);
$week = Incident::search_count($conn);
$incident_list = Incident::search($conn, array("status" => "Open", "last_update" => array("DATE_ADD(CURDATE(), " . $_2Week . ")", $_2Week_interv)), "", "", 1, 999999999);
$week2 = Incident::search_count($conn);
$values2 = $today . "," . $yday . "," . $ago2 . "," . $week . "," . $week2;
//
$db->close($conn);
$db->close($conn2);
//
$alarm_urls = "'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 86400) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 172800) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 604800) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
$alarm_urls .= ",'../control_panel/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=1&date_from=" . gmdate("Y-m-d", $timetz - 1209600) . "&date_to=" . gmdate("Y-m-d", $timetz) . "'";
?>
  
	<script class="code" type="text/javascript">
	
		var links = [<?php 
 public function status()
 {
     $status = new Stattus();
     $status->object_type = Input::get('object_type');
     $status->updated_by = Auth::employee()->get()->employee_identity;
     $status->status_id = Input::get('status_id');
     if (Input::get('object_type') == 'ticket') {
         $Ticket = Ticket::where('id', Input::get('object_id'))->first();
         if (Input::get('status_id') != $Ticket->status_id) {
             $status->object_id = Input::get('object_id');
             $status->save();
             $status->updateParent($status->object_id);
             $assignTicket = AssignTicket::where('ticket_no', $Ticket->ticket_no)->orderBy('id', 'desc')->first();
             if ($assignTicket && Input::get('status_id') == 4) {
                 $assignTicket->complete = 1;
                 $assignTicket->save();
             }
             return Redirect::back()->with('success', 'Status Updated Succesfully');
         } else {
             return Redirect::back()->with('failure', 'Dupilcate Status Not Updated');
         }
     } else {
         $object_id = Input::get('object_id');
         if ($object_id) {
             foreach ($object_id as $key) {
                 $Incident = Incident::where('id', $key)->first();
                 $server = ServerDetails::where('id', $Incident->incident_id)->first();
                 if ($server->status == 0 && Input::get('status_id') == 4) {
                     return Redirect::back()->with('failure', 'Incident Yet not to be closed');
                 } else {
                     $status->object_id = $key;
                     $status->save();
                     $status->updateParent($status->object_id);
                 }
             }
             return Redirect::back()->with('success', 'Status Updated Succesfully');
         }
         return Redirect::back()->with('failure', 'Incident Invaild');
     }
 }
Example #20
0
    /**
     * This function builds the content of the <code>body</code>.
     *
     * @access public
     * @author kalmer
     * @param string         $parameters['alias']          the alias
     * @param string[string] $parameters['breadcrumb']     the breadcrumb as
     * 		links and texts
     * @param boolean        $parameters['broad']          Do we show the broad
     * 		page?
     * @param string         $parameters['content']        the content to be
     * 		displayed on the page
     * @param boolean        $parameters['error']          Are we in the error
     * 		state?
     * @param boolean        $parameters['facebookOnline'] Is Facebook online?
     * @param string         $parameters['id']             the ID of the object
     * 		(optional)
     * @param string         $parameters['type']           the type of the
     * 		original object
     * @param integer        $parameters['idOfLanguage']   the ID of the
     * 		language
     * @param boolean        $parameters['intro']          Is it the intro page?
     * @param Page           $parameters['page']           the page
     * @param string         $parameters['suffix']         the suffix
     * @param Human|boolean  $parameters['user']           the current user or
     * 		<code>FALSE</code>
     * @param integer        $parameters['width']          the width
     * @uses ALBUMS                                 for link the widget for the
     * 		Facebook page
     * @uses DEFAULT_LANGUAGE                       for knowing the current
     * 		language
     * @uses DOMAIN                                 for addressing
     * @uses Language                               for translations
     * @uses MenuItem                               for menus
     * @uses NestedSet                              for menus
     * @uses NESTED_SET_MENU_FOR_INTRO              for the menu on the intro
     * 		page
     * @uses NESTED_SET_MENU_FOR_LOGGED_IN          for people logged in
     * @uses NESTED_SET_MENU_FOR_MAIN_ADMINISTRATOR for the administration menu
     * @uses NESTED_SET_MENU_FOR_REGISTERED_USER    for registered user
     * @uses NESTED_SET_MENU_MAIN_BUTTONS           for main buttons
     * @uses NESTED_SET_MENU_PUBLIC                 for the public menu
     * @uses NESTED_SET_MENU_WE                     for the menu about us
     * @uses O_FOLDER                               for the templates from "O"
     * @uses OFFLINE                                for displaying different
     * 		content for offline and online
     * @uses RequisitesView                         for requisites
     * @uses HumanView                              for log-in-form
     * @uses View                                   for error handling
     */
    public static function buildBody($parameters)
    {
        require_once O_FOLDER . 'errors/ErrorView.php';
        \PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array(new ErrorView(), 'raiseError'));
        require_once 'HTML/Template/IT.php';
        $tpl = new \HTML_Template_IT(sprintf('%1$s/../assets/tpl/%2$u', dirname(__FILE__), $parameters['width']));
        $tpl->loadTemplatefile('body.tpl');
        if (isset($parameters['broad']) || $parameters['width'] < 321) {
            $jsNormal = '';
        } else {
            $templateForJsNormal = new \HTML_Template_IT(sprintf('%1$s/../assets/tpl/%2$u', dirname(__FILE__), $parameters['width']));
            $templateForJsNormal->loadTemplatefile('body.tpl');
            if (!OFFLINE && isset($parameters['facebookOnline'])) {
                $templateForJsNormal->setCurrentBlock('facebook-albums');
                $templateForJsNormal->setVariable(array('SUBFOLDER-FOR-ALBUMS' => ALBUMS));
                $templateForJsNormal->parseCurrentBlock();
            }
            $templateForJsNormal->setCurrentBlock('js-normal');
            $templateForJsNormal->setVariable(array('BEGINNING-OF-URL-IN-JS-NORMAL' => DOMAIN));
            $templateForJsNormal->parseCurrentBlock();
            $jsNormal = $templateForJsNormal->get('js-normal');
        }
        $templateForScripts = new \HTML_Template_IT(O_FOLDER . 'assets/tpl');
        $templateForScripts->loadTemplatefile('page_Kai.tpl');
        $templateForScripts->setCurrentBlock('scripts');
        $templateForScripts->setVariable(array('JS-NORMAL' => $jsNormal));
        $templateForScripts->parse('scripts');
        $isError = isset($parameters['isError']) && $parameters['isError'];
        if (isset($parameters['user']) && is_object($parameters['user']) && !$isError) {
            if (isset($parameters['breadcrumb'])) {
                foreach ($parameters['breadcrumb'] as $link => $val) {
                    $tpl->setCurrentBlock('position');
                    $tpl->setVariable(array('LINK-TO-POSITION' => $link, 'STEP' => end($parameters['breadcrumb
						']) === $val ? 'active' : 'completed', 'VALUE-OF-POSITION' => str_replace(' ', '&#160;', $val)));
                    $tpl->parseCurrentBlock();
                }
            } else {
                if (isset($_SESSION['nestedSets'])) {
                    require_once O_FOLDER . 'puu/NestedSet.php';
                    $nestedSets = explode(',', $_SESSION['nestedSets']);
                    $idOfNestedSet = $nestedSets[count($nestedSets) - 1];
                    $nestedSetForPosition = new NestedSet();
                    $nestedSetForPosition->setId($idOfNestedSet);
                    $nestedSetForPosition->setCompleteNestedSet();
                    $descendantNestedSets = $nestedSetForPosition->getDescendantNestedSets();
                    if (isset($descendantNestedSets[$idOfNestedSet])) {
                        foreach ($descendantNestedSets[$idOfNestedSet]->path as $idNestedSet => $txt) {
                            $elInPath = new NestedSet($idNestedSet);
                            $descendantNestedSetsOfElementInPath = $elInPath->getDescendantNestedSets();
                            if (isset($descendantNestedSetsOfElementInPath[$idNestedSet]->idEl)) {
                                require_once dirname(__FILE__) . '/../puu/SystemMenuItem.php';
                                $menuEl = new SystemMenuItem();
                                $menuEl->setId($descendantNestedSetsOfElementInPath[$idNestedSet]->idEl);
                                $menuEl->setCompleteSystemMenuItem();
                                if (isset($menuEl->page)) {
                                    $href = '?function=loadPage&amp;page=' . $menuEl->page->getId();
                                    $caption = $menuEl->page->title;
                                } else {
                                    $href = strtr($menuEl->ref, '&', '&amp;');
                                    $caption = $menuEl->title;
                                    if (strstr($menuEl->ref, '[ID-OF-USER]') > -1) {
                                        if (isset($_SESSION['User_ID'])) {
                                            $href = str_replace('[ID-OF-USER]', '&amp;idHuman=' . $_SESSION['idUser'], $menuEl->ref);
                                        }
                                    }
                                    if (strstr($menuEl->ref, '[ID-OF-COMPANY]') > -1) {
                                        if (isset($_SESSION['idCompany'])) {
                                            $href = str_replace('[ID-OF-COMPANY]', '&amp;idContact=' . $_SESSION['idCompany'], $menuEl->ref);
                                        }
                                    }
                                }
                                $tpl->setCurrentBlock('position');
                                $tpl->setVariable(array('BEGINNING-OF-URL' => DOMAIN, 'LINK-TO-POSITION' => isset($href) ? $href : '#', 'STEP' => end($descendantNestedSets[$idOfNestedSet]->path) === $txt ? 'active' : 'completed', 'VALUE-OF-POSITION' => str_replace(' ', '&#160;', $caption)));
                                $tpl->parseCurrentBlock();
                            }
                        }
                    }
                }
            }
        }
        $menus = array();
        require_once O_FOLDER . 'puu/SystemMenuItemView.php';
        if ($isError) {
            $buildMenuOfLanguages = FALSE;
        } else {
            $buildMenuOfLanguages = TRUE;
            if (isset($parameters['user']) && is_object($parameters['user'])) {
                require_once O_FOLDER . 'puu/SystemMenuItemView.php';
                if ($parameters['user']->isMainAdministrator()) {
                    $isMainAdministrator = TRUE;
                    $menus['forMainAdministrator'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => '2', 'root' => NESTED_SET_MENU_FOR_MAIN_ADMINISTRATOR, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                    $menus['loggedIn'] = SystemMenuItemView::buildMenuForLoggedIn(array('alias' => $parameters['alias'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                    $menus['forRegisteredUser'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => 'open', 'root' => NESTED_SET_MENU_FOR_REGISTERED_USER, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                } else {
                    $isMainAdministrator = FALSE;
                    $menus['loggedIn'] = SystemMenuItemView::buildMenuForLoggedIn(array('alias' => $parameters['alias'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                    $menus['forRegisteredUser'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => 'open', 'root' => NESTED_SET_MENU_FOR_REGISTERED_USER, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                }
            } else {
                $isMainAdministrator = FALSE;
            }
            // echo ' 679: <pre>';print_r(debug_print_backtrace()); echo '</pre>';
            $idOfObject = $parameters['page']->getId();
            if ($parameters['page']->getTypeOfObject() === 'Page' && ID_OF_OPENING_PAGE != $idOfObject || $parameters['page']->getTypeOfObject() != 'Page' || $isMainAdministrator) {
                $menus['aboutUs'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => 'we', 'root' => NESTED_SET_MENU_WE, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
            }
        }
        $menus['public'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => '1', 'root' => NESTED_SET_MENU_PUBLIC, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
        if ($parameters['page']->getTypeOfObject() === 'Page' && ID_OF_OPENING_PAGE == $idOfObject) {
            $menus['forIntro'] = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => 'intro', 'root' => NESTED_SET_MENU_FOR_INTRO, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
        }
        $outerNews = array();
        if ($parameters['width'] > 899 && !$isError && !OFFLINE) {
            require_once O_FOLDER . 'magpierss-0.72/rss_fetch.inc';
            $rss = fetch_rss(RSS_FEED);
            if (is_object($rss)) {
                $firstOuterNewsItems = array_slice($rss->items, 0, 1);
                $secondOuterNewsItems = array_slice($rss->items, 1, 1);
                $remainingOuterNewsItems = array_slice($rss->items, 2, 1);
                if ($parameters['width'] > 1301 && $parameters['width'] < 1800) {
                    $additionalClassForOuterNews = 'CaptionInEdge';
                } else {
                    $additionalClassForOuterNews = 'CaptionInWideColumn';
                }
                $outerNews['first'] = BodyView::buildOuterNews(array('class' => $additionalClassForOuterNews, 'outerNewsItem' => $firstOuterNewsItems[0], 'width' => $parameters['width']));
                $outerNews['second'] = BodyView::buildOuterNews(array('class' => $additionalClassForOuterNews, 'outerNewsItem' => $secondOuterNewsItems[0], 'width' => $parameters['width']));
                $outerNews['remaining'] = '';
                foreach ($remainingOuterNewsItems as $remainingItem) {
                    $outerNews['remaining'] .= BodyView::buildOuterNews(array('class' => $additionalClassForOuterNews, 'outerNewsItem' => $remainingItem, 'width' => $parameters['width']));
                }
            }
        }
        if (!OFFLINE && !$isError) {
            require_once O_FOLDER . 'varud/Inquiry.php';
            $inquiry = new \o\Inquiry();
            $currentSupporterLogos = '';
            if (isset($_GET['idEvent']) || isset($_GET['iDOCompetition'])) {
                if (isset($_GET['idEvent'])) {
                    require_once dirname(__FILE__) . '/../o/turniirid/Incident.php';
                    $event = new \o\Incident($_GET['idEvent']);
                } else {
                    $competition = new \o\Competition($_GET['iDOCompetition']);
                    $event = $competition->event;
                }
                foreach ($inquiry->categories as $cat) {
                    $supporterLogos = $event->getLogos($cat['id']);
                    if (sizeOf($supporterLogos) > 0) {
                        $currentSupporterLogos .= BodyView::buildLogos(array('folder' => '/assets/tpl', 'file' => 'page_Kai', 'logos' => $supporterLogos, 'block' => 'current', 'category' => $cat, 'sizes' => array('width' => 132, 'height' => 120), 'widthOfBlock' => 132));
                    }
                }
            } else {
                if ($parameters['width'] > 320) {
                    foreach ($inquiry->categories as $cat) {
                        require_once O_FOLDER . 'turniirid/Incident.php';
                        $supporterLogos = Incident::getActualLogos($cat['id']);
                        if (sizeOf($supporterLogos) > 0) {
                            $currentSupporterLogos .= BodyView::buildLogos(array('folder' => '/assets/tpl', 'file' => 'page_Kai', 'logos' => $supporterLogos, 'block' => 'current', 'category' => $cat, 'sizes' => array('width' => $parameters['width'] > 1301 ? 200 : 122, 'height' => 244), 'widthOfBlock' => $parameters['width'] > 1800 ? 200 : 122));
                        }
                    }
                }
            }
        }
        $menus['mainButtons'] = SystemMenuItemView::buildMenu(array('block' => 'mainButtons', 'root' => NESTED_SET_MENU_MAIN_BUTTONS, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
        $login = '';
        require_once O_FOLDER . 'View.php';
        if (!$isError) {
            require_once O_FOLDER . 'haldus/kasutajad/HumanView.php';
            if (isset($parameters['user']) && is_object($parameters['user']) && $parameters['user']->isLoggedIn(array($parameters['suffix']))) {
                $contentOfLogin = HumanView::buildLoggedIn(array('suffix' => $parameters['suffix'], 'width' => $parameters['width']));
            } else {
                $contentOfLogin = \o\HumanView::buildButtonForLoginForm(array('isDraggable' => FALSE, 'width' => $parameters['width']));
                // 				$login .= HumanView::buildLoginForm(array (
                // 					'functions'               => array (),
                // 					'idOfFieldOfInfo'         => 'messageForLoggingIn',
                // 					'idOfFieldOfInfoOriginal' => '',
                // 					'idOfTarget'              => 'wrapperForLoggingIn',
                // 					'suffix'                  => $parameters['suffix'],
                // 					'width'                   => $parameters['width']
                // 				));
            }
            // echo ' 760: ', $contentOfLogin;
            $login = \o\View::buildTarget(array('buildNavigation' => FALSE, 'content' => $contentOfLogin, 'highSlidable' => FALSE, 'id' => '', 'type' => 'ButtonsOfLogin', 'insertionAddition' => '', 'width' => $parameters['width']));
        }
        // echo ' 772: ', $login;
        if (isset($parameters['broad']) && $parameters['broad']) {
            // 			echo ' 763: ', $parameters['content'];
            $contentOfSite = BodyView::buildBig(array('content' => $parameters['content'], 'width' => $parameters['width']));
        } else {
            $contentOfSite = BodyView::buildNormal(array('content' => $parameters['content'], 'currentSupporterLogos' => $isError ? NULL : $currentSupporterLogos, 'user' => $parameters['user'], 'id' => isset($parameters['id']) ? $parameters['id'] : NULL, 'type' => isset($parameters['type']) ? $parameters['type'] : NULL, 'idOfLanguage' => $parameters['idOfLanguage'], 'login' => $login, 'menus' => $menus, 'outerNews' => $outerNews, 'page' => $parameters['page'], 'rss' => isset($rss) ? $rss : NULL, 'suffix' => $parameters['suffix'], 'width' => $parameters['width']));
        }
        // echo ' 783: ', $contentOfSite;
        if (isset($_SESSION['nestedSets']) && !$isError) {
            $nestedSets = array_reverse(array_slice(explode(',', $_SESSION['nestedSets']), 3));
            foreach ($nestedSets as $nestedSet) {
                require_once O_FOLDER . 'puu/SystemMenuItemView.php';
                $submenu = SystemMenuItemView::buildMenu(array('alias' => $parameters['alias'], 'block' => 'submenu', 'root' => $nestedSet, 'secondLevel' => TRUE, 'suffix' => $parameters['suffix'], 'user' => $parameters['user'], 'width' => $parameters['width']));
                if ($submenu != '') {
                    break;
                }
            }
        }
        if ($parameters['width'] > 1301 && $parameters['width'] < 1800 && !$isError && !isset($parameters['intro'])) {
            $bestPlayers = BodyView::buildBestPlayers(array('suffix' => $parameters['suffix'], 'width' => $parameters['width']));
        } else {
            $bestPlayers = '';
        }
        // echo ' 974: ', FB_BADGE;
        require_once O_FOLDER . 'rekvisiidid/RequisitesView.php';
        // echo ' 833: ', BodyView::buildLanguageMenu(
        // 				array (
        // 					'id'     => isset($parameters['id']) ?
        // 							$parameters['id']: NULL,
        // 					'type'   => $parameters['type'],
        // 					'suffix' => $parameters['suffix'],
        // 					'width'  => $parameters['width']
        // 				)
        // 			);
        // echo ' 855: ', $login;
        $tpl->setCurrentBlock('body');
        $tpl->setVariable(array('BADGE' => FB_BADGE, 'USERNAME-IN-FACEBOOK' => ALBUMS, 'BEST-PLAYERS-IN-BODY' => $bestPlayers, 'CONTENT-OF-SITE' => $contentOfSite, 'CURRENT-SUPPORTER-LOGOS' => isset($currentSupporterLogos) ? $currentSupporterLogos : '', 'HUMAN' => \o\View::buildTarget(array('buildNavigation' => TRUE, 'highSlidable' => TRUE, 'id' => '', 'insertionAddition' => '', 'type' => 'user', 'width' => $parameters['width'])), 'LANGUAGES' => isset($parameters['type']) && $buildMenuOfLanguages ? BodyView::buildLanguageMenu(array('id' => isset($parameters['id']) ? $parameters['id'] : NULL, 'type' => $parameters['type'], 'suffix' => $parameters['suffix'], 'width' => $parameters['width'])) : '', 'LOCATION' => DOMAIN, 'LOGGED-IN' => $login, 'LOGIN' => \o\View::buildTarget(array('buildNavigation' => TRUE, 'highSlidable' => TRUE, 'id' => '', 'idOfDiv' => 'Login', 'insertionAddition' => '', 'type' => 'Login', 'width' => $parameters['width'])), 'MENU-WITH-PRIORITY-LOGGED-IN' => isset($menus['loggedIn']) ? $menus['loggedIn'] : '', 'MENU-WITH-PRIORITY-PUBLIC' => isset($menus['public']) ? $menus['public'] : '', 'REQUISITES' => RequisitesView::buildRequisites(array('user' => $parameters['user'], 'width' => $parameters['width'])), 'SCRIPTS' => $templateForScripts->get('scripts'), 'SUBMENU' => isset($submenu) ? $submenu : ''));
        $tpl->parseCurrentBlock();
        // 		echo ' 866: ', $contentOfSite;
        return $tpl->get('body');
    }
                <td style='border-bottom:none;' valign='middle'><?php 
        echo _("No Data Available");
        ?>
</td>
            </tr>
        </table>
        <?php 
    }
}
$db = new ossim_db();
$conn = $db->connect();
$user = Session::get_session_user();
$tickets_by_status = Incident::incidents_by_status($conn, null, $user);
$tickets_by_type = Incident::incidents_by_type($conn, null, $user);
$tickets_by_user = Incident::incidents_by_user($conn, true, null, $user);
$tickets_by_tag = Incident::incidents_by_tag($conn, null, $user);
/*echo "<pre>";
	print_r($tickets_by_status);
echo "</pre>";*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title> <?php 
echo gettext("OSSIM Framework");
?>
 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
	<!--[if IE]><script language="javascript" type="text/javascript" src="../js/jqplot/excanvas.js"></script><![endif]-->
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php 
Example #22
0
 public static function IncidentStatus($status, $area, $from_date, $to_date, $from, $to)
 {
     if (!is_null($status)) {
         if (!is_null($area)) {
             $tickets = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->get();
             $ticket = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
         } else {
             $tickets = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->get();
             $ticket = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
         }
         if (count(Incident::whereIn('status_id', $status)->get()) == 0 && count(Incident::whereIn('ticket_type_id', $status)->get()) != 0) {
             if (!is_null($area)) {
                 $tickets = Incident::whereIn('ticket_type_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->get();
                 $ticket = Incident::whereIn('ticket_type_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
             } else {
                 $tickets = Incident::whereIn('ticket_type_id', $status)->whereBetween('created_at', [$from_date, $to_date])->get();
                 $ticket = Incident::whereIn('ticket_type_id', $status)->whereBetween('created_at', [$from_date, $to_date])->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
             }
         }
         if (count(Incident::whereIn('status_id', $status)->get()) != 0 && count(Incident::whereIn('ticket_type_id', $status)->get()) != 0) {
             if (!is_null($area)) {
                 $tickets = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->whereIn('ticket_type_id', $status)->get();
                 $ticket = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->whereIn('ticket_type_id', $status)->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
             } else {
                 $tickets = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('ticket_type_id', $status)->get();
                 $ticket = Incident::whereIn('status_id', $status)->whereBetween('created_at', [$from_date, $to_date])->whereIn('ticket_type_id', $status)->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
             }
         }
     } else {
         if (is_null($status) && !is_null($area)) {
             $tickets = Incident::whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->get();
             $ticket = Incident::whereBetween('created_at', [$from_date, $to_date])->whereIn('area', $area)->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
         } else {
             if (is_null($status) && is_null($area) && $from && $to && ($from != "undefined" && $to != "undefined")) {
                 $tickets = Incident::whereBetween('created_at', [$from_date, $to_date])->get();
                 $ticket = Incident::whereBetween('created_at', [$from_date, $to_date])->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
             } else {
                 $ticket = DB::table('incident')->select('id', 'ticket_no', 'name', 'mobile', 'address', 'area', 'requirement')->orderBy('id', 'desc');
                 $tickets = DB::table('incident')->get();
             }
         }
     }
     return array('ticket' => $ticket, 'tickets' => $tickets);
 }
Example #23
0
    die(ossim_error());
}
$db = new ossim_db();
$conn = $db->connect();
if ($by == "user") {
    $title = _("TICKET BY USER");
    $data_pie = Incident::incidents_by_user($conn);
} elseif ($by == "type") {
    $title = _("TICKET BY TYPE");
    $data_pie = Incident::incidents_by_type($conn);
} elseif ($by == "type_descr") {
    $title = _("TICKET BY TYPE DESCRIPTION");
    $data_pie = Incident::incidents_by_type_descr($conn);
} elseif ($by == "status") {
    $title = _("TICKET BY STATUS");
    $data_pie = Incident::incidents_by_status($conn);
}
$db->close($conn);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="">
<head>
	<meta http-equiv="Pragma" content="no-cache"/>
	<link rel="stylesheet" type="text/css" href="../style/style.css"/>
	<!--[if IE]><script language="javascript" type="text/javascript" src="../../js/jqplot/excanvas.js"></script><![endif]-->
	<script type="text/javascript" src="../../js/jquery-1.3.2.min.js"></script>
	<script type="text/javascript" src="../../js/jquery.flot.pie.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			
Example #24
0
><?php 
        echo $incident->get_submitter();
        ?>
&nbsp;</td>
						<td <?php 
        echo $class;
        ?>
><?php 
        echo $incident->get_type();
        ?>
</td>
						<td <?php 
        echo $class;
        ?>
><?php 
        Incident::colorize_status($incident->get_status());
        ?>
</td>
						<td <?php 
        echo $class;
        ?>
>
							<?php 
        $rows = 0;
        foreach ($incident->get_tags() as $tag_id) {
            echo "<font color='grey' size='1'>" . $incident_tag->get_html_tag($tag_id) . "</font><br/>\n";
            $rows++;
        }
        if (!$rows) {
            echo "&nbsp;";
        }
Example #25
0
    $assets = $shared->get("TicketsStatus4_assets");
    $ticket_closed_by_month = Incident::incidents_closed_by_month($conn, $assets, $user);
    if (is_array($ticket_closed_by_month) && !empty($ticket_closed_by_month)) {
        foreach ($ticket_closed_by_month as $event_type => $months) {
            foreach ($months as $month => $occurrences) {
                $data[$month] = (int) $data[$month] + (int) $occurrences;
            }
        }
    }
    $labelx = array_keys($data);
    $datay = array_values($data);
} elseif ($by == "resolution_time") {
    $user = $shared->get("TicketsStatus5_user");
    $assets = $shared->get("TicketsStatus5_assets");
    $args = $shared->get("TicketsStatus5_args");
    $list = Incident::incidents_by_resolution_time($conn, $assets, $user, $args);
    $ttl_groups = array("1" => 0, "2" => 0, "3" => 0, "4" => 0, "5" => 0, "6" => 0);
    $total_days = 0;
    $day_count = null;
    foreach ($list as $incident) {
        $ttl_secs = $incident->get_life_time('s');
        $days = round($ttl_secs / 60 / 60 / 24);
        $total_days += $days;
        $day_count++;
        if ($days < 1) {
            $days = 1;
        }
        if ($days > 6) {
            $days = 6;
        }
        @$ttl_groups[$days]++;
Example #26
0
     $links[] = "'" . Menu::get_menu_url("/ossim/alarm/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=0&date_from=" . gmdate("Y-m-d", $timetz) . "&date_to=" . gmdate("Y-m-d", $timetz), "analysis", "alarms") . "'";
     $links[] = "'" . Menu::get_menu_url("/ossim/alarm/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=0&date_from=" . gmdate("Y-m-d", $timetz - 86400 * $_1Ago_day) . "&date_to=" . gmdate("Y-m-d", $timetz - 86400 * $_1Ago_day), "analysis", "alarms") . "'";
     $links[] = "'" . Menu::get_menu_url("/ossim/alarm/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=0&date_from=" . gmdate("Y-m-d", $timetz - 86400 * $_2Ago_day) . "&date_to=" . gmdate("Y-m-d", $timetz - 86400 * ($_1Ago_day + 1)), "analysis", "alarms") . "'";
     $links[] = "'" . Menu::get_menu_url("/ossim/alarm/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=0&date_from=" . gmdate("Y-m-d", $timetz - 86400 * $_Week_day) . "&date_to=" . gmdate("Y-m-d", $timetz - 86400 * ($_2Ago_day + 1)), "analysis", "alarms") . "'";
     $links[] = "'" . Menu::get_menu_url("/ossim/alarm/alarm_console.php?num_alarms_page=50&hmenu=Alarms&smenu=Alarms&hour=00&minutes=00&hide_closed=0&date_from=" . gmdate("Y-m-d", $timetz - 86400 * $_2Week_day) . "&date_to=" . gmdate("Y-m-d", $timetz - 86400 * ($_Week_day + 1)), "analysis", "alarms") . "'";
 } else {
     $values = array(0, 0, 0, 0, 0);
     $links = array(0, 0, 0, 0, 0);
 }
 if (Session::menu_perms("analysis-menu", "IncidentsIncidents")) {
     // Tickets
     $today = Incident::incidents_by_date($conn, "'" . $_today . "'", $param_filters["assets"], $param_filters["user"], " AND incident.status = 'Open' ");
     $yday = Incident::incidents_by_date($conn, array("'{$_1Ago}'", "'{$_today}'"), $param_filters["assets"], $param_filters["user"], " AND incident.status = 'Open' ");
     $ago2 = Incident::incidents_by_date($conn, array("'{$_2Ago}'", "'{$_1Ago}'"), $param_filters["assets"], $param_filters["user"], " AND incident.status = 'Open' ");
     $week = Incident::incidents_by_date($conn, array("'{$_Week}'", "'{$_2Ago}'"), $param_filters["assets"], $param_filters["user"], " AND incident.status = 'Open' ");
     $week2 = Incident::incidents_by_date($conn, array("'{$_2Week}'", "'{$_Week}'"), $param_filters["assets"], $param_filters["user"], " AND incident.status = 'Open' ");
     $values2[] = $today;
     $values2[] = $yday;
     $values2[] = $ago2;
     $values2[] = $week;
     $values2[] = $week2;
     $links2 = Menu::get_menu_url("/ossim/incidents/index.php?status=&hmenu=Tickets&smenu=Tickets", "analysis", "tickets");
 } else {
     $values2 = array(0, 0, 0, 0, 0);
     $links2 = "";
 }
 if (!empty($values) || !empty($values2)) {
     $data[0] = $values;
     $data[1] = $values2;
 }
 $serie1 = _('Alarms');
$conf = $GLOBALS["CONF"];
$jpgraph = $conf->get_conf("jpgraph_path");
require "{$jpgraph}/jpgraph.php";
require "{$jpgraph}/jpgraph_bar.php";
$db = new ossim_db();
$conn = $db->connect();
$shared = new DBA_shared(GET('shared'));
if ($by == "ticketsByTypePerMonth") {
    $titley = _("Month") . '-' . _("Year");
    $titlex = _("Num. Tickets");
    $title = '';
    $width = 650;
    $user = $shared->get("TicketsStatus4_user");
    $assets = $shared->get("TicketsStatus4_assets");
    $final_values = array();
    $ticket_by_type_per_month = Incident::incidents_by_type_per_month($conn, $assets, $user);
    if (is_array($ticket_by_type_per_month) && !empty($ticket_by_type_per_month)) {
        foreach ($ticket_by_type_per_month as $event_type => $months) {
            $final_values[$event_type] = implode(",", $months);
        }
        $event_types = array_keys($ticket_by_type_per_month);
    }
    $labelx = array_keys($ticket_by_type_per_month[$event_types[0]]);
    $final_values = array_slice($final_values, 0, 18);
} else {
    die(_("Invalid Graph"));
}
$background = "white";
$color = "navy";
$color2 = "navy";
// Setup graph
Example #28
0
	public function show ($message = "") {
		if ($this->permission) {
			$system = System::getInstance();
			
			switch ($this->operation) {
				case 'delete':
					$incident = new Incident();
					$result = $incident->deleteIncident($this->id_incident);
					unset($incident);
					if ($result) {
						$this->id_incident = -1;
						$message = "<h2 class='suc'>".__('Successfully deleted')."</h2>";
					} else {
						$message = "<h2 class='error'>".__('An error ocurred while deleting the ticket')."</h2>";
					}
					break;
			}
			$this->showIncidents($message);
		}
		else {
			$this->showNoPermission();
		}
	}
*
* On Debian GNU/Linux systems, the complete text of the GNU General
* Public License can be found in `/usr/share/common-licenses/GPL-2'.
*
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("analysis-menu", "IncidentsIncidents");
$id = GET('id');
$incident_id = GET('incident_id');
ossim_valid($id, OSS_DIGIT, 'illegal:' . _("Id"));
ossim_valid($incident_id, OSS_DIGIT, 'illegal:' . _("Incident Id"));
if (ossim_error()) {
    die(ossim_error());
}
/* database connect */
$db = new ossim_db();
$conn = $db->connect();
list($output_name, $content) = Incident::get_custom_content($conn, $id, $incident_id);
$conn->disconnect();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header("Content-Type: application/octet-stream");
header("Content-Transfer-Encoding:­ binary");
header("Content-Length: " . strlen($content));
$output_name = "CUS{$incident_id}-{$output_name}";
header("Content-disposition:  attachment; filename={$output_name}");
echo $content;
Example #30
0
        			</table>
        		</td>
        	</tr>
        	</table>
        </td>
        </tr>
        </table>
        <?php 
} elseif ($screen == "tickets" && Session::menu_perms("analysis-menu", "IncidentsReport")) {
    // Incidents report
    $user = Session::get_session_user();
    $list1 = Incident::incidents_by_status($conn, null, $user);
    // Status
    $list2 = Incident::incidents_by_type($conn, null, $user);
    // Type
    $list3 = Incident::incidents_by_user($conn, true, null, $user);
    // User
    ?>
        <table cellpadding='0' cellspacing='0' border='0' align="center" width='100%'>
        <tr>
        <td class="canvas">
        	<table cellpadding='0' cellspacing='0' border='0' width='100%'>
        	<tr>
        		<td height="3" colspan="11" bgcolor="#A1A1A1"></td>
        	</tr>
        	<tr>
        		<td width="12" valign="top"></td>
        		<td style="padding:5px 10px 3px 0px">
        		
        			<table cellpadding='0' cellspacing='0' border='0' width='100%'>