2008-10-10 Evi Vanoost <vanooste@rcbi.rochester.edu>

* operation/reporting/reporting_xml.php: Now correctly displays image 
        reports without messing up the XML

        * include/functions_html.php: print_select now accepts arrays (eg. for 
        use in select boxes with the multiple tag set) as selected values

git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1140 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
guruevi 2008-10-10 21:04:56 +00:00
parent 7d9eaac721
commit fefbfddeda
3 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,11 @@
2008-10-10 Evi Vanoost <vanooste@rcbi.rochester.edu>
* operation/reporting/reporting_xml.php: Now correctly displays image
reports without messing up the XML
* include/functions_html.php: print_select now accepts arrays (eg. for
use in select boxes with the multiple tag set) as selected values
2008-10-10 Sancho Lerena <slerena@artica.es>
* ajax.php: removed carriage return from EOF.

View File

@ -25,7 +25,8 @@
*
* @param array $fields Array with dropdown values. Example: $fields["value"] = "label"
* @param string $name Select form name
* @param variant $selected Current selected value.
* @param variant $selected Current selected value. Can be a single value or an
* array of selected values (in combination with multiple)
* @param string $script Javascript onChange code.
* @param string $nothing Label when nothing is selected.
* @param variant $nothing_value Value when nothing is selected
@ -66,7 +67,9 @@ function print_select ($fields, $name, $selected = '', $script = '', $nothing =
}
foreach ($fields as $value => $label) {
$output .= '<option value="'.$value.'"';
if ($value == $selected) {
if (is_array ($selected) && in_array ($value, $selected)) {
$output .= ' selected';
} elseif (!is_array ($selected) && $value == $selected) {
$output .= ' selected';
}
if ($label === '') {

View File

@ -121,7 +121,7 @@ if (! give_acl ($config['id_user'], $report['id_group'], "AR")) {
if ($report['id_user'] != $config['id_user'] && ! dame_admin ($config['id_user']) && ! $report['private']) {
return;
}
header ('Content-type: application/xml; charset="utf-8"', true);
echo '<?xml version="1.0" encoding="UTF-8" ?>';
$date = (string) get_parameter ('date', date ('Y-m-j'));
@ -167,7 +167,7 @@ foreach ($contents as $content) {
case 1:
case 'simple_graph':
$data["title"] = __('Simple graph');
$data["objdata"]["img"] = 'reporting/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=720&period='.$content['period'].'&date='.$datetime.'&avg_only=1&pure=1';
$data["objdata"]["img"] = 'reporting/fgraph.php?tipo=sparse&amp;id='.$content['id_agent_module'].'&amp;height=230&amp;width=720&amp;period='.$content['period'].'&amp;date='.$datetime.'&amp;avg_only=1&amp;pure=1';
break;
case 2:
case 'custom_graph':
@ -186,7 +186,7 @@ foreach ($contents as $content) {
array_push ($weights, $content2["weight"]);
}
$data["objdata"]["img"] = 'reporting/fgraph.php?tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height=230&width=720&period='.$content['period'].'&date='.$datetime.'&stacked='.$graph["stacked"].'&pure=1"';
$data["objdata"]["img"] = 'reporting/fgraph.php?tipo=combined&amp;id='.implode (',', $modules).'&amp;weight_l='.implode (',', $weights).'&amp;height=230&amp;width=720&amp;period='.$content['period'].'&amp;date='.$datetime.'&amp;stacked='.$graph["stacked"].'&amp;pure=1"';
break;
case 3:
case 'SLA':
@ -288,6 +288,9 @@ foreach ($contents as $content) {
array_push ($xml["reports"], $data);
}
header ('Content-type: application/xml; charset="utf-8"',true);
function xml_array ($array) {
foreach ($array as $name => $value) {
if (is_int ($name)) {