2013-05-14 Miguel de Dios <miguel.dedios@artica.es>

* godmode/alerts/alert_commands.php: fixed the ajax of
	"get_alert_command".
	
	Fixes: #2214




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8133 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-05-14 15:23:57 +00:00
parent 361e63c218
commit 8cbf72e246
2 changed files with 46 additions and 33 deletions

View File

@ -1,3 +1,10 @@
2013-05-14 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/alert_commands.php: fixed the ajax of
"get_alert_command".
Fixes: #2214
2013-05-14 Ramon Novoa <rnovoa@artica.es>
* include/config_process.php,

View File

@ -65,11 +65,12 @@ if (is_ajax ()) {
$fields_rows = array();
for ($i = 1; $i <= 10; $i++) {
if (!empty($fields_descriptions[$i - 1])) {
$fdesc = $fields_descriptions[$i-1].' <br><span style="font-size:xx-small; font-weight:normal;">'.sprintf(__('Field %s'), $i).'</span>';
$fdesc = $fields_descriptions[$i - 1] .
' <br><span style="font-size:xx-small; font-weight:normal;">' . sprintf(__('Field %s'), $i) . '</span>';
}
else {
// If the macro hasn't description and doesnt appear in command, set with empty description to dont show it
if(substr_count($command['command'], "_field$i_") > 0) {
if (substr_count($command['command'], "_field" . $i . "_") > 0) {
$fdesc = sprintf(__('Field %s'), $i);
}
else {
@ -102,7 +103,8 @@ if (is_ajax ()) {
$fields_rows[$i] = '';
}
else {
$fields_rows[$i] = '<tr id="table1-field'.$i.'" class="datos">
$fields_rows[$i] =
'<tr id="table1-field' . $i . '" class="datos">
<td style="font-weight:bold;width:20%" class="datos">
' . $fdesc . '
</td>
@ -279,12 +281,14 @@ foreach ($commands as $command) {
$data[0] .= $command['name'];
$data[0] .= '</span>';
$data[1] = $command['id'];
$data[2] = str_replace("\r\n","<br>",io_safe_output($command['description']));
$data[2] = str_replace("\r\n","<br>",
io_safe_output($command['description']));
$data[3] = '';
if (! $command['internal'])
if (! $command['internal']) {
$data[3] = '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_commands&delete_command=1&id='.$command['id'].'&pure='.$pure.'"
onClick="if (!confirm(\''.__('Are you sure?').'\')) return false;">'.
html_print_image("images/cross.png", true) . '</a>';
}
array_push ($table->data, $data);
}
@ -293,7 +297,9 @@ if (isset($data)) {
html_print_table ($table);
}
else {
echo "<div class='nf'>".__('No alert commands configured')."</div>";
echo "<div class='nf'>" .
__('No alert commands configured') .
"</div>";
}
echo '<div class="action-buttons" style="width: ' . $table->width . '">';