Minor fixes in the event.conf.dist.php see #4658

skala
Julio Montoya 13 years ago
parent d280694759
commit e2c7c6adc6
  1. 17
      main/inc/conf/events.conf.dist.php

@ -1,6 +1,7 @@
<?php <?php
/* For licensing terms, see /license.txt */
/** /**
*
* Events' configuration * Events' configuration
* Used to configure each event and to link them to functions the event'll fire. * Used to configure each event and to link them to functions the event'll fire.
* The flow is like the following : * The flow is like the following :
@ -11,7 +12,6 @@
* 5. then it will see if a filter for that function exists (if it does, the filter is executed) * 5. then it will see if a filter for that function exists (if it does, the filter is executed)
* 6. if the filter says it's ok, the function linked to the event is executed * 6. if the filter says it's ok, the function linked to the event is executed
* 7. and that function will actually call the truly interesting function with the good require_once * 7. and that function will actually call the truly interesting function with the good require_once
*
*/ */
global $event_config; global $event_config;
@ -73,9 +73,8 @@ $event_config = array(
* @param array $values (passing by reference) * @param array $values (passing by reference)
* @return boolean * @return boolean
*/ */
function user_registration_event_send_mail_filter_func(&$values) function user_registration_event_send_mail_filter_func(&$values) {
{ return true;
return true;
} }
/** /**
@ -87,7 +86,6 @@ function user_registration_event_send_mail_filter_func(&$values)
* @param array $params * @param array $params
*/ */
function event_send_mail($event_name, $params) { function event_send_mail($event_name, $params) {
require_once api_get_path(LIBRARY_PATH).'events_email.class.php';
EventsMail::send_mail($event_name, $params); EventsMail::send_mail($event_name, $params);
} }
@ -101,14 +99,11 @@ function event_send_mail($event_name, $params) {
function check_if_mail_already_sent($event_name, $user_from, $user_to = null) { function check_if_mail_already_sent($event_name, $user_from, $user_to = null) {
if ($user_to == null) { if ($user_to == null) {
$sql = 'SELECT COUNT(*) as total FROM ' . Database::get_main_table(TABLE_EVENT_SENT) . ' $sql = 'SELECT COUNT(*) as total FROM ' . Database::get_main_table(TABLE_EVENT_SENT) . '
WHERE user_from = '.$user_from.' AND event_type_name = "'.$event_name.'"; WHERE user_from = '.$user_from.' AND event_type_name = "'.$event_name.'"';
';
} else { } else {
$sql = 'SELECT COUNT(*) as total FROM ' . Database::get_main_table(TABLE_EVENT_SENT) . ' $sql = 'SELECT COUNT(*) as total FROM ' . Database::get_main_table(TABLE_EVENT_SENT) . '
WHERE user_from = '.$user_from.' AND user_to = '.$user_to.' AND event_type_name = "'.$event_name.'"; WHERE user_from = '.$user_from.' AND user_to = '.$user_to.' AND event_type_name = "'.$event_name.'"';
';
} }
$result = Database::store_result(Database::query($sql), 'ASSOC'); $result = Database::store_result(Database::query($sql), 'ASSOC');
return $result[0]["total"]; return $result[0]["total"];
} }

Loading…
Cancel
Save