// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De',
'form.mail.to' => 'Per a',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Od',
'form.mail.to' => 'Komu',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Fra',
'form.mail.to' => 'Til',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Erweiterungen',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Von',
'form.mail.to' => 'An',
'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'From',
'form.mail.to' => 'To',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De',
'form.mail.to' => 'Para',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Kellelt',
'form.mail.to' => 'Kellele',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'پلاگین ها',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'از',
'form.mail.to' => 'به',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Lisäosat',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Lähettäjä',
'form.mail.to' => 'Vastaanottaja',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De',
'form.mail.to' => 'À',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Πρόσθετα',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Από',
'form.mail.to' => 'Προς',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'תוספים',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'מאת',
'form.mail.to' => 'אל',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Feladó',
'form.mail.to' => 'Címzett',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Plugin',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Da',
'form.mail.to' => 'A',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'から',
'form.mail.to' => 'まで',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => '부터',
'form.mail.to' => '까지', // TODO: is this correct? The meaning is that we send an email TO this person.
'form.profile.allow_ip' => 'Toegestane IP adressen',
'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Van',
'form.mail.to' => 'Aan',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Fra',
'form.mail.to' => 'Til',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Dodatkowe moduły',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Od',
'form.mail.to' => 'Do',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De',
'form.mail.to' => 'Para',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De',
'form.mail.to' => 'Para',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'De la',
'form.mail.to' => 'Catre',
'form.profile.allow_ip' => 'Разрешить доступ с IP',
'form.profile.plugins' => 'Плагины',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+'form.group_delete.hint' => 'Вы уверены, что хотите удалить всю группу?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'От',
'form.mail.to' => 'Кому',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Doplnkové moduly',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Od',
'form.mail.to' => 'Komu',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Od',
'form.mail.to' => 'Za',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Dodaci',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Forma mejla. Pogledajte primer na https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Od',
'form.mail.to' => 'Za',
// 'form.profile.allow_ip' => 'Allow IP',
'form.profile.plugins' => 'Tillägg',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Från',
'form.mail.to' => 'Till',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => 'Kimden',
'form.mail.to' => 'Kime',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => '从',
'form.mail.to' => '到',
// 'form.profile.allow_ip' => 'Allow IP',
// 'form.profile.plugins' => 'Plugins',
+// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php
+// TODO: translate the following.
+// 'form.group_delete.hint' => 'Are you sure you want to delete the entire group?',
+
// Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report.
'form.mail.from' => '從',
'form.mail.to' => '到',
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.87.4252 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.88.4253 | 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>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
+ <tr><td colspan="2">{$i18n.form.group_delete.hint}</td></tr>
+ <tr><td> </td></tr>
<tr>
<td colspan="2" align="center"><b>{$group_to_delete|escape}</b></td>
</tr>
<script>
+function chLocation(newLocation) { document.location = newLocation; }
+
// handleTaskRequiredCheckbox - controls visibility of the Task Required checkbox.
function handleTaskRequiredCheckbox() {
var taskRequiredCheckbox = document.getElementById("task_required");
<td colspan="2"> </td>
</tr>
<tr>
- <td colspan="2" height="50" align="center">{$forms.groupForm.btn_save.control}</td>
+ <td colspan="2" height="50" align="center">{$forms.groupForm.btn_save.control} {$forms.groupForm.btn_delete.control}</td>
</tr>
</table>
</td>
require_once('initialize.php');
import('form.Form');
+import('ttAdmin');
// Access checks.
if (!ttAccessAllowed('delete_group')) {
header('Location: access_denied.php');
exit();
}
-// End of access checks.
-
-// TODO: refactor this... and the template.
$group_id = (int)$request->getParameter('id');
+if ($user->group_id != $group_id) {
+ header('Location: access_denied.php');
+ exit();
+}
+// End of access checks.
+// Note: reuse ttAdmin class here, simply because deleting a group
+// is a complicated task.
$admin = new ttAdmin();
$group_details = $admin->getGroupDetails($group_id);
$group_name = $group_details['group_name'];
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
- $result = $admin->markGroupDeleted($group_id);
- if ($result) {
- header('Location: admin_groups.php');
+ if ($admin->markGroupDeleted($group_id)) {
+ $auth->doLogout();
+ session_unset();
+ header('Location: login.php');
exit();
} else
$err->add($i18n->get('error.db'));
}
if ($request->getParameter('btn_cancel')) {
- header('Location: admin_groups.php');
+ header('Location: group_edit.php');
exit();
}
} // isPost
$smarty->assign('group_to_delete', $group_name);
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
$smarty->assign('title', $i18n->get('title.delete_group'));
-$smarty->assign('content_page_name', 'admin_group_delete.tpl');
+$smarty->assign('content_page_name', 'group_delete.tpl');
$smarty->display('index.tpl');
$form->addInput(array('type'=>'checkbox','name'=>'quotas','value'=>$cl_quotas,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'checkbox','name'=>'week_view','value'=>$cl_week_view,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save')));
+if ($user->can('delete_group')) $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('button.delete')));
if ($request->isPost()) {
+
+ if ($request->getParameter('btn_delete')) {
+ // Delete button pressed, redirect.
+ header('Location: group_delete.php?id='.$user->group_id);
+ exit();
+ }
+
// Validate user input.
if (!ttValidString($cl_group, true)) $err->add($i18n->get('error.field'), $i18n->get('label.group_name'));
if (!ttValidString($cl_currency, true)) $err->add($i18n->get('error.field'), $i18n->get('label.currency'));