function item_moveup() {
	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("graph_template_id"));
	/* ==================================================== */

	global $graph_item_types;

	$arr = get_graph_group($_GET["id"]);
	$next_id = get_graph_parent($_GET["id"], "previous");

	if ((!empty($next_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group($_GET["id"], $arr, $next_id, "previous");
	}elseif (ereg("(GPRINT|VRULE|HRULE|COMMENT)", $graph_item_types{db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])})) {
		/* this is so we know the "other" graph item to propagate the changes to */
		$last_item = get_item("graph_templates_item", "sequence", $_GET["id"], "graph_template_id=" . $_GET["graph_template_id"] . " and local_graph_id=0", "previous");

		move_item_up("graph_templates_item", $_GET["id"], "graph_template_id=" . $_GET["graph_template_id"] . " and local_graph_id=0");

		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $_GET["id"]) . " where local_graph_template_item_id=" . $_GET["id"]);
		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $last_item). " where local_graph_template_item_id=" . $last_item);
	}
}
Beispiel #2
0
function item_moveup() {
	global $graph_item_types;

	$arr = get_graph_group($_GET["id"]);
	$previous_id = get_graph_parent($_GET["id"], "previous");

	if ((!empty($previous_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group($_GET["id"], $arr, $previous_id, "previous");
	}elseif (ereg("(GPRINT|VRULE|HRULE|COMMENT)", $graph_item_types{db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])})) {
		move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
	}
}
Beispiel #3
0
function item_moveup()
{
    global $graph_item_types;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('local_graph_id'));
    /* ==================================================== */
    $arr = get_graph_group($_REQUEST['id']);
    $previous_id = get_graph_parent($_REQUEST['id'], 'previous');
    if (!empty($previous_id) && isset($arr[$_REQUEST['id']])) {
        move_graph_group($_REQUEST['id'], $arr, $previous_id, 'previous');
    } elseif (preg_match('/(GPRINT|VRULE|HRULE|COMMENT)/', $graph_item_types[db_fetch_cell_prepared('SELECT graph_type_id FROM graph_templates_item WHERE id = ?', array(get_request_var_request('id')))])) {
        move_item_up('graph_templates_item', $_REQUEST['id'], 'local_graph_id=' . $_REQUEST['local_graph_id']);
    }
}
Beispiel #4
0
function item_moveup()
{
    global $graph_item_types;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var("id"));
    input_validate_input_number(get_request_var("local_graph_id"));
    /* ==================================================== */
    $arr = get_graph_group($_GET["id"]);
    $previous_id = get_graph_parent($_GET["id"], "previous");
    if (!empty($previous_id) && isset($arr[$_GET["id"]])) {
        move_graph_group($_GET["id"], $arr, $previous_id, "previous");
    } elseif (preg_match("/(GPRINT|VRULE|HRULE|COMMENT)/", $graph_item_types[db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"])])) {
        move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
    }
}
Beispiel #5
0
function item_moveup() {
	require(CACTI_BASE_PATH . "/include/graph/graph_arrays.php");

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("local_graph_id"));
	/* ==================================================== */

	$arr = get_graph_group($_GET["id"]);
	$previous_id = get_graph_parent($_GET["id"], "previous");

	$graph_type_id = db_fetch_cell("select graph_type_id from graph_templates_item where id=" . $_GET["id"]);
	if ((!empty($previous_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group(get_request_var("id"), $arr, $previous_id, "previous");
	}elseif ($graph_type_id == GRAPH_ITEM_TYPE_GPRINT_AVERAGE ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_LAST ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MAX ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MIN ||
			$graph_type_id == GRAPH_ITEM_TYPE_HRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_VRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_COMMENT) {
		move_item_up("graph_templates_item", $_GET["id"], "local_graph_id=" . $_GET["local_graph_id"]);
	}
}
function item_moveup() {
	require(CACTI_BASE_PATH . "/include/graph/graph_arrays.php");

	/* ================= input validation ================= */
	input_validate_input_number(get_request_var("id"));
	input_validate_input_number(get_request_var("graph_template_id"));
	/* ==================================================== */

	$arr = get_graph_group(get_request_var("id"));
	$next_id = get_graph_parent(get_request_var("id"), "previous");

	$graph_type_id = db_fetch_cell("select graph_type_id from graph_templates_item where id=" . get_request_var("id"));
	if ((!empty($next_id)) && (isset($arr{$_GET["id"]}))) {
		move_graph_group(get_request_var("id"), $arr, $next_id, "previous");
	}elseif ($graph_type_id == GRAPH_ITEM_TYPE_GPRINT_AVERAGE ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_LAST ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MAX ||
			$graph_type_id == GRAPH_ITEM_TYPE_GPRINT_MIN ||
			$graph_type_id == GRAPH_ITEM_TYPE_HRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_VRULE ||
			$graph_type_id == GRAPH_ITEM_TYPE_COMMENT) {
		/* this is so we know the "other" graph item to propagate the changes to */
		$last_item = get_item("graph_templates_item", "sequence", get_request_var("id"), "graph_template_id=" . get_request_var("graph_template_id") . " and local_graph_id=0", "previous");

		move_item_up("graph_templates_item", get_request_var("id"), "graph_template_id=" . get_request_var("graph_template_id") . " and local_graph_id=0");

		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . get_request_var("id")) . " where local_graph_template_item_id=" . get_request_var("id"));
		db_execute("update graph_templates_item set sequence=" . db_fetch_cell("select sequence from graph_templates_item where id=" . $last_item). " where local_graph_template_item_id=" . $last_item);
	}
}
Beispiel #7
0
function item_moveup()
{
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_request('id'));
    input_validate_input_number(get_request_var_request('graph_template_id'));
    /* ==================================================== */
    global $graph_item_types;
    $arr = get_graph_group($_REQUEST['id']);
    $next_id = get_graph_parent($_REQUEST['id'], 'previous');
    if (!empty($next_id) && isset($arr[$_REQUEST['id']])) {
        move_graph_group($_REQUEST['id'], $arr, $next_id, 'previous');
    } elseif (preg_match('/(GPRINT|VRULE|HRULE|COMMENT)/', $graph_item_types[db_fetch_cell_prepared('SELECT graph_type_id FROM graph_templates_item WHERE id = ?', array($_REQUEST['id']))])) {
        /* this is so we know the "other" graph item to propagate the changes to */
        $last_item = get_item('graph_templates_item', 'sequence', $_REQUEST['id'], 'graph_template_id=' . $_REQUEST['graph_template_id'] . ' and local_graph_id=0', 'previous');
        move_item_up('graph_templates_item', $_REQUEST['id'], 'graph_template_id=' . $_REQUEST['graph_template_id'] . ' and local_graph_id=0');
        db_execute_prepared('UPDATE graph_templates_item SET sequence = ' . db_fetch_cell_prepared('SELECT sequence FROM graph_templates_item WHERE id = ?', array($_REQUEST['id'])) . ' WHERE local_graph_template_item_id = ?', array($_REQUEST['id']));
        db_execute_prepared('UPDATE graph_templates_item SET sequence = ' . db_fetch_cell_prepared('SELECT sequence FROM graph_templates_item WHERE id = ?', array($last_item)) . ' WHERE local_graph_template_item_id = ?', array($last_item));
    }
}