return true;
}
- // validateTeamInfo validates team information entered by user.
- function validateTeamInfo($fields) {
+ // validateGroupInfo validates group information entered by user.
+ function validateGroupInfo($fields) {
global $i18n;
global $auth;
return $result;
}
- // updateTeam validates user input and updates the team with new information.
- function updateTeam($team_id, $fields) {
- if (!$this->validateTeamInfo($fields)) return false; // Can't continue as user input is invalid.
+ // updateGroup validates user input and updates the group with new information.
+ function updateGroup($team_id, $fields) {
+ if (!$this->validateGroupInfo($fields)) return false; // Can't continue as user input is invalid.
global $user;
$mdb2 = getConnection();
return true;
}
+
+ // updateSelf validates user input and updates admin account with new information.
+ function updateSelf($fields) {
+ return false; // Not yet implemeneted.
+ }
}
// Get all team ids for teams created or modified more than 8 months ago.
// $ts = date('Y-m-d', strtotime('-1 year'));
- $ts = date('Y-m-d', strtotime('-8 month'));
- $sql = "select id from tt_teams where timestamp < '$ts' order by id";
+ $ts = $mdb2->quote(date('Y-m-d', strtotime('-8 month')));
+ $sql = "select id from tt_teams where created < $ts and (modified is null or modified < $ts) order by id";
$res = $mdb2->query($sql);
$count = 0;
$count = 0;
$ts = date('Y-m-d', strtotime('-2 years'));
- $sql = "select count(*) as cnt from tt_log where user_id in ($user_list) and timestamp > '$ts'";
+ $sql = "select count(*) as cnt from tt_log where user_id in ($user_list) and created > '$ts'";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
if ($val = $res->fetchRow()) {
// We will consider a team inactive if it has 5 or less time entries made more than 1 year ago.
$count_last_year = 0;
$ts = date('Y-m-d', strtotime('-1 year'));
- $sql = "select count(*) as cnt from tt_log where user_id in ($user_list) and timestamp > '$ts'";
+ $sql = "select count(*) as cnt from tt_log where user_id in ($user_list) and created > '$ts'";
$res = $mdb2->query($sql);
if (!is_a($res, 'PEAR_Error')) {
if ($val = $res->fetchRow()) {
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.17.65.4136 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.65.4137 | 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>
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
if ($request->isPost()) {
+/*
+ * This is work in progress... refactoring to replace the block below.
+
+ // Create fields array for ttAdmin instance.
+ $fields = array(
+ 'name' => $cl_name,
+ 'login' => $cl_login,
+ 'password1' => $cl_password1,
+ 'password2' => $cl_password2,
+ 'email' => $cl_email);
+
+ import('ttAdmin');
+ $admin = new ttAdmin($err);
+ $result = $admin->updateSelf($fields);
+ if ($result) {
+ header('Location: admin_teams.php');
+ exit();
+ }
+ */
+
// Validate user input.
if (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
if (!ttValidString($cl_login)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
import('ttAdmin');
$admin = new ttAdmin($err);
- $result = $admin->updateTeam($team_id, $fields);
+ $result = $admin->updateGroup($team_id, $fields);
if ($result) {
header('Location: admin_teams.php');
exit();