$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);
$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'));
<tr><td class="sectionHeaderNoBorder">{$i18n.form.templates.active_templates}</td></tr>
{/if}
<tr>
- <td class="tableHeader">{$i18n.label.thing_name}</td>
- <td class="tableHeader">{$i18n.label.description}</td>
- <td class="tableHeader">{$i18n.label.edit}</td>
- <td class="tableHeader">{$i18n.label.delete}</td>
+ <td class="tableHeader" width="45%">{$i18n.label.thing_name}</td>
+ <td class="tableHeader" width="45%">{$i18n.label.description}</td>
+ <td class="tableHeader" width="5%">{$i18n.label.edit}</td>
+ <td class="tableHeader" width="5%">{$i18n.label.delete}</td>
</tr>
- {if $active_templates}
{foreach $active_templates as $template}
<tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
<td>{$template['name']|escape}</td>
<td><a href="template_delete.php?id={$template['id']}">{$i18n.label.delete}</a></td>
</tr>
{/foreach}
- {/if}
</table>
-
<table width="100%">
<tr><td align="center"><br>{$forms.templatesForm.btn_add.control}</td></tr>
</table>
+{if $inactive_templates}
+ <table cellspacing="1" cellpadding="3" border="0" width="100%">
+ <tr><td class="sectionHeaderNoBorder">{$i18n.form.tasks.inactive_tasks}</td></tr>
+ <tr>
+ <td class="tableHeader" width="45%">{$i18n.label.thing_name}</td>
+ <td class="tableHeader" width="45%">{$i18n.label.description}</td>
+ <td class="tableHeader" width="5%">{$i18n.label.edit}</td>
+ <td class="tableHeader" width="5%">{$i18n.label.delete}</td>
+ </tr>
+ {foreach $inactive_templates as $template}
+ <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
+ <td>{$template['name']|escape}</td>
+ <td>{$template['description']|escape}</td>
+ <td><a href="template_edit.php?id={$template['id']}">{$i18n.label.edit}</a></td>
+ <td><a href="template_delete.php?id={$template['id']}">{$i18n.label.delete}</a></td>
+ </tr>
+ {/foreach}
+ </table>
+ <table width="100%">
+ <tr><td align="center"><br>{$forms.templatesForm.btn_add.control}</td></tr>
+ </table>
+{/if}
</td>
</tr>
</table>