X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttFileHelper.class.php;h=9d18022b863d11f2935fce393ada360c1f1bc1da;hb=ce4c2506404d648ba6e97552aa4ae17a58ea2fbd;hp=f3c36e56b6a07a61e72113f4639ea2f6a136cea4;hpb=2a43d526f93570b4aebc325aae96a484943b0c39;p=timetracker.git diff --git a/WEB-INF/lib/ttFileHelper.class.php b/WEB-INF/lib/ttFileHelper.class.php index f3c36e56..9d18022b 100644 --- a/WEB-INF/lib/ttFileHelper.class.php +++ b/WEB-INF/lib/ttFileHelper.class.php @@ -297,8 +297,8 @@ class ttFileHelper { return $val['group_key']; } - // getProjectFiles obtains a list of files for a project. - static function getProjectFiles($project_id) { + // getEntityFiles obtains a list of files for an entity. + static function getEntityFiles($id, $type) { global $user; $mdb2 = getConnection(); @@ -306,8 +306,9 @@ class ttFileHelper { $org_id = $user->org_id; $result = array(); + $entity_type = $mdb2->quote($type); $sql = "select id, remote_id, file_name as name, description from tt_files". - " where entity_type = 'project' and entity_id = $project_id". + " where entity_type = $entity_type and entity_id = $id". " and group_id = $group_id and org_id = $org_id and status = 1 order by id"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) {