Merge branch 'MDL-66631-master-test' of git://github.com/rezaies/moodle
authorSara Arjona <sara@moodle.com>
Mon, 21 Oct 2019 10:18:19 +0000 (12:18 +0200)
committerSara Arjona <sara@moodle.com>
Mon, 21 Oct 2019 10:18:19 +0000 (12:18 +0200)
1  2 
mod/forum/classes/form/export_form.php
mod/forum/export.php
mod/forum/lang/en/forum.php

@@@ -76,20 -78,20 +76,23 @@@ if ($form->is_cancelled()) 
          }, $discussions);
      }
  
+     $filters = ['discussionids' => $discussionids];
      if ($data->userids) {
-         $posts = $postvault->get_from_discussion_ids_and_user_ids($USER,
-                                                                   $discussionids,
-                                                                   $data->userids,
-                                                                   $capabilitymanager->can_view_any_private_reply($USER));
-     } else {
-         $posts = $postvault->get_from_discussion_ids($USER,
-                                                      $discussionids,
-                                                      $capabilitymanager->can_view_any_private_reply($USER));
+         $filters['userids'] = $data->userids;
+     }
+     if ($data->from) {
+         $filters['from'] = $data->from;
      }
+     if ($data->to) {
+         $filters['to'] = $data->to;
+     }
+     // Retrieve posts based on the selected filters.
+     $posts = $postvault->get_from_filters($USER, $filters, $capabilitymanager->can_view_any_private_reply($USER));
  
 +    $striphtml = !empty($data->striphtml);
 +    $humandates = !empty($data->humandates);
 +
      $fields = ['id', 'discussion', 'parent', 'userid', 'created', 'modified', 'mailed', 'subject', 'message',
                  'messageformat', 'messagetrust', 'attachment', 'totalscore', 'mailnow', 'deleted', 'privatereplyto'];
  
Simple merge