Methods to access properties of an alert
This class is used to manage alerts. The following functions are supplied
Located in /program/lib/alertmanager.class.php (line 55)
construct an AlertManager object
This initialises the AlertManager.
show link to 'add an alert' followed by a list of existing alerts
this constructs an overview dialogue with options add, edit and delete alerts. Records are ordered by 'is_active' and 'full name'.
handle confirmation and actual delete of an alert
this single routine handles
display dialogue for an alert (new or existing)
if $alert_id is 0 show_alert() presents the add alert dialogue, otherwise the edit dialogue.
handle confirmation and actual delete of a rule
this single routine handles
display dialogue for a rule (new or existing)
if $rule_id is 0 show_rule() presents the add rule dialogue, otherwise the edit rule dialogue.
store a new or modified alert rule in the database
store a new or modified alert in the database
if the user pressed cancel (or somehow no button was pressed) she is returned to the alerts overview. after that the data is validated. On error the user is returned to the same dialogue to correct errors. after adding or updating the alert the user is taken to either
shorthand for the anchor parameters that lead to the alert manager
validate add/edit alert dialog
the usual validation and an additional check on the email address
validate add/edit rule dialog
the usual validation and an additional check on existing rule
construct a dialogue defintion for adding/editing selected alert properties
construct a dialogdef for adding/editing a rule for alert $alert_id
entry point
show a dialog to add a new or edit an existing alert
if $alert_id is 0 we show the add new alert dialogue, with just three fields: Name, E-mail and Frequency (is_active is set to TRUE upon saving data). There are only two buttons: [Save] or [Cancel]. The former takes the user to the edit dialogue after adding the initial alert, the latter takes the user back to the overview.
If $alert_id is non-0, we show the same dialogue but this time including is_active flag. This time there is also a [Done] button: this saves the changes and returns to the overview. [Save] stores the data but restarts the edit.
Also, if we are not adding but editing the current list of alert rules is displayed in a table, beneath the Save/Done/Cancel buttons. There is also an Add rule link.
allow the caller to use the menu area (or not)
this routine tells the caller if it is OK to use the menu area (TRUE returned) or not (FALSE returned).
show a dialogue where a rule can be edited
we expect the caller to fill dialogdef with the correct values etc. This allows for reusing this routine to easily display errors,
walk the tree and add all nodes to an options array
Documentation generated on Tue, 28 Jun 2016 19:08:06 +0200 by phpDocumentor 1.4.0