X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttTemplateHelper.class.php;h=cc1818d2952f6ceff378cce97786132582e08875;hb=fe8af9a04f7170a0623915f31610c6c4c3df4058;hp=e2e565a39a81e56ea350b892dfa2aa27c7f38fea;hpb=18ad12139f489cfc5a0721e68b2b3e6aa0175b89;p=timetracker.git diff --git a/WEB-INF/lib/ttTemplateHelper.class.php b/WEB-INF/lib/ttTemplateHelper.class.php index e2e565a3..cc1818d2 100644 --- a/WEB-INF/lib/ttTemplateHelper.class.php +++ b/WEB-INF/lib/ttTemplateHelper.class.php @@ -38,7 +38,7 @@ class ttTemplateHelper { $group_id = $user->getGroup(); $org_id = $user->org_id; - $sql = "select id, name, description, content from tt_templates". + $sql = "select id, name, description, content, status from tt_templates". " where id = $id and group_id = $group_id and org_id = $org_id". " and status is not null"; $res = $mdb2->query($sql); @@ -59,7 +59,7 @@ class ttTemplateHelper { $group_id = $user->getGroup(); $org_id = $user->org_id; - $sql = "update from tt_templates set status = null". + $sql = "update tt_templates set status = null". " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) @@ -102,10 +102,12 @@ class ttTemplateHelper { $name = $fields['name']; $description = $fields['description']; $content = $fields['content']; + $status = (int) $fields['status']; $sql = "update tt_templates set name = ".$mdb2->quote($name). ", description = ".$mdb2->quote($description). ", content = ".$mdb2->quote($content). + ", status = ".$status. " where id = $template_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); return (!is_a($affected, 'PEAR_Error'));