define('COST_ON_REPORTS', true);
-// READONLY_START_FINISH - defines whether the start and finish fields on time entry pages are read-only.
-// This applies to regular users only. Manager and co-managers can edit these values.
-//
-// define('READONLY_START_FINISH', false);
-
-
// WEEKEND_START_DAY
//
// This option defines which days are highlighted with weekend color.
var $project_required = 0; // Whether project selection is required on time entires.
var $task_required = 0; // Whether task selection is required on time entires.
var $record_type = 0; // Record type (duration vs start and finish, or both).
+ var $punch_in_mode = 0; // Whether punch in mode is enabled for user.
var $allow_overlap = 0; // Whether to allow overlapping time entries.
var $future_entries = 0; // Whether to allow creating future entries.
var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
// Set user config options.
$this->show_holidays = in_array('show_holidays', $config_array);
+ $this->punch_in_mode = in_array('punch_in_mode', $config_array);
$this->allow_overlap = in_array('allow_overlap', $config_array);
$this->future_entries = in_array('future_entries', $config_array);
$this->uncompleted_indicators = in_array('uncompleted_indicators', $config_array);
} elseif ($this->role == ROLE_SITE_ADMIN) {
$this->rights = right_administer_site;
}
+
+ // Adjust punch_in_mode for managers as they are allowed to overwrite start and end times.
+ if ($this->canManageTeam()) $this->punch_in_mode = 0;
}
}
<td align="right" nowrap>{$i18n.form.profile.record_type}:</td>
<td>{$forms.profileForm.record_type.control}</td>
</tr>
+ <tr>
+ <td align="right" nowrap>{$i18n.form.profile.punch_in_mode}:</td>
+ <td>{$forms.profileForm.punch_in_mode.control} <a href="https://www.anuko.com/lp/tt_18.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+ </tr>
<tr>
<td align="right" nowrap>{$i18n.form.profile.allow_overlap}:</td>
<td>{$forms.profileForm.allow_overlap.control} <a href="https://www.anuko.com/lp/tt_16.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
$form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');"));
$form->addInput(array('type'=>'text','name'=>'finish','value'=>$cl_finish,'onchange'=>"formDisable('finish');"));
- if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
+ if ($user->punch_in_mode) {
// Make the start and finish fields read-only.
$form->getElement('start')->setEnabled(false);
$form->getElement('finish')->setEnabled(false);
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
$form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');"));
$form->addInput(array('type'=>'text','name'=>'finish','value'=>$cl_finish,'onchange'=>"formDisable('finish');"));
- if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
+ if ($user->punch_in_mode) {
// Make the start and finish fields read-only.
$form->getElement('start')->setEnabled(false);
$form->getElement('finish')->setEnabled(false);
$cl_project_required = $request->getParameter('project_required');
$cl_task_required = $request->getParameter('task_required');
$cl_record_type = $request->getParameter('record_type');
+ $cl_punch_in_mode = $request->getParameter('punch_in_mode');
$cl_allow_overlap = $request->getParameter('allow_overlap');
$cl_future_entries = $request->getParameter('future_entries');
$cl_uncompleted_indicators = $request->getParameter('uncompleted_indicators');
$cl_project_required = $user->project_required;
$cl_task_required = $user->task_required;
$cl_record_type = $user->record_type;
+ $cl_punch_in_mode = $user->punch_in_mode;
$cl_allow_overlap = $user->allow_overlap;
$cl_future_entries = $user->future_entries;
$cl_uncompleted_indicators = $user->uncompleted_indicators;
$record_type_options[TYPE_DURATION] = $i18n->getKey('form.profile.type_duration');
$form->addInput(array('type'=>'combobox','name'=>'record_type','style'=>'width: 150px;','data'=>$record_type_options,'value'=>$cl_record_type));
+ // Punch in mode checkbox.
+ $form->addInput(array('type'=>'checkbox','name'=>'punch_in_mode','value'=>$cl_punch_in_mode));
+
// Allow overlap checkbox.
$form->addInput(array('type'=>'checkbox','name'=>'allow_overlap','value'=>$cl_allow_overlap));
// Prepare config string.
if ($cl_show_holidays)
$config .= ',show_holidays';
+ if ($cl_punch_in_mode)
+ $config .= ',punch_in_mode';
if ($cl_allow_overlap)
$config .= ',allow_overlap';
if ($cl_future_entries)
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
$form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');"));
$form->addInput(array('type'=>'text','name'=>'finish','value'=>$cl_finish,'onchange'=>"formDisable('finish');"));
- if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
+ if ($user->punch_in_mode) {
// Make the start and finish fields read-only.
$form->getElement('start')->setEnabled(false);
$form->getElement('finish')->setEnabled(false);
if ((TYPE_START_FINISH == $user->record_type) || (TYPE_ALL == $user->record_type)) {
$form->addInput(array('type'=>'text','name'=>'start','value'=>$cl_start,'onchange'=>"formDisable('start');"));
$form->addInput(array('type'=>'text','name'=>'finish','value'=>$cl_finish,'onchange'=>"formDisable('finish');"));
- if (!$user->canManageTeam() && defined('READONLY_START_FINISH') && isTrue(READONLY_START_FINISH)) {
+ if ($user->punch_in_mode) {
// Make the start and finish fields read-only.
$form->getElement('start')->setEnabled(false);
$form->getElement('finish')->setEnabled(false);