$time_format_part = '';
$week_start_part = '';
$tracking_mode_part = '';
+ $task_required_part = ' , task_required = '.$mdb2->quote($fields['task_required']);
$record_type_part = '';
$uncompleted_indicators_part = '';
$plugins_part = '';
if (isset($fields['workday_hours'])) $workday_hours_part = ', workday_hours = '.$mdb2->quote($fields['workday_hours']);
$sql = "update tt_teams set $name_part $addr_part $currency_part $lang_part $decimal_mark_part
- $date_format_part $time_format_part $week_start_part $tracking_mode_part $record_type_part
+ $date_format_part $time_format_part $week_start_part $tracking_mode_part $task_required_part $record_type_part
$uncompleted_indicators_part $plugins_part $lock_spec_part $workday_hours_part where id = $team_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.10.42.3628 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.11.43.3629 | 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>
<script>
+// handleTaskRequiredCheckbox - controls visibility of the Task Required checkbox.
+function handleTaskRequiredCheckbox() {
+ var taskRequiredCheckbox = document.getElementById("task_required");
+ var taskRequiredLabel = document.getElementById("task_required_label");
+ var trackingModeDropdown = document.getElementById("tracking_mode");
+ if (trackingModeDropdown.value == 2) {
+ taskRequiredCheckbox.style.visibility = "visible";
+ taskRequiredLabel.style.visibility = "visible";
+ } else {
+ taskRequiredCheckbox.style.visibility = "hidden";
+ taskRequiredLabel.style.visibility = "hidden";
+ }
+}
+
+
// handleControls - controls visibility of controls.
function handlePluginCheckboxes() {
var clientsCheckbox = document.getElementById("clients");
</tr>
<tr>
<td align="right" nowrap>{$i18n.form.profile.tracking_mode}:</td>
- <td>{$forms.profileForm.tracking_mode.control}</td>
+ <td>{$forms.profileForm.tracking_mode.control} {$forms.profileForm.task_required.control} <span id="task_required_label"><label for="task_required">{$i18n.label.required}</label></span></td></td>
</tr>
<tr>
<td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
}
+ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
+ if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ }
if (strlen($cl_duration) == 0) {
if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
}
+ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
+ if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ }
if (!$cl_duration) {
if ('0' == $cl_duration)
$err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));
$cl_custom_format_time = $user->time_format;
$cl_start_week = $user->week_start;
$cl_tracking_mode = $user->tracking_mode;
- $cl_ttask_required = $user->task_required;
+ $cl_task_required = $user->task_required;
$cl_record_type = $user->record_type;
$cl_uncompleted_indicators = $user->uncompleted_indicators;
$tracking_mode_options[MODE_TIME] = $i18n->getKey('form.profile.mode_time');
$tracking_mode_options[MODE_PROJECTS] = $i18n->getKey('form.profile.mode_projects');
$tracking_mode_options[MODE_PROJECTS_AND_TASKS] = $i18n->getKey('form.profile.mode_projects_and_tasks');
- $form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode));
+ $form->addInput(array('type'=>'combobox','name'=>'tracking_mode','style'=>'width: 150px;','data'=>$tracking_mode_options,'value'=>$cl_tracking_mode,'onchange'=>'handleTaskRequiredCheckbox()'));
+ $form->addInput(array('type'=>'checkbox','name'=>'task_required','value'=>$cl_task_required));
// Prepare record type choices.
$record_type_options = array();
'time_format' => $cl_custom_format_time,
'week_start' => $cl_start_week,
'tracking_mode' => $cl_tracking_mode,
+ 'task_required' => $cl_task_required,
'record_type' => $cl_record_type,
'uncompleted_indicators' => $cl_uncompleted_indicators,
'plugins' => $plugins));
$smarty->assign('auth_external', $auth->isPasswordExternal());
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('onload', 'onLoad="handlePluginCheckboxes()"');
+$smarty->assign('onload', 'onLoad="handleTaskRequiredCheckbox(); handlePluginCheckboxes();"');
$smarty->assign('title', $i18n->getKey('title.profile'));
$smarty->assign('content_page_name', 'profile_edit.tpl');
$smarty->display('index.tpl');
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
}
+ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
+ if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ }
if (strlen($cl_duration) == 0) {
if ($cl_start || $cl_finish) {
if (!ttTimeHelper::isValidTime($cl_start))
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode) {
if (!$cl_project) $err->add($i18n->getKey('error.project'));
}
+ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode && $user->task_required) {
+ if (!$cl_task) $err->add($i18n->getKey('error.task'));
+ }
if (!$cl_duration) {
if ('0' == $cl_duration)
$err->add($i18n->getKey('error.field'), $i18n->getKey('label.duration'));