2007-06-22 Raul Mateos <raulofpandora@gmail.com>

* operation/reporting/*.php: Added code to show text
	if no reporting defined.
	* operation/menu.php: Added code to highlight custom reporting
	if selected.

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@533 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
raulmateos 2007-06-22 08:10:56 +00:00
parent f20d641d9e
commit 065b7d7043
6 changed files with 72 additions and 49 deletions

View File

@ -9,6 +9,12 @@
* godmode/reporting/*builder.php: Added code to show text
if no reporting defined.
* operation/reporting/*.php: Added code to show text
if no reporting defined.
* operation/menu.php: Added code to highlight custom reporting
if selected.
2007-06-21 Sancho Lerena <slerena@artica.es>

View File

@ -227,9 +227,9 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<table width=500 cellspacing=4 cellpading=4 class='databox_color'>";
echo "<tr><td class='datos2'>";
echo $lang_label["report_name"];
echo "<td class='datos2'>";
echo "</td><td class='datos2'>";
echo "<input type=text size=35 name='map_name' value='$map_name'>";
echo "</td></tr>";
echo "<tr><td class='datos'>";
echo $lang_label["background"];
echo "</td><td class='datos'>";
@ -237,14 +237,14 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo '<select name="map_background" class="w155">';
if ($map_background != "")
echo "<option>".$map_background;
echo "<option>".$map_background."</option>";
$ficheros2 = list_files('images/console/background/', "",0, 0);
$a=0;
while (isset($ficheros2[$a])){
echo "<option>".$ficheros2[$a]."</option>";
$a++;
}
echo '</select>';
echo '</select></td></tr>';
echo "<tr><td class='datos'>";
echo $lang_label["width"];
@ -273,7 +273,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<h2>".$lang_label["map_item_add"];
?>
<A HREF="javascript:;" onmousedown="toggleDiv('map_control');">
<a href="javascript:;" onmousedown="toggleDiv('map_control');">
<?PHP
echo "<img src='images/wand.png'>";
echo "</a></h2>";
@ -298,7 +298,7 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
if ( $id_agent != $row["id_agente"])
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
}
echo '</select>';
echo '</select></td>';
echo "<td class='datos' colspan=1 align='right'><input type=submit name='update_agent' class='sub upd' value='".$lang_label["get_info"]."'>";
@ -310,7 +310,8 @@ if ($createmode==2 OR isset($_GET["id"]) OR (isset($_POST["id_map"]))) {
echo "<input type='hidden' name=id_map value='$id_map'>";
if (isset($id_agent))
echo "<input type='hidden' name='id_agent' value='$id_agent'>";
echo "</td></tr>";
echo "<tr><td class='datos2'>";
echo "<b>".$lang_label["modules"]."</b>";
echo "<td class='datos2' colspan=3>";

View File

@ -258,7 +258,9 @@ if (give_acl($_SESSION["id_usuario"], 0, "AR")==1) {
// Custom reporting
if (isset($_GET["sec"]) && $_GET["sec"] == "reporting"){
if (isset($_GET["sec2"]) && $_GET["sec2"] == "operation/reporting/custom_reporting"){
if (isset($_GET["sec2"]) && $_GET["sec2"] ==
"operation/reporting/custom_reporting" || $_GET["sec2"] ==
"operation/reporting/reporting_viewer"){
echo "<div class='arrows'>";
} else {
echo "<div class='arrow'>";

View File

@ -31,18 +31,22 @@ if (comprueba_login() != 0) {
echo "<h2>".$lang_label["reporting"]." &gt; ";
echo $lang_label["custom_reporting"]."</h2>";
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox'>";
echo "<tr>
<th>".$lang_label["report_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["view"]."</th>";
$color=1;
$sql="SELECT * FROM treport";
$res=mysql_query($sql);
while ($row = mysql_fetch_array($res)){
if (($row["private"]==0) || ($row["id_user"] == $id_user)){
// Calculate table line color
if ($color == 1){
if (mysql_num_rows($res)) {
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox'>";
echo "<tr>
<th>".$lang_label["report_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["view"]."</th>
</tr>";
while ($row = mysql_fetch_array($res)){
if (($row["private"]==0) || ($row["id_user"] == $id_user)){
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
@ -58,9 +62,11 @@ while ($row = mysql_fetch_array($res)){
<a href='index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id=$id_report'>
<img src='images/reporting.png'></a>
</td></tr>";
}
}
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_reporting_def"]."</div>";
}
echo "</table>";
?>

View File

@ -147,41 +147,46 @@ if (isset($_GET["view_graph"])){
}
echo "<h2>".$lang_label["reporting"]." &gt; ";
echo $lang_label["custom_graph_viewer"]."</h2>";
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<tr><th>".$lang_label["graph_name"]."<th>".$lang_label["description"]."<th>".$lang_label["view"];
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1))
echo "<th>";
$color=1;
$sql="SELECT * FROM tgraph";
$res=mysql_query($sql);
while ($row = mysql_fetch_array($res)){
if (($row["private"]==0) || ($row["id_user"] == $id_user)){
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
echo "<td valign='top' class='$tdcolor'>".$row["name"];
echo "<td class='$tdcolor'>".$row["description"];
$id_graph = $row["id_graph"];
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=$id_graph'><img src='images/images.png'></A>";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1)) {
echo "<td class='$tdcolor'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&delete=$id_graph' ".'onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
echo "<img src='images/cross.png'></a></td>";
if (mysql_num_rows($res)) {
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_frame'>";
echo "<tr>
<th>".$lang_label["graph_name"]."</th>
<th>".$lang_label["description"]."</th>
<th>".$lang_label["view"]."</th>";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1))
echo "<th>".$lang_label["delete"]."</th>";
echo "</tr>";
while ($row = mysql_fetch_array($res)){
if (($row["private"]==0) || ($row["id_user"] == $id_user)){
// Calculate table line color
if ($color == 1){
$tdcolor = "datos";
$color = 0;
}
else {
$tdcolor = "datos2";
$color = 1;
}
echo "<tr>";
echo "<td valign='top' class='$tdcolor'>".$row["name"]."</td>";
echo "<td class='$tdcolor'>".$row["description"]."</td>";
$id_graph = $row["id_graph"];
echo "<td valign='middle' class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=$id_graph'><img src='images/images.png'></a>";
if ((give_acl($id_usuario,0,"AW") == 1 ) OR (dame_admin($id_usuario)==1)) {
echo "<td class='$tdcolor' align='center'><a href='index.php?sec=reporting&sec2=operation/reporting/graph_viewer&delete=$id_graph' ".'onClick="if (!confirm(\' '.$lang_label["are_you_sure"].'\')) return false;">';
echo "<img src='images/cross.png'></a></td>";
}
}
}
echo "</table>";
} else {
echo "<div class='nf'>".$lang_label["no_reporting_def"]."</div>";
}
echo "</table>";
?>

View File

@ -49,7 +49,10 @@ $report_private= give_db_value ("private", "treport", "id_report", $id_report);
$report_user = give_db_value ("id_user", "treport", "id_report", $id_report);
if (($report_user == $id_user) OR (dame_admin($id_user)==1) OR ($report_private == 0)) {
//echo "SLA for Tato: %".return_module_SLA (50, 604800, 1, 1);
echo "<h1>".$lang_label["custom_reporting"]." - ".$report_name."</h1>";
echo "<h2>".$lang_label["reporting"]." &gt; ";
echo $lang_label["custom_reporting"]." - ";
echo $report_name."</h2>";
echo "<table class='databox' cellpadding= 4 cellspacing=4 width=750>";
echo "<tr>";