Skip to content

Commit

Permalink
Allow notification-limitation to checkbox for all event types Wunderb…
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpollak committed Jun 28, 2021
1 parent 156f483 commit 9cd6b97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rule/eventnotification/rule_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ public function trigger(\core\event\base $event) {
}
}

// If event is "update_entry" check if we only trigger on specific checkbox.
if ($eventname == "entry_updated" && $this->rule->param5) {
// Check if we only trigger on specific checkbox.
if ($this->rule->param5) {

// If so, test for conditions and stop sending if not met.
$entryid = $entryid = $event->get_data()['objectid'];
Expand Down
3 changes: 1 addition & 2 deletions rule/rule_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ public function definition() {
// If we have selected entry updated, add a new UI when the instance includes a checkbox.
if($checkboxes = $this->_df->get_fields_by_type('checkbox', true)) {
$checkboxes = array('0' => get_string('noselection', 'datalynx')) + $checkboxes;
$mform->addElement('select', 'param5', get_string('triggerspecificevent', 'datalynxrule_eventnotification'), $checkboxes);
$mform->hideIf('param5', 'entry_updated');
$mform->addElement('select', 'param5', get_string('triggerspecificevent', 'datalynxrule_eventnotification'), $checkboxes);
}

$this->rule_definition();
Expand Down

0 comments on commit 9cd6b97

Please sign in to comment.