mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Working in the files for the next cherry pick.
This commit is contained in:
parent
de78ae6542
commit
7883e08af5
@ -63,17 +63,19 @@ if (is_ajax ()) {
|
|||||||
// Get the html rows of the fields form
|
// Get the html rows of the fields form
|
||||||
|
|
||||||
// Descriptions are stored in json
|
// Descriptions are stored in json
|
||||||
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode(io_safe_output($command['fields_descriptions']), true);
|
$fields_descriptions = empty($command['fields_descriptions']) ?
|
||||||
|
'' : json_decode(io_safe_output($command['fields_descriptions']), true);
|
||||||
|
|
||||||
// Fields values are stored in json
|
// Fields values are stored in json
|
||||||
$fields_values = empty($command['fields_values']) ? '' : io_safe_output(json_decode($command['fields_values'], true));
|
$fields_values = empty($command['fields_values']) ?
|
||||||
|
'' : io_safe_output(json_decode($command['fields_values'], true));
|
||||||
|
|
||||||
$fields_rows = array();
|
$fields_rows = array();
|
||||||
for ($i = 1; $i <= 10; $i++) {
|
for ($i = 1; $i <= 10; $i++) {
|
||||||
|
|
||||||
$field_description = $fields_descriptions[$i - 1];
|
$field_description = $fields_descriptions[$i - 1];
|
||||||
$field_value = $fields_values[$i - 1];
|
$field_value = $fields_values[$i - 1];
|
||||||
|
|
||||||
if (!empty($field_description)) {
|
if (!empty($field_description)) {
|
||||||
$fdesc = $field_description .
|
$fdesc = $field_description .
|
||||||
' <br><span style="font-size:xx-small; font-weight:normal;">' . sprintf(__('Field %s'), $i) . '</span>';
|
' <br><span style="font-size:xx-small; font-weight:normal;">' . sprintf(__('Field %s'), $i) . '</span>';
|
||||||
@ -92,7 +94,7 @@ if (is_ajax ()) {
|
|||||||
$field_value = io_safe_output($field_value);
|
$field_value = io_safe_output($field_value);
|
||||||
// HTML type
|
// HTML type
|
||||||
if (preg_match ("/^_html_editor_$/i", $field_value)) {
|
if (preg_match ("/^_html_editor_$/i", $field_value)) {
|
||||||
|
|
||||||
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
||||||
$editor_type_chkbx .= __('Basic') . " ";
|
$editor_type_chkbx .= __('Basic') . " ";
|
||||||
$editor_type_chkbx .= html_print_radio_button_extended ('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_value')", '', true);
|
$editor_type_chkbx .= html_print_radio_button_extended ('editor_type_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_value')", '', true);
|
||||||
@ -102,7 +104,7 @@ if (is_ajax ()) {
|
|||||||
$editor_type_chkbx .= "</small></b></div>";
|
$editor_type_chkbx .= "</small></b></div>";
|
||||||
$ffield = $editor_type_chkbx;
|
$ffield = $editor_type_chkbx;
|
||||||
$ffield .= html_print_textarea ('field'.$i.'_value', 1, 1, '', 'class="fields"', true);
|
$ffield .= html_print_textarea ('field'.$i.'_value', 1, 1, '', 'class="fields"', true);
|
||||||
|
|
||||||
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
$editor_type_chkbx = "<div style=\"padding: 4px 0px;\"><b><small>";
|
||||||
$editor_type_chkbx .= __('Basic') . " ";
|
$editor_type_chkbx .= __('Basic') . " ";
|
||||||
$editor_type_chkbx .= html_print_radio_button_extended ('editor_type_recovery_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_recovery_value')", '', true);
|
$editor_type_chkbx .= html_print_radio_button_extended ('editor_type_recovery_value_'.$i, 0, '', false, false, "removeTinyMCE('textarea_field".$i."_recovery_value')", '', true);
|
||||||
@ -132,13 +134,18 @@ if (is_ajax ()) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ffield = html_print_select($fields_value_select, 'field'.$i.'_value', '', '', '', 0, true, false, false);
|
$ffield = html_print_select($fields_value_select,
|
||||||
$rfield = html_print_select($fields_value_select, 'field'.$i.'_recovery_value', '', '', '', 0, true, false, false);
|
'field'.$i.'_value', '', '', '', 0, true, false, false, 'fields');
|
||||||
|
$rfield = html_print_select($fields_value_select,
|
||||||
|
'field'.$i.'_recovery_value', '', '', '', 0, true, false, false, 'fields_recovery');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$ffield = html_print_textarea ('field'.$i.'_value', 1, 1, '', 'style="min-height:40px" class="fields"', true);
|
$ffield = html_print_textarea ('field' . $i . '_value',
|
||||||
$rfield = html_print_textarea ('field'.$i.'_recovery_value', 1, 1, '', 'style="min-height:40px" class="fields_recovery"', true);
|
1, 1, '', 'style="min-height:40px" class="fields"', true);
|
||||||
|
$rfield = html_print_textarea (
|
||||||
|
'field' . $i . '_recovery_value', 1, 1, '',
|
||||||
|
'style="min-height:40px" class="fields_recovery"', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,14 +53,18 @@ if ($al_action !== false) {
|
|||||||
if (defined('METACONSOLE'))
|
if (defined('METACONSOLE'))
|
||||||
alerts_meta_print_header();
|
alerts_meta_print_header();
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/gm_alerts.png", false, "alert_config", true);
|
ui_print_page_header (__('Alerts') . ' » ' .
|
||||||
|
__('Configure alert action'), "images/gm_alerts.png", false,
|
||||||
|
"alert_config", true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Header
|
// Header
|
||||||
if (defined('METACONSOLE'))
|
if (defined('METACONSOLE'))
|
||||||
alerts_meta_print_header();
|
alerts_meta_print_header();
|
||||||
else
|
else
|
||||||
ui_print_page_header (__('Alerts').' » '.__('Configure alert action'), "images/gm_alerts.png", false, "alert_config", true);
|
ui_print_page_header (__('Alerts') . ' » ' .
|
||||||
|
__('Configure alert action'), "images/gm_alerts.png", false,
|
||||||
|
"alert_config", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -79,11 +83,14 @@ if ($id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hidden div with help hint to fill with javascript
|
// Hidden div with help hint to fill with javascript
|
||||||
html_print_div(array('id' => 'help_alert_macros_hint', 'content' => ui_print_help_icon ('alert_macros', true), 'hidden' => true));
|
html_print_div(
|
||||||
|
array('id' => 'help_alert_macros_hint',
|
||||||
|
'content' => ui_print_help_icon ('alert_macros', true),
|
||||||
|
'hidden' => true));
|
||||||
|
|
||||||
$table->id = 'table_macros';
|
$table->id = 'table_macros';
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
if (defined('METACONSOLE')){
|
if (defined('METACONSOLE')) {
|
||||||
$table->class = 'databox data';
|
$table->class = 'databox data';
|
||||||
$table->width = '100%';
|
$table->width = '100%';
|
||||||
if ($id) {
|
if ($id) {
|
||||||
@ -150,19 +157,30 @@ $table->data[5][2] = html_print_textarea ('command_recovery_preview', 5, 30, '',
|
|||||||
|
|
||||||
$row = 6;
|
$row = 6;
|
||||||
for ($i = 1; $i <= 10; $i++) {
|
for ($i = 1; $i <= 10; $i++) {
|
||||||
$table->data['field' . $i][0] = html_print_image('images/spinner.gif', true);
|
$table->data['field' . $i][0] = html_print_image(
|
||||||
$table->data['field' . $i][1] = html_print_image('images/spinner.gif', true);
|
'images/spinner.gif', true);
|
||||||
$table->data['field' . $i][2] = html_print_image('images/spinner.gif', true);
|
$table->data['field' . $i][1] = html_print_image(
|
||||||
|
'images/spinner.gif', true);
|
||||||
|
$table->data['field' . $i][2] = html_print_image(
|
||||||
|
'images/spinner.gif', true);
|
||||||
|
|
||||||
// Store the value in a hidden to keep it on first execution
|
// Store the value in a hidden to keep it on first execution
|
||||||
$table->data['field' . $i][1] .= html_print_input_hidden('field' . $i . '_value',
|
$table->data['field' . $i][1] .= html_print_input_hidden(
|
||||||
|
'field' . $i . '_value',
|
||||||
!empty($action['field' . $i]) ?
|
!empty($action['field' . $i]) ?
|
||||||
$action['field' . $i] : '', true);
|
$action['field' . $i] : '',
|
||||||
$table->data['field' . $i][2] .= html_print_input_hidden('field' . $i . '_recovery_value',
|
true);
|
||||||
|
$table->data['field' . $i][2] .= html_print_input_hidden(
|
||||||
|
'field' . $i . '_recovery_value',
|
||||||
!empty($action['field' . $i . '_recovery']) ?
|
!empty($action['field' . $i . '_recovery']) ?
|
||||||
$action['field' . $i . '_recovery'] : '', true);
|
$action['field' . $i . '_recovery'] : '',
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<form method="post" action="index.php?sec=' . $sec . '&sec2=godmode/alerts/alert_actions&pure='.$pure.'">';
|
echo '<form method="post" action="' .
|
||||||
|
'index.php?sec=' . $sec . '&' .
|
||||||
|
'sec2=godmode/alerts/alert_actions&' .
|
||||||
|
'pure=' . $pure . '">';
|
||||||
$table_html = html_print_table ($table, true);
|
$table_html = html_print_table ($table, true);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
@ -253,33 +271,37 @@ $(document).ready (function () {
|
|||||||
render_command_preview (original_command);
|
render_command_preview (original_command);
|
||||||
command_description = js_html_entity_decode (data["description"]);
|
command_description = js_html_entity_decode (data["description"]);
|
||||||
render_command_description(command_description);
|
render_command_description(command_description);
|
||||||
|
|
||||||
|
|
||||||
for (i = 1; i <= 10; i++) {
|
for (i = 1; i <= 10; i++) {
|
||||||
var old_value = '';
|
var old_value = '';
|
||||||
var old_recovery_value = '';
|
var old_recovery_value = '';
|
||||||
var field_row = data["fields_rows"][i];
|
var field_row = data["fields_rows"][i];
|
||||||
var $table_macros_field = $('#table_macros-field' + i);
|
var $table_macros_field = $('#table_macros-field' + i);
|
||||||
|
|
||||||
// If the row is empty, hide it
|
// If the row is empty, hide it
|
||||||
if (field_row == '') {
|
if (field_row == '') {
|
||||||
$table_macros_field.hide();
|
$table_macros_field.hide();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only keep the value if is provided from hidden (first time)
|
// Only keep the value if is provided from hidden (first time)
|
||||||
if (($("[name=field" + i + "_value]").attr('id'))
|
if (($("[name=field" + i + "_value]").attr('id'))
|
||||||
== ("hidden-field" + i + "_value")) {
|
== ("hidden-field" + i + "_value")) {
|
||||||
|
|
||||||
old_value = $("[name=field" + i + "_value]").val();
|
old_value = $("[name=field" + i + "_value]").val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($("[name=field" + i + "_recovery_value]").attr('id'))
|
if (($("[name=field" + i + "_recovery_value]").attr('id'))
|
||||||
== ("hidden-field" + i + "_recovery_value")) {
|
== ("hidden-field" + i + "_recovery_value")) {
|
||||||
old_recovery_value = $("[name=field" + i + "_recovery_value]").val();
|
|
||||||
|
old_recovery_value =
|
||||||
|
$("[name=field" + i + "_recovery_value]").val();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace the old column with the new
|
// Replace the old column with the new
|
||||||
$table_macros_field.replaceWith(field_row);
|
$table_macros_field.replaceWith(field_row);
|
||||||
|
|
||||||
$("[name=field" + i + "_value]").val(old_value);
|
$("[name=field" + i + "_value]").val(old_value);
|
||||||
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
||||||
|
|
||||||
@ -289,7 +311,8 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
$(td_content)
|
$(td_content)
|
||||||
.html(
|
.html(
|
||||||
$(td_content).html() + $('#help_alert_macros_hint').html());
|
$(td_content).html() +
|
||||||
|
$('#help_alert_macros_hint').html());
|
||||||
}
|
}
|
||||||
|
|
||||||
$table_macros_field.show();
|
$table_macros_field.show();
|
||||||
@ -316,10 +339,16 @@ $(document).ready (function () {
|
|||||||
render_command_preview(original_command);
|
render_command_preview(original_command);
|
||||||
render_command_recovery_preview(original_command);
|
render_command_recovery_preview(original_command);
|
||||||
|
|
||||||
$(".fields").keyup (function() {
|
$(".fields").keyup(function() {
|
||||||
render_command_preview(original_command);
|
render_command_preview(original_command);
|
||||||
});
|
});
|
||||||
$(".fields_recovery").keyup (function() {
|
$(".fields_recovery").keyup(function() {
|
||||||
|
render_command_recovery_preview(original_command);
|
||||||
|
});
|
||||||
|
$("select.fields").change(function() {
|
||||||
|
render_command_preview(original_command);
|
||||||
|
});
|
||||||
|
$("select.fields_recovery").change(function() {
|
||||||
render_command_recovery_preview(original_command);
|
render_command_recovery_preview(original_command);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user