From 6e2b1ec1880cebedef5a1ca380820ad0d40d06a2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 8 Mar 2019 19:46:07 +0000 Subject: [PATCH] Some fixes to templates.php. --- WEB-INF/lib/ttTemplateHelper.class.php | 4 +++- WEB-INF/templates/templates.tpl | 33 ++++++++++++++++++++------ 2 files changed, 29 insertions(+), 8 deletions(-) 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} -- 2.20.1