X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/1cf228c258ba8a8950b1a55bc25b93768bf50184..6152f4bd9a8f960c79ae025b775b719930574cc9:/WEB-INF/lib/ttFileHelper.class.php diff --git a/WEB-INF/lib/ttFileHelper.class.php b/WEB-INF/lib/ttFileHelper.class.php index 6a799ad8..ce24cd79 100644 --- a/WEB-INF/lib/ttFileHelper.class.php +++ b/WEB-INF/lib/ttFileHelper.class.php @@ -335,4 +335,21 @@ class ttFileHelper { } return false; } + + // update - updates file details in local database. + static function update($fields) { + global $user; + $mdb2 = getConnection(); + + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $file_id = (int) $fields['id']; + $description = $mdb2->quote($fields['description']); + + $sql = "update tt_files set description = $description where id = $file_id". + " and group_id = $group_id and org_id = $org_id and (status = 0 or status = 1)"; + $affected = $mdb2->exec($sql); + return !is_a($affected, 'PEAR_Error'); + } }