'.$template['name'].'';
echo ''.__('Type').': ';
echo get_alert_templates_type_name ($template['type']);
echo '
';
echo print_alert_template_example ($template['id'], true);
echo '
';
if ($template['description'] != '') {
echo ''.__('Description').':
';
echo $template['description'];
echo '
';
}
echo ''.__('Priority').': ';
echo get_priority_name ($template['priority']);
echo '
';
if ($template['monday'] && $template['tuesday']
&& $template['wednesday'] && $template['thursday']
&& $template['friday'] && $template['saturday']
&& $template['sunday']) {
/* Everyday */
echo ''.__('Everyday').'
';
}
else {
$days = array ('monday' => __('Monday'),
'tuesday' => __('Tuesday'),
'wednesday' => __('Wednesday'),
'thursday' => __('Thursday'),
'friday' => __('Friday'),
'saturday' => __('Saturday'),
'sunday' => __('Sunday'));
echo ''.__('Days').': '.__('Every').' ';
$actives = array ();
foreach ($days as $day => $name) {
if ($template[$day])
array_push ($actives, $name);
}
$last = array_pop ($actives);
if (count ($actives)) {
echo implode (', ', $actives);
echo ' '.__('and').' ';
}
echo $last;
echo "
";
}
echo "" . __('Time threshold') . ": ";
echo human_time_description_raw($template['time_threshold']);
echo '
';
if ($template['time_from'] != $template['time_to']) {
echo ''.__('From').' ';
echo $template['time_from'];
echo ' '.__('to').' ';
echo $template['time_to'];
echo '
';
}
return;
}
return;
}
if (! give_acl ($config['id_user'], 0, "LM")) {
pandora_audit("ACL Violation",
"Trying to access Alert Management");
require ("general/noaccess.php");
exit;
}
// Header
print_page_header (__('Alerts')." » ". __('Alert templates'), "images/god2.png", false, "", true);
$update_template = (bool) get_parameter ('update_template');
$delete_template = (bool) get_parameter ('delete_template');
if ($update_template) {
$id = (int) get_parameter ('id');
$recovery_notify = (bool) get_parameter ('recovery_notify');
$field2_recovery = (string) get_parameter ('field2_recovery');
$field3_recovery = (string) get_parameter ('field3_recovery');
$result = update_alert_template ($id,
array ('recovery_notify' => $recovery_notify,
'field2_recovery' => $field2_recovery,
'field3_recovery' => $field3_recovery));
print_result_message ($result,
__('Successfully updated'),
__('Could not be updated'));
}
if ($delete_template) {
$id = get_parameter ('id');
$result = delete_alert_template ($id);
print_result_message ($result,
__('Successfully deleted'),
__('Could not be deleted'));
}
$url = get_url_refresh (array ('offset' => false));
$search_string = (string) get_parameter ('search_string');
$search_type = (string) get_parameter ('search_type');
$table->width = '600px';
$table->data = array ();
$table->head = array ();
$table->style = array ();
$table->style[0] = 'font-weight: bold';
$table->style[2] = 'font-weight: bold';
$table->data[0][0] = __('Type');
$table->data[0][1] = print_select (get_alert_templates_types (), 'search_type',
$search_type, '', __('All'), '', true, false, false);
$table->data[0][2] = __('Search');
$table->data[0][3] = print_input_text ('search_string', $search_string, '', 25,
255, true);
$table->data[0][4] = '