// 'title.delete_predefined_expense' => 'Deleting Predefined Expense',
'title.reports' => 'Informes',
'title.report' => 'Informe',
-
-
-
-// TODO: refactoring ongoing down from here.
-
+// TODO: translate the following.
// 'title.send_report' => 'Sending Report',
// 'title.invoice' => 'Invoice',
// 'title.send_invoice' => 'Sending Invoice',
// NOTE TO TRANSLATORS: Locking is a feature to lock records from modifications (ex: weekly on Mondays we lock all previous weeks).
// It is also a name for the Locking plugin on the Team profile page.
// 'title.locking' => 'Locking',
+// 'title.week_view' => 'Week View',
+
+
+
+// TODO: refactoring ongoing down from here.
// Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here.
// Strings that are used in a single form must go to the specific form section.
'title.reports' => 'Sestavy',
// TODO: translate the following.
// 'title.report' => 'Report',
+// 'title.send_report' => 'Sending Report',
+// 'title.invoice' => 'Invoice',
+// 'title.send_invoice' => 'Sending Invoice',
+// 'title.charts' => 'Charts',
+// 'title.projects' => 'Projects',
+// 'title.add_project' => 'Adding Project',
+// 'title.edit_project' => 'Editing Project',
+// 'title.delete_project' => 'Deleting Project',
+// 'title.tasks' => 'Tasks',
+// 'title.add_task' => 'Adding Task',
+// 'title.edit_task' => 'Editing Task',
+// 'title.delete_task' => 'Deleting Task',
+// 'title.users' => 'Users',
+// 'title.add_user' => 'Adding User',
+// 'title.edit_user' => 'Editing User',
+// 'title.delete_user' => 'Deleting User',
+// 'title.clients' => 'Clients',
+// 'title.add_client' => 'Adding Client',
+// 'title.edit_client' => 'Editing Client',
+// 'title.delete_client' => 'Deleting Client',
+// 'title.invoices' => 'Invoices',
+// 'title.add_invoice' => 'Adding Invoice',
+// 'title.view_invoice' => 'Viewing Invoice',
+// 'title.delete_invoice' => 'Deleting Invoice',
+// 'title.notifications' => 'Notifications',
+// 'title.add_notification' => 'Adding Notification',
+// 'title.edit_notification' => 'Editing Notification',
+// 'title.delete_notification' => 'Deleting Notification',
+// 'title.monthly_quotas' => 'Monthly Quotas',
+// 'title.export' => 'Exporting Team Data',
+// 'title.import' => 'Importing Team Data',
+// 'title.options' => 'Options',
+// 'title.profile' => 'Profile',
+// 'title.cf_custom_fields' => 'Custom Fields',
+// 'title.cf_add_custom_field' => 'Adding Custom Field',
+// 'title.cf_edit_custom_field' => 'Editing Custom Field',
+// 'title.cf_delete_custom_field' => 'Deleting Custom Field',
+// 'title.cf_dropdown_options' => 'Dropdown Options',
+// 'title.cf_add_dropdown_option' => 'Adding Option',
+// 'title.cf_edit_dropdown_option' => 'Editing Option',
+// 'title.cf_delete_dropdown_option' => 'Deleting Option',
+// NOTE TO TRANSLATORS: Locking is a feature to lock records from modifications (ex: weekly on Mondays we lock all previous weeks).
+// It is also a name for the Locking plugin on the Team profile page.
+// 'title.locking' => 'Locking',
+// 'title.week_view' => 'Week View',
'title.cf_edit_dropdown_option' => 'Redigér Mulighed',
'title.cf_delete_dropdown_option' => 'Slet Mulighed',
'title.locking' => 'Lås Registring',
+// TODO: translate the following.
+// 'title.week_view' => 'Week View',
// Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here.
// Strings that are used in a single form must go to the specific form section.
'title.cf_edit_dropdown_option' => 'Auswahlmöglichkeit bearbeiten',
'title.cf_delete_dropdown_option' => 'Auswahlmöglichkeit löschen',
'title.locking' => 'Sperren',
+// TODO: translate the following.
+// 'title.week_view' => 'Week View',
// Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here.
// Strings that are used in a single form must go to the specific form section.
// NOTE TO TRANSLATORS: Locking is a feature to lock records from modifications (ex: weekly on Mondays we lock all previous weeks).
// It is also a name for the Locking plugin on the Team profile page.
'title.locking' => 'Locking',
+'title.week_view' => 'Week View',
// Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here.
// Strings that are used in a single form must go to the specific form section.
// NOTE TO TRANSLATORS: Locking is a feature to lock records from modifications (ex: weekly on Mondays we lock all previous weeks).
// It is also a name for the Locking plugin on the Team profile page.
// 'title.locking' => 'Locking',
+// 'title.week_view' => 'Week View',
// Section for common strings inside combo boxes on forms. Strings shared between forms shall be placed here.
// Strings that are used in a single form must go to the specific form section.
'title.reports' => 'Raportid',
// TODO: translate the following.
// 'title.report' => 'Report',
+// 'title.send_report' => 'Sending Report',
+// 'title.invoice' => 'Invoice',
+// 'title.send_invoice' => 'Sending Invoice',
+// 'title.charts' => 'Charts',
+// 'title.projects' => 'Projects',
+// 'title.add_project' => 'Adding Project',
+// 'title.edit_project' => 'Editing Project',
+// 'title.delete_project' => 'Deleting Project',
+// 'title.tasks' => 'Tasks',
+// 'title.add_task' => 'Adding Task',
+// 'title.edit_task' => 'Editing Task',
+// 'title.delete_task' => 'Deleting Task',
+// 'title.users' => 'Users',
+// 'title.add_user' => 'Adding User',
+// 'title.edit_user' => 'Editing User',
+// 'title.delete_user' => 'Deleting User',
+// 'title.clients' => 'Clients',
+// 'title.add_client' => 'Adding Client',
+// 'title.edit_client' => 'Editing Client',
+// 'title.delete_client' => 'Deleting Client',
+// 'title.invoices' => 'Invoices',
+// 'title.add_invoice' => 'Adding Invoice',
+// 'title.view_invoice' => 'Viewing Invoice',
+// 'title.delete_invoice' => 'Deleting Invoice',
+// 'title.notifications' => 'Notifications',
+// 'title.add_notification' => 'Adding Notification',
+// 'title.edit_notification' => 'Editing Notification',
+// 'title.delete_notification' => 'Deleting Notification',
+// 'title.monthly_quotas' => 'Monthly Quotas',
+// 'title.export' => 'Exporting Team Data',
+// 'title.import' => 'Importing Team Data',
+'title.options' => 'Suvandid',
+// TODO: translate the following.
+// 'title.profile' => 'Profile',
+// 'title.cf_custom_fields' => 'Custom Fields',
+// 'title.cf_add_custom_field' => 'Adding Custom Field',
+// 'title.cf_edit_custom_field' => 'Editing Custom Field',
+// 'title.cf_delete_custom_field' => 'Deleting Custom Field',
+// 'title.cf_dropdown_options' => 'Dropdown Options',
+// 'title.cf_add_dropdown_option' => 'Adding Option',
+// 'title.cf_edit_dropdown_option' => 'Editing Option',
+// 'title.cf_delete_dropdown_option' => 'Deleting Option',
+// NOTE TO TRANSLATORS: Locking is a feature to lock records from modifications (ex: weekly on Mondays we lock all previous weeks).
+// It is also a name for the Locking plugin on the Team profile page.
+// 'title.locking' => 'Locking',
+// 'title.week_view' => 'Week View',
// TODO: refactoring ongoing down from here.
-// Form titles.
-'title.options' => 'Suvandid',
-
-// TODO: file refactoring is ongoing down from here.
"form.filter.project" => 'projekt',
"form.filter.filter" => 'lemmikraport',
"form.filter.filter_new" => 'salvesta lemmikuna',
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.10.3862 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.10.3863 | 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>
<td align="right" nowrap>{$forms.profileForm.quotas.control}</td>
<td><label for="quotas">{$i18n.label.monthly_quotas}</label> <span id="quotas_config"><a href="quotas.php">{$i18n.label.configure}</a></span></td>
</tr>
+ {if $smarty.const.WEEK_VIEW_DEBUG == 1}
+ <tr>
+ <td align="right" nowrap>{$forms.profileForm.week_view.control}</td>
+ <td><label for="quotas">{$i18n.label.week_view}</label> <span id="week_view_config"><a href="week_view.php">{$i18n.label.configure}</a></span></td>
+ </tr>
+ {/if}
{/if}
<tr>
--- /dev/null
+<table cellspacing="0" cellpadding="7" border="0" width="720">
+ <tr><td valign="top">{$i18n.form.quota.hint}</td></tr>
+</table>
+
+{$forms.monthlyQuotasForm.open}
+<div style="padding: 0 0 10 0">
+ <table border="0" class="divider">
+ <tr>
+ <td align="center">
+ <table>
+ <tr>
+ <td>{$i18n.form.quota.workday_hours}:</td>
+ <td>{$forms.monthlyQuotasForm.workdayHours.control}</td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+</div>
+<table>
+ <tr>
+ <td>{$i18n.form.quota.year}:</td>
+ <td>{$forms.monthlyQuotasForm.year.control}</td>
+ </tr>
+ <tr><td> </td></tr>
+ <tr>
+ <td colspan="2">
+ <table>
+ <tr>
+ <td class="tableHeaderCentered">{$i18n.form.quota.month}</td>
+ <td class="tableHeaderCentered">{$i18n.form.quota.quota}</td>
+ </tr>
+{foreach $months as $month}
+ <tr>
+ <td>{$month}:</td>
+ <td>{$forms.monthlyQuotasForm.$month.control}</td>
+ </tr>
+{/foreach}
+ <tr><td colspan="2"> </td></tr>
+ <tr><td colspan="2" style="text-align:center;"><input type="submit" name="btn_submit" value="{$i18n.button.save}"></td></tr>
+ </table>
+ </td>
+ </tr>
+</table>
+{$forms.monthlyQuotasForm.close}
$cl_notifications = $request->getParameter('notifications');
$cl_locking = $request->getParameter('locking');
$cl_quotas = $request->getParameter('quotas');
+ $cl_week_view = $request->getParameter('week_view');
}
} else {
$cl_name = $user->name;
$cl_notifications = in_array('no', $plugins);
$cl_locking = in_array('lk', $plugins);
$cl_quotas = in_array('mq', $plugins);
+ $cl_week_view = in_array('wv', $plugins);
}
}
$form->addInput(array('type'=>'checkbox','name'=>'notifications','value'=>$cl_notifications,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'checkbox','name'=>'locking','value'=>$cl_locking,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'checkbox','name'=>'quotas','value'=>$cl_quotas,'onchange'=>'handlePluginCheckboxes()'));
+ if (defined('WEEK_VIEW_DEBUG') && isTrue(WEEK_VIEW_DEBUG)) {
+ $form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_view));
+ }
}
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
$plugins .= ',lk';
if ($cl_quotas)
$plugins .= ',mq';
+ if ($cl_week_view)
+ $plugins .= ',wv';
$plugins = trim($plugins, ',');
$update_result = ttTeamHelper::update($user->team_id, array(
--- /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');
+require_once('plugins/MonthlyQuota.class.php');
+import('form.Form');
+import('ttTeamHelper');
+import('ttTimeHelper');
+
+// Access check.
+if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('wv')) {
+ header('Location: access_denied.php');
+ exit();
+}
+
+
+// Get selected year from url parameter.
+$selectedYear = $request->getParameter('year');
+if (!$selectedYear or !ttValidInteger($selectedYear)){
+ $selectedYear = date('Y');
+} else {
+ $selectedYear = (int) $selectedYear;
+}
+
+// Months are zero indexed.
+$months = $i18n->monthNames;
+
+$quota = new MonthlyQuota();
+
+if ($request->isPost()){
+ // Validate user input.
+ if (!ttTimeHelper::isValidDuration($request->getParameter('workdayHours')))
+ $err->add($i18n->getKey('error.field'), $i18n->getKey('form.quota.workday_hours'));
+
+ for ($i = 0; $i < count($months); $i++){
+ $val = $request->getParameter($months[$i]);
+ if (!$quota->isValidQuota($val))
+ $err->add($i18n->getKey('error.field'), $months[$i]);
+ }
+ // Finished validating user input.
+
+ if ($err->no()) {
+
+ // Handle workday hours.
+ $hours = $quota->quotaToFloat($request->getParameter('workdayHours'));
+ if ($hours != $user->workday_hours) {
+ if (!ttTeamHelper::update($user->team_id, array('name'=>$user->team,'workday_hours'=>$hours)))
+ $err->add($i18n->getKey('error.db'));
+ }
+
+ // Handle monthly quotas for a selected year.
+ $selectedYear = (int) $request->getParameter('year');
+ for ($i = 0; $i < count($months); $i++){
+ if (!$quota->update($selectedYear, $i+1, $request->getParameter($months[$i])))
+ $err->add($i18n->getKey('error.db'));
+ }
+
+ if ($err->no()) {
+ // Redisplay the form.
+ header('Location: quotas.php?year='.$selectedYear);
+ exit();
+ }
+ }
+}
+
+// Get monthly quotas for the entire year.
+$monthsData = $quota->get($selectedYear);
+$workdayHours = ttTimeHelper::toAbsDuration($user->workday_hours * 60, true);
+
+$form = new Form('weekViewForm');
+$form->addInput(array('type'=>'checkbox','name'=>'week_note','value'=>$cl_week_note));
+$form->addInput(array('type'=>'checkbox','name'=>'week_list','value'=>$cl_week_list));
+
+$smarty->assign('forms', array($form->getName()=>$form->toArray()));
+$smarty->assign('title', $i18n->getKey('label.week_view'));
+$smarty->assign('content_page_name', 'week_view.tpl');
+$smarty->display('index.tpl');