2009-05-28 Esteban Sanchez <estebans@artica.es>

* godmode/reporting/map_builder.php: Replaced exit with return. Use
	jquery.pandora_controls extensions to manage agent dropdown.
	Fixes #2784397

	* include/javascript/jquery.pandora.controls.js: Exclude delete pending
	modules on pandoraSelectAgentModule.

	* include/javascript/pandora.js: Removed php code on a javascript file.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1722 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Esteban Sanchez 2009-05-28 14:06:32 +00:00
parent 3a8797cd29
commit 84b08feb4f
4 changed files with 31 additions and 12 deletions

View File

@ -1,3 +1,14 @@
2009-05-28 Esteban Sanchez <estebans@artica.es>
* godmode/reporting/map_builder.php: Replaced exit with return. Use
jquery.pandora_controls extensions to manage agent dropdown.
Fixes #2784397
* include/javascript/jquery.pandora.controls.js: Exclude delete pending
modules on pandoraSelectAgentModule.
* include/javascript/pandora.js: Removed php code on a javascript file.
2009-05-28 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Return -1 on get_agent_status() on case

View File

@ -23,7 +23,7 @@ check_login ();
if (! give_acl ($config['id_user'], 0, "AW")) {
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation", "Trying to access map builder");
require ("general/noaccess.php");
exit;
return;
}
require_once ('include/functions_visual_map.php');
@ -71,7 +71,7 @@ if ($create_layout) {
echo '<h3 class="err">'.__('Could not be created').'</h3>';
}
if (is_ajax ()) {
exit;
return;
}
}
@ -114,7 +114,7 @@ if ($update_layout) {
__('Update layout failed'));
if (is_ajax ()) {
exit;
return;
}
}
@ -127,7 +127,7 @@ if ($get_background_info) {
}
if (is_ajax ()) {
echo json_encode ($info);
exit;
return;
}
}
@ -139,7 +139,7 @@ if ($get_layout_data) {
if (is_ajax ()) {
echo json_encode ($layout_data);
exit;
return;
}
}
@ -177,7 +177,7 @@ if ($create_layout_data) {
echo '<h3 class="error">'.__('Could not be created').'</h3>';
}
if (is_ajax ()) {
exit;
return;
}
}
@ -195,7 +195,7 @@ if ($update_layout_data_coords) {
array ('id' => $id_layout_data));
if (is_ajax ()) {
exit;
return;
}
}
@ -211,7 +211,7 @@ if ($delete_layout_data) {
}
if (is_ajax ()) {
exit;
return;
}
}
@ -451,10 +451,12 @@ require_jquery_file ('ui.core');
require_jquery_file ('ui.draggable');
require_jquery_file ('ui.droppable');
require_jquery_file ('colorpicker');
require_jquery_file ('pandora.controls');
require_javascript_file ('wz_jsgraphics');
require_javascript_file ('pandora_visual_console');
?>
<script language="javascript" type="text/javascript">
var id_agent_module = 0;
$(document).ready (function () {
<?php if ($id_layout): ?>
if (lines)
@ -547,7 +549,8 @@ $(document).ready (function () {
$("#form_layout_data_editor #submit-create_layout_data_button").attr ('value', "<?php echo __('Update'); ?>").removeClass ('wand').addClass ('upd');
$("#form_layout_data_editor #text-label_color").attr ('value', data['label_color']);
$(".ColorPickerDivSample").css ('background-color', data['label_color']);
agent_changed (null, data['id_agent'], data['id_agente_modulo']);
$("#form_layout_data_editor #agent").change ();
id_agent_module = data['id_agente_modulo'];
},
"json"
);
@ -579,7 +582,12 @@ $(document).ready (function () {
$("#image_preview").append ($('<img></img>').attr ('src', 'images/console/icons/' + this.value + '_bad.png'));
}
});
$("#form_layout_data_editor #agent").change (agent_changed);
$("#form_layout_data_editor #agent").pandoraSelectAgentModule ({
moduleSelect: "#module",
callbackAfter : function () {
$("#module").attr ("value", id_agent_module);
}
});
$("#form_layout_data_editor #type").change (function () {
if (this.value == 0) {
$("#table_layout_data #table_layout_data-8").fadeIn ();

View File

@ -64,7 +64,7 @@
callbackPre: dummyFunc,
callbackPost: dummyFunc,
callbackAfter: dummyFunc,
moduleFilter: 'disabled=0',
moduleFilter: 'disabled=0 AND delete_pending=0',
debug: false
};

View File

@ -63,7 +63,7 @@ function agent_changed (event, id_agent, selected) {
id_agent = this.value;
$('#module').attr ('disabled', 1);
$('#module').empty ();
$('#module').append ($('<option></option>').html ("<?php echo __('Loading'); ?>...").attr ("value", 0));
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php',
{"page": "operation/agentes/ver_agente",
"get_agent_modules_json": 1,