2013-06-24 Miguel de Dios <miguel.dedios@artica.es>

* godmode/reporting/visual_console_builder.editor.js,
	godmode/reporting/visual_console_builder.editor.php,
	include/functions_visual_map_editor.php: changed the code to show
	the list of parent in the select, now this selectbox doesn't show
	the same item.
	
	MERGED FROM THE BRANCH PANDORA_4.0




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8374 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-06-24 10:11:37 +00:00
parent 7cbf41b007
commit a78937a5eb
4 changed files with 42 additions and 4 deletions

View File

@ -1,3 +1,13 @@
2013-06-24 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.editor.js,
godmode/reporting/visual_console_builder.editor.php,
include/functions_visual_map_editor.php: changed the code to show
the list of parent in the select, now this selectbox doesn't show
the same item.
MERGED FROM THE BRANCH PANDORA_4.0
2013-06-20 Mario Pulido <mario.pulido@artica.es>
*include/help/es/help_module_tokens.php

View File

@ -20,6 +20,7 @@ var toolbuttonActive = null;
var autosave = true;
var list_actions_pending_save = [];
var temp_id_item = 0;
var parents = {};
var SIZE_GRID = 16; //Const the size (for width and height) of grid.
@ -40,6 +41,10 @@ function toggle_advance_options_palette(close) {
function visual_map_main() {
$(".label_color").attachColorPicker();
//Get the list of posible parents
parents = Base64.decode($("input[name='parents_load']").val());
parents = eval("(" + parents + ")");
eventsBackground();
eventsItems();
@ -388,6 +393,21 @@ function toggle_item_palette() {
}
}
function fill_parent_select(id_item) {
//Populate the parent widget
$("#parent option")
.filter(function() { if ($(this).attr('value') != 0) return true; })
.remove();
jQuery.each(parents, function(key, value) {
if (id_item == key) {
return; //continue
}
$("#parent").append($('<option value="' + key + '">' +
value + '</option>'));
});
}
function loadFieldsFromDB(item) {
metaconsole = $("input[name='metaconsole']").val();
@ -416,6 +436,8 @@ function loadFieldsFromDB(item) {
{
var moduleId = 0;
fill_parent_select(idItem);
jQuery.each(data, function(key, val) {
if (key == 'background') $("#background_image").val(val);
if (key == 'width') $("input[name=width]").val(val);
@ -692,6 +714,8 @@ function cleanFields() {
$("input[name=height_module_graph]").val(180);
$("#preview").empty();
fill_parent_select();
var anyText = $("#any_text").html(); //Trick for catch the translate text.
$("#module").empty().append($('<option value="0" selected="selected">' + anyText + '</option></select>'));
}
@ -1179,7 +1203,8 @@ function createItem(type, values, id_data) {
}
function addItemSelectParents(id_data, text) {
$("#parent").append($('<option value="' + id_data + '" selected="selected">' + text + '</option></select>'));
parents[id_data] = text;
//$("#parent").append($('<option value="' + id_data + '" selected="selected">' + text + '</option></select>'));
}
function insertDB(type, values) {

View File

@ -72,14 +72,16 @@ echo "<div id='background_grid'
//Print the layout datas from the DB.
foreach ($layoutDatas as $layoutData) {
// Pending delete and disable modules must be ignored
$delete_pending_module = db_get_value ("delete_pending", "tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
$disabled_module = db_get_value ("disabled", "tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
$delete_pending_module = db_get_value ("delete_pending",
"tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
$disabled_module = db_get_value ("disabled",
"tagente_modulo", "id_agente_modulo", $layoutData["id_agente_modulo"]);
if ($delete_pending_module == 1 || $disabled_module == 1)
continue;
visual_map_print_item($layoutData);
html_print_input_hidden('status_'.$layoutData['id'], visual_map_get_status_element($layoutData));
html_print_input_hidden('status_' . $layoutData['id'], visual_map_get_status_element($layoutData));
}
echo "<img style='position: absolute; top: 0px; left: 0px;' id='background_img' src='" . $metaconsole_hack . "images/console/background/" . $background . "' width='100%' height='100%' />";

View File

@ -302,6 +302,7 @@ function visual_map_editor_print_item_palette($visualConsole_id, $background) {
$form_items_advance['parent_row']['html'] = '<td align="left">' .
__('Parent') . '</td>
<td align="left">' .
html_print_input_hidden('parents_load', base64_encode(json_encode($parents)), true) .
html_print_select($parents, 'parent', '', '', __('None'), 0, true) .
'</td>';