'Device sysContact', 'contact_method' => 'syscontact', 'contact_endpoint' => '{"syscontact":"device"}', //'contact_disabled' => '0', //'contact_disabled_until' => NULL, //'contact_message_custom' => 0, //'contact_message_template' => NULL ]; dbInsert($syscontact, 'alert_contacts'); } // FIXME. Show for anyone > 5 (also for non-ADMIN) and any contacts? $contacts = dbFetchRows('SELECT * FROM `alert_contacts` WHERE 1'); if (count($contacts)) { //r($contacts); // We have contacts, print the table. echo generate_box_open(); ?> $parameters) { if (isset($parameters[$key]) && isset($contact['endpoint_variables'][$key])) { $contact['endpoint_identifiers'][] = escape_html($parameters[$key]['description'] . ': ' . $contact['endpoint_variables'][$key]); } } } $contact['endpoint_descr'] = implode('
', $contact['endpoint_identifiers']); } else { $contact['endpoint_descr'] = escape_html($contact['contact_endpoint']); } if ($transport === 'syscontact') { $transport_name = 'sysContact'; $transport_status = $contact['contact_disabled'] ? 'disabled' : 'enabled'; $contact['endpoint_descr'] = 'Device specified contact in sysContact field (email only)'; } elseif (!isset($config['transports'][$transport])) { // Transport undefined (removed or limited to Pro) $transport_name = nicecase($transport) . ' (Missing)'; $transport_status = 'missing'; } else { $transport_name = $config['transports'][$transport]['name']; $transport_status = $contact['contact_disabled'] ? 'disabled' : 'enabled'; } echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; echo ' '; /* now in defaults for generate_form_modal() $modal_args = array( //'hide' => TRUE, //'fade' => TRUE, //'role' => 'dialog', //'class' => 'modal-md', ); */ $form = array('type' => 'horizontal', 'userlevel' => 10, // Minimum user level for display form 'id' => 'modal-contact_delete_'.$contact['contact_id'], 'title' => 'Delete Contact "' . escape_html($contact['contact_descr']) . '" (Id: '. $contact['contact_id'] . ', ' . $config['transports'][$contact['contact_method']]['name'] . ')', //'modal_args' => $modal_args, // modal specific options //'help' => 'This will delete the selected contact and any alert assocations.', //'class' => '', // Clean default box class (default for modals) //'url' => 'delhost/' ); //$form['fieldset']['body'] = array('class' => 'modal-body'); // Required this class for modal body! //$form['fieldset']['footer'] = array('class' => 'modal-footer'); // Required this class for modal footer! $form['row'][0]['contact_id'] = array( 'type' => 'hidden', 'fieldset' => 'body', 'value' => $contact['contact_id']); $form['row'][0]['action'] = array( 'type' => 'hidden', 'fieldset' => 'body', 'value' => 'delete_contact'); $form['row'][6]['confirm_'.$contact['contact_id']] = array( 'type' => 'checkbox', 'fieldset' => 'body', //'offset' => FALSE, 'name' => 'Confirm', 'placeholder' => 'Yes, please delete this contact!', 'onchange' => "javascript: toggleAttrib('disabled', 'delete_button_".$contact['contact_id']."'); showDiv(!this.checked, 'warning_".$contact['contact_id']."_div');", 'value' => 'confirm'); $form['row'][7]['warning_'.$contact['contact_id']] = array( 'type' => 'html', 'fieldset' => 'body', 'html' => '

Warning!

' . ' Are you sure you want to delete this contact?', 'div_style' => 'display: none', // hide initially 'div_class' => 'alert alert-warning'); $form['row'][8]['close'] = array( 'type' => 'submit', 'fieldset' => 'footer', 'div_class' => '', // Clean default form-action class! 'name' => 'Close', 'icon' => '', 'attribs' => array('data-dismiss' => 'modal', // dismiss modal 'aria-hidden' => 'true')); // do not sent any value $form['row'][9]['delete_button_'.$contact['contact_id']] = array( 'type' => 'submit', 'fieldset' => 'footer', 'div_class' => '', // Clean default form-action class! 'name' => 'Delete Contact', 'icon' => 'icon-trash icon-white', //'right' => TRUE, 'class' => 'btn-danger', 'disabled' => TRUE, 'value' => 'contact_delete'); $modals .= generate_form_modal($form); unset($form); } ?>
Id Transport Description Destination Used Status
'.$contact['contact_id'].''.$transport_name.''.escape_html($contact['contact_descr']).'' . $contact['endpoint_descr'] . ''.$num_assocs.'' . $transport_status . ''; if ($_SESSION['userlevel'] >= 10 && $transport !== 'syscontact') { echo '
'; } echo '