Merge pull request #6378 from johanv/CRM-15991-permission_delete_relationship
[civicrm-core.git] / api / v3 / Event.php
index abff8e836bbc9c958e5673b42410fd02e4553798..4728270b45361f3c8dcc16dd2cae943839d67647 100644 (file)
@@ -259,8 +259,12 @@ function _civicrm_api3_event_getlist_output($result, $request) {
       if (!empty($row['summary'])) {
         $data['description'][] = $row['summary'];
       }
-      foreach ($request['extra'] as $field) {
-        $data['extra'][$field] = isset($row[$field]) ? $row[$field] : NULL;
+      // Add repeating info
+      $repeat = CRM_Core_BAO_RecurringEntity::getPositionAndCount($row['id'], 'civicrm_event');
+      $data['extra']['is_recur'] = FALSE;
+      if ($repeat) {
+        $data['suffix'] = ts('(%1 of %2)', array(1 => $repeat[0], 2 => $repeat[1]));
+        $data['extra']['is_recur'] = TRUE;
       }
       $output[] = $data;
     }