mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
2012-07-19 Sergio Martin <sergio.martin@artica.es>
* godmode/modules/manage_network_components_form.php godmode/modules/manage_network_components_form_plugin.php: Fix some bugs as allow delete first macro, show at least one macro, etc. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6793 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
c5b7b285b4
commit
4da392a6b2
@ -1,3 +1,9 @@
|
|||||||
|
2012-07-19 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
|
* godmode/modules/manage_network_components_form.php
|
||||||
|
godmode/modules/manage_network_components_form_plugin.php: Fix some
|
||||||
|
bugs as allow delete first macro, show at least one macro, etc.
|
||||||
|
|
||||||
2012-07-19 Sergio Martin <sergio.martin@artica.es>
|
2012-07-19 Sergio Martin <sergio.martin@artica.es>
|
||||||
|
|
||||||
* godmode/modules/manage_network_components_form.php
|
* godmode/modules/manage_network_components_form.php
|
||||||
|
@ -481,10 +481,14 @@ type_change ();
|
|||||||
|
|
||||||
// Functions to add and remove dynamic fields for macros
|
// Functions to add and remove dynamic fields for macros
|
||||||
function delete_macro() {
|
function delete_macro() {
|
||||||
var next_row = parseInt($('#next_row').html());
|
|
||||||
$('#next_row').html(next_row-2);
|
|
||||||
var next_number = parseInt($('#next_macro').html());
|
var next_number = parseInt($('#next_macro').html());
|
||||||
|
// Is not possible delete first macro
|
||||||
|
if(next_number == 3) {
|
||||||
|
$('#delete_macro_button').hide();
|
||||||
|
}
|
||||||
|
var next_row = parseInt($('#next_row').html());
|
||||||
$('#next_macro').html(next_number-1);
|
$('#next_macro').html(next_number-1);
|
||||||
|
$('#next_row').html(next_row-2);
|
||||||
|
|
||||||
var nrow1 = next_row - 2;
|
var nrow1 = next_row - 2;
|
||||||
var nrow2 = next_row - 1;
|
var nrow2 = next_row - 1;
|
||||||
@ -494,6 +498,8 @@ function delete_macro() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function new_macro() {
|
function new_macro() {
|
||||||
|
$('#delete_macro_button').show();
|
||||||
|
|
||||||
var next_row = parseInt($('#next_row').html());
|
var next_row = parseInt($('#next_row').html());
|
||||||
|
|
||||||
$('#next_row').html(next_row+2);
|
$('#next_row').html(next_row+2);
|
||||||
|
@ -65,7 +65,8 @@ $macros = json_decode($macros,true);
|
|||||||
$next_name_number = 5;
|
$next_name_number = 5;
|
||||||
$i = 1;
|
$i = 1;
|
||||||
while(1) {
|
while(1) {
|
||||||
if(!isset($macros[$i]) || $macros[$i]['desc'] == '') {
|
// Always print at least one macro
|
||||||
|
if((!isset($macros[$i]) || $macros[$i]['desc'] == '') && $i > 1) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$macro_desc_name = 'field'.$i.'_desc';
|
$macro_desc_name = 'field'.$i.'_desc';
|
||||||
@ -120,7 +121,7 @@ while(1) {
|
|||||||
$data[1] = __('Add macro').' <a href="javascript:new_macro()">'.html_print_image('images/add.png',true).'</a>';
|
$data[1] = __('Add macro').' <a href="javascript:new_macro()">'.html_print_image('images/add.png',true).'</a>';
|
||||||
$data[1] .= '<div id="next_macro" style="display:none">'.$i.'</div>';
|
$data[1] .= '<div id="next_macro" style="display:none">'.$i.'</div>';
|
||||||
$data[1] .= '<div id="next_row" style="display:none">'.$next_name_number.'</div>';
|
$data[1] .= '<div id="next_row" style="display:none">'.$next_name_number.'</div>';
|
||||||
$data[2] = __('Delete macro').' <a href="javascript:delete_macro()">'.html_print_image('images/cancel.png',true).'</a>';
|
$data[2] = '<div id="delete_macro_button" style="display:none;">'.__('Delete macro').' <a href="javascript:delete_macro()">'.html_print_image('images/cancel.png',true).'</a></div>';
|
||||||
|
|
||||||
push_table_row ($data, 'plugin_n');
|
push_table_row ($data, 'plugin_n');
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user