Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
georgmaisser committed Oct 13, 2023
1 parent 825ad98 commit 9f0324d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rule/ftpsyncfiles/rule_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public function __construct($df = 0, $rule = 0) {
public function trigger(\core\event\base $event) {
global $CFG, $DB, $USER;
require_once("$CFG->dirroot/mod/datalynx/classes/datalynx.php");
require_once("$CFG->dirroot/mod/datalynx/field/entryauthor/fieldclass/datalynx_entryauthor.php");
require_once("$CFG->dirroot/mod/datalynx/entries_class.php");
require_once("$CFG->dirroot/mod/datalynx/view/csv/view_class.php");
require_once($CFG->libdir.'/filelib.php');
Expand All @@ -123,17 +124,15 @@ public function trigger(\core\event\base $event) {
$data = new stdClass();
$data->eids = [];

$fields = $this->dl->get_fields();

$fieldid = datalynxfield_entryauthor::_USERID;
$filename = $file->get_filename();

$entryid = -1;
$data->eids[$entryid] = $entryid;
// TODO: If filename is not userid get userid here.
// Entry author is specified in the rule settings:
$data->{"field_{$fieldid}_{$entryid}"} = $this->authorid;
$data->{"field_{$fieldid}_{$entryid}_filemanager"} = $this->draftitemid;
$data->{"field_{$fieldid}_{$entryid}_content"} = 1;
$dlentries = new datalynx_entries($this->dl);
// Set teammember from filename.
$data->{"field_{$this->teammemberfieldid}_{$entryid}"} = $this->get_userid_from_filename($filename);
Expand Down

0 comments on commit 9f0324d

Please sign in to comment.