'tt_config',
'tt_cron',
'tt_fav_reports',
+ 'tt_templates',
'tt_monthly_quotas',
'tt_predefined_expenses',
'tt_expense_items',
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.54.4837 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.54.4838 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
} else {
configureLabel.style.visibility = "hidden";
}
+
+ var templatesCheckbox = document.getElementById("templates");
+ configureLabel = document.getElementById("templates_config");
+ if (templatesCheckbox.checked){
+ configureLabel.style.display = "";
+ //configureLabel.style.visibility = "visible";
+ } else {
+ configureLabel.style.display = "none";
+ //configureLabel.style.visibility = "hidden";
+ }
}
</script>
{if isTrue('TEMPLATES_DEBUG')}
<tr>
<td align="right" nowrap>{$forms.pluginsForm.templates.control}</td>
- <td><label for="templates">{$i18n.title.templates}</label> <a href="https://www.anuko.com/lp/tt_29.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+ <td><label for="templates">{$i18n.title.templates}</label> <span id="templates_config"><a href="templates.php">{$i18n.label.configure}</a></span> <a href="https://www.anuko.com/lp/tt_29.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
</tr>
{/if}
<tr>
<table cellspacing="0" cellpadding="7" border="0" width="720">
<tr>
<td valign="top">
-{if $user->can('manage_advanced_settings')}
<table cellspacing="1" cellpadding="3" border="0" width="100%">
<tr>
<td class="tableHeader">{$i18n.label.thing_name}</td>
<table width="100%">
<tr><td align="center"><br>{$forms.predefinedExpensesForm.btn_add.control}</td></tr>
</table>
-{/if}
</td>
</tr>
</table>
--- /dev/null
+{$forms.templatesForm.open}
+<table cellspacing="0" cellpadding="7" border="0" width="720">
+ <tr>
+ <td valign="top">
+ <table cellspacing="1" cellpadding="3" border="0" width="100%">
+ <tr>
+ <td class="tableHeader">{$i18n.label.thing_name}</td>
+ <td class="tableHeader">{$i18n.label.edit}</td>
+ <td class="tableHeader">{$i18n.label.delete}</td>
+ </tr>
+ {if $templates}
+ {foreach $templates as $template}
+ <tr bgcolor="{cycle values="#f5f5f5,#ffffff"}">
+ <td>{$template_expense['name']|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}
+ {/if}
+ </table>
+
+ <table width="100%">
+ <tr><td align="center"><br>{$forms.templatesForm.btn_add.control}</td></tr>
+ </table>
+ </td>
+ </tr>
+</table>
+{$forms.templatesForm.close}
ttExecute("OPTIMIZE TABLE tt_invoices");
ttExecute("OPTIMIZE TABLE tt_log");
ttExecute("OPTIMIZE TABLE tt_monthly_quotas");
+ ttExecute("OPTIMIZE TABLE tt_templates");
ttExecute("OPTIMIZE TABLE tt_predefined_expenses");
ttExecute("OPTIMIZE TABLE tt_project_task_binds");
ttExecute("OPTIMIZE TABLE tt_projects");
$form->addInput(array('type'=>'checkbox','name'=>'approval','value'=>$cl_approval));
$form->addInput(array('type'=>'checkbox','name'=>'timesheets','value'=>$cl_timesheets));
if (isTrue('TEMPLATES_DEBUG')) {
- $form->addInput(array('type'=>'checkbox','name'=>'templates','value'=>$cl_templates));
+ $form->addInput(array('type'=>'checkbox','name'=>'templates','value'=>$cl_templates,'onchange'=>'handlePluginCheckboxes()'));
}
// Submit button.
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
--- /dev/null
+<?php
+// +----------------------------------------------------------------------+
+// | Anuko Time Tracker
+// +----------------------------------------------------------------------+
+// | Copyright (c) Anuko International Ltd. (https://www.anuko.com)
+// +----------------------------------------------------------------------+
+// | LIBERAL FREEWARE LICENSE: This source code document may be used
+// | by anyone for any purpose, and freely redistributed alone or in
+// | combination with other software, provided that the license is obeyed.
+// |
+// | There are only two ways to violate the license:
+// |
+// | 1. To redistribute this code in source form, with the copyright
+// | notice or license removed or altered. (Distributing in compiled
+// | forms without embedded copyright notices is permitted).
+// |
+// | 2. To redistribute modified versions of this code in *any* form
+// | that bears insufficient indications that the modifications are
+// | not the work of the original author(s).
+// |
+// | This license applies to this document only, not any other software
+// | that it may be combined with.
+// |
+// +----------------------------------------------------------------------+
+// | Contributors:
+// | https://www.anuko.com/time_tracker/credits.htm
+// +----------------------------------------------------------------------+
+
+require_once('initialize.php');
+import('form.Form');
+import('ttGroupHelper');
+
+// Access checks.
+if (!ttAccessAllowed('manage_advanced_settings')) {
+ header('Location: access_denied.php');
+ exit();
+}
+if (!$user->isPluginEnabled('tp')) {
+ header('Location: feature_disabled.php');
+ exit();
+}
+// End of access checks.
+
+$form = new Form('templatesForm');
+
+if ($request->isPost()) {
+ if ($request->getParameter('btn_add')) {
+ // The Add button clicked. Redirect to template_add.php page.
+ header('Location: template_add.php');
+ exit();
+ }
+} else {
+ $form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add')));
+ $predefinedExpenses = ttGroupHelper::getPredefinedExpenses();
+}
+
+$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('predefined_expenses', $predefinedExpenses);
+$smarty->assign('title', $i18n->get('title.templates'));
+$smarty->assign('content_page_name', 'templates.tpl');
+$smarty->display('index.tpl');