From: Nik Okuntseff Date: Fri, 8 Mar 2019 19:46:07 +0000 (+0000) Subject: Some fixes to templates.php. X-Git-Tag: timetracker_1.19-1~197 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6e2b1ec1880cebedef5a1ca380820ad0d40d06a2;p=timetracker.git Some fixes to templates.php. --- diff --git a/WEB-INF/lib/ttTemplateHelper.class.php b/WEB-INF/lib/ttTemplateHelper.class.php index e2e565a3..d6eefcde 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); @@ -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')); diff --git a/WEB-INF/templates/templates.tpl b/WEB-INF/templates/templates.tpl index 0e8f220a..c1a8d5b4 100644 --- a/WEB-INF/templates/templates.tpl +++ b/WEB-INF/templates/templates.tpl @@ -7,12 +7,11 @@ {$i18n.form.templates.active_templates} {/if} - {$i18n.label.thing_name} - {$i18n.label.description} - {$i18n.label.edit} - {$i18n.label.delete} + {$i18n.label.thing_name} + {$i18n.label.description} + {$i18n.label.edit} + {$i18n.label.delete} - {if $active_templates} {foreach $active_templates as $template} {$template['name']|escape} @@ -21,12 +20,32 @@ {$i18n.label.delete} {/foreach} - {/if} -

{$forms.templatesForm.btn_add.control}
+{if $inactive_templates} + + + + + + + + + {foreach $inactive_templates as $template} + + + + + + + {/foreach} +
{$i18n.form.tasks.inactive_tasks}
{$i18n.label.thing_name}{$i18n.label.description}{$i18n.label.edit}{$i18n.label.delete}
{$template['name']|escape}{$template['description']|escape}{$i18n.label.edit}{$i18n.label.delete}
+ + +

{$forms.templatesForm.btn_add.control}
+{/if}