return $i18n;
}
+/// @todo We should replace this with a separate update function if there is some time left
+/**
+ * @brief Removes duplicated birthday events
+ *
+ * @param array $dates Array of possibly duplicated events
+ * @return array Cleaned events
+ */
+function event_remove_duplicates($dates) {
+ $dates2 = array();
+
+ foreach ($dates AS $date) {
+ if ($date['type'] == 'birthday') {
+ $dates2[$date['uid']."-".$date['cid']."-".$date['start']] = $date;
+ } else {
+ $dates2[] = $date;
+ }
+ }
+ return $dates2;
+}
+
/**
* @brief Get an event by its event ID
*
intval($event_params["event_id"])
);
- if (dbm::is_result($r))
- return $r;
-
+ if (dbm::is_result($r)) {
+ return event_remove_duplicates($r);
+ }
}
/**
dbesc($event_params["adjust_finish"])
);
- if (dbm::is_result($r))
- return $r;
+ if (dbm::is_result($r)) {
+ return event_remove_duplicates($r);
+ }
}
/**
* @param array $arr Event query array
* @return array Event array for the template
*/
-function process_events ($arr) {
+function process_events($arr) {
$events=array();
$last_date = '';