From 13947ca72d10d79e7fb37e29449cb47978875e36 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Wed, 22 Jul 2009 15:26:31 +0000 Subject: [PATCH] 2009-07-22 Miguel de Dios * general/header.php, images/lupa_15x15.png, include/functions_html.php include/styles/pandora.css, operation/search_results.php: add global search bar in the header for searching Agents, Maps, Reports, Graphs, Alerts and Users...if you user have access level... git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1814 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 + pandora_console/general/header.php | 235 +++++++++++-------- pandora_console/images/lupa_15x15.png | Bin 0 -> 858 bytes pandora_console/include/functions_html.php | 90 +++++++ pandora_console/include/styles/pandora.css | 2 +- pandora_console/operation/search_results.php | 230 ++++++++++++++++++ 6 files changed, 471 insertions(+), 93 deletions(-) create mode 100644 pandora_console/images/lupa_15x15.png create mode 100644 pandora_console/operation/search_results.php diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 1be16383ae..894740e08a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2009-07-22 Miguel de Dios + + * general/header.php, images/lupa_15x15.png, include/functions_html.php + include/styles/pandora.css, operation/search_results.php: add global + search bar in the header for searching Agents, Maps, Reports, Graphs, + Alerts and Users...if you user have access level... + 2009-07-20 Miguel de Dios * operation/agentes/tactical.php, operation/agentes/status_monitor.php: add diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 64ce4d61fd..eebfde0315 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -14,99 +14,150 @@ require_once ("include/functions_messages.php"); -//First column (logo) -echo ' + + + + + + + +
'; - -echo '
'; - -// First column (identifier) -echo '
user '.''.__('You are').' ['.$config["id_user"].'] '; -$msg_cnt = get_message_count ($config["id_user"]); -if ($msg_cnt > 0) { - echo ''; +?> + + + +
+ .png" class="bot" alt="user" /> + [] + 0) { + echo ''; - require_css_file ('dialog'); - require_jquery_file ('ui.core'); - require_jquery_file ('ui.dialog'); - echo ''; - print_image ("images/email.png", false, - array ("title" => __('You have %d unread message(s)', $msg_cnt), - "id" => "yougotmail", - "class" => "bot")); - echo ''; -} - -//First column, second row (logout button) -echo '

'; -echo 'logout '. __('Logout').''; - -// Second column (link to main page) -echo '
'; -echo 'info '.__('General information').''; - -//Second column, second row (System up/down) -echo '

'; -echo ''; -$servers["all"] = (int) get_db_value ('COUNT(id_server)','tserver'); -$servers["up"] = (int) check_server_status (); -$servers["down"] = $servers["all"] - $servers["up"]; -if ($servers["up"] == 0) { - //All Servers down or no servers at all - echo 'cross '.__('All systems').': '.__('Down'); -} elseif ($servers["down"] != 0) { - //Some servers down - echo 'error '.$servers["down"].' '.__('servers down'); -} else { - //All servers up - echo 'ok '.__('All systems').': '.__('Ready'); -} -unset ($servers); // Since this is the header, we don't like to trickle down variables. -echo ""; - - -// Third column -// Autorefresh -echo '
'; -$ignored_params = array ('agent_config' => false, 'code' => false); -if ($config["refr"]) { - $ignored_params['refr'] = 0; - echo 'lightning '. __('Autorefresh'); - echo ' ('.date ("i:s", $config["refr"]).')'; - echo ''; -} else { - $ignored_params['refr'] = ''; - echo 'lightning '.__('Autorefresh').''; - $values = array ('5' => '5 '.__('seconds'), - '10' => '10 '.__('seconds'), - '15' => '15 '.__('seconds'), - '30' => '30 '.__('seconds'), - '60' => '1 '.__('minute'), - '120' => '2 '.__('minutes'), - '300' => '5 '.__('minutes'), - '900' => '15 '.__('minutes'), - '1800' => '30 '.__('minutes'), - '3600' => '1 '.__('hour')); - echo ''; -} - -//Events -echo '

'; -echo 'lightning_go '.__('Events').''; - -// Styled text -echo '
Pandora FMS
'; - -/* Enterprise support */ -if (file_exists (ENTERPRISE_DIR."/load_enterprise.php")) - echo '
Enterprise
'; -else - echo '
OpenSource
'; - -echo '
'; - + require_css_file ('dialog'); + require_jquery_file ('ui.core'); + require_jquery_file ('ui.dialog'); + echo ''; + print_image ("images/email.png", false, + array ("title" => __('You have %d unread message(s)', $msg_cnt), "id" => "yougotmail", "class" => "bot")); + echo ''; + } + ?> +
+
+ <?=__('Logout');?> +
+ info +
+
+ +  '.__('All systems').': '.__('Down'); + } + elseif ($servers["down"] != 0) { + //Some servers down + echo 'error '.$servers["down"].' '.__('servers down'); + } + else { + //All servers up + echo 'ok '.__('All systems').': '.__('Ready'); + } + unset ($servers); // Since this is the header, we don't like to trickle down variables. + ?> + +
+ false, 'code' => false); + if ($config["refr"]) { + $ignored_params['refr'] = 0; + echo 'lightning '. __('Autorefresh'); + echo ' ('.date ("i:s", $config["refr"]).')'; + echo ''; + } + else { + $ignored_params['refr'] = ''; + echo 'lightning '.__('Autorefresh').''; + $values = array ( + '5' => '5 '.__('seconds'), + '10' => '10 '.__('seconds'), + '15' => '15 '.__('seconds'), + '30' => '30 '.__('seconds'), + '60' => '1 '.__('minute'), + '120' => '2 '.__('minutes'), + '300' => '5 '.__('minutes'), + '900' => '15 '.__('minutes'), + '1800' => '30 '.__('minutes'), + '3600' => '1 '.__('hour')); + echo ''; + } + ?> +
+
+ + lightning_go + +
+
Pandora FMS
+ Enterprise'; + else + echo '
OpenSource
'; + ?> +
+
+ + + onfocus="javascript: if (fieldKeyWordEmpty) $('#keywords').val('');" + size="119" style="background: white url('images/lupa_15x15.png') no-repeat left; padding: 0; padding-left:15px; margin: 0; width: 70%; margin-left: 2px;" /> + ((strlen(__("Search")) > 12) ? (substr(__("0123456789AB"), 0, 12) . "…") : __("0123456789AB")), + 'all' => ((strlen(__("All")) > 12) ? (substr(__("All"), 0, 12) . "…") : __("All")), + 'users' => ((strlen(__("Users")) > 12) ? (substr(__("Users"), 0, 12) . "…") : __("Users")), + 'alerts' => ((strlen(__("Alerts")) > 12) ? (substr(__("Alerts"), 0, 12) . "…") : __("Alerts")), + 'reports' => ((strlen(__("Reports")) > 12) ? (substr(__("Reports"), 0, 12) . "…") : __("Reports")) + ); + + //INI SECURITY ACL + if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "AR")) { + $values['agents'] = ((strlen(__("Agents")) > 12) ? (substr(__("Agents"), 0, 12) . "…") : __("Agents")); + $values['graphs'] = ((strlen(__("Graphs")) > 12) ? (substr(__("Graphs"), 0, 12) . "…") : __("Graphs")); + } + if (give_acl ($config["id_user"], 0, "AR")) + $values['maps'] = ((strlen(__("Maps")) > 12) ? (substr(__("Maps"), 0, 12) . "…") : __("Maps"));; + //END SECURITY ACL + + print_select_style ($values, 'search_category', $selected, "min-width: 12em;"); + ?> + 12) ? (substr(__("0123456789ABCD"), 0, 12) . "…") : __("Search")); ?>" + class="sub" type="submit" style="min-width: 12em; height: 23px;" /> +
+
+ diff --git a/pandora_console/images/lupa_15x15.png b/pandora_console/images/lupa_15x15.png new file mode 100644 index 0000000000000000000000000000000000000000..2f048b00d115923457a4d5a4ab9ee9f42f70b03d GIT binary patch literal 858 zcmV-g1Eu_lP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXS} z4m&J5L!HF{00P=cL_t(2&t;NZNRwe0$N%ql*mNhiIn&Tw&JrsPE0vNiypTXF%_0f{ z2?C)g2*R?o(#j4*bX7zUDOp4ZI$f+pNIQ^gxkh20@=#VI&6+yC&F}EOT~s#gfAfcj z=l7g=2mtJ_uEOb4XHdDL(yGdlR6+;=0Rti7%auPYct^vDt z?_80WyW&oIn#&oH6$m^BK@em{Nn3qgUCF!@r;1r30I;`ePnILz@or&miTZqSI%F^! zja1WAM1tD(BA4;P`7>=C;fqXWGp#>z>>pfRvoF?WiSsO3Rk~<+N;h4WpAw1D@oZ93 zB=6u)$=4gmEO3mXtINN>=D?x*(Ve-GPao4)7p%;_=ldZQWF~ymC<}*WEu>Kz(sN{3 zB|5iaPRH2T=#AN93p$;i*C=4NnDvaYkR)rWPT=J5G#&R31-*Mp=|~^0ISv71OS^hZ=8YowkJ=g<|HK)E=fzA3sX|w@ZgZ$X1DZ2 zq;OJjV)E?P!uiQIE;QBQ@htVedfo88tNR}e0KQKD&3K2oaM?UVa=g`&oRS#7!5*uv zU2G4DcN@>W$jZ*i5JkO~k-1=t(QIfM92inIZYl?N^7L^4fYoL%>F(_*pZM6}d)smm zeb27ak$&G5eXObI*6o{}d3m||^t1(wGZtn90N~E8yT6|V07Oyb6h)c23S-Rl_)$yD ziIWZT*yuQ)vpnlYMa8x?U|=3^$LIF;_ALHSu8vZw2VitMoi?}IU1l&C4j4_w9G>T; z=H{yt{e1%u!VyVdTwI**Om)V+@%yfmsNF>X!XF0!_BY0H94Ms<0BK$6+FFan!mc%6 kuOawfWR@eU7>f@40vxt5JfDi7%>V!Z07*qoM6N<$f`-0}'; + + if ($nothing != '' || empty ($fields)) { + if ($nothing == '') { + $nothing = __('None'); + } + $output .= '"; + } + } + } + + $output .= ""; + + if ($return) + return $output; + + echo $output; +} + /** * Prints an array of fields in a popup menu of a form. diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css index 28d859e67b..3b43770ec8 100644 --- a/pandora_console/include/styles/pandora.css +++ b/pandora_console/include/styles/pandora.css @@ -209,7 +209,7 @@ div#menu { div#head { font-size: 8pt; width: 960px; - height: 60px; + height: 87px;/*84px;*/ /*height: 60px;*/ background: url(../../images/header.jpg); border-bottom: solid 2px #555; } diff --git a/pandora_console/operation/search_results.php b/pandora_console/operation/search_results.php new file mode 100644 index 0000000000..45582b8100 --- /dev/null +++ b/pandora_console/operation/search_results.php @@ -0,0 +1,230 @@ + + + +"; +echo "
"; + +if (($agents === false) && ($users === false) && ($alerts === false) && ($graphs === false) + && ($reports === false) && ($maps === false)) { + echo "

" . __("None results") . "

\n"; +} +else { + if ($agents !== false) { + echo "\n"; + } + + if ($users !== false) { + echo "\n"; + } + + if ($alerts !== false) { + echo "
    \n"; + foreach ($alerts as $alert) { + echo "
  • " . $alert['agent_name'] . " - " . $alert['template_name'] . " - " . $alert['action_name'] . "
  • \n"; + } + echo "
\n"; + } + + if ($graphs !== false) { + echo "\n"; + } + + if ($reports !== false) { + echo "
    \n"; + foreach ($reports as $report) { + echo "
  • " . $report['name'] . "
  • \n"; + } + echo "
\n"; + } + + if ($maps !== false) { + //echo "

" . __("Maps") . "

\n"; + echo "\n"; + } +} +?>