From c99954245edfe4bd80b44048afd1c15d67096094 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 13:05:15 +0000 Subject: [PATCH 001/304] Starting to work on mobile friendly week view. --- WEB-INF/templates/week2.tpl | 236 +++++++++++++++ initialize.php | 2 +- week2.php | 559 ++++++++++++++++++++++++++++++++++++ 3 files changed, 796 insertions(+), 1 deletion(-) create mode 100644 WEB-INF/templates/week2.tpl create mode 100644 week2.php diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week2.tpl new file mode 100644 index 00000000..b46e9804 --- /dev/null +++ b/WEB-INF/templates/week2.tpl @@ -0,0 +1,236 @@ +{* Copyright (c) Anuko International Ltd. https://www.anuko.com +License: See license.txt *} + +{include file="time_script.tpl"} + + + + + + +{if $show_navigation} +
+ {$i18n.label.day_view} / {$i18n.label.week_view} +
+{/if} + +{$forms.weekTimeForm.open} +
{$forms.weekTimeForm.date.control}
+ + +{if $user_dropdown} + + + + + + +{/if} +{if $show_client} + + + + + + +{/if} +
{$forms.weekTimeForm.date.control}
{$forms.weekTimeForm.user.control}
{$forms.weekTimeForm.client.control}
+{$forms.weekTimeForm.close} + + + + +{$forms.weekTimeForm.open} + +{if $show_navigation} + + + +{/if} + + + + +
+ {$i18n.label.day_view} / {$i18n.label.week_view} +
+ +{if $user_dropdown} + + + + +{/if} +{if $show_client} + + + + +{/if} +{if $show_billable} + + + + +{/if} +{if $custom_fields && $custom_fields->timeFields} + {foreach $custom_fields->timeFields as $timeField} + + + {assign var="control_name" value='time_field_'|cat:$timeField['id']} + + + {/foreach} +{/if} +{if $show_project} + + + + +{/if} +{if $show_task} + + + + +{/if} +{if $show_week_note} + + + + +{/if} +
{$i18n.label.user}:{$forms.weekTimeForm.user.control}
{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/if}:{$forms.weekTimeForm.client.control}
 
{$timeField['label']|escape}{if $timeField['required']} (*){/if}:{$forms.weekTimeForm.$control_name.control}
{$i18n.label.project} (*):{$forms.weekTimeForm.project.control}
{$i18n.label.task}{if $task_required} (*){/if}:{$forms.weekTimeForm.task.control}
{$i18n.label.week_note}:{$forms.weekTimeForm.note.control}
+
+ + +
{$forms.weekTimeForm.date.control}
+
+ + + + +
{$forms.weekTimeForm.week_durations.control}
+ + + + + + +
{$forms.weekTimeForm.btn_submit.control}
 
+ +{if $show_week_list} + + + + +
+{if $time_records} + + + + {if $show_client} + + {/if} + {if $show_project} + + {/if} + {if $show_task} + + {/if} + {if $show_start} + + + {/if} + + + {if $show_files} + + {/if} + + + + {foreach $time_records as $record} + + + {if $show_client} + + {/if} + {if $show_project} + + {/if} + {if $show_task} + + {/if} + {if $show_start} + + + {/if} + + + {if $show_files} + {if $record.has_files} + + {else} + + {/if} + {/if} + + + + {/foreach} +
{$i18n.label.date}{$i18n.label.client}{$i18n.label.project}{$i18n.label.task}{$i18n.label.start}{$i18n.label.finish}{$i18n.label.duration}{$i18n.label.note}
{$record.date}{$record.client|escape}{$record.project|escape}{$record.task|escape}{if $record.start}{$record.start}{else} {/if}{if $record.finish}{$record.finish}{else} {/if}{if ($record.duration == '0:00' && $record.start <> '')}{$i18n.form.time.uncompleted}{else}{$record.duration}{/if}{if $record.comment}{$record.comment|escape}{else} {/if}{$i18n.label.files}{$i18n.label.files} + {if $record.approved || $record.timesheet_id || $record.invoice_id} +   + {else} + {$i18n.label.edit} + {/if} + + {if $record.approved || $record.timesheet_id || $record.invoice_id} +   + {else} + {$i18n.label.delete} + {/if} +
+{/if} +
+{/if} + +{if $time_records} + + {if $show_week_list} + + + + + {/if} + {if $user->isPluginEnabled('mq')} + + + {if $over_quota} + + {else} + + {/if} + + {/if} +
{$i18n.label.week_total}: {$week_total}
{$i18n.label.month_total}: {$month_total}{$i18n.form.time.over_quota}: {$quota_remaining}{$i18n.form.time.remaining_quota}: {$quota_remaining}
+{/if} +{$forms.weekTimeForm.close} diff --git a/initialize.php b/initialize.php index e7773d3d..14c04798 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5530"); +define("APP_VERSION", "1.19.28.5531"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week2.php b/week2.php new file mode 100644 index 00000000..f97a515d --- /dev/null +++ b/week2.php @@ -0,0 +1,559 @@ +isPluginEnabled('wv')) { + header('Location: feature_disabled.php'); + exit(); +} +if ($user->behalf_id && (!$user->can('track_time') || !$user->checkBehalfId())) { + header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user. + exit(); +} +if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId()) { + header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf. + exit(); +} +if ($request->isPost()) { + $userChanged = (bool)$request->getParameter('user_changed'); // Reused in multiple places below. + if ($userChanged && !($user->can('track_time') && $user->isUserValid((int)$request->getParameter('user')))) { + header('Location: access_denied.php'); // User changed, but no right or wrong user id. + exit(); + } +} +// End of access checks. + +// Determine user for whom we display this page. +if ($request->isPost() && $userChanged) { + $user_id = (int)$request->getParameter('user'); + $user->setOnBehalfUser($user_id); +} else { + $user_id = $user->getUser(); +} + +$group_id = $user->getGroup(); + +$showClient = $user->isPluginEnabled('cl'); +$showBillable = $user->isPluginEnabled('iv'); +$trackingMode = $user->getTrackingMode(); +$showProject = MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode; +$showTask = MODE_PROJECTS_AND_TASKS == $trackingMode; +if ($showTask) $taskRequired = $user->getConfigOption('task_required'); +$showWeekNote = $user->isOptionEnabled('week_note'); +$showWeekNotes = $user->isOptionEnabled('week_notes'); +$recordType = $user->getRecordType(); +$showStart = TYPE_START_FINISH == $recordType || TYPE_ALL == $recordType; +$showFiles = $user->isPluginEnabled('at'); + +// Initialize and store date in session. +$cl_date = $request->getParameter('date', @$_SESSION['date']); +$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); +if($selected_date->isError()) + $selected_date = new DateAndTime(DB_DATEFORMAT); +if(!$cl_date) + $cl_date = $selected_date->toString(DB_DATEFORMAT); +$_SESSION['date'] = $cl_date; + +// Determine selected week start and end dates. +$weekStartDay = $user->getWeekStart(); +$t_arr = localtime($selected_date->getTimestamp()); +$t_arr[5] = $t_arr[5] + 1900; +if ($t_arr[6] < $weekStartDay) + $startWeekBias = $weekStartDay - 7; +else + $startWeekBias = $weekStartDay; +$startDate = new DateAndTime(); +$startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); +$endDate = new DateAndTime(); +$endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); +// The above is needed to set date range (timestring) in page title. + +// Use custom fields plugin if it is enabled. +if ($user->isPluginEnabled('cf')) { + require_once('plugins/CustomFields.class.php'); + $custom_fields = new CustomFields(); + $smarty->assign('custom_fields', $custom_fields); +} + +// Use Monthly Quotas plugin, if applicable. +if ($user->isPluginEnabled('mq')){ + require_once('plugins/MonthlyQuota.class.php'); + $quota = new MonthlyQuota(); + $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); + $month_total = ttTimeHelper::getTimeForMonth($selected_date); + $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); + + $smarty->assign('month_total', $month_total); + $smarty->assign('over_quota', $minutes_left < 0); + $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); +} + +// Initialize variables. +$cl_billable = 1; +if ($showBillable) { + if ($request->isPost()) { + $cl_billable = $request->getParameter('billable'); + $_SESSION['billable'] = (int) $cl_billable; + } else + if (isset($_SESSION['billable'])) + $cl_billable = $_SESSION['billable']; +} +$cl_client = $request->getParameter('client', ($request->isPost() ? null : @$_SESSION['client'])); +$_SESSION['client'] = $cl_client; +$cl_project = $request->getParameter('project', ($request->isPost() ? null : @$_SESSION['project'])); +$_SESSION['project'] = $cl_project; +$cl_task = $request->getParameter('task', ($request->isPost() ? null : @$_SESSION['task'])); +$_SESSION['task'] = $cl_task; +$cl_note = $request->getParameter('note', ($request->isPost() ? null : @$_SESSION['note'])); +$_SESSION['note'] = $cl_note; + +$timeCustomFields = array(); +// If we have time custom fields - collect input. +if ($request->isPost()) { + if ($custom_fields && $custom_fields->timeFields) { + foreach ($custom_fields->timeFields as $timeField) { + $control_name = 'time_field_'.$timeField['id']; + $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], + 'control_name' => $control_name, + 'label' => $timeField['label'], + 'type' => $timeField['type'], + 'required' => $timeField['required'], + 'value' => trim($request->getParameter($control_name))); + } + } +} + +// Get the data we need to display week view. +// Get column headers, which are day numbers in month. +$dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString(DB_DATEFORMAT)); +$lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString(DB_DATEFORMAT)); +// Get already existing records. +$records = ttWeekViewHelper::getRecordsForInterval($startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT), $showFiles); +// Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function. +if ($records) + $dataArray = ttWeekViewHelper::getDataForWeekView($records, $dayHeaders); +else + $dataArray = ttWeekViewHelper::prePopulateFromPastWeeks($startDate->toString(DB_DATEFORMAT), $dayHeaders); + +// Build day totals (total durations for each day in week). +$dayTotals = ttWeekViewHelper::getDayTotals($dataArray, $dayHeaders); + +// Define rendering class for a label field to the left of durations. +class LabelCellRenderer extends DefaultCellRenderer { + function render(&$table, $value, $row, $column, $selected = false) { + global $user; + $showNotes = $user->isOptionEnabled('week_notes'); + + $this->setOptions(array('width'=>200,'valign'=>'middle')); + + // Special handling for a new week entry (row 0, or 0 and 1 if we show notes). + if (0 == $row) { + $this->setOptions(array('style'=>'text-align: center; font-weight: bold; vertical-align: top;')); + } else if ($showNotes && (1 == $row)) { + $this->setOptions(array('style'=>'text-align: right; vertical-align: top;')); + } else if ($showNotes && (0 != $row % 2)) { + $this->setOptions(array('style'=>'text-align: right;')); + } + // Special handling for not billable entries. + $ignoreRow = $showNotes ? 1 : 0; + if ($row > $ignoreRow) { + $row_id = $table->getValueAtName($row,'row_id'); + $billable = ttWeekViewHelper::parseFromWeekViewRow($row_id, 'bl'); + if (!$billable) { + if (($showNotes && (0 == $row % 2)) || !$showNotes) { + $this->setOptions(array('style'=>'color: red;')); // TODO: style it properly in CSS. + } + } + } + $this->setValue(htmlspecialchars($value)); // This escapes HTML for output. + return $this->toString(); + } +} + +// Define rendering class for a single cell for a time or a comment entry in week view table. +class WeekViewCellRenderer extends DefaultCellRenderer { + function render(&$table, $value, $row, $column, $selected = false) { + global $user; + $showNotes = $user->isOptionEnabled('week_notes'); + + $field_name = $table->getValueAt($row,$column)['control_id']; // Our text field names (and ids) are like x_y (row_column). + $field = new TextField($field_name); + // Disable control if the date is locked. + global $lockedDays; + if ($lockedDays[$column-1]) + $field->setEnabled(false); + $field->setFormName($table->getFormName()); + $field->setStyle('width: 60px;'); // TODO: need to style everything properly, eventually. + // Provide visual separation for new entry row. + $rowToSeparate = $showNotes ? 1 : 0; + if ($rowToSeparate == $row) { + $field->setStyle('width: 60px; margin-bottom: 40px'); + } + if ($showNotes) { + if (0 == $row % 2) { + $field->setValue($table->getValueAt($row,$column)['duration']); // Duration for even rows. + } else { + $field->setValue($table->getValueAt($row,$column)['note']); // Comment for odd rows. + $field->setTitle($table->getValueAt($row,$column)['note']); // Tooltip to help view the entire comment. + } + } else { + $field->setValue($table->getValueAt($row,$column)['duration']); + // $field->setTitle($table->getValueAt($row,$column)['note']); // Tooltip to see comment. TODO - value not available. + } + // Disable control when time entry mode is TYPE_START_FINISH and there is no value in control + // because we can't supply start and finish times in week view - there are no fields for them. + if (!$field->getValue() && TYPE_START_FINISH == $user->getRecordType()) { + $field->setEnabled(false); + } + $this->setValue($field->getHtml()); + return $this->toString(); + } +} + +// Elements of weekTimeForm. +$form = new Form('weekTimeForm'); +$largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. + +if ($user->can('track_time')) { + $rank = $user->getMaxRankForGroup($group_id); + if ($user->can('track_own_time')) + $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_self'=>true,'self_first'=>true); + else + $options = array('status'=>ACTIVE,'max_rank'=>$rank); + $user_list = $user->getUsers($options); + if (count($user_list) >= 1) { + $form->addInput(array('type'=>'combobox', + 'onchange'=>'document.weekTimeForm.user_changed.value=1;document.weekTimeForm.submit();', + 'name'=>'user', + 'style'=>'width: 250px;', + 'value'=>$user_id, + 'data'=>$user_list, + 'datakeys'=>array('id','name'))); + $form->addInput(array('type'=>'hidden','name'=>'user_changed')); + $largeScreenCalendarRowSpan += 2; + $smarty->assign('user_dropdown', 1); + } +} + +// Create week_durations table. +$table = new Table('week_durations'); +// $table->setCssClass('week_view_table'); // Currently not used. Fix this. +$table->setTableOptions(array('width'=>'100%','cellspacing'=>'1','cellpadding'=>'3','border'=>'0')); +$table->setRowOptions(array('class'=>'tableHeaderCentered')); +$table->setData($dataArray); +// Add columns to table. +$table->addColumn(new TableColumn('label', '', new LabelCellRenderer(), $dayTotals['label'])); +for ($i = 0; $i < 7; $i++) { + $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]])); +} +$table->setInteractive(false); +$form->addInputElement($table); + +// Dropdown for clients in MODE_TIME. Use all active clients. +if (MODE_TIME == $trackingMode && $showClient) { + $active_clients = ttGroupHelper::getActiveClients(true); + $form->addInput(array('type'=>'combobox', + 'onchange'=>'fillProjectDropdown(this.value);', + 'name'=>'client', + 'style'=>'width: 250px;', + 'value'=>$cl_client, + 'data'=>$active_clients, + 'datakeys'=>array('id', 'name'), + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; + // Note: in other modes the client list is filtered to relevant clients only. See below. +} + +// Billable checkbox. +if ($user->isPluginEnabled('iv')) + $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); + +// If we have time custom fields - add controls for them. +if ($custom_fields && $custom_fields->timeFields) { + foreach ($custom_fields->timeFields as $timeField) { + $field_name = 'time_field_'.$timeField['id']; + if ($timeField['type'] == CustomFields::TYPE_TEXT) { + $form->addInput(array('type'=>'text','name'=>$field_name,'style'=>'width: 250px;','value'=>$timeCustomFields[$timeField['id']]['value'])); + } elseif ($timeField['type'] == CustomFields::TYPE_DROPDOWN) { + $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'style'=>'width: 250px;', + 'data'=>CustomFields::getOptions($timeField['id']), + 'value'=>$timeCustomFields[$timeField['id']]['value'], + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + } + } +} + +// If we show project dropdown, add controls for project and client. +if ($showProject) { + // Dropdown for projects assigned to user. + $project_list = $user->getAssignedProjects(); + $form->addInput(array('type'=>'combobox', + 'onchange'=>'fillTaskDropdown(this.value);', + 'name'=>'project', + 'style'=>'width: 250px;', + 'value'=>$cl_project, + 'data'=>$project_list, + 'datakeys'=>array('id','name'), + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + + // Dropdown for clients if the clients plugin is enabled. + if ($showClient) { + $active_clients = ttGroupHelper::getActiveClients(true); + // We need an array of assigned project ids to do some trimming. + foreach($project_list as $project) + $projects_assigned_to_user[] = $project['id']; + + // Build a client list out of active clients. Use only clients that are relevant to user. + // Also trim their associated project list to only assigned projects (to user). + foreach($active_clients as $client) { + $projects_assigned_to_client = explode(',', $client['projects']); + if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user)) + $intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user); + if ($intersection) { + $client['projects'] = implode(',', $intersection); + $client_list[] = $client; + } + } + $form->addInput(array('type'=>'combobox', + 'onchange'=>'fillProjectDropdown(this.value);', + 'name'=>'client', + 'style'=>'width: 250px;', + 'value'=>$cl_client, + 'data'=>$client_list, + 'datakeys'=>array('id', 'name'), + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + } +} + +// Task dropdown. +if ($showTask) { + $task_list = ttGroupHelper::getActiveTasks(); + $form->addInput(array('type'=>'combobox', + 'name'=>'task', + 'style'=>'width: 250px;', + 'value'=>$cl_task, + 'data'=>$task_list, + 'datakeys'=>array('id','name'), + 'empty'=>array(''=>$i18n->get('dropdown.select')))); +} + +// Week note control. +if ($showWeekNote) { + if (!defined('NOTE_INPUT_HEIGHT')) + define('NOTE_INPUT_HEIGHT', 40); + $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); +} + +// Calendar. +$form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); + +// A hidden control for today's date from user's browser. +$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'get_date()')); // User current date, which gets filled in on btn_submit click. + +// Submit button. +$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit'))); + +// Submit. +if ($request->isPost()) { + if ($request->getParameter('btn_submit')) { + // Validate user input for row 0. + // Determine if a new entry was posted. + $newEntryPosted = false; + foreach($dayHeaders as $dayHeader) { + $control_id = '0_'.$dayHeader; + if ($request->getParameter($control_id)) { + $newEntryPosted = true; + break; + } + } + if ($newEntryPosted) { + if ($showClient && $user->isOptionEnabled('client_required') && !$cl_client) + $err->add($i18n->get('error.client')); + // Validate input in time custom fields. + if ($custom_fields && $custom_fields->timeFields) { + foreach ($timeCustomFields as $timeField) { + // Validation is the same for text and dropdown fields. + if (!ttValidString($timeField['value'], !$timeField['required'])) $err->add($i18n->get('error.field'), htmlspecialchars($timeField['label'])); + } + } + if ($showProject) { + if (!$cl_project) $err->add($i18n->get('error.project')); + } + if ($showTask && $taskRequired) { + if (!$cl_task) $err->add($i18n->get('error.task')); + } + } + // Finished validating user input for row 0. + + // Process the table of values. + if ($err->no()) { + + // Obtain values. Iterate through posted parameters one by one, + // see if value changed, apply one change at a time until we see an error. + $result = true; + $rowNumber = 0; + // Iterate through existing rows. + foreach ($dataArray as $row) { + // Iterate through days. + foreach ($dayHeaders as $key => $dayHeader) { + // Do not process locked days. + if ($lockedDays[$key]) continue; + // Make control id for the cell. + $control_id = $rowNumber.'_'.$dayHeader; + + // Handle durations and comments in separate blocks of code. + if (!$showWeekNotes || (0 == $rowNumber % 2)) { + // Handle durations row here. + + // Obtain existing and posted durations. + $postedDuration = $request->getParameter($control_id); + $existingDuration = $dataArray[$rowNumber][$dayHeader]['duration']; + // If posted value is not null, check and normalize it. + if ($postedDuration) { + if (false === ttTimeHelper::postedDurationToMinutes($postedDuration)) { + $err->add($i18n->get('error.field'), $i18n->get('label.duration')); + $result = false; break; // Break out. Stop any further processing. + } else { + $minutes = ttTimeHelper::postedDurationToMinutes($postedDuration); + $postedDuration = ttTimeHelper::minutesToDuration($minutes); + } + } + // Do not process if value has not changed. + if ($postedDuration == $existingDuration) + continue; + // Posted value is different. + if ($existingDuration == null) { + // Skip inserting 0 duration values. + if (0 == ttTimeHelper::toMinutes($postedDuration)) + continue; + // Insert a new record. + $fields = array(); + $fields['row_id'] = $dataArray[$rowNumber]['row_id']; + if (!$fields['row_id']) { + // Special handling for row 0, a new entry. Need to construct new row_id. + $record = array(); + $record['client_id'] = $cl_client; + $record['billable'] = $cl_billable ? '1' : '0'; + $record['project_id'] = $cl_project; + $record['task_id'] = $cl_task; + if ($custom_fields && $custom_fields->timeFields) { + foreach ($custom_fields->timeFields as $timeField) { + $field_name = 'time_field_'.$timeField['id']; + if ($timeField['type'] == CustomFields::TYPE_TEXT) + $record[$field_name] = $timeCustomFields[$timeField['id']]['value']; + else if ($timeField['type'] == CustomFields::TYPE_DROPDOWN) + $record[$field_name.'_option_id'] = $timeCustomFields[$timeField['id']]['value']; + } + } + $fields['row_id'] = ttWeekViewHelper::makeRowIdentifier($record).'_0'; + // Note: no need to check for a possible conflict with an already existing row + // because we are doing an insert that does not affect already existing data. + + if ($showWeekNote) { + $fields['note'] = $request->getParameter('note'); + } + } + $fields['day_header'] = $dayHeader; + $fields['start_date'] = $startDate->toString(DB_DATEFORMAT); // To be able to determine date for the entry using $dayHeader. + $fields['duration'] = $postedDuration; + $fields['browser_today'] = $request->getParameter('browser_today', null); + if ($showWeekNotes) { + // Take note value from the control below duration. + $noteRowNumber = $rowNumber + 1; + $note_control_id = $noteRowNumber.'_'.$dayHeader; + $fields['note'] = $request->getParameter($note_control_id); + } + $result = ttWeekViewHelper::insertDurationFromWeekView($fields, $custom_fields, $err); + } elseif ($postedDuration == null || 0 == ttTimeHelper::toMinutes($postedDuration)) { + // Delete an already existing record here. + $result = ttTimeHelper::delete($dataArray[$rowNumber][$dayHeader]['tt_log_id']); + } else { + $fields = array(); + $fields['tt_log_id'] = $dataArray[$rowNumber][$dayHeader]['tt_log_id']; + $fields['duration'] = $postedDuration; + $result = ttWeekViewHelper::modifyDurationFromWeekView($fields, $err); + } + if (!$result) break; // Break out of the loop in case of first error. + + } else if ($showWeekNotes) { + // Handle commments row here. + + // Obtain existing and posted comments. + $postedComment = $request->getParameter($control_id); + $existingComment = $dataArray[$rowNumber][$dayHeader]['note']; + // If posted value is not null, check it. + if ($postedComment && !ttValidString($postedComment, true)) { + $err->add($i18n->get('error.field'), $i18n->get('label.note')); + $result = false; break; // Break out. Stop any further processing. + } + // Do not process if value has not changed. + if ($postedComment == $existingComment) + continue; + + // Posted value is different. + // TODO: handle new entries separately in the durations block above. + + // Here, only update the comment on an already existing record. + $fields = array(); + $fields['tt_log_id'] = $dataArray[$rowNumber][$dayHeader]['tt_log_id']; + if ($fields['tt_log_id']) { + $fields['comment'] = $postedComment; + $result = ttWeekViewHelper::modifyCommentFromWeekView($fields); + } + if (!$result) break; // Break out of the loop on first error. + } + } + if (!$result) break; // Break out of the loop on first error. + $rowNumber++; + } + if ($result) { + header('Location: week.php'); // Normal exit. + exit(); + } + } + } +} // isPost + +$week_total = ttTimeHelper::getTimeForWeek($selected_date); + +$smarty->assign('large_screen_calendar_row_span', $largeScreenCalendarRowSpan); +$smarty->assign('selected_date', $selected_date); +$smarty->assign('week_total', $week_total); +$smarty->assign('client_list', $client_list); +$smarty->assign('project_list', $project_list); +$smarty->assign('task_list', $task_list); +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('onload', 'onLoad="fillDropdowns()"'); +$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format)); +$smarty->assign('time_records', $records); +$smarty->assign('show_navigation', !$user->isOptionEnabled('week_menu')); +$smarty->assign('show_client', $showClient); +$smarty->assign('show_billable', $showBillable); +$smarty->assign('show_project', $showProject); +$smarty->assign('show_task', $showTask); +$smarty->assign('task_required', $taskRequired); +$smarty->assign('show_week_note', $showWeekNote); +$smarty->assign('show_week_list', $user->isOptionEnabled('week_list')); +$smarty->assign('show_start', $showStart); +$smarty->assign('show_files', $showFiles); +$smarty->assign('title', $i18n->get('menu.week')); +$smarty->assign('content_page_name', 'week2.tpl'); +$smarty->display('index2.tpl'); From e7ec5231bd04c2d5cc430746cac8572c06bc1653 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 13:43:14 +0000 Subject: [PATCH 002/304] A bit more progress towards making week view mobile friendly. --- WEB-INF/templates/week2.tpl | 42 +++++++++++++++++++++++++++++++++++++ default.css | 4 ++-- initialize.php | 2 +- time.php | 4 +++- week2.php | 27 ++++++++++++------------ 5 files changed, 61 insertions(+), 18 deletions(-) diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week2.tpl index b46e9804..b09a1198 100644 --- a/WEB-INF/templates/week2.tpl +++ b/WEB-INF/templates/week2.tpl @@ -51,6 +51,48 @@ function fillDropdowns() {
{/if} +{if $show_billable} + +   + + +
+{/if} +{if isset($custom_fields) && $custom_fields->timeFields} + {foreach $custom_fields->timeFields as $timeField} + {assign var="control_name" value='time_field_'|cat:$timeField['id']} + + + + {$forms.weekTimeForm.$control_name.control} + +
+ {/foreach} +{/if} +{if $show_project} + + + + {$forms.weekTimeForm.project.control} + +
+{/if} +{if $show_task} + + + + {$forms.weekTimeForm.task.control} + +
+{/if} +{if $show_week_note} + + + + {$forms.weekTimeForm.week_note.control} + +
+{/if} {$forms.weekTimeForm.close} diff --git a/default.css b/default.css index e04cab3d..48cd2c4e 100644 --- a/default.css +++ b/default.css @@ -363,7 +363,7 @@ input[type="text"].short-text-field { } /* textareas for fields */ -#description, #address, #item_name, #comment, #custom_css, #content { +#description, #address, #item_name, #comment, #custom_css, #content, #week_note { width: 220px; border-radius: 4px; border: 1px solid #c9c9c9; @@ -371,7 +371,7 @@ input[type="text"].short-text-field { } /* textareas with focus */ -#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #content:focus { +#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #content:focus, #week_note:focus { background-color: yellow; border: 1px solid black; outline: none; diff --git a/initialize.php b/initialize.php index 14c04798..09214a38 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5531"); +define("APP_VERSION", "1.19.28.5532"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index d96c497e..9b366b54 100644 --- a/time.php +++ b/time.php @@ -192,8 +192,10 @@ } // Billable checkbox. -if ($showBillable) +if ($showBillable) { $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); + $largeScreenCalendarRowSpan += 2; +} // If we have time custom fields - add controls for them. if (isset($custom_fields) && $custom_fields->timeFields) { diff --git a/week2.php b/week2.php index f97a515d..6fccba9c 100644 --- a/week2.php +++ b/week2.php @@ -121,8 +121,8 @@ $_SESSION['project'] = $cl_project; $cl_task = $request->getParameter('task', ($request->isPost() ? null : @$_SESSION['task'])); $_SESSION['task'] = $cl_task; -$cl_note = $request->getParameter('note', ($request->isPost() ? null : @$_SESSION['note'])); -$_SESSION['note'] = $cl_note; +$cl_note = $request->getParameter('week_note', ($request->isPost() ? null : @$_SESSION['week_note'])); +$_SESSION['week_note'] = $cl_note; $timeCustomFields = array(); // If we have time custom fields - collect input. @@ -242,7 +242,6 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'document.weekTimeForm.user_changed.value=1;document.weekTimeForm.submit();', 'name'=>'user', - 'style'=>'width: 250px;', 'value'=>$user_id, 'data'=>$user_list, 'datakeys'=>array('id','name'))); @@ -272,7 +271,6 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', - 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$active_clients, 'datakeys'=>array('id', 'name'), @@ -282,22 +280,24 @@ function render(&$table, $value, $row, $column, $selected = false) { } // Billable checkbox. -if ($user->isPluginEnabled('iv')) +if ($showBillable) { $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); + $largeScreenCalendarRowSpan += 2; +} // If we have time custom fields - add controls for them. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) { - $form->addInput(array('type'=>'text','name'=>$field_name,'style'=>'width: 250px;','value'=>$timeCustomFields[$timeField['id']]['value'])); + $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$timeCustomFields[$timeField['id']]['value'])); } elseif ($timeField['type'] == CustomFields::TYPE_DROPDOWN) { $form->addInput(array('type'=>'combobox','name'=>$field_name, - 'style'=>'width: 250px;', 'data'=>CustomFields::getOptions($timeField['id']), 'value'=>$timeCustomFields[$timeField['id']]['value'], 'empty'=>array(''=>$i18n->get('dropdown.select')))); } + $largeScreenCalendarRowSpan += 2; } } @@ -308,11 +308,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillTaskDropdown(this.value);', 'name'=>'project', - 'style'=>'width: 250px;', 'value'=>$cl_project, 'data'=>$project_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; // Dropdown for clients if the clients plugin is enabled. if ($showClient) { @@ -335,11 +335,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', - 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; } } @@ -348,18 +348,17 @@ function render(&$table, $value, $row, $column, $selected = false) { $task_list = ttGroupHelper::getActiveTasks(); $form->addInput(array('type'=>'combobox', 'name'=>'task', - 'style'=>'width: 250px;', 'value'=>$cl_task, 'data'=>$task_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; } // Week note control. if ($showWeekNote) { - if (!defined('NOTE_INPUT_HEIGHT')) - define('NOTE_INPUT_HEIGHT', 40); - $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); + $form->addInput(array('type'=>'textarea','name'=>'week_note','value'=>$cl_note)); + $largeScreenCalendarRowSpan += 2; } // Calendar. @@ -468,7 +467,7 @@ function render(&$table, $value, $row, $column, $selected = false) { // because we are doing an insert that does not affect already existing data. if ($showWeekNote) { - $fields['note'] = $request->getParameter('note'); + $fields['note'] = $request->getParameter('week_note'); } } $fields['day_header'] = $dayHeader; From d09c4858e797b620335255e38c84c9e423dc8e4c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 15:57:52 +0000 Subject: [PATCH 003/304] Made week view mobile friendly. --- WEB-INF/templates/week2.tpl | 183 ++++++++++-------------------------- default.css | 4 +- initialize.php | 2 +- week.php | 39 ++++---- week2.php => week_old.php | 35 ++++--- 5 files changed, 90 insertions(+), 173 deletions(-) rename week2.php => week_old.php (96%) diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week2.tpl index b09a1198..7f77b0ad 100644 --- a/WEB-INF/templates/week2.tpl +++ b/WEB-INF/templates/week2.tpl @@ -86,193 +86,108 @@ function fillDropdowns() {
{/if} {if $show_week_note} - + - - {$forms.weekTimeForm.week_note.control} + + {$forms.weekTimeForm.comment.control}
{/if} -{$forms.weekTimeForm.close} - - - - -{$forms.weekTimeForm.open} - -{if $show_navigation} - - - -{/if} +
+
- {$i18n.label.day_view} / {$i18n.label.week_view} -
- - - -
- -{if $user_dropdown} - - - - -{/if} -{if $show_client} - - - - -{/if} -{if $show_billable} - - - - -{/if} -{if $custom_fields && $custom_fields->timeFields} - {foreach $custom_fields->timeFields as $timeField} - - - {assign var="control_name" value='time_field_'|cat:$timeField['id']} - - - {/foreach} -{/if} -{if $show_project} - - - - -{/if} -{if $show_task} - - - - -{/if} -{if $show_week_note} - - - - -{/if} -
{$i18n.label.user}:{$forms.weekTimeForm.user.control}
{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/if}:{$forms.weekTimeForm.client.control}
 
{$timeField['label']|escape}{if $timeField['required']} (*){/if}:{$forms.weekTimeForm.$control_name.control}
{$i18n.label.project} (*):{$forms.weekTimeForm.project.control}
{$i18n.label.task}{if $task_required} (*){/if}:{$forms.weekTimeForm.task.control}
{$i18n.label.week_note}:{$forms.weekTimeForm.note.control}
-
- - -
{$forms.weekTimeForm.date.control}
-
- -
{$forms.weekTimeForm.week_durations.control}
- - - - - - -
{$forms.weekTimeForm.btn_submit.control}
 
+
{$forms.weekTimeForm.btn_submit.control}
+{$forms.weekTimeForm.close} {if $show_week_list} - - - -
-{if $time_records} - - - +
+
{$i18n.label.date}
+ + {if $show_client} - + {/if} {if $show_project} - + {/if} {if $show_task} - + {/if} {if $show_start} - - + + {/if} - - + + {if $show_files} - + {/if} - - - + + + {foreach $time_records as $record} - - + + {if $show_client} - + {/if} {if $show_project} - + {/if} {if $show_task} - + {/if} {if $show_start} - - + + {/if} - - + + {if $show_files} {if $record.has_files} - + {else} - + {/if} {/if} - - + - + + {/foreach} -
{$i18n.label.date}{$i18n.label.client}{$i18n.label.client}{$i18n.label.project}{$i18n.label.project}{$i18n.label.task}{$i18n.label.task}{$i18n.label.start}{$i18n.label.finish}{$i18n.label.start}{$i18n.label.finish}{$i18n.label.duration}{$i18n.label.note}{$i18n.label.duration}{$i18n.label.note}
{$record.date}
{$record.date}{$record.client|escape}{$record.client|escape}{$record.project|escape}{$record.project|escape}{$record.task|escape}{$record.task|escape}{if $record.start}{$record.start}{else} {/if}{if $record.finish}{$record.finish}{else} {/if}{if $record.start}{$record.start}{else} {/if}{if $record.finish}{$record.finish}{else} {/if}{if ($record.duration == '0:00' && $record.start <> '')}{$i18n.form.time.uncompleted}{else}{$record.duration}{/if}{if $record.comment}{$record.comment|escape}{else} {/if}{if ($record.duration == '0:00' && $record.start <> '')}{$i18n.form.time.uncompleted}{else}{$record.duration}{/if}{if $record.comment}{$record.comment|escape}{else} {/if}{$i18n.label.files}{$i18n.label.files}{$i18n.label.files}{$i18n.label.files} + {if $record.approved || $record.timesheet_id || $record.invoice_id} -   +   {else} - {$i18n.label.edit} + {$i18n.label.edit} {/if} - + {if $record.approved || $record.timesheet_id || $record.invoice_id} -   +   {else} - {$i18n.label.delete} + {$i18n.label.delete} {/if} -
-{/if} -
{/if} - {if $time_records} - - {if $show_week_list} +
+
- - + + - {/if} {if $user->isPluginEnabled('mq')} - + {if $over_quota} - + {else} - + {/if} {/if}
{$i18n.label.week_total}: {$week_total}{$i18n.label.week_total}: {$week_total}
{$i18n.label.month_total}: {$month_total}{$i18n.label.month_total}: {$month_total}{$i18n.form.time.over_quota}: {$quota_remaining}{$i18n.form.time.over_quota}: {$quota_remaining}{$i18n.form.time.remaining_quota}: {$quota_remaining}{$i18n.form.time.remaining_quota}: {$quota_remaining}
{/if} -{$forms.weekTimeForm.close} diff --git a/default.css b/default.css index 48cd2c4e..e04cab3d 100644 --- a/default.css +++ b/default.css @@ -363,7 +363,7 @@ input[type="text"].short-text-field { } /* textareas for fields */ -#description, #address, #item_name, #comment, #custom_css, #content, #week_note { +#description, #address, #item_name, #comment, #custom_css, #content { width: 220px; border-radius: 4px; border: 1px solid #c9c9c9; @@ -371,7 +371,7 @@ input[type="text"].short-text-field { } /* textareas with focus */ -#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #content:focus, #week_note:focus { +#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #content:focus { background-color: yellow; border: 1px solid black; outline: none; diff --git a/initialize.php b/initialize.php index 09214a38..dc0c3545 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5532"); +define("APP_VERSION", "1.19.28.5533"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index 01597704..dbb61529 100644 --- a/week.php +++ b/week.php @@ -121,8 +121,8 @@ $_SESSION['project'] = $cl_project; $cl_task = $request->getParameter('task', ($request->isPost() ? null : @$_SESSION['task'])); $_SESSION['task'] = $cl_task; -$cl_note = $request->getParameter('note', ($request->isPost() ? null : @$_SESSION['note'])); -$_SESSION['note'] = $cl_note; +$cl_note = $request->getParameter('comment', ($request->isPost() ? null : @$_SESSION['comment'])); +$_SESSION['comment'] = $cl_note; $timeCustomFields = array(); // If we have time custom fields - collect input. @@ -229,6 +229,7 @@ function render(&$table, $value, $row, $column, $selected = false) { // Elements of weekTimeForm. $form = new Form('weekTimeForm'); +$largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. if ($user->can('track_time')) { $rank = $user->getMaxRankForGroup($group_id); @@ -241,11 +242,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'document.weekTimeForm.user_changed.value=1;document.weekTimeForm.submit();', 'name'=>'user', - 'style'=>'width: 250px;', 'value'=>$user_id, 'data'=>$user_list, 'datakeys'=>array('id','name'))); $form->addInput(array('type'=>'hidden','name'=>'user_changed')); + $largeScreenCalendarRowSpan += 2; $smarty->assign('user_dropdown', 1); } } @@ -270,31 +271,33 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', - 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$active_clients, 'datakeys'=>array('id', 'name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; // Note: in other modes the client list is filtered to relevant clients only. See below. } // Billable checkbox. -if ($user->isPluginEnabled('iv')) +if ($showBillable) { $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); + $largeScreenCalendarRowSpan += 2; +} // If we have time custom fields - add controls for them. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) { - $form->addInput(array('type'=>'text','name'=>$field_name,'style'=>'width: 250px;','value'=>$timeCustomFields[$timeField['id']]['value'])); + $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$timeCustomFields[$timeField['id']]['value'])); } elseif ($timeField['type'] == CustomFields::TYPE_DROPDOWN) { $form->addInput(array('type'=>'combobox','name'=>$field_name, - 'style'=>'width: 250px;', 'data'=>CustomFields::getOptions($timeField['id']), 'value'=>$timeCustomFields[$timeField['id']]['value'], 'empty'=>array(''=>$i18n->get('dropdown.select')))); } + $largeScreenCalendarRowSpan += 2; } } @@ -305,11 +308,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillTaskDropdown(this.value);', 'name'=>'project', - 'style'=>'width: 250px;', 'value'=>$cl_project, 'data'=>$project_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; // Dropdown for clients if the clients plugin is enabled. if ($showClient) { @@ -332,11 +335,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', - 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; } } @@ -345,18 +348,17 @@ function render(&$table, $value, $row, $column, $selected = false) { $task_list = ttGroupHelper::getActiveTasks(); $form->addInput(array('type'=>'combobox', 'name'=>'task', - 'style'=>'width: 250px;', 'value'=>$cl_task, 'data'=>$task_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); + $largeScreenCalendarRowSpan += 2; } // Week note control. if ($showWeekNote) { - if (!defined('NOTE_INPUT_HEIGHT')) - define('NOTE_INPUT_HEIGHT', 40); - $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); + $form->addInput(array('type'=>'textarea','name'=>'comment','value'=>$cl_note)); + $largeScreenCalendarRowSpan += 2; } // Calendar. @@ -465,7 +467,7 @@ function render(&$table, $value, $row, $column, $selected = false) { // because we are doing an insert that does not affect already existing data. if ($showWeekNote) { - $fields['note'] = $request->getParameter('note'); + $fields['note'] = $request->getParameter('comment'); } } $fields['day_header'] = $dayHeader; @@ -476,7 +478,9 @@ function render(&$table, $value, $row, $column, $selected = false) { // Take note value from the control below duration. $noteRowNumber = $rowNumber + 1; $note_control_id = $noteRowNumber.'_'.$dayHeader; - $fields['note'] = $request->getParameter($note_control_id); + if ($request->getParameter($note_control_id)) { + $fields['note'] = $request->getParameter($note_control_id); // This overwrites week note. + } } $result = ttWeekViewHelper::insertDurationFromWeekView($fields, $custom_fields, $err); } elseif ($postedDuration == null || 0 == ttTimeHelper::toMinutes($postedDuration)) { @@ -531,6 +535,7 @@ function render(&$table, $value, $row, $column, $selected = false) { $week_total = ttTimeHelper::getTimeForWeek($selected_date); +$smarty->assign('large_screen_calendar_row_span', $largeScreenCalendarRowSpan); $smarty->assign('selected_date', $selected_date); $smarty->assign('week_total', $week_total); $smarty->assign('client_list', $client_list); @@ -551,5 +556,5 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('show_start', $showStart); $smarty->assign('show_files', $showFiles); $smarty->assign('title', $i18n->get('menu.week')); -$smarty->assign('content_page_name', 'week.tpl'); -$smarty->display('index.tpl'); +$smarty->assign('content_page_name', 'week2.tpl'); +$smarty->display('index2.tpl'); diff --git a/week2.php b/week_old.php similarity index 96% rename from week2.php rename to week_old.php index 6fccba9c..01597704 100644 --- a/week2.php +++ b/week_old.php @@ -121,8 +121,8 @@ $_SESSION['project'] = $cl_project; $cl_task = $request->getParameter('task', ($request->isPost() ? null : @$_SESSION['task'])); $_SESSION['task'] = $cl_task; -$cl_note = $request->getParameter('week_note', ($request->isPost() ? null : @$_SESSION['week_note'])); -$_SESSION['week_note'] = $cl_note; +$cl_note = $request->getParameter('note', ($request->isPost() ? null : @$_SESSION['note'])); +$_SESSION['note'] = $cl_note; $timeCustomFields = array(); // If we have time custom fields - collect input. @@ -229,7 +229,6 @@ function render(&$table, $value, $row, $column, $selected = false) { // Elements of weekTimeForm. $form = new Form('weekTimeForm'); -$largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. if ($user->can('track_time')) { $rank = $user->getMaxRankForGroup($group_id); @@ -242,11 +241,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'document.weekTimeForm.user_changed.value=1;document.weekTimeForm.submit();', 'name'=>'user', + 'style'=>'width: 250px;', 'value'=>$user_id, 'data'=>$user_list, 'datakeys'=>array('id','name'))); $form->addInput(array('type'=>'hidden','name'=>'user_changed')); - $largeScreenCalendarRowSpan += 2; $smarty->assign('user_dropdown', 1); } } @@ -271,33 +270,31 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', + 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$active_clients, 'datakeys'=>array('id', 'name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); - $largeScreenCalendarRowSpan += 2; // Note: in other modes the client list is filtered to relevant clients only. See below. } // Billable checkbox. -if ($showBillable) { +if ($user->isPluginEnabled('iv')) $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); - $largeScreenCalendarRowSpan += 2; -} // If we have time custom fields - add controls for them. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) { - $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$timeCustomFields[$timeField['id']]['value'])); + $form->addInput(array('type'=>'text','name'=>$field_name,'style'=>'width: 250px;','value'=>$timeCustomFields[$timeField['id']]['value'])); } elseif ($timeField['type'] == CustomFields::TYPE_DROPDOWN) { $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'style'=>'width: 250px;', 'data'=>CustomFields::getOptions($timeField['id']), 'value'=>$timeCustomFields[$timeField['id']]['value'], 'empty'=>array(''=>$i18n->get('dropdown.select')))); } - $largeScreenCalendarRowSpan += 2; } } @@ -308,11 +305,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillTaskDropdown(this.value);', 'name'=>'project', + 'style'=>'width: 250px;', 'value'=>$cl_project, 'data'=>$project_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); - $largeScreenCalendarRowSpan += 2; // Dropdown for clients if the clients plugin is enabled. if ($showClient) { @@ -335,11 +332,11 @@ function render(&$table, $value, $row, $column, $selected = false) { $form->addInput(array('type'=>'combobox', 'onchange'=>'fillProjectDropdown(this.value);', 'name'=>'client', + 'style'=>'width: 250px;', 'value'=>$cl_client, 'data'=>$client_list, 'datakeys'=>array('id', 'name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); - $largeScreenCalendarRowSpan += 2; } } @@ -348,17 +345,18 @@ function render(&$table, $value, $row, $column, $selected = false) { $task_list = ttGroupHelper::getActiveTasks(); $form->addInput(array('type'=>'combobox', 'name'=>'task', + 'style'=>'width: 250px;', 'value'=>$cl_task, 'data'=>$task_list, 'datakeys'=>array('id','name'), 'empty'=>array(''=>$i18n->get('dropdown.select')))); - $largeScreenCalendarRowSpan += 2; } // Week note control. if ($showWeekNote) { - $form->addInput(array('type'=>'textarea','name'=>'week_note','value'=>$cl_note)); - $largeScreenCalendarRowSpan += 2; + if (!defined('NOTE_INPUT_HEIGHT')) + define('NOTE_INPUT_HEIGHT', 40); + $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); } // Calendar. @@ -467,7 +465,7 @@ function render(&$table, $value, $row, $column, $selected = false) { // because we are doing an insert that does not affect already existing data. if ($showWeekNote) { - $fields['note'] = $request->getParameter('week_note'); + $fields['note'] = $request->getParameter('note'); } } $fields['day_header'] = $dayHeader; @@ -533,7 +531,6 @@ function render(&$table, $value, $row, $column, $selected = false) { $week_total = ttTimeHelper::getTimeForWeek($selected_date); -$smarty->assign('large_screen_calendar_row_span', $largeScreenCalendarRowSpan); $smarty->assign('selected_date', $selected_date); $smarty->assign('week_total', $week_total); $smarty->assign('client_list', $client_list); @@ -554,5 +551,5 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('show_start', $showStart); $smarty->assign('show_files', $showFiles); $smarty->assign('title', $i18n->get('menu.week')); -$smarty->assign('content_page_name', 'week2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'week.tpl'); +$smarty->display('index.tpl'); From 494d48957f43fc4ab1bb87e7e5b6371901ceb79d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 17:43:22 +0000 Subject: [PATCH 004/304] It is hard to believe but the entire app is now mobile friendly. --- WEB-INF/templates/week.tpl | 200 ------------- WEB-INF/templates/week2.tpl | 9 +- initialize.php | 2 +- week_old.php | 555 ------------------------------------ 4 files changed, 2 insertions(+), 764 deletions(-) delete mode 100644 WEB-INF/templates/week.tpl delete mode 100644 week_old.php diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl deleted file mode 100644 index 92ce31d9..00000000 --- a/WEB-INF/templates/week.tpl +++ /dev/null @@ -1,200 +0,0 @@ -{include file="time_script.tpl"} - - - - - -{$forms.weekTimeForm.open} - -{if $show_navigation} - - - -{/if} - - - - -
- {$i18n.label.day_view} / {$i18n.label.week_view} -
- -{if $user_dropdown} - - - - -{/if} -{if $show_client} - - - - -{/if} -{if $show_billable} - - - - -{/if} -{if $custom_fields && $custom_fields->timeFields} - {foreach $custom_fields->timeFields as $timeField} - - - {assign var="control_name" value='time_field_'|cat:$timeField['id']} - - - {/foreach} -{/if} -{if $show_project} - - - - -{/if} -{if $show_task} - - - - -{/if} -{if $show_week_note} - - - - -{/if} -
{$i18n.label.user}:{$forms.weekTimeForm.user.control}
{$i18n.label.client}{if $user->isOptionEnabled('client_required')} (*){/if}:{$forms.weekTimeForm.client.control}
 
{$timeField['label']|escape}{if $timeField['required']} (*){/if}:{$forms.weekTimeForm.$control_name.control}
{$i18n.label.project} (*):{$forms.weekTimeForm.project.control}
{$i18n.label.task}{if $task_required} (*){/if}:{$forms.weekTimeForm.task.control}
{$i18n.label.week_note}:{$forms.weekTimeForm.note.control}
-
- - -
{$forms.weekTimeForm.date.control}
-
- - - - -
{$forms.weekTimeForm.week_durations.control}
- - - - - - -
{$forms.weekTimeForm.btn_submit.control}
 
- -{if $show_week_list} - - - - -
-{if $time_records} - - - - {if $show_client} - - {/if} - {if $show_project} - - {/if} - {if $show_task} - - {/if} - {if $show_start} - - - {/if} - - - {if $show_files} - - {/if} - - - - {foreach $time_records as $record} - - - {if $show_client} - - {/if} - {if $show_project} - - {/if} - {if $show_task} - - {/if} - {if $show_start} - - - {/if} - - - {if $show_files} - {if $record.has_files} - - {else} - - {/if} - {/if} - - - - {/foreach} -
{$i18n.label.date}{$i18n.label.client}{$i18n.label.project}{$i18n.label.task}{$i18n.label.start}{$i18n.label.finish}{$i18n.label.duration}{$i18n.label.note}
{$record.date}{$record.client|escape}{$record.project|escape}{$record.task|escape}{if $record.start}{$record.start}{else} {/if}{if $record.finish}{$record.finish}{else} {/if}{if ($record.duration == '0:00' && $record.start <> '')}{$i18n.form.time.uncompleted}{else}{$record.duration}{/if}{if $record.comment}{$record.comment|escape}{else} {/if}{$i18n.label.files}{$i18n.label.files} - {if $record.approved || $record.timesheet_id || $record.invoice_id} -   - {else} - {$i18n.label.edit} - {/if} - - {if $record.approved || $record.timesheet_id || $record.invoice_id} -   - {else} - {$i18n.label.delete} - {/if} -
-{/if} -
-{/if} - -{if $time_records} - - {if $show_week_list} - - - - - {/if} - {if $user->isPluginEnabled('mq')} - - - {if $over_quota} - - {else} - - {/if} - - {/if} -
{$i18n.label.week_total}: {$week_total}
{$i18n.label.month_total}: {$month_total}{$i18n.form.time.over_quota}: {$quota_remaining}{$i18n.form.time.remaining_quota}: {$quota_remaining}
-{/if} -{$forms.weekTimeForm.close} diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week2.tpl index 7f77b0ad..7dbf5d1f 100644 --- a/WEB-INF/templates/week2.tpl +++ b/WEB-INF/templates/week2.tpl @@ -18,13 +18,6 @@ function fillDropdowns() { } - - - {if $show_navigation}
{$i18n.label.day_view} / {$i18n.label.week_view} @@ -130,7 +123,7 @@ function fillDropdowns() { {foreach $time_records as $record} - + {$record.date} {if $show_client} {$record.client|escape} diff --git a/initialize.php b/initialize.php index dc0c3545..469d92a7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5533"); +define("APP_VERSION", "1.19.28.5534"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week_old.php b/week_old.php deleted file mode 100644 index 01597704..00000000 --- a/week_old.php +++ /dev/null @@ -1,555 +0,0 @@ -isPluginEnabled('wv')) { - header('Location: feature_disabled.php'); - exit(); -} -if ($user->behalf_id && (!$user->can('track_time') || !$user->checkBehalfId())) { - header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user. - exit(); -} -if (!$user->behalf_id && !$user->can('track_own_time') && !$user->adjustBehalfId()) { - header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to work on behalf. - exit(); -} -if ($request->isPost()) { - $userChanged = (bool)$request->getParameter('user_changed'); // Reused in multiple places below. - if ($userChanged && !($user->can('track_time') && $user->isUserValid((int)$request->getParameter('user')))) { - header('Location: access_denied.php'); // User changed, but no right or wrong user id. - exit(); - } -} -// End of access checks. - -// Determine user for whom we display this page. -if ($request->isPost() && $userChanged) { - $user_id = (int)$request->getParameter('user'); - $user->setOnBehalfUser($user_id); -} else { - $user_id = $user->getUser(); -} - -$group_id = $user->getGroup(); - -$showClient = $user->isPluginEnabled('cl'); -$showBillable = $user->isPluginEnabled('iv'); -$trackingMode = $user->getTrackingMode(); -$showProject = MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode; -$showTask = MODE_PROJECTS_AND_TASKS == $trackingMode; -if ($showTask) $taskRequired = $user->getConfigOption('task_required'); -$showWeekNote = $user->isOptionEnabled('week_note'); -$showWeekNotes = $user->isOptionEnabled('week_notes'); -$recordType = $user->getRecordType(); -$showStart = TYPE_START_FINISH == $recordType || TYPE_ALL == $recordType; -$showFiles = $user->isPluginEnabled('at'); - -// Initialize and store date in session. -$cl_date = $request->getParameter('date', @$_SESSION['date']); -$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); -if($selected_date->isError()) - $selected_date = new DateAndTime(DB_DATEFORMAT); -if(!$cl_date) - $cl_date = $selected_date->toString(DB_DATEFORMAT); -$_SESSION['date'] = $cl_date; - -// Determine selected week start and end dates. -$weekStartDay = $user->getWeekStart(); -$t_arr = localtime($selected_date->getTimestamp()); -$t_arr[5] = $t_arr[5] + 1900; -if ($t_arr[6] < $weekStartDay) - $startWeekBias = $weekStartDay - 7; -else - $startWeekBias = $weekStartDay; -$startDate = new DateAndTime(); -$startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); -$endDate = new DateAndTime(); -$endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); -// The above is needed to set date range (timestring) in page title. - -// Use custom fields plugin if it is enabled. -if ($user->isPluginEnabled('cf')) { - require_once('plugins/CustomFields.class.php'); - $custom_fields = new CustomFields(); - $smarty->assign('custom_fields', $custom_fields); -} - -// Use Monthly Quotas plugin, if applicable. -if ($user->isPluginEnabled('mq')){ - require_once('plugins/MonthlyQuota.class.php'); - $quota = new MonthlyQuota(); - $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); - $month_total = ttTimeHelper::getTimeForMonth($selected_date); - $minutes_left = $month_quota_minutes - ttTimeHelper::toMinutes($month_total); - - $smarty->assign('month_total', $month_total); - $smarty->assign('over_quota', $minutes_left < 0); - $smarty->assign('quota_remaining', ttTimeHelper::toAbsDuration($minutes_left)); -} - -// Initialize variables. -$cl_billable = 1; -if ($showBillable) { - if ($request->isPost()) { - $cl_billable = $request->getParameter('billable'); - $_SESSION['billable'] = (int) $cl_billable; - } else - if (isset($_SESSION['billable'])) - $cl_billable = $_SESSION['billable']; -} -$cl_client = $request->getParameter('client', ($request->isPost() ? null : @$_SESSION['client'])); -$_SESSION['client'] = $cl_client; -$cl_project = $request->getParameter('project', ($request->isPost() ? null : @$_SESSION['project'])); -$_SESSION['project'] = $cl_project; -$cl_task = $request->getParameter('task', ($request->isPost() ? null : @$_SESSION['task'])); -$_SESSION['task'] = $cl_task; -$cl_note = $request->getParameter('note', ($request->isPost() ? null : @$_SESSION['note'])); -$_SESSION['note'] = $cl_note; - -$timeCustomFields = array(); -// If we have time custom fields - collect input. -if ($request->isPost()) { - if ($custom_fields && $custom_fields->timeFields) { - foreach ($custom_fields->timeFields as $timeField) { - $control_name = 'time_field_'.$timeField['id']; - $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], - 'control_name' => $control_name, - 'label' => $timeField['label'], - 'type' => $timeField['type'], - 'required' => $timeField['required'], - 'value' => trim($request->getParameter($control_name))); - } - } -} - -// Get the data we need to display week view. -// Get column headers, which are day numbers in month. -$dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString(DB_DATEFORMAT)); -$lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString(DB_DATEFORMAT)); -// Get already existing records. -$records = ttWeekViewHelper::getRecordsForInterval($startDate->toString(DB_DATEFORMAT), $endDate->toString(DB_DATEFORMAT), $showFiles); -// Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function. -if ($records) - $dataArray = ttWeekViewHelper::getDataForWeekView($records, $dayHeaders); -else - $dataArray = ttWeekViewHelper::prePopulateFromPastWeeks($startDate->toString(DB_DATEFORMAT), $dayHeaders); - -// Build day totals (total durations for each day in week). -$dayTotals = ttWeekViewHelper::getDayTotals($dataArray, $dayHeaders); - -// Define rendering class for a label field to the left of durations. -class LabelCellRenderer extends DefaultCellRenderer { - function render(&$table, $value, $row, $column, $selected = false) { - global $user; - $showNotes = $user->isOptionEnabled('week_notes'); - - $this->setOptions(array('width'=>200,'valign'=>'middle')); - - // Special handling for a new week entry (row 0, or 0 and 1 if we show notes). - if (0 == $row) { - $this->setOptions(array('style'=>'text-align: center; font-weight: bold; vertical-align: top;')); - } else if ($showNotes && (1 == $row)) { - $this->setOptions(array('style'=>'text-align: right; vertical-align: top;')); - } else if ($showNotes && (0 != $row % 2)) { - $this->setOptions(array('style'=>'text-align: right;')); - } - // Special handling for not billable entries. - $ignoreRow = $showNotes ? 1 : 0; - if ($row > $ignoreRow) { - $row_id = $table->getValueAtName($row,'row_id'); - $billable = ttWeekViewHelper::parseFromWeekViewRow($row_id, 'bl'); - if (!$billable) { - if (($showNotes && (0 == $row % 2)) || !$showNotes) { - $this->setOptions(array('style'=>'color: red;')); // TODO: style it properly in CSS. - } - } - } - $this->setValue(htmlspecialchars($value)); // This escapes HTML for output. - return $this->toString(); - } -} - -// Define rendering class for a single cell for a time or a comment entry in week view table. -class WeekViewCellRenderer extends DefaultCellRenderer { - function render(&$table, $value, $row, $column, $selected = false) { - global $user; - $showNotes = $user->isOptionEnabled('week_notes'); - - $field_name = $table->getValueAt($row,$column)['control_id']; // Our text field names (and ids) are like x_y (row_column). - $field = new TextField($field_name); - // Disable control if the date is locked. - global $lockedDays; - if ($lockedDays[$column-1]) - $field->setEnabled(false); - $field->setFormName($table->getFormName()); - $field->setStyle('width: 60px;'); // TODO: need to style everything properly, eventually. - // Provide visual separation for new entry row. - $rowToSeparate = $showNotes ? 1 : 0; - if ($rowToSeparate == $row) { - $field->setStyle('width: 60px; margin-bottom: 40px'); - } - if ($showNotes) { - if (0 == $row % 2) { - $field->setValue($table->getValueAt($row,$column)['duration']); // Duration for even rows. - } else { - $field->setValue($table->getValueAt($row,$column)['note']); // Comment for odd rows. - $field->setTitle($table->getValueAt($row,$column)['note']); // Tooltip to help view the entire comment. - } - } else { - $field->setValue($table->getValueAt($row,$column)['duration']); - // $field->setTitle($table->getValueAt($row,$column)['note']); // Tooltip to see comment. TODO - value not available. - } - // Disable control when time entry mode is TYPE_START_FINISH and there is no value in control - // because we can't supply start and finish times in week view - there are no fields for them. - if (!$field->getValue() && TYPE_START_FINISH == $user->getRecordType()) { - $field->setEnabled(false); - } - $this->setValue($field->getHtml()); - return $this->toString(); - } -} - -// Elements of weekTimeForm. -$form = new Form('weekTimeForm'); - -if ($user->can('track_time')) { - $rank = $user->getMaxRankForGroup($group_id); - if ($user->can('track_own_time')) - $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_self'=>true,'self_first'=>true); - else - $options = array('status'=>ACTIVE,'max_rank'=>$rank); - $user_list = $user->getUsers($options); - if (count($user_list) >= 1) { - $form->addInput(array('type'=>'combobox', - 'onchange'=>'document.weekTimeForm.user_changed.value=1;document.weekTimeForm.submit();', - 'name'=>'user', - 'style'=>'width: 250px;', - 'value'=>$user_id, - 'data'=>$user_list, - 'datakeys'=>array('id','name'))); - $form->addInput(array('type'=>'hidden','name'=>'user_changed')); - $smarty->assign('user_dropdown', 1); - } -} - -// Create week_durations table. -$table = new Table('week_durations'); -// $table->setCssClass('week_view_table'); // Currently not used. Fix this. -$table->setTableOptions(array('width'=>'100%','cellspacing'=>'1','cellpadding'=>'3','border'=>'0')); -$table->setRowOptions(array('class'=>'tableHeaderCentered')); -$table->setData($dataArray); -// Add columns to table. -$table->addColumn(new TableColumn('label', '', new LabelCellRenderer(), $dayTotals['label'])); -for ($i = 0; $i < 7; $i++) { - $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]])); -} -$table->setInteractive(false); -$form->addInputElement($table); - -// Dropdown for clients in MODE_TIME. Use all active clients. -if (MODE_TIME == $trackingMode && $showClient) { - $active_clients = ttGroupHelper::getActiveClients(true); - $form->addInput(array('type'=>'combobox', - 'onchange'=>'fillProjectDropdown(this.value);', - 'name'=>'client', - 'style'=>'width: 250px;', - 'value'=>$cl_client, - 'data'=>$active_clients, - 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->get('dropdown.select')))); - // Note: in other modes the client list is filtered to relevant clients only. See below. -} - -// Billable checkbox. -if ($user->isPluginEnabled('iv')) - $form->addInput(array('type'=>'checkbox','name'=>'billable','value'=>$cl_billable)); - -// If we have time custom fields - add controls for them. -if ($custom_fields && $custom_fields->timeFields) { - foreach ($custom_fields->timeFields as $timeField) { - $field_name = 'time_field_'.$timeField['id']; - if ($timeField['type'] == CustomFields::TYPE_TEXT) { - $form->addInput(array('type'=>'text','name'=>$field_name,'style'=>'width: 250px;','value'=>$timeCustomFields[$timeField['id']]['value'])); - } elseif ($timeField['type'] == CustomFields::TYPE_DROPDOWN) { - $form->addInput(array('type'=>'combobox','name'=>$field_name, - 'style'=>'width: 250px;', - 'data'=>CustomFields::getOptions($timeField['id']), - 'value'=>$timeCustomFields[$timeField['id']]['value'], - 'empty'=>array(''=>$i18n->get('dropdown.select')))); - } - } -} - -// If we show project dropdown, add controls for project and client. -if ($showProject) { - // Dropdown for projects assigned to user. - $project_list = $user->getAssignedProjects(); - $form->addInput(array('type'=>'combobox', - 'onchange'=>'fillTaskDropdown(this.value);', - 'name'=>'project', - 'style'=>'width: 250px;', - 'value'=>$cl_project, - 'data'=>$project_list, - 'datakeys'=>array('id','name'), - 'empty'=>array(''=>$i18n->get('dropdown.select')))); - - // Dropdown for clients if the clients plugin is enabled. - if ($showClient) { - $active_clients = ttGroupHelper::getActiveClients(true); - // We need an array of assigned project ids to do some trimming. - foreach($project_list as $project) - $projects_assigned_to_user[] = $project['id']; - - // Build a client list out of active clients. Use only clients that are relevant to user. - // Also trim their associated project list to only assigned projects (to user). - foreach($active_clients as $client) { - $projects_assigned_to_client = explode(',', $client['projects']); - if (is_array($projects_assigned_to_client) && is_array($projects_assigned_to_user)) - $intersection = array_intersect($projects_assigned_to_client, $projects_assigned_to_user); - if ($intersection) { - $client['projects'] = implode(',', $intersection); - $client_list[] = $client; - } - } - $form->addInput(array('type'=>'combobox', - 'onchange'=>'fillProjectDropdown(this.value);', - 'name'=>'client', - 'style'=>'width: 250px;', - 'value'=>$cl_client, - 'data'=>$client_list, - 'datakeys'=>array('id', 'name'), - 'empty'=>array(''=>$i18n->get('dropdown.select')))); - } -} - -// Task dropdown. -if ($showTask) { - $task_list = ttGroupHelper::getActiveTasks(); - $form->addInput(array('type'=>'combobox', - 'name'=>'task', - 'style'=>'width: 250px;', - 'value'=>$cl_task, - 'data'=>$task_list, - 'datakeys'=>array('id','name'), - 'empty'=>array(''=>$i18n->get('dropdown.select')))); -} - -// Week note control. -if ($showWeekNote) { - if (!defined('NOTE_INPUT_HEIGHT')) - define('NOTE_INPUT_HEIGHT', 40); - $form->addInput(array('type'=>'textarea','name'=>'note','style'=>'width: 250px; height:'.NOTE_INPUT_HEIGHT.'px;','value'=>$cl_note)); -} - -// Calendar. -$form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); - -// A hidden control for today's date from user's browser. -$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'get_date()')); // User current date, which gets filled in on btn_submit click. - -// Submit button. -$form->addInput(array('type'=>'submit','name'=>'btn_submit','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.submit'))); - -// Submit. -if ($request->isPost()) { - if ($request->getParameter('btn_submit')) { - // Validate user input for row 0. - // Determine if a new entry was posted. - $newEntryPosted = false; - foreach($dayHeaders as $dayHeader) { - $control_id = '0_'.$dayHeader; - if ($request->getParameter($control_id)) { - $newEntryPosted = true; - break; - } - } - if ($newEntryPosted) { - if ($showClient && $user->isOptionEnabled('client_required') && !$cl_client) - $err->add($i18n->get('error.client')); - // Validate input in time custom fields. - if ($custom_fields && $custom_fields->timeFields) { - foreach ($timeCustomFields as $timeField) { - // Validation is the same for text and dropdown fields. - if (!ttValidString($timeField['value'], !$timeField['required'])) $err->add($i18n->get('error.field'), htmlspecialchars($timeField['label'])); - } - } - if ($showProject) { - if (!$cl_project) $err->add($i18n->get('error.project')); - } - if ($showTask && $taskRequired) { - if (!$cl_task) $err->add($i18n->get('error.task')); - } - } - // Finished validating user input for row 0. - - // Process the table of values. - if ($err->no()) { - - // Obtain values. Iterate through posted parameters one by one, - // see if value changed, apply one change at a time until we see an error. - $result = true; - $rowNumber = 0; - // Iterate through existing rows. - foreach ($dataArray as $row) { - // Iterate through days. - foreach ($dayHeaders as $key => $dayHeader) { - // Do not process locked days. - if ($lockedDays[$key]) continue; - // Make control id for the cell. - $control_id = $rowNumber.'_'.$dayHeader; - - // Handle durations and comments in separate blocks of code. - if (!$showWeekNotes || (0 == $rowNumber % 2)) { - // Handle durations row here. - - // Obtain existing and posted durations. - $postedDuration = $request->getParameter($control_id); - $existingDuration = $dataArray[$rowNumber][$dayHeader]['duration']; - // If posted value is not null, check and normalize it. - if ($postedDuration) { - if (false === ttTimeHelper::postedDurationToMinutes($postedDuration)) { - $err->add($i18n->get('error.field'), $i18n->get('label.duration')); - $result = false; break; // Break out. Stop any further processing. - } else { - $minutes = ttTimeHelper::postedDurationToMinutes($postedDuration); - $postedDuration = ttTimeHelper::minutesToDuration($minutes); - } - } - // Do not process if value has not changed. - if ($postedDuration == $existingDuration) - continue; - // Posted value is different. - if ($existingDuration == null) { - // Skip inserting 0 duration values. - if (0 == ttTimeHelper::toMinutes($postedDuration)) - continue; - // Insert a new record. - $fields = array(); - $fields['row_id'] = $dataArray[$rowNumber]['row_id']; - if (!$fields['row_id']) { - // Special handling for row 0, a new entry. Need to construct new row_id. - $record = array(); - $record['client_id'] = $cl_client; - $record['billable'] = $cl_billable ? '1' : '0'; - $record['project_id'] = $cl_project; - $record['task_id'] = $cl_task; - if ($custom_fields && $custom_fields->timeFields) { - foreach ($custom_fields->timeFields as $timeField) { - $field_name = 'time_field_'.$timeField['id']; - if ($timeField['type'] == CustomFields::TYPE_TEXT) - $record[$field_name] = $timeCustomFields[$timeField['id']]['value']; - else if ($timeField['type'] == CustomFields::TYPE_DROPDOWN) - $record[$field_name.'_option_id'] = $timeCustomFields[$timeField['id']]['value']; - } - } - $fields['row_id'] = ttWeekViewHelper::makeRowIdentifier($record).'_0'; - // Note: no need to check for a possible conflict with an already existing row - // because we are doing an insert that does not affect already existing data. - - if ($showWeekNote) { - $fields['note'] = $request->getParameter('note'); - } - } - $fields['day_header'] = $dayHeader; - $fields['start_date'] = $startDate->toString(DB_DATEFORMAT); // To be able to determine date for the entry using $dayHeader. - $fields['duration'] = $postedDuration; - $fields['browser_today'] = $request->getParameter('browser_today', null); - if ($showWeekNotes) { - // Take note value from the control below duration. - $noteRowNumber = $rowNumber + 1; - $note_control_id = $noteRowNumber.'_'.$dayHeader; - $fields['note'] = $request->getParameter($note_control_id); - } - $result = ttWeekViewHelper::insertDurationFromWeekView($fields, $custom_fields, $err); - } elseif ($postedDuration == null || 0 == ttTimeHelper::toMinutes($postedDuration)) { - // Delete an already existing record here. - $result = ttTimeHelper::delete($dataArray[$rowNumber][$dayHeader]['tt_log_id']); - } else { - $fields = array(); - $fields['tt_log_id'] = $dataArray[$rowNumber][$dayHeader]['tt_log_id']; - $fields['duration'] = $postedDuration; - $result = ttWeekViewHelper::modifyDurationFromWeekView($fields, $err); - } - if (!$result) break; // Break out of the loop in case of first error. - - } else if ($showWeekNotes) { - // Handle commments row here. - - // Obtain existing and posted comments. - $postedComment = $request->getParameter($control_id); - $existingComment = $dataArray[$rowNumber][$dayHeader]['note']; - // If posted value is not null, check it. - if ($postedComment && !ttValidString($postedComment, true)) { - $err->add($i18n->get('error.field'), $i18n->get('label.note')); - $result = false; break; // Break out. Stop any further processing. - } - // Do not process if value has not changed. - if ($postedComment == $existingComment) - continue; - - // Posted value is different. - // TODO: handle new entries separately in the durations block above. - - // Here, only update the comment on an already existing record. - $fields = array(); - $fields['tt_log_id'] = $dataArray[$rowNumber][$dayHeader]['tt_log_id']; - if ($fields['tt_log_id']) { - $fields['comment'] = $postedComment; - $result = ttWeekViewHelper::modifyCommentFromWeekView($fields); - } - if (!$result) break; // Break out of the loop on first error. - } - } - if (!$result) break; // Break out of the loop on first error. - $rowNumber++; - } - if ($result) { - header('Location: week.php'); // Normal exit. - exit(); - } - } - } -} // isPost - -$week_total = ttTimeHelper::getTimeForWeek($selected_date); - -$smarty->assign('selected_date', $selected_date); -$smarty->assign('week_total', $week_total); -$smarty->assign('client_list', $client_list); -$smarty->assign('project_list', $project_list); -$smarty->assign('task_list', $task_list); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="fillDropdowns()"'); -$smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format)); -$smarty->assign('time_records', $records); -$smarty->assign('show_navigation', !$user->isOptionEnabled('week_menu')); -$smarty->assign('show_client', $showClient); -$smarty->assign('show_billable', $showBillable); -$smarty->assign('show_project', $showProject); -$smarty->assign('show_task', $showTask); -$smarty->assign('task_required', $taskRequired); -$smarty->assign('show_week_note', $showWeekNote); -$smarty->assign('show_week_list', $user->isOptionEnabled('week_list')); -$smarty->assign('show_start', $showStart); -$smarty->assign('show_files', $showFiles); -$smarty->assign('title', $i18n->get('menu.week')); -$smarty->assign('content_page_name', 'week.tpl'); -$smarty->display('index.tpl'); From 89db773dd2810bd5a52049e4c2908a6db4dd7636 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 19:50:23 +0000 Subject: [PATCH 005/304] Addressed issue #110 for php8. --- WEB-INF/lib/form/DateField.class.php | 4 +++- initialize.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index 01c14f2e..f5d6f8f7 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -406,7 +406,9 @@ function adjustiFrame(pickerDiv, iFrameDiv) { $html .= " value=\"".htmlspecialchars($this->getValue())."\""; $html .= ">"; - $dir_name = trim(@constant('DIR_NAME'), '/'); + $dir_name = $app_root = ''; + if (defined('DIR_NAME')) + $dir_name = trim(constant('DIR_NAME'), '/'); if (!empty($dir_name)) $app_root = '/'.$dir_name; diff --git a/initialize.php b/initialize.php index 469d92a7..7d469b37 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5534"); +define("APP_VERSION", "1.19.28.5535"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6b8482702e23b70f3c54f476888b7efbc7bfee1e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 8 May 2021 20:21:07 +0000 Subject: [PATCH 006/304] Addressed a few more php8 warnings. --- WEB-INF/lib/ttTimeHelper.class.php | 4 +-- WEB-INF/lib/ttWeekViewHelper.class.php | 34 +++++--------------------- WEB-INF/templates/week2.tpl | 4 +-- initialize.php | 2 +- week.php | 11 ++++++--- 5 files changed, 18 insertions(+), 37 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 58f2f422..031ccfb6 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -414,8 +414,8 @@ static function insert($fields) $org_id = $user->org_id; $date = $fields['date']; - $start = $fields['start']; - $finish = $fields['finish']; + $start = isset($fields['start']) ? $fields['start'] : null; + $finish = isset($fields['finish']) ? $fields['finish'] : null ; $duration = isset($fields['duration']) ? $fields['duration'] : null; if ($duration) { $minutes = ttTimeHelper::postedDurationToMinutes($duration); diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index aee8c8d6..55e40dc1 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -1,30 +1,6 @@ get('label.day_total').':'; - + foreach($dayHeaders as $dayHeader) { + $dayTotals[$dayHeader] = 0; + } foreach ($dataArray as $row) { foreach($dayHeaders as $dayHeader) { if (array_key_exists($dayHeader, $row)) { - $minutes = ttTimeHelper::toMinutes($row[$dayHeader]['duration']); + $minutes = ttTimeHelper::toMinutes(@$row[$dayHeader]['duration']); $dayTotals[$dayHeader] += $minutes; } } diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week2.tpl index 7dbf5d1f..99da5ef4 100644 --- a/WEB-INF/templates/week2.tpl +++ b/WEB-INF/templates/week2.tpl @@ -148,14 +148,14 @@ function fillDropdowns() { {/if} {/if} - {if $record.approved || $record.timesheet_id || $record.invoice_id} + {if (isset($record.approved) && $record.approved) || (isset($record.timesheet_id) && $record.timesheet_id) || (isset($record.invoice_id) && $record.invoice_id)}   {else} {$i18n.label.edit} {/if} - {if $record.approved || $record.timesheet_id || $record.invoice_id} + {if (isset($record.approved) && $record.approved) || (isset($record.timesheet_id) && $record.timesheet_id) || (isset($record.invoice_id) && $record.invoice_id)}   {else} {$i18n.label.delete} diff --git a/initialize.php b/initialize.php index 7d469b37..69580f62 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5535"); +define("APP_VERSION", "1.19.28.5536"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index dbb61529..63bd3823 100644 --- a/week.php +++ b/week.php @@ -55,6 +55,7 @@ $trackingMode = $user->getTrackingMode(); $showProject = MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode; $showTask = MODE_PROJECTS_AND_TASKS == $trackingMode; +$taskRequired = false; if ($showTask) $taskRequired = $user->getConfigOption('task_required'); $showWeekNote = $user->isOptionEnabled('week_note'); $showWeekNotes = $user->isOptionEnabled('week_notes'); @@ -127,7 +128,7 @@ $timeCustomFields = array(); // If we have time custom fields - collect input. if ($request->isPost()) { - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $control_name = 'time_field_'.$timeField['id']; $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], @@ -286,7 +287,7 @@ function render(&$table, $value, $row, $column, $selected = false) { } // If we have time custom fields - add controls for them. -if ($custom_fields && $custom_fields->timeFields) { +if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) { @@ -302,6 +303,7 @@ function render(&$table, $value, $row, $column, $selected = false) { } // If we show project dropdown, add controls for project and client. +$project_list = $client_list = array(); if ($showProject) { // Dropdown for projects assigned to user. $project_list = $user->getAssignedProjects(); @@ -344,6 +346,7 @@ function render(&$table, $value, $row, $column, $selected = false) { } // Task dropdown. +$task_list = array(); if ($showTask) { $task_list = ttGroupHelper::getActiveTasks(); $form->addInput(array('type'=>'combobox', @@ -387,7 +390,7 @@ function render(&$table, $value, $row, $column, $selected = false) { if ($showClient && $user->isOptionEnabled('client_required') && !$cl_client) $err->add($i18n->get('error.client')); // Validate input in time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($timeCustomFields as $timeField) { // Validation is the same for text and dropdown fields. if (!ttValidString($timeField['value'], !$timeField['required'])) $err->add($i18n->get('error.field'), htmlspecialchars($timeField['label'])); @@ -453,7 +456,7 @@ function render(&$table, $value, $row, $column, $selected = false) { $record['billable'] = $cl_billable ? '1' : '0'; $record['project_id'] = $cl_project; $record['task_id'] = $cl_task; - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) From c7d7520f3e7ac8de81432256d8ed1c77b776d448 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 9 May 2021 17:19:06 +0000 Subject: [PATCH 007/304] Addressed a couple more of php8 issues. --- WEB-INF/lib/form/Table.class.php | 38 +++++++++++++++++--------------- initialize.php | 2 +- user_edit.php | 1 + 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/WEB-INF/lib/form/Table.class.php b/WEB-INF/lib/form/Table.class.php index c83d90bd..d617f8b3 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -36,7 +36,7 @@ class Table extends FormElement { var $mHeaders = array(); // column headers var $mFooters = array(); // column footers var $mInteractive = true; // adds a clickable checkbox column to table - var $mIAScript = null; // sctipt to execute when a checkbox is clicked + var $mIAScript = null; // script to execute when a checkbox is clicked var $mKeyField = ''; // identifies a column used as key to access row data var $mColumnFields = array(); // field names (from mData) for data in each column var $mBgColor = '#ffffff'; @@ -156,28 +156,30 @@ function getHtml() { } // Print rows. - for ($row = 0; $row < count($this->mData); $row++) { - $html .= "\nmBgColor."\" onmouseover=\"setRowBackground(this, '".$this->mBgColorOver."')\" onmouseout=\"setRowBackground(this, null)\">\n"; - for ($col = 0; $col < $this->getColumnCount(); $col++) { - if (0 == $col && strtolower(get_class($this->mColumns[$col]->getRenderer())) == 'checkboxcellrenderer') { - // Checkbox for the row. Determine if selected. - $selected = false; - if (is_array($this->value)) { - foreach ($this->value as $p) { - if ($p == $this->mData[$row][$this->mKeyField]) { - $selected = true; - break; + if (is_array($this->mData)) { + for ($row = 0; $row < count($this->mData); $row++) { + $html .= "\nmBgColor."\" onmouseover=\"setRowBackground(this, '".$this->mBgColorOver."')\" onmouseout=\"setRowBackground(this, null)\">\n"; + for ($col = 0; $col < $this->getColumnCount(); $col++) { + if (0 == $col && strtolower(get_class($this->mColumns[$col]->getRenderer())) == 'checkboxcellrenderer') { + // Checkbox for the row. Determine if selected. + $selected = false; + if (is_array($this->value)) { + foreach ($this->value as $p) { + if ($p == $this->mData[$row][$this->mKeyField]) { + $selected = true; + break; + } } } + // Render control checkbox. + $html .= $this->mColumns[$col]->renderCell($this->mData[$row][$this->mKeyField], $row, $col, $selected); + } else { + // Render regular cell. + $html .= $this->mColumns[$col]->renderCell($this->getValueAt($row, $col), $row, $col); } - // Render control checkbox. - $html .= $this->mColumns[$col]->renderCell($this->mData[$row][$this->mKeyField], $row, $col, $selected); - } else { - // Render regular cell. - $html .= $this->mColumns[$col]->renderCell($this->getValueAt($row, $col), $row, $col); } + $html .= "\n"; } - $html .= "\n"; } // Print footers. diff --git a/initialize.php b/initialize.php index 69580f62..e219033d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5536"); +define("APP_VERSION", "1.19.28.5537"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/user_edit.php b/user_edit.php index dc19ad6a..bae837c4 100644 --- a/user_edit.php +++ b/user_edit.php @@ -37,6 +37,7 @@ } $show_projects = MODE_PROJECTS == $user->getTrackingMode() || MODE_PROJECTS_AND_TASKS == $user->getTrackingMode(); +$projects = array(); if ($show_projects) { $projects = ttGroupHelper::getActiveProjects(); if (count($projects) == 0) $show_projects = false; From cc0928bf1d0b319a42359b44743d04eaaa0fdd05 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 13:20:39 +0000 Subject: [PATCH 008/304] Addressed a couple more of php8 issues. --- WEB-INF/lib/form/DateField.class.php | 28 ++-------------------------- initialize.php | 2 +- password_reset.php | 5 ++++- 3 files changed, 7 insertions(+), 28 deletions(-) diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index f5d6f8f7..922e8bf5 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -1,30 +1,6 @@ setCharSet(CHARSET); $mailer->setSender(SENDER); $mailer->setReceiver("$receiver"); + $secure_connection = false; if ((!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] !== 'off')) || ($_SERVER['SERVER_PORT'] == 443)) $secure_connection = true; if($secure_connection) @@ -85,7 +86,9 @@ $cl_subject = $user_i18n->get('form.reset_password.email_subject'); - $dir_name = trim(@constant('DIR_NAME'), '/'); + $dir_name = $app_root = ''; + if (defined('DIR_NAME')) + $dir_name = trim(constant('DIR_NAME'), '/'); if (!empty($dir_name)) $app_root = '/'.$dir_name; From 8e469a82a605b16607d1deca358ba698db4bc165 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 13:46:44 +0000 Subject: [PATCH 009/304] Removed no longer used template files. --- WEB-INF/templates/header.tpl | 211 ------------------------ WEB-INF/templates/index.tpl | 5 - WEB-INF/templates/{ => work}/footer.tpl | 1 + WEB-INF/templates/work/index.tpl | 2 +- initialize.php | 2 +- 5 files changed, 3 insertions(+), 218 deletions(-) delete mode 100644 WEB-INF/templates/header.tpl delete mode 100644 WEB-INF/templates/index.tpl rename WEB-INF/templates/{ => work}/footer.tpl (99%) diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl deleted file mode 100644 index 29ec892d..00000000 --- a/WEB-INF/templates/header.tpl +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - -{if (isset($i18n.language.rtl) && $i18n.language.rtl)} - -{/if} -{if $user->getCustomCss()} - -{/if} - Time Tracker{if $title} - {$title}{/if} - - - - - - - -{assign var="tab_width" value="700"} - - - -
- - - - -{if $user->custom_logo} - - -
-{else} - -{/if} - - - - -
- - - -{if $user->custom_logo} - -{else} - -{/if} - - -
-
- - -{if $authenticated} - {if $user->can('administer_site')} - - - - - -
  - {$i18n.menu.logout} - {$i18n.menu.forum} - {$i18n.menu.help} -
- - - - - - - - - - {else} - - - - - -
  - {$i18n.menu.logout} - {if $user->exists() && $user->can('manage_own_settings')} - {$i18n.menu.profile} - {/if} - {if $user->can('manage_basic_settings')} - {$i18n.menu.group} - {/if} - {if $user->can('manage_features')} - {$i18n.menu.plugins} - {/if} - {$i18n.menu.forum} - {$i18n.menu.help} -
- - - - - - - - - - {/if} -{else} - - - - - -
  - {$i18n.menu.login} - {if isTrue('MULTIORG_MODE') && constant('AUTH_MODULE') == 'db'} - {$i18n.menu.register} - {/if} - {$i18n.menu.forum} - {$i18n.menu.help} -
-{/if} -
- - -{if $title} - - - {* No need to escape as it is done in the class. *} -
{$title}{if (isset($timestring) && $timestring)}: {$timestring}{/if}
{$user->getUserPartForHeader()}
-{/if} - - - -{if $err->yes()} - - - - -
- {foreach $err->getErrors() as $error} - {$error.message}
{* No need to escape as they are not coming from user and may contain a link. *} - {/foreach} -
-{/if} - - - -{if $msg->yes()} - - - - -
- {foreach $msg->getErrors() as $message} - {$message.message}
{* No need to escape. *} - {/foreach} -
-{/if} - diff --git a/WEB-INF/templates/index.tpl b/WEB-INF/templates/index.tpl deleted file mode 100644 index 75a751e0..00000000 --- a/WEB-INF/templates/index.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{include file="header.tpl"} - -{if $content_page_name}{include file="$content_page_name"}{/if} - -{include file="footer.tpl"} diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/work/footer.tpl similarity index 99% rename from WEB-INF/templates/footer.tpl rename to WEB-INF/templates/work/footer.tpl index a5ae56f9..61106755 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/work/footer.tpl @@ -26,3 +26,4 @@
+ diff --git a/WEB-INF/templates/work/index.tpl b/WEB-INF/templates/work/index.tpl index 6817f396..3c650082 100644 --- a/WEB-INF/templates/work/index.tpl +++ b/WEB-INF/templates/work/index.tpl @@ -2,4 +2,4 @@ {if $content_page_name}{include file="$content_page_name"}{/if} -{include file="footer.tpl"} +{include file="work/footer.tpl"} diff --git a/initialize.php b/initialize.php index 7f27932d..6260eb07 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5538"); +define("APP_VERSION", "1.19.28.5539"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ee3dae2396dc3051e9f79825759e57d51beb7985 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 14:00:32 +0000 Subject: [PATCH 010/304] Work in progress renaming template files. --- WEB-INF/templates/{access_denied2.tpl => access_denied.tpl} | 0 WEB-INF/templates/{admin_group_add2.tpl => admin_group_add.tpl} | 0 .../{admin_group_delete2.tpl => admin_group_delete.tpl} | 0 .../templates/{admin_group_edit2.tpl => admin_group_edit.tpl} | 0 WEB-INF/templates/{admin_groups2.tpl => admin_groups.tpl} | 0 WEB-INF/templates/{admin_options2.tpl => admin_options.tpl} | 0 access_denied.php | 2 +- admin_group_add.php | 2 +- admin_group_delete.php | 2 +- admin_group_edit.php | 2 +- admin_groups.php | 2 +- admin_options.php | 2 +- feature_disabled.php | 2 +- initialize.php | 2 +- 14 files changed, 8 insertions(+), 8 deletions(-) rename WEB-INF/templates/{access_denied2.tpl => access_denied.tpl} (100%) rename WEB-INF/templates/{admin_group_add2.tpl => admin_group_add.tpl} (100%) rename WEB-INF/templates/{admin_group_delete2.tpl => admin_group_delete.tpl} (100%) rename WEB-INF/templates/{admin_group_edit2.tpl => admin_group_edit.tpl} (100%) rename WEB-INF/templates/{admin_groups2.tpl => admin_groups.tpl} (100%) rename WEB-INF/templates/{admin_options2.tpl => admin_options.tpl} (100%) diff --git a/WEB-INF/templates/access_denied2.tpl b/WEB-INF/templates/access_denied.tpl similarity index 100% rename from WEB-INF/templates/access_denied2.tpl rename to WEB-INF/templates/access_denied.tpl diff --git a/WEB-INF/templates/admin_group_add2.tpl b/WEB-INF/templates/admin_group_add.tpl similarity index 100% rename from WEB-INF/templates/admin_group_add2.tpl rename to WEB-INF/templates/admin_group_add.tpl diff --git a/WEB-INF/templates/admin_group_delete2.tpl b/WEB-INF/templates/admin_group_delete.tpl similarity index 100% rename from WEB-INF/templates/admin_group_delete2.tpl rename to WEB-INF/templates/admin_group_delete.tpl diff --git a/WEB-INF/templates/admin_group_edit2.tpl b/WEB-INF/templates/admin_group_edit.tpl similarity index 100% rename from WEB-INF/templates/admin_group_edit2.tpl rename to WEB-INF/templates/admin_group_edit.tpl diff --git a/WEB-INF/templates/admin_groups2.tpl b/WEB-INF/templates/admin_groups.tpl similarity index 100% rename from WEB-INF/templates/admin_groups2.tpl rename to WEB-INF/templates/admin_groups.tpl diff --git a/WEB-INF/templates/admin_options2.tpl b/WEB-INF/templates/admin_options.tpl similarity index 100% rename from WEB-INF/templates/admin_options2.tpl rename to WEB-INF/templates/admin_options.tpl diff --git a/access_denied.php b/access_denied.php index 2aa3c5d7..7025d873 100644 --- a/access_denied.php +++ b/access_denied.php @@ -8,5 +8,5 @@ if ($auth->isAuthenticated()) $smarty->assign('authenticated', true); // Used in header.tpl for menu display. $smarty->assign('title', $i18n->get('label.error')); -$smarty->assign('content_page_name', 'access_denied2.tpl'); +$smarty->assign('content_page_name', 'access_denied.tpl'); $smarty->display('index2.tpl'); diff --git a/admin_group_add.php b/admin_group_add.php index 976b5c6d..178b2d1b 100644 --- a/admin_group_add.php +++ b/admin_group_add.php @@ -101,6 +101,6 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.groupForm.group_name.focus()"'); -$smarty->assign('content_page_name', 'admin_group_add2.tpl'); +$smarty->assign('content_page_name', 'admin_group_add.tpl'); $smarty->assign('title', $i18n->get('title.add_group')); $smarty->display('index2.tpl'); diff --git a/admin_group_delete.php b/admin_group_delete.php index 83999da5..1707d595 100644 --- a/admin_group_delete.php +++ b/admin_group_delete.php @@ -42,5 +42,5 @@ $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_delete2.tpl'); +$smarty->assign('content_page_name', 'admin_group_delete.tpl'); $smarty->display('index2.tpl'); diff --git a/admin_group_edit.php b/admin_group_edit.php index 5474ca2c..35b0a531 100644 --- a/admin_group_edit.php +++ b/admin_group_edit.php @@ -110,5 +110,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.groupForm.manager_name.focus()"'); $smarty->assign('title', $i18n->get('title.edit_group')); -$smarty->assign('content_page_name', 'admin_group_edit2.tpl'); +$smarty->assign('content_page_name', 'admin_group_edit.tpl'); $smarty->display('index2.tpl'); diff --git a/admin_groups.php b/admin_groups.php index 915f7d77..e3a5559c 100644 --- a/admin_groups.php +++ b/admin_groups.php @@ -14,5 +14,5 @@ $smarty->assign('groups', ttOrgHelper::getOrgs()); $smarty->assign('title', $i18n->get('title.groups')); -$smarty->assign('content_page_name', 'admin_groups2.tpl'); +$smarty->assign('content_page_name', 'admin_groups.tpl'); $smarty->display('index2.tpl'); diff --git a/admin_options.php b/admin_options.php index bc126933..00d292b9 100644 --- a/admin_options.php +++ b/admin_options.php @@ -72,5 +72,5 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.options')); -$smarty->assign('content_page_name', 'admin_options2.tpl'); +$smarty->assign('content_page_name', 'admin_options.tpl'); $smarty->display('index2.tpl'); diff --git a/feature_disabled.php b/feature_disabled.php index c04afe73..42f3e47a 100644 --- a/feature_disabled.php +++ b/feature_disabled.php @@ -8,5 +8,5 @@ if ($auth->isAuthenticated()) $smarty->assign('authenticated', true); // Used in header.tpl for menu display. $smarty->assign('title', $i18n->get('label.error')); -$smarty->assign('content_page_name', 'access_denied2.tpl'); +$smarty->assign('content_page_name', 'access_denied.tpl'); $smarty->display('index2.tpl'); diff --git a/initialize.php b/initialize.php index 6260eb07..87083f8e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5539"); +define("APP_VERSION", "1.19.28.5540"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 7e6f9a6e72593d24989acad71929f4187ce6c1e2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 14:48:36 +0000 Subject: [PATCH 011/304] A bit more of template file renaming. --- .../{cf_custom_field_add2.tpl => cf_custom_field_add.tpl} | 0 ...f_custom_field_delete2.tpl => cf_custom_field_delete.tpl} | 0 .../{cf_custom_field_edit2.tpl => cf_custom_field_edit.tpl} | 0 .../{cf_custom_fields2.tpl => cf_custom_fields.tpl} | 0 ...f_dropdown_option_add2.tpl => cf_dropdown_option_add.tpl} | 0 ...down_option_delete2.tpl => cf_dropdown_option_delete.tpl} | 0 ...dropdown_option_edit2.tpl => cf_dropdown_option_edit.tpl} | 0 .../{cf_dropdown_options2.tpl => cf_dropdown_options.tpl} | 0 WEB-INF/templates/{charts2.tpl => charts.tpl} | 0 WEB-INF/templates/index.tpl | 5 +++++ access_denied.php | 2 +- admin_group_add.php | 2 +- admin_group_delete.php | 2 +- admin_group_edit.php | 2 +- admin_groups.php | 2 +- admin_options.php | 2 +- cf_custom_field_add.php | 4 ++-- cf_custom_field_delete.php | 4 ++-- cf_custom_field_edit.php | 4 ++-- cf_custom_fields.php | 4 ++-- cf_dropdown_option_add.php | 4 ++-- cf_dropdown_option_delete.php | 4 ++-- cf_dropdown_option_edit.php | 4 ++-- cf_dropdown_options.php | 4 ++-- charts.php | 4 ++-- feature_disabled.php | 2 +- initialize.php | 2 +- 27 files changed, 31 insertions(+), 26 deletions(-) rename WEB-INF/templates/{cf_custom_field_add2.tpl => cf_custom_field_add.tpl} (100%) rename WEB-INF/templates/{cf_custom_field_delete2.tpl => cf_custom_field_delete.tpl} (100%) rename WEB-INF/templates/{cf_custom_field_edit2.tpl => cf_custom_field_edit.tpl} (100%) rename WEB-INF/templates/{cf_custom_fields2.tpl => cf_custom_fields.tpl} (100%) rename WEB-INF/templates/{cf_dropdown_option_add2.tpl => cf_dropdown_option_add.tpl} (100%) rename WEB-INF/templates/{cf_dropdown_option_delete2.tpl => cf_dropdown_option_delete.tpl} (100%) rename WEB-INF/templates/{cf_dropdown_option_edit2.tpl => cf_dropdown_option_edit.tpl} (100%) rename WEB-INF/templates/{cf_dropdown_options2.tpl => cf_dropdown_options.tpl} (100%) rename WEB-INF/templates/{charts2.tpl => charts.tpl} (100%) create mode 100644 WEB-INF/templates/index.tpl diff --git a/WEB-INF/templates/cf_custom_field_add2.tpl b/WEB-INF/templates/cf_custom_field_add.tpl similarity index 100% rename from WEB-INF/templates/cf_custom_field_add2.tpl rename to WEB-INF/templates/cf_custom_field_add.tpl diff --git a/WEB-INF/templates/cf_custom_field_delete2.tpl b/WEB-INF/templates/cf_custom_field_delete.tpl similarity index 100% rename from WEB-INF/templates/cf_custom_field_delete2.tpl rename to WEB-INF/templates/cf_custom_field_delete.tpl diff --git a/WEB-INF/templates/cf_custom_field_edit2.tpl b/WEB-INF/templates/cf_custom_field_edit.tpl similarity index 100% rename from WEB-INF/templates/cf_custom_field_edit2.tpl rename to WEB-INF/templates/cf_custom_field_edit.tpl diff --git a/WEB-INF/templates/cf_custom_fields2.tpl b/WEB-INF/templates/cf_custom_fields.tpl similarity index 100% rename from WEB-INF/templates/cf_custom_fields2.tpl rename to WEB-INF/templates/cf_custom_fields.tpl diff --git a/WEB-INF/templates/cf_dropdown_option_add2.tpl b/WEB-INF/templates/cf_dropdown_option_add.tpl similarity index 100% rename from WEB-INF/templates/cf_dropdown_option_add2.tpl rename to WEB-INF/templates/cf_dropdown_option_add.tpl diff --git a/WEB-INF/templates/cf_dropdown_option_delete2.tpl b/WEB-INF/templates/cf_dropdown_option_delete.tpl similarity index 100% rename from WEB-INF/templates/cf_dropdown_option_delete2.tpl rename to WEB-INF/templates/cf_dropdown_option_delete.tpl diff --git a/WEB-INF/templates/cf_dropdown_option_edit2.tpl b/WEB-INF/templates/cf_dropdown_option_edit.tpl similarity index 100% rename from WEB-INF/templates/cf_dropdown_option_edit2.tpl rename to WEB-INF/templates/cf_dropdown_option_edit.tpl diff --git a/WEB-INF/templates/cf_dropdown_options2.tpl b/WEB-INF/templates/cf_dropdown_options.tpl similarity index 100% rename from WEB-INF/templates/cf_dropdown_options2.tpl rename to WEB-INF/templates/cf_dropdown_options.tpl diff --git a/WEB-INF/templates/charts2.tpl b/WEB-INF/templates/charts.tpl similarity index 100% rename from WEB-INF/templates/charts2.tpl rename to WEB-INF/templates/charts.tpl diff --git a/WEB-INF/templates/index.tpl b/WEB-INF/templates/index.tpl new file mode 100644 index 00000000..410a7616 --- /dev/null +++ b/WEB-INF/templates/index.tpl @@ -0,0 +1,5 @@ +{include file="header2.tpl"} + +{if $content_page_name}{include file="$content_page_name"}{/if} + +{include file="footer2.tpl"} diff --git a/access_denied.php b/access_denied.php index 7025d873..80900d57 100644 --- a/access_denied.php +++ b/access_denied.php @@ -9,4 +9,4 @@ $smarty->assign('title', $i18n->get('label.error')); $smarty->assign('content_page_name', 'access_denied.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_group_add.php b/admin_group_add.php index 178b2d1b..52850b60 100644 --- a/admin_group_add.php +++ b/admin_group_add.php @@ -103,4 +103,4 @@ $smarty->assign('onload', 'onLoad="document.groupForm.group_name.focus()"'); $smarty->assign('content_page_name', 'admin_group_add.tpl'); $smarty->assign('title', $i18n->get('title.add_group')); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_group_delete.php b/admin_group_delete.php index 1707d595..0cea02b3 100644 --- a/admin_group_delete.php +++ b/admin_group_delete.php @@ -43,4 +43,4 @@ $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->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_group_edit.php b/admin_group_edit.php index 35b0a531..81588ebe 100644 --- a/admin_group_edit.php +++ b/admin_group_edit.php @@ -111,4 +111,4 @@ $smarty->assign('onload', 'onLoad="document.groupForm.manager_name.focus()"'); $smarty->assign('title', $i18n->get('title.edit_group')); $smarty->assign('content_page_name', 'admin_group_edit.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_groups.php b/admin_groups.php index e3a5559c..8dffd393 100644 --- a/admin_groups.php +++ b/admin_groups.php @@ -15,4 +15,4 @@ $smarty->assign('groups', ttOrgHelper::getOrgs()); $smarty->assign('title', $i18n->get('title.groups')); $smarty->assign('content_page_name', 'admin_groups.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/admin_options.php b/admin_options.php index 00d292b9..84a0ed3a 100644 --- a/admin_options.php +++ b/admin_options.php @@ -73,4 +73,4 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.options')); $smarty->assign('content_page_name', 'admin_options.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index 14b233a5..6cfd8725 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -55,5 +55,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fieldForm.name.focus()"'); $smarty->assign('title', $i18n->get('title.cf_add_custom_field')); -$smarty->assign('content_page_name', 'cf_custom_field_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_custom_field_add.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 7cfd7203..ba222c65 100644 --- a/cf_custom_field_delete.php +++ b/cf_custom_field_delete.php @@ -50,5 +50,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fieldDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.cf_delete_custom_field')); -$smarty->assign('content_page_name', 'cf_custom_field_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_custom_field_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_custom_field_edit.php b/cf_custom_field_edit.php index 36e76d4b..3f959ee2 100644 --- a/cf_custom_field_edit.php +++ b/cf_custom_field_edit.php @@ -68,5 +68,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fieldForm.name.focus()"'); $smarty->assign('title', $i18n->get('title.cf_edit_custom_field')); -$smarty->assign('content_page_name', 'cf_custom_field_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_custom_field_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_custom_fields.php b/cf_custom_fields.php index 7d670636..6552bb7f 100644 --- a/cf_custom_fields.php +++ b/cf_custom_fields.php @@ -34,5 +34,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('custom_fields', $fields); $smarty->assign('title', $i18n->get('title.cf_custom_fields')); -$smarty->assign('content_page_name', 'cf_custom_fields2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_custom_fields.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_dropdown_option_add.php b/cf_dropdown_option_add.php index f1bf0090..582794ae 100644 --- a/cf_dropdown_option_add.php +++ b/cf_dropdown_option_add.php @@ -49,5 +49,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.optionAddForm.name.focus()"'); $smarty->assign('title', $i18n->get('title.cf_add_dropdown_option')); -$smarty->assign('content_page_name', 'cf_dropdown_option_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_dropdown_option_add.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_dropdown_option_delete.php b/cf_dropdown_option_delete.php index e23288bd..e6eeeeb7 100644 --- a/cf_dropdown_option_delete.php +++ b/cf_dropdown_option_delete.php @@ -53,5 +53,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.optionDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.cf_delete_dropdown_option')); -$smarty->assign('content_page_name', 'cf_dropdown_option_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_dropdown_option_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_dropdown_option_edit.php b/cf_dropdown_option_edit.php index c73200ff..eee02f63 100644 --- a/cf_dropdown_option_edit.php +++ b/cf_dropdown_option_edit.php @@ -51,5 +51,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.optionEditForm.name.focus()"'); $smarty->assign('title', $i18n->get('title.cf_edit_dropdown_option')); -$smarty->assign('content_page_name', 'cf_dropdown_option_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_dropdown_option_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/cf_dropdown_options.php b/cf_dropdown_options.php index 2570f0ee..06f53a7d 100644 --- a/cf_dropdown_options.php +++ b/cf_dropdown_options.php @@ -28,5 +28,5 @@ $smarty->assign('field_id', $field_id); $smarty->assign('options', $options); $smarty->assign('title', $i18n->get('title.cf_dropdown_options')); -$smarty->assign('content_page_name', 'cf_dropdown_options2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'cf_dropdown_options.tpl'); +$smarty->display('index.tpl'); diff --git a/charts.php b/charts.php index 25e6695d..1bf6d34f 100644 --- a/charts.php +++ b/charts.php @@ -205,5 +205,5 @@ $smarty->assign('onload', 'onLoad="adjustTodayLinks()"'); $smarty->assign('forms', array($chart_form->getName() => $chart_form->toArray())); $smarty->assign('title', $i18n->get('title.charts')); -$smarty->assign('content_page_name', 'charts2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'charts.tpl'); +$smarty->display('index.tpl'); diff --git a/feature_disabled.php b/feature_disabled.php index 42f3e47a..d1541354 100644 --- a/feature_disabled.php +++ b/feature_disabled.php @@ -9,4 +9,4 @@ $smarty->assign('title', $i18n->get('label.error')); $smarty->assign('content_page_name', 'access_denied.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); diff --git a/initialize.php b/initialize.php index 87083f8e..378edcba 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5540"); +define("APP_VERSION", "1.19.28.5541"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From edc7f366e8e45096e54bf15c46ea205fbf2867c3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 16:05:40 +0000 Subject: [PATCH 012/304] More template files renamed. --- WEB-INF/templates/{client_add2.tpl => client_add.tpl} | 0 WEB-INF/templates/{client_delete2.tpl => client_delete.tpl} | 0 WEB-INF/templates/{client_edit2.tpl => client_edit.tpl} | 0 WEB-INF/templates/{clients2.tpl => clients.tpl} | 0 .../templates/{display_options2.tpl => display_options.tpl} | 0 WEB-INF/templates/{entity_files2.tpl => entity_files.tpl} | 0 WEB-INF/templates/{expense_delete2.tpl => expense_delete.tpl} | 0 WEB-INF/templates/{expense_edit2.tpl => expense_edit.tpl} | 0 WEB-INF/templates/{expenses2.tpl => expenses.tpl} | 0 WEB-INF/templates/{export2.tpl => export.tpl} | 0 WEB-INF/templates/{file_delete2.tpl => file_delete.tpl} | 0 WEB-INF/templates/{file_download2.tpl => file_download.tpl} | 0 WEB-INF/templates/{file_edit2.tpl => file_edit.tpl} | 0 client_add.php | 4 ++-- client_delete.php | 4 ++-- client_edit.php | 4 ++-- clients.php | 4 ++-- display_options.php | 4 ++-- expense_delete.php | 4 ++-- expense_edit.php | 4 ++-- expense_files.php | 4 ++-- expenses.php | 4 ++-- export.php | 4 ++-- file_delete.php | 4 ++-- file_download.php | 4 ++-- file_edit.php | 4 ++-- initialize.php | 2 +- project_files.php | 4 ++-- time_files.php | 4 ++-- timesheet_files.php | 4 ++-- 30 files changed, 33 insertions(+), 33 deletions(-) rename WEB-INF/templates/{client_add2.tpl => client_add.tpl} (100%) rename WEB-INF/templates/{client_delete2.tpl => client_delete.tpl} (100%) rename WEB-INF/templates/{client_edit2.tpl => client_edit.tpl} (100%) rename WEB-INF/templates/{clients2.tpl => clients.tpl} (100%) rename WEB-INF/templates/{display_options2.tpl => display_options.tpl} (100%) rename WEB-INF/templates/{entity_files2.tpl => entity_files.tpl} (100%) rename WEB-INF/templates/{expense_delete2.tpl => expense_delete.tpl} (100%) rename WEB-INF/templates/{expense_edit2.tpl => expense_edit.tpl} (100%) rename WEB-INF/templates/{expenses2.tpl => expenses.tpl} (100%) rename WEB-INF/templates/{export2.tpl => export.tpl} (100%) rename WEB-INF/templates/{file_delete2.tpl => file_delete.tpl} (100%) rename WEB-INF/templates/{file_download2.tpl => file_download.tpl} (100%) rename WEB-INF/templates/{file_edit2.tpl => file_edit.tpl} (100%) diff --git a/WEB-INF/templates/client_add2.tpl b/WEB-INF/templates/client_add.tpl similarity index 100% rename from WEB-INF/templates/client_add2.tpl rename to WEB-INF/templates/client_add.tpl diff --git a/WEB-INF/templates/client_delete2.tpl b/WEB-INF/templates/client_delete.tpl similarity index 100% rename from WEB-INF/templates/client_delete2.tpl rename to WEB-INF/templates/client_delete.tpl diff --git a/WEB-INF/templates/client_edit2.tpl b/WEB-INF/templates/client_edit.tpl similarity index 100% rename from WEB-INF/templates/client_edit2.tpl rename to WEB-INF/templates/client_edit.tpl diff --git a/WEB-INF/templates/clients2.tpl b/WEB-INF/templates/clients.tpl similarity index 100% rename from WEB-INF/templates/clients2.tpl rename to WEB-INF/templates/clients.tpl diff --git a/WEB-INF/templates/display_options2.tpl b/WEB-INF/templates/display_options.tpl similarity index 100% rename from WEB-INF/templates/display_options2.tpl rename to WEB-INF/templates/display_options.tpl diff --git a/WEB-INF/templates/entity_files2.tpl b/WEB-INF/templates/entity_files.tpl similarity index 100% rename from WEB-INF/templates/entity_files2.tpl rename to WEB-INF/templates/entity_files.tpl diff --git a/WEB-INF/templates/expense_delete2.tpl b/WEB-INF/templates/expense_delete.tpl similarity index 100% rename from WEB-INF/templates/expense_delete2.tpl rename to WEB-INF/templates/expense_delete.tpl diff --git a/WEB-INF/templates/expense_edit2.tpl b/WEB-INF/templates/expense_edit.tpl similarity index 100% rename from WEB-INF/templates/expense_edit2.tpl rename to WEB-INF/templates/expense_edit.tpl diff --git a/WEB-INF/templates/expenses2.tpl b/WEB-INF/templates/expenses.tpl similarity index 100% rename from WEB-INF/templates/expenses2.tpl rename to WEB-INF/templates/expenses.tpl diff --git a/WEB-INF/templates/export2.tpl b/WEB-INF/templates/export.tpl similarity index 100% rename from WEB-INF/templates/export2.tpl rename to WEB-INF/templates/export.tpl diff --git a/WEB-INF/templates/file_delete2.tpl b/WEB-INF/templates/file_delete.tpl similarity index 100% rename from WEB-INF/templates/file_delete2.tpl rename to WEB-INF/templates/file_delete.tpl diff --git a/WEB-INF/templates/file_download2.tpl b/WEB-INF/templates/file_download.tpl similarity index 100% rename from WEB-INF/templates/file_download2.tpl rename to WEB-INF/templates/file_download.tpl diff --git a/WEB-INF/templates/file_edit2.tpl b/WEB-INF/templates/file_edit.tpl similarity index 100% rename from WEB-INF/templates/file_edit2.tpl rename to WEB-INF/templates/file_edit.tpl diff --git a/client_add.php b/client_add.php index 1b91a408..f1f45333 100644 --- a/client_add.php +++ b/client_add.php @@ -68,5 +68,5 @@ $smarty->assign('onload', 'onLoad="document.clientForm.name.focus()"'); $smarty->assign('show_projects', $show_projects); $smarty->assign('title', $i18n->get('title.add_client')); -$smarty->assign('content_page_name', 'client_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'client_add.tpl'); +$smarty->display('index.tpl'); diff --git a/client_delete.php b/client_delete.php index 147f2db5..e832c6bc 100644 --- a/client_delete.php +++ b/client_delete.php @@ -50,5 +50,5 @@ $smarty->assign('client_to_delete', $client_to_delete); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.delete_client')); -$smarty->assign('content_page_name', 'client_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'client_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/client_edit.php b/client_edit.php index c7e0a92e..34983418 100644 --- a/client_edit.php +++ b/client_edit.php @@ -104,5 +104,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_projects', $show_projects); $smarty->assign('title', $i18n->get('title.edit_client')); -$smarty->assign('content_page_name', 'client_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'client_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/clients.php b/clients.php index 77ade9c7..309eb155 100644 --- a/clients.php +++ b/clients.php @@ -27,5 +27,5 @@ $smarty->assign('active_clients', $active_clients); $smarty->assign('inactive_clients', $inactive_clients); $smarty->assign('title', $i18n->get('title.clients')); -$smarty->assign('content_page_name', 'clients2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'clients.tpl'); +$smarty->display('index.tpl'); diff --git a/display_options.php b/display_options.php index 53a86ca9..21b488c6 100644 --- a/display_options.php +++ b/display_options.php @@ -74,5 +74,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.display_options')); -$smarty->assign('content_page_name', 'display_options2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'display_options.tpl'); +$smarty->display('index.tpl'); diff --git a/expense_delete.php b/expense_delete.php index 7ecd2c6d..6c5cb791 100644 --- a/expense_delete.php +++ b/expense_delete.php @@ -60,5 +60,5 @@ $smarty->assign('expense_item', $expense_item); $smarty->assign('show_project', $show_project); $smarty->assign('title', $i18n->get('title.delete_expense')); -$smarty->assign('content_page_name', 'expense_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'expense_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/expense_edit.php b/expense_edit.php index f4d3c221..271a588a 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -211,5 +211,5 @@ $smarty->assign('client_list', $client_list); $smarty->assign('project_list', $project_list); $smarty->assign('title', $i18n->get('title.edit_expense')); -$smarty->assign('content_page_name', 'expense_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'expense_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/expense_files.php b/expense_files.php index 5642cb38..7fe2a5d1 100644 --- a/expense_files.php +++ b/expense_files.php @@ -61,5 +61,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('files', $files); $smarty->assign('title', $i18n->get('title.expense_files')); -$smarty->assign('content_page_name', 'entity_files2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'entity_files.tpl'); +$smarty->display('index.tpl'); diff --git a/expenses.php b/expenses.php index d5978228..1914a253 100644 --- a/expenses.php +++ b/expenses.php @@ -230,5 +230,5 @@ $smarty->assign('project_list', $project_list); $smarty->assign('timestring', $selected_date->toString($user->getDateFormat())); $smarty->assign('title', $i18n->get('title.expenses')); -$smarty->assign('content_page_name', 'expenses2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'expenses.tpl'); +$smarty->display('index.tpl'); diff --git a/export.php b/export.php index b5e1206d..2bcba2dc 100644 --- a/export.php +++ b/export.php @@ -55,5 +55,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.export')); -$smarty->assign('content_page_name', 'export2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'export.tpl'); +$smarty->display('index.tpl'); diff --git a/file_delete.php b/file_delete.php index 1b415c19..e6cb5337 100644 --- a/file_delete.php +++ b/file_delete.php @@ -98,5 +98,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fileDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_file')); -$smarty->assign('content_page_name', 'file_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'file_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/file_download.php b/file_download.php index ff7e1633..2fb52f79 100644 --- a/file_download.php +++ b/file_download.php @@ -59,5 +59,5 @@ } $smarty->assign('title', $i18n->get('title.download_file')); -$smarty->assign('content_page_name', 'file_download2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'file_download.tpl'); +$smarty->display('index.tpl'); diff --git a/file_edit.php b/file_edit.php index 745293c2..aeb8f70c 100644 --- a/file_edit.php +++ b/file_edit.php @@ -96,5 +96,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.fileForm.description.focus()"'); $smarty->assign('title', $i18n->get('title.edit_file')); -$smarty->assign('content_page_name', 'file_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'file_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/initialize.php b/initialize.php index 378edcba..658b5fb6 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5541"); +define("APP_VERSION", "1.19.28.5542"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/project_files.php b/project_files.php index 60fc4d9e..8b38a8ce 100644 --- a/project_files.php +++ b/project_files.php @@ -62,5 +62,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('files', $files); $smarty->assign('title', $i18n->get('title.project_files').': '.$project['name']); -$smarty->assign('content_page_name', 'entity_files2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'entity_files.tpl'); +$smarty->display('index.tpl'); diff --git a/time_files.php b/time_files.php index 210bd534..c5dce5ba 100644 --- a/time_files.php +++ b/time_files.php @@ -62,5 +62,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('files', $files); $smarty->assign('title', $i18n->get('title.time_files')); -$smarty->assign('content_page_name', 'entity_files2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'entity_files.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheet_files.php b/timesheet_files.php index d09ecd57..bca00f28 100644 --- a/timesheet_files.php +++ b/timesheet_files.php @@ -61,5 +61,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('files', $files); $smarty->assign('title', $i18n->get('title.timesheet_files').': '.$timesheet['name']); -$smarty->assign('content_page_name', 'entity_files2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'entity_files.tpl'); +$smarty->display('index.tpl'); From 9f25423fdd777837465ef62d0d8ba97853e725ed Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 16:39:30 +0000 Subject: [PATCH 013/304] More templates renamed. --- WEB-INF/templates/{footer2.tpl => footer.tpl} | 0 WEB-INF/templates/{group_add2.tpl => group_add.tpl} | 0 .../{group_advanced_edit2.tpl => group_advanced_edit.tpl} | 0 WEB-INF/templates/{group_delete2.tpl => group_delete.tpl} | 0 WEB-INF/templates/{group_edit2.tpl => group_edit.tpl} | 0 WEB-INF/templates/{groups2.tpl => groups.tpl} | 0 WEB-INF/templates/{header2.tpl => header.tpl} | 0 WEB-INF/templates/{import2.tpl => import.tpl} | 0 WEB-INF/templates/index.tpl | 4 ++-- WEB-INF/templates/index2.tpl | 4 ++-- WEB-INF/templates/{user_add2.tpl => user_add.tpl} | 0 WEB-INF/templates/{user_delete2.tpl => user_delete.tpl} | 0 WEB-INF/templates/{user_edit2.tpl => user_edit.tpl} | 0 WEB-INF/templates/{users2.tpl => users.tpl} | 0 WEB-INF/templates/{week2.tpl => week.tpl} | 0 WEB-INF/templates/{week_view2.tpl => week_view.tpl} | 0 WEB-INF/templates/{work_units2.tpl => work_units.tpl} | 0 group_add.php | 4 ++-- group_advanced_edit.php | 4 ++-- group_delete.php | 4 ++-- group_edit.php | 4 ++-- groups.php | 4 ++-- import.php | 4 ++-- initialize.php | 2 +- user_add.php | 4 ++-- user_delete.php | 4 ++-- user_edit.php | 4 ++-- users.php | 4 ++-- week.php | 4 ++-- week_view.php | 4 ++-- work_units.php | 4 ++-- 31 files changed, 31 insertions(+), 31 deletions(-) rename WEB-INF/templates/{footer2.tpl => footer.tpl} (100%) rename WEB-INF/templates/{group_add2.tpl => group_add.tpl} (100%) rename WEB-INF/templates/{group_advanced_edit2.tpl => group_advanced_edit.tpl} (100%) rename WEB-INF/templates/{group_delete2.tpl => group_delete.tpl} (100%) rename WEB-INF/templates/{group_edit2.tpl => group_edit.tpl} (100%) rename WEB-INF/templates/{groups2.tpl => groups.tpl} (100%) rename WEB-INF/templates/{header2.tpl => header.tpl} (100%) rename WEB-INF/templates/{import2.tpl => import.tpl} (100%) rename WEB-INF/templates/{user_add2.tpl => user_add.tpl} (100%) rename WEB-INF/templates/{user_delete2.tpl => user_delete.tpl} (100%) rename WEB-INF/templates/{user_edit2.tpl => user_edit.tpl} (100%) rename WEB-INF/templates/{users2.tpl => users.tpl} (100%) rename WEB-INF/templates/{week2.tpl => week.tpl} (100%) rename WEB-INF/templates/{week_view2.tpl => week_view.tpl} (100%) rename WEB-INF/templates/{work_units2.tpl => work_units.tpl} (100%) diff --git a/WEB-INF/templates/footer2.tpl b/WEB-INF/templates/footer.tpl similarity index 100% rename from WEB-INF/templates/footer2.tpl rename to WEB-INF/templates/footer.tpl diff --git a/WEB-INF/templates/group_add2.tpl b/WEB-INF/templates/group_add.tpl similarity index 100% rename from WEB-INF/templates/group_add2.tpl rename to WEB-INF/templates/group_add.tpl diff --git a/WEB-INF/templates/group_advanced_edit2.tpl b/WEB-INF/templates/group_advanced_edit.tpl similarity index 100% rename from WEB-INF/templates/group_advanced_edit2.tpl rename to WEB-INF/templates/group_advanced_edit.tpl diff --git a/WEB-INF/templates/group_delete2.tpl b/WEB-INF/templates/group_delete.tpl similarity index 100% rename from WEB-INF/templates/group_delete2.tpl rename to WEB-INF/templates/group_delete.tpl diff --git a/WEB-INF/templates/group_edit2.tpl b/WEB-INF/templates/group_edit.tpl similarity index 100% rename from WEB-INF/templates/group_edit2.tpl rename to WEB-INF/templates/group_edit.tpl diff --git a/WEB-INF/templates/groups2.tpl b/WEB-INF/templates/groups.tpl similarity index 100% rename from WEB-INF/templates/groups2.tpl rename to WEB-INF/templates/groups.tpl diff --git a/WEB-INF/templates/header2.tpl b/WEB-INF/templates/header.tpl similarity index 100% rename from WEB-INF/templates/header2.tpl rename to WEB-INF/templates/header.tpl diff --git a/WEB-INF/templates/import2.tpl b/WEB-INF/templates/import.tpl similarity index 100% rename from WEB-INF/templates/import2.tpl rename to WEB-INF/templates/import.tpl diff --git a/WEB-INF/templates/index.tpl b/WEB-INF/templates/index.tpl index 410a7616..75a751e0 100644 --- a/WEB-INF/templates/index.tpl +++ b/WEB-INF/templates/index.tpl @@ -1,5 +1,5 @@ -{include file="header2.tpl"} +{include file="header.tpl"} {if $content_page_name}{include file="$content_page_name"}{/if} -{include file="footer2.tpl"} +{include file="footer.tpl"} diff --git a/WEB-INF/templates/index2.tpl b/WEB-INF/templates/index2.tpl index 410a7616..75a751e0 100644 --- a/WEB-INF/templates/index2.tpl +++ b/WEB-INF/templates/index2.tpl @@ -1,5 +1,5 @@ -{include file="header2.tpl"} +{include file="header.tpl"} {if $content_page_name}{include file="$content_page_name"}{/if} -{include file="footer2.tpl"} +{include file="footer.tpl"} diff --git a/WEB-INF/templates/user_add2.tpl b/WEB-INF/templates/user_add.tpl similarity index 100% rename from WEB-INF/templates/user_add2.tpl rename to WEB-INF/templates/user_add.tpl diff --git a/WEB-INF/templates/user_delete2.tpl b/WEB-INF/templates/user_delete.tpl similarity index 100% rename from WEB-INF/templates/user_delete2.tpl rename to WEB-INF/templates/user_delete.tpl diff --git a/WEB-INF/templates/user_edit2.tpl b/WEB-INF/templates/user_edit.tpl similarity index 100% rename from WEB-INF/templates/user_edit2.tpl rename to WEB-INF/templates/user_edit.tpl diff --git a/WEB-INF/templates/users2.tpl b/WEB-INF/templates/users.tpl similarity index 100% rename from WEB-INF/templates/users2.tpl rename to WEB-INF/templates/users.tpl diff --git a/WEB-INF/templates/week2.tpl b/WEB-INF/templates/week.tpl similarity index 100% rename from WEB-INF/templates/week2.tpl rename to WEB-INF/templates/week.tpl diff --git a/WEB-INF/templates/week_view2.tpl b/WEB-INF/templates/week_view.tpl similarity index 100% rename from WEB-INF/templates/week_view2.tpl rename to WEB-INF/templates/week_view.tpl diff --git a/WEB-INF/templates/work_units2.tpl b/WEB-INF/templates/work_units.tpl similarity index 100% rename from WEB-INF/templates/work_units2.tpl rename to WEB-INF/templates/work_units.tpl diff --git a/group_add.php b/group_add.php index 8436acd8..6f88af20 100644 --- a/group_add.php +++ b/group_add.php @@ -46,5 +46,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.groupForm.group_name.focus()"'); $smarty->assign('title', $i18n->get('title.add_group')); -$smarty->assign('content_page_name', 'group_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'group_add.tpl'); +$smarty->display('index.tpl'); diff --git a/group_advanced_edit.php b/group_advanced_edit.php index efb7a49e..d0801757 100644 --- a/group_advanced_edit.php +++ b/group_advanced_edit.php @@ -62,5 +62,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.edit_group')); -$smarty->assign('content_page_name', 'group_advanced_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'group_advanced_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/group_delete.php b/group_delete.php index c1e47d02..377bb80e 100644 --- a/group_delete.php +++ b/group_delete.php @@ -64,5 +64,5 @@ $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', 'group_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'group_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/group_edit.php b/group_edit.php index 097c3405..ab3065d5 100644 --- a/group_edit.php +++ b/group_edit.php @@ -231,5 +231,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="handlePluginCheckboxes();"'); $smarty->assign('title', $i18n->get('title.edit_group')); -$smarty->assign('content_page_name', 'group_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'group_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/groups.php b/groups.php index 5773220a..a7bf2dfe 100644 --- a/groups.php +++ b/groups.php @@ -39,5 +39,5 @@ $smarty->assign('subgroups', $user->getSubgroups($group_id)); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('label.subgroups')); -$smarty->assign('content_page_name', 'groups2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'groups.tpl'); +$smarty->display('index.tpl'); diff --git a/import.php b/import.php index c4b59c24..b743b3f5 100644 --- a/import.php +++ b/import.php @@ -25,5 +25,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray()) ); $smarty->assign('title', $i18n->get('title.import')); -$smarty->assign('content_page_name', 'import2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'import.tpl'); +$smarty->display('index.tpl'); diff --git a/initialize.php b/initialize.php index 658b5fb6..f69c77a1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5542"); +define("APP_VERSION", "1.19.28.5543"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/user_add.php b/user_add.php index 7325682e..8d584afb 100644 --- a/user_add.php +++ b/user_add.php @@ -217,5 +217,5 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('show_quota', $show_quota); $smarty->assign('show_projects', $show_projects); $smarty->assign('title', $i18n->get('title.add_user')); -$smarty->assign('content_page_name', 'user_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'user_add.tpl'); +$smarty->display('index.tpl'); diff --git a/user_delete.php b/user_delete.php index 99378fda..e6ec7365 100644 --- a/user_delete.php +++ b/user_delete.php @@ -59,5 +59,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.delete_user')); -$smarty->assign('content_page_name', 'user_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'user_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/user_edit.php b/user_edit.php index bae837c4..10aaebbb 100644 --- a/user_edit.php +++ b/user_edit.php @@ -279,5 +279,5 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('show_projects', $show_projects); $smarty->assign('user_id', $user_id); $smarty->assign('title', $i18n->get('title.edit_user')); -$smarty->assign('content_page_name', 'user_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'user_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/users.php b/users.php index a0ccdc3c..16a42239 100644 --- a/users.php +++ b/users.php @@ -41,5 +41,5 @@ $smarty->assign('inactive_users', $inactive_users); $smarty->assign('show_quota', $user->isPluginEnabled('mq')); $smarty->assign('title', $i18n->get('title.users')); -$smarty->assign('content_page_name', 'users2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'users.tpl'); +$smarty->display('index.tpl'); diff --git a/week.php b/week.php index 63bd3823..6a2a25e2 100644 --- a/week.php +++ b/week.php @@ -559,5 +559,5 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('show_start', $showStart); $smarty->assign('show_files', $showFiles); $smarty->assign('title', $i18n->get('menu.week')); -$smarty->assign('content_page_name', 'week2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'week.tpl'); +$smarty->display('index.tpl'); diff --git a/week_view.php b/week_view.php index d612239b..1718afd4 100644 --- a/week_view.php +++ b/week_view.php @@ -45,5 +45,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.week_view')); -$smarty->assign('content_page_name', 'week_view2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'week_view.tpl'); +$smarty->display('index.tpl'); diff --git a/work_units.php b/work_units.php index ab2ac81a..b8a4a747 100644 --- a/work_units.php +++ b/work_units.php @@ -53,5 +53,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.work_units')); -$smarty->assign('content_page_name', 'work_units2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'work_units.tpl'); +$smarty->display('index.tpl'); From 9358c20bf5a5ff35c17633c093fca9f8a0d84118 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 17:05:44 +0000 Subject: [PATCH 014/304] Some more templates renamed. --- WEB-INF/templates/{template_add2.tpl => template_add.tpl} | 0 .../templates/{template_delete2.tpl => template_delete.tpl} | 0 WEB-INF/templates/{template_edit2.tpl => template_edit.tpl} | 0 WEB-INF/templates/{templates2.tpl => templates.tpl} | 0 WEB-INF/templates/{time2.tpl => time.tpl} | 0 WEB-INF/templates/{time_delete2.tpl => time_delete.tpl} | 0 WEB-INF/templates/{time_edit2.tpl => time_edit.tpl} | 0 WEB-INF/templates/{timer2.tpl => timer.tpl} | 0 WEB-INF/templates/{timesheet_add2.tpl => timesheet_add.tpl} | 0 .../templates/{timesheet_delete2.tpl => timesheet_delete.tpl} | 0 WEB-INF/templates/{timesheet_edit2.tpl => timesheet_edit.tpl} | 0 WEB-INF/templates/{timesheet_view2.tpl => timesheet_view.tpl} | 0 WEB-INF/templates/{timesheets2.tpl => timesheets.tpl} | 0 initialize.php | 2 +- template_add.php | 4 ++-- template_delete.php | 4 ++-- template_edit.php | 4 ++-- templates.php | 4 ++-- time.php | 4 ++-- time_delete.php | 4 ++-- time_edit.php | 4 ++-- timer.php | 4 ++-- timesheet_add.php | 4 ++-- timesheet_delete.php | 4 ++-- timesheet_edit.php | 4 ++-- timesheet_view.php | 4 ++-- timesheets.php | 4 ++-- 27 files changed, 27 insertions(+), 27 deletions(-) rename WEB-INF/templates/{template_add2.tpl => template_add.tpl} (100%) rename WEB-INF/templates/{template_delete2.tpl => template_delete.tpl} (100%) rename WEB-INF/templates/{template_edit2.tpl => template_edit.tpl} (100%) rename WEB-INF/templates/{templates2.tpl => templates.tpl} (100%) rename WEB-INF/templates/{time2.tpl => time.tpl} (100%) rename WEB-INF/templates/{time_delete2.tpl => time_delete.tpl} (100%) rename WEB-INF/templates/{time_edit2.tpl => time_edit.tpl} (100%) rename WEB-INF/templates/{timer2.tpl => timer.tpl} (100%) rename WEB-INF/templates/{timesheet_add2.tpl => timesheet_add.tpl} (100%) rename WEB-INF/templates/{timesheet_delete2.tpl => timesheet_delete.tpl} (100%) rename WEB-INF/templates/{timesheet_edit2.tpl => timesheet_edit.tpl} (100%) rename WEB-INF/templates/{timesheet_view2.tpl => timesheet_view.tpl} (100%) rename WEB-INF/templates/{timesheets2.tpl => timesheets.tpl} (100%) diff --git a/WEB-INF/templates/template_add2.tpl b/WEB-INF/templates/template_add.tpl similarity index 100% rename from WEB-INF/templates/template_add2.tpl rename to WEB-INF/templates/template_add.tpl diff --git a/WEB-INF/templates/template_delete2.tpl b/WEB-INF/templates/template_delete.tpl similarity index 100% rename from WEB-INF/templates/template_delete2.tpl rename to WEB-INF/templates/template_delete.tpl diff --git a/WEB-INF/templates/template_edit2.tpl b/WEB-INF/templates/template_edit.tpl similarity index 100% rename from WEB-INF/templates/template_edit2.tpl rename to WEB-INF/templates/template_edit.tpl diff --git a/WEB-INF/templates/templates2.tpl b/WEB-INF/templates/templates.tpl similarity index 100% rename from WEB-INF/templates/templates2.tpl rename to WEB-INF/templates/templates.tpl diff --git a/WEB-INF/templates/time2.tpl b/WEB-INF/templates/time.tpl similarity index 100% rename from WEB-INF/templates/time2.tpl rename to WEB-INF/templates/time.tpl diff --git a/WEB-INF/templates/time_delete2.tpl b/WEB-INF/templates/time_delete.tpl similarity index 100% rename from WEB-INF/templates/time_delete2.tpl rename to WEB-INF/templates/time_delete.tpl diff --git a/WEB-INF/templates/time_edit2.tpl b/WEB-INF/templates/time_edit.tpl similarity index 100% rename from WEB-INF/templates/time_edit2.tpl rename to WEB-INF/templates/time_edit.tpl diff --git a/WEB-INF/templates/timer2.tpl b/WEB-INF/templates/timer.tpl similarity index 100% rename from WEB-INF/templates/timer2.tpl rename to WEB-INF/templates/timer.tpl diff --git a/WEB-INF/templates/timesheet_add2.tpl b/WEB-INF/templates/timesheet_add.tpl similarity index 100% rename from WEB-INF/templates/timesheet_add2.tpl rename to WEB-INF/templates/timesheet_add.tpl diff --git a/WEB-INF/templates/timesheet_delete2.tpl b/WEB-INF/templates/timesheet_delete.tpl similarity index 100% rename from WEB-INF/templates/timesheet_delete2.tpl rename to WEB-INF/templates/timesheet_delete.tpl diff --git a/WEB-INF/templates/timesheet_edit2.tpl b/WEB-INF/templates/timesheet_edit.tpl similarity index 100% rename from WEB-INF/templates/timesheet_edit2.tpl rename to WEB-INF/templates/timesheet_edit.tpl diff --git a/WEB-INF/templates/timesheet_view2.tpl b/WEB-INF/templates/timesheet_view.tpl similarity index 100% rename from WEB-INF/templates/timesheet_view2.tpl rename to WEB-INF/templates/timesheet_view.tpl diff --git a/WEB-INF/templates/timesheets2.tpl b/WEB-INF/templates/timesheets.tpl similarity index 100% rename from WEB-INF/templates/timesheets2.tpl rename to WEB-INF/templates/timesheets.tpl diff --git a/initialize.php b/initialize.php index f69c77a1..c57314c2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5543"); +define("APP_VERSION", "1.19.28.5544"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/template_add.php b/template_add.php index 6347d22e..cb84fb33 100644 --- a/template_add.php +++ b/template_add.php @@ -65,5 +65,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_projects', $bindTemplatesWithProjects && count($projects) > 0); $smarty->assign('title', $i18n->get('title.add_template')); -$smarty->assign('content_page_name', 'template_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'template_add.tpl'); +$smarty->display('index.tpl'); diff --git a/template_delete.php b/template_delete.php index 792cadbd..a4996e05 100644 --- a/template_delete.php +++ b/template_delete.php @@ -47,5 +47,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.templateDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_template')); -$smarty->assign('content_page_name', 'template_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'template_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/template_edit.php b/template_edit.php index 3451ff64..814eff59 100644 --- a/template_edit.php +++ b/template_edit.php @@ -83,5 +83,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_projects', $bindTemplatesWithProjects && count($projects) > 0); $smarty->assign('title', $i18n->get('title.edit_template')); -$smarty->assign('content_page_name', 'template_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'template_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/templates.php b/templates.php index 53d57b86..636d4bc1 100644 --- a/templates.php +++ b/templates.php @@ -59,5 +59,5 @@ $smarty->assign('inactive_templates', $inactiveTemplates); $smarty->assign('show_bind_with_projects_checkbox', $showBindWithProjectsCheckbox); $smarty->assign('title', $i18n->get('title.templates')); -$smarty->assign('content_page_name', 'templates2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'templates.tpl'); +$smarty->display('index.tpl'); diff --git a/time.php b/time.php index 9b366b54..9bd31127 100644 --- a/time.php +++ b/time.php @@ -488,5 +488,5 @@ $smarty->assign('onload', 'onLoad="fillDropdowns();prepopulateNote();adjustTodayLinks()"'); $smarty->assign('timestring', $selected_date->toString($user->getDateFormat())); $smarty->assign('title', $i18n->get('title.time')); -$smarty->assign('content_page_name', 'time2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'time.tpl'); +$smarty->display('index.tpl'); diff --git a/time_delete.php b/time_delete.php index 5b384952..9c028dab 100644 --- a/time_delete.php +++ b/time_delete.php @@ -69,5 +69,5 @@ $smarty->assign('show_duration', $showDuration); $smarty->assign('forms', array($form->getName() => $form->toArray())); $smarty->assign('title', $i18n->get('title.delete_time_record')); -$smarty->assign('content_page_name', 'time_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'time_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/time_edit.php b/time_edit.php index 8e9f31e5..d34ae1ca 100644 --- a/time_edit.php +++ b/time_edit.php @@ -467,5 +467,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="fillDropdowns()"'); $smarty->assign('title', $i18n->get('title.edit_time_record')); -$smarty->assign('content_page_name', 'time_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'time_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/timer.php b/timer.php index aa51a4dc..cd0081f3 100644 --- a/timer.php +++ b/timer.php @@ -307,5 +307,5 @@ $smarty->assign('onload', 'onLoad="fillDropdowns()"'); $smarty->assign('timestring', $selected_date->toString($user->date_format)); $smarty->assign('title', $i18n->get('title.time')); -$smarty->assign('content_page_name', 'timer2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timer.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheet_add.php b/timesheet_add.php index 5fb15df6..7361c4f2 100644 --- a/timesheet_add.php +++ b/timesheet_add.php @@ -80,5 +80,5 @@ $smarty->assign('show_client', $showClient); $smarty->assign('show_project', $showProject); $smarty->assign('title', $i18n->get('title.add_timesheet')); -$smarty->assign('content_page_name', 'timesheet_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timesheet_add.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheet_delete.php b/timesheet_delete.php index b0b84797..ff1e4e18 100644 --- a/timesheet_delete.php +++ b/timesheet_delete.php @@ -47,5 +47,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.invoiceDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_timesheet')); -$smarty->assign('content_page_name', 'timesheet_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timesheet_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheet_edit.php b/timesheet_edit.php index c9676ed5..164cc61b 100644 --- a/timesheet_edit.php +++ b/timesheet_edit.php @@ -81,5 +81,5 @@ $smarty->assign('onload', 'onLoad="document.timesheetForm.timesheet_name.focus()"'); $smarty->assign('can_delete', $canDelete); $smarty->assign('title', $i18n->get('title.edit_timesheet')); -$smarty->assign('content_page_name', 'timesheet_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timesheet_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheet_view.php b/timesheet_view.php index a74424a6..90537176 100644 --- a/timesheet_view.php +++ b/timesheet_view.php @@ -126,5 +126,5 @@ $smarty->assign('show_approve', $showApprove); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.timesheet').": ".$timesheet['start_date']." - ".$timesheet['end_date']); -$smarty->assign('content_page_name', 'timesheet_view2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timesheet_view.tpl'); +$smarty->display('index.tpl'); diff --git a/timesheets.php b/timesheets.php index 54bbc339..7dbbb78d 100644 --- a/timesheets.php +++ b/timesheets.php @@ -78,5 +78,5 @@ $smarty->assign('show_files', $showFiles); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.timesheets')); -$smarty->assign('content_page_name', 'timesheets2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'timesheets.tpl'); +$smarty->display('index.tpl'); From eea705e1dcf06723cd7f1f334e4f716f8cfaae1a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 17:20:08 +0000 Subject: [PATCH 015/304] More work in progress on template renaming. --- WEB-INF/templates/{quotas2.tpl => quotas.tpl} | 0 WEB-INF/templates/{register2.tpl => register.tpl} | 0 WEB-INF/templates/{report2.tpl => report.tpl} | 0 WEB-INF/templates/{reports2.tpl => reports.tpl} | 2 +- WEB-INF/templates/{role_add2.tpl => role_add.tpl} | 0 WEB-INF/templates/{role_delete2.tpl => role_delete.tpl} | 0 WEB-INF/templates/{role_edit2.tpl => role_edit.tpl} | 0 WEB-INF/templates/{roles2.tpl => roles.tpl} | 0 WEB-INF/templates/{success2.tpl => success.tpl} | 0 WEB-INF/templates/{swap_roles2.tpl => swap_roles.tpl} | 0 WEB-INF/templates/{task_add2.tpl => task_add.tpl} | 0 WEB-INF/templates/{task_delete2.tpl => task_delete.tpl} | 0 WEB-INF/templates/{task_edit2.tpl => task_edit.tpl} | 0 WEB-INF/templates/{tasks2.tpl => tasks.tpl} | 0 initialize.php | 2 +- quotas.php | 4 ++-- register.php | 4 ++-- report.php | 4 ++-- reports.php | 4 ++-- role_add.php | 4 ++-- role_delete.php | 4 ++-- role_edit.php | 4 ++-- roles.php | 4 ++-- success.php | 4 ++-- swap_roles.php | 4 ++-- task_add.php | 4 ++-- task_delete.php | 4 ++-- task_edit.php | 4 ++-- tasks.php | 4 ++-- 29 files changed, 30 insertions(+), 30 deletions(-) rename WEB-INF/templates/{quotas2.tpl => quotas.tpl} (100%) rename WEB-INF/templates/{register2.tpl => register.tpl} (100%) rename WEB-INF/templates/{report2.tpl => report.tpl} (100%) rename WEB-INF/templates/{reports2.tpl => reports.tpl} (99%) rename WEB-INF/templates/{role_add2.tpl => role_add.tpl} (100%) rename WEB-INF/templates/{role_delete2.tpl => role_delete.tpl} (100%) rename WEB-INF/templates/{role_edit2.tpl => role_edit.tpl} (100%) rename WEB-INF/templates/{roles2.tpl => roles.tpl} (100%) rename WEB-INF/templates/{success2.tpl => success.tpl} (100%) rename WEB-INF/templates/{swap_roles2.tpl => swap_roles.tpl} (100%) rename WEB-INF/templates/{task_add2.tpl => task_add.tpl} (100%) rename WEB-INF/templates/{task_delete2.tpl => task_delete.tpl} (100%) rename WEB-INF/templates/{task_edit2.tpl => task_edit.tpl} (100%) rename WEB-INF/templates/{tasks2.tpl => tasks.tpl} (100%) diff --git a/WEB-INF/templates/quotas2.tpl b/WEB-INF/templates/quotas.tpl similarity index 100% rename from WEB-INF/templates/quotas2.tpl rename to WEB-INF/templates/quotas.tpl diff --git a/WEB-INF/templates/register2.tpl b/WEB-INF/templates/register.tpl similarity index 100% rename from WEB-INF/templates/register2.tpl rename to WEB-INF/templates/register.tpl diff --git a/WEB-INF/templates/report2.tpl b/WEB-INF/templates/report.tpl similarity index 100% rename from WEB-INF/templates/report2.tpl rename to WEB-INF/templates/report.tpl diff --git a/WEB-INF/templates/reports2.tpl b/WEB-INF/templates/reports.tpl similarity index 99% rename from WEB-INF/templates/reports2.tpl rename to WEB-INF/templates/reports.tpl index 294d5ea7..aa8e9d63 100644 --- a/WEB-INF/templates/reports2.tpl +++ b/WEB-INF/templates/reports.tpl @@ -121,7 +121,7 @@ function fillProjectDropdown(id) { function fillTaskDropdown(project_id) { var str_task_ids; // Get a string of comma-separated task ids. - if (project_id) { + if (project_id) { var property = "p" + project_id; str_task_ids = obj_tasks[property]; } diff --git a/WEB-INF/templates/role_add2.tpl b/WEB-INF/templates/role_add.tpl similarity index 100% rename from WEB-INF/templates/role_add2.tpl rename to WEB-INF/templates/role_add.tpl diff --git a/WEB-INF/templates/role_delete2.tpl b/WEB-INF/templates/role_delete.tpl similarity index 100% rename from WEB-INF/templates/role_delete2.tpl rename to WEB-INF/templates/role_delete.tpl diff --git a/WEB-INF/templates/role_edit2.tpl b/WEB-INF/templates/role_edit.tpl similarity index 100% rename from WEB-INF/templates/role_edit2.tpl rename to WEB-INF/templates/role_edit.tpl diff --git a/WEB-INF/templates/roles2.tpl b/WEB-INF/templates/roles.tpl similarity index 100% rename from WEB-INF/templates/roles2.tpl rename to WEB-INF/templates/roles.tpl diff --git a/WEB-INF/templates/success2.tpl b/WEB-INF/templates/success.tpl similarity index 100% rename from WEB-INF/templates/success2.tpl rename to WEB-INF/templates/success.tpl diff --git a/WEB-INF/templates/swap_roles2.tpl b/WEB-INF/templates/swap_roles.tpl similarity index 100% rename from WEB-INF/templates/swap_roles2.tpl rename to WEB-INF/templates/swap_roles.tpl diff --git a/WEB-INF/templates/task_add2.tpl b/WEB-INF/templates/task_add.tpl similarity index 100% rename from WEB-INF/templates/task_add2.tpl rename to WEB-INF/templates/task_add.tpl diff --git a/WEB-INF/templates/task_delete2.tpl b/WEB-INF/templates/task_delete.tpl similarity index 100% rename from WEB-INF/templates/task_delete2.tpl rename to WEB-INF/templates/task_delete.tpl diff --git a/WEB-INF/templates/task_edit2.tpl b/WEB-INF/templates/task_edit.tpl similarity index 100% rename from WEB-INF/templates/task_edit2.tpl rename to WEB-INF/templates/task_edit.tpl diff --git a/WEB-INF/templates/tasks2.tpl b/WEB-INF/templates/tasks.tpl similarity index 100% rename from WEB-INF/templates/tasks2.tpl rename to WEB-INF/templates/tasks.tpl diff --git a/initialize.php b/initialize.php index c57314c2..b2857f6e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5544"); +define("APP_VERSION", "1.19.28.5545"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/quotas.php b/quotas.php index c49fbf1f..55214093 100644 --- a/quotas.php +++ b/quotas.php @@ -107,5 +107,5 @@ $smarty->assign('months', $months); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.monthly_quotas')); -$smarty->assign('content_page_name', 'quotas2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'quotas.tpl'); +$smarty->display('index.tpl'); diff --git a/register.php b/register.php index 22037613..35fbee9c 100644 --- a/register.php +++ b/register.php @@ -96,5 +96,5 @@ $smarty->assign('title', $i18n->get('title.add_group')); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.groupForm.group_name.focus()"'); -$smarty->assign('content_page_name', 'register2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'register.tpl'); +$smarty->display('index.tpl'); diff --git a/report.php b/report.php index cb959d48..bd2576f1 100644 --- a/report.php +++ b/report.php @@ -320,5 +320,5 @@ $smarty->assign('colspan', $colspan); $smarty->assign('bean', $bean); $smarty->assign('title', $i18n->get('title.report').": ".$totals['start_date']." - ".$totals['end_date']); -$smarty->assign('content_page_name', 'report2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'report.tpl'); +$smarty->display('index.tpl'); diff --git a/reports.php b/reports.php index 71f455be..059c7d90 100644 --- a/reports.php +++ b/reports.php @@ -492,5 +492,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="handleCheckboxes();fillDropdowns()"'); $smarty->assign('title', $i18n->get('title.reports')); -$smarty->assign('content_page_name', 'reports2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'reports.tpl'); +$smarty->display('index.tpl'); diff --git a/role_add.php b/role_add.php index 54fd9bdb..b2879dd8 100644 --- a/role_add.php +++ b/role_add.php @@ -55,5 +55,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.add_role')); -$smarty->assign('content_page_name', 'role_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'role_add.tpl'); +$smarty->display('index.tpl'); diff --git a/role_delete.php b/role_delete.php index 805c89db..e2f0805e 100644 --- a/role_delete.php +++ b/role_delete.php @@ -46,5 +46,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_role')); -$smarty->assign('content_page_name', 'role_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'role_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/role_edit.php b/role_edit.php index 03e1d247..5192ee62 100644 --- a/role_edit.php +++ b/role_edit.php @@ -115,5 +115,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.edit_role')); -$smarty->assign('content_page_name', 'role_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'role_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/roles.php b/roles.php index f2795fb0..569f2649 100644 --- a/roles.php +++ b/roles.php @@ -17,5 +17,5 @@ $smarty->assign('active_roles', ttTeamHelper::getActiveRolesForUser()); $smarty->assign('inactive_roles', ttTeamHelper::getInactiveRolesForUser()); $smarty->assign('title', $i18n->get('title.roles')); -$smarty->assign('content_page_name', 'roles2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'roles.tpl'); +$smarty->display('index.tpl'); diff --git a/success.php b/success.php index eea4687a..6fbf8ad2 100644 --- a/success.php +++ b/success.php @@ -8,5 +8,5 @@ if ($auth->isAuthenticated()) $smarty->assign('authenticated', true); // Used in header.tpl for menu display. $smarty->assign('title', $i18n->get('title.success')); -$smarty->assign('content_page_name', 'success2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'success.tpl'); +$smarty->display('index.tpl'); diff --git a/swap_roles.php b/swap_roles.php index e49bed75..7a036a77 100644 --- a/swap_roles.php +++ b/swap_roles.php @@ -49,5 +49,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.swapForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.swap_roles')); -$smarty->assign('content_page_name', 'swap_roles2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'swap_roles.tpl'); +$smarty->display('index.tpl'); diff --git a/task_add.php b/task_add.php index 4888677f..3d8dcc1c 100644 --- a/task_add.php +++ b/task_add.php @@ -62,5 +62,5 @@ $smarty->assign('show_projects', count($projects) > 0); $smarty->assign('onload', 'onLoad="document.taskForm.name.focus()"'); $smarty->assign('title', $i18n->get('title.add_task')); -$smarty->assign('content_page_name', 'task_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'task_add.tpl'); +$smarty->display('index.tpl'); diff --git a/task_delete.php b/task_delete.php index 61f5e23f..04008010 100644 --- a/task_delete.php +++ b/task_delete.php @@ -50,5 +50,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.taskDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_task')); -$smarty->assign('content_page_name', 'task_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'task_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/task_edit.php b/task_edit.php index 4b9a72ae..b2b61b80 100644 --- a/task_edit.php +++ b/task_edit.php @@ -96,5 +96,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_projects', count($projects) > 0); $smarty->assign('title', $i18n->get('title.edit_task')); -$smarty->assign('content_page_name', 'task_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'task_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/tasks.php b/tasks.php index 464af615..13787a8a 100644 --- a/tasks.php +++ b/tasks.php @@ -49,5 +49,5 @@ $smarty->assign('active_tasks', $active_tasks); $smarty->assign('inactive_tasks', $inactive_tasks); $smarty->assign('title', $i18n->get('title.tasks')); -$smarty->assign('content_page_name', 'tasks2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'tasks.tpl'); +$smarty->display('index.tpl'); From 01dfa61fb9f34b4559d6be25e6efee210a2f046d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 18:00:57 +0000 Subject: [PATCH 016/304] More templates renamed. --- .../templates/{password_change2.tpl => password_change.tpl} | 0 WEB-INF/templates/{password_reset2.tpl => password_reset.tpl} | 0 WEB-INF/templates/{plugins2.tpl => plugins.tpl} | 0 ...predefined_expense_add2.tpl => predefined_expense_add.tpl} | 0 ...ined_expense_delete2.tpl => predefined_expense_delete.tpl} | 0 ...edefined_expense_edit2.tpl => predefined_expense_edit.tpl} | 0 .../{predefined_expenses2.tpl => predefined_expenses.tpl} | 0 WEB-INF/templates/{profile_edit2.tpl => profile_edit.tpl} | 0 WEB-INF/templates/{project_add2.tpl => project_add.tpl} | 0 WEB-INF/templates/{project_delete2.tpl => project_delete.tpl} | 0 WEB-INF/templates/{project_edit2.tpl => project_edit.tpl} | 0 WEB-INF/templates/{projects2.tpl => projects.tpl} | 0 initialize.php | 2 +- password_change.php | 4 ++-- password_reset.php | 4 ++-- plugins.php | 4 ++-- predefined_expense_add.php | 4 ++-- predefined_expense_delete.php | 4 ++-- predefined_expense_edit.php | 4 ++-- predefined_expenses.php | 4 ++-- profile_edit.php | 4 ++-- project_add.php | 4 ++-- project_delete.php | 4 ++-- project_edit.php | 4 ++-- projects.php | 4 ++-- 25 files changed, 25 insertions(+), 25 deletions(-) rename WEB-INF/templates/{password_change2.tpl => password_change.tpl} (100%) rename WEB-INF/templates/{password_reset2.tpl => password_reset.tpl} (100%) rename WEB-INF/templates/{plugins2.tpl => plugins.tpl} (100%) rename WEB-INF/templates/{predefined_expense_add2.tpl => predefined_expense_add.tpl} (100%) rename WEB-INF/templates/{predefined_expense_delete2.tpl => predefined_expense_delete.tpl} (100%) rename WEB-INF/templates/{predefined_expense_edit2.tpl => predefined_expense_edit.tpl} (100%) rename WEB-INF/templates/{predefined_expenses2.tpl => predefined_expenses.tpl} (100%) rename WEB-INF/templates/{profile_edit2.tpl => profile_edit.tpl} (100%) rename WEB-INF/templates/{project_add2.tpl => project_add.tpl} (100%) rename WEB-INF/templates/{project_delete2.tpl => project_delete.tpl} (100%) rename WEB-INF/templates/{project_edit2.tpl => project_edit.tpl} (100%) rename WEB-INF/templates/{projects2.tpl => projects.tpl} (100%) diff --git a/WEB-INF/templates/password_change2.tpl b/WEB-INF/templates/password_change.tpl similarity index 100% rename from WEB-INF/templates/password_change2.tpl rename to WEB-INF/templates/password_change.tpl diff --git a/WEB-INF/templates/password_reset2.tpl b/WEB-INF/templates/password_reset.tpl similarity index 100% rename from WEB-INF/templates/password_reset2.tpl rename to WEB-INF/templates/password_reset.tpl diff --git a/WEB-INF/templates/plugins2.tpl b/WEB-INF/templates/plugins.tpl similarity index 100% rename from WEB-INF/templates/plugins2.tpl rename to WEB-INF/templates/plugins.tpl diff --git a/WEB-INF/templates/predefined_expense_add2.tpl b/WEB-INF/templates/predefined_expense_add.tpl similarity index 100% rename from WEB-INF/templates/predefined_expense_add2.tpl rename to WEB-INF/templates/predefined_expense_add.tpl diff --git a/WEB-INF/templates/predefined_expense_delete2.tpl b/WEB-INF/templates/predefined_expense_delete.tpl similarity index 100% rename from WEB-INF/templates/predefined_expense_delete2.tpl rename to WEB-INF/templates/predefined_expense_delete.tpl diff --git a/WEB-INF/templates/predefined_expense_edit2.tpl b/WEB-INF/templates/predefined_expense_edit.tpl similarity index 100% rename from WEB-INF/templates/predefined_expense_edit2.tpl rename to WEB-INF/templates/predefined_expense_edit.tpl diff --git a/WEB-INF/templates/predefined_expenses2.tpl b/WEB-INF/templates/predefined_expenses.tpl similarity index 100% rename from WEB-INF/templates/predefined_expenses2.tpl rename to WEB-INF/templates/predefined_expenses.tpl diff --git a/WEB-INF/templates/profile_edit2.tpl b/WEB-INF/templates/profile_edit.tpl similarity index 100% rename from WEB-INF/templates/profile_edit2.tpl rename to WEB-INF/templates/profile_edit.tpl diff --git a/WEB-INF/templates/project_add2.tpl b/WEB-INF/templates/project_add.tpl similarity index 100% rename from WEB-INF/templates/project_add2.tpl rename to WEB-INF/templates/project_add.tpl diff --git a/WEB-INF/templates/project_delete2.tpl b/WEB-INF/templates/project_delete.tpl similarity index 100% rename from WEB-INF/templates/project_delete2.tpl rename to WEB-INF/templates/project_delete.tpl diff --git a/WEB-INF/templates/project_edit2.tpl b/WEB-INF/templates/project_edit.tpl similarity index 100% rename from WEB-INF/templates/project_edit2.tpl rename to WEB-INF/templates/project_edit.tpl diff --git a/WEB-INF/templates/projects2.tpl b/WEB-INF/templates/projects.tpl similarity index 100% rename from WEB-INF/templates/projects2.tpl rename to WEB-INF/templates/projects.tpl diff --git a/initialize.php b/initialize.php index b2857f6e..691f66ed 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5545"); +define("APP_VERSION", "1.19.28.5546"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/password_change.php b/password_change.php index f501a78e..992bdd87 100644 --- a/password_change.php +++ b/password_change.php @@ -77,5 +77,5 @@ $smarty->assign('forms', array($form->getName() => $form->toArray())); $smarty->assign('title', $i18n->get('title.change_password')); -$smarty->assign('content_page_name', 'password_change2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'password_change.tpl'); +$smarty->display('index.tpl'); diff --git a/password_reset.php b/password_reset.php index a9dfd1f0..9645139e 100644 --- a/password_reset.php +++ b/password_reset.php @@ -106,5 +106,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.resetPasswordForm.login.focus()"'); $smarty->assign('title', $i18n->get('title.reset_password')); -$smarty->assign('content_page_name', 'password_reset2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'password_reset.tpl'); +$smarty->display('index.tpl'); diff --git a/plugins.php b/plugins.php index 730889bc..9b3bc1a2 100644 --- a/plugins.php +++ b/plugins.php @@ -141,5 +141,5 @@ $smarty->assign('onload', 'onLoad="handlePluginCheckboxes();"'); $smarty->assign('user_exists', $user->exists()); $smarty->assign('title', $i18n->get('title.plugins')); -$smarty->assign('content_page_name', 'plugins2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'plugins.tpl'); +$smarty->display('index.tpl'); diff --git a/predefined_expense_add.php b/predefined_expense_add.php index 8cac318f..08e395ce 100644 --- a/predefined_expense_add.php +++ b/predefined_expense_add.php @@ -45,5 +45,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.add_predefined_expense')); -$smarty->assign('content_page_name', 'predefined_expense_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'predefined_expense_add.tpl'); +$smarty->display('index.tpl'); diff --git a/predefined_expense_delete.php b/predefined_expense_delete.php index 26b726fc..e965b0be 100644 --- a/predefined_expense_delete.php +++ b/predefined_expense_delete.php @@ -48,5 +48,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.predefinedExpenseDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_predefined_expense')); -$smarty->assign('content_page_name', 'predefined_expense_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'predefined_expense_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/predefined_expense_edit.php b/predefined_expense_edit.php index d1b55755..8f475024 100644 --- a/predefined_expense_edit.php +++ b/predefined_expense_edit.php @@ -55,5 +55,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.edit_predefined_expense')); -$smarty->assign('content_page_name', 'predefined_expense_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'predefined_expense_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/predefined_expenses.php b/predefined_expenses.php index c44aee27..9f94bd1c 100644 --- a/predefined_expenses.php +++ b/predefined_expenses.php @@ -33,5 +33,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('predefined_expenses', $predefinedExpenses); $smarty->assign('title', $i18n->get('title.predefined_expenses')); -$smarty->assign('content_page_name', 'predefined_expenses2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'predefined_expenses.tpl'); +$smarty->display('index.tpl'); diff --git a/profile_edit.php b/profile_edit.php index f85473fe..a9f11fc2 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -87,5 +87,5 @@ $smarty->assign('auth_external', $auth->isPasswordExternal()); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.profile')); -$smarty->assign('content_page_name', 'profile_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'profile_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/project_add.php b/project_add.php index 16af7a8d..35b45c97 100644 --- a/project_add.php +++ b/project_add.php @@ -91,5 +91,5 @@ $smarty->assign('show_users', count($users) > 0); $smarty->assign('show_tasks', $show_tasks); $smarty->assign('title', $i18n->get('title.add_project')); -$smarty->assign('content_page_name', 'project_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'project_add.tpl'); +$smarty->display('index.tpl'); diff --git a/project_delete.php b/project_delete.php index 2d6ca289..4f4353b8 100644 --- a/project_delete.php +++ b/project_delete.php @@ -47,5 +47,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.projectDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_project')); -$smarty->assign('content_page_name', 'project_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'project_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/project_edit.php b/project_edit.php index cbb2c1f9..917b2e97 100644 --- a/project_edit.php +++ b/project_edit.php @@ -108,5 +108,5 @@ $smarty->assign('show_users', count($users) > 0); $smarty->assign('show_tasks', $show_tasks); $smarty->assign('title', $i18n->get('title.edit_project')); -$smarty->assign('content_page_name', 'project_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'project_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/projects.php b/projects.php index e9a0b5dc..ed4d371d 100644 --- a/projects.php +++ b/projects.php @@ -30,5 +30,5 @@ $smarty->assign('inactive_projects', $inactive_projects); $smarty->assign('show_files', $showFiles); $smarty->assign('title', $i18n->get('title.projects')); -$smarty->assign('content_page_name', 'projects2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'projects.tpl'); +$smarty->display('index.tpl'); From 339fea0fc8c13ba9ad30064f9d255b10761184b3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 18:20:47 +0000 Subject: [PATCH 017/304] Finished renaming template files. --- WEB-INF/templates/index2.tpl | 5 ----- WEB-INF/templates/{invoice_add2.tpl => invoice_add.tpl} | 0 .../templates/{invoice_delete2.tpl => invoice_delete.tpl} | 0 WEB-INF/templates/{invoice_view2.tpl => invoice_view.tpl} | 0 WEB-INF/templates/{invoices2.tpl => invoices.tpl} | 0 WEB-INF/templates/{locking2.tpl => locking.tpl} | 0 WEB-INF/templates/{login.db2.tpl => login.db.tpl} | 0 WEB-INF/templates/{login.ldap2.tpl => login.ldap.tpl} | 0 WEB-INF/templates/{login2.tpl => login.tpl} | 2 +- WEB-INF/templates/{mail2.tpl => mail.tpl} | 0 .../{notification_add2.tpl => notification_add.tpl} | 0 .../{notification_delete2.tpl => notification_delete.tpl} | 0 .../{notification_edit2.tpl => notification_edit.tpl} | 0 WEB-INF/templates/{notifications2.tpl => notifications.tpl} | 0 initialize.php | 2 +- invoice_add.php | 4 ++-- invoice_delete.php | 4 ++-- invoice_send.php | 4 ++-- invoice_view.php | 4 ++-- invoices.php | 4 ++-- locking.php | 4 ++-- login.php | 6 +++--- notification_add.php | 4 ++-- notification_delete.php | 4 ++-- notification_edit.php | 4 ++-- notifications.php | 4 ++-- report_send.php | 4 ++-- site_map.php | 2 +- 28 files changed, 28 insertions(+), 33 deletions(-) delete mode 100644 WEB-INF/templates/index2.tpl rename WEB-INF/templates/{invoice_add2.tpl => invoice_add.tpl} (100%) rename WEB-INF/templates/{invoice_delete2.tpl => invoice_delete.tpl} (100%) rename WEB-INF/templates/{invoice_view2.tpl => invoice_view.tpl} (100%) rename WEB-INF/templates/{invoices2.tpl => invoices.tpl} (100%) rename WEB-INF/templates/{locking2.tpl => locking.tpl} (100%) rename WEB-INF/templates/{login.db2.tpl => login.db.tpl} (100%) rename WEB-INF/templates/{login.ldap2.tpl => login.ldap.tpl} (100%) rename WEB-INF/templates/{login2.tpl => login.tpl} (85%) rename WEB-INF/templates/{mail2.tpl => mail.tpl} (100%) rename WEB-INF/templates/{notification_add2.tpl => notification_add.tpl} (100%) rename WEB-INF/templates/{notification_delete2.tpl => notification_delete.tpl} (100%) rename WEB-INF/templates/{notification_edit2.tpl => notification_edit.tpl} (100%) rename WEB-INF/templates/{notifications2.tpl => notifications.tpl} (100%) diff --git a/WEB-INF/templates/index2.tpl b/WEB-INF/templates/index2.tpl deleted file mode 100644 index 75a751e0..00000000 --- a/WEB-INF/templates/index2.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{include file="header.tpl"} - -{if $content_page_name}{include file="$content_page_name"}{/if} - -{include file="footer.tpl"} diff --git a/WEB-INF/templates/invoice_add2.tpl b/WEB-INF/templates/invoice_add.tpl similarity index 100% rename from WEB-INF/templates/invoice_add2.tpl rename to WEB-INF/templates/invoice_add.tpl diff --git a/WEB-INF/templates/invoice_delete2.tpl b/WEB-INF/templates/invoice_delete.tpl similarity index 100% rename from WEB-INF/templates/invoice_delete2.tpl rename to WEB-INF/templates/invoice_delete.tpl diff --git a/WEB-INF/templates/invoice_view2.tpl b/WEB-INF/templates/invoice_view.tpl similarity index 100% rename from WEB-INF/templates/invoice_view2.tpl rename to WEB-INF/templates/invoice_view.tpl diff --git a/WEB-INF/templates/invoices2.tpl b/WEB-INF/templates/invoices.tpl similarity index 100% rename from WEB-INF/templates/invoices2.tpl rename to WEB-INF/templates/invoices.tpl diff --git a/WEB-INF/templates/locking2.tpl b/WEB-INF/templates/locking.tpl similarity index 100% rename from WEB-INF/templates/locking2.tpl rename to WEB-INF/templates/locking.tpl diff --git a/WEB-INF/templates/login.db2.tpl b/WEB-INF/templates/login.db.tpl similarity index 100% rename from WEB-INF/templates/login.db2.tpl rename to WEB-INF/templates/login.db.tpl diff --git a/WEB-INF/templates/login.ldap2.tpl b/WEB-INF/templates/login.ldap.tpl similarity index 100% rename from WEB-INF/templates/login.ldap2.tpl rename to WEB-INF/templates/login.ldap.tpl diff --git a/WEB-INF/templates/login2.tpl b/WEB-INF/templates/login.tpl similarity index 85% rename from WEB-INF/templates/login2.tpl rename to WEB-INF/templates/login.tpl index 755763c3..e6a8a4ed 100644 --- a/WEB-INF/templates/login2.tpl +++ b/WEB-INF/templates/login.tpl @@ -9,7 +9,7 @@ function get_date() { {$forms.loginForm.open} -{include file="login.`$smarty.const.AUTH_MODULE`2.tpl"} +{include file="login.`$smarty.const.AUTH_MODULE`.tpl"} {$forms.loginForm.close} {if !empty($about_text)} diff --git a/WEB-INF/templates/mail2.tpl b/WEB-INF/templates/mail.tpl similarity index 100% rename from WEB-INF/templates/mail2.tpl rename to WEB-INF/templates/mail.tpl diff --git a/WEB-INF/templates/notification_add2.tpl b/WEB-INF/templates/notification_add.tpl similarity index 100% rename from WEB-INF/templates/notification_add2.tpl rename to WEB-INF/templates/notification_add.tpl diff --git a/WEB-INF/templates/notification_delete2.tpl b/WEB-INF/templates/notification_delete.tpl similarity index 100% rename from WEB-INF/templates/notification_delete2.tpl rename to WEB-INF/templates/notification_delete.tpl diff --git a/WEB-INF/templates/notification_edit2.tpl b/WEB-INF/templates/notification_edit.tpl similarity index 100% rename from WEB-INF/templates/notification_edit2.tpl rename to WEB-INF/templates/notification_edit.tpl diff --git a/WEB-INF/templates/notifications2.tpl b/WEB-INF/templates/notifications.tpl similarity index 100% rename from WEB-INF/templates/notifications2.tpl rename to WEB-INF/templates/notifications.tpl diff --git a/initialize.php b/initialize.php index 691f66ed..0df7d7ec 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5546"); +define("APP_VERSION", "1.19.28.5547"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/invoice_add.php b/invoice_add.php index bc337a00..e7018f00 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -80,5 +80,5 @@ $smarty->assign('onload', 'onLoad="document.invoiceForm.number.focus()"'); $smarty->assign('show_project', $show_project); $smarty->assign('title', $i18n->get('title.add_invoice')); -$smarty->assign('content_page_name', 'invoice_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'invoice_add.tpl'); +$smarty->display('index.tpl'); diff --git a/invoice_delete.php b/invoice_delete.php index 7e80b126..5b473dfa 100644 --- a/invoice_delete.php +++ b/invoice_delete.php @@ -51,5 +51,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.invoiceDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_invoice')); -$smarty->assign('content_page_name', 'invoice_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'invoice_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/invoice_send.php b/invoice_send.php index c3126eb9..5483a09b 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -80,5 +80,5 @@ $smarty->assign('title', $i18n->get('title.send_invoice')); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"'); -$smarty->assign('content_page_name', 'mail2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'mail.tpl'); +$smarty->display('index.tpl'); diff --git a/invoice_view.php b/invoice_view.php index 621ae4a0..b03b719e 100644 --- a/invoice_view.php +++ b/invoice_view.php @@ -107,5 +107,5 @@ $smarty->assign('invoice_items', $invoice_items); $smarty->assign('colspan', $colspan); $smarty->assign('title', $i18n->get('title.view_invoice')); -$smarty->assign('content_page_name', 'invoice_view2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'invoice_view.tpl'); +$smarty->display('index.tpl'); diff --git a/invoices.php b/invoices.php index bbca99cc..3f6438b9 100644 --- a/invoices.php +++ b/invoices.php @@ -90,5 +90,5 @@ $smarty->assign('show_sorting_options', count($invoices) > 1); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.invoices')); -$smarty->assign('content_page_name', 'invoices2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'invoices.tpl'); +$smarty->display('index.tpl'); diff --git a/locking.php b/locking.php index 5277ec90..04c8d941 100644 --- a/locking.php +++ b/locking.php @@ -37,5 +37,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.locking')); -$smarty->assign('content_page_name', 'locking2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'locking.tpl'); +$smarty->display('index.tpl'); diff --git a/login.php b/login.php index 31d7f6d1..09c7af14 100644 --- a/login.php +++ b/login.php @@ -60,7 +60,7 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_hint', $show_hint); $smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"'); -$smarty->assign('title', $i18n->get('title.login')); -$smarty->assign('content_page_name', 'login2.tpl'); $smarty->assign('about_text', $i18n->get('form.login.about')); -$smarty->display('index2.tpl'); +$smarty->assign('title', $i18n->get('title.login')); +$smarty->assign('content_page_name', 'login.tpl'); +$smarty->display('index.tpl'); diff --git a/notification_add.php b/notification_add.php index 1290bfa2..99602fe5 100644 --- a/notification_add.php +++ b/notification_add.php @@ -95,5 +95,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.add_notification')); -$smarty->assign('content_page_name', 'notification_add2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'notification_add.tpl'); +$smarty->display('index.tpl'); diff --git a/notification_delete.php b/notification_delete.php index 741826c0..93820427 100644 --- a/notification_delete.php +++ b/notification_delete.php @@ -51,5 +51,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.notificationDeleteForm.btn_cancel.focus()"'); $smarty->assign('title', $i18n->get('title.delete_notification')); -$smarty->assign('content_page_name', 'notification_delete2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'notification_delete.tpl'); +$smarty->display('index.tpl'); diff --git a/notification_edit.php b/notification_edit.php index 43dbabcf..164127e9 100644 --- a/notification_edit.php +++ b/notification_edit.php @@ -106,5 +106,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('title', $i18n->get('title.edit_notification')); -$smarty->assign('content_page_name', 'notification_edit2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'notification_edit.tpl'); +$smarty->display('index.tpl'); diff --git a/notifications.php b/notifications.php index 23d1feb1..5945320e 100644 --- a/notifications.php +++ b/notifications.php @@ -40,5 +40,5 @@ $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('notifications', $notifications); $smarty->assign('title', $i18n->get('title.notifications')); -$smarty->assign('content_page_name', 'notifications2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'notifications.tpl'); +$smarty->display('index.tpl'); diff --git a/report_send.php b/report_send.php index 67e7136c..b20dd6df 100644 --- a/report_send.php +++ b/report_send.php @@ -74,5 +74,5 @@ $smarty->assign('title', $i18n->get('title.send_report')); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.mailForm.'.($cl_receiver?'comment':'receiver').'.focus()"'); -$smarty->assign('content_page_name', 'mail2.tpl'); -$smarty->display('index2.tpl'); +$smarty->assign('content_page_name', 'mail.tpl'); +$smarty->display('index.tpl'); diff --git a/site_map.php b/site_map.php index 56a79511..11695f78 100644 --- a/site_map.php +++ b/site_map.php @@ -14,4 +14,4 @@ // $smarty->assign('title', $i18n->get('form.label.menu')); $smarty->assign('content_page_name', 'site_map.tpl'); -$smarty->display('index2.tpl'); +$smarty->display('index.tpl'); From dc81e09a376196a503bc9ce0c6a0540b3721985f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 10 May 2021 18:31:47 +0000 Subject: [PATCH 018/304] Addressed a php warning. --- initialize.php | 2 +- reports.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/initialize.php b/initialize.php index 0df7d7ec..daa1667a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5547"); +define("APP_VERSION", "1.19.28.5548"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index 059c7d90..b7170622 100644 --- a/reports.php +++ b/reports.php @@ -167,7 +167,7 @@ // Add user table. $showUsers = $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient(); -$user_list = array(); +$user_list = $user_list_active = $user_list_inactive = array(); if ($showUsers) { // Prepare user and assigned projects arrays. if ($user->can('view_reports') || $user->can('view_all_reports')) { @@ -206,7 +206,6 @@ 'layout'=>'V', 'groupin'=>$row_count)); - $user_list_inactive = array(); foreach ($inactive_users as $single_user) { $user_list_inactive[$single_user['id']] = $single_user['name']; $projects = ttProjectHelper::getAssignedProjects($single_user['id']); From 49e89ce143d21f13c22919bdd8a168db25ec12f8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 11 May 2021 13:02:46 +0000 Subject: [PATCH 019/304] Added a what is it link explaning delete invoice entries option. --- WEB-INF/templates/invoice_delete.tpl | 5 ++++- initialize.php | 2 +- site_map.php | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/invoice_delete.tpl b/WEB-INF/templates/invoice_delete.tpl index 6fb7cb6c..951e5e81 100644 --- a/WEB-INF/templates/invoice_delete.tpl +++ b/WEB-INF/templates/invoice_delete.tpl @@ -23,7 +23,10 @@ License: See license.txt *} - {$forms.invoiceDeleteForm.delete_invoice_entries.control} + {$forms.invoiceDeleteForm.delete_invoice_entries.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} +
diff --git a/initialize.php b/initialize.php index daa1667a..90c7b309 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5548"); +define("APP_VERSION", "1.19.28.5549"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/site_map.php b/site_map.php index 11695f78..f769edd7 100644 --- a/site_map.php +++ b/site_map.php @@ -12,6 +12,5 @@ global $auth; $authenticated = $auth->isAuthenticated(); // This call assigns 'authenticated' to smarty. -// $smarty->assign('title', $i18n->get('form.label.menu')); $smarty->assign('content_page_name', 'site_map.tpl'); $smarty->display('index.tpl'); From b141c562ab1802dc2a3c20a68d2d7254f4bc5def Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 14 May 2021 14:12:52 +0000 Subject: [PATCH 020/304] Fixed presentation issue on the login page. --- default.css | 2 -- initialize.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/default.css b/default.css index e04cab3d..956c35ed 100644 --- a/default.css +++ b/default.css @@ -799,8 +799,6 @@ input[type=checkbox], label { div.table-divider { height: 30px; } -div#LoginAboutText { width: 400px; } - .uncompleted-entry { display: inline-block; height: 8px; diff --git a/initialize.php b/initialize.php index 90c7b309..9c2bae6f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5549"); +define("APP_VERSION", "1.19.28.5550"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 3a89ce9194bd0a38a4a9a854844455367390a72f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 14 May 2021 23:45:36 +0000 Subject: [PATCH 021/304] Removed no longer needed NOTE_INPUT_HEIGHT from config.php.dist. --- WEB-INF/config.php.dist | 2 -- initialize.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/WEB-INF/config.php.dist b/WEB-INF/config.php.dist index bbf647ce..9d9d90df 100644 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@ -176,8 +176,6 @@ define('AUTH_MODULE', 'db'); // define('MONTHLY_QUOTA_YEAR_START', 2010); // If nothing is specified, it falls back to 2015. // define('MONTHLY_QUOTA_YEAR_END', 2025); // If nothing is specified, it falls back to 2030. -// Height in pixels for the note input field in time.php. Defaults to 40. -// define('NOTE_INPUT_HEIGHT', 100); // A comma-separated list of default plugins for new group registrations. // Example below enables charts and attachments. diff --git a/initialize.php b/initialize.php index 9c2bae6f..2942020c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5550"); +define("APP_VERSION", "1.19.28.5551"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bc04705f7a876c73a68c49a4513acbf161e8741f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 15 May 2021 13:27:55 +0000 Subject: [PATCH 022/304] Introduced a what is it link explaining custom CSS in display options. --- WEB-INF/templates/display_options.tpl | 1 + initialize.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index e4da2cfa..8c9db8ea 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -45,6 +45,7 @@ License: See license.txt *}
{$i18n.form.display_options.custom_css} {$forms.displayOptionsForm.custom_css.control} + {$i18n.label.what_is_it}
{$forms.displayOptionsForm.btn_save.control}
diff --git a/initialize.php b/initialize.php index 2942020c..dca1b42e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5551"); +define("APP_VERSION", "1.19.28.5552"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From beec12ef1f35549ab44b3f19a3ed5cf4785e0446 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 15 May 2021 14:54:33 +0000 Subject: [PATCH 023/304] Addressed a couple of php8 warnings. --- WEB-INF/lib/ttWeekViewHelper.class.php | 10 ++++++---- initialize.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index 55e40dc1..42167631 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -406,8 +406,9 @@ static function getLockedDaysForWeek($start_date) { static function makeRowIdentifier($record) { global $user; // Start with client. + $row_identifier = ''; if ($user->isPluginEnabled('cl')) - $row_identifier = $record['client_id'] ? 'cl:'.$record['client_id'] : ''; + $row_identifier .= $record['client_id'] ? 'cl:'.$record['client_id'] : ''; // Add billable flag. if (!empty($row_identifier)) $row_identifier .= ','; $row_identifier .= 'bl:'.$record['billable']; @@ -417,7 +418,7 @@ static function makeRowIdentifier($record) { $row_identifier .= $record['task_id'] ? ',ts:'.$record['task_id'] : ''; // Add custom field parts. global $custom_fields; - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; if ($timeField['type'] == CustomFields::TYPE_TEXT) @@ -438,8 +439,9 @@ static function makeRowIdentifier($record) { static function makeRowLabel($record) { global $user; // Start with client. + $label = ''; if ($user->isPluginEnabled('cl')) - $label = $record['client']; + $label .= $record['client']; // Add project. if (!empty($label) && !empty($record['project'])) $label .= ' - '; @@ -451,7 +453,7 @@ static function makeRowLabel($record) { // Add custom field parts. global $custom_fields; - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $field_value = $record[$field_name]; diff --git a/initialize.php b/initialize.php index dca1b42e..d3b1ff26 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5552"); +define("APP_VERSION", "1.19.28.5553"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ecb2c17d8d2f482f0112915c82ed7fbd69460479 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 15 May 2021 17:16:41 +0000 Subject: [PATCH 024/304] Improved week view by remembering custom fields and also printing them when configured to do so. --- WEB-INF/templates/week.tpl | 12 ++++++++++++ initialize.php | 2 +- week.php | 24 +++++++++++++----------- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 99da5ef4..42fa0b34 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -101,6 +101,11 @@ function fillDropdowns() { + {if $show_record_custom_fields && isset($custom_fields) && $custom_fields->timeFields} + {foreach $custom_fields->timeFields as $timeField} + + {/foreach} + {/if} {if $show_client} {/if} @@ -125,6 +130,13 @@ function fillDropdowns() { {foreach $time_records as $record} + {* record custom fileds *} + {if $show_record_custom_fields && isset($custom_fields) && $custom_fields->timeFields} + {foreach $custom_fields->timeFields as $timeField} + {assign var="control_name" value='time_field_'|cat:$timeField['id']} + + {/foreach} + {/if} {if $show_client} {/if} diff --git a/initialize.php b/initialize.php index d3b1ff26..f1c0f038 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5553"); +define("APP_VERSION", "1.19.28.5554"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index 6a2a25e2..7687f959 100644 --- a/week.php +++ b/week.php @@ -62,6 +62,7 @@ $recordType = $user->getRecordType(); $showStart = TYPE_START_FINISH == $recordType || TYPE_ALL == $recordType; $showFiles = $user->isPluginEnabled('at'); +$showRecordCustomFields = $user->isOptionEnabled('record_custom_fields'); // Initialize and store date in session. $cl_date = $request->getParameter('date', @$_SESSION['date']); @@ -127,17 +128,17 @@ $timeCustomFields = array(); // If we have time custom fields - collect input. -if ($request->isPost()) { - if (isset($custom_fields) && $custom_fields->timeFields) { - foreach ($custom_fields->timeFields as $timeField) { - $control_name = 'time_field_'.$timeField['id']; - $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], - 'control_name' => $control_name, - 'label' => $timeField['label'], - 'type' => $timeField['type'], - 'required' => $timeField['required'], - 'value' => trim($request->getParameter($control_name))); - } +if (isset($custom_fields) && $custom_fields->timeFields) { + foreach ($custom_fields->timeFields as $timeField) { + $control_name = 'time_field_'.$timeField['id']; + $cl_control_name = $request->getParameter($control_name, ($request->isPost() ? null : @$_SESSION[$control_name])); + $_SESSION[$control_name] = $cl_control_name; + $timeCustomFields[$timeField['id']] = array('field_id' => $timeField['id'], + 'control_name' => $control_name, + 'label' => $timeField['label'], + 'type' => $timeField['type'], + 'required' => $timeField['required'], + 'value' => trim($cl_control_name)); } } @@ -548,6 +549,7 @@ function render(&$table, $value, $row, $column, $selected = false) { $smarty->assign('onload', 'onLoad="fillDropdowns()"'); $smarty->assign('timestring', $startDate->toString($user->date_format).' - '.$endDate->toString($user->date_format)); $smarty->assign('time_records', $records); +$smarty->assign('show_record_custom_fields', $showRecordCustomFields); $smarty->assign('show_navigation', !$user->isOptionEnabled('week_menu')); $smarty->assign('show_client', $showClient); $smarty->assign('show_billable', $showBillable); From bddfeb53d64046ea825477adf6d5a3dcaedac9d2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 15 May 2021 18:00:48 +0000 Subject: [PATCH 025/304] Renamed timer.php to puncher.php to implement it as a plugin. --- WEB-INF/templates/{timer.tpl => puncher.tpl} | 0 initialize.php | 2 +- timer.php => puncher.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename WEB-INF/templates/{timer.tpl => puncher.tpl} (100%) rename timer.php => puncher.php (99%) diff --git a/WEB-INF/templates/timer.tpl b/WEB-INF/templates/puncher.tpl similarity index 100% rename from WEB-INF/templates/timer.tpl rename to WEB-INF/templates/puncher.tpl diff --git a/initialize.php b/initialize.php index f1c0f038..2ffd096f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5554"); +define("APP_VERSION", "1.19.28.5555"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/timer.php b/puncher.php similarity index 99% rename from timer.php rename to puncher.php index cd0081f3..56292a57 100644 --- a/timer.php +++ b/puncher.php @@ -307,5 +307,5 @@ $smarty->assign('onload', 'onLoad="fillDropdowns()"'); $smarty->assign('timestring', $selected_date->toString($user->date_format)); $smarty->assign('title', $i18n->get('title.time')); -$smarty->assign('content_page_name', 'timer.tpl'); +$smarty->assign('content_page_name', 'puncher.tpl'); $smarty->display('index.tpl'); From 565b05d323a8983beda56447f82fc6586cd00a69 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 16 May 2021 14:35:08 +0000 Subject: [PATCH 026/304] Implemented puncher page as a plugin. --- WEB-INF/resources/ca.lang.php | 1 - WEB-INF/resources/cs.lang.php | 1 - WEB-INF/resources/da.lang.php | 1 - WEB-INF/resources/de.lang.php | 1 - WEB-INF/resources/en.lang.php | 4 +++- WEB-INF/resources/es.lang.php | 1 - WEB-INF/resources/et.lang.php | 2 -- WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/gr.lang.php | 2 -- WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/hu.lang.php | 1 - WEB-INF/resources/it.lang.php | 2 -- WEB-INF/resources/ja.lang.php | 1 - WEB-INF/resources/ko.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/no.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/pt-br.lang.php | 1 - WEB-INF/resources/pt.lang.php | 1 - WEB-INF/resources/ro.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sl.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/resources/sv.lang.php | 1 - WEB-INF/resources/tr.lang.php | 1 - WEB-INF/resources/zh-cn.lang.php | 1 - WEB-INF/resources/zh-tw.lang.php | 1 - WEB-INF/templates/header.tpl | 3 +++ WEB-INF/templates/plugins.tpl | 20 ++++++++++++++-- WEB-INF/templates/puncher_conf.tpl | 17 ++++++++++++++ WEB-INF/templates/time.tpl | 4 +++- WEB-INF/templates/week_view.tpl | 4 ++-- initialize.php | 2 +- plugins.php | 5 ++++ puncher.php | 6 ++--- puncher_conf.php | 37 ++++++++++++++++++++++++++++++ time.php | 4 +++- 40 files changed, 95 insertions(+), 43 deletions(-) create mode 100644 WEB-INF/templates/puncher_conf.tpl create mode 100644 puncher_conf.php diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 34421e73..5d115f9c 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -240,7 +240,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 199a96fa..99d24e05 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -250,7 +250,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index efdacc37..567310f3 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -231,7 +231,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index e41d92b0..9c2a35c2 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -222,7 +222,6 @@ 'label.paid_status' => 'Bezahlstatus', 'label.paid' => 'Bezahlt', 'label.mark_paid' => 'Als bezahlt setzen', -'label.week_menu' => 'Wochenansicht im Menü', 'label.week_note' => 'Wochennotiz', 'label.week_list' => 'Wochenliste', 'label.work_units' => 'Arbeitseinheiten', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 37aae4ca..1733fe48 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -24,6 +24,7 @@ 'menu.subgroups' => 'Subgroups', 'menu.plugins' => 'Plugins', 'menu.time' => 'Time', +'menu.puncher' => 'Punch', 'menu.week' => 'Week', 'menu.expenses' => 'Expenses', 'menu.reports' => 'Reports', @@ -173,6 +174,7 @@ 'label.select_none' => 'Deselect all', 'label.day_view' => 'Day view', 'label.week_view' => 'Week view', +'label.puncher' => 'Puncher', 'label.id' => 'ID', 'label.language' => 'Language', 'label.decimal_mark' => 'Decimal mark', @@ -215,7 +217,6 @@ 'label.paid_status' => 'Paid status', 'label.paid' => 'Paid', 'label.mark_paid' => 'Mark paid', -'label.week_menu' => 'Week menu', 'label.week_note' => 'Week note', 'label.week_list' => 'Week list', 'label.work_units' => 'Work units', @@ -269,6 +270,7 @@ 'title.edit_time_record' => 'Editing Time Record', 'title.delete_time_record' => 'Deleting Time Record', 'title.time_files' => 'Time Record Files', +'title.puncher' => 'Puncher', 'title.expenses' => 'Expenses', 'title.edit_expense' => 'Editing Expense Item', 'title.delete_expense' => 'Deleting Expense Item', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 9df81484..e8757a7f 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -243,7 +243,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 7638ade6..1bd5ff23 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -238,8 +238,6 @@ 'label.paid_status' => 'Makse olek', 'label.paid' => 'Makstud', 'label.mark_paid' => 'Märgi makstuks', -// TODO: translate the following. -// 'label.week_menu' => 'Week menu', 'label.week_note' => 'Nädala märge', 'label.week_list' => 'Nädala nimekiri', 'label.work_units' => 'Töö ühikud', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 0fca3458..96c46186 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -243,7 +243,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index eaad8a29..80220a61 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -235,7 +235,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 771ed18e..5c11e422 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -229,7 +229,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index e9003045..a5490a59 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -223,8 +223,6 @@ 'label.paid_status' => 'Κατάσταση πληρωμής', 'label.paid' => 'Πληρωμένο', 'label.mark_paid' => 'Σήμανση πληρωμένα', -// TODO: translate the following. -// 'label.week_menu' => 'Week menu', 'label.week_note' => 'Σημείωση εβδομάδας', 'label.week_list' => 'Λίστα εβδομάδων', // TODO: translate the following. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 032e01bf..6112f1f0 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -250,7 +250,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 1909682f..7425cc9a 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -247,7 +247,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 35035d3e..3aeb88a8 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -227,8 +227,6 @@ 'label.paid_status' => 'Stato pagamento', 'label.paid' => 'Pagato', 'label.mark_paid' => 'Segna come pagato', -// TODO: translate the following. -// 'label.week_menu' => 'Week menu', 'label.week_note' => 'Nota settimanale', 'label.week_list' => 'Lista settimanale', // TODO: translate the following. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 0ba848ba..c98730d9 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -250,7 +250,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 975e4216..d7edcbf4 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -250,7 +250,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 70750349..4580c677 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -206,7 +206,6 @@ 'label.paid_status' => 'Status van betaling', 'label.paid' => 'Betaald', 'label.mark_paid' => 'Markeer als betaald', -'label.week_menu' => 'Week menu', 'label.week_note' => 'Week aantekening', 'label.week_list' => 'Week overzicht', 'label.work_units' => 'Werk eenheid', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index cfaf305b..f7e0240d 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -248,7 +248,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 24664d69..e2cb857e 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -236,7 +236,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index e41cf26c..bf89e0c2 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -233,7 +233,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 13912a44..1ff1bf99 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -236,7 +236,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 0c531ad1..60d9b1a3 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -247,7 +247,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index db94bf68..82cbce9d 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -206,7 +206,6 @@ 'label.paid_status' => 'Статус оплаты', 'label.paid' => 'Оплачено', 'label.mark_paid' => 'Отметить оплату', -'label.week_menu' => 'Меню недели', 'label.week_note' => 'Комментарий недели', 'label.week_list' => 'Список недели', 'label.work_units' => 'Единицы работы', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 57c14a7d..a24317b9 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -240,7 +240,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 32e200f8..65a3d0a0 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -231,7 +231,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 38cf8565..7be8bd4f 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -235,7 +235,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index fe05e89a..8bab1c08 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -231,7 +231,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 777440e8..61472bf9 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -254,7 +254,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 01e639bd..129e2115 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -241,7 +241,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 66dc7099..19e8800d 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -246,7 +246,6 @@ // 'label.paid_status' => 'Paid status', // 'label.paid' => 'Paid', // 'label.mark_paid' => 'Mark paid', -// 'label.week_menu' => 'Week menu', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', // 'label.work_units' => 'Work units', diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 1d8627a6..e7df23ea 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -98,6 +98,9 @@ {if $user->exists() && ($user->can('track_own_time') || $user->can('track_time'))} + {if $user->isPluginEnabled('pu') && $user->isOptionEnabled('puncher_menu')} + + {/if} {if $user->isPluginEnabled('wv') && $user->isOptionEnabled('week_menu')} {/if} diff --git a/WEB-INF/templates/plugins.tpl b/WEB-INF/templates/plugins.tpl index 370c93c5..5c1e4c94 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -4,6 +4,17 @@ License: See license.txt *} +{$forms.timesheetsForm.open}
{$i18n.label.date}{$timeField['label']|escape}{$i18n.label.client}
{$record.date}{$record.$control_name|escape}{$record.client|escape}
{$i18n.menu.time}{$i18n.menu.puncher}{$i18n.menu.week}
{if $user_dropdown} - {$forms.timesheetsForm.open} - {$forms.timesheetsForm.close} {/if}
{$forms.timesheetsForm.user.control}
+{$forms.timesheetsForm.close}
{if $inactive_timesheets}
{$i18n.form.timesheets.active_timesheets}
@@ -27,8 +27,8 @@ License: See license.txt *} {if $show_client} {$i18n.label.client} {/if} - {$i18n.label.submitted} - {$i18n.label.approved} + {$i18n.label.submitted} + {$i18n.label.approved} {if $show_files} {/if} @@ -68,8 +68,8 @@ License: See license.txt *} {if $show_client} {$i18n.label.client} {/if} - {$i18n.label.submitted} - {$i18n.label.approved} + {$i18n.label.submitted} + {$i18n.label.approved} {if $show_files} {/if} diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 42fa0b34..41568f60 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -195,4 +195,5 @@ function fillDropdowns() { {/if} +
{/if} diff --git a/WEB-INF/templates/work/footer.tpl b/WEB-INF/templates/work/footer_old.tpl similarity index 100% rename from WEB-INF/templates/work/footer.tpl rename to WEB-INF/templates/work/footer_old.tpl diff --git a/WEB-INF/templates/work/index.tpl b/WEB-INF/templates/work/index.tpl index 3c650082..c4f19352 100644 --- a/WEB-INF/templates/work/index.tpl +++ b/WEB-INF/templates/work/index.tpl @@ -2,4 +2,4 @@ {if $content_page_name}{include file="$content_page_name"}{/if} -{include file="work/footer.tpl"} +{include file="work/footer_old.tpl"} diff --git a/initialize.php b/initialize.php index a1be5736..666e412c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5570"); +define("APP_VERSION", "1.19.28.5571"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/template_add.php b/template_add.php index cb84fb33..8eef424e 100644 --- a/template_add.php +++ b/template_add.php @@ -19,9 +19,11 @@ $config = new ttConfigHelper($user->getConfig()); $bindTemplatesWithProjects = $config->getDefinedValue('bind_templates_with_projects'); +$projects = $cl_projects = array(); if ($bindTemplatesWithProjects) $projects = ttGroupHelper::getActiveProjects(); +$cl_name = $cl_description = $cl_content = null; if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); $cl_description = trim($request->getParameter('description')); diff --git a/template_edit.php b/template_edit.php index 814eff59..2f3c6972 100644 --- a/template_edit.php +++ b/template_edit.php @@ -25,9 +25,11 @@ $config = $user->getConfigHelper(); $bindTemplatesWithProjects = $config->getDefinedValue('bind_templates_with_projects'); +$projects = $cl_projects = array(); if ($bindTemplatesWithProjects) $projects = ttGroupHelper::getActiveProjects(); +$cl_name = $cl_description = $cl_content = $cl_status = null; if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); $cl_description = trim($request->getParameter('description')); diff --git a/timesheet_files.php b/timesheet_files.php index bca00f28..bec4e29d 100644 --- a/timesheet_files.php +++ b/timesheet_files.php @@ -24,6 +24,7 @@ } // End of access checks. +$cl_description = null; if ($request->isPost()) { $cl_description = trim($request->getParameter('description')); } From 8f576b10e996d468d28febf8767d0bc95b824421 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 18 May 2021 22:20:28 +0000 Subject: [PATCH 043/304] Addressed several more php8 warnings. --- WEB-INF/lib/ttFavReportHelper.class.php | 12 ++++----- WEB-INF/lib/ttRoleHelper.class.php | 33 ++++--------------------- initialize.php | 2 +- role_add.php | 1 + topdf.php | 21 ++++++++-------- 5 files changed, 24 insertions(+), 45 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index b4f917a4..d1cce724 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -399,7 +399,7 @@ static function loadReport(&$bean) { 'chtotalsonly' => null, 'new_fav_report' => null)); // Time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_field_name = 'show_'.$field_name; @@ -408,7 +408,7 @@ static function loadReport(&$bean) { } } // User custom fields. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_field_name = 'show_'.$field_name; @@ -416,7 +416,7 @@ static function loadReport(&$bean) { $custom_field_attrs[$checkbox_field_name] = null; } } - if (is_array($custom_field_attrs)) + if (isset($custom_field_attrs)) $attrs = array_merge($attrs, $custom_field_attrs); $bean->setAttributes($attrs); } @@ -543,7 +543,7 @@ static function makeReportSpec($bean) { } // Add time custom field settings. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $field_value = str_replace(',',',',$bean->getAttribute($field_name)); @@ -555,7 +555,7 @@ static function makeReportSpec($bean) { } // Add user custom field settings. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $field_value = str_replace(',',',',$bean->getAttribute($field_name)); @@ -567,7 +567,7 @@ static function makeReportSpec($bean) { } $reportSpec = null; - if (is_array($reportSpecArray)) + if (isset($reportSpecArray)) $reportSpec = implode(',', $reportSpecArray); return $reportSpec; } diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index a3753d23..683f7eba 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -1,30 +1,6 @@ fetchRow(); - if ($val['id']) + if (isset($val['id']) && $val['id']) return $val; } return false; @@ -115,7 +91,7 @@ static function getRoleByRank($rank) { if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); - if ($val['id']) + if (isset($val['id']) && $val['id']) return $val['id']; } return false; @@ -130,6 +106,7 @@ static function update($fields) { $org_id = $user->org_id; $id = (int)$fields['id']; + $name_part = $rank_part = $descr_part = $status_part = $rights_part = ''; if (isset($fields['name'])) $name_part = 'name = '.$mdb2->quote($fields['name']); if (isset($fields['rank'])) $rank_part = ', `rank` = '.(int)$fields['rank']; if (isset($fields['description'])) $descr_part = ', description = '.$mdb2->quote($fields['description']); diff --git a/initialize.php b/initialize.php index 666e412c..2493a215 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5571"); +define("APP_VERSION", "1.19.28.5572"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/role_add.php b/role_add.php index b2879dd8..b4e05f90 100644 --- a/role_add.php +++ b/role_add.php @@ -12,6 +12,7 @@ exit(); } +$cl_name = $cl_description = $cl_rank = null; if ($request->isPost()) { $cl_name = trim($request->getParameter('name')); $cl_description = trim($request->getParameter('description')); diff --git a/topdf.php b/topdf.php index aa840e10..85ff8d84 100644 --- a/topdf.php +++ b/topdf.php @@ -46,6 +46,7 @@ // Obtain items for report. $options = ttReportHelper::getReportOptions($bean); $grouping = ttReportHelper::grouping($options); +$items = null; if (!$totals_only) $items = ttReportHelper::getItems($options); // Individual entries. if ($totals_only || $grouping) @@ -128,7 +129,7 @@ $html .= ''.$i18n->get('label.date').''; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) { $colspan++; $html .= ''.$i18n->get('label.user').''; } // User custom field labels. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -139,7 +140,7 @@ if ($bean->getAttribute('chproject')) { $colspan++; $html .= ''.$i18n->get('label.project').''; } if ($bean->getAttribute('chtask')) { $colspan++; $html .= ''.$i18n->get('label.task').''; } // Time custom field labels. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -174,7 +175,7 @@ $html .= ''; } // User custom fields. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -197,7 +198,7 @@ $html .= ''; } // Time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -242,7 +243,7 @@ $html .= ''.$item['date'].''; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $html .= ''.htmlspecialchars($item['user']).''; // User custom fields. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -253,7 +254,7 @@ if ($bean->getAttribute('chproject')) $html .= ''.htmlspecialchars($item['project']).''; if ($bean->getAttribute('chtask')) $html .= ''.htmlspecialchars($item['task']).''; // Time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -314,7 +315,7 @@ $html .= ''; } // User custom fields. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -337,7 +338,7 @@ $html .= ''; } // Time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -371,7 +372,7 @@ $html .= ''.$i18n->get('label.total').''; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $html .= ''; // User custom fields. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_control_name = 'show_'.$field_name; @@ -382,7 +383,7 @@ if ($bean->getAttribute('chproject')) $html .= ''; if ($bean->getAttribute('chtask')) $html .= ''; // Time custom fields. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_control_name = 'show_'.$field_name; From c90d809986888e191292af4ce5660a64f12c040a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 19 May 2021 18:58:44 +0000 Subject: [PATCH 044/304] Eliminated 2 more php8 warnings. --- WEB-INF/lib/ttFavReportHelper.class.php | 4 ++-- initialize.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index d1cce724..be23f6a3 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -304,7 +304,7 @@ static function loadReport(&$bean) { if ($val['report_spec']) { $report_spec = $val['report_spec']; // Time custom field settings. - if ($custom_fields && $custom_fields->timeFields) { + if (isset($custom_fields) && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { $field_name = 'time_field_'.$timeField['id']; $checkbox_field_name = 'show_'.$field_name; @@ -315,7 +315,7 @@ static function loadReport(&$bean) { } } // User custom field settings. - if ($custom_fields && $custom_fields->userFields) { + if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; $checkbox_field_name = 'show_'.$field_name; diff --git a/initialize.php b/initialize.php index 2493a215..3d348f59 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5572"); +define("APP_VERSION", "1.19.28.5573"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 273e129c8e1a28ce5d8d0a425caf3865332d3bda Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 15:22:58 +0000 Subject: [PATCH 045/304] Starting to integrate newly translated pt-br strings from pr #111. --- WEB-INF/resources/ca.lang.php | 1 - WEB-INF/resources/cs.lang.php | 1 - WEB-INF/resources/da.lang.php | 1 - WEB-INF/resources/de.lang.php | 2 -- WEB-INF/resources/en.lang.php | 1 - WEB-INF/resources/es.lang.php | 1 - WEB-INF/resources/et.lang.php | 1 - WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/gr.lang.php | 2 -- WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/hu.lang.php | 2 -- WEB-INF/resources/it.lang.php | 2 -- WEB-INF/resources/ja.lang.php | 1 - WEB-INF/resources/ko.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/no.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/pt-br.lang.php | 21 +++++++-------------- WEB-INF/resources/pt.lang.php | 1 - WEB-INF/resources/ro.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sl.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/resources/sv.lang.php | 2 -- WEB-INF/resources/tr.lang.php | 1 - WEB-INF/resources/zh-cn.lang.php | 1 - WEB-INF/resources/zh-tw.lang.php | 1 - initialize.php | 2 +- 31 files changed, 8 insertions(+), 49 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index b1fbd33c..333d78ab 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -40,7 +40,6 @@ 'menu.users' => 'Usuaris', 'menu.groups' => 'Grups', // TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'Clients', 'menu.options' => 'Opcions', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 97f37507..a7a3fbdb 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -41,7 +41,6 @@ 'menu.users' => 'Uživatelů', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Export', 'menu.clients' => 'Zákazníci', // TODO: translate the following. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index dd185700..f2e0ff43 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Brugere', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Eksport', 'menu.clients' => 'Kunder', 'menu.options' => 'Indstillinger', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index ed2d2587..7a831864 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -37,8 +37,6 @@ 'menu.tasks' => 'Aufgaben', 'menu.users' => 'Personen', 'menu.groups' => 'Gruppen', -// TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Exportieren', 'menu.clients' => 'Kunden', 'menu.options' => 'Optionen', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 80ef8277..4da63222 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -21,7 +21,6 @@ 'menu.register' => 'Register', 'menu.profile' => 'Profile', 'menu.group' => 'Group', -'menu.subgroups' => 'Subgroups', 'menu.plugins' => 'Plugins', 'menu.time' => 'Time', 'menu.puncher' => 'Punch', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index c50f388b..571c167c 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -39,7 +39,6 @@ 'menu.users' => 'Personas', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'Clientes', 'menu.options' => 'Opciones', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 573d684c..15888784 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -38,7 +38,6 @@ 'menu.tasks' => 'Tööülesanded', 'menu.users' => 'Kasutajad', 'menu.groups' => 'Grupid', -'menu.subgroups' => 'Alamgrupid', 'menu.export' => 'Eksport', // TODO: is this a correct term as an opposite of "Import"? 'menu.clients' => 'Kliendid', 'menu.options' => 'Suvandid', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 2e2718eb..f9ae9a08 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -39,7 +39,6 @@ 'menu.users' => 'کاربران', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'پشتیبانی', 'menu.clients' => 'مشتری ها', 'menu.options' => 'تنظیمات', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 534a94b8..bcfe6241 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Käyttäjät', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Vie', 'menu.clients' => 'Asiakkaat', 'menu.options' => 'Optiot', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 0b55172d..d0170ebd 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Utilisateurs', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Exporter', 'menu.clients' => 'Clients', 'menu.options' => 'Options', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index f8bdb0dc..b8e6789c 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -36,8 +36,6 @@ 'menu.tasks' => 'Εργασίες', 'menu.users' => 'Χρήστες', 'menu.groups' => 'Ομάδες', -// TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Εξαγωγή', 'menu.clients' => 'Πελάτες', 'menu.options' => 'Επιλογές', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 7505f096..011b5f57 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -39,7 +39,6 @@ 'menu.users' => 'משתמשים', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'ייצוא', 'menu.clients' => 'לקוחות', 'menu.options' => 'אפשרויות', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 052dbe72..f8fb388d 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -41,8 +41,6 @@ // 'menu.users' => 'Users', 'menu.groups' => 'Csoportok', // TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', -// TODO: translate the following. // 'menu.export' => 'Export', 'menu.clients' => 'Ügyfelek', 'menu.options' => 'Opciók', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 55faab87..4e2bdfb2 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -38,8 +38,6 @@ 'menu.tasks' => 'Compiti', 'menu.users' => 'Utenti', 'menu.groups' => 'Gruppi', -// TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Esportazione', 'menu.clients' => 'Clienti', 'menu.options' => 'Opzioni', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 57f5592d..15db98a0 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -40,7 +40,6 @@ 'menu.users' => 'ユーザー', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'クライアント', 'menu.options' => 'オプション', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 832464fb..8f22ae32 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -40,7 +40,6 @@ 'menu.users' => '사용자', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => '클라이언트', 'menu.options' => '옵션', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 66c32ea5..37821646 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -34,7 +34,6 @@ 'menu.tasks' => 'Taken', 'menu.users' => 'Medewerkers', 'menu.groups' => 'Groepen', -'menu.subgroups' => 'Subgroepen', 'menu.export' => 'Exporteren', 'menu.clients' => 'Klanten', 'menu.options' => 'Opties', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 3929ac4b..b13b942f 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -41,7 +41,6 @@ 'menu.users' => 'Brukere', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Eksport', 'menu.clients' => 'Klienter', 'menu.options' => 'Opsjoner', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 98018f67..144ea434 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Użytkownicy', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Eksport', 'menu.clients' => 'Klienci', 'menu.options' => 'Opcje', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 3fdfae2d..a67633ab 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -5,7 +5,7 @@ // Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. -$i18n_language = 'Portuguese (Português brasileiro)'; +$i18n_language = 'Portuguese (Português Brasileiro)'; $i18n_months = array('Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'); $i18n_weekdays = array('Domingo', 'Segunda-feira', 'Terça-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sábado'); $i18n_weekdays_short = array('Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'); @@ -18,27 +18,20 @@ 'menu.logout' => 'Logout', 'menu.forum' => 'Fórum', 'menu.help' => 'Ajuda', -// TODO: translate the following. -// 'menu.register' => 'Register', +'menu.register' => 'Registro', 'menu.profile' => 'Perfil', -// TODO: translate the following. -// 'menu.group' => 'Group', +'menu.group' => 'Grupo', 'menu.plugins' => 'Plugins', 'menu.time' => 'Tempo', -// TODO: translate the following. -// 'menu.puncher' => 'Punch', -// 'menu.week' => 'Week', -'menu.expenses' => 'Gastos', +'menu.puncher' => 'Punch', +'menu.week' => 'Semana', +'menu.expenses' => 'Despesas', 'menu.reports' => 'Relatórios', -// TODO: translate the following. -// 'menu.timesheets' => 'Timesheets', +'menu.timesheets' => 'Planilha de horas', 'menu.charts' => 'Gráficos', 'menu.projects' => 'Projetos', 'menu.tasks' => 'Tarefas', 'menu.users' => 'Usuários', -// TODO: translate the following. -// 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Exportar', 'menu.clients' => 'Clientes', 'menu.options' => 'Opções', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 9cdaffd8..585db686 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -42,7 +42,6 @@ 'menu.users' => 'Usuários', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', // 'menu.clients' => 'Clients', 'menu.options' => 'Opções', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 7e42575c..eb99020f 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -42,7 +42,6 @@ 'menu.users' => 'Utilizatori', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'Clienti', // TODO: translate the following. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index c74e45bc..e5e767ff 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -33,7 +33,6 @@ 'menu.tasks' => 'Задачи', 'menu.users' => 'Пользователи', 'menu.groups' => 'Группы', -'menu.subgroups' => 'Подгруппы', 'menu.export' => 'Экспорт', 'menu.clients' => 'Клиенты', 'menu.options' => 'Опции', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 574a283f..dcdcb8c8 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Používatelia', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Export', 'menu.clients' => 'Klienti', 'menu.options' => 'Nastavenia', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index a2ce91ee..095b12f3 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -40,7 +40,6 @@ // 'menu.tasks' => 'Tasks', // 'menu.users' => 'Users', // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'Stranke', 'menu.options' => 'Možnosti', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index b876161b..73a1dce5 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -38,7 +38,6 @@ 'menu.users' => 'Korisnici', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Izvoz', 'menu.clients' => 'Klijenti', 'menu.options' => 'Opcije', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 3f4cc33b..76467182 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -36,8 +36,6 @@ 'menu.tasks' => 'Arbetsuppgifter', 'menu.users' => 'Användare', 'menu.groups' => 'Grupper', -// TODO: translate the following. -// 'menu.subgroups' => 'Subgroups', 'menu.export' => 'Exportera', 'menu.clients' => 'Kunder', 'menu.options' => 'Alternativ', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index bf768a1b..5e7ee26d 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -42,7 +42,6 @@ 'menu.users' => 'Kullanıcılar', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', // 'menu.export' => 'Export', 'menu.clients' => 'Müşteriler', // TODO: translate the following. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 00095186..d10d1c7c 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -38,7 +38,6 @@ 'menu.users' => '用户', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => '导出数据', 'menu.clients' => '客户', 'menu.options' => '选项', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index d4fa2a9f..f1a6a6e3 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -38,7 +38,6 @@ 'menu.users' => '用戶', // TODO: translate the following. // 'menu.groups' => 'Groups', -// 'menu.subgroups' => 'Subgroups', 'menu.export' => '輸出資料', 'menu.clients' => '客戶', 'menu.options' => '選項', diff --git a/initialize.php b/initialize.php index 3d348f59..c47a19f4 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5573"); +define("APP_VERSION", "1.19.28.5574"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 5ff85207b6b74ed20d665de27263d8256bbab5e1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 16:00:41 +0000 Subject: [PATCH 046/304] Work in progress integrating changes from pr #111. --- WEB-INF/resources/pt-br.lang.php | 51 ++++++++++++++------------------ initialize.php | 2 +- 2 files changed, 23 insertions(+), 30 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index a67633ab..b7203dea 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -32,6 +32,7 @@ 'menu.projects' => 'Projetos', 'menu.tasks' => 'Tarefas', 'menu.users' => 'Usuários', +'menu.groups' => 'Grupos', 'menu.export' => 'Exportar', 'menu.clients' => 'Clientes', 'menu.options' => 'Opções', @@ -46,59 +47,51 @@ 'error.access_denied' => 'Acesso negado.', 'error.sys' => 'Erro no sistema.', 'error.db' => 'Erro no banco de dados.', -// TODO: translate the following. -// 'error.registered_recently' => 'Registered recently.', -// 'error.feature_disabled' => 'Feature is disabled.', +'error.registered_recently' => 'Registrado recentemente.', +'error.feature_disabled' => 'Recurso desabilitado.', 'error.field' => 'Dados incorretos "{0}".', 'error.empty' => 'Campo "{0}" está vazio.', 'error.not_equal' => 'Campo "{0}" é diferente do campo "{1}".', -// TODO: translate the following. -// 'error.interval' => 'Field "{0}" must be greater than "{1}".', +'error.interval' => 'Campo "{0}" precisa ser maior que "{1}".', 'error.project' => 'Selecione projeto.', 'error.task' => 'Selecione tarefa.', 'error.client' => 'Selecione cliente.', 'error.report' => 'Selecione relatório.', -// TODO: translate the following. -// 'error.record' => 'Select record.', +'error.record' => 'Selecione o registro.', 'error.auth' => 'Usuário ou senha incorretos.', 'error.user_exists' => 'Já existe usuário com este login.', -// TODO: translate the following. -// 'error.object_exists' => 'Object with this name already exists.', +'error.object_exists' => 'Já existe um objeto com este nome.', 'error.invoice_exists' => 'Já existe fatura com este número.', -// TODO: translate the following. -// 'error.role_exists' => 'Role with this rank already exists.', +// TODO: improve translation of the word "role" in error.role_exists. função here, papel elsewhere? +'error.role_exists' => 'Já existe uma função com este rank.', 'error.no_invoiceable_items' => 'Não há items faturáveis.', -// TODO: translate the following. -// 'error.no_records' => 'There are no records.', +'error.no_records' => 'Não há registros.', 'error.no_login' => 'Não há usuário com este login.', -'error.no_groups' => 'Sua base de dados está vazia. Entre como admin e crie uma equipe nova.', // TODO: replace "team" with "group". +'error.no_groups' => 'Sua base de dados está vazia. Entre como admin e crie um grupo novo.', 'error.upload' => 'Erro no envio do arquivo.', 'error.range_locked' => 'Período está bloqueado.', 'error.mail_send' => 'Erro enviando o e-mail.', -// TODO: improve the translation above by adding MAIL_SMTP_DEBUG part. -// 'error.mail_send' => 'Error sending mail. Use MAIL_SMTP_DEBUG for diagnostics.', +// TODO: is "Use" in error.mail_send translated correctly? +'error.mail_send' => 'Erro ao enviar e-mail. Use MAIL_SMTP_DEBUG para diagnósticos.', 'error.no_email' => 'Não há e-mail associado a este login.', 'error.uncompleted_exists' => 'Entrada incompleta existente. Feche ou remova-a.', 'error.goto_uncompleted' => 'Ir até a entrada incompleta.', 'error.overlap' => 'O intervalo se sobrepõe com entradas já existentes.', 'error.future_date' => 'Data é no futuro.', -// TODO: translate the following. -// 'error.xml' => 'Error in XML file at line %d: %s.', -// 'error.cannot_import' => 'Cannot import: %s.', -// 'error.format' => 'Invalid file format.', -// 'error.user_count' => 'Limit on user count.', -// 'error.expired' => 'Expiration date reached.', -// 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. +'error.xml' => 'Erro no arquivo XML, linha line %d: %s.', +'error.cannot_import' => 'Não foi possível importar: %s.', +'error.format' => 'Formato de arquivo inválido.', +'error.user_count' => 'Limite na contagem de usuários.', +'error.expired' => 'Data de expiração atingida.', +'error.file_storage' => 'Erro relacionado ao servidor de armazenamento de arquivos.', +'error.remote_work' => 'Erro relacionado ao servidor responsável pelo plugin work.', // Warning messages. -// TODO: translate the following. -// 'warn.sure' => 'Are you sure?', -// 'warn.confirm_save' => 'Date has changed. Confirm saving, not copying this item.', +'warn.sure' => 'Tem certeza?', +'warn.confirm_save' => 'A data mudou. Confirme salvando, não copiando este item.', // Success messages. -// TODO: translate the following. -// 'msg.success' => 'Operation completed successfully.', +'msg.success' => 'Operação concluída com sucesso.', // Labels for buttons. 'button.login' => 'Login', diff --git a/initialize.php b/initialize.php index c47a19f4..88b47d25 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5574"); +define("APP_VERSION", "1.19.28.5575"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 565d1b835511f1af29f945d3c944645a0bda57d3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 17:57:11 +0000 Subject: [PATCH 047/304] A bit more progress integrating pr #111. --- WEB-INF/resources/ca.lang.php | 2 - WEB-INF/resources/cs.lang.php | 2 - WEB-INF/resources/da.lang.php | 2 - WEB-INF/resources/de.lang.php | 2 - WEB-INF/resources/en.lang.php | 2 - WEB-INF/resources/es.lang.php | 2 - WEB-INF/resources/et.lang.php | 2 - WEB-INF/resources/fa.lang.php | 2 - WEB-INF/resources/fi.lang.php | 2 - WEB-INF/resources/fr.lang.php | 2 - WEB-INF/resources/gr.lang.php | 2 - WEB-INF/resources/he.lang.php | 2 - WEB-INF/resources/hu.lang.php | 2 - WEB-INF/resources/it.lang.php | 2 - WEB-INF/resources/ja.lang.php | 2 - WEB-INF/resources/ko.lang.php | 2 - WEB-INF/resources/nl.lang.php | 2 - WEB-INF/resources/no.lang.php | 2 - WEB-INF/resources/pl.lang.php | 2 - WEB-INF/resources/pt-br.lang.php | 97 ++++++++++++++------------------ WEB-INF/resources/pt.lang.php | 2 - WEB-INF/resources/ro.lang.php | 2 - WEB-INF/resources/ru.lang.php | 2 - WEB-INF/resources/sk.lang.php | 2 - WEB-INF/resources/sl.lang.php | 2 - WEB-INF/resources/sr.lang.php | 2 - WEB-INF/resources/sv.lang.php | 2 - WEB-INF/resources/tr.lang.php | 2 - WEB-INF/resources/zh-cn.lang.php | 2 - WEB-INF/resources/zh-tw.lang.php | 2 - initialize.php | 2 +- 31 files changed, 42 insertions(+), 115 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 333d78ab..1f735771 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -260,8 +260,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index a7a3fbdb..b180b884 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -270,8 +270,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index f2e0ff43..9c6aea90 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -252,8 +252,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktive Brugere', 'label.inactive_users' => 'Inaktive Brugere', // TODO: translate the following. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 7a831864..d2dff2a0 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -244,8 +244,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktive Nutzer', 'label.inactive_users' => 'Inaktive Nutzer', // TODO: translate the following or confirm that "Details" is also correct for German (exactly as the English string). diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 4da63222..d7fb49ac 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -234,8 +234,6 @@ 'label.attachments' => 'Attachments', 'label.files' => 'Files', 'label.file' => 'File', -'label.image' => 'Image', -'label.download' => 'Download', 'label.active_users' => 'Active Users', 'label.inactive_users' => 'Inactive Users', 'label.details' => 'Details', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 571c167c..c352f5d9 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -263,8 +263,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 15888784..c4ab61d3 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -260,8 +260,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktiivsed kasutajad', 'label.inactive_users' => 'Mitteaktiivsed kasutajad', // TODO: translate the following. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index f9ae9a08..dfff12bd 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -263,8 +263,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'کاربران فعال', 'label.inactive_users' => 'کاربران غیرفعال', // TODO: translate the following. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index bcfe6241..f624a91d 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -256,8 +256,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktiiviset käyttäjät', 'label.inactive_users' => 'Ei-aktiiviset käyttäjät', // TODO: translate the following. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index d0170ebd..f3e0c862 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -250,8 +250,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Utilisateurs actifs', 'label.inactive_users' => 'Utilisateurs inactifs', // TODO: translate the following. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index b8e6789c..b5ba3bf3 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -245,8 +245,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Ενεργοί χρήστες', 'label.inactive_users' => 'Ανενεργοί χρήστες', // TODO: translate the following. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 011b5f57..f85fbb54 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -271,8 +271,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'משתמשים פעילים', 'label.inactive_users' => 'משתמשים לא פעילים', // TODO: translate the following. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index f8fb388d..791105b3 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -265,8 +265,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 4e2bdfb2..2654c639 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -249,8 +249,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Utenti attivi', 'label.inactive_users' => 'Utenti inattivi', // TODO: translate the following. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 15db98a0..b9d84a9a 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -270,8 +270,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 8f22ae32..f1cff3fc 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -270,8 +270,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 37821646..dfd46999 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -228,8 +228,6 @@ 'label.attachments' => 'Bijlagen', 'label.files' => 'Bestanden', 'label.file' => 'Bestand', -'label.image' => 'Afbeelding', -'label.download' => 'Download', 'label.active_users' => 'Actieve medewerkers', 'label.inactive_users' => 'Inactieve medewerkers', 'label.details' => 'Details', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index b13b942f..3511faec 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -267,8 +267,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 144ea434..dd4deead 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -257,8 +257,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktywni użytkownicy', 'label.inactive_users' => 'Nieaktywni użytkownicy', // TODO: translate the following. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index b7203dea..40f7a836 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -110,16 +110,13 @@ 'button.export' => 'Exportar equipe', // TODO: replace "team" with "group". 'button.import' => 'Importar equipe', // TODO: replace "team" with "group". 'button.close' => 'Fechar', -// TODO: translate the following. -// 'button.start' => 'Start', +'button.start' => 'Iniciar', 'button.stop' => 'Parar', -// TODO: translate the following. -// 'button.approve' => 'Approve', -// 'button.disapprove' => 'Disapprove', +'button.approve' => 'Aprovar', +'button.disapprove' => 'Desaprovar', // Labels for controls on forms. Labels in this section are used on multiple forms. -// TODO: translate the following. -// 'label.menu' => 'Menu', +'label.menu' => 'Menu', 'label.group_name' => 'Nome da equipe', // TODO: replace "team" with "group". 'label.address' => 'Endereço', 'label.currency' => 'Moeda', @@ -132,18 +129,16 @@ 'label.confirm_password' => 'Confirme a senha', 'label.email' => 'E-mail', 'label.cc' => 'Cc', -// TODO: translate the following. -// 'label.bcc' => 'Bcc', +'label.bcc' => 'Bcc', 'label.subject' => 'Assunto', 'label.date' => 'Data', 'label.start_date' => 'Data inicial', 'label.end_date' => 'Data final', 'label.user' => 'Usuário', 'label.users' => 'Usuários', -// TODO: translate the following. -// 'label.group' => 'Group', -// 'label.subgroups' => 'Subgroups', -// 'label.roles' => 'Roles', +'label.group' => 'Grupo', +'label.subgroups' => 'Subgrupos', +'label.roles' => 'Papéis', 'label.client' => 'Cliente', 'label.clients' => 'Clientes', 'label.option' => 'Opção', @@ -157,16 +152,13 @@ 'label.finish' => 'Fim', 'label.duration' => 'Duração', 'label.note' => 'Anotação', -// TODO: translate the following. -// 'label.notes' => 'Notes', +'label.notes' => 'Anotações', 'label.item' => 'Item', 'label.cost' => 'Custo', -// TODO: translate the following. -// 'label.ip' => 'IP', +'label.ip' => 'IP', 'label.day_total' => 'Total diário', 'label.week_total' => 'Total semanal', -// TODO: translate the following. -// 'label.month_total' => 'Month total', +'label.month_total' => 'Total mensal', 'label.today' => 'Hoje', 'label.view' => 'Ver', 'label.edit' => 'Editar', @@ -174,10 +166,9 @@ 'label.configure' => 'Configurar', 'label.select_all' => 'Selecionar todos', 'label.select_none' => 'Desmarcar todos', -// TODO: translate the following. -// 'label.day_view' => 'Day view', -// 'label.week_view' => 'Week view', -// 'label.puncher' => 'Puncher', +'label.day_view' => 'Visão diária', +'label.week_view' => 'Visão semanal', +'label.puncher' => 'Puncher', 'label.id' => 'ID', 'label.language' => 'Idioma', 'label.decimal_mark' => 'Ponto decimal', @@ -200,17 +191,14 @@ 'label.role_comanager' => '(coordenador)', 'label.role_admin' => '(administrador)', 'label.page' => 'Página', -// TODO: translate the following. -// 'label.condition' => 'Condition', -// 'label.yes' => 'yes', -// 'label.no' => 'no', -// 'label.sort' => 'Sort', +'label.condition' => 'Condição', +'label.yes' => 'sim', +'label.no' => 'não', +'label.sort' => 'Ordenar', // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Campos personalizados', -// Translate the following. -// 'label.monthly_quotas' => 'Monthly quotas', -// TODO: translate the following. -// 'label.entity' => 'Entity', +'label.monthly_quotas' => 'Cotas mensais', +'label.entity' => 'Entidade', 'label.type' => 'Tipo', 'label.type_dropdown' => 'lista suspensa', 'label.type_text' => 'texto', @@ -218,31 +206,28 @@ 'label.fav_report' => 'Relatório favorito', 'label.schedule' => 'Agenda', 'label.what_is_it' => 'O que é?', -// 'label.expense' => 'Expense', -// 'label.quantity' => 'Quantity', -// 'label.paid_status' => 'Paid status', -// 'label.paid' => 'Paid', -// 'label.mark_paid' => 'Mark paid', -// 'label.week_note' => 'Week note', -// 'label.week_list' => 'Week list', -// 'label.work_units' => 'Work units', -// 'label.work_units_short' => 'Units', +'label.expense' => 'Despesa', +'label.quantity' => 'Quantidade', +'label.paid_status' => 'Status pago', +'label.paid' => 'Pago', +'label.mark_paid' => 'Marcar como pago', +'label.week_note' => 'Anotação da semana', +'label.week_list' => 'Lista da semana', +'label.work_units' => 'Unidades de trabalho', +'label.work_units_short' => 'Unidades', 'label.totals_only' => 'Somente totais', -// TODO: translate the following. -// 'label.quota' => 'Quota', -// 'label.timesheet' => 'Timesheet', -// 'label.submitted' => 'Submitted', -// 'label.approved' => 'Approved', -// 'label.approval' => 'Report approval', -// 'label.mark_approved' => 'Mark approved', -// 'label.template' => 'Template', -// 'label.bind_templates_with_projects' => 'Bind templates with projects', -// 'label.prepopulate_note' => 'Prepopulate Note field', -// 'label.attachments' => 'Attachments', -// 'label.files' => 'Files', -// 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', +'label.quota' => 'Cota', +'label.timesheet' => 'Planilha de horas', +'label.submitted' => 'Enviado', +'label.approved' => 'Aprovado', +'label.approval' => 'Aprovação de relatório', +'label.mark_approved' => 'Marcar como aprovado', +'label.template' => 'Modelo', +'label.bind_templates_with_projects' => 'Vincular modelos com projetos', +'label.prepopulate_note' => 'Pré-preencher campo de anotação', +'label.attachments' => 'Anexos', +'label.files' => 'Arquivos', +'label.file' => 'Arquivo', 'label.active_users' => 'Usuários ativos', 'label.inactive_users' => 'Usuários inativos', // TODO: translate the following. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 585db686..374cf4da 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -255,8 +255,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index eb99020f..cdca51cc 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -267,8 +267,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index e5e767ff..abfff9a2 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -225,8 +225,6 @@ 'label.attachments' => 'Приложения', 'label.files' => 'Файлы', 'label.file' => 'Файл', -'label.image' => 'Изображение', -'label.download' => 'Скачать', 'label.active_users' => 'Активные пользователи', 'label.inactive_users' => 'Неактивные пользователи', 'label.details' => 'Детали', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index dcdcb8c8..8c971727 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -260,8 +260,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktívny používatelia', 'label.inactive_users' => 'Neaktívny používatelia', // TODO: translate the following. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 095b12f3..e45e43a5 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -250,8 +250,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 73a1dce5..cd9ff618 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -255,8 +255,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktivni korisnik', 'label.inactive_users' => 'Neaktivni korisnik', // TODO: translate the following. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 76467182..5a9b8678 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -251,8 +251,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', 'label.active_users' => 'Aktiva användare', 'label.inactive_users' => 'Inaktiva användare', // TODO: translate the following. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 5e7ee26d..a1b4b0d8 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -274,8 +274,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index d10d1c7c..fc07dc61 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -260,8 +260,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index f1a6a6e3..1b20c2d1 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -265,8 +265,6 @@ // 'label.attachments' => 'Attachments', // 'label.files' => 'Files', // 'label.file' => 'File', -// 'label.image' => 'Image', -// 'label.download' => 'Download', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', diff --git a/initialize.php b/initialize.php index 88b47d25..6104df6e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5575"); +define("APP_VERSION", "1.19.28.5576"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 0b6c6bf40b94be1b25f4675eea05354297103409 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 19:16:27 +0000 Subject: [PATCH 048/304] More progress on integrating strings from pr #111. --- WEB-INF/resources/ca.lang.php | 1 - WEB-INF/resources/cs.lang.php | 1 - WEB-INF/resources/da.lang.php | 1 - WEB-INF/resources/de.lang.php | 2 -- WEB-INF/resources/en.lang.php | 1 - WEB-INF/resources/es.lang.php | 1 - WEB-INF/resources/et.lang.php | 1 - WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/gr.lang.php | 1 - WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/hu.lang.php | 1 - WEB-INF/resources/it.lang.php | 1 - WEB-INF/resources/ja.lang.php | 1 - WEB-INF/resources/ko.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/no.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/pt-br.lang.php | 31 ++++++++++++------------------- WEB-INF/resources/pt.lang.php | 1 - WEB-INF/resources/ro.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sl.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/resources/sv.lang.php | 1 - WEB-INF/resources/tr.lang.php | 1 - WEB-INF/resources/zh-cn.lang.php | 1 - WEB-INF/resources/zh-tw.lang.php | 1 - initialize.php | 2 +- 31 files changed, 13 insertions(+), 50 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 1f735771..c91a3ae3 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -291,7 +291,6 @@ 'title.login' => 'Sessió iniciada', 'title.groups' => 'Grups', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Eliminar grup', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index b180b884..2829fc0f 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -301,7 +301,6 @@ 'title.login' => 'Přihlásit', 'title.groups' => 'Týmy', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Smazat tým', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 9c6aea90..bec944e1 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -280,7 +280,6 @@ 'title.login' => 'Login', 'title.groups' => 'Teams', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Redigér Team', // TODO: change "team" to "group". 'title.delete_group' => 'Slet Team', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index d2dff2a0..2c270748 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -274,8 +274,6 @@ 'title.success' => 'Erfol', 'title.login' => 'Anmelden', 'title.groups' => 'Gruppen', -// TODO: translate the following. -// 'title.subgroups' => 'Subgroups', 'title.add_group' => 'Gruppe anlegen', 'title.edit_group' => 'Gruppe bearbeiten', 'title.delete_group' => 'Gruppe löschen', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index d7fb49ac..2339a996 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -258,7 +258,6 @@ 'title.success' => 'Success', 'title.login' => 'Login', 'title.groups' => 'Groups', -'title.subgroups' => 'Subgroups', 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Deleting Group', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index c352f5d9..c538fbc9 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -290,7 +290,6 @@ 'title.login' => 'Sesión iniciada', 'title.groups' => 'Grupos', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', // 'title.delete_group' => 'Deleting Group', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index c4ab61d3..08f392f6 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -290,7 +290,6 @@ 'title.success' => 'Õnnestumine', 'title.login' => 'Sisene', 'title.groups' => 'Grupid', -'title.subgroups' => 'Alamgrupid', 'title.add_group' => 'Lisa grupp', 'title.edit_group' => 'Muuda gruppi', 'title.delete_group' => 'Kustuta grupp', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index dfff12bd..75220b46 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -291,7 +291,6 @@ 'title.login' => 'ورود', 'title.groups' => 'تیم ها', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'حذف تیم', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index f624a91d..a497a690 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -284,7 +284,6 @@ 'title.login' => 'Kirjautuminen', 'title.groups' => 'Tiimit', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Tiimin muokkaus', // TODO: change "team" to "group". 'title.delete_group' => 'Tiimin poisto', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index f3e0c862..d1b0bc90 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -278,7 +278,6 @@ 'title.login' => 'Connexion', 'title.groups' => 'Équipes', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Modification d\\\'une équipe', // TODO: change "team" to "group". 'title.delete_group' => 'Suppression d\\\'une équipe', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index b5ba3bf3..647475c4 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -273,7 +273,6 @@ 'title.login' => 'Σύνδεση', 'title.groups' => 'Ομάδες', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Επεξεργασία ομάδας', 'title.delete_group' => 'Διαγραφή ομάδας', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index f85fbb54..8ad1fe77 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -299,7 +299,6 @@ 'title.login' => 'כניסה', 'title.groups' => 'צוותים', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'מחיקת צוות', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 791105b3..403e178b 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -292,7 +292,6 @@ 'title.login' => 'Bejelentkezés', 'title.groups' => 'Csoportok', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Csoport törlése', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 2654c639..c4825196 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -281,7 +281,6 @@ 'title.login' => 'Login', 'title.groups' => 'Gruppi', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Modifica gruppo', 'title.delete_group' => 'Elimina gruppo', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index b9d84a9a..df981bc5 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -297,7 +297,6 @@ 'title.login' => 'ログイン', 'title.groups' => 'チーム', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'チームの削除', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index f1cff3fc..120734f7 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -297,7 +297,6 @@ 'title.login' => '로그인', 'title.groups' => '팀', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => '팀 삭제', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index dfd46999..2190504f 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -248,7 +248,6 @@ 'title.success' => 'Succes', 'title.login' => 'Aanmelden', 'title.groups' => 'Groepen', -'title.subgroups' => 'Subgroepen', 'title.add_group' => 'Groep toevoegen', 'title.edit_group' => 'Groep bewerken', 'title.delete_group' => 'Groep aan het verwijderen', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 3511faec..a0ebfcde 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -294,7 +294,6 @@ 'title.login' => 'Innlogging', // TODO: translate the following. // 'title.groups' => 'Groups', -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Slett team', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index dd4deead..42ff3903 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -285,7 +285,6 @@ 'title.login' => 'Logowanie', 'title.groups' => 'Zespoły', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Edytowanie zespołu', // TODO: change "team" to "group". 'title.delete_group' => 'Usuwanie zespołu', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 40f7a836..d936a13f 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -217,7 +217,7 @@ 'label.work_units_short' => 'Unidades', 'label.totals_only' => 'Somente totais', 'label.quota' => 'Cota', -'label.timesheet' => 'Planilha de horas', +'label.timesheet' => 'Planilha de horas', 'label.submitted' => 'Enviado', 'label.approved' => 'Aprovado', 'label.approval' => 'Aprovação de relatório', @@ -230,33 +230,26 @@ 'label.file' => 'Arquivo', 'label.active_users' => 'Usuários ativos', 'label.inactive_users' => 'Usuários inativos', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. +'label.details' => 'Detalhes', +'label.budget' => 'Orçamento', +'label.work' => 'Trabalho', +'label.offer' => 'Oferta', +'label.contractor' => 'Contratante', +'label.how_to_pay' => 'Como pagar', +'label.moderator_comment' => 'Comentário do moderador', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. -// TODO: translate the following. -// 'entity.time' => 'time', -// 'entity.user' => 'user', -// 'entity.project' => 'project', +'entity.time' => 'tempo', +'entity.user' => 'usuário', +'entity.project' => 'projeto', // Form titles. 'title.error' => 'Erro', -// TODO: Translate the following. -// 'title.success' => 'Success', +'title.success' => 'Sucesso', 'title.login' => 'Login', 'title.groups' => 'Equipes', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Editando equipe', // TODO: change "team" to "group". 'title.delete_group' => 'Apagando equipe', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 374cf4da..2bd9783f 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -282,7 +282,6 @@ 'title.login' => 'Login', // TODO: translate the following. // 'title.groups' => 'Groups', -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', // 'title.delete_group' => 'Deleting Group', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index cdca51cc..561543d4 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -297,7 +297,6 @@ 'title.login' => 'Autentificare', 'title.groups' => 'Echipe', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Șterge echipa', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index abfff9a2..c5c01a17 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -246,7 +246,6 @@ 'title.success' => 'Успех', 'title.login' => 'Вход в систему', 'title.groups' => 'Группы', -'title.subgroups' => 'Подгруппы', 'title.add_group' => 'Добавление группы', 'title.edit_group' => 'Редактирование группы', 'title.delete_group' => 'Удаление группы', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 8c971727..68ba1055 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -288,7 +288,6 @@ 'title.login' => 'Prihlásenie', 'title.groups' => 'Tímy', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Vymazávanie tímu', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index e45e43a5..0942fbbd 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -277,7 +277,6 @@ 'title.login' => 'Prijava', 'title.groups' => 'Timi', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', // 'title.delete_group' => 'Deleting Group', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index cd9ff618..a7118c7c 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -283,7 +283,6 @@ 'title.login' => 'Prijava', 'title.groups' => 'Timovi', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Izmeni tim', // TODO: change "team" to "group". 'title.delete_group' => 'Obriši tim', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 5a9b8678..66f1b159 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -279,7 +279,6 @@ 'title.login' => 'Logga in', 'title.groups' => 'Grupper', // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Redigera grupp', 'title.delete_group' => 'Ta bort grupp', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index a1b4b0d8..7ae9c8e0 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -306,7 +306,6 @@ 'title.login' => 'Giriş', 'title.groups' => 'Ekipler', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => 'Ekibi sil', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index fc07dc61..f370b737 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -287,7 +287,6 @@ 'title.login' => '登录', 'title.groups' => '团队', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => '删除团队', // TODO: change "team" to "group". diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 1b20c2d1..c7985b99 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -292,7 +292,6 @@ 'title.login' => '登錄', 'title.groups' => '團隊', // TODO: change "teams" to "groups". // TODO: translate the following. -// 'title.subgroups' => 'Subgroups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', 'title.delete_group' => '刪除團隊', // TODO: change "team" to "group". diff --git a/initialize.php b/initialize.php index 6104df6e..edfd70a7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5576"); +define("APP_VERSION", "1.19.28.5577"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 1406aa8ff086976efeea555da98d547f268845c7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 20:17:02 +0000 Subject: [PATCH 049/304] More work on progress improving pt-br translation from pr #111. --- WEB-INF/resources/pt-br.lang.php | 127 ++++++++++++++----------------- initialize.php | 2 +- 2 files changed, 57 insertions(+), 72 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index d936a13f..d736843a 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -217,7 +217,7 @@ 'label.work_units_short' => 'Unidades', 'label.totals_only' => 'Somente totais', 'label.quota' => 'Cota', -'label.timesheet' => 'Planilha de horas', +'label.timesheet' => 'Planilha de horas', 'label.submitted' => 'Enviado', 'label.approved' => 'Aprovado', 'label.approval' => 'Aprovação de relatório', @@ -248,37 +248,32 @@ 'title.error' => 'Erro', 'title.success' => 'Sucesso', 'title.login' => 'Login', -'title.groups' => 'Equipes', // TODO: change "teams" to "groups". -// TODO: translate the following. -// 'title.add_group' => 'Adding Group', -'title.edit_group' => 'Editando equipe', // TODO: change "team" to "group". -'title.delete_group' => 'Apagando equipe', // TODO: change "team" to "group". +'title.groups' => 'Grupos', +'title.add_group' => 'Adicionando grupo', +'title.edit_group' => 'Editando grupo', +'title.delete_group' => 'Apagando grupo', 'title.reset_password' => 'Resetando a senha', 'title.change_password' => 'Alterando a senha', 'title.time' => 'Tempo', 'title.edit_time_record' => 'Editando entrada de hora', 'title.delete_time_record' => 'Apagando entrada de hora', -// TODO: Translate the following. -// 'title.time_files' => 'Time Record Files', -// 'title.puncher' => 'Puncher', +'title.time_files' => 'Arquivos de registro de tempo', +'title.puncher' => 'Puncher', 'title.expenses' => 'Gastos', 'title.edit_expense' => 'Editando item de gasto', 'title.delete_expense' => 'Apagando item de gasto', -// TODO: translate the following. -// 'title.expense_files' => 'Expense Item Files', +'title.expense_files' => 'Arquivos de itens de despesas', 'title.reports' => 'Relatórios', 'title.report' => 'Report', 'title.send_report' => 'Enviando relatório', -// TODO: Translate the following. -// 'title.timesheets' => 'Timesheets', -// 'title.timesheet' => 'Timesheet', -// 'title.timesheet_files' => 'Timesheet Files', +'title.timesheets' => 'Planilhas de horas', +'title.timesheet' => 'Planilha de horas', +'title.timesheet_files' => 'Arquivos de planilha de horas', 'title.invoice' => 'Fatura', 'title.send_invoice' => 'Enviando fatura', 'title.charts' => 'Gráficos', 'title.projects' => 'Projetos', -// TODO: translate the following. -// 'title.project_files' => 'Project Files', +'title.project_files' => 'Arquivos do projeto', 'title.add_project' => 'Adicionando projeto', 'title.edit_project' => 'Editando projeto', 'title.delete_project' => 'Apagando projeto', @@ -290,8 +285,8 @@ 'title.add_user' => 'Adicionando usuário', 'title.edit_user' => 'Editando usuário', 'title.delete_user' => 'Apagando usuário', +'title.roles' => 'Papéis', // TODO: translate the following. -// 'title.roles' => 'Roles', // 'title.add_role' => 'Adding Role', // 'title.edit_role' => 'Editing Role', // 'title.delete_role' => 'Deleting Role', @@ -307,16 +302,14 @@ 'title.add_notification' => 'Adicionando notificação', 'title.edit_notification' => 'Editando notificação', 'title.delete_notification' => 'Apagando notificação', -// TODO: translate the following. -// 'title.add_timesheet' => 'Adding Timesheet', -// 'title.edit_timesheet' => 'Editing Timesheet', -// 'title.delete_timesheet' => 'Deleting Timesheet', -// 'title.monthly_quotas' => 'Monthly Quotas', +'title.add_timesheet' => 'Adicionando planilha de horas', +'title.edit_timesheet' => 'Editando planilha de horas', +'title.delete_timesheet' => 'Apagando planilha de horas', +'title.monthly_quotas' => 'Cotas mensais', 'title.export' => 'Exportando dados de equipe', // TODO: replace "team" with "group". 'title.import' => 'Importando dados de equipe', // TODO: replace "team" with "group". 'title.options' => 'Opções', -// TODO: translate the following. -// 'title.display_options' => 'Display Options', +'title.display_options' => 'Opções de exibição', 'title.profile' => 'Perfil', 'title.plugins' => 'Plugins', 'title.cf_custom_fields' => 'Campos personalizados', @@ -328,41 +321,39 @@ 'title.cf_edit_dropdown_option' => 'Editando opção', 'title.cf_delete_dropdown_option' => 'Apagando opção', 'title.locking' => 'Bloquear', -// TODO: translate the following. -// 'title.week_view' => 'Week View', -// 'title.swap_roles' => 'Swapping Roles', -// 'title.work_units' => 'Work Units', -// 'title.templates' => 'Templates', -// 'title.add_template' => 'Adding Template', -// 'title.edit_template' => 'Editing Template', -// 'title.delete_template' => 'Deleting Template', -// 'title.edit_file' => 'Editing File', -// 'title.delete_file' => 'Deleting File', -// 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. +'title.week_view' => 'Visão semanal', +'title.swap_roles' => 'Alteração de papéis', +'title.work_units' => 'Unidades de trabalho', +'title.templates' => 'Modelos', +'title.add_template' => 'Adicionando modelo', +'title.edit_template' => 'Editando modelo', +'title.delete_template' => 'Apagando modelo', +'title.edit_file' => 'Editando arquivo', +'title.delete_file' => 'Apagando arquivo', +'title.download_file' => 'Baixando arquivo', +'title.work' => 'Trabalho', +'title.add_work' => 'Adicionando trabalho', +'title.edit_work' => 'Editando trabalho', +'title.delete_work' => 'Apagando trabalho', +'title.active_work' => 'Trabalho ativo', +'title.available_work' => 'Trabalho disponível', +'title.inactive_work' => 'Trabalho inativo', +'title.pending_work' => 'Trabalho pendente', +'title.offer' => 'Oferta', +'title.add_offer' => 'Adicionando oferta', +'title.edit_offer' => 'Editando oferta', +'title.delete_offer' => 'Apagando oferta', +'title.active_offers' => 'Ofertas ativas', +'title.available_offers' => 'Ofertas disponíveis', +'title.inactive_offers' => 'Ofertas inativas', +'title.pending_offers' => 'Ofertas pendentes', // 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. 'dropdown.all' => '--- todos ---', 'dropdown.no' => '--- não ---', -// TODO: translate the following. -// 'dropdown.current_day' => 'today', -// 'dropdown.previous_day' => 'yesterday', +'dropdown.current_day' => 'hoje', +'dropdown.previous_day' => 'ontem', 'dropdown.selected_day' => 'dia', 'dropdown.current_week' => 'esta semana', 'dropdown.previous_week' => 'última semana', @@ -371,8 +362,7 @@ 'dropdown.previous_month' => 'último mês', 'dropdown.selected_month' => 'mês', 'dropdown.current_year' => 'este ano', -// TODO: translate the following. -// 'dropdown.previous_year' => 'previous year', +'dropdown.previous_year' => 'último ano', // TODO: check if this is correct. I used último for consistency with other dropdown options. 'dropdown.selected_year' => 'ano', 'dropdown.all_time' => 'todas as datas', 'dropdown.projects' => 'projetos', @@ -380,20 +370,18 @@ 'dropdown.clients' => 'clientes', 'dropdown.select' => '--- selecione ---', 'dropdown.select_invoice' => '--- selecione fatura ---', -// TODO: translate the following. -// 'dropdown.select_timesheet' => '--- select timesheet ---', +'dropdown.select_timesheet' => '--- selecione planilha de horas ---', 'dropdown.status_active' => 'ativo', 'dropdown.status_inactive' => 'inativo', 'dropdown.delete' => 'apagar', 'dropdown.do_not_delete' => 'não apagar', -// TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', -// 'dropdown.approved' => 'approved', -// 'dropdown.not_approved' => 'not approved', -// 'dropdown.paid' => 'paid', -// 'dropdown.not_paid' => 'not paid', -// 'dropdown.ascending' => 'ascending', -// 'dropdown.descending' => 'descending', +'dropdown.pending_approval' => 'aprovação pendente', +'dropdown.approved' => 'aprovado', +'dropdown.not_approved' => 'não aprovado', +'dropdown.paid' => 'pago', +'dropdown.not_paid' => 'não pago', +'dropdown.ascending' => 'ascendente', +'dropdown.descending' => 'descendente', // Below is a section for strings that are used on individual forms. When a string is used only on one form it should be placed here. // One exception is for closely related forms such as "Time" and "Editing Time Record" with similar controls. In such cases @@ -407,10 +395,7 @@ // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Pedido para resetar a senha enviado por e-mail.', 'form.reset_password.email_subject' => 'Pedido de alteração de senha no Anuko Time Tracker', -// TODO: English string has changed. "from IP" added. Re-translate the beginning. -// 'form.reset_password.email_body' => "Dear User,\n\nSomeone from IP %s requested your Anuko Time Tracker password reset. Please visit this link if you want to reset your password.\n\n%s\n\nAnuko Time Tracker is an open source time tracking system. Visit https://www.anuko.com for more information.\n\n", -// "IP %s" probably sounds awkward. -'form.reset_password.email_body' => "Prezado usuário,\n\nAlguém, IP %s, solicitou o reset da sua senha do Anuko Time Tracker. Entre nete link para resetar a sua senha.\n\n%s\n\nAnuko Time Tracker é um sistema de código abertois, de rastreamento do tempo. Visite https://www.anuko.com para mais informações.\n\n", +'form.reset_password.email_body' => "Caro usuário,\n\nAlguém do IP %s solicitou a redefinição da senha do Anuko Time Tracker. Visite este link se quiser redefinir sua senha.\n\n%s\n\nAnuko Time Tracker é um sistema de rastreamento de apontamentos de código aberto. Visite https://www.anuko.com para obter mais informações.\n\n", // Changing Password form. See example at https://timetracker.anuko.com/password_change.php?ref=1. 'form.change_password.tip' => 'Entre com a nova senha e clique em Salvar.', diff --git a/initialize.php b/initialize.php index edfd70a7..80ad77c0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5577"); +define("APP_VERSION", "1.19.28.5578"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From c1633c81d3003d84aeea7e185d13f33b6142ab9f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 22:21:33 +0000 Subject: [PATCH 050/304] More work in progress on pt-br translation. --- WEB-INF/resources/ca.lang.php | 4 +-- WEB-INF/resources/cs.lang.php | 4 +-- WEB-INF/resources/da.lang.php | 4 +-- WEB-INF/resources/de.lang.php | 4 +-- WEB-INF/resources/en.lang.php | 4 +-- WEB-INF/resources/es.lang.php | 4 +-- WEB-INF/resources/et.lang.php | 4 +-- WEB-INF/resources/fa.lang.php | 4 +-- WEB-INF/resources/fi.lang.php | 4 +-- WEB-INF/resources/fr.lang.php | 4 +-- WEB-INF/resources/gr.lang.php | 4 +-- WEB-INF/resources/he.lang.php | 4 +-- WEB-INF/resources/hu.lang.php | 4 +-- WEB-INF/resources/it.lang.php | 4 +-- WEB-INF/resources/ja.lang.php | 4 +-- WEB-INF/resources/ko.lang.php | 4 +-- WEB-INF/resources/nl.lang.php | 4 +-- WEB-INF/resources/no.lang.php | 4 +-- WEB-INF/resources/pl.lang.php | 4 +-- WEB-INF/resources/pt-br.lang.php | 46 +++++++++++++++----------------- WEB-INF/resources/pt.lang.php | 4 +-- WEB-INF/resources/ro.lang.php | 4 +-- WEB-INF/resources/ru.lang.php | 4 +-- WEB-INF/resources/sk.lang.php | 4 +-- WEB-INF/resources/sl.lang.php | 4 +-- WEB-INF/resources/sr.lang.php | 4 +-- WEB-INF/resources/sv.lang.php | 4 +-- WEB-INF/resources/tr.lang.php | 4 +-- WEB-INF/resources/zh-cn.lang.php | 4 +-- WEB-INF/resources/zh-tw.lang.php | 4 +-- initialize.php | 2 +- 31 files changed, 81 insertions(+), 83 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index c91a3ae3..205600d0 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -520,8 +520,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Número de factura', 'form.invoice.person' => 'Persona', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 2829fc0f..7a685029 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -529,8 +529,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Faktura číslo', 'form.invoice.person' => 'Osoba', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index bec944e1..3cb53a5a 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -503,8 +503,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Fakturanummer', 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 2c270748..c0d69b6d 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -489,8 +489,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Rechnungsnummer', 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 2339a996..1acc7908 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -472,8 +472,8 @@ 'form.templates.active_templates' => 'Active Templates', 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Invoice number', 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index c538fbc9..ebe095e9 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -533,8 +533,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Número de factura', 'form.invoice.person' => 'Persona', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 08f392f6..961b8e2b 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -515,8 +515,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Arve number', 'form.invoice.person' => 'Isik', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 75220b46..798406cc 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -524,8 +524,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'شماره فاکتور', 'form.invoice.person' => 'شخص', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index a497a690..813b442f 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -509,8 +509,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Laskun numero', 'form.invoice.person' => 'Henkilö', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index d1b0bc90..e2642ad2 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -500,8 +500,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Numéro de facture', 'form.invoice.person' => 'Personne', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 647475c4..5a6a8df8 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -495,8 +495,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Αριθμός τιμολογίου', 'form.invoice.person' => 'Άτομο', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 8ad1fe77..958a556e 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -528,8 +528,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'מספר חשבונית', 'form.invoice.person' => 'משתמש', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 403e178b..22b28039 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -523,8 +523,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Számla azonosító száma', 'form.invoice.person' => 'Személy', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index c4825196..ab3852bf 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -508,8 +508,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Numero fattura', 'form.invoice.person' => 'Persona', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index df981bc5..85192f02 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -529,8 +529,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => '送り状の番号', 'form.invoice.person' => '個人', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 120734f7..202578fc 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -527,8 +527,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => '송장 번호', 'form.invoice.person' => '개인', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 2190504f..10c90514 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -455,8 +455,8 @@ 'form.templates.active_templates' => 'Actieve sjablonen', 'form.templates.inactive_templates' => 'Inactieve sjablonen', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Factuur nummer', 'form.invoice.person' => 'Medewerker', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index a0ebfcde..b3cf7886 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -527,8 +527,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Fakturanummer', 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 42ff3903..b0602334 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -511,8 +511,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Numer faktury', 'form.invoice.person' => 'Osoba', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index d736843a..52193b87 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -404,18 +404,16 @@ 'form.time.duration_format' => '(hh:mm ou 0.0h)', 'form.time.billable' => 'Faturável', 'form.time.uncompleted' => 'Incompleta', -// TODO: translate the following. -// 'form.time.remaining_quota' => 'Remaining quota', -// 'form.time.over_quota' => 'Over quota', -// 'form.time.remaining_balance' => 'Remaining balance', -// 'form.time.over_balance' => 'Over balance', +'form.time.remaining_quota' => 'Cota restante', // TODO: check if this translation is correct. I changed it from "Cota excedente", which appears to be wrong. +'form.time.over_quota' => 'Acima da cota', +'form.time.remaining_balance' => 'Saldo restante', +'form.time.over_balance' => 'Saldo excedente', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). 'form.time_edit.uncompleted' => 'Eesta entrada foi salva somente com hora de início. Não é um erro.', // Week view form. See example at https://timetracker.anuko.com/week.php. -// TODO: translate the following. -// 'form.week.new_entry' => 'New entry', +'form.week.new_entry' => 'Nova entrada', // Reports form. See example at https://timetracker.anuko.com/reports.php 'form.reports.save_as_favorite' => 'Guardar como favorito', @@ -424,16 +422,19 @@ 'form.reports.include_not_billable' => 'não faturável', 'form.reports.include_invoiced' => 'faturado', 'form.reports.include_not_invoiced' => 'não faturado', -// TODO: translate the following. -// 'form.reports.include_assigned' => 'assigned', -// 'form.reports.include_not_assigned' => 'not assigned', -// 'form.reports.include_pending' => 'pending', +'form.reports.include_assigned' => 'atribuído', +'form.reports.include_not_assigned' => 'não atribuído', +'form.reports.include_pending' => 'pendente', 'form.reports.select_period' => 'Selecione o período de tempo', 'form.reports.set_period' => 'ou selecionar datas', 'form.reports.show_fields' => 'Exibir campos', -// TODO: translate the following. +// TODO: Try to improve the translation of form.reports.time_fields. This is a label for a section of custom fields that +// are associated with a time record. I suggest trying custom fields plugin, creating a few "time" custom fields, and seeing how +// reports.php page looks like. For example, one may create a "Ticket #" or a "Property" custom fields to be associated with time entries, +// the form.reports.time_fields groups these fields together on reports.php. // 'form.reports.time_fields' => 'Time fields', -// 'form.reports.user_fields' => 'User fields', +// 'form.reports.time_fields' => 'Campos de apontamento', +'form.reports.user_fields' => 'Campos de usuário', 'form.reports.group_by' => 'Agrupar por', 'form.reports.group_by_no' => '--- sem agrupar ---', 'form.reports.group_by_date' => 'data', @@ -445,22 +446,19 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportar', -// TODO: translate the following. -// 'form.report.assign_to_invoice' => 'Assign to invoice', -// 'form.report.assign_to_timesheet' => 'Assign to timesheet', +'form.report.assign_to_invoice' => 'Atribuir a fatura', +'form.report.assign_to_timesheet' => 'Atribuir a planilha de horas', // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php -// TODO: translate the following. -// 'form.timesheets.active_timesheets' => 'Active Timesheets', -// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets', +'form.timesheets.active_timesheets' => 'Planilhas de horas ativas', +'form.timesheets.inactive_timesheets' => 'Planilhas de horas inativas', // Templates form. See example at https://timetracker.anuko.com/templates.php -// TODO: translate the following. -// 'form.templates.active_templates' => 'Active Templates', -// 'form.templates.inactive_templates' => 'Inactive Templates', +'form.templates.active_templates' => 'Modelos ativos', +'form.templates.inactive_templates' => 'Modelos inativos', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Número da fatura', 'form.invoice.person' => 'Pessoa', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 2bd9783f..9a26f283 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -505,8 +505,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). // TODO: translate the following. // 'form.invoice.number' => 'Invoice number', // 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 561543d4..95e27a12 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -527,8 +527,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Numar factura', 'form.invoice.person' => 'Persoana', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index c5c01a17..cb4abe57 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -452,8 +452,8 @@ 'form.templates.active_templates' => 'Активные шаблоны', 'form.templates.inactive_templates' => 'Неактивные шаблоны', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Номер счёта', 'form.invoice.person' => 'Работник', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 68ba1055..821c23b4 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -514,8 +514,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Číslo faktúry', 'form.invoice.person' => 'Osoba', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 0942fbbd..bb37b863 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -500,8 +500,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). // TODO: translate the following. // 'form.invoice.number' => 'Invoice number', // 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index a7118c7c..e1f9a28e 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -511,8 +511,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Forma izveštaja. Pogledajte primer na https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Broj računa', 'form.invoice.person' => 'Osoba', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 66f1b159..cea1ddd8 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -509,8 +509,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Fakturanummer', 'form.invoice.person' => 'Person', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 7ae9c8e0..b94ba8d9 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -539,8 +539,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => 'Fatura numarası', 'form.invoice.person' => 'Kişi', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index f370b737..0a6e4ab2 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -516,8 +516,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => '发票号码', 'form.invoice.person' => '人', // TODO: is this correct? diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index c7985b99..2efd7bbe 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -519,8 +519,8 @@ // 'form.templates.active_templates' => 'Active Templates', // 'form.templates.inactive_templates' => 'Inactive Templates', -// Invoice form. See example at https://timetracker.anuko.com/invoice.php -// (you can get to this form after generating a report). +// Invoice form. See example at https://timetracker.anuko.com/invoice_view.php +// (you can get to this form after generating an invoice). 'form.invoice.number' => '發票號碼', 'form.invoice.person' => '人', // TODO: is this correct? diff --git a/initialize.php b/initialize.php index 80ad77c0..33974fb7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5578"); +define("APP_VERSION", "1.19.28.5579"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 2ac0bd2cc5b5d9b512476d884540b06b6c5f374a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 23:09:50 +0000 Subject: [PATCH 051/304] Finished integrating good changes from pr #111. --- WEB-INF/resources/pt-br.lang.php | 157 +++++++++++++++---------------- initialize.php | 2 +- 2 files changed, 75 insertions(+), 84 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 52193b87..f9085c53 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -465,8 +465,7 @@ // Deleting Invoice form. See example at https://timetracker.anuko.com/invoice_delete.php 'form.invoice.invoice_to_delete' => 'Fatura a ser apagada', 'form.invoice.invoice_entries' => 'Entradas de fatura', -// TODO: translate the following. -// 'form.invoice.confirm_deleting_entries' => 'Please confirm deleting invoice entries from Time Tracker.', +'form.invoice.confirm_deleting_entries' => 'Confirme a exclusão das entradas de fatura do Time Tracker.', // Charts form. See example at https://timetracker.anuko.com/charts.php 'form.charts.interval' => 'Intervalo', @@ -481,8 +480,12 @@ 'form.tasks.inactive_tasks' => 'Tarefas inativas', // Users form. See example at https://timetracker.anuko.com/users.php -// TODO: translate the following. +// TODO: check the translation of form.users.uncompleted_entry. Is "apontamento" a correct term for a time entry? +// The meaning of incomplete time entry in Time Tracker is that the entry only has the "start" time defined, but no finish time yet, +// and may be ongoing. For example, user started working on something and is curently in progress doing it. +// Check the Puncher plugin, which operates with such entries. // 'form.users.uncompleted_entry' => 'User has an uncompleted time entry', +'form.users.uncompleted_entry' => 'O usuário tem um apontamento incompleto', 'form.users.role' => 'Papel', 'form.users.manager' => 'Gerente', 'form.users.comanager' => 'Coordenador', @@ -490,17 +493,15 @@ 'form.users.default_rate' => 'Honorário padrão por hora', // Editing User form. See example at https://timetracker.anuko.com/user_edit.php -// TODO: translate the following. -// 'form.user_edit.swap_roles' => 'Swap roles', +'form.user_edit.swap_roles' => 'Alternar papéis', // Roles form. See example at https://timetracker.anuko.com/roles.php -// TODO: translate the following. -// 'form.roles.active_roles' => 'Active Roles', -// 'form.roles.inactive_roles' => 'Inactive Roles', -// 'form.roles.rank' => 'Rank', -// 'form.roles.rights' => 'Rights', -// 'form.roles.assigned' => 'Assigned', -// 'form.roles.not_assigned' => 'Not assigned', +'form.roles.active_roles' => 'Papéis ativos', +'form.roles.inactive_roles' => 'Papéis inativos', +'form.roles.rank' => 'Rank', +'form.roles.rights' => 'Direitos', +'form.roles.assigned' => 'Atribuído', +'form.roles.not_assigned' => 'Não atribuído', // Clients form. See example at https://timetracker.anuko.com/clients.php 'form.clients.active_clients' => 'Clientes ativos', @@ -529,9 +530,8 @@ // Group Settings form. See example at https://timetracker.anuko.com/group_edit.php. 'form.group_edit.12_hours' => '12 horas', 'form.group_edit.24_hours' => '24 horas', -// TODO: translate the following. -// 'form.group_edit.display_options' => 'Display options', -// 'form.group_edit.holidays' => 'Holidays', +'form.group_edit.display_options' => 'Opções de exibição', +'form.group_edit.holidays' => 'Feriados', 'form.group_edit.tracking_mode' => 'Modo de acompanhamento', 'form.group_edit.mode_time' => 'tempo', 'form.group_edit.mode_projects' => 'projetos', @@ -540,18 +540,16 @@ 'form.group_edit.type_all' => 'todos', 'form.group_edit.type_start_finish' => 'início e fim', 'form.group_edit.type_duration' => 'duração', -// TODO: translate the following. -// 'form.group_edit.punch_mode' => 'Punch mode', -// 'form.group_edit.allow_overlap' => 'Allow overlap', -// 'form.group_edit.future_entries' => 'Future entries', -// 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', -// 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.advanced_settings' => 'Advanced settings', +'form.group_edit.punch_mode' => 'Modo punch', +'form.group_edit.allow_overlap' => 'Permitir sobreposição', +'form.group_edit.future_entries' => 'Entradas futuros', +'form.group_edit.uncompleted_indicators' => 'Indicadores incompletos', +'form.group_edit.confirm_save' => 'Confirme o salvamento', +'form.group_edit.allow_ip' => 'Permitir IP', +'form.group_edit.advanced_settings' => 'Configurações avançadas', // 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?', +'form.group_delete.hint' => 'Tem certeza de que deseja excluir todo o grupo?', // Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report. 'form.mail.to' => 'Para', @@ -561,74 +559,67 @@ 'form.mail.invoice_sent' => 'Fatura enviada.', // Quotas configuration form. See example at https://timetracker.anuko.com/quotas.php after enabling Monthly quotas plugin. -// TODO: translate the following. -// 'form.quota.year' => 'Year', -// 'form.quota.month' => 'Month', -// 'form.quota.workday_hours' => 'Hours in a work day', -// 'form.quota.hint' => 'If values are empty, quotas are calculated automatically based on workday hours and holidays.', +'form.quota.year' => 'Ano', +'form.quota.month' => 'Mês', +'form.quota.workday_hours' => 'Horas em um dia útil', +'form.quota.hint' => 'Se os valores estiverem vazios, as cotas serão calculadas automaticamente com base nas horas de trabalho e feriados.', // Swap roles form. See example at https://timetracker.anuko.com/swap_roles.php. -// TODO: translate the following. -// 'form.swap.hint' => 'Demote yourself to a lower role by swapping roles with someone else. This cannot be undone.', -// 'form.swap.swap_with' => 'Swap roles with', +'form.swap.hint' => 'Rebaixe-se a papel inferior trocando funções com outra pessoa. Isto não pode ser desfeito.', +'form.swap.swap_with' => 'Trocar papéis com', // Work Units configuration form. See example at https://timetracker.anuko.com/work_units.php after enabling Work units plugin. -// TODO: translate the following. -// 'form.work_units.minutes_in_unit' => 'Minutes in unit', -// 'form.work_units.1st_unit_threshold' => '1st unit threshold', +'form.work_units.minutes_in_unit' => 'Minutos em unidade', +'form.work_units.1st_unit_threshold' => 'Limiar da 1ª unidade', // Roles and rights. These strings are used in multiple places. Grouped here to provide consistent translations. -// TODO: translate the following. -// 'role.user.label' => 'User', -// 'role.user.low_case_label' => 'user', -// 'role.user.description' => 'A regular member without management rights.', -// 'role.client.label' => 'Client', -// 'role.client.low_case_label' => 'client', -// 'role.client.description' => 'A client can view its own data.', -// 'role.supervisor.label' => 'Supervisor', -// 'role.supervisor.low_case_label' => 'supervisor', -// 'role.supervisor.description' => 'A person with a small set of management rights.', -// 'role.comanager.label' => 'Co-manager', -// 'role.comanager.low_case_label' => 'co-manager', -// 'role.comanager.description' => 'A person with a big set of management functions.', -// 'role.manager.label' => 'Manager', -// 'role.manager.low_case_label' => 'manager', -// 'role.manager.description' => 'Group manager. Can do most of things for a group.', -// 'role.top_manager.label' => 'Top manager', -// 'role.top_manager.low_case_label' => 'top manager', -// 'role.top_manager.description' => 'Top group manager. Can do everything in a tree of groups.', -// 'role.admin.label' => 'Administrator', -// 'role.admin.low_case_label' => 'administrator', -// 'role.admin.description' => 'Site adminsitrator.', +'role.user.label' => 'Usuário', +'role.user.low_case_label' => 'usuário', +'role.user.description' => 'Um membro regular sem direitos de gestão.', +'role.client.label' => 'Cliente', +'role.client.low_case_label' => 'cliente', +'role.client.description' => 'Um cliente pode visualizar seus próprios dados.', +'role.supervisor.label' => 'Supervisor', +'role.supervisor.low_case_label' => 'supervisor', +'role.supervisor.description' => 'Uma pessoa com um pequeno conjunto de direitos de gerenciamento.', +'role.comanager.label' => 'Co-gerente', +'role.comanager.low_case_label' => 'co-gerente', +'role.comanager.description' => 'Uma pessoa com um grande conjunto de funções de gerenciamento.', +'role.manager.label' => 'Gerente', +'role.manager.low_case_label' => 'gerente', +'role.manager.description' => 'Gerente de grupo. Pode fazer a maioria das coisas para um grupo.', +'role.top_manager.label' => 'Gerente geral', +'role.top_manager.low_case_label' => 'gerente geral', +'role.top_manager.description' => 'Principal gerente de grupo. Pode fazer tudo em uma árvore de grupos.', +'role.admin.label' => 'Administrador', +'role.admin.low_case_label' => 'administrador', +'role.admin.description' => 'Adminsitrador do site/sistema.', // Timesheet View form. See example at https://timetracker.anuko.com/timesheet_view.php. -// TODO: translate the following. -// 'form.timesheet_view.submit_subject' => 'Timesheet approval request', -// 'form.timesheet_view.submit_body' => "A new timesheet requires approval.

User: %s.", -// 'form.timesheet_view.approve_subject' => 'Timesheet approved', -// 'form.timesheet_view.approve_body' => "Your timesheet %s was approved.

%s", -// 'form.timesheet_view.disapprove_subject' => 'Timesheet not approved', -// 'form.timesheet_view.disapprove_body' => "Your timesheet %s was not approved.

%s", +'form.timesheet_view.submit_subject' => 'Solicitação de aprovação de planilha de horas', +'form.timesheet_view.submit_body' => "Uma nova planilha de horas requer aprovação.

Usuário: %s.", +'form.timesheet_view.approve_subject' => 'Planilha de horas aprovada', +'form.timesheet_view.approve_body' => "Sua planilha de horas %s foi aprovada.

%s", +'form.timesheet_view.disapprove_subject' => 'Planilha de horas não aprovada', +'form.timesheet_view.disapprove_body' => "Sua planilha de horas %s não foi aprovada.

%s", // Display Options form. See example at https://timetracker.anuko.com/display_options.php. -// TODO: translate the following. -// 'form.display_options.note_on_separate_row' => 'Note on separate row', -// 'form.display_options.not_complete_days' => 'Not complete days', -// 'form.display_options.custom_css' => 'Custom CSS', +'form.display_options.note_on_separate_row' => 'Anotação em linha separada', +'form.display_options.not_complete_days' => 'Dias não completos', +'form.display_options.custom_css' => 'CSS customizado', // Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', +'work.error.work_not_available' => 'Item de trabalho não está disponível.', +'work.error.offer_not_available' => 'Oferta não disponível', +'work.type.one_time' => 'Uma interação', +'work.type.ongoing' => 'Em progresso', +'work.label.own_work' => 'Trabalho próprio', +'work.label.own_offers' => 'Ofertas próprias', +'work.label.offers' => 'Ofertas', +'work.button.send_message' => 'Enviar mensagem', +'work.button.make_offer' => 'Fazer oferta', +'work.button.accept' => 'Aceitar', +'work.button.decline' => 'Recusar', +'work.title.send_message' => 'Enviando mensagem', +'work.msg.message_sent' => 'Mensagem enviada.', ); diff --git a/initialize.php b/initialize.php index 33974fb7..a89b0c28 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5579"); +define("APP_VERSION", "1.19.28.5580"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 9e937b53f8265d44579fdab0de1b9074582125b0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Jun 2021 23:17:58 +0000 Subject: [PATCH 052/304] Improved TODO comments for pt-br translators. --- WEB-INF/resources/pt-br.lang.php | 16 ++++++++-------- initialize.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index f9085c53..38ca0dfe 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -106,9 +106,9 @@ 'button.reset_password' => 'Resetar senha', 'button.send' => 'Enviar', 'button.send_by_email' => 'Enviar por e-mail', -'button.create_group' => 'Criar equipe', // TODO: replace "team" with "group". -'button.export' => 'Exportar equipe', // TODO: replace "team" with "group". -'button.import' => 'Importar equipe', // TODO: replace "team" with "group". +'button.create_group' => 'Criar equipe', // TODO: replace "equipe" with "group". +'button.export' => 'Exportar equipe', // TODO: replace "equipe" with "group". +'button.import' => 'Importar equipe', // TODO: replace "equipe" with "group". 'button.close' => 'Fechar', 'button.start' => 'Iniciar', 'button.stop' => 'Parar', @@ -117,7 +117,7 @@ // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', -'label.group_name' => 'Nome da equipe', // TODO: replace "team" with "group". +'label.group_name' => 'Nome da equipe', // TODO: replace "equipe" with "group". 'label.address' => 'Endereço', 'label.currency' => 'Moeda', 'label.manager_name' => 'Nome do gerente', @@ -306,8 +306,8 @@ 'title.edit_timesheet' => 'Editando planilha de horas', 'title.delete_timesheet' => 'Apagando planilha de horas', 'title.monthly_quotas' => 'Cotas mensais', -'title.export' => 'Exportando dados de equipe', // TODO: replace "team" with "group". -'title.import' => 'Importando dados de equipe', // TODO: replace "team" with "group". +'title.export' => 'Exportando dados de equipe', // TODO: replace "equipe" with "group". +'title.import' => 'Importando dados de equipe', // TODO: replace "equipe" with "group". 'title.options' => 'Opções', 'title.display_options' => 'Opções de exibição', 'title.profile' => 'Perfil', @@ -512,7 +512,7 @@ 'form.client.client_entries' => 'Entradas de cliente', // Exporting Group Data form. See example at https://timetracker.anuko.com/export.php -// TODO: replace "team" with "group" in the string below. +// TODO: replace "equipe" with "group" in the string below. 'form.export.hint' => 'Você pode exportar todos os dados da equipe para um arquivo xml. Isto pode ser útil se você estiver migrando os dados para um servidor próprio.', 'form.export.compression' => 'Compressão', 'form.export.compression_none' => 'nenhuma', @@ -524,7 +524,7 @@ 'form.import.success' => 'Importação realizada com sucesso.', // Groups form. See example at https://timetracker.anuko.com/admin_groups.php (login as admin first). -// TODO: replace "team" with "group" in the string below (3 places). +// TODO: replace "equipe" with "group" in the string below (3 places). 'form.groups.hint' => 'Crie uma nova equipe fazendo uma nova conta de gerente.
Você também pode importar os dados de um arquivo xml de outro servidor Anuko Time Tracker (não havendo colisão de usuários).', // Group Settings form. See example at https://timetracker.anuko.com/group_edit.php. diff --git a/initialize.php b/initialize.php index a89b0c28..24ac12b5 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5580"); +define("APP_VERSION", "1.19.28.5581"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 387034aed0193e99e1ac6cc3e01977118064201c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Jun 2021 18:06:29 +0000 Subject: [PATCH 053/304] Dutch translation improved. --- WEB-INF/resources/nl.lang.php | 12 ++++-------- initialize.php | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 10c90514..51d4e41e 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -23,8 +23,7 @@ 'menu.group' => 'Groep', 'menu.plugins' => 'Plugins', 'menu.time' => 'Tijden', -// TODO: translate the following: -// 'menu.puncher' => 'Punch', +'menu.puncher' => 'Prikklok', 'menu.week' => 'Week', 'menu.expenses' => 'Kosten', 'menu.reports' => 'Rapporten', @@ -108,8 +107,7 @@ 'button.export' => 'Groep exporteren', 'button.import' => 'Groep importeren', 'button.close' => 'Sluiten', -// TODO: translate the following. -// 'button.start' => 'Start', +'button.start' => 'Start', 'button.stop' => 'Stop', 'button.approve' => 'Goedkeuren', 'button.disapprove' => 'Afkeuren', @@ -167,8 +165,7 @@ 'label.select_none' => 'Selecteer niets', 'label.day_view' => 'Dag overzicht', 'label.week_view' => 'Week overzicht', -// TODO: translate the following. -// 'label.puncher' => 'Puncher', +'label.puncher' => 'Prikklok', 'label.id' => 'ID', 'label.language' => 'Taal', 'label.decimal_mark' => 'Decimaal teken', @@ -257,8 +254,7 @@ 'title.edit_time_record' => 'Wijzigen tijdrecord', 'title.delete_time_record' => 'Verwijder tijdrecord', 'title.time_files' => 'Tijden bestanden', -// TODO: Translate the following: -// 'title.puncher' => 'Puncher', +'title.puncher' => 'Prikklok', 'title.expenses' => 'Kosten', 'title.edit_expense' => 'Bewerk kosten artikel', 'title.delete_expense' => 'Verwijder kosten artikel', diff --git a/initialize.php b/initialize.php index 24ac12b5..b5407ad8 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5581"); +define("APP_VERSION", "1.19.28.5582"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From c446afd20b43b27d34a840010ccf114f1eeb7b53 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 24 Jun 2021 17:08:40 +0000 Subject: [PATCH 054/304] Cosmetic change to .gitignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 92e2728c..d81178e1 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ Thumbs.db *.DS_Store *~ .idea/ +api/ From 0b57ed4799b8ab05e9add3028977fb79d7c6fb90 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 6 Jul 2021 15:19:18 +0000 Subject: [PATCH 055/304] Integrating useful changes from pr#111 with yet some remaining todo. --- WEB-INF/resources/pt-br.lang.php | 95 ++++++++++++++------------------ initialize.php | 2 +- 2 files changed, 42 insertions(+), 55 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 38ca0dfe..3e2c6526 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -62,16 +62,15 @@ 'error.user_exists' => 'Já existe usuário com este login.', 'error.object_exists' => 'Já existe um objeto com este nome.', 'error.invoice_exists' => 'Já existe fatura com este número.', -// TODO: improve translation of the word "role" in error.role_exists. função here, papel elsewhere? 'error.role_exists' => 'Já existe uma função com este rank.', 'error.no_invoiceable_items' => 'Não há items faturáveis.', 'error.no_records' => 'Não há registros.', 'error.no_login' => 'Não há usuário com este login.', 'error.no_groups' => 'Sua base de dados está vazia. Entre como admin e crie um grupo novo.', 'error.upload' => 'Erro no envio do arquivo.', -'error.range_locked' => 'Período está bloqueado.', -'error.mail_send' => 'Erro enviando o e-mail.', -// TODO: is "Use" in error.mail_send translated correctly? +'error.range_locked' => 'Período bloqueado.', +// TODO: is "Use" in error.mail_send translated correctly? Usar, or utilizar, perhaps? "Use" looks like an untranslated English word. +// The meaning of this error is that mail send feature did not work, and using MAIL_SMTP_DEBUG should help admin to troubleshoot it. 'error.mail_send' => 'Erro ao enviar e-mail. Use MAIL_SMTP_DEBUG para diagnósticos.', 'error.no_email' => 'Não há e-mail associado a este login.', 'error.uncompleted_exists' => 'Entrada incompleta existente. Feche ou remova-a.', @@ -106,9 +105,9 @@ 'button.reset_password' => 'Resetar senha', 'button.send' => 'Enviar', 'button.send_by_email' => 'Enviar por e-mail', -'button.create_group' => 'Criar equipe', // TODO: replace "equipe" with "group". -'button.export' => 'Exportar equipe', // TODO: replace "equipe" with "group". -'button.import' => 'Importar equipe', // TODO: replace "equipe" with "group". +'button.create_group' => 'Criar grupo', +'button.export' => 'Exportar grupo', +'button.import' => 'Importar grupo', 'button.close' => 'Fechar', 'button.start' => 'Iniciar', 'button.stop' => 'Parar', @@ -117,7 +116,7 @@ // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', -'label.group_name' => 'Nome da equipe', // TODO: replace "equipe" with "group". +'label.group_name' => 'Nome do grupo', 'label.address' => 'Endereço', 'label.currency' => 'Moeda', 'label.manager_name' => 'Nome do gerente', @@ -286,10 +285,9 @@ 'title.edit_user' => 'Editando usuário', 'title.delete_user' => 'Apagando usuário', 'title.roles' => 'Papéis', -// TODO: translate the following. -// 'title.add_role' => 'Adding Role', -// 'title.edit_role' => 'Editing Role', -// 'title.delete_role' => 'Deleting Role', +'title.add_role' => 'Adicionando função', +'title.edit_role' => 'Editando função', +'title.delete_role' => 'Apagando função', 'title.clients' => 'Clientes', 'title.add_client' => 'Adicionando cliente', 'title.edit_client' => 'Editando cliente', @@ -306,8 +304,8 @@ 'title.edit_timesheet' => 'Editando planilha de horas', 'title.delete_timesheet' => 'Apagando planilha de horas', 'title.monthly_quotas' => 'Cotas mensais', -'title.export' => 'Exportando dados de equipe', // TODO: replace "equipe" with "group". -'title.import' => 'Importando dados de equipe', // TODO: replace "equipe" with "group". +'title.export' => 'Exportando dados do grupo', +'title.import' => 'Importando dados do grupo', 'title.options' => 'Opções', 'title.display_options' => 'Opções de exibição', 'title.profile' => 'Perfil', @@ -362,7 +360,7 @@ 'dropdown.previous_month' => 'último mês', 'dropdown.selected_month' => 'mês', 'dropdown.current_year' => 'este ano', -'dropdown.previous_year' => 'último ano', // TODO: check if this is correct. I used último for consistency with other dropdown options. +'dropdown.previous_year' => 'último ano', 'dropdown.selected_year' => 'ano', 'dropdown.all_time' => 'todas as datas', 'dropdown.projects' => 'projetos', @@ -404,7 +402,7 @@ 'form.time.duration_format' => '(hh:mm ou 0.0h)', 'form.time.billable' => 'Faturável', 'form.time.uncompleted' => 'Incompleta', -'form.time.remaining_quota' => 'Cota restante', // TODO: check if this translation is correct. I changed it from "Cota excedente", which appears to be wrong. +'form.time.remaining_quota' => 'Cota restante', 'form.time.over_quota' => 'Acima da cota', 'form.time.remaining_balance' => 'Saldo restante', 'form.time.over_balance' => 'Saldo excedente', @@ -415,7 +413,7 @@ // Week view form. See example at https://timetracker.anuko.com/week.php. 'form.week.new_entry' => 'Nova entrada', -// Reports form. See example at https://timetracker.anuko.com/reports.php +// Reports form. See example at https://timetracker.anuko.com/reports.php. 'form.reports.save_as_favorite' => 'Guardar como favorito', 'form.reports.confirm_delete' => 'Tem certeza que deseja remover este relatório dos favoritos?', 'form.reports.include_billable' => 'faturável', @@ -428,12 +426,7 @@ 'form.reports.select_period' => 'Selecione o período de tempo', 'form.reports.set_period' => 'ou selecionar datas', 'form.reports.show_fields' => 'Exibir campos', -// TODO: Try to improve the translation of form.reports.time_fields. This is a label for a section of custom fields that -// are associated with a time record. I suggest trying custom fields plugin, creating a few "time" custom fields, and seeing how -// reports.php page looks like. For example, one may create a "Ticket #" or a "Property" custom fields to be associated with time entries, -// the form.reports.time_fields groups these fields together on reports.php. -// 'form.reports.time_fields' => 'Time fields', -// 'form.reports.time_fields' => 'Campos de apontamento', +'form.reports.time_fields' => 'Campos de tempo', 'form.reports.user_fields' => 'Campos de usuário', 'form.reports.group_by' => 'Agrupar por', 'form.reports.group_by_no' => '--- sem agrupar ---', @@ -449,11 +442,11 @@ 'form.report.assign_to_invoice' => 'Atribuir a fatura', 'form.report.assign_to_timesheet' => 'Atribuir a planilha de horas', -// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php +// Timesheets form. See example at https://timetracker.anuko.com/timesheets.php. 'form.timesheets.active_timesheets' => 'Planilhas de horas ativas', 'form.timesheets.inactive_timesheets' => 'Planilhas de horas inativas', -// Templates form. See example at https://timetracker.anuko.com/templates.php +// Templates form. See example at https://timetracker.anuko.com/templates.php. 'form.templates.active_templates' => 'Modelos ativos', 'form.templates.inactive_templates' => 'Modelos inativos', @@ -462,70 +455,63 @@ 'form.invoice.number' => 'Número da fatura', 'form.invoice.person' => 'Pessoa', -// Deleting Invoice form. See example at https://timetracker.anuko.com/invoice_delete.php +// Deleting Invoice form. See example at https://timetracker.anuko.com/invoice_delete.php. 'form.invoice.invoice_to_delete' => 'Fatura a ser apagada', 'form.invoice.invoice_entries' => 'Entradas de fatura', 'form.invoice.confirm_deleting_entries' => 'Confirme a exclusão das entradas de fatura do Time Tracker.', -// Charts form. See example at https://timetracker.anuko.com/charts.php +// Charts form. See example at https://timetracker.anuko.com/charts.php. 'form.charts.interval' => 'Intervalo', 'form.charts.chart' => 'Gráfico', -// Projects form. See example at https://timetracker.anuko.com/projects.php +// Projects form. See example at https://timetracker.anuko.com/projects.php. 'form.projects.active_projects' => 'Projetos ativos', 'form.projects.inactive_projects' => 'Projetos inativos', -// Tasks form. See example at https://timetracker.anuko.com/tasks.php +// Tasks form. See example at https://timetracker.anuko.com/tasks.php. 'form.tasks.active_tasks' => 'Tarefas ativas', 'form.tasks.inactive_tasks' => 'Tarefas inativas', -// Users form. See example at https://timetracker.anuko.com/users.php -// TODO: check the translation of form.users.uncompleted_entry. Is "apontamento" a correct term for a time entry? -// The meaning of incomplete time entry in Time Tracker is that the entry only has the "start" time defined, but no finish time yet, -// and may be ongoing. For example, user started working on something and is curently in progress doing it. -// Check the Puncher plugin, which operates with such entries. -// 'form.users.uncompleted_entry' => 'User has an uncompleted time entry', -'form.users.uncompleted_entry' => 'O usuário tem um apontamento incompleto', -'form.users.role' => 'Papel', +// Users form. See example at https://timetracker.anuko.com/users.php. +'form.users.uncompleted_entry' => 'O usuário tem uma entrada incompleta', +'form.users.role' => 'Função', 'form.users.manager' => 'Gerente', 'form.users.comanager' => 'Coordenador', 'form.users.rate' => 'Honorário', 'form.users.default_rate' => 'Honorário padrão por hora', -// Editing User form. See example at https://timetracker.anuko.com/user_edit.php -'form.user_edit.swap_roles' => 'Alternar papéis', +// Editing User form. See example at https://timetracker.anuko.com/user_edit.php. +'form.user_edit.swap_roles' => 'Alternar funções', -// Roles form. See example at https://timetracker.anuko.com/roles.php -'form.roles.active_roles' => 'Papéis ativos', -'form.roles.inactive_roles' => 'Papéis inativos', +// Roles form. See example at https://timetracker.anuko.com/roles.php. +'form.roles.active_roles' => 'Funções ativas', +'form.roles.inactive_roles' => 'Funções inativas', 'form.roles.rank' => 'Rank', 'form.roles.rights' => 'Direitos', 'form.roles.assigned' => 'Atribuído', 'form.roles.not_assigned' => 'Não atribuído', -// Clients form. See example at https://timetracker.anuko.com/clients.php +// Clients form. See example at https://timetracker.anuko.com/clients.php. 'form.clients.active_clients' => 'Clientes ativos', 'form.clients.inactive_clients' => 'Clientes inativos', -// Deleting Client form. See example at https://timetracker.anuko.com/client_delete.php +// Deleting Client form. See example at https://timetracker.anuko.com/client_delete.php. 'form.client.client_to_delete' => 'Cliente a ser apagado', 'form.client.client_entries' => 'Entradas de cliente', -// Exporting Group Data form. See example at https://timetracker.anuko.com/export.php -// TODO: replace "equipe" with "group" in the string below. -'form.export.hint' => 'Você pode exportar todos os dados da equipe para um arquivo xml. Isto pode ser útil se você estiver migrando os dados para um servidor próprio.', +// Exporting Group Data form. See example at https://timetracker.anuko.com/export.php. +'form.export.hint' => 'Você pode exportar todos os dados do grupo para um arquivo xml. Isto pode ser útil se você estiver migrando os dados para um servidor próprio.', 'form.export.compression' => 'Compressão', 'form.export.compression_none' => 'nenhuma', 'form.export.compression_bzip' => 'bzip', // Importing Group Data form. See example at https://timetracker.anuko.com/import.php (login as admin first). -'form.import.hint' => 'Importar dados de equipe de um arquivo xml.', // TODO: replace "team" with "group". +'form.import.hint' => 'Importar dados do grupo de um arquivo xml.', 'form.import.file' => 'Selecionar arquivo', 'form.import.success' => 'Importação realizada com sucesso.', // Groups form. See example at https://timetracker.anuko.com/admin_groups.php (login as admin first). -// TODO: replace "equipe" with "group" in the string below (3 places). -'form.groups.hint' => 'Crie uma nova equipe fazendo uma nova conta de gerente.
Você também pode importar os dados de um arquivo xml de outro servidor Anuko Time Tracker (não havendo colisão de usuários).', +'form.groups.hint' => 'Crie um novo grupo fazendo uma nova conta de gerente.
Você também pode importar os dados de um arquivo xml de outro servidor Anuko Time Tracker (não havendo colisão de usuários).', // Group Settings form. See example at https://timetracker.anuko.com/group_edit.php. 'form.group_edit.12_hours' => '12 horas', @@ -548,7 +534,7 @@ 'form.group_edit.allow_ip' => 'Permitir IP', 'form.group_edit.advanced_settings' => 'Configurações avançadas', -// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php +// Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php. 'form.group_delete.hint' => 'Tem certeza de que deseja excluir todo o grupo?', // Mail form. See example at https://timetracker.anuko.com/report_send.php when emailing a report. @@ -565,8 +551,8 @@ 'form.quota.hint' => 'Se os valores estiverem vazios, as cotas serão calculadas automaticamente com base nas horas de trabalho e feriados.', // Swap roles form. See example at https://timetracker.anuko.com/swap_roles.php. -'form.swap.hint' => 'Rebaixe-se a papel inferior trocando funções com outra pessoa. Isto não pode ser desfeito.', -'form.swap.swap_with' => 'Trocar papéis com', +'form.swap.hint' => 'Rebaixe-se a função inferior trocando funções com outra pessoa. Isto não pode ser desfeito.', +'form.swap.swap_with' => 'Trocar papéis com', // TODO: replace papéis with funções? // Work Units configuration form. See example at https://timetracker.anuko.com/work_units.php after enabling Work units plugin. 'form.work_units.minutes_in_unit' => 'Minutos em unidade', @@ -608,7 +594,7 @@ 'form.display_options.not_complete_days' => 'Dias não completos', 'form.display_options.custom_css' => 'CSS customizado', -// Work plugin strings. See example at https://timetracker.anuko.com/work.php +// Work plugin strings. See example at https://timetracker.anuko.com/work.php. 'work.error.work_not_available' => 'Item de trabalho não está disponível.', 'work.error.offer_not_available' => 'Oferta não disponível', 'work.type.one_time' => 'Uma interação', @@ -623,3 +609,4 @@ 'work.title.send_message' => 'Enviando mensagem', 'work.msg.message_sent' => 'Mensagem enviada.', ); + diff --git a/initialize.php b/initialize.php index b5407ad8..f0b52b40 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5582"); +define("APP_VERSION", "1.19.28.5583"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 227ab161cfe26f605406ef31959449aa0ada0f27 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 7 Jul 2021 13:28:54 +0000 Subject: [PATCH 056/304] Minor improvement in pt-br file as per pr #111. --- WEB-INF/resources/pt-br.lang.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 3e2c6526..bef8e5f4 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -552,7 +552,7 @@ // Swap roles form. See example at https://timetracker.anuko.com/swap_roles.php. 'form.swap.hint' => 'Rebaixe-se a função inferior trocando funções com outra pessoa. Isto não pode ser desfeito.', -'form.swap.swap_with' => 'Trocar papéis com', // TODO: replace papéis with funções? +'form.swap.swap_with' => 'Trocar função com', // Work Units configuration form. See example at https://timetracker.anuko.com/work_units.php after enabling Work units plugin. 'form.work_units.minutes_in_unit' => 'Minutos em unidade', diff --git a/initialize.php b/initialize.php index f0b52b40..dc53874d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5583"); +define("APP_VERSION", "1.19.28.5584"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From f22d240ca21743681e52edecfa050450cd596213 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 7 Jul 2021 13:35:58 +0000 Subject: [PATCH 057/304] Added a comment in pt-br file. --- WEB-INF/resources/pt-br.lang.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index bef8e5f4..128f57f4 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -137,7 +137,7 @@ 'label.users' => 'Usuários', 'label.group' => 'Grupo', 'label.subgroups' => 'Subgrupos', -'label.roles' => 'Papéis', +'label.roles' => 'Papéis', // TODO: for consistency, use funçãos, perhaps? 'label.client' => 'Cliente', 'label.clients' => 'Clientes', 'label.option' => 'Opção', diff --git a/initialize.php b/initialize.php index dc53874d..c282d3f3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5584"); +define("APP_VERSION", "1.19.28.5585"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 7e78a97138a71ff4b8070d3ec354475ddf0b8e29 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 8 Jul 2021 13:37:19 +0000 Subject: [PATCH 058/304] Finished integrating changes from pr #111. --- WEB-INF/resources/pt-br.lang.php | 12 +++++------- initialize.php | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 128f57f4..5d3e2b6e 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -69,9 +69,7 @@ 'error.no_groups' => 'Sua base de dados está vazia. Entre como admin e crie um grupo novo.', 'error.upload' => 'Erro no envio do arquivo.', 'error.range_locked' => 'Período bloqueado.', -// TODO: is "Use" in error.mail_send translated correctly? Usar, or utilizar, perhaps? "Use" looks like an untranslated English word. -// The meaning of this error is that mail send feature did not work, and using MAIL_SMTP_DEBUG should help admin to troubleshoot it. -'error.mail_send' => 'Erro ao enviar e-mail. Use MAIL_SMTP_DEBUG para diagnósticos.', +'error.mail_send' => 'Erro ao enviar e-mail. Use MAIL_SMTP_DEBUG para diagnósticos.', // "Use" means the same in pt-br as in en. 'error.no_email' => 'Não há e-mail associado a este login.', 'error.uncompleted_exists' => 'Entrada incompleta existente. Feche ou remova-a.', 'error.goto_uncompleted' => 'Ir até a entrada incompleta.', @@ -137,7 +135,7 @@ 'label.users' => 'Usuários', 'label.group' => 'Grupo', 'label.subgroups' => 'Subgrupos', -'label.roles' => 'Papéis', // TODO: for consistency, use funçãos, perhaps? +'label.roles' => 'Funções', 'label.client' => 'Cliente', 'label.clients' => 'Clientes', 'label.option' => 'Opção', @@ -284,7 +282,7 @@ 'title.add_user' => 'Adicionando usuário', 'title.edit_user' => 'Editando usuário', 'title.delete_user' => 'Apagando usuário', -'title.roles' => 'Papéis', +'title.roles' => 'Funções', 'title.add_role' => 'Adicionando função', 'title.edit_role' => 'Editando função', 'title.delete_role' => 'Apagando função', @@ -320,7 +318,7 @@ 'title.cf_delete_dropdown_option' => 'Apagando opção', 'title.locking' => 'Bloquear', 'title.week_view' => 'Visão semanal', -'title.swap_roles' => 'Alteração de papéis', +'title.swap_roles' => 'Alteração de funções', 'title.work_units' => 'Unidades de trabalho', 'title.templates' => 'Modelos', 'title.add_template' => 'Adicionando modelo', @@ -408,7 +406,7 @@ 'form.time.over_balance' => 'Saldo excedente', // Editing Time Record form. See example at https://timetracker.anuko.com/time_edit.php (get there by editing an uncompleted time record). -'form.time_edit.uncompleted' => 'Eesta entrada foi salva somente com hora de início. Não é um erro.', +'form.time_edit.uncompleted' => 'Esta entrada foi salva somente com hora de início. Não é um erro.', // Week view form. See example at https://timetracker.anuko.com/week.php. 'form.week.new_entry' => 'Nova entrada', diff --git a/initialize.php b/initialize.php index c282d3f3..76b5058e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5585"); +define("APP_VERSION", "1.19.28.5586"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bd5871c86bd95adff6d429c3481f03ec9a244414 Mon Sep 17 00:00:00 2001 From: Thiago Alves Cavalcante Date: Thu, 8 Jul 2021 10:45:13 -0300 Subject: [PATCH 059/304] Add conditional if ldap is enabled on passwords (#112) Adds same conditional on verifications of passwords in case of ldap (external password) is enabled. Else is not possible create groups due to erros on this verification with ldap configured. --- admin_group_add.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/admin_group_add.php b/admin_group_add.php index 52850b60..9aeff183 100644 --- a/admin_group_add.php +++ b/admin_group_add.php @@ -69,12 +69,14 @@ $err->add($i18n->get('error.field'), $i18n->get('label.manager_login')); if (ttUserHelper::getUserByLogin($cl_manager_login)) $err->add($i18n->get('error.user_exists')); - if (!ttValidString($cl_password1)) - $err->add($i18n->get('error.field'), $i18n->get('label.password')); - if (!ttValidString($cl_password2)) - $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); - if ($cl_password1 !== $cl_password2) - $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + if (!$auth->isPasswordExternal()) { + if (!ttValidString($cl_password1)) + $err->add($i18n->get('error.field'), $i18n->get('label.password')); + if (!ttValidString($cl_password2)) + $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); + if ($cl_password1 !== $cl_password2) + $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + } if (!ttValidEmail($cl_manager_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); if (!ttUserHelper::canAdd()) From 0a94b8f7afe1ee14b69b15789fd751d928255dd4 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 20 Jul 2021 15:23:21 +0000 Subject: [PATCH 060/304] Fixed ttUser::getUserDetails() function to allow supervisors work on behalf of users. --- WEB-INF/lib/ttUser.class.php | 7 ++----- initialize.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index cf1065f0..2086a374 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -587,11 +587,8 @@ function getSubgroups($group_id = null) { return $groups; } - // getUserDetails function is used to manage users in group and returns user details. - // At the moment, the function is used for user edits and deletes. - function getUserDetails($user_id) { - if (!$this->can('manage_users')) return false; - + // getUserDetails function returns user details. + function getUserDetails($user_id) { $mdb2 = getConnection(); $group_id = $this->getGroup(); $org_id = $this->org_id; diff --git a/initialize.php b/initialize.php index 76b5058e..6b968992 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5586"); +define("APP_VERSION", "1.19.28.5587"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 36d735b4748bc786196f4b8c5f9ce72867aa1fe2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 21 Jul 2021 15:06:30 +0000 Subject: [PATCH 061/304] Work started on inactive projects display option for reports. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + initialize.php | 2 +- 31 files changed, 33 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 205600d0..5f37900b 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -682,6 +682,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 7a685029..0ff16955 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -695,6 +695,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 3cb53a5a..14265558 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -659,6 +659,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index c0d69b6d..86834287 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -636,6 +636,7 @@ 'form.display_options.note_on_separate_row' => 'Beschreibung in separater Zeile', // TODO: translate the following. // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 1acc7908..93d77217 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -614,6 +614,7 @@ // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Note on separate row', 'form.display_options.not_complete_days' => 'Not complete days', +'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index ebe095e9..1fb69298 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -697,6 +697,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 961b8e2b..28693401 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -667,6 +667,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 798406cc..7d453ef3 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -683,6 +683,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 813b442f..f45dec85 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -667,6 +667,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index e2642ad2..168b01a5 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -655,6 +655,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 5a6a8df8..3b1ca388 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -647,6 +647,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 958a556e..2ed161e3 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -688,6 +688,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 22b28039..78971e4f 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -686,6 +686,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index ab3852bf..d1c172a5 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -661,6 +661,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 85192f02..2e1b012d 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -690,6 +690,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 202578fc..a5960229 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -688,6 +688,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 51d4e41e..c261b749 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -593,6 +593,8 @@ // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Notitie in aparte kolom', // Translator (Henk) comment: "kolom is the right word in Dutch." 'form.display_options.not_complete_days' => 'Niet complete dagen', +// TODO: translate the following. +// 'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.custom_css' => 'Aangepaste CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index b3cf7886..6a6161f5 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -689,6 +689,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index b0602334..376f324b 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -668,6 +668,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 5d3e2b6e..db850303 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -590,6 +590,8 @@ // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Anotação em linha separada', 'form.display_options.not_complete_days' => 'Dias não completos', +// TODO: translate the following. +// 'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.custom_css' => 'CSS customizado', // Work plugin strings. See example at https://timetracker.anuko.com/work.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 9a26f283..4617faf4 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -669,6 +669,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 95e27a12..d325468c 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -690,6 +690,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index cb4abe57..5fbca603 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -594,6 +594,7 @@ // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Комментарий в отдельном ряду', 'form.display_options.not_complete_days' => 'Незавершенные дни', +'form.display_options.inactive_projects' => 'Неактивные проекты', 'form.display_options.custom_css' => 'Пользовательская CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 821c23b4..d8add50c 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -672,6 +672,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index bb37b863..ac49e7d8 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -663,6 +663,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index e1f9a28e..6fcae026 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -670,6 +670,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index cea1ddd8..49df0665 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -667,6 +667,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index b94ba8d9..08eec061 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -703,6 +703,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 0a6e4ab2..4ec6da13 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -677,6 +677,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 2efd7bbe..970d7926 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -680,6 +680,7 @@ // TODO: translate the following. // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', +// 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/initialize.php b/initialize.php index 6b968992..60598cb3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5587"); +define("APP_VERSION", "1.19.28.5588"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ae7dfacad852cccff08c0a1f6fdcc8c7e7f50cf1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 21 Jul 2021 16:42:27 +0000 Subject: [PATCH 062/304] Implemented report inactive projects display option. --- WEB-INF/lib/ttProjectHelper.class.php | 12 +++++++++--- WEB-INF/templates/display_options.tpl | 8 ++++++++ display_options.php | 4 ++++ initialize.php | 2 +- reports.php | 4 +++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index d456c311..ebbd055f 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -77,17 +77,23 @@ static function getRates($user_id) { return $result; } - // getProjects - returns an array of active and inactive projects in group. - static function getProjects() { + // getProjects - returns an array of projects for group. + static function getProjects($includeInactiveProjects = true) { global $user; $mdb2 = getConnection(); $group_id = $user->getGroup(); $org_id = $user->org_id; + // Construct status part. + $statusPart = 'status = 1'; + if ($includeInactiveProjects) { + $statusPart = '(status = 0 or '.$statusPart.')'; + } + $result = array(); $sql = "select id, name, tasks from tt_projects". - " where group_id = $group_id and org_id = $org_id and (status = 0 or status = 1) order by upper(name)"; + " where group_id = $group_id and org_id = $org_id and $statusPart order by upper(name)"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { while ($val = $res->fetchRow()) { diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index 8c9db8ea..6486c0b2 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -41,6 +41,14 @@ License: See license.txt *} {$i18n.label.what_is_it} + + + + {$forms.displayOptionsForm.report_inactive_projects.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} + +

{$i18n.form.display_options.custom_css} diff --git a/display_options.php b/display_options.php index 21b488c6..6e0ccc54 100644 --- a/display_options.php +++ b/display_options.php @@ -20,12 +20,14 @@ $cl_time_not_complete_days = (bool)$request->getParameter('time_not_complete_days'); $cl_record_custom_fields = (bool)$request->getParameter('record_custom_fields'); $cl_report_note_on_separate_row = (bool)$request->getParameter('report_note_on_separate_row'); + $cl_report_inactive_projects = (bool)($request->getParameter('report_inactive_projects')); $cl_custom_css = trim($request->getParameter('custom_css')); } else { $cl_time_note_on_separate_row = $config->getDefinedValue('time_note_on_separate_row'); $cl_time_not_complete_days = $config->getDefinedValue('time_not_complete_days'); $cl_record_custom_fields = $config->getDefinedValue('record_custom_fields'); $cl_report_note_on_separate_row = $config->getDefinedValue('report_note_on_separate_row'); + $cl_report_inactive_projects = $config->getDefinedValue('report_inactive_projects'); $cl_custom_css = $user->getCustomCss(); } @@ -46,6 +48,7 @@ // Reports. $form->addInput(array('type'=>'checkbox','name'=>'report_note_on_separate_row','value'=>$cl_report_note_on_separate_row)); +$form->addInput(array('type'=>'checkbox','name'=>'report_inactive_projects','value'=>$cl_report_inactive_projects)); // TODO: add PDF break controller here. $form->addInput(array('type'=>'textarea','name'=>'custom_css','value'=>$cl_custom_css)); @@ -62,6 +65,7 @@ $config->setDefinedValue('time_not_complete_days', $cl_time_not_complete_days); $config->setDefinedValue('record_custom_fields', $cl_record_custom_fields); $config->setDefinedValue('report_note_on_separate_row', $cl_report_note_on_separate_row); + $config->setDefinedValue('report_inactive_projects', $cl_report_inactive_projects); if ($user->updateGroup(array( 'config' => $config->getConfig(), 'custom_css' => $cl_custom_css))) { diff --git a/initialize.php b/initialize.php index 60598cb3..f8f514ee 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5588"); +define("APP_VERSION", "1.19.28.5589"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index b7170622..c1df0438 100644 --- a/reports.php +++ b/reports.php @@ -73,7 +73,9 @@ $project_list = array(); if ($showProject) { if ($user->can('view_reports') || $user->can('view_all_reports')) { - $project_list = ttProjectHelper::getProjects(); // All active and inactive projects. + $config = new ttConfigHelper($user->getConfig()); + $includeInactiveProjects = $config->getDefinedValue('report_inactive_projects'); + $project_list = ttProjectHelper::getProjects($includeInactiveProjects); } elseif ($user->isClient()) { $project_list = ttProjectHelper::getProjectsForClient(); } else { From fb9f7b179726343b7c59aadf11c9ef1fa0b0762d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 6 Aug 2021 18:21:40 +0000 Subject: [PATCH 063/304] Added a resource string. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 1 + WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + initialize.php | 2 +- 31 files changed, 32 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 5f37900b..f9d9952d 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -131,6 +131,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 0ff16955..453a5100 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -133,6 +133,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 14265558..a3322416 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -128,6 +128,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 86834287..47eb84a1 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -125,6 +125,7 @@ // The problem is they do not appear precise, deviate from the meaning of approval / disaproval of report items.) // 'button.approve' => 'Approve', (suggested 'Freigeben / Genehmigen' does not appear precise) // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 93d77217..c1c00af9 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -120,6 +120,7 @@ 'button.stop' => 'Stop', 'button.approve' => 'Approve', 'button.disapprove' => 'Disapprove', +'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 1fb69298..8a8902f7 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -130,6 +130,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 28693401..3299e8ad 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -139,6 +139,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 7d453ef3..019c4ca3 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -136,6 +136,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index f45dec85..0940dc59 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -130,6 +130,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 168b01a5..88a96690 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -128,6 +128,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 3b1ca388..489185a8 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -123,6 +123,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 2ed161e3..918b5f7d 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -144,6 +144,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 78971e4f..407c22cd 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -133,6 +133,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index d1c172a5..165afe88 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -127,6 +127,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 2e1b012d..dbac8f19 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -137,6 +137,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index a5960229..896f1939 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -136,6 +136,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index c261b749..921d50af 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -111,6 +111,7 @@ 'button.stop' => 'Stop', 'button.approve' => 'Goedkeuren', 'button.disapprove' => 'Afkeuren', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 6a6161f5..5cb39137 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -136,6 +136,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 376f324b..d77f11c3 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -132,6 +132,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index db850303..15e3ef91 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -111,6 +111,8 @@ 'button.stop' => 'Parar', 'button.approve' => 'Aprovar', 'button.disapprove' => 'Desaprovar', +// TODO: translate the following. +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 4617faf4..6a1598cc 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -129,6 +129,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index d325468c..f93f1208 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -136,6 +136,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 5fbca603..71bc709b 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -111,6 +111,7 @@ 'button.stop' => 'Завершить', 'button.approve' => 'Одобрить', 'button.disapprove' => 'Не одобрить', +'button.sync' => 'Синхронизовать', // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Меню', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index d8add50c..da24d8ca 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -133,6 +133,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index ac49e7d8..40abaabe 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -126,6 +126,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 6fcae026..8e9fe4e8 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -129,6 +129,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 49df0665..bd025f84 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -127,6 +127,7 @@ // TODO: translate the following. // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 08eec061..5ac60a72 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -140,6 +140,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 4ec6da13..6c645121 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -129,6 +129,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 970d7926..d16bf4cb 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -133,6 +133,7 @@ // 'button.stop' => 'Stop', // 'button.approve' => 'Approve', // 'button.disapprove' => 'Disapprove', +// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. // Labels for controls on forms. Labels in this section are used on multiple forms. // TODO: translate the following. diff --git a/initialize.php b/initialize.php index f8f514ee..d3644587 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5589"); +define("APP_VERSION", "1.19.28.5590"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From d1a34ad77b7f38f8831fa303a215c242aaab492b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 13 Aug 2021 13:26:18 +0000 Subject: [PATCH 064/304] Introduced entities_modified field in tt_groups table for future API support. --- dbinstall.php | 10 ++++++---- initialize.php | 2 +- mysql.sql | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dbinstall.php b/dbinstall.php index 322b0566..2dfe30d6 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1137,7 +1137,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to11923"]) { + if ($_POST["convert11900to11929"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1170,6 +1170,8 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.22', modified = now() where param_name = 'version_db' and param_value = '1.19.19'"); ttExecute("ALTER TABLE `tt_groups` drop `task_required`"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.23', modified = now() where param_name = 'version_db' and param_value = '1.19.22'"); + ttExecute("ALTER TABLE `tt_groups` ADD `entities_modified` datetime default NULL AFTER `modified_by`"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.29', modified = now() where param_name = 'version_db' and param_value = '1.19.23'"); } if ($_POST["cleanup"]) { @@ -1220,7 +1222,7 @@ function ttGenerateKeys() {

DB Install

-
Create database structure (v1.19.23) + Create database structure (v1.19.29)
(applies only to new installations, do not execute when updating)
@@ -1269,8 +1271,8 @@ function ttGenerateKeys() { - Update database structure (v1.19 to v1.19.23) - + Update database structure (v1.19 to v1.19.29) + diff --git a/initialize.php b/initialize.php index d3644587..97dfbe2a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.28.5590"); +define("APP_VERSION", "1.19.29.5591"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index e9f4cc03..7a87b376 100644 --- a/mysql.sql +++ b/mysql.sql @@ -45,6 +45,7 @@ CREATE TABLE `tt_groups` ( `modified` datetime default NULL, # modification timestamp `modified_ip` varchar(45) default NULL, # modifier ip `modified_by` int(11) default NULL, # modifier user_id + `entities_modified` datetime default NULL, # modification timestamp of group entities (clients, projects, etc.) `status` tinyint(4) default 1, # group status PRIMARY KEY (`id`) ); @@ -656,4 +657,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.19.23', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.19.29', now()); # TODO: change when structure changes. From 30ae56536c029705287b6a5c291624e5e4c5ed11 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 13 Aug 2021 14:21:56 +0000 Subject: [PATCH 065/304] Wrote ttGroupHelper::updateEntitiesModidied function and started to use it for group and project changes. --- WEB-INF/lib/ttGroupHelper.class.php | 13 +++++++++++++ WEB-INF/lib/ttProjectHelper.class.php | 21 +++++++++++++++++---- WEB-INF/lib/ttUser.class.php | 3 +++ initialize.php | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index 0dd3dd41..0fa0355e 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -761,4 +761,17 @@ static function deleteGroupFiles($group_id) { // By design, we ignore such errors. return true; } + + // updateEntitiesModified updates the entities_modided field in tt_groups table + // with a current timestamp. + static function updateEntitiesModified() { + global $user; + $org_id = $user->org_id; + $group_id = $user->getGroup(); + $mdb2 = getConnection(); + + $sql = "update tt_groups set entities_modified = now() where id = $group_id and org_id = $org_id"; + $affected = $mdb2->exec($sql); + return (!is_a($affected, 'PEAR_Error')); + } } diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index ebbd055f..5e3321b9 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -216,9 +216,14 @@ static function delete($id) { if (is_a($affected, 'PEAR_Error')) return false; - // Finally, delete the project from the projects field in tt_clients table. - $result = ttClientHelper::deleteProject($id); - return $result; + // Delete the project from the projects field in tt_clients table. + if (!ttClientHelper::deleteProject($id)) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) return false; + + return true; } // insert function inserts a new project into database. @@ -269,6 +274,9 @@ static function insert($fields) } } + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) return false; + return $last_id; } @@ -354,7 +362,12 @@ static function update($fields) { ", tasks = ".$mdb2->quote($comma_separated).", status = ".$mdb2->quote($status). " where id = $project_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) return false; + + return true; } // getAssignedUsers - returns an array of user ids assigned to a project. diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 2086a374..c6539db6 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -707,6 +707,9 @@ function updateGroup($fields) { $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) return false; + return true; } diff --git a/initialize.php b/initialize.php index 97dfbe2a..5c37c745 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5591"); +define("APP_VERSION", "1.19.29.5592"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 25c08b9eab394193cddae071ca3d6cca652ef88d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 13 Aug 2021 15:47:54 +0000 Subject: [PATCH 066/304] Started to update entities_modified for client add, edit, and delete operations. --- WEB-INF/lib/ttClientHelper.class.php | 22 ++++++++++++++++++++-- WEB-INF/lib/ttGroupHelper.class.php | 2 +- WEB-INF/lib/ttProjectHelper.class.php | 12 ++++++++---- WEB-INF/lib/ttUser.class.php | 6 ++++-- initialize.php | 2 +- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index 3c5f0d64..ba62d0f3 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -150,7 +150,14 @@ static function delete($id, $delete_client_entries) { $sql = "update tt_clients set status = null". " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // The insert function inserts a new client record into the clients table. @@ -190,6 +197,10 @@ static function insert($fields) return false; } + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return $last_id; } @@ -232,7 +243,14 @@ static function update($fields) ", tax = $tax, projects = ".$mdb2->quote($comma_separated).", status = $status". " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // The fillBean function fills the ActionForm object with client data. diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index 0fa0355e..aa75a571 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -762,7 +762,7 @@ static function deleteGroupFiles($group_id) { return true; } - // updateEntitiesModified updates the entities_modided field in tt_groups table + // updateEntitiesModified updates the entities_modified field in tt_groups table // with a current timestamp. static function updateEntitiesModified() { global $user; diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index 5e3321b9..dd6e35cb 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -221,7 +221,8 @@ static function delete($id) { return false; // Update entities_modified, too. - if (!ttGroupHelper::updateEntitiesModified()) return false; + if (!ttGroupHelper::updateEntitiesModified()) + return false; return true; } @@ -275,7 +276,8 @@ static function insert($fields) } // Update entities_modified, too. - if (!ttGroupHelper::updateEntitiesModified()) return false; + if (!ttGroupHelper::updateEntitiesModified()) + return false; return $last_id; } @@ -362,10 +364,12 @@ static function update($fields) { ", tasks = ".$mdb2->quote($comma_separated).", status = ".$mdb2->quote($status). " where id = $project_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - if (is_a($affected, 'PEAR_Error')) return false; + if (is_a($affected, 'PEAR_Error')) + return false; // Update entities_modified, too. - if (!ttGroupHelper::updateEntitiesModified()) return false; + if (!ttGroupHelper::updateEntitiesModified()) + return false; return true; } diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index c6539db6..6848a72d 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -705,10 +705,12 @@ function updateGroup($fields) { $sql = "update tt_groups set $parts where id = $group_id and org_id = $this->org_id"; $affected = $mdb2->exec($sql); - if (is_a($affected, 'PEAR_Error')) return false; + if (is_a($affected, 'PEAR_Error')) + return false; // Update entities_modified, too. - if (!ttGroupHelper::updateEntitiesModified()) return false; + if (!ttGroupHelper::updateEntitiesModified()) + return false; return true; } diff --git a/initialize.php b/initialize.php index 5c37c745..d2b0a737 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5592"); +define("APP_VERSION", "1.19.29.5593"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 9a99a01e54029b20a1f1ed6dcc2ae9062e300576 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 13 Aug 2021 16:33:58 +0000 Subject: [PATCH 067/304] Start to update entities_modified for task and user update operations. --- WEB-INF/lib/ttTaskHelper.class.php | 19 +++++++++++- WEB-INF/lib/ttUser.class.php | 4 ++- WEB-INF/lib/ttUserHelper.class.php | 47 +++++++++++++++++++----------- initialize.php | 2 +- 4 files changed, 52 insertions(+), 20 deletions(-) diff --git a/WEB-INF/lib/ttTaskHelper.class.php b/WEB-INF/lib/ttTaskHelper.class.php index 71a52002..e93d3d66 100644 --- a/WEB-INF/lib/ttTaskHelper.class.php +++ b/WEB-INF/lib/ttTaskHelper.class.php @@ -107,7 +107,14 @@ static function delete($task_id) { // Mark the task as deleted. $sql = "update tt_tasks set status = NULL where id = $task_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // insert function inserts a new task into database. @@ -161,6 +168,11 @@ static function insert($fields) return false; } } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return $last_id; } @@ -242,6 +254,11 @@ static function update($fields) } } } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 6848a72d..320fa623 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -760,7 +760,9 @@ function markUserDeleted($user_id) { if (is_a($affected, 'PEAR_Error')) return false; - + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; return true; } diff --git a/WEB-INF/lib/ttUserHelper.class.php b/WEB-INF/lib/ttUserHelper.class.php index 95be4fbb..122c7889 100644 --- a/WEB-INF/lib/ttUserHelper.class.php +++ b/WEB-INF/lib/ttUserHelper.class.php @@ -95,27 +95,31 @@ static function insert($fields, $hash = true) { $mdb2->quote($fields['name']).", ".$mdb2->quote($fields['login']). ", $password, $group_id, $org_id, ".$mdb2->quote($fields['role_id']).", ".$mdb2->quote($fields['client_id']).", $rate, $quota_percent, ".$mdb2->quote($email).", now() $created_ip_v $created_by_v)"; $affected = $mdb2->exec($sql); + if (is_a($affected, 'PEAR_Error')) + return false; // Now deal with project assignment. - if (!is_a($affected, 'PEAR_Error')) { - $last_id = $mdb2->lastInsertID('tt_users', 'id'); - $projects = isset($fields['projects']) ? $fields['projects'] : array(); - if (count($projects) > 0) { - // We have at least one project assigned. Insert corresponding entries in tt_user_project_binds table. - foreach($projects as $p) { - if(!isset($p['rate'])) - $p['rate'] = 0; - else - $p['rate'] = str_replace(',', '.', $p['rate']); - - $sql = "insert into tt_user_project_binds (project_id, user_id, group_id, org_id, rate, status)". - " values(".$p['id'].", $last_id, $group_id, $org_id, ".$p['rate'].", 1)"; - $affected = $mdb2->exec($sql); - } + $last_id = $mdb2->lastInsertID('tt_users', 'id'); + $projects = isset($fields['projects']) ? $fields['projects'] : array(); + if (count($projects) > 0) { + // We have at least one project assigned. Insert corresponding entries in tt_user_project_binds table. + foreach($projects as $p) { + if(!isset($p['rate'])) + $p['rate'] = 0; + else + $p['rate'] = str_replace(',', '.', $p['rate']); + + $sql = "insert into tt_user_project_binds (project_id, user_id, group_id, org_id, rate, status)". + " values(".$p['id'].", $last_id, $group_id, $org_id, ".$p['rate'].", 1)"; + $affected = $mdb2->exec($sql); } - return $last_id; } - return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return $last_id; } // update - updates a user in database. @@ -232,6 +236,11 @@ static function update($user_id, $fields) { } } } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } @@ -282,6 +291,10 @@ static function delete($user_id) { if (is_a($affected, 'PEAR_Error')) return false; + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } diff --git a/initialize.php b/initialize.php index d2b0a737..984dc371 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5593"); +define("APP_VERSION", "1.19.29.5594"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 974a1cf40a424eca9594bc0d0dbf08e3b72c78f2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 14 Aug 2021 16:52:54 +0000 Subject: [PATCH 068/304] Started to update entities_modified on custom field and predefined expenses changes. --- .../lib/ttPredefinedExpenseHelper.class.php | 17 ++++++- initialize.php | 2 +- plugins/CustomFields.class.php | 50 +++++++++++++++++-- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/ttPredefinedExpenseHelper.class.php b/WEB-INF/lib/ttPredefinedExpenseHelper.class.php index 8ec8ccfe..c6bc3f35 100644 --- a/WEB-INF/lib/ttPredefinedExpenseHelper.class.php +++ b/WEB-INF/lib/ttPredefinedExpenseHelper.class.php @@ -66,6 +66,10 @@ static function delete($id) { if (is_a($affected, 'PEAR_Error')) return false; + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } @@ -88,6 +92,10 @@ static function insert($fields) { if (is_a($affected, 'PEAR_Error')) return false; + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } @@ -108,6 +116,13 @@ static function update($fields) { $sql = "update tt_predefined_expenses set name = ".$mdb2->quote($name).", cost = ".$mdb2->quote($cost). " where id = $predefined_expense_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } } diff --git a/initialize.php b/initialize.php index 984dc371..21f27ce8 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5594"); +define("APP_VERSION", "1.19.29.5595"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index a11e40a3..6350a678 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -156,6 +156,11 @@ static function insertOption($field_id, $option_name) { if (is_a($affected, 'PEAR_Error')) return false; } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } @@ -170,7 +175,14 @@ static function updateOption($id, $option_name) { $sql = "update tt_custom_field_options set value = " . $mdb2->quote($option_name) . " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // delete Option deletes an option and all custom field log entries that used it. @@ -196,7 +208,14 @@ static function deleteOption($id) { $sql = "update tt_custom_field_options set status = null" . " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // getOptions returns an array of options for a custom field. @@ -314,7 +333,14 @@ static function insertField($field_name, $entity_type, $field_type, $required) { $sql = "insert into tt_custom_fields (group_id, org_id, entity_type, type, label, required, status)" . " values($group_id, $org_id, $entity_type, $field_type, " . $mdb2->quote($field_name) . ", $required, 1)"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // The updateField updates custom field for group. @@ -328,7 +354,14 @@ static function updateField($id, $name, $type, $required) { $sql = "update tt_custom_fields set label = " . $mdb2->quote($name) . ", type = $type, required = $required" . " where id = $id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // The deleteField deletes a custom field, its options and log entries for group. @@ -357,7 +390,14 @@ static function deleteField($field_id) { $sql = "update tt_custom_fields set status = null" . " where id = $field_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + + return true; } // insertTimeFields - inserts time custom fields into tt_custom_field_log. From 865dd33879409b174a4eab42beecedf426f26602 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 14 Aug 2021 17:10:06 +0000 Subject: [PATCH 069/304] Started to update entities_modified on template changes. --- WEB-INF/lib/ttTemplateHelper.class.php | 13 +++++++++++++ initialize.php | 2 +- plugins/MonthlyQuota.class.php | 8 +++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttTemplateHelper.class.php b/WEB-INF/lib/ttTemplateHelper.class.php index 6e6ad0a0..0b9fcf92 100644 --- a/WEB-INF/lib/ttTemplateHelper.class.php +++ b/WEB-INF/lib/ttTemplateHelper.class.php @@ -48,6 +48,10 @@ static function delete($id) { if (is_a($affected, 'PEAR_Error')) return false; + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } @@ -87,6 +91,11 @@ static function insert($fields) { return false; } } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return $last_id; } @@ -129,6 +138,10 @@ static function update($fields) { die($affected->getMessage()); } + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } diff --git a/initialize.php b/initialize.php index 21f27ce8..b8f7a204 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5595"); +define("APP_VERSION", "1.19.29.5596"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index 0a8ee4e9..f742fd91 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -51,8 +51,14 @@ public function update($year, $month, $minutes) { $insertSql = "insert into tt_monthly_quotas (group_id, org_id, year, month, minutes)". " values ($this->group_id, $this->org_id, $year, $month, $minutes)"; $affected = $this->db->exec($insertSql); - return (!is_a($affected, 'PEAR_Error')); + if (is_a($affected, 'PEAR_Error')) + return false; } + + // Update entities_modified, too. + if (!ttGroupHelper::updateEntitiesModified()) + return false; + return true; } From 72d595742225a383fa8b891cd19add6296b2c208 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 1 Sep 2021 14:27:58 +0000 Subject: [PATCH 070/304] Cosmetic fixes to typos in comments. --- WEB-INF/lib/ttTimeHelper.class.php | 4 ++-- initialize.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 031ccfb6..75c911e0 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -119,13 +119,13 @@ static function isValidDuration($value) { } // postedDurationToMinutes - converts a value representing a duration - // (usually enetered in a form by a user) to an integer number of minutes. + // (usually entered in a form by a user) to an integer number of minutes. // // Parameters: // $duration - user entered duration string. Valid strings are: // 3 or 3h - means 3 hours. Note: h and m letters are not localized. // 0.25 or 0.25h or .25 or .25h - means a quarter of hour. - // 0,25 or 0,25h or ,25 or ,25h - same as above for users with comma ad decimal mark. + // 0,25 or 0,25h or ,25 or ,25h - same as above for users with comma as decimal mark. // 1:30 - means 1 hour 30 minutes. // 25m - means 25 minutes. // $max - maximum number of minutes that is valid. diff --git a/initialize.php b/initialize.php index b8f7a204..934f9d4b 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5596"); +define("APP_VERSION", "1.19.29.5597"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 71796c69b7128ce6d49c6772ccfa8c0c14ff4ba0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 7 Oct 2021 17:39:30 +0000 Subject: [PATCH 071/304] Maintenance fixes. --- initialize.php | 2 +- plugins/CustomFields.class.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index 934f9d4b..10550736 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5597"); +define("APP_VERSION", "1.19.29.5598"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index 6350a678..26e4532b 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -373,18 +373,27 @@ static function deleteField($field_id) { $org_id = $user->org_id; // Mark log entries as deleted. TODO: why are we doing this? Research impact. + // The impact is quite severe: an accidental delete of a custom field makes manual recovery problematic. + // Therefore, not doing this anymore as of Oct 7, 2021. + /* $sql = "update tt_custom_field_log set status = null" . " where field_id = $field_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; + */ // Mark field options as deleted. + // Same comment as above applies. + // An accidental delete of a custom field makes manual recovery problematic. + // Therefore, not doing this anymore as of Oct 7, 2021. + /* $sql = "update tt_custom_field_options set status = null" . " where field_id = $field_id and group_id = $group_id and org_id = $org_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; + */ // Mark custom field as deleted. $sql = "update tt_custom_fields set status = null" . From 559906731f153c9b3a632c2839ed11669b76d593 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 12 Oct 2021 20:01:36 +0000 Subject: [PATCH 072/304] Added a check for passed in date to time.php. --- initialize.php | 2 +- time.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index 10550736..e0b38f4d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.29.5598"); +define("APP_VERSION", "1.19.30.5599"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 1bee1129..61e771f8 100644 --- a/time.php +++ b/time.php @@ -32,6 +32,12 @@ exit(); } } +// If we are passed in a date, make sure it is in correct format. +$date = $request->getParameter('date'); +if ($date && !ttValidDate($date)) { + header('Location: access_denied.php'); + exit(); +} // End of access checks. // Determine user for whom we display this page. From d3f60bd3e3ea8ff8ec31a596baec6750af601b7c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 12 Oct 2021 20:31:02 +0000 Subject: [PATCH 073/304] A better fix to validate a passed-in date. --- WEB-INF/lib/common.lib.php | 20 +++++++++++++++++--- initialize.php | 2 +- time.php | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index d5b43f57..db8d58ea 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -226,15 +226,29 @@ function ttValidDate($val) if (strlen($val) == 0) return false; - // This should accept a string in format 'YYYY-MM-DD', 'MM/DD/YYYY', 'DD-MM-YYYY', 'DD.MM.YYYY', or 'DD.MM.YYYY whatever'. + // This should validate a string in format 'YYYY-MM-DD', 'MM/DD/YYYY', 'DD-MM-YYYY', 'DD.MM.YYYY', or 'DD.MM.YYYY whatever'. if (!preg_match('/^\d\d\d\d-\d\d-\d\d$/', $val) && !preg_match('/^\d\d\/\d\d\/\d\d\d\d$/', $val) && !preg_match('/^\d\d\-\d\d\-\d\d\d\d$/', $val) && !preg_match('/^\d\d\.\d\d\.\d\d\d\d$/', $val) && !preg_match('/^\d\d\.\d\d\.\d\d\d\d .+$/', $val)) return false; - - return true; + + return true; +} + +// ttValidDbDateFormatDate is used to check user input to validate a date in DB_DATEFORMAT. +function ttValidDbDateFormatDate($val) +{ + $val = trim($val); + if (strlen($val) == 0) + return false; + + // This should validate a string in format 'YYYY-MM-DD'. + if (!preg_match('/^\d\d\d\d-\d\d-\d\d$/', $val)) + return false; + + return true; } // ttValidInteger is used to check user input to validate an integer. diff --git a/initialize.php b/initialize.php index e0b38f4d..3d6aeab4 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.30.5599"); +define("APP_VERSION", "1.19.30.5600"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 61e771f8..e5e509c0 100644 --- a/time.php +++ b/time.php @@ -34,7 +34,7 @@ } // If we are passed in a date, make sure it is in correct format. $date = $request->getParameter('date'); -if ($date && !ttValidDate($date)) { +if ($date && !ttValidDbDateFormatDate($date)) { header('Location: access_denied.php'); exit(); } From 42ea5b1d1658ba5a0fa14069d8b31b9292249821 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 12 Oct 2021 21:00:47 +0000 Subject: [PATCH 074/304] Added validation of browser_today parameter in posts. --- expense_edit.php | 8 ++++++++ expenses.php | 8 ++++++++ initialize.php | 2 +- login.php | 11 +++++++++++ puncher.php | 8 ++++++++ time.php | 8 ++++++++ time_edit.php | 8 ++++++++ 7 files changed, 52 insertions(+), 1 deletion(-) diff --git a/expense_edit.php b/expense_edit.php index 271a588a..258437b3 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -27,6 +27,14 @@ header('Location: access_denied.php'); exit(); } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. $item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']); diff --git a/expenses.php b/expenses.php index 1914a253..1b5d99c1 100644 --- a/expenses.php +++ b/expenses.php @@ -38,6 +38,14 @@ exit(); } } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. // Determine user for which we display this page. diff --git a/initialize.php b/initialize.php index 3d6aeab4..63ee048d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.30.5600"); +define("APP_VERSION", "1.19.30.5601"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index 09c7af14..9e243620 100644 --- a/login.php +++ b/login.php @@ -7,6 +7,17 @@ import('ttOrgHelper'); import('ttUser'); +// Access checks. +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} +// End of access checks. + $cl_login = $request->getParameter('login'); if ($cl_login == null && $request->isGet()) $cl_login = @$_COOKIE[LOGIN_COOKIE_NAME]; $cl_password = $request->getParameter('password'); diff --git a/puncher.php b/puncher.php index 5d6bca7c..787c6f34 100644 --- a/puncher.php +++ b/puncher.php @@ -19,6 +19,14 @@ header('Location: feature_disabled.php'); exit(); } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. $showClient = $user->isPluginEnabled('cl'); diff --git a/time.php b/time.php index e5e509c0..9202dc1d 100644 --- a/time.php +++ b/time.php @@ -38,6 +38,14 @@ header('Location: access_denied.php'); exit(); } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. // Determine user for whom we display this page. diff --git a/time_edit.php b/time_edit.php index d34ae1ca..e82e21b8 100644 --- a/time_edit.php +++ b/time_edit.php @@ -24,6 +24,14 @@ header('Location: access_denied.php'); exit(); } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. $user_id = $user->getUser(); From 8f78ea2bac49e937eedf5477dfcb9cf61c498069 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 12 Oct 2021 21:45:35 +0000 Subject: [PATCH 075/304] Forgot to check in one file. --- week.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/week.php b/week.php index 7687f959..fbfbfee3 100644 --- a/week.php +++ b/week.php @@ -38,6 +38,14 @@ exit(); } } +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. // Determine user for whom we display this page. From 94fda0cc0c9c20ab98d38ccc75ff040d13dc7f1b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 20 Oct 2021 20:51:47 +0000 Subject: [PATCH 076/304] Fixed an sql injection vulnerability in groups.php. --- groups.php | 13 ++++++++++--- initialize.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/groups.php b/groups.php index a7bf2dfe..ca01a5f7 100644 --- a/groups.php +++ b/groups.php @@ -11,9 +11,16 @@ header('Location: access_denied.php'); exit(); } -if ($request->isPost() && !$user->isGroupValid($request->getParameter('group'))) { - header('Location: access_denied.php'); // Wrong group id in post. - exit(); +if ($request->isPost()) { + $group_id = $request->getParameter('group'); + if (!ttValidInteger($group_id)) { + header('Location: access_denied.php'); // Protection against sql injection. + exit(); + } + if (!$user->isGroupValid($group_id)) { + header('Location: access_denied.php'); // Wrong group id in post. + exit(); + } } // End of access checks. diff --git a/initialize.php b/initialize.php index 63ee048d..92c907f3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.30.5601"); +define("APP_VERSION", "1.19.31.5602"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 0cf32f1046418aa2e5218b0b370064820c330c6a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 21 Oct 2021 12:29:00 +0000 Subject: [PATCH 077/304] Added additional protection against an sql injection fixed in previous commit. --- WEB-INF/lib/ttGroupHelper.class.php | 6 +++++- initialize.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index aa75a571..81b0c7f3 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -27,9 +27,13 @@ static function getGroupName($group_id) { static function getParentGroup($group_id) { global $user; + // Checking parameters for sanity is normally done in access check blocks on pages. + // This cast below is just in case we forgot to check $group_id to be an integer. + $groupId = (int) $group_id; // Protection against sql injection. + $mdb2 = getConnection(); - $sql = "select parent_id from tt_groups where id = $group_id and org_id = $user->org_id and status = 1"; + $sql = "select parent_id from tt_groups where id = $groupId and org_id = $user->org_id and status = 1"; $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { diff --git a/initialize.php b/initialize.php index 92c907f3..bc05d18d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.31.5602"); +define("APP_VERSION", "1.19.31.5603"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 571a69ca25e0c94af905d54b84dc06b3d9df22d8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 21 Oct 2021 15:27:59 +0000 Subject: [PATCH 078/304] A couple more fixes to address CVE-2021-41139. --- charts.php | 5 +++++ expenses.php | 6 ++++++ initialize.php | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/charts.php b/charts.php index 1bf6d34f..88878f6b 100644 --- a/charts.php +++ b/charts.php @@ -40,6 +40,11 @@ exit(); } } +$date = $request->getParameter('date'); +if ($date && !ttValidDbDateFormatDate($date)) { + header('Location: access_denied.php'); + exit(); +} // End of access checks. // Determine user for which we display this page. diff --git a/expenses.php b/expenses.php index 1b5d99c1..578e2d1c 100644 --- a/expenses.php +++ b/expenses.php @@ -38,6 +38,12 @@ exit(); } } +// If we are passed in a date, make sure it is in correct format. +$date = $request->getParameter('date'); +if ($date && !ttValidDbDateFormatDate($date)) { + header('Location: access_denied.php'); + exit(); +} if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); diff --git a/initialize.php b/initialize.php index bc05d18d..6caaec77 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.31.5603"); +define("APP_VERSION", "1.19.32.5604"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 098706ef27d5fbc8dda87383d64a671b9dd5aa7c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 22 Oct 2021 19:54:28 +0000 Subject: [PATCH 079/304] Security fix, added checking status value for sanity. --- WEB-INF/lib/common.lib.php | 13 +++++++++++++ client_edit.php | 2 ++ initialize.php | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index db8d58ea..5840f368 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -219,6 +219,19 @@ function ttValidFloat($val, $emptyValid = false) return true; } +// ttValidStatus is used to check user input to validate a status value. +function ttValidStatus($val) +{ + if (!ttValidInteger($val)) + return false; + + $intVal = (int) $val; // Cast to int for comparisons below to work. + if ($intVal != ACTIVE && $intVal != INACTIVE) + return false; + + return true; +} + // ttValidDate is used to check user input to validate a date. function ttValidDate($val) { diff --git a/client_edit.php b/client_edit.php index 34983418..4489e2a7 100644 --- a/client_edit.php +++ b/client_edit.php @@ -33,6 +33,7 @@ $cl_address = trim($request->getParameter('address')); $cl_tax = trim($request->getParameter('tax')); $cl_status = $request->getParameter('status'); +$cl_status = "1" ; $cl_projects = $request->getParameter('projects'); } else { $cl_name = $client['name']; @@ -64,6 +65,7 @@ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.client_name')); if (!ttValidString($cl_address, true)) $err->add($i18n->get('error.field'), $i18n->get('label.client_address')); if (!ttValidFloat($cl_tax, true)) $err->add($i18n->get('error.field'), $i18n->get('label.tax')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if ($err->no()) { if ($request->getParameter('btn_save')) { diff --git a/initialize.php b/initialize.php index 6caaec77..4497264e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.32.5604"); +define("APP_VERSION", "1.19.33.5605"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 1e89145d4f841021ebe82049b58ce4e6840091d4 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 22 Oct 2021 19:56:09 +0000 Subject: [PATCH 080/304] Proper security fix, added checking status value for sanity. --- client_edit.php | 1 - 1 file changed, 1 deletion(-) diff --git a/client_edit.php b/client_edit.php index 4489e2a7..665fda15 100644 --- a/client_edit.php +++ b/client_edit.php @@ -33,7 +33,6 @@ $cl_address = trim($request->getParameter('address')); $cl_tax = trim($request->getParameter('tax')); $cl_status = $request->getParameter('status'); -$cl_status = "1" ; $cl_projects = $request->getParameter('projects'); } else { $cl_name = $client['name']; From c1db27ad9c9a4a1ebe0726977789bea52184f088 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 22 Oct 2021 20:15:50 +0000 Subject: [PATCH 081/304] Added checking status parameter for sanity in more files. --- initialize.php | 2 +- project_edit.php | 1 + role_edit.php | 1 + task_edit.php | 1 + template_edit.php | 1 + timesheet_edit.php | 1 + user_edit.php | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index 4497264e..342d458a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.33.5605"); +define("APP_VERSION", "1.19.33.5606"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/project_edit.php b/project_edit.php index 917b2e97..7d8e113d 100644 --- a/project_edit.php +++ b/project_edit.php @@ -63,6 +63,7 @@ // Validate user input. if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_users, 'tt_users')) $err->add($i18n->get('error.field'), $i18n->get('label.users')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_tasks, 'tt_tasks')) $err->add($i18n->get('error.field'), $i18n->get('label.tasks')); diff --git a/role_edit.php b/role_edit.php index 5192ee62..f2aecade 100644 --- a/role_edit.php +++ b/role_edit.php @@ -58,6 +58,7 @@ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); if ($cl_rank >= $user->rank || $cl_rank < 0) $err->add($i18n->get('error.field'), $i18n->get('form.roles.rank')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if ($err->no()) { $existing_role = ttRoleHelper::getRoleByName($cl_name); diff --git a/task_edit.php b/task_edit.php index b2b61b80..9761e31d 100644 --- a/task_edit.php +++ b/task_edit.php @@ -56,6 +56,7 @@ // Validate user input. if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if ($err->no()) { if ($request->getParameter('btn_save')) { diff --git a/template_edit.php b/template_edit.php index 2f3c6972..2ff87b72 100644 --- a/template_edit.php +++ b/template_edit.php @@ -64,6 +64,7 @@ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); if (!ttValidString($cl_content)) $err->add($i18n->get('error.field'), $i18n->get('label.template')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_projects, 'tt_projects')) $err->add($i18n->get('error.field'), $i18n->get('label.projects')); // Finished validating user input. diff --git a/timesheet_edit.php b/timesheet_edit.php index 164cc61b..3e46733a 100644 --- a/timesheet_edit.php +++ b/timesheet_edit.php @@ -51,6 +51,7 @@ // Validate user input. if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.comment')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if ($request->getParameter('btn_save')) { if ($err->no()) { diff --git a/user_edit.php b/user_edit.php index 10aaebbb..57133eb3 100644 --- a/user_edit.php +++ b/user_edit.php @@ -194,6 +194,7 @@ function render(&$table, $value, $row, $column, $selected = false) { if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); // Require selection of a client for a client role. if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->get('error.client')); + if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if (!ttValidFloat($cl_quota_percent, true)) $err->add($i18n->get('error.field'), $i18n->get('label.quota')); // Validate input in user custom fields. if (isset($custom_fields) && $custom_fields->userFields) { From 4546333e1869a99b28981e3049a83b6ee4d4fa1f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 24 Oct 2021 14:57:44 +0000 Subject: [PATCH 082/304] Fixed ttValidStatus function to accept null values. --- WEB-INF/lib/common.lib.php | 3 +++ initialize.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 5840f368..05a06808 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -222,6 +222,9 @@ function ttValidFloat($val, $emptyValid = false) // ttValidStatus is used to check user input to validate a status value. function ttValidStatus($val) { + if (null == $val) + return true; + if (!ttValidInteger($val)) return false; diff --git a/initialize.php b/initialize.php index 342d458a..c778bc42 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.33.5606"); +define("APP_VERSION", "1.19.33.5607"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 50c7a625e0f8e86d3ffb8ea7c5664a995718f797 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 28 Oct 2021 14:45:37 +0000 Subject: [PATCH 083/304] Dutch translation improvement. --- WEB-INF/resources/nl.lang.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 921d50af..91ff4c8b 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -594,8 +594,7 @@ // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Notitie in aparte kolom', // Translator (Henk) comment: "kolom is the right word in Dutch." 'form.display_options.not_complete_days' => 'Niet complete dagen', -// TODO: translate the following. -// 'form.display_options.inactive_projects' => 'Inactive projects', +'form.display_options.inactive_projects' => 'Niet actieve projecten', 'form.display_options.custom_css' => 'Aangepaste CSS', // Work plugin strings. See example at https://timetracker.anuko.com/work.php diff --git a/initialize.php b/initialize.php index c778bc42..f02b0b0e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.33.5607"); +define("APP_VERSION", "1.19.33.5608"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ab0e714e047eac432316aca5eee38589215745d8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 22 Nov 2021 17:19:15 +0000 Subject: [PATCH 084/304] Fixed CustomFileds class for adding a previously deleted option. --- initialize.php | 2 +- plugins/CustomFields.class.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/initialize.php b/initialize.php index f02b0b0e..b93c09ce 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.33.5608"); +define("APP_VERSION", "1.19.34.5609"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index 26e4532b..1a7b94e9 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -140,8 +140,9 @@ static function insertOption($field_id, $option_name) { // Check if the option exists. $id = 0; - $sql = "select id from tt_custom_field_options" . - " where field_id = $field_id and group_id = $group_id and org_id = $org_id and value = " . $mdb2->quote($option_name); + $sql = "select id from tt_custom_field_options". + " where field_id = $field_id and group_id = $group_id and org_id = $org_id and value = ".$mdb2->quote($option_name). + " and status is not null"; $res = $mdb2->query($sql); if (is_a($res, 'PEAR_Error')) return false; From 79b16664911af80dc0703ea8d8192242e7f32748 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 21 Dec 2021 21:16:50 +0000 Subject: [PATCH 085/304] Addressed CVE-2021-41139 situation in week.php. --- initialize.php | 2 +- week.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index b93c09ce..4be51648 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5609"); +define("APP_VERSION", "1.19.34.5610"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index fbfbfee3..e6f7864b 100644 --- a/week.php +++ b/week.php @@ -38,6 +38,12 @@ exit(); } } +// If we are passed in a date, make sure it is in correct format. +$date = $request->getParameter('date'); +if ($date && !ttValidDbDateFormatDate($date)) { + header('Location: access_denied.php'); + exit(); +} if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); From 52e8604e0ac0c33497c6e0de0db459a53b6627d7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 24 Jan 2022 17:25:34 +0000 Subject: [PATCH 086/304] Work in progress removing remote work plugin. --- WEB-INF/templates/plugins.tpl | 6 ------ initialize.php | 2 +- plugins.php | 5 ----- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/WEB-INF/templates/plugins.tpl b/WEB-INF/templates/plugins.tpl index 5c1e4c94..e4402f62 100644 --- a/WEB-INF/templates/plugins.tpl +++ b/WEB-INF/templates/plugins.tpl @@ -210,12 +210,6 @@ function handlePluginCheckboxes() { {$forms.pluginsForm.attachments.control} {$i18n.label.what_is_it}
- - - - {$forms.pluginsForm.work.control} {$i18n.label.what_is_it} - -
{$forms.pluginsForm.btn_save.control}
{$forms.pluginsForm.close} diff --git a/initialize.php b/initialize.php index 4be51648..c4fccc0f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5610"); +define("APP_VERSION", "1.19.34.5611"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins.php b/plugins.php index 95b6d4b9..1dfe6a07 100644 --- a/plugins.php +++ b/plugins.php @@ -32,7 +32,6 @@ $cl_timesheets = (bool)$request->getParameter('timesheets'); $cl_templates = (bool)$request->getParameter('templates'); $cl_attachments = (bool)$request->getParameter('attachments'); - $cl_work = (bool)$request->getParameter('work'); } else { // Note: we get here in get, and also in post when group changes. // Which plugins do we have enabled in currently selected group? @@ -55,7 +54,6 @@ $cl_timesheets = in_array('ts', $plugins); $cl_templates = in_array('tp', $plugins); $cl_attachments = in_array('at', $plugins); - $cl_work = in_array('wk', $plugins); } $form = new Form('pluginsForm'); @@ -79,7 +77,6 @@ $form->addInput(array('type'=>'checkbox','name'=>'timesheets','value'=>$cl_timesheets)); $form->addInput(array('type'=>'checkbox','name'=>'templates','value'=>$cl_templates,'onchange'=>'handlePluginCheckboxes()')); $form->addInput(array('type'=>'checkbox','name'=>'attachments','value'=>$cl_attachments,'onchange'=>'handlePluginCheckboxes()')); -$form->addInput(array('type'=>'checkbox','name'=>'work','value'=>$cl_work,'onchange'=>'handlePluginCheckboxes()')); // Submit button. $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); @@ -124,8 +121,6 @@ $plugins .= ',tp'; if ($cl_attachments) $plugins .= ',at'; - if ($cl_work) - $plugins .= ',wk'; $plugins = trim($plugins, ','); // Prepare a new config string. From 6ff1577e836c0f8134734f8a382be7b11c888fe1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 24 Jan 2022 17:35:24 +0000 Subject: [PATCH 087/304] Fixed headers to remove remote work plugin. --- WEB-INF/templates/header.tpl | 3 --- WEB-INF/templates/work/header.tpl | 3 --- initialize.php | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index e7df23ea..372b18d4 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -134,9 +134,6 @@ {if $user->isPluginEnabled('cl') && ($user->can('view_own_clients') || $user->can('manage_clients'))} {$i18n.menu.clients} {/if} - {if $user->isPluginEnabled('wk') && ($user->can('update_work') || $user->can('bid_on_work') || $user->can('manage_work')) && $user->exists()} - {$i18n.title.work} - {/if} {if $user->can('export_data')} {$i18n.menu.export} {/if} diff --git a/WEB-INF/templates/work/header.tpl b/WEB-INF/templates/work/header.tpl index 75a0d586..6b767a16 100644 --- a/WEB-INF/templates/work/header.tpl +++ b/WEB-INF/templates/work/header.tpl @@ -141,9 +141,6 @@ {if $user->isPluginEnabled('cl') && ($user->can('view_own_clients') || $user->can('manage_clients'))} {$i18n.menu.clients} {/if} - {if $user->isPluginEnabled('wk') && ($user->can('update_work') || $user->can('bid_on_work') || $user->can('manage_work')) && $user->exists()} - {$i18n.title.work} - {/if} {if $user->can('export_data')} {$i18n.menu.export} {/if} diff --git a/initialize.php b/initialize.php index c4fccc0f..16f3a5b1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5611"); +define("APP_VERSION", "1.19.34.5612"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 4a289fddb562e738b03c4f8f5e2be4d1b53b3f81 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 14:54:56 +0000 Subject: [PATCH 088/304] Removed code for Remote Work plugin. --- WEB-INF/lib/ttAdminWorkHelper.class.php | 1028 ------------ WEB-INF/lib/ttWorkHelper.class.php | 1617 ------------------- WEB-INF/templates/header.tpl | 3 - WEB-INF/templates/site_map.tpl | 3 - WEB-INF/templates/work/admin_offer_edit.tpl | 70 - WEB-INF/templates/work/admin_work.tpl | 104 -- WEB-INF/templates/work/admin_work_edit.tpl | 67 - WEB-INF/templates/work/footer_old.tpl | 29 - WEB-INF/templates/work/header.tpl | 204 --- WEB-INF/templates/work/index.tpl | 5 - WEB-INF/templates/work/offer_add.tpl | 74 - WEB-INF/templates/work/offer_delete.tpl | 20 - WEB-INF/templates/work/offer_edit.tpl | 67 - WEB-INF/templates/work/offer_message.tpl | 32 - WEB-INF/templates/work/offer_view.tpl | 47 - WEB-INF/templates/work/offer_view_own.tpl | 42 - WEB-INF/templates/work/work.tpl | 140 -- WEB-INF/templates/work/work_add.tpl | 62 - WEB-INF/templates/work/work_delete.tpl | 20 - WEB-INF/templates/work/work_edit.tpl | 73 - WEB-INF/templates/work/work_message.tpl | 32 - WEB-INF/templates/work/work_offer_view.tpl | 57 - WEB-INF/templates/work/work_offers.tpl | 41 - WEB-INF/templates/work/work_view.tpl | 47 - WEB-INF/templates/work/work_view_own.tpl | 38 - work/admin_offer_delete.php | 71 - work/admin_offer_edit.php | 171 -- work/admin_work.php | 53 - work/admin_work_delete.php | 71 - work/admin_work_edit.php | 168 -- work/offer_add.php | 120 -- work/offer_delete.php | 75 - work/offer_edit.php | 135 -- work/offer_message.php | 90 -- work/offer_view.php | 81 - work/offer_view_own.php | 77 - work/work.php | 65 - work/work_add.php | 122 -- work/work_delete.php | 75 - work/work_edit.php | 151 -- work/work_message.php | 90 -- work/work_offer_view.php | 123 -- work/work_offers.php | 56 - work/work_view.php | 74 - work/work_view_own.php | 79 - 45 files changed, 5869 deletions(-) delete mode 100644 WEB-INF/lib/ttAdminWorkHelper.class.php delete mode 100644 WEB-INF/lib/ttWorkHelper.class.php delete mode 100644 WEB-INF/templates/work/admin_offer_edit.tpl delete mode 100644 WEB-INF/templates/work/admin_work.tpl delete mode 100644 WEB-INF/templates/work/admin_work_edit.tpl delete mode 100644 WEB-INF/templates/work/footer_old.tpl delete mode 100644 WEB-INF/templates/work/header.tpl delete mode 100644 WEB-INF/templates/work/index.tpl delete mode 100644 WEB-INF/templates/work/offer_add.tpl delete mode 100644 WEB-INF/templates/work/offer_delete.tpl delete mode 100644 WEB-INF/templates/work/offer_edit.tpl delete mode 100644 WEB-INF/templates/work/offer_message.tpl delete mode 100644 WEB-INF/templates/work/offer_view.tpl delete mode 100644 WEB-INF/templates/work/offer_view_own.tpl delete mode 100644 WEB-INF/templates/work/work.tpl delete mode 100644 WEB-INF/templates/work/work_add.tpl delete mode 100644 WEB-INF/templates/work/work_delete.tpl delete mode 100644 WEB-INF/templates/work/work_edit.tpl delete mode 100644 WEB-INF/templates/work/work_message.tpl delete mode 100644 WEB-INF/templates/work/work_offer_view.tpl delete mode 100644 WEB-INF/templates/work/work_offers.tpl delete mode 100644 WEB-INF/templates/work/work_view.tpl delete mode 100644 WEB-INF/templates/work/work_view_own.tpl delete mode 100644 work/admin_offer_delete.php delete mode 100644 work/admin_offer_edit.php delete mode 100644 work/admin_work.php delete mode 100644 work/admin_work_delete.php delete mode 100644 work/admin_work_edit.php delete mode 100644 work/offer_add.php delete mode 100644 work/offer_delete.php delete mode 100644 work/offer_edit.php delete mode 100644 work/offer_message.php delete mode 100644 work/offer_view.php delete mode 100644 work/offer_view_own.php delete mode 100644 work/work.php delete mode 100644 work/work_add.php delete mode 100644 work/work_delete.php delete mode 100644 work/work_edit.php delete mode 100644 work/work_message.php delete mode 100644 work/work_offer_view.php delete mode 100644 work/work_offers.php delete mode 100644 work/work_view.php delete mode 100644 work/work_view_own.php diff --git a/WEB-INF/lib/ttAdminWorkHelper.class.php b/WEB-INF/lib/ttAdminWorkHelper.class.php deleted file mode 100644 index 22098b27..00000000 --- a/WEB-INF/lib/ttAdminWorkHelper.class.php +++ /dev/null @@ -1,1028 +0,0 @@ -errors = &$errors; - - $this->work_server_uri = defined('WORK_SERVER_URI') ? WORK_SERVER_URI : "https://www.anuko.com/work/"; - $this->register_uri = $this->work_server_uri.'register'; - $this->get_work_item_uri = $this->work_server_uri.'admin_getworkitem'; - $this->update_work_item_uri = $this->work_server_uri.'admin_updateworkitem'; - $this->delete_work_item_uri = $this->work_server_uri.'admin_deleteworkitem'; - $this->approve_work_item_uri = $this->work_server_uri.'admin_approveworkitem'; - $this->approve_work_item_on_offer_uri = $this->work_server_uri.'admin_approveworkitemonoffer'; - $this->disapprove_work_item_uri = $this->work_server_uri.'admin_disapproveworkitem'; - $this->disapprove_work_item_on_offer_uri = $this->work_server_uri.'admin_disapproveworkitemonoffer'; - $this->get_offer_uri = $this->work_server_uri.'admin_getoffer'; - $this->update_offer_uri = $this->work_server_uri.'admin_updateoffer'; - $this->delete_offer_uri = $this->work_server_uri.'admin_deleteoffer'; - $this->approve_offer_uri = $this->work_server_uri.'admin_approveoffer'; - $this->disapprove_offer_uri = $this->work_server_uri.'admin_disapproveoffer'; - $this->get_pending_work_items_uri = $this->work_server_uri.'admin_getpendingworkitems'; - $this->get_pending_offers_uri = $this->work_server_uri.'admin_getpendingoffers'; - $this->get_items_uri = $this->work_server_uri.'admin_getitems'; - $this->checkSiteRegistration(); - } - - // checkSiteRegistration - obtains site id and key from local database. - // If not found, it tries to register with remote work server. - function checkSiteRegistration() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - // Obtain site id. - $sql = "select param_value as id from tt_site_config where param_name = 'worksite_id'"; - $res = $mdb2->query($sql); - $val = $res->fetchRow(); - if (!$val) { - // No site id found, need to register. - $fields = array('lang' => urlencode($user->lang), - 'name' => urlencode('time tracker'), - 'origin' => urlencode('time tracker source')); - - // Urlify the data for the POST. - foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->register_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $reg_status = $result_array['reg_status']; // Registration status. - if ($reg_status['site_id'] && $reg_status['site_key']) { - $this->site_id = $reg_status['site_id']; - $this->site_key = $reg_status['site_key']; - - // Registration successful. Store id and key locally for future use. - $sql = "insert into tt_site_config values('worksite_id', $this->site_id, now(), null)"; - $mdb2->exec($sql); - $sql = "insert into tt_site_config values('worksite_key', ".$mdb2->quote($this->site_key).", now(), null)"; - $mdb2->exec($sql); - } else { - $this->errors->add($i18n->get('error.remote_work')); - } - } else { - // Site id found. - $this->site_id = $val['id']; - - // Obtain site key. - $sql = "select param_value as site_key from tt_site_config where param_name = 'worksite_key'"; - $res = $mdb2->query($sql); - $val = $res->fetchRow(); - $this->site_key = $val['site_key']; - } - } - - // getPendingOffers - obtains a list of offers pending approval. - function getPendingOffers() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_pending_offers_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $pending_offers = $result_array['pending_offers']; - return $pending_offers; - } - - // getPendingWorkItems - obtains a list of work items pending approval. - function getPendingWorkItems() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_pending_work_items_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $pending_work = $result_array['pending_work']; - return $pending_work; - } - - // getWorkItem - gets work item details from remote work server. - function getWorkItem($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($work_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $work_item = $result_array['work_item']; - return $work_item; - } - - // deleteWorkItem - deletes work item from remote work server. - function deleteWorkItem($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($work_id), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->delete_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // deleteOffer - deletes an offer from remote work server. - function deleteOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'offer_id' => urlencode($offer_id), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->delete_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getOffer - gets offer details from remote work server. - function getOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'offer_id' => urlencode($offer_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $offer = $result_array['offer']; - return $offer; - } - - // updateWorkItem - updates a work item in remote work server. - function updateWorkItem($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($fields['work_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->update_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // approveWorkItem - approves work item in remote work server. - function approveWorkItem($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($fields['work_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->approve_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // disapproveWorkItem - disapproves work item in remote work server. - function disapproveWorkItem($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($fields['work_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->disapprove_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // disapproveWorkItemOnOffer - disapproves work item posted on offer in remote work server. - function disapproveWorkItemOnOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($fields['work_id']), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->disapprove_work_item_on_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // approveWorkItemOnOffer - approves work item posted on offer in remote work server. - function approveWorkItemOnOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'work_id' => urlencode($fields['work_id']), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->approve_work_item_on_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // updateOffer - updates an offer in remote work server. - function updateOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'offer_id' => urlencode($fields['offer_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'payment_info' => urlencode(base64_encode($fields['payment_info'])), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->update_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // approveOffer - approves offer in remote work server. - function approveOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'offer_id' => urlencode($fields['offer_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->approve_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - - // disapproveOffer - disapproves offer in remote work server. - function disapproveOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id), - 'offer_id' => urlencode($fields['offer_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'moderator_comment' => urlencode(base64_encode($fields['moderator_comment'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->disapprove_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getItems - obtains a list of all items relevant to admin in one API call to Remote Work Server. - function getItems() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'user_id' => urlencode($user->id) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_items_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - unset($result_array['call_status']); // Remove call_status element. - return $result_array; - } -} diff --git a/WEB-INF/lib/ttWorkHelper.class.php b/WEB-INF/lib/ttWorkHelper.class.php deleted file mode 100644 index 6ddf8751..00000000 --- a/WEB-INF/lib/ttWorkHelper.class.php +++ /dev/null @@ -1,1617 +0,0 @@ -errors = &$errors; - - $this->work_server_uri = defined('WORK_SERVER_URI') ? WORK_SERVER_URI : "https://www.anuko.com/work/"; - - // Note: at some point a need will arise for API versioning. - // When this happens, we will append an API version number to the end of URI, - // for example: register_0_1 instead of register. - // This should theoretically allow a remote work server to be able to work with - // a complete variety of deployed clients, including those without versions. - $this->register_uri = $this->work_server_uri.'register'; // register_0_0 - $this->put_own_work_item_uri = $this->work_server_uri.'putownworkitem'; - $this->get_own_work_item_uri = $this->work_server_uri.'getownworkitem'; - $this->get_own_work_item_offer_uri = $this->work_server_uri.'getownworkitemoffer'; - $this->get_own_work_item_offers_uri = $this->work_server_uri.'getownworkitemoffers'; - $this->get_own_work_items_uri = $this->work_server_uri.'getownworkitems'; - $this->get_available_work_items_uri = $this->work_server_uri.'getavailableworkitems'; - $this->get_available_work_item_uri = $this->work_server_uri.'getavailableworkitem'; - $this->delete_own_work_item_uri = $this->work_server_uri.'deleteownworkitem'; - $this->accept_own_work_item_offer_uri = $this->work_server_uri.'acceptownworkitemoffer'; - $this->decline_own_work_item_offer_uri = $this->work_server_uri.'declineownworkitemoffer'; - $this->update_own_work_item_uri = $this->work_server_uri.'updateownworkitem'; - $this->update_own_work_item_on_offer_uri = $this->work_server_uri.'updateownworkitemonoffer'; - $this->put_own_offer_uri = $this->work_server_uri.'putownoffer'; - $this->get_own_offer_uri = $this->work_server_uri.'getownoffer'; - $this->get_own_offers_uri = $this->work_server_uri.'getownoffers'; - - $this->get_available_offers_uri = $this->work_server_uri.'getavailableoffers'; - $this->get_available_offer_uri = $this->work_server_uri.'getavailableoffer'; - $this->get_group_items_uri = $this->work_server_uri.'getgroupitems'; - $this->delete_own_offer_uri = $this->work_server_uri.'deleteownoffer'; - $this->update_own_offer_uri = $this->work_server_uri.'updateownoffer'; - $this->send_message_to_work_owner_uri = $this->work_server_uri.'sendmessagetoworkowner'; - $this->send_message_to_offer_owner_uri = $this->work_server_uri.'sendmessagetoofferowner'; - $this->checkSiteRegistration(); - } - - // checkSiteRegistration - obtains site id and key from local database. - // If not found, it tries to register with remote work server. - function checkSiteRegistration() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - // Obtain site id. - $sql = "select param_value as id from tt_site_config where param_name = 'worksite_id'"; - $res = $mdb2->query($sql); - $val = $res->fetchRow(); - if (!$val) { - // No site id found, need to register. - $group_id = $user->getGroup(); - $org_id = $user->org_id; - $fields = array('lang' => urlencode($user->lang), - 'name' => urlencode('time tracker'), - 'origin' => urlencode('time tracker source'), - 'org_id' => urlencode($org_id), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'user_id' => urlencode($user->getUser()), - 'user_name' => urlencode(base64_encode($user->getName())), - 'user_email' => urlencode(base64_encode($user->getEmail())), - 'user_ip' => urlencode($_SERVER['REMOTE_ADDR'])); - - // Urlify the data for the POST. - foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->register_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $reg_status = $result_array['reg_status']; // Registration status. - if ($reg_status['site_id'] && $reg_status['site_key']) { - $this->site_id = $reg_status['site_id']; - $this->site_key = $reg_status['site_key']; - - // Registration successful. Store id and key locally for future use. - $sql = "insert into tt_site_config values('worksite_id', $this->site_id, now(), null)"; - $mdb2->exec($sql); - $sql = "insert into tt_site_config values('worksite_key', ".$mdb2->quote($this->site_key).", now(), null)"; - $mdb2->exec($sql); - } else { - $this->errors->add($i18n->get('error.remote_work')); - } - } else { - // Site id found. - $this->site_id = $val['id']; - - // Obtain site key. - $sql = "select param_value as site_key from tt_site_config where param_name = 'worksite_key'"; - $res = $mdb2->query($sql); - $val = $res->fetchRow(); - $this->site_key = $val['site_key']; - } - } - - // putOwnWorkItem - publishes a work item in remote work server. - // - // Note about some fields using additional base64 encoding. - // There is a problem with data posted by curl calls on the server side for - // some languages. Data arrives corrupted. - // - // For example: consider a case for a single Russian letter ф in the subject field. - // UTF-8 encoding for ф: 0xD1 0x84 (2 bytes). - // urlencoded ф: %D1%84 - a string of 6 characters. - // If we use a curl call like here with only urlencoded ф, what arrives on the server in POST is "C3 91 C2 84" - // no idea what it is. - // - // A workaround for now is to use use an additional base64 encoding for all text fields, - // which are decoded back to utf-8 strings on the server side. - function putOwnWorkItem($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($fields['offer_id']), - 'type' => urlencode($fields['type']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'created_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'created_by' => urlencode($user->getUser()), - 'created_by_name' => urlencode(base64_encode($user->getName())), - 'created_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->put_own_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // updateOwnWorkItem - updates a work item in remote work server. - function updateOwnWorkItem($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($fields['work_id']), - 'type' => urlencode($fields['type']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->update_own_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // updateOwnWorkItemOnOffer - updates own work item posted on offer in remote work server. - function updateOwnWorkItemOnOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($fields['work_id']), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->update_own_work_item_on_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getOwnWorkItems - obtains a list of work items this group is currently outsourcing. - function getOwnWorkItems() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_work_items_iri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $active_work = $result_array['active_work']; - return $active_work; - } - - // getAvailableWorkItems - obtains a list of available work items this group can bid on. - function getAvailableWorkItems() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_available_work_items_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $available_work = $result_array['available_work']; - return $available_work; - } - - // getOwnWorkItem - gets work item details from remote work server. - function getOwnWorkItem($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($work_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $work_item = $result_array['work_item']; - return $work_item; - } - - // getOwnWorkItemOffers - gets offers on own work item from remote work server. - function getOwnWorkItemOffers($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($work_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_work_item_offers_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $work_item_offers = $result_array['work_item_offers']; - return $work_item_offers; - } - - // deleteOwnWorkItem - deletes work item from remote work server. - function deleteOwnWorkItem($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($work_id), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->delete_own_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // putOwnOffer - publishes an offer in remote work server. - function putOwnOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($fields['work_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'payment_info' => urlencode(base64_encode($fields['payment_info'])), - 'created_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'created_by' => urlencode($user->getUser()), - 'created_by_name' => urlencode(base64_encode($user->getName())), - 'created_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->put_own_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getOwnOffers - obtains a list of offers this group made available to other groups. - function getOwnOffers() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_offers_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $active_offers = $result_array['active_offers']; - return $active_offers; - } - - // getAvailableOffers - obtains a list of available offers from other organizations. - function getAvailableOffers() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_available_offers_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $available_offers = $result_array['available_offers']; - return $available_offers; - } - - // getOwnOffer - gets offer details from remote work server. - function getOwnOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($offer_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $offer = $result_array['offer']; - return $offer; - } - - // updateOwnOffer - updates an offer in remote work server. - function updateOwnOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($fields['offer_id']), - 'subject' => urlencode(base64_encode($fields['subject'])), - 'descr_short' => urlencode(base64_encode($fields['descr_short'])), - 'descr_long' => urlencode(base64_encode($fields['descr_long'])), - 'currency' => urlencode($fields['currency']), - 'amount' => urlencode($fields['amount']), - 'payment_info' => urlencode(base64_encode($fields['payment_info'])), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail())) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->update_own_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // deleteOwnOffer - deletes an offer from remote work server. - function deleteOwnOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($offer_id), - 'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'modified_by' => urlencode($user->getUser()), - 'modified_by_name' => urlencode(base64_encode($user->getName())), - 'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->delete_own_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getOwnWorkItemOffer - gets offer details from remote work server - // for an offer posted on own work item. - function getOwnWorkItemOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($offer_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_own_work_item_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $offer = $result_array['offer']; - return $offer; - } - - // declineOwnWorkItemOffer - declines an offer posted on own work item in remote work server. - function declineOwnWorkItemOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($fields['offer_id']), - 'client_comment' => urlencode(base64_encode($fields['client_comment']))); - //'modified_ip' => urlencode($_SERVER['REMOTE_ADDR']), - //'modified_by' => urlencode($user->getUser()), - //'modified_by_name' => urlencode(base64_encode($user->getName())), - //'modified_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->decline_own_work_item_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // acceptOwnWorkItemOffer - accepts an offer posted on own work item in remote work server. - function acceptOwnWorkItemOffer($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($fields['offer_id']), - 'client_comment' => urlencode(base64_encode($fields['client_comment'])), - 'accepted_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'accepted_by' => urlencode($user->getUser()), - 'accepted_by_name' => urlencode(base64_encode($user->getName())), - 'accepted_by_email' => urlencode(base64_encode($user->getEmail()))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->accept_own_work_item_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // getCurrencies - obtains a list of supported currencies. - static function getCurrencies() { - $mdb2 = getConnection(); - - $sql = "select id, name from tt_work_currencies order by id"; - $res = $mdb2->query($sql); - if (is_a($res, 'PEAR_Error')) return false; - - while ($val = $res->fetchRow()) { - $result[] = array('id'=>$val['id'], 'name'=>$val['name']); - } - return $result; - } - - // getCurrencyID - obtains an ID for currency. - static function getCurrencyID($currency) { - $mdb2 = getConnection(); - - $currency_id = null; - $sql = "select id from tt_work_currencies where name = ".$mdb2->quote($currency); - $res = $mdb2->query($sql); - if (is_a($res, 'PEAR_Error')) return null; - - if($val = $res->fetchRow()) { - $currency_id = $val['id']; - } - return $currency_id; - } - - // getCurrencyName - obtains currency name using its id. - static function getCurrencyName($currency_id) { - $mdb2 = getConnection(); - - $currency_name = null; - $sql = "select name from tt_work_currencies where id = $currency_id"; - $res = $mdb2->query($sql); - if (is_a($res, 'PEAR_Error')) return null; - - if($val = $res->fetchRow()) { - $currency_name = $val['name']; - } - return $currency_name; - } - - // getGroupItems - obtains a list of all items relevant to group in one API call to Remote Work Server. - function getGroupItems() { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_key' => urlencode($user->getGroupKey()) - ); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_group_items_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - unset($result_array['call_status']); // Remove call_status element, - return $result_array; - } - - // getAvailableWorkItem - gets available work item details from remote work server. - function getAvailableWorkItem($work_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'user_id' => urlencode($user->getUser()), - 'user_name' => urlencode(base64_encode($user->getName())), - 'user_email' => urlencode(base64_encode($user->getEmail())), - 'user_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'work_id' => urlencode($work_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_available_work_item_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $work_item = $result_array['work_item']; - return $work_item; - } - - // getAvailableOffer - gets available offer details from remote work server. - function getAvailableOffer($offer_id) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'user_id' => urlencode($user->getUser()), - 'user_name' => urlencode(base64_encode($user->getName())), - 'user_email' => urlencode(base64_encode($user->getEmail())), - 'user_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'offer_id' => urlencode($offer_id)); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->get_available_offer_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - $offer = $result_array['offer']; - return $offer; - } - - // sendMessageToWorkOwner - sends a message to work owner via remote work server. - function sendMessageToWorkOwner($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'work_id' => urlencode($fields['work_id']), - 'sender_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'sender_user_id' => urlencode($user->getUser()), - 'sender_name' => urlencode(base64_encode($user->getName())), - 'sender_email' => urlencode(base64_encode($user->getEmail())), - 'message_body' => urlencode(base64_encode($fields['message_body']))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->send_message_to_work_owner_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } - - // sendMessageToOfferOwner - sends a message to offer owner via remote work server. - function sendMessageToOfferOwner($fields) { - global $i18n; - global $user; - $mdb2 = getConnection(); - - $group_id = $user->getGroup(); - $org_id = $user->org_id; - - $curl_fields = array('lang' => urlencode($user->lang), - 'site_id' => urlencode($this->site_id), - 'site_key' => urlencode($this->site_key), - 'org_id' => urlencode($org_id), - 'org_key' => urlencode($user->getOrgKey()), - 'group_id' => urlencode($group_id), - 'group_name' => urlencode(base64_encode($user->getGroupName())), - 'group_key' => urlencode($user->getGroupKey()), - 'offer_id' => urlencode($fields['offer_id']), - 'sender_ip' => urlencode($_SERVER['REMOTE_ADDR']), - 'sender_user_id' => urlencode($user->getUser()), - 'sender_name' => urlencode(base64_encode($user->getName())), - 'sender_email' => urlencode(base64_encode($user->getEmail())), - 'message_body' => urlencode(base64_encode($fields['message_body']))); - - // url-ify the data for the POST. - foreach($curl_fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } - $fields_string = rtrim($fields_string, '&'); - - // Open connection. - $ch = curl_init(); - - // Set the url, number of POST vars, POST data. - curl_setopt($ch, CURLOPT_URL, $this->send_message_to_offer_owner_uri); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - // Execute a post request. - $result = curl_exec($ch); - - // Close connection. - curl_close($ch); - - if (!$result) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - - $result_array = json_decode($result, true); - - // Check for errors. - $call_status = $result_array['call_status']; - if (!$call_status) { - $this->errors->add($i18n->get('error.remote_work')); - return false; - } - if ($call_status['code'] != TT_CURL_SUCCESS) { - $this->errors->add($call_status['error']); - return false; - } - - return true; - } -} diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index 372b18d4..a189e50e 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -63,9 +63,6 @@ {$i18n.menu.groups} {$i18n.menu.options} - {if isTrue('WORK_SERVER_ADMINISTRATION')} - {$i18n.label.work} - {/if} diff --git a/WEB-INF/templates/site_map.tpl b/WEB-INF/templates/site_map.tpl index 6848fc52..54ff8818 100644 --- a/WEB-INF/templates/site_map.tpl +++ b/WEB-INF/templates/site_map.tpl @@ -4,9 +4,6 @@
- {if isTrue('WORK_SERVER_ADMINISTRATION')} - - {/if}
{* end of sub menu for admin *} {* main menu for admin *} diff --git a/WEB-INF/templates/work/admin_offer_edit.tpl b/WEB-INF/templates/work/admin_offer_edit.tpl deleted file mode 100644 index bd9a6542..00000000 --- a/WEB-INF/templates/work/admin_offer_edit.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{$forms.offerForm.open} - - - - -
- -{if $work_id} - - - - - - - - - -{/if} - - - - - - - - - - - - -{if $show_files} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.work}:{$work_name}
{$forms.offerForm.work_description.control}
 
{$i18n.label.offer} (*):{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.file}:{$forms.offerForm.newfile.control}
{$i18n.label.currency}:{$forms.offerForm.currency.control}
{$i18n.label.budget} (*):{$forms.offerForm.budget.control}
{$i18n.label.how_to_pay} (*):{$forms.offerForm.payment_info.control}
{$i18n.label.status}:{$forms.offerForm.status.control}
{$i18n.label.moderator_comment}:{$forms.offerForm.moderator_comment.control}
{$i18n.label.required_fields}
 
{$forms.offerForm.btn_approve.control} {$forms.offerForm.btn_save.control} {$forms.offerForm.btn_disapprove.control}
-
-{$forms.offerForm.close} diff --git a/WEB-INF/templates/work/admin_work.tpl b/WEB-INF/templates/work/admin_work.tpl deleted file mode 100644 index 13f37e91..00000000 --- a/WEB-INF/templates/work/admin_work.tpl +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - -
-{if $pending_work} - - - - - - - - - - - {foreach $pending_work as $work_item} - - - - - - - - - {/foreach} -
{$i18n.title.pending_work}
{$i18n.label.work}{$i18n.label.description}{$i18n.label.client}{$i18n.label.budget}
{$work_item.subject|escape}{$work_item.description|escape}{$work_item.group_name|escape} ({$work_item.site_id}.{$work_item.group_id}){$work_item.amount_with_currency}{$i18n.label.edit}{$i18n.label.delete}
-{/if} - -
- -{if $pending_offers} - - - - - - - - - - - {foreach $pending_offers as $offer} - - - - - - - - - {/foreach} -
{$i18n.title.pending_offers}
{$i18n.label.offer}{$i18n.label.description}{$i18n.label.contractor}{$i18n.label.budget}
{$offer.subject|escape}{$offer.description|escape}{$offer.group_name|escape} ({$offer.site_id}.{$offer.group_id}){$offer.amount_with_currency}{$i18n.label.edit}{$i18n.label.delete}
-{/if} - -
- - - -{if $available_work} - - - - - - - {foreach $available_work as $work_item} - - - - - - - {/foreach} -{/if} -
{$i18n.title.available_work}
{$i18n.label.work}{$i18n.label.description}{$i18n.label.client}{$i18n.label.budget}
{$work_item.subject|escape}{$work_item.description|escape}{$work_item.group_name|escape}{$work_item.amount_with_currency}
- -
- - - -{if $available_offers} - - - - - - - {foreach $available_offers as $offer} - - - - - - - {/foreach} -{/if} -
{$i18n.title.available_offers}
{$i18n.label.offer}{$i18n.label.description}{$i18n.label.contractor}{$i18n.label.budget}
{$offer.subject|escape}{$offer.description|escape}{$offer.group_name|escape}{$offer.amount_with_currency}
- -
diff --git a/WEB-INF/templates/work/admin_work_edit.tpl b/WEB-INF/templates/work/admin_work_edit.tpl deleted file mode 100644 index 1ae59a6f..00000000 --- a/WEB-INF/templates/work/admin_work_edit.tpl +++ /dev/null @@ -1,67 +0,0 @@ -{$forms.workForm.open} - -{if $offer} - - - -{/if} - - - -
- - - - - -
{$i18n.label.offer}: {$offer.subject}
{$i18n.label.contractor}: {$offer.group_name}
{$i18n.label.description}: {$offer.descr_short|escape}
{$i18n.label.budget}: {$offer.amount_with_currency}
-
- - - - - - - - - - - - - -{if $show_files} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.work} (*):{$forms.workForm.work_name.control}
{$i18n.label.description}:{$forms.workForm.description.control}
{$i18n.label.details}:{$forms.workForm.details.control}
{$i18n.label.file}:{$forms.workForm.newfile.control}
{$i18n.label.currency}:{$forms.workForm.currency.control}
{$i18n.label.budget} (*):{$forms.workForm.budget.control}
{$i18n.label.status}:{$forms.workForm.status.control}
{$i18n.label.moderator_comment}:{$forms.workForm.moderator_comment.control}
{$i18n.label.required_fields}
 
{$forms.workForm.btn_save.control}
-
-{$forms.workForm.close} diff --git a/WEB-INF/templates/work/footer_old.tpl b/WEB-INF/templates/work/footer_old.tpl deleted file mode 100644 index 61106755..00000000 --- a/WEB-INF/templates/work/footer_old.tpl +++ /dev/null @@ -1,29 +0,0 @@ - - - - -

 

- - - - - -
{$i18n.footer.contribute_msg}
-
- - - - -
Anuko Time Tracker {constant('APP_VERSION')} | Copyright © Anuko | - {$i18n.footer.credits} | - {$i18n.footer.license} | - {$i18n.footer.improve} -
-
- - - - - - - diff --git a/WEB-INF/templates/work/header.tpl b/WEB-INF/templates/work/header.tpl deleted file mode 100644 index 6b767a16..00000000 --- a/WEB-INF/templates/work/header.tpl +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - -{if $i18n.language.rtl} - -{/if} - Time Tracker{if $title} - {$title}{/if} - - - - - - - -{assign var="tab_width" value="700"} - - - - - - + +
- - - - -{if $user->custom_logo} - - -
-{else} - -{/if} - - - - -
- - - -{if $user->custom_logo} - -{else} - -{/if} - - -
-
- - -{if $authenticated} - {if $user->can('administer_site')} - - - - - -
  - {$i18n.menu.logout} - {$i18n.menu.forum} - {$i18n.menu.help} -
- - - - - - - - - - {else} - - - - - -
  - {$i18n.menu.logout} - {if $user->exists() && $user->can('manage_own_settings')} - {$i18n.menu.profile} - {/if} - {if $user->can('manage_basic_settings')} - {$i18n.menu.group} - {/if} - {if $user->can('manage_features')} - {$i18n.menu.plugins} - {/if} - {$i18n.menu.forum} - {$i18n.menu.help} -
- - - - - - - - - - {/if} -{else} - - - - - -
  - {$i18n.menu.login} - {if isTrue('MULTIORG_MODE') && constant('AUTH_MODULE') == 'db'} - {$i18n.menu.register} - {/if} - {$i18n.menu.forum} - {$i18n.menu.help} -
-{/if} -
- - -{if $title} - - - {* No need to escape as it is done in the class. *} -
{$title}{if $timestring}: {$timestring}{/if}
{$user->getUserPartForHeader()}
-{/if} - - - -{if $err->yes()} - - - - -
- {foreach $err->getErrors() as $error} - {$error.message}
{* No need to escape as they are not coming from user and may contain a link. *} - {/foreach} -
-{/if} - - - -{if $msg->yes()} - - - - -
- {foreach $msg->getErrors() as $message} - {$message.message}
{* No need to escape. *} - {/foreach} -
-{/if} - diff --git a/WEB-INF/templates/work/index.tpl b/WEB-INF/templates/work/index.tpl deleted file mode 100644 index c4f19352..00000000 --- a/WEB-INF/templates/work/index.tpl +++ /dev/null @@ -1,5 +0,0 @@ -{include file="work/header.tpl"} - -{if $content_page_name}{include file="$content_page_name"}{/if} - -{include file="work/footer_old.tpl"} diff --git a/WEB-INF/templates/work/offer_add.tpl b/WEB-INF/templates/work/offer_add.tpl deleted file mode 100644 index 80e07d80..00000000 --- a/WEB-INF/templates/work/offer_add.tpl +++ /dev/null @@ -1,74 +0,0 @@ -{$forms.offerForm.open} - -{if $work_item} - - - -{/if} - - - - -
- - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- -{if $work_id} - - - - - - - - - -{/if} - - - - - - - - - - - - -{if $show_files} - - - - -{/if} - - - - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.work}:{$work_name}
{$forms.offerForm.work_description.control}
 
{$i18n.label.offer} (*):{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.file}:{$forms.offerForm.newfile.control}
{$i18n.label.currency}:{$forms.offerForm.currency.control}
{$i18n.label.budget} (*):{$forms.offerForm.budget.control} {$i18n.label.what_is_it}
{$i18n.label.how_to_pay} (*):{$forms.offerForm.payment_info.control} {$i18n.label.what_is_it}
{$i18n.label.required_fields}
 
{$forms.offerForm.btn_add.control}
-
-{$forms.offerForm.close} diff --git a/WEB-INF/templates/work/offer_delete.tpl b/WEB-INF/templates/work/offer_delete.tpl deleted file mode 100644 index 7d8954cf..00000000 --- a/WEB-INF/templates/work/offer_delete.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{$forms.offerDeleteForm.open} - - - - -
- - - - - - - - - - - -
{$offer_to_delete|escape}
 
{$forms.offerDeleteForm.btn_delete.control}  {$forms.offerDeleteForm.btn_cancel.control}
-
-{$forms.offerDeleteForm.close} diff --git a/WEB-INF/templates/work/offer_edit.tpl b/WEB-INF/templates/work/offer_edit.tpl deleted file mode 100644 index 5c1e89a3..00000000 --- a/WEB-INF/templates/work/offer_edit.tpl +++ /dev/null @@ -1,67 +0,0 @@ -{$forms.offerForm.open} - -{if $work_item} - - - -{/if} - - - - -
- - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{if $show_moderator_comment} - - - - -{/if} - - - - - - - - - - - -
{$i18n.label.offer} (*):{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.currency}:{$forms.offerForm.currency.control}
{$i18n.label.budget} (*):{$forms.offerForm.budget.control} {$i18n.label.what_is_it}
{$i18n.label.how_to_pay} (*):{$forms.offerForm.payment_info.control} {$i18n.label.what_is_it}
{$i18n.label.status}:{$forms.offerForm.status.control}
{$i18n.label.moderator_comment}:{$forms.offerForm.moderator_comment.control}
{$i18n.label.required_fields}
 
{$forms.offerForm.btn_save.control}
-
-{$forms.offerForm.close} diff --git a/WEB-INF/templates/work/offer_message.tpl b/WEB-INF/templates/work/offer_message.tpl deleted file mode 100644 index c97a3db9..00000000 --- a/WEB-INF/templates/work/offer_message.tpl +++ /dev/null @@ -1,32 +0,0 @@ - - -{$forms.messageForm.open} - -{if $offer} - - - -{/if} - - - -
- - - - -
{$i18n.label.offer}: {$offer.subject}
{$i18n.label.description}: {$offer.descr_short|escape}
{$i18n.label.budget}: {$offer.amount_with_currency}
-
- - - - - - - - -
{$i18n.work.label.message}:{$forms.messageForm.message_body.control}
{$forms.messageForm.btn_send.control}
-
-{$forms.messageForm.close} diff --git a/WEB-INF/templates/work/offer_view.tpl b/WEB-INF/templates/work/offer_view.tpl deleted file mode 100644 index 3d9d7d0c..00000000 --- a/WEB-INF/templates/work/offer_view.tpl +++ /dev/null @@ -1,47 +0,0 @@ - - -{$forms.offerForm.open} - - - - -
- - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.contractor}:{$forms.offerForm.contractor.control}
{$i18n.label.offer}:{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.budget}:{$forms.offerForm.budget.control}
-
-{$forms.offerForm.close} - - - - - -
- - - - - -
-
diff --git a/WEB-INF/templates/work/offer_view_own.tpl b/WEB-INF/templates/work/offer_view_own.tpl deleted file mode 100644 index d00ae7ea..00000000 --- a/WEB-INF/templates/work/offer_view_own.tpl +++ /dev/null @@ -1,42 +0,0 @@ - - -{$forms.offerForm.open} - -{if $work_item} - - - -{/if} - - - - -
- - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- - - - - - - - - - - - - - - - - -
{$i18n.label.offer}:{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.budget}:{$forms.offerForm.budget.control}
-
-{$forms.offerForm.close} diff --git a/WEB-INF/templates/work/work.tpl b/WEB-INF/templates/work/work.tpl deleted file mode 100644 index 67235b64..00000000 --- a/WEB-INF/templates/work/work.tpl +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - -
-{if $own_work_items} - - - - - - - - - - - - {foreach $own_work_items as $work_item} - - - - - - - {if $work_item.can_edit} - - {else} - - {/if} - {if $work_item.can_delete} - - {else} - - {/if} - - {/foreach} -
{$i18n.work.label.own_work}
{$i18n.label.work}{$i18n.label.description}{$i18n.label.status}{$i18n.work.label.offers}{$i18n.label.budget}
{$work_item.subject|escape}{$work_item.description|escape}{$work_item.status_label}{if $work_item.num_offers}{$work_item.num_offers}{/if}{$work_item.amount_with_currency}{$i18n.label.edit}{$i18n.label.delete}
- - - - - -

-
-
-{/if} - - - -{if $available_work_items} - - - - - - - {foreach $available_work_items as $work_item} - - - - - - - {/foreach} -{/if} -
{$i18n.title.available_work}
{$i18n.label.work}{$i18n.label.description}{$i18n.label.client}{$i18n.label.budget}
{$work_item.subject|escape}{$work_item.description|escape}{$work_item.group_name|escape}{$work_item.amount_with_currency}
- - - - - -

-
-
- -{if $own_offers} - - - - - - - - - - - {foreach $own_offers as $offer} - - - - - - - - - {/foreach} -
{$i18n.work.label.own_offers}
{$i18n.label.offer}{$i18n.label.description}{$i18n.label.status}{$i18n.label.budget}
{$offer.subject|escape}{$offer.description|escape}{$offer.status_label}{$offer.amount_with_currency}{$i18n.label.edit}{$i18n.label.delete}
- - - - - -

-
-
-{/if} - - - -{if $available_offers} - - - - - - - {foreach $available_offers as $offer} - - - - - - - {/foreach} -{/if} -
{$i18n.title.available_offers}
{$i18n.label.offer}{$i18n.label.description}{$i18n.label.contractor}{$i18n.label.budget}
{$offer.subject|escape}{$offer.description|escape}{$offer.group_name|escape}{$offer.amount_with_currency}
- - - - - -

-
-
- -
diff --git a/WEB-INF/templates/work/work_add.tpl b/WEB-INF/templates/work/work_add.tpl deleted file mode 100644 index eca0ba79..00000000 --- a/WEB-INF/templates/work/work_add.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{$forms.workForm.open} - -{if $offer} - - - -{/if} - - - -
- - - - -
{$i18n.label.offer}: {$offer.subject}
{$i18n.label.description}: {$offer.descr_short|escape}
{$i18n.label.budget}: {$offer.amount_with_currency}
-
- - - - - - - - - - - - - - - - - -{if $show_files} - - - - -{/if} - - - - - - - - - - - - - - - - - - - -
{$i18n.label.work} (*):{$forms.workForm.work_name.control}
{$i18n.label.type}:{$forms.workForm.work_type.control}
{$i18n.label.description}:{$forms.workForm.description.control}
{$i18n.label.details}:{$forms.workForm.details.control}
{$i18n.label.file}:{$forms.workForm.newfile.control}
{$i18n.label.currency}:{$forms.workForm.currency.control}
{$i18n.label.budget} (*):{$forms.workForm.budget.control} {$i18n.label.what_is_it}
{$i18n.label.required_fields}
 
{$forms.workForm.btn_add.control}
-
-{$forms.workForm.close} diff --git a/WEB-INF/templates/work/work_delete.tpl b/WEB-INF/templates/work/work_delete.tpl deleted file mode 100644 index 2831b0f1..00000000 --- a/WEB-INF/templates/work/work_delete.tpl +++ /dev/null @@ -1,20 +0,0 @@ -{$forms.workDeleteForm.open} - - - - -
- - - - - - - - - - - -
{$work_to_delete|escape}
 
{$forms.workDeleteForm.btn_delete.control}  {$forms.workDeleteForm.btn_cancel.control}
-
-{$forms.workDeleteForm.close} diff --git a/WEB-INF/templates/work/work_edit.tpl b/WEB-INF/templates/work/work_edit.tpl deleted file mode 100644 index 7165d5e1..00000000 --- a/WEB-INF/templates/work/work_edit.tpl +++ /dev/null @@ -1,73 +0,0 @@ -{$forms.workForm.open} - -{if $offer} - - - -{/if} - - - -
- - - - - -
{$i18n.label.offer}: {$offer.subject}
{$i18n.label.contractor}: {$offer.group_name}
{$i18n.label.description}: {$offer.descr_short|escape}
{$i18n.label.budget}: {$offer.amount_with_currency}
-
- - - - - - - - - - - - - - - - - -{if $show_files} - - - - -{/if} - - - - - - - - - - - - -{if $show_moderator_comment} - - - - -{/if} - - - - - - - - - - - -
{$i18n.label.work} (*):{$forms.workForm.work_name.control}
{$i18n.label.type}:{$forms.workForm.work_type.control}
{$i18n.label.description}:{$forms.workForm.description.control}
{$i18n.label.details}:{$forms.workForm.details.control}
{$i18n.label.file}:{$forms.workForm.newfile.control}
{$i18n.label.currency}:{$forms.workForm.currency.control}
{$i18n.label.budget} (*):{$forms.workForm.budget.control} {$i18n.label.what_is_it}
{$i18n.label.status}:{$forms.workForm.status.control}
{$i18n.label.moderator_comment}:{$forms.workForm.moderator_comment.control}
{$i18n.label.required_fields}
 
{$forms.workForm.btn_save.control}
-
-{$forms.workForm.close} diff --git a/WEB-INF/templates/work/work_message.tpl b/WEB-INF/templates/work/work_message.tpl deleted file mode 100644 index 3f237659..00000000 --- a/WEB-INF/templates/work/work_message.tpl +++ /dev/null @@ -1,32 +0,0 @@ - - -{$forms.messageForm.open} - -{if $work_item} - - - -{/if} - - - -
- - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- - - - - - - - -
{$i18n.work.label.message}:{$forms.messageForm.message_body.control}
{$forms.messageForm.btn_send.control}
-
-{$forms.messageForm.close} diff --git a/WEB-INF/templates/work/work_offer_view.tpl b/WEB-INF/templates/work/work_offer_view.tpl deleted file mode 100644 index e2afe000..00000000 --- a/WEB-INF/templates/work/work_offer_view.tpl +++ /dev/null @@ -1,57 +0,0 @@ -{$forms.offerForm.open} - -{if $work_item} - - - -{/if} - - - -
- - - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.client}: {$work_item.group_name}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.contractor}:{$forms.offerForm.contractor.control}
{$i18n.label.offer}:{$forms.offerForm.offer_name.control}
{$i18n.label.description}:{$forms.offerForm.description.control}
{$i18n.label.details}:{$forms.offerForm.details.control}
{$i18n.label.budget}:{$forms.offerForm.budget.control}
{$i18n.label.status}:{$forms.offerForm.status.control}
 
{$forms.offerForm.btn_accept.control} {$forms.offerForm.btn_decline.control}
{$i18n.label.comment}:{$forms.offerForm.client_comment.control}
-
-{$forms.offerForm.close} diff --git a/WEB-INF/templates/work/work_offers.tpl b/WEB-INF/templates/work/work_offers.tpl deleted file mode 100644 index ea0d8816..00000000 --- a/WEB-INF/templates/work/work_offers.tpl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - -
- - - - - -
{$i18n.label.work}: {$work_item.subject}
{$i18n.label.client}: {$work_item.group_name}
{$i18n.label.description}: {$work_item.descr_short|escape}
{$i18n.label.budget}: {$work_item.amount_with_currency}
-
- -{if $work_item_offers} - - - - - - - - {foreach $work_item_offers as $offer} - - - - - - - {/foreach} -
{$i18n.label.contractor}{$i18n.label.description}{$i18n.label.status}{$i18n.label.budget}
{$offer.group_name|escape}{$offer.description|escape}{$offer.status_label}{$offer.amount_with_currency}
-{/if} - -
diff --git a/WEB-INF/templates/work/work_view.tpl b/WEB-INF/templates/work/work_view.tpl deleted file mode 100644 index 468cb9dd..00000000 --- a/WEB-INF/templates/work/work_view.tpl +++ /dev/null @@ -1,47 +0,0 @@ - - -{$forms.workForm.open} - - - - -
- - - - - - - - - - - - - - - - - - - - - -
{$i18n.label.client}:{$forms.workForm.client.control}
{$i18n.label.work}:{$forms.workForm.work_name.control}
{$i18n.label.description}:{$forms.workForm.description.control}
{$i18n.label.details}:{$forms.workForm.details.control}
{$i18n.label.budget}:{$forms.workForm.budget.control}
-
-{$forms.workForm.close} - - - - - -
- - - - - -
-
diff --git a/WEB-INF/templates/work/work_view_own.tpl b/WEB-INF/templates/work/work_view_own.tpl deleted file mode 100644 index 61e270b4..00000000 --- a/WEB-INF/templates/work/work_view_own.tpl +++ /dev/null @@ -1,38 +0,0 @@ -{$forms.workForm.open} - -{if $offer} - - - -{/if} - - - -
- - - - - -
{$i18n.label.offer}: {$offer.subject}
{$i18n.label.contractor}: {$offer.group_name}
{$i18n.label.description}: {$offer.descr_short|escape}
{$i18n.label.budget}: {$offer.amount_with_currency}
-
- - - - - - - - - - - - - - - - - -
{$i18n.label.work}:{$forms.workForm.work_name.control}
{$i18n.label.description}:{$forms.workForm.description.control}
{$i18n.label.details}:{$forms.workForm.details.control}
{$i18n.label.budget}:{$forms.workForm.budget.control}
-
-{$forms.workForm.close} diff --git a/work/admin_offer_delete.php b/work/admin_offer_delete.php deleted file mode 100644 index a1bd5fac..00000000 --- a/work/admin_offer_delete.php +++ /dev/null @@ -1,71 +0,0 @@ -getParameter('id'); -$adminWorkHelper = new ttAdminWorkHelper($err); -$offer = $adminWorkHelper->getOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$offer_to_delete = $offer['subject']; - -$form = new Form('offerDeleteForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_offer_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_delete')) { - if ($adminWorkHelper->deleteOffer($cl_offer_id)) { - header('Location: admin_work.php'); - exit(); - } - } elseif ($request->getParameter('btn_cancel')) { - header('Location: admin_work.php'); - exit(); - } -} // isPost - -$smarty->assign('offer_to_delete', $offer_to_delete); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.offerDeleteForm.btn_cancel.focus()"'); -$smarty->assign('title', $i18n->get('title.delete_offer')); -$smarty->assign('content_page_name', 'work/offer_delete.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/admin_offer_edit.php b/work/admin_offer_edit.php deleted file mode 100644 index ab795c13..00000000 --- a/work/admin_offer_edit.php +++ /dev/null @@ -1,171 +0,0 @@ -getParameter('id'); -$adminWorkHelper = new ttAdminWorkHelper($err); -$offer = $adminWorkHelper->getOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -// Is this offer associated with a work item? -$work_id = $offer['work_id']; -if ($work_id) { - $work_item = $adminWorkHelper->getWorkItem($work_id); - if (!$work_item) $err->add($i18n->get('work.error.work_not_available')); -} - -$existingStatus = $offer['status']; -$currencies = ttWorkHelper::getCurrencies(); - -if ($request->isPost()) { - $cl_name = trim($request->getParameter('offer_name')); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - if (!$cl_currency_id && $work_item) $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - $cl_budget = $request->getParameter('budget'); - $cl_payment_info = $request->getParameter('payment_info'); - // $cl_status = $request->getParameter('status'); - $cl_moderator_comment = $request->getParameter('moderator_comment'); -} else { - $cl_name = $offer['subject']; - $cl_description = $offer['descr_short']; - $cl_details = $offer['descr_long']; - $currency = $offer['currency']; - $cl_currency_id = ttWorkHelper::getCurrencyID($offer['currency']); - $cl_budget = $offer['amount']; - $cl_payment_info = $offer['payment_info']; - $status = $offer['status']; - $status_label = $offer['status_label']; - $cl_moderator_comment = $offer['moderator_comment']; -} - -$form = new Form('offerForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_offer_id)); -if ($work_id) { - $form->addInput(array('type'=>'textarea','name'=>'work_description','style'=>'width: 400px; height: 80px;','value'=>$work_item['descr_short'])); - $form->getElement('work_description')->setEnabled(false); -} -$form->addInput(array('type'=>'text','name'=>'offer_name','style'=>'width: 400px;','value'=>$cl_name)); -if ($work_id) $form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -if ($work_id) $form->getElement('currency')->setEnabled(false); -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -$form->addInput(array('type'=>'textarea','name'=>'payment_info','maxlength'=>'256','style'=>'width: 400px; height: 40px;vertical-align: middle','value'=>$cl_payment_info)); -$form->addInput(array('type'=>'text','name'=>'status','style'=>'width: 400px;','value'=>$status_label)); -$form->getElement('status')->setEnabled(false); - -// Prepare status choices. -/* -$status_options = array(); -$status_options[STATUS_PENDING_APPROVAL] = $i18n->get('dropdown.pending_approval'); -$status_options[STATUS_DISAPPROVED] = $i18n->get('dropdown.not_approved'); -$status_options[STATUS_APPROVED] = $i18n->get('dropdown.approved'); - -$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,'data'=>$status_options)); -*/ -$form->addInput(array('type'=>'textarea','name'=>'moderator_comment','style'=>'width: 400px; height: 80px;','value'=>$cl_moderator_comment)); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); -if ($status == STATUS_PENDING_APPROVAL) { - $form->addInput(array('type'=>'submit','name'=>'btn_approve','value'=>$i18n->get('button.approve'))); - $form->addInput(array('type'=>'submit','name'=>'btn_disapprove','value'=>$i18n->get('button.disapprove'))); -} - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.work')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - if (!ttValidString($cl_payment_info)) $err->add($i18n->get('error.field'), $i18n->get('label.how_to_pay')); - if (!ttValidString($cl_moderator_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.moderator_comment')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - $fields = array('offer_id'=>$cl_offer_id, - 'subject'=>$cl_name, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget, - 'payment_info' => $cl_payment_info, - 'moderator_comment' => $cl_moderator_comment); - - if ($err->no()) { - if ($request->getParameter('btn_approve')) { - // Approve offer. - if ($adminWorkHelper->approveOffer($fields)) { - header('Location: admin_work.php'); - exit(); - } - } - - if ($request->getParameter('btn_save')) { - // Update offer without changing its status. - if ($adminWorkHelper->updateOffer($fields)) { - header('Location: admin_work.php'); - exit(); - } - } - - if ($request->getParameter('btn_disapprove')) { - // Dispprove offer. - if ($adminWorkHelper->disapproveOffer($fields)) { - header('Location: admin_work.php'); - exit(); - } - } - } -} // isPost - -if ($work_id) { - $smarty->assign('work_id', $work_id); - $smarty->assign('work_name', $work_item['subject']); - $smarty->assign('work_description', $work_item['descr_short']); -} -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.edit_offer')); -$smarty->assign('content_page_name', 'work/admin_offer_edit.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/admin_work.php b/work/admin_work.php deleted file mode 100644 index 86a029a4..00000000 --- a/work/admin_work.php +++ /dev/null @@ -1,53 +0,0 @@ -getItems(); -$pending_work = $adminItems['pending_work']; -$pending_offers = $adminItems['pending_offers']; -$available_work = $adminItems['available_work']; -$available_offers = $adminItems['available_offers']; - -$smarty->assign('pending_work', $pending_work); -$smarty->assign('pending_offers', $pending_offers); -$smarty->assign('available_work', $available_work); -$smarty->assign('available_offers', $available_offers); -$smarty->assign('title', $i18n->get('title.work')); -$smarty->assign('content_page_name', 'work/admin_work.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/admin_work_delete.php b/work/admin_work_delete.php deleted file mode 100644 index 11b59943..00000000 --- a/work/admin_work_delete.php +++ /dev/null @@ -1,71 +0,0 @@ -getParameter('id'); -$adminWorkHelper = new ttAdminWorkHelper($err); -$work_item = $adminWorkHelper->getWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$work_to_delete = $work_item['subject']; - -$form = new Form('workDeleteForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_delete')) { - if ($adminWorkHelper->deleteWorkItem($cl_work_id)) { - header('Location: admin_work.php'); - exit(); - } - } elseif ($request->getParameter('btn_cancel')) { - header('Location: admin_work.php'); - exit(); - } -} // isPost - -$smarty->assign('work_to_delete', $work_to_delete); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.workDeleteForm.btn_cancel.focus()"'); -$smarty->assign('title', $i18n->get('title.delete_work')); -$smarty->assign('content_page_name', 'work/work_delete.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/admin_work_edit.php b/work/admin_work_edit.php deleted file mode 100644 index 51169325..00000000 --- a/work/admin_work_edit.php +++ /dev/null @@ -1,168 +0,0 @@ -getParameter('id'); -$adminWorkHelper = new ttAdminWorkHelper($err); -$work_item = $adminWorkHelper->getWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// Do we have offer_id? -$offer_id = $work_item['offer_id']; -if ($offer_id) { - $offer = $adminWorkHelper->getOffer($offer_id); - if (!$offer) { - header('Location: ../access_denied.php'); - exit(); - } -} -// End of access checks. - -$existingStatus = $work_item['status']; -$currencies = ttWorkHelper::getCurrencies(); - -if ($request->isPost()) { - $cl_name = trim($request->getParameter('work_name')); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - $cl_budget = $request->getParameter('budget'); - $cl_status = $request->getParameter('status'); - $cl_moderator_comment = $request->getParameter('moderator_comment'); -} else { - $cl_name = $work_item['subject']; - $cl_description = $work_item['descr_short']; - $cl_details = $work_item['descr_long']; - $currency = $work_item['currency']; - $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - $cl_budget = $work_item['amount']; - $cl_status = $work_item['status']; - $cl_moderator_comment = $work_item['moderator_comment']; -} - -$form = new Form('workForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'text','name'=>'work_name','maxlength'=>'128','style'=>'width: 400px;','value'=>$cl_name)); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -// Disable some controls for work on an available offer. -if ($offer) { - $form->getElement('work_name')->setEnabled(false); - // $form->getElement('work_type')->setEnabled(false); - $form->getElement('currency')->setEnabled(false); - $form->getElement('budget')->setEnabled(false); -} - -// Prepare status choices. -$status_options = array(); -$status_options[STATUS_PENDING_APPROVAL] = $i18n->get('dropdown.pending_approval'); -$status_options[STATUS_DISAPPROVED] = $i18n->get('dropdown.not_approved'); -$status_options[STATUS_APPROVED] = $i18n->get('dropdown.approved'); - -$form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status,'data'=>$status_options)); -$form->addInput(array('type'=>'textarea','name'=>'moderator_comment','style'=>'width: 400px; height: 80px;','value'=>$cl_moderator_comment)); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.work')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - if (!ttValidString($cl_moderator_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.moderator_comment')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - if ($request->getParameter('btn_save')) { - $fields = array('work_id'=>$cl_work_id, - 'subject'=>$cl_name, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget, - 'moderator_comment' => $cl_moderator_comment); - - // Do things differently, depending on status control value. - if ($existingStatus == $cl_status) { - // Status not changed. Update work information. - if ($adminWorkHelper->updateWorkItem($fields)) { - header('Location: admin_work.php'); - exit(); - } - } else if ($cl_status == STATUS_DISAPPROVED) { - // Status changed to "not approved". Disapprove work. - if ($offer_id) { - if ($adminWorkHelper->disapproveWorkItemOnOffer($fields)) { - header('Location: admin_work.php'); - exit(); - } - } else { - if ($adminWorkHelper->disapproveWorkItem($fields)) { - header('Location: admin_work.php'); - exit(); - } - } - } else if ($cl_status == STATUS_APPROVED) { - // Status changed to "approved". Approve work. - if ($offer_id) { - if ($adminWorkHelper->approveWorkItemOnOffer($fields)) { - header('Location: admin_work.php'); - exit(); - } - } else { - if ($adminWorkHelper->approveWorkItem($fields)) { - header('Location: admin_work.php'); - exit(); - } - } - } - } - } -} // isPost - -$smarty->assign('offer', $offer); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.edit_work')); -$smarty->assign('content_page_name', 'work/admin_work_edit.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_add.php b/work/offer_add.php deleted file mode 100644 index bafdae21..00000000 --- a/work/offer_add.php +++ /dev/null @@ -1,120 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -// Do we have work_id? -$cl_work_id = (int)$request->getParameter('work_id'); -if ($cl_work_id) { - $workHelper = new ttWorkHelper($err); - $work_item = $workHelper->getAvailableWorkItem($cl_work_id); - if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); - } -} -// End of access checks. -if ($work_item) $cl_name = $work_item['subject']; - -if ($request->isPost()) { - if (!$work_item) - $cl_name = trim($request->getParameter('offer_name')); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - if (!$cl_currency_id && $work_item) $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - $cl_budget = $request->getParameter('budget'); - $cl_payment_info = $request->getParameter('payment_info'); -} else { - if ($work_item) { - $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - } -} - -$form = new Form('offerForm'); -if ($cl_work_id) { - $form->addInput(array('type'=>'hidden','name'=>'work_id','value'=>$cl_work_id)); - $form->addInput(array('type'=>'textarea','name'=>'work_description','style'=>'width: 400px; height: 80px;','value'=>$work_item['descr_short'])); - $form->getElement('work_description')->setEnabled(false); -} -$form->addInput(array('type'=>'text','name'=>'offer_name','maxlength'=>'128','style'=>'width: 400px;','value'=>$cl_name)); -if ($work_item) $form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -// Add a dropdown for currency. -$currencies = ttWorkHelper::getCurrencies(); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -if ($work_item) $form->getElement('currency')->setEnabled(false); // Do not allow changing currency for offers on existing work items. -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -$form->addInput(array('type'=>'textarea','name'=>'payment_info','maxlength'=>'256','style'=>'width: 400px; height: 40px;vertical-align: middle','value'=>$cl_payment_info)); -$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add'))); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.offer')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - if (!ttValidString($cl_payment_info)) $err->add($i18n->get('error.field'), $i18n->get('label.how_to_pay')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - $workHelper = new ttWorkHelper($err); - $fields = array('work_id'=>$cl_work_id, - 'subject'=>$cl_name, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget, - 'payment_info' => $cl_payment_info); - if ($workHelper->putOwnOffer($fields)) { - header('Location: work.php'); - exit(); - } - } -} // isPost - -$smarty->assign('work_item', $work_item); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.offerForm.work_name.focus()"'); -$smarty->assign('title', $i18n->get('title.add_offer')); -$smarty->assign('content_page_name', 'work/offer_add.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_delete.php b/work/offer_delete.php deleted file mode 100644 index fd3d2e7d..00000000 --- a/work/offer_delete.php +++ /dev/null @@ -1,75 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_offer_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getOwnOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$offer_to_delete = $offer['subject']; - -$form = new Form('offerDeleteForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_offer_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_delete')) { - if ($workHelper->deleteOwnOffer($cl_offer_id)) { - header('Location: work.php'); - exit(); - } - } elseif ($request->getParameter('btn_cancel')) { - header('Location: work.php'); - exit(); - } -} // isPost - -$smarty->assign('offer_to_delete', $offer_to_delete); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.offerDeleteForm.btn_cancel.focus()"'); -$smarty->assign('title', $i18n->get('title.delete_offer')); -$smarty->assign('content_page_name', 'work/offer_delete.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_edit.php b/work/offer_edit.php deleted file mode 100644 index bd217221..00000000 --- a/work/offer_edit.php +++ /dev/null @@ -1,135 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_offer_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getOwnOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -// Is this offer associated with a work item? -$work_id = $offer['work_id']; -if ($work_id) { - $work_item = $workHelper->getAvailableWorkItem($work_id); - if (!$work_item) $err->add($i18n->get('work.error.work_not_available')); -} - -$currencies = ttWorkHelper::getCurrencies(); - -if ($request->isPost()) { - $cl_name = trim($request->getParameter('offer_name')); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - if (!$cl_currency_id && $work_item) $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - $cl_budget = $request->getParameter('budget'); - $cl_payment_info = $request->getParameter('payment_info'); -} else { - $cl_name = $offer['subject']; - $cl_description = $offer['descr_short']; - $cl_details = $offer['descr_long']; - $cl_currency_id = ttWorkHelper::getCurrencyID($offer['currency']); - $cl_budget = $offer['amount']; - $cl_payment_info = $offer['payment_info']; - $cl_status = $offer['status_label']; - $cl_moderator_comment = $offer['moderator_comment']; -} - -$show_moderator_comment = $cl_moderator_comment != null; - -$form = new Form('offerForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_offer_id)); -if ($work_id) { - $form->addInput(array('type'=>'textarea','name'=>'work_description','style'=>'width: 400px; height: 80px;','value'=>$work_item['descr_short'])); - $form->getElement('work_description')->setEnabled(false); -} -$form->addInput(array('type'=>'text','name'=>'offer_name','maxlength'=>'128','style'=>'width: 400px;','value'=>$cl_name)); -if ($work_id) $form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -if ($work_id) $form->getElement('currency')->setEnabled(false); -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -$form->addInput(array('type'=>'textarea','name'=>'payment_info','maxlength'=>'256','style'=>'width: 400px; height: 40px; vertical-align: middle','value'=>$cl_payment_info)); -$form->addInput(array('type'=>'text','name'=>'status','style'=>'width: 400px;','value'=>$cl_status)); -$form->getElement('status')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'moderator_comment','style'=>'width: 400px; height: 80px;','value'=>$cl_moderator_comment)); -$form->getElement('moderator_comment')->setEnabled(false); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.offer')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - if (!ttValidString($cl_payment_info)) $err->add($i18n->get('error.field'), $i18n->get('label.how_to_pay')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - if ($request->getParameter('btn_save')) { - // Update offer information. - $fields = array('offer_id'=>$cl_offer_id, - 'subject'=>$cl_name, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget, - 'payment_info' => $cl_payment_info); - if ($workHelper->updateOwnOffer($fields)) { - header('Location: work.php'); - exit(); - } - } - } -} // isPost - -$smarty->assign('work_item', $work_item); -$smarty->assign('show_moderator_comment', $show_moderator_comment); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.edit_offer')); -$smarty->assign('content_page_name', 'work/offer_edit.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_message.php b/work/offer_message.php deleted file mode 100644 index ff324808..00000000 --- a/work/offer_message.php +++ /dev/null @@ -1,90 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_offer_id = (int)$request->getParameter('offer_id'); -if (!$cl_offer_id) { - header('Location: ../access_denied.php'); - exit(); -} -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getAvailableOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$cl_name = $offer['subject']; - -if ($request->isPost()) { - $cl_message_body = trim($request->getParameter('message_body')); -} - -$form = new Form('messageForm'); -$form->addInput(array('type'=>'hidden','name'=>'offer_id','value'=>$cl_offer_id)); -$form->addInput(array('type'=>'textarea','name'=>'message_body','style'=>'width: 400px; height: 80px;vertical-align: middle','value'=>$cl_message_body)); -$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->get('work.button.send_message'))); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_message_body)) $err->add($i18n->get('error.field'), $i18n->get('work.label.message')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - $workHelper = new ttWorkHelper($err); - $fields = array('offer_id'=>$cl_offer_id, - 'message_body' => $cl_message_body); - if ($workHelper->sendMessageToOfferOwner($fields)) { - $msg->add($i18n->get('work.msg.message_sent')); - // header('Location: work.php'); // TODO: where to redirect? - // exit(); - } - } -} // isPost - -$smarty->assign('offer', $offer); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.offerForm.work_name.focus()"'); -$smarty->assign('title', $i18n->get('work.title.send_message')); -$smarty->assign('content_page_name', 'work/offer_message.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_view.php b/work/offer_view.php deleted file mode 100644 index 1e045bf2..00000000 --- a/work/offer_view.php +++ /dev/null @@ -1,81 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -if (!ttAccessAllowed('manage_work')) { - header('Location: ../access_denied.php'); - exit(); -} -$offer_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getAvailableOffer($offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -// Is this offer associated with a work item? -$work_id = $offer['work_id']; -if ($work_id) { - $work_item = $workHelper->getAvailableWorkItem($work_id); - if (!$work_item) $err->add($i18n->get('work.error.work_not_available')); -} - -$cl_contractor = $offer['group_name']; -$cl_name = $offer['subject']; -$cl_description = $offer['descr_short']; -$cl_details = $offer['descr_long']; -$cl_budget = $offer['amount_with_currency']; - -$form = new Form('offerForm'); -$form->addInput(array('type'=>'text','name'=>'contractor','value'=>$cl_contractor)); -$form->getElement('contractor')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'offer_name','style'=>'width: 400px;','value'=>$cl_name)); -$form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->getElement('description')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->getElement('details')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'budget','value'=>$cl_budget)); -$form->getElement('budget')->setEnabled(false); - - -$smarty->assign('offer_id', $offer_id); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.offer')); -$smarty->assign('content_page_name', 'work/offer_view.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/offer_view_own.php b/work/offer_view_own.php deleted file mode 100644 index 57b1b95b..00000000 --- a/work/offer_view_own.php +++ /dev/null @@ -1,77 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -if (!ttAccessAllowed('manage_work')) { - header('Location: ../access_denied.php'); - exit(); -} -$offer_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getOwnOffer($offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -// Is this offer associated with a work item? -$work_id = $offer['work_id']; -if ($work_id) { - $work_item = $workHelper->getAvailableWorkItem($work_id); - if (!$work_item) $err->add($i18n->get('work.error.work_not_available')); -} - -$cl_name = $offer['subject']; -$cl_description = $offer['descr_short']; -$cl_details = $offer['descr_long']; -$cl_budget = $offer['amount_with_currency']; - -$form = new Form('offerForm'); -$form->addInput(array('type'=>'text','name'=>'offer_name','style'=>'width: 400px;','value'=>$cl_name)); -$form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->getElement('description')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->getElement('details')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'budget','value'=>$cl_budget)); -$form->getElement('budget')->setEnabled(false); - -$smarty->assign('work_item', $work_item); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.offer')); -$smarty->assign('content_page_name', 'work/offer_view_own.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work.php b/work/work.php deleted file mode 100644 index b043690b..00000000 --- a/work/work.php +++ /dev/null @@ -1,65 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -// End of access checks. - -$workHelper = new ttWorkHelper($err); -$groupItems = $workHelper->getGroupItems(); // All group items. -if($user->can('manage_work')) { - $own_work_items = $groupItems['own_work_items']; // Own work items this group is outsourcing. - $available_offers = $groupItems['available_offers']; // Available offers from other organizations. -} -if($user->can('bid_on_work')) { - $available_work_items = $groupItems['available_work_items']; // Currently available work items from other orgs. - $own_offers = $groupItems['own_offers']; // Own offers this group makes available to other groups. -} -if($user->can('update_work')) { - // $in_progress_work = ttWorkHelper::getInProgressWork(); // Work items in progress for other groups. - // $completed_work = ttWorkHelper::getCompletedWork(); // Completed work items for other groups. -} -// TODO: review access rights for the code above. - -$smarty->assign('own_work_items', $own_work_items); -$smarty->assign('available_work_items', $available_work_items); -$smarty->assign('own_offers', $own_offers); -$smarty->assign('available_offers', $available_offers); -$smarty->assign('title', $i18n->get('title.work')); -$smarty->assign('content_page_name', 'work/work.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_add.php b/work/work_add.php deleted file mode 100644 index df12c915..00000000 --- a/work/work_add.php +++ /dev/null @@ -1,122 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -// Do we have offer_id? -$cl_offer_id = (int)$request->getParameter('offer_id'); -if ($cl_offer_id) { - $workHelper = new ttWorkHelper($err); - $offer = $workHelper->getAvailableOffer($cl_offer_id); - if (!$offer) { - header('Location: ../access_denied.php'); - exit(); - } -} -// End of access checks. - -if ($request->isPost()) { - $cl_name = trim($request->getParameter('work_name')); - $cl_work_type = $request->getParameter('work_type'); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - $cl_budget = $request->getParameter('budget'); -} -// Override some fields for work being created on an available offer. -if ($offer) { - $cl_name = $offer['subject']; - $cl_work_type = 0; // one-time work - $cl_currency_id = ttWorkHelper::getCurrencyID($offer['currency']); - $cl_budget = $offer['amount']; -} - -$form = new Form('workForm'); -if ($offer) - $form->addInput(array('type'=>'hidden','name'=>'offer_id','value'=>$cl_offer_id)); -$form->addInput(array('type'=>'text','name'=>'work_name','maxlength'=>'128','style'=>'width: 400px;','value'=>$cl_name)); -$WORK_TYPE_OPTIONS = array('0'=>$i18n->get('work.type.one_time'),'1'=>$i18n->get('work.type.ongoing')); -$form->addInput(array('type'=>'combobox','name'=>'work_type','data'=>$WORK_TYPE_OPTIONS,'value'=>$cl_work_type)); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -// Add a dropdown for currency. -$currencies = ttWorkHelper::getCurrencies(); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->get('button.add'))); -// Disable some controls for work being created on an available offer. -if ($offer) { - $form->getElement('work_name')->setEnabled(false); - $form->getElement('work_type')->setEnabled(false); - $form->getElement('currency')->setEnabled(false); - $form->getElement('budget')->setEnabled(false); -} - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.work')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - $workHelper = new ttWorkHelper($err); - $fields = array('offer_id' => $cl_offer_id, - 'subject' => $cl_name, - 'type' => $cl_work_type, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget); - if ($workHelper->putOwnWorkItem($fields)) { - header('Location: work.php'); - exit(); - } - } -} // isPost - -$smarty->assign('offer', $offer); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.workForm.work_name.focus()"'); -$smarty->assign('title', $i18n->get('title.add_work')); -$smarty->assign('content_page_name', 'work/work_add.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_delete.php b/work/work_delete.php deleted file mode 100644 index 1d94603a..00000000 --- a/work/work_delete.php +++ /dev/null @@ -1,75 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_work_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getOwnWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$work_to_delete = $work_item['subject']; - -$form = new Form('workDeleteForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->get('label.delete'))); -$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get('button.cancel'))); - -if ($request->isPost()) { - if ($request->getParameter('btn_delete')) { - if ($workHelper->deleteOwnWorkItem($cl_work_id)) { - header('Location: work.php'); - exit(); - } - } elseif ($request->getParameter('btn_cancel')) { - header('Location: work.php'); - exit(); - } -} // isPost - -$smarty->assign('work_to_delete', $work_to_delete); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.workDeleteForm.btn_cancel.focus()"'); -$smarty->assign('title', $i18n->get('title.delete_work')); -$smarty->assign('content_page_name', 'work/work_delete.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_edit.php b/work/work_edit.php deleted file mode 100644 index 7e27106b..00000000 --- a/work/work_edit.php +++ /dev/null @@ -1,151 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_work_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getOwnWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// Do we have offer_id? -$offer_id = $work_item['offer_id']; -if ($offer_id) { - $offer = $workHelper->getAvailableOffer($offer_id); - if (!$offer) { - header('Location: ../access_denied.php'); - exit(); - } -} -// End of access checks. - -$currencies = ttWorkHelper::getCurrencies(); - -if ($request->isPost()) { - $cl_name = trim($request->getParameter('work_name')); - $cl_work_type = $request->getParameter('work_type'); - $cl_description = trim($request->getParameter('description')); - $cl_details = trim($request->getParameter('details')); - $cl_currency_id = $request->getParameter('currency'); - $cl_budget = $request->getParameter('budget'); -} else { - $cl_name = $work_item['subject']; - $cl_work_type = $work_item['type']; - $cl_description = $work_item['descr_short']; - $cl_details = $work_item['descr_long']; - $cl_currency_id = ttWorkHelper::getCurrencyID($work_item['currency']); - $cl_budget = $work_item['amount']; - $cl_status = $work_item['status_label']; - $cl_moderator_comment = $work_item['moderator_comment']; -} -// Override some fields for work on an available offer. -if ($offer) { - $cl_name = $offer['subject']; - $cl_work_type = 0; // one-time work - $cl_currency_id = ttWorkHelper::getCurrencyID($offer['currency']); - $cl_budget = $offer['amount']; -} - -$show_moderator_comment = $cl_moderator_comment != null; - -$form = new Form('workForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'text','name'=>'work_name','maxlength'=>'128','style'=>'width: 400px;','value'=>$cl_name)); -$WORK_TYPE_OPTIONS = array('0'=>$i18n->get('work.type.one_time'),'1'=>$i18n->get('work.type.ongoing')); -$form->addInput(array('type'=>'combobox','name'=>'work_type','data'=>$WORK_TYPE_OPTIONS,'value'=>$cl_work_type)); -$form->addInput(array('type'=>'textarea','name'=>'description','maxlength'=>'512','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->addInput(array('type'=>'combobox','name'=>'currency','data'=>$currencies,'datakeys'=>array('id','name'),'value'=>$cl_currency_id)); -$form->addInput(array('type'=>'floatfield','maxlength'=>'10','name'=>'budget','format'=>'.2','value'=>$cl_budget)); -$form->addInput(array('type'=>'text','name'=>'status','style'=>'width: 400px;','value'=>$cl_status)); -$form->getElement('status')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'moderator_comment','style'=>'width: 400px; height: 80px;','value'=>$cl_moderator_comment)); -$form->getElement('moderator_comment')->setEnabled(false); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); -// Disable some controls for work on an available offer. -if ($offer) { - $form->getElement('work_name')->setEnabled(false); - $form->getElement('work_type')->setEnabled(false); - $form->getElement('currency')->setEnabled(false); - $form->getElement('budget')->setEnabled(false); -} - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.work')); - if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if (!ttValidString($cl_details, true)) $err->add($i18n->get('error.field'), $i18n->get('label.details')); - if (!ttValidString($cl_budget)) $err->add($i18n->get('error.field'), $i18n->get('label.budget')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - if ($request->getParameter('btn_save')) { - // Update work information. - $fields = array('work_id'=>$cl_work_id, - 'type'=>$cl_work_type, - 'subject'=>$cl_name, - 'descr_short' => $cl_description, - 'descr_long' => $cl_details, - 'currency' => ttWorkHelper::getCurrencyName($cl_currency_id), - 'amount' => $cl_budget); - if ($offer_id > 0) { - if ($workHelper->updateOwnWorkItemOnOffer($fields)) { - header('Location: work.php'); - exit(); - } - } else { - if ($workHelper->updateOwnWorkItem($fields)) { - header('Location: work.php'); - exit(); - } - } - } - } -} // isPost - -$smarty->assign('offer', $offer); -$smarty->assign('show_moderator_comment', $show_moderator_comment); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.edit_work')); -$smarty->assign('content_page_name', 'work/work_edit.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_message.php b/work/work_message.php deleted file mode 100644 index 91d02b5c..00000000 --- a/work/work_message.php +++ /dev/null @@ -1,90 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$cl_work_id = (int)$request->getParameter('work_id'); -if (!$cl_work_id) { - header('Location: ../access_denied.php'); - exit(); -} -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getAvailableWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$cl_name = $work_item['subject']; - -if ($request->isPost()) { - $cl_message_body = trim($request->getParameter('message_body')); -} - -$form = new Form('messageForm'); -$form->addInput(array('type'=>'hidden','name'=>'work_id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'textarea','name'=>'message_body','style'=>'width: 400px; height: 80px;vertical-align: middle','value'=>$cl_message_body)); -$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->get('work.button.send_message'))); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_message_body)) $err->add($i18n->get('error.field'), $i18n->get('work.label.message')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - $workHelper = new ttWorkHelper($err); - $fields = array('work_id'=>$cl_work_id, - 'message_body' => $cl_message_body); - if ($workHelper->sendMessageToWorkOwner($fields)) { - $msg->add($i18n->get('work.msg.message_sent')); - // header('Location: work.php'); // TODO: where to redirect? - // exit(); - } - } -} // isPost - -$smarty->assign('work_item', $work_item); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.offerForm.work_name.focus()"'); -$smarty->assign('title', $i18n->get('work.title.send_message')); -$smarty->assign('content_page_name', 'work/work_message.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_offer_view.php b/work/work_offer_view.php deleted file mode 100644 index c0dd5ee1..00000000 --- a/work/work_offer_view.php +++ /dev/null @@ -1,123 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -if (!ttAccessAllowed('manage_work')) { - header('Location: ../access_denied.php'); - exit(); -} -$cl_offer_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$offer = $workHelper->getOwnWorkItemOffer($cl_offer_id); -if (!$offer) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -// Get an associated work item. -$work_item = $workHelper->getOwnWorkItem($offer['work_id']); -if (!$work_item) $err->add($i18n->get('work.error.work_not_available')); - -if ($request->isPost()) { - $cl_client_comment = $request->getParameter('client_comment'); -} else { - $cl_client_comment = $offer['client_comment']; -} - -$cl_contractor = $offer['group_name']; -$cl_name = $offer['subject']; -$cl_description = $offer['descr_short']; -$cl_details = $offer['descr_long']; -$cl_budget = $offer['amount_with_currency']; -$cl_status = $offer['status_label']; - -$form = new Form('offerForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_offer_id)); -$form->addInput(array('type'=>'text','name'=>'contractor','value'=>$cl_contractor)); -$form->getElement('contractor')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'offer_name','style'=>'width: 400px;','value'=>$cl_name)); -$form->getElement('offer_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->getElement('description')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->getElement('details')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'budget','value'=>$cl_budget)); -$form->getElement('budget')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'status','style'=>'width: 400px;','value'=>$cl_status)); -$form->getElement('status')->setEnabled(false); -if ($offer['status'] == STATUS_APPROVED) { - $form->addInput(array('type'=>'submit','name'=>'btn_accept','value'=>$i18n->get('work.button.accept'))); - $form->addInput(array('type'=>'submit','name'=>'btn_decline','value'=>$i18n->get('work.button.decline'))); -} -$form->addInput(array('type'=>'textarea','name'=>'client_comment','style'=>'width: 400px; height: 80px;','value'=>$cl_client_comment)); - -if ($request->isPost()) { - // Validate user input. - if (!ttValidString($cl_client_comment, true)) $err->add($i18n->get('error.field'), $i18n->get('label.comment')); - - // Ensure user email exists (required for workflow). - if (!$user->getEmail()) $err->add($i18n->get('error.no_email')); - - if ($err->no()) { - $workHelper = new ttWorkHelper($err); - $fields = array('offer_id'=>$cl_offer_id, - 'client_comment'=>$cl_client_comment); - - if ($request->getParameter('btn_accept')) { - // Accept offer. - if ($workHelper->acceptOwnWorkItemOffer($fields)) { - header('Location: work_offer_view.php?id='.$cl_offer_id); - exit(); - } - } - - if ($request->getParameter('btn_decline')) { - // Decline offer. - if ($workHelper->declineOwnWorkItemOffer($fields)) { - header('Location: work_offer_view.php?id='.$cl_offer_id); - exit(); - } - } - } -} // isPost - -$smarty->assign('work_item', $work_item); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.offer')); -$smarty->assign('content_page_name', 'work/work_offer_view.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_offers.php b/work/work_offers.php deleted file mode 100644 index eae9841b..00000000 --- a/work/work_offers.php +++ /dev/null @@ -1,56 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -$work_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getOwnWorkItem($work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$work_item_offers = $workHelper->getOwnWorkItemOffers($work_id); - -$smarty->assign('work_item', $work_item); -$smarty->assign('work_item_offers', $work_item_offers); -$smarty->assign('title', $i18n->get('work.label.offers')); -$smarty->assign('content_page_name', 'work/work_offers.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_view.php b/work/work_view.php deleted file mode 100644 index cb73f2ee..00000000 --- a/work/work_view.php +++ /dev/null @@ -1,74 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -if (!ttAccessAllowed('bid_on_work')) { - header('Location: ../access_denied.php'); - exit(); -} -$cl_work_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getAvailableWorkItem($cl_work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// End of access checks. - -$cl_client = $work_item['group_name']; -$cl_name = $work_item['subject']; -$cl_description = $work_item['descr_short']; -$cl_details = $work_item['descr_long']; -$cl_budget = $work_item['amount_with_currency']; - -$form = new Form('workForm'); -$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_work_id)); -$form->addInput(array('type'=>'text','name'=>'client','value'=>$cl_client)); -$form->getElement('client')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'work_name','style'=>'width: 400px;','value'=>$cl_name)); -$form->getElement('work_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->getElement('description')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->getElement('details')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'budget','value'=>$cl_budget)); -$form->getElement('budget')->setEnabled(false); - -$smarty->assign('work_id', $cl_work_id); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.work')); -$smarty->assign('content_page_name', 'work/work_view.tpl'); -$smarty->display('work/index.tpl'); diff --git a/work/work_view_own.php b/work/work_view_own.php deleted file mode 100644 index c4b887e7..00000000 --- a/work/work_view_own.php +++ /dev/null @@ -1,79 +0,0 @@ -isPluginEnabled('wk')) { - header('Location: ../feature_disabled.php'); - exit(); -} -if (!ttAccessAllowed('manage_work')) { - header('Location: ../access_denied.php'); - exit(); -} -$work_id = (int)$request->getParameter('id'); -$workHelper = new ttWorkHelper($err); -$work_item = $workHelper->getOwnWorkItem($work_id); -if (!$work_item) { - header('Location: ../access_denied.php'); - exit(); -} -// Do we have offer_id? -$offer_id = $work_item['offer_id']; -if ($offer_id) { - $offer = $workHelper->getAvailableOffer($offer_id); - if (!$offer) { - header('Location: ../access_denied.php'); - exit(); - } -} -// End of access checks. - -$cl_name = $work_item['subject']; -$cl_description = $work_item['descr_short']; -$cl_details = $work_item['descr_long']; -$cl_budget = $work_item['amount_with_currency']; - -$form = new Form('workForm'); -$form->addInput(array('type'=>'textarea','name'=>'work_name','style'=>'width: 400px;','value'=>$cl_name)); -$form->getElement('work_name')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 400px; height: 80px;','value'=>$cl_description)); -$form->getElement('description')->setEnabled(false); -$form->addInput(array('type'=>'textarea','name'=>'details','style'=>'width: 400px; height: 200px;','value'=>$cl_details)); -$form->getElement('details')->setEnabled(false); -$form->addInput(array('type'=>'text','name'=>'budget','value'=>$cl_budget)); -$form->getElement('budget')->setEnabled(false); - -$smarty->assign('offer', $offer); -$smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('title', $i18n->get('title.work')); -$smarty->assign('content_page_name', 'work/work_view_own.tpl'); -$smarty->display('work/index.tpl'); From 0db69425bcc8bbdc20091e20d2b7437f7b53071d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 15:08:53 +0000 Subject: [PATCH 089/304] Some cleanup in translation files. --- WEB-INF/resources/ca.lang.php | 8 -------- WEB-INF/resources/cs.lang.php | 8 -------- WEB-INF/resources/da.lang.php | 8 -------- WEB-INF/resources/de.lang.php | 9 --------- WEB-INF/resources/en.lang.php | 8 -------- WEB-INF/resources/es.lang.php | 8 -------- WEB-INF/resources/et.lang.php | 8 -------- WEB-INF/resources/fa.lang.php | 8 -------- WEB-INF/resources/fi.lang.php | 8 -------- WEB-INF/resources/fr.lang.php | 8 -------- WEB-INF/resources/gr.lang.php | 8 -------- WEB-INF/resources/he.lang.php | 8 -------- WEB-INF/resources/hu.lang.php | 8 -------- WEB-INF/resources/it.lang.php | 8 -------- WEB-INF/resources/ja.lang.php | 8 -------- WEB-INF/resources/ko.lang.php | 8 -------- WEB-INF/resources/nl.lang.php | 5 ----- WEB-INF/resources/no.lang.php | 8 -------- WEB-INF/resources/pl.lang.php | 8 -------- WEB-INF/resources/pt-br.lang.php | 5 ----- WEB-INF/resources/pt.lang.php | 8 -------- WEB-INF/resources/ro.lang.php | 8 -------- WEB-INF/resources/ru.lang.php | 5 ----- WEB-INF/resources/sk.lang.php | 8 -------- WEB-INF/resources/sl.lang.php | 8 -------- WEB-INF/resources/sr.lang.php | 8 -------- WEB-INF/resources/sv.lang.php | 8 -------- WEB-INF/resources/tr.lang.php | 8 -------- WEB-INF/resources/zh-cn.lang.php | 8 -------- WEB-INF/resources/zh-tw.lang.php | 8 -------- initialize.php | 2 +- 31 files changed, 1 insertion(+), 233 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index f9d9952d..a2e13083 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -265,14 +265,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 453a5100..be62bf26 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -275,14 +275,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index a3322416..48a37886 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -258,14 +258,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 47eb84a1..916861d1 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -253,15 +253,6 @@ // Another use is with offers with Remote Work plugin, where details hold a long, precise, and complete description of the offer. // 'label.details' => 'Details', 'label.budget' => 'Budget', -// TODO: translate the following. -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index c1c00af9..2a78286a 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -239,14 +239,6 @@ 'label.inactive_users' => 'Inactive Users', 'label.details' => 'Details', 'label.budget' => 'Budget', -'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 8a8902f7..83b5a6c0 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -268,14 +268,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 3299e8ad..727da041 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -266,14 +266,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 019c4ca3..4ec8ef17 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -269,14 +269,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 0940dc59..d01becc4 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -262,14 +262,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 88a96690..f690a4dc 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -256,14 +256,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 489185a8..3d0ac2a7 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -251,14 +251,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 918b5f7d..bf17c615 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -277,14 +277,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 407c22cd..f67aadf8 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -270,14 +270,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 165afe88..ca7eec15 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -255,14 +255,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index dbac8f19..9519dd4c 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -275,14 +275,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 896f1939..0d190764 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -275,14 +275,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 91ff4c8b..fe5f4653 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -230,11 +230,6 @@ 'label.inactive_users' => 'Inactieve medewerkers', 'label.details' => 'Details', 'label.budget' => 'Budget', -'label.work' => 'Werk', -'label.offer' => 'Aanbod', -'label.contractor' => 'Aanbieder', -'label.how_to_pay' => 'Betaalwijze', -'label.moderator_comment' => 'Commentaar', // Entity names. 'entity.time' => 'tijd', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 5cb39137..73a640b9 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -272,14 +272,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index d77f11c3..ea501314 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -263,14 +263,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 15e3ef91..a4620816 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -231,11 +231,6 @@ 'label.inactive_users' => 'Usuários inativos', 'label.details' => 'Detalhes', 'label.budget' => 'Orçamento', -'label.work' => 'Trabalho', -'label.offer' => 'Oferta', -'label.contractor' => 'Contratante', -'label.how_to_pay' => 'Como pagar', -'label.moderator_comment' => 'Comentário do moderador', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 6a1598cc..fff0ad65 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -260,14 +260,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index f93f1208..736c934e 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -272,14 +272,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 71bc709b..3450227d 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -230,11 +230,6 @@ 'label.inactive_users' => 'Неактивные пользователи', 'label.details' => 'Детали', 'label.budget' => 'Бюджет', -'label.work' => 'Работа', -'label.offer' => 'Предложение', -'label.contractor' => 'Подрядчик', -'label.how_to_pay' => 'Как оплатить', -'label.moderator_comment' => 'Комментарий модератора', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index da24d8ca..8c386d1a 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -266,14 +266,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 40abaabe..44be6053 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -255,14 +255,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 8e9fe4e8..45dbb100 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -261,14 +261,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index bd025f84..cb30b5e4 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -257,14 +257,6 @@ // TODO: translate the following. // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 5ac60a72..56c30943 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -279,14 +279,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 6c645121..6f492d49 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -265,14 +265,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index d16bf4cb..f9496eb2 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -270,14 +270,6 @@ // 'label.inactive_users' => 'Inactive Users', // 'label.details' => 'Details', // 'label.budget' => 'Budget', -// 'label.work' => 'Work', // Table column header for work items, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.offer' => 'Offer', // Table column header for offers, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// 'label.contractor' => 'Contractor', // Table column header for offers (contractor is someone who offers to do work). - // Technically, it is either an org name or a combination of org and group names - // because both work items and offers are owned by Time Tracker groups of users. -// 'label.how_to_pay' => 'How to pay', // Label for the "How to pay" field on offers, which allows contractors to specify - // how to pay them, for example: paypal email, check by mail to a specific address, etc. -// 'label.moderator_comment' => 'Moderator comment', // Label for "Moderator comment" field that explains something. // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/initialize.php b/initialize.php index 16f3a5b1..db645a9d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5612"); +define("APP_VERSION", "1.19.34.5613"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 91294bc2d33e9415d104670928b2ecd83ce68c36 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 15:26:22 +0000 Subject: [PATCH 090/304] A bit more cleanup in translation files. --- WEB-INF/resources/ca.lang.php | 2 -- WEB-INF/resources/cs.lang.php | 2 -- WEB-INF/resources/da.lang.php | 3 --- WEB-INF/resources/de.lang.php | 6 ------ WEB-INF/resources/en.lang.php | 2 -- WEB-INF/resources/es.lang.php | 2 -- WEB-INF/resources/et.lang.php | 3 --- WEB-INF/resources/fa.lang.php | 3 --- WEB-INF/resources/fi.lang.php | 3 --- WEB-INF/resources/fr.lang.php | 3 --- WEB-INF/resources/gr.lang.php | 3 --- WEB-INF/resources/he.lang.php | 3 --- WEB-INF/resources/hu.lang.php | 2 -- WEB-INF/resources/it.lang.php | 3 --- WEB-INF/resources/ja.lang.php | 2 -- WEB-INF/resources/ko.lang.php | 2 -- WEB-INF/resources/nl.lang.php | 2 -- WEB-INF/resources/no.lang.php | 2 -- WEB-INF/resources/pl.lang.php | 3 --- WEB-INF/resources/pt-br.lang.php | 2 -- WEB-INF/resources/pt.lang.php | 2 -- WEB-INF/resources/ro.lang.php | 2 -- WEB-INF/resources/ru.lang.php | 2 -- WEB-INF/resources/sk.lang.php | 3 --- WEB-INF/resources/sl.lang.php | 2 -- WEB-INF/resources/sr.lang.php | 3 --- WEB-INF/resources/sv.lang.php | 3 --- WEB-INF/resources/tr.lang.php | 2 -- WEB-INF/resources/zh-cn.lang.php | 2 -- WEB-INF/resources/zh-tw.lang.php | 2 -- initialize.php | 2 +- 31 files changed, 1 insertion(+), 77 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index a2e13083..fefaad82 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -263,8 +263,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index be62bf26..ff237c00 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -273,8 +273,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 48a37886..9a9c532d 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -255,9 +255,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktive Brugere', 'label.inactive_users' => 'Inaktive Brugere', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 916861d1..3fea57b7 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -247,12 +247,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktive Nutzer', 'label.inactive_users' => 'Inaktive Nutzer', -// TODO: translate the following or confirm that "Details" is also correct for German (exactly as the English string). -// label.details is used to identify a field for LONG DESCRIPTION of a work item used in Remote Work plugin. -// For example, a work item could be "Design a logo", and the Details hold EXACT anfd PRECISE specs of what a customer needs. -// Another use is with offers with Remote Work plugin, where details hold a long, precise, and complete description of the offer. -// 'label.details' => 'Details', -'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 2a78286a..d82bb75b 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -237,8 +237,6 @@ 'label.file' => 'File', 'label.active_users' => 'Active Users', 'label.inactive_users' => 'Inactive Users', -'label.details' => 'Details', -'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 83b5a6c0..0f2b8a31 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -266,8 +266,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 727da041..7137357e 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -263,9 +263,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktiivsed kasutajad', 'label.inactive_users' => 'Mitteaktiivsed kasutajad', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 4ec8ef17..085f80ca 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -266,9 +266,6 @@ // 'label.file' => 'File', 'label.active_users' => 'کاربران فعال', 'label.inactive_users' => 'کاربران غیرفعال', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index d01becc4..f3237ff0 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -259,9 +259,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktiiviset käyttäjät', 'label.inactive_users' => 'Ei-aktiiviset käyttäjät', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index f690a4dc..5c971ea9 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -253,9 +253,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Utilisateurs actifs', 'label.inactive_users' => 'Utilisateurs inactifs', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 3d0ac2a7..dbbd85db 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -248,9 +248,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Ενεργοί χρήστες', 'label.inactive_users' => 'Ανενεργοί χρήστες', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index bf17c615..f3cee584 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -274,9 +274,6 @@ // 'label.file' => 'File', 'label.active_users' => 'משתמשים פעילים', 'label.inactive_users' => 'משתמשים לא פעילים', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index f67aadf8..08e52d40 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -268,8 +268,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index ca7eec15..d9cca113 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -252,9 +252,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Utenti attivi', 'label.inactive_users' => 'Utenti inattivi', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 9519dd4c..7437648b 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -273,8 +273,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 0d190764..3454a362 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -273,8 +273,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index fe5f4653..2c1b7b71 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -228,8 +228,6 @@ 'label.file' => 'Bestand', 'label.active_users' => 'Actieve medewerkers', 'label.inactive_users' => 'Inactieve medewerkers', -'label.details' => 'Details', -'label.budget' => 'Budget', // Entity names. 'entity.time' => 'tijd', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 73a640b9..20f50546 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -270,8 +270,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index ea501314..84cd8241 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -260,9 +260,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktywni użytkownicy', 'label.inactive_users' => 'Nieaktywni użytkownicy', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index a4620816..fbdff5ac 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -229,8 +229,6 @@ 'label.file' => 'Arquivo', 'label.active_users' => 'Usuários ativos', 'label.inactive_users' => 'Usuários inativos', -'label.details' => 'Detalhes', -'label.budget' => 'Orçamento', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index fff0ad65..728c4ba6 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -258,8 +258,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 736c934e..d89e335b 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -270,8 +270,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 3450227d..d16bd99d 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -228,8 +228,6 @@ 'label.file' => 'Файл', 'label.active_users' => 'Активные пользователи', 'label.inactive_users' => 'Неактивные пользователи', -'label.details' => 'Детали', -'label.budget' => 'Бюджет', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 8c386d1a..37303bdf 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -263,9 +263,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktívny používatelia', 'label.inactive_users' => 'Neaktívny používatelia', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 44be6053..91e6dea0 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -253,8 +253,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 45dbb100..5eddee16 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -258,9 +258,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktivni korisnik', 'label.inactive_users' => 'Neaktivni korisnik', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index cb30b5e4..fddf70ab 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -254,9 +254,6 @@ // 'label.file' => 'File', 'label.active_users' => 'Aktiva användare', 'label.inactive_users' => 'Inaktiva användare', -// TODO: translate the following. -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 56c30943..e5c4e5c2 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -277,8 +277,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 6f492d49..157a9572 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -263,8 +263,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index f9496eb2..a2c2705e 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -268,8 +268,6 @@ // 'label.file' => 'File', // 'label.active_users' => 'Active Users', // 'label.inactive_users' => 'Inactive Users', -// 'label.details' => 'Details', -// 'label.budget' => 'Budget', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. diff --git a/initialize.php b/initialize.php index db645a9d..ddbfe244 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5613"); +define("APP_VERSION", "1.19.34.5614"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From efef96ec94f019afbad9af8cf8b6b0f9e4cefbcf Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 15:38:24 +0000 Subject: [PATCH 091/304] More cleanup in translation files. --- WEB-INF/resources/ca.lang.php | 16 ---------------- WEB-INF/resources/cs.lang.php | 16 ---------------- WEB-INF/resources/da.lang.php | 16 ---------------- WEB-INF/resources/de.lang.php | 16 ---------------- WEB-INF/resources/en.lang.php | 16 ---------------- WEB-INF/resources/es.lang.php | 16 ---------------- WEB-INF/resources/et.lang.php | 16 ---------------- WEB-INF/resources/fa.lang.php | 16 ---------------- WEB-INF/resources/fi.lang.php | 16 ---------------- WEB-INF/resources/fr.lang.php | 16 ---------------- WEB-INF/resources/gr.lang.php | 16 ---------------- WEB-INF/resources/he.lang.php | 16 ---------------- WEB-INF/resources/hu.lang.php | 16 ---------------- WEB-INF/resources/it.lang.php | 16 ---------------- WEB-INF/resources/ja.lang.php | 16 ---------------- WEB-INF/resources/ko.lang.php | 16 ---------------- WEB-INF/resources/nl.lang.php | 15 --------------- WEB-INF/resources/no.lang.php | 16 ---------------- WEB-INF/resources/pl.lang.php | 16 ---------------- WEB-INF/resources/pt-br.lang.php | 15 --------------- WEB-INF/resources/pt.lang.php | 16 ---------------- WEB-INF/resources/ro.lang.php | 16 ---------------- WEB-INF/resources/ru.lang.php | 15 --------------- WEB-INF/resources/sk.lang.php | 16 ---------------- WEB-INF/resources/sl.lang.php | 16 ---------------- WEB-INF/resources/sr.lang.php | 16 ---------------- WEB-INF/resources/sv.lang.php | 16 ---------------- WEB-INF/resources/tr.lang.php | 16 ---------------- WEB-INF/resources/zh-cn.lang.php | 16 ---------------- WEB-INF/resources/zh-tw.lang.php | 16 ---------------- initialize.php | 2 +- 31 files changed, 1 insertion(+), 478 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index fefaad82..0f05c8d7 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -675,20 +675,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index ff237c00..d42f5193 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -688,20 +688,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 9a9c532d..af755d4a 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -651,20 +651,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 3fea57b7..46cdcb47 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -624,20 +624,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index d82bb75b..897faa59 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -607,20 +607,4 @@ 'form.display_options.not_complete_days' => 'Not complete days', 'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -'work.error.work_not_available' => 'Work item is not available.', -'work.error.offer_not_available' => 'Offer is not available.', -'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -'work.label.own_work' => 'Own work', -'work.label.own_offers' => 'Own offers', -'work.label.offers' => 'Offers', -'work.label.message' => 'Message', -'work.button.send_message' => 'Send message', -'work.button.make_offer' => 'Make offer', -'work.button.accept' => 'Accept', -'work.button.decline' => 'Decline', -'work.title.send_message' => 'Sending Message', -'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 0f2b8a31..f9a30037 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -690,20 +690,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 7137357e..ad93af7d 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -659,20 +659,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 085f80ca..7bf3a963 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -675,20 +675,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index f3237ff0..71f401fb 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -659,20 +659,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 5c971ea9..e56425f5 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -647,20 +647,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index dbbd85db..fe89a425 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -639,20 +639,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index f3cee584..9c4718bf 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -680,20 +680,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 08e52d40..d20ff352 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -679,20 +679,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index d9cca113..253c0854 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -653,20 +653,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 7437648b..06d45210 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -683,20 +683,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 3454a362..07603b63 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -681,20 +681,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 2c1b7b71..ac41ea72 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -589,19 +589,4 @@ 'form.display_options.not_complete_days' => 'Niet complete dagen', 'form.display_options.inactive_projects' => 'Niet actieve projecten', 'form.display_options.custom_css' => 'Aangepaste CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -'work.error.work_not_available' => 'Werk onderdeel is niet beschikbaar.', -'work.error.offer_not_available' => 'Aanbod is niet beschikbaar.', -'work.type.one_time' => 'eenmalig', -'work.type.ongoing' => 'doorlopend', -'work.label.own_work' => 'Eigen werk', -'work.label.own_offers' => 'Eigen aanbod', -'work.label.offers' => 'Aanbiedingen', -'work.button.send_message' => 'Verstuur bericht', -'work.button.make_offer' => 'maak aanbieding', -'work.button.accept' => 'Accepteer', -'work.button.decline' => 'Weiger', -'work.title.send_message' => 'Bericht wordt verstuurd', -'work.msg.message_sent' => 'Bericht is verstuurd.', ); diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 20f50546..05b4f16c 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -682,20 +682,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 84cd8241..114465b5 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -660,20 +660,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index fbdff5ac..9bdede0d 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -588,20 +588,5 @@ // TODO: translate the following. // 'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.custom_css' => 'CSS customizado', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php. -'work.error.work_not_available' => 'Item de trabalho não está disponível.', -'work.error.offer_not_available' => 'Oferta não disponível', -'work.type.one_time' => 'Uma interação', -'work.type.ongoing' => 'Em progresso', -'work.label.own_work' => 'Trabalho próprio', -'work.label.own_offers' => 'Ofertas próprias', -'work.label.offers' => 'Ofertas', -'work.button.send_message' => 'Enviar mensagem', -'work.button.make_offer' => 'Fazer oferta', -'work.button.accept' => 'Aceitar', -'work.button.decline' => 'Recusar', -'work.title.send_message' => 'Enviando mensagem', -'work.msg.message_sent' => 'Mensagem enviada.', ); diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 728c4ba6..25a65270 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -662,20 +662,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index d89e335b..74f89856 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -683,20 +683,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index d16bd99d..a59d7e41 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -590,19 +590,4 @@ 'form.display_options.not_complete_days' => 'Незавершенные дни', 'form.display_options.inactive_projects' => 'Неактивные проекты', 'form.display_options.custom_css' => 'Пользовательская CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -'work.error.work_not_available' => 'Работа отсутствует.', -'work.error.offer_not_available' => 'Предложение отсутствует.', -'work.type.one_time' => 'одноразовая', -'work.type.ongoing' => 'постоянная', -'work.label.own_work' => 'Своя работа', -'work.label.own_offers' => 'Свои предложения', -'work.label.offers' => 'Предложения', -'work.button.send_message' => 'Отправить сообщение', -'work.button.make_offer' => 'Сделать предложение', -'work.button.accept' => 'Принять', -'work.button.decline' => 'Отклонить', -'work.title.send_message' => 'Отсылка сообщения', -'work.msg.message_sent' => 'Сообщение отослано.', ); diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 37303bdf..d09cd106 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -664,20 +664,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 91e6dea0..98621f35 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -656,20 +656,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 5eddee16..1dc547f1 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -662,20 +662,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index fddf70ab..2fa40ce3 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -659,20 +659,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index e5c4e5c2..10b582dc 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -696,20 +696,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 157a9572..6722da04 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -670,20 +670,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index a2c2705e..24bc7b81 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -673,20 +673,4 @@ // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.custom_css' => 'Custom CSS', - -// Work plugin strings. See example at https://timetracker.anuko.com/work.php -// TODO: translate the following. -// 'work.error.work_not_available' => 'Work item is not available.', -// 'work.error.offer_not_available' => 'Offer is not available.', -// 'work.type.one_time' => 'one time', // Work type is "one time job" for well defined work ("do exactly this"). -// 'work.type.ongoing' => 'ongoing', // Work type is "ongoing" for complex jobs (billed by the hour, multiple contractors, etc.) -// 'work.label.own_work' => 'Own work', -// 'work.label.own_offers' => 'Own offers', -// 'work.label.offers' => 'Offers', -// 'work.button.send_message' => 'Send message', -// 'work.button.make_offer' => 'Make offer', -// 'work.button.accept' => 'Accept', -// 'work.button.decline' => 'Decline', -// 'work.title.send_message' => 'Sending Message', -// 'work.msg.message_sent' => 'Message sent.', ); diff --git a/initialize.php b/initialize.php index ddbfe244..0ec782c6 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5614"); +define("APP_VERSION", "1.19.34.5615"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 2a6379743ea1ff38a24062c39610749e9581c9dc Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 16:09:52 +0000 Subject: [PATCH 092/304] Removed no longer used string from translation files. --- WEB-INF/resources/ca.lang.php | 1 - WEB-INF/resources/cs.lang.php | 1 - WEB-INF/resources/da.lang.php | 1 - WEB-INF/resources/de.lang.php | 1 - WEB-INF/resources/en.lang.php | 5 ----- WEB-INF/resources/es.lang.php | 1 - WEB-INF/resources/et.lang.php | 1 - WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/gr.lang.php | 1 - WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/hu.lang.php | 1 - WEB-INF/resources/it.lang.php | 1 - WEB-INF/resources/ja.lang.php | 1 - WEB-INF/resources/ko.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/no.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/pt-br.lang.php | 1 - WEB-INF/resources/pt.lang.php | 1 - WEB-INF/resources/ro.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sl.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/resources/sv.lang.php | 1 - WEB-INF/resources/tr.lang.php | 1 - WEB-INF/resources/zh-cn.lang.php | 1 - WEB-INF/resources/zh-tw.lang.php | 1 - initialize.php | 2 +- 31 files changed, 1 insertion(+), 35 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 0f05c8d7..0202a4be 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -97,7 +97,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index d42f5193..6ace1181 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -99,7 +99,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index af755d4a..b76c65c2 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -94,7 +94,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 46cdcb47..6a11c405 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -90,7 +90,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. 'warn.sure' => 'Sind Sie sicher?', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 897faa59..44a1c2a6 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -86,11 +86,6 @@ // "something went wrong" when trying to do some operation with attachments. // For example, File Storage server could be offline, or Time Tracker config option is wrong, etc. 'error.file_storage' => 'File storage server error.', -// Meaning of error.remote_work: an (unspecified) error occurred when trying to communicate with -// "Remote Work" server, the one that supports the "Work" plugin, see https://www.anuko.com/time_tracker/what_is/work_plugin.htm -// It is a generic message telling us that "something went wrong" when trying to do some operation with Work plugin. -// For example, Remote Work server could be offline, among other things. -'error.remote_work' => 'Remote work server error.', // Warning messages. 'warn.sure' => 'Are you sure?', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index f9a30037..09fe1d9e 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -95,7 +95,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index ad93af7d..9cbcf13b 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -107,7 +107,6 @@ 'error.expired' => 'Kehtivusaeg on lõppenud.', // TODO: translate the following. // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. 'warn.sure' => 'Oled kindel?', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 7bf3a963..16fb3e5a 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -102,7 +102,6 @@ // 'error.expired' => 'Expiration date reached.', // TODO: translate the following. // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 71f401fb..9c76d646 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -96,7 +96,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index e56425f5..5a301736 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -94,7 +94,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index fe89a425..e2bd5418 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -89,7 +89,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 9c4718bf..5fd42b36 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -110,7 +110,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index d20ff352..e03a684c 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -98,7 +98,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 253c0854..2e3fd91f 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -93,7 +93,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 06d45210..c2b509f3 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -101,7 +101,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 07603b63..dc217240 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -100,7 +100,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index ac41ea72..247a3652 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -81,7 +81,6 @@ 'error.user_count' => 'Limiet op aantal gebruikers.', 'error.expired' => 'Verloop datum is bereikt.', 'error.file_storage' => 'Bestand server probleem.', -'error.remote_work' => 'Werk op afstand server probleem.', // Warning messages. 'warn.sure' => 'Ben je er zeker van?', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 05b4f16c..094d6b0a 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -101,7 +101,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 114465b5..0cb9f69f 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -98,7 +98,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 9bdede0d..ae860cf1 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -81,7 +81,6 @@ 'error.user_count' => 'Limite na contagem de usuários.', 'error.expired' => 'Data de expiração atingida.', 'error.file_storage' => 'Erro relacionado ao servidor de armazenamento de arquivos.', -'error.remote_work' => 'Erro relacionado ao servidor responsável pelo plugin work.', // Warning messages. 'warn.sure' => 'Tem certeza?', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 25a65270..538dd52f 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -94,7 +94,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 74f89856..cde5a27d 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -101,7 +101,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index a59d7e41..c6214272 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -81,7 +81,6 @@ 'error.user_count' => 'Ограничение на количество пользователей.', 'error.expired' => 'Достигнута дата экспирации.', 'error.file_storage' => 'Ошибка сервера для хранения файлов.', -'error.remote_work' => 'Ошибка сервера удаленной работы.', // Warning messages. 'warn.sure' => 'Вы уверены?', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index d09cd106..d74bb318 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -99,7 +99,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 98621f35..f615e431 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -91,7 +91,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 1dc547f1..7bb9edbe 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -95,7 +95,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 2fa40ce3..dce2488b 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -93,7 +93,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 10b582dc..c154a3a4 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -104,7 +104,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 6722da04..a2e6bf28 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -94,7 +94,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 24bc7b81..69121475 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -98,7 +98,6 @@ // 'error.user_count' => 'Limit on user count.', // 'error.expired' => 'Expiration date reached.', // 'error.file_storage' => 'File storage server error.', // See comment in English file. -// 'error.remote_work' => 'Remote work server error.', // See comment in English file. // Warning messages. // TODO: translate the following. diff --git a/initialize.php b/initialize.php index 0ec782c6..7825bbe5 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5615"); +define("APP_VERSION", "1.19.34.5616"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 46fa236d1a379935b89bd218af2190a1691d3e10 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 16:45:01 +0000 Subject: [PATCH 093/304] Removed no longer used titles from translation files. --- WEB-INF/resources/ca.lang.php | 16 ---------------- WEB-INF/resources/cs.lang.php | 16 ---------------- WEB-INF/resources/da.lang.php | 16 ---------------- WEB-INF/resources/de.lang.php | 16 ---------------- WEB-INF/resources/en.lang.php | 16 ---------------- WEB-INF/resources/es.lang.php | 16 ---------------- WEB-INF/resources/et.lang.php | 16 ---------------- WEB-INF/resources/fa.lang.php | 16 ---------------- WEB-INF/resources/fi.lang.php | 16 ---------------- WEB-INF/resources/fr.lang.php | 16 ---------------- WEB-INF/resources/gr.lang.php | 16 ---------------- WEB-INF/resources/he.lang.php | 16 ---------------- WEB-INF/resources/hu.lang.php | 16 ---------------- WEB-INF/resources/it.lang.php | 16 ---------------- WEB-INF/resources/ja.lang.php | 16 ---------------- WEB-INF/resources/ko.lang.php | 16 ---------------- WEB-INF/resources/nl.lang.php | 16 ---------------- WEB-INF/resources/no.lang.php | 16 ---------------- WEB-INF/resources/pl.lang.php | 16 ---------------- WEB-INF/resources/pt-br.lang.php | 16 ---------------- WEB-INF/resources/pt.lang.php | 16 ---------------- WEB-INF/resources/ro.lang.php | 16 ---------------- WEB-INF/resources/ru.lang.php | 16 ---------------- WEB-INF/resources/sk.lang.php | 16 ---------------- WEB-INF/resources/sl.lang.php | 16 ---------------- WEB-INF/resources/sr.lang.php | 16 ---------------- WEB-INF/resources/sv.lang.php | 16 ---------------- WEB-INF/resources/tr.lang.php | 16 ---------------- WEB-INF/resources/zh-cn.lang.php | 16 ---------------- WEB-INF/resources/zh-tw.lang.php | 16 ---------------- initialize.php | 2 +- 31 files changed, 1 insertion(+), 481 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 0202a4be..6a929004 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -378,22 +378,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 6ace1181..15da342d 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -388,22 +388,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index b76c65c2..d357a3b3 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -362,22 +362,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 6a11c405..259f6c55 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -345,22 +345,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 44a1c2a6..8867e8c2 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -331,22 +331,6 @@ 'title.edit_file' => 'Editing File', 'title.delete_file' => 'Deleting File', 'title.download_file' => 'Downloading File', -'title.work' => 'Work', -'title.add_work' => 'Adding Work', -'title.edit_work' => 'Editing Work', -'title.delete_work' => 'Deleting Work', -'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -'title.available_work' => 'Available Work', // Available work items from other organizations. -'title.inactive_work' => 'Inactive Work', // Inactive work items for group. -'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -'title.offer' => 'Offer', -'title.add_offer' => 'Adding Offer', -'title.edit_offer' => 'Editing Offer', -'title.delete_offer' => 'Deleting Offer', -'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -'title.available_offers' => 'Available Offers', // Available offers from other organizations. -'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 09fe1d9e..25c94b89 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -377,22 +377,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 9cbcf13b..0f0d1448 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -371,22 +371,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 16fb3e5a..831e9228 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -371,22 +371,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 9c76d646..bbb33f37 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -362,22 +362,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 5a301736..443ace91 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -356,22 +356,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index e2bd5418..229d94eb 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -354,22 +354,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 5fd42b36..5431e051 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -378,22 +378,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index e03a684c..d1a093ba 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -377,22 +377,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 2e3fd91f..1afc09eb 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -364,22 +364,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index c2b509f3..93ab30e4 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -384,22 +384,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index dc217240..6ca74cf6 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -385,22 +385,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 247a3652..ae1df70d 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -323,22 +323,6 @@ 'title.edit_file' => 'Bestand bewerken', 'title.delete_file' => 'Bestand verwijderen', 'title.download_file' => ' Bestand downloaden', -'title.work' => 'Werk', -'title.add_work' => 'Werk toevoegen', -'title.edit_work' => 'Werk bewerken', -'title.delete_work' => 'Werk verwijderen', -'title.active_work' => 'Actief werk', -'title.available_work' => 'Beschikbaar werk', -'title.inactive_work' => 'Inactief werk', -'title.pending_work' => 'Werk in afwachting van goedkeuring', -'title.offer' => 'Aanbod', -'title.add_offer' => 'Aanbieding toevoegen', -'title.edit_offer' => 'Aanbieding bewerken', -'title.delete_offer' => 'Aanbieding verwijderen', -'title.active_offers' => 'Actieve aanbiedingen', -'title.available_offers' => 'Beschikbare aanbiedingen', -'title.inactive_offers' => 'Inactieve aanbiedingen', -'title.pending_offers' => 'Aangeboden werk in afwachting van goedkeuring', // 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. diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 094d6b0a..5b678077 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -381,22 +381,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 0cb9f69f..970acaf1 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -365,22 +365,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index ae860cf1..b46a54a8 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -321,22 +321,6 @@ 'title.edit_file' => 'Editando arquivo', 'title.delete_file' => 'Apagando arquivo', 'title.download_file' => 'Baixando arquivo', -'title.work' => 'Trabalho', -'title.add_work' => 'Adicionando trabalho', -'title.edit_work' => 'Editando trabalho', -'title.delete_work' => 'Apagando trabalho', -'title.active_work' => 'Trabalho ativo', -'title.available_work' => 'Trabalho disponível', -'title.inactive_work' => 'Trabalho inativo', -'title.pending_work' => 'Trabalho pendente', -'title.offer' => 'Oferta', -'title.add_offer' => 'Adicionando oferta', -'title.edit_offer' => 'Editando oferta', -'title.delete_offer' => 'Apagando oferta', -'title.active_offers' => 'Ofertas ativas', -'title.available_offers' => 'Ofertas disponíveis', -'title.inactive_offers' => 'Ofertas inativas', -'title.pending_offers' => 'Ofertas pendentes', // 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. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 538dd52f..1fb18ea1 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -365,22 +365,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index cde5a27d..f5bdba76 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -383,22 +383,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.add_offer' => 'Adding Offer', -// 'title.offer' => 'Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index c6214272..8171ba51 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -324,22 +324,6 @@ 'title.edit_file' => 'Редактирование файла', 'title.delete_file' => 'Удаление файла', 'title.download_file' => 'Скачивание файла', -'title.work' => 'Работа', -'title.add_work' => 'Добавление работы', -'title.edit_work' => 'Редактирование работы', -'title.delete_work' => 'Удаление работы', -'title.active_work' => 'Активная работа', -'title.available_work' => 'Имеющаяся работа', -'title.inactive_work' => 'Неактивная работа', -'title.pending_work' => 'Работа в ожидании', -'title.offer' => 'Предложение', -'title.add_offer' => 'Добавление предложения', -'title.edit_offer' => 'Редактирование предложения', -'title.delete_offer' => 'Удаление предложения', -'title.active_offers' => 'Активные предложения', -'title.available_offers' => 'Имеющиеся предложения', -'title.inactive_offers' => 'Неактивные предложения', -'title.pending_offers' => 'Предложения в ожидании', // 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. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index d74bb318..ab601e94 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -367,22 +367,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index f615e431..b8f7e940 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -358,22 +358,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 7bb9edbe..bc98a1d3 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -363,22 +363,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index dce2488b..d977a9a2 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -363,22 +363,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index c154a3a4..dc8bd073 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -392,22 +392,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index a2e6bf28..50cff7bc 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -374,22 +374,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 69121475..8bc481b9 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -378,22 +378,6 @@ // 'title.edit_file' => 'Editing File', // 'title.delete_file' => 'Deleting File', // 'title.download_file' => 'Downloading File', -// 'title.work' => 'Work', -// 'title.add_work' => 'Adding Work', -// 'title.edit_work' => 'Editing Work', -// 'title.delete_work' => 'Deleting Work', -// 'title.active_work' => 'Active Work', // Active work items this group outsources to other groups. -// 'title.available_work' => 'Available Work', // Available work items from other organizations. -// 'title.inactive_work' => 'Inactive Work', // Inactive work items this group was outsourcing to other groups. -// 'title.pending_work' => 'Pending Work', // Work items pending moderator approval. -// 'title.offer' => 'Offer', -// 'title.add_offer' => 'Adding Offer', -// 'title.edit_offer' => 'Editing Offer', -// 'title.delete_offer' => 'Deleting Offer', -// 'title.active_offers' => 'Active Offers', // Active offers this group makes available to other groups. -// 'title.available_offers' => 'Available Offers', // Available offers from other organizations. -// 'title.inactive_offers' => 'Inactive Offers', // Inactive offers for group. -// 'title.pending_offers' => 'Pending Offers', // Offers pending moderator approval. // 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. diff --git a/initialize.php b/initialize.php index 7825bbe5..07344a41 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5616"); +define("APP_VERSION", "1.19.34.5617"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From cb7c7934259f96399c6fc14c25311c9430fd75a7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 17:59:14 +0000 Subject: [PATCH 094/304] Removed 3 unused strings from translation files. --- WEB-INF/resources/ca.lang.php | 3 --- WEB-INF/resources/cs.lang.php | 4 ---- WEB-INF/resources/da.lang.php | 3 --- WEB-INF/resources/de.lang.php | 3 --- WEB-INF/resources/en.lang.php | 3 --- WEB-INF/resources/es.lang.php | 3 --- WEB-INF/resources/et.lang.php | 3 --- WEB-INF/resources/fa.lang.php | 3 --- WEB-INF/resources/fi.lang.php | 3 --- WEB-INF/resources/fr.lang.php | 3 --- WEB-INF/resources/gr.lang.php | 3 --- WEB-INF/resources/he.lang.php | 3 --- WEB-INF/resources/hu.lang.php | 3 --- WEB-INF/resources/it.lang.php | 3 --- WEB-INF/resources/ja.lang.php | 5 ----- WEB-INF/resources/ko.lang.php | 5 ----- WEB-INF/resources/nl.lang.php | 3 --- WEB-INF/resources/no.lang.php | 3 --- WEB-INF/resources/pl.lang.php | 3 --- WEB-INF/resources/pt-br.lang.php | 3 --- WEB-INF/resources/pt.lang.php | 4 ---- WEB-INF/resources/ro.lang.php | 3 --- WEB-INF/resources/ru.lang.php | 3 --- WEB-INF/resources/sk.lang.php | 3 --- WEB-INF/resources/sl.lang.php | 3 --- WEB-INF/resources/sr.lang.php | 3 --- WEB-INF/resources/sv.lang.php | 3 --- WEB-INF/resources/tr.lang.php | 3 --- WEB-INF/resources/zh-cn.lang.php | 3 --- WEB-INF/resources/zh-tw.lang.php | 3 --- initialize.php | 2 +- 31 files changed, 1 insertion(+), 97 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 6a929004..196a4441 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -214,9 +214,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* camps requerits', 'label.on_behalf' => 'a nom de', -'label.role_manager' => '(manejador)', -'label.role_comanager' => '(auxiliar del manejador)', -'label.role_admin' => '(administrador)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 15da342d..a30d83c8 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -224,10 +224,6 @@ 'label.required_fields' => '* nutno vyplnit', // TODO: translate the following. // 'label.on_behalf' => 'on behalf of', -'label.role_manager' => '(manažer)', -'label.role_comanager' => '(spolumanažer)', -'label.role_admin' => '(administrator)', -// TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', // 'label.yes' => 'yes', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index d357a3b3..369c965f 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -207,9 +207,6 @@ 'label.ldap_hint' => 'Skriv dit Windows brugernavn eller adgangskode i felterne her under.', 'label.required_fields' => '* - obligatorisk felt', 'label.on_behalf' => 'på vegne af', -'label.role_manager' => '(Manager)', -'label.role_comanager' => '(Co-Manager)', -'label.role_admin' => '(Administrator)', 'label.page' => 'Side', 'label.condition' => 'Betingelse', // TODO: translate the following. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 259f6c55..87f40c84 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -201,9 +201,6 @@ 'label.ldap_hint' => 'Geben Sie unten Ihren Windows Benutzernamen und Ihr Passwort ein.', 'label.required_fields' => '* - Pflichtfelder', 'label.on_behalf' => 'für', -'label.role_manager' => '(Manager)', -'label.role_comanager' => '(Co-Manager)', -'label.role_admin' => '(Administrator)', 'label.page' => 'Seite', 'label.condition' => 'Bedingung', 'label.yes' => 'Ja', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 8867e8c2..0d82650c 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -189,9 +189,6 @@ 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* - required fields', 'label.on_behalf' => 'on behalf of', -'label.role_manager' => '(manager)', -'label.role_comanager' => '(co-manager)', -'label.role_admin' => '(administrator)', 'label.page' => 'Page', 'label.condition' => 'Condition', 'label.yes' => 'yes', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 25c94b89..68dcc8c3 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -218,9 +218,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* - campos requeridos', 'label.on_behalf' => 'a nombre de', -'label.role_manager' => '(manejador)', -'label.role_comanager' => '(auxiliar del manejador)', -'label.role_admin' => '(administrador)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 0f0d1448..431f2956 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -216,9 +216,6 @@ 'label.required_fields' => '* nõutud väljad', // TODO: Translate label.on_behalf, perhaps trying as "instead of". // 'label.on_behalf' => 'on behalf of', -'label.role_manager' => '(haldur)', -'label.role_comanager' => '(kaashaldur)', -'label.role_admin' => '(administraator)', 'label.page' => 'Lehekülg', 'label.condition' => 'Tingimus', 'label.yes' => 'jah', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 831e9228..9ae24d01 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -218,9 +218,6 @@ 'label.ldap_hint' => 'نام کاربری ویندوزو رمزعبورخود را در فیلدهای زیر وارد کنید', 'label.required_fields' => '* - فیلد های اجباری', 'label.on_behalf' => 'از دیدگاه', -'label.role_manager' => '(مدیر)', -'label.role_comanager' => '(دستیار مدیر)', -'label.role_admin' => '(مدیر ارشد)', // Translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index bbb33f37..a9396eba 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -210,9 +210,6 @@ 'label.ldap_hint' => 'Syötä Windows-käyttäjätunnuksesi ja salasanasi ao. kenttiin.', 'label.required_fields' => '* - pakolliset kentät', 'label.on_behalf' => 'puolesta', -'label.role_manager' => '(esimies)', -'label.role_comanager' => '(apu-esimies)', -'label.role_admin' => '(ylläpitäjä)', 'label.page' => 'Sivu', // TODO: translate the following. // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 443ace91..91e04d79 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -206,9 +206,6 @@ 'label.ldap_hint' => 'Entrer votre Identifiant Windows et votre mot de passe dans les champs suivants.', 'label.required_fields' => '* - champs obligatoires', 'label.on_behalf' => 'de la part de', -'label.role_manager' => '(responsable)', -'label.role_comanager' => '(coresponsable)', -'label.role_admin' => '(administrateur)', 'label.page' => 'Page', 'label.condition' => 'Condition', // TODO: translate the following. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 229d94eb..1fd83890 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -200,9 +200,6 @@ 'label.ldap_hint' => 'Εισάγετε το όνομα σύνδεσης των Windows και κωδικό πρόσβασης στα παρακάτω πεδία.', 'label.required_fields' => '* - υποχρεωτικά πεδία', 'label.on_behalf' => 'εκ μέρους του', -'label.role_manager' => '(Διευθυντής)', -'label.role_comanager' => '(Υποδιευθυντής)', -'label.role_admin' => '(Διαχειριστής)', 'label.page' => 'Σελίδα', 'label.condition' => 'Κατάσταση', 'label.yes' => 'ναι', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 5431e051..ef7597cd 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -226,9 +226,6 @@ 'label.ldap_hint' => 'הכנס את שם המשתמש ואת הסיסמה של ווינדוז בשדות.', 'label.required_fields' => '* - שדות חובה', 'label.on_behalf' => 'מטעם', -'label.role_manager' => '(מנהל)', -'label.role_comanager' => '(מנהל משנה)', -'label.role_admin' => '(מנהל המערכת)', // Translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index d1a093ba..1c446ac5 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -221,9 +221,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* kötelezően kitöltendő mezők', 'label.on_behalf' => 'helyett', -'label.role_manager' => '(vezető)', -'label.role_comanager' => '(helyettes)', -'label.role_admin' => '(adminisztrátor)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 1afc09eb..e3d19aa5 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -204,9 +204,6 @@ 'label.ldap_hint' => 'Digita il tuo Login Windows e la tua password nei campi qui sotto.', 'label.required_fields' => '* campi obbligatori', 'label.on_behalf' => 'a favore di', -'label.role_manager' => '(manager)', -'label.role_comanager' => '(co-manager)', -'label.role_admin' => '(amministratore)', 'label.page' => 'Pagina', 'label.condition' => 'Condizione', 'label.yes' => 'si', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 93ab30e4..aa238978 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -223,11 +223,6 @@ 'label.ldap_hint' => '下記のフィールドにあなたのWindowsのログインIDパスワードを入力してください。', 'label.required_fields' => '* 必須のフィールド', 'label.on_behalf' => 'を代表して', -// TODO: translate all 3 roles properly, see https://www.anuko.com/time_tracker/user_guide/user_accounts.htm -// This may require different terms for role_manager and role_comanager. -'label.role_manager' => '(管理者)', -'label.role_comanager' => '(共同管理者)', -// 'label.role_admin' => '(administrator)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 6ca74cf6..cc52c110 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -222,11 +222,6 @@ 'label.ldap_hint' => '아래의 필드들에서 Windows 로그인암호 를 입력하십시오.', 'label.required_fields' => '* 필수 필드', 'label.on_behalf' => '을 대표하여', -// TODO: translate all 3 roles properly, see https://www.anuko.com/time_tracker/user_guide/user_accounts.htm -// This may require different terms for role_manager and role_comanager. -'label.role_manager' => '(관리자)', -'label.role_comanager' => '(공동관리자)', -// 'label.role_admin' => '(administrator)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index ae1df70d..360ddd80 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -184,9 +184,6 @@ 'label.ldap_hint' => 'Type uw Windows login en wachtwoord in de onderstaande velden.', 'label.required_fields' => '* - verplichte velden', 'label.on_behalf' => 'namens', -'label.role_manager' => '(manager)', -'label.role_comanager' => '(co-manager)', -'label.role_admin' => '(beheerder)', 'label.page' => 'Pagina', 'label.condition' => 'Voorwaarde', 'label.yes' => 'ja', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 5b678077..8202b4e9 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -224,9 +224,6 @@ 'label.required_fields' => '* obligatoriske felt', 'label.on_behalf' => 'på vegne av', // TODO: translate the following. -// 'label.role_manager' => '(manager)', -// 'label.role_comanager' => '(co-manager)', -// 'label.role_admin' => '(administrator)', // 'label.page' => 'Page', // 'label.condition' => 'Condition', // 'label.yes' => 'yes', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 970acaf1..ad4ec2c3 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -212,9 +212,6 @@ 'label.ldap_hint' => 'Wpisz swoją nazwę użytkownika Windows i hasło w polach poniżej.', 'label.required_fields' => '* - pola wymagane', 'label.on_behalf' => 'w imieniu', -'label.role_manager' => '(Manager)', -'label.role_comanager' => '(Co-manager)', -'label.role_admin' => '(Administrator)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index b46a54a8..3b8ceccf 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -185,9 +185,6 @@ 'label.ldap_hint' => 'Entre com o seu login do Windows e senha nos campos abaixo.', 'label.required_fields' => '* - campos obrigatórios', 'label.on_behalf' => 'em nome de', -'label.role_manager' => '(gerente)', -'label.role_comanager' => '(coordenador)', -'label.role_admin' => '(administrador)', 'label.page' => 'Página', 'label.condition' => 'Condição', 'label.yes' => 'sim', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 1fb18ea1..4b6db659 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -212,10 +212,6 @@ 'label.required_fields' => '* campos obrigatórios', // TODO: translate the following. // 'label.on_behalf' => 'on behalf of', -'label.role_manager' => '(gerente)', -// TODO: translate the following. -// 'label.role_comanager' => '(co-manager)', -// 'label.role_admin' => '(administrator)', // 'label.page' => 'Page', // 'label.condition' => 'Condition', // 'label.yes' => 'yes', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index f5bdba76..fc8c9a8f 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -222,9 +222,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* date obligatorii', 'label.on_behalf' => 'in numele', -'label.role_manager' => '(manager)', -'label.role_comanager' => '(co-manager)', -'label.role_admin' => '(administrator)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 8171ba51..e052ba81 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -184,9 +184,6 @@ 'label.ldap_hint' => 'Введите свои Windows логин и пароль в поля ниже.', 'label.required_fields' => '* - обязательные для заполнения поля', 'label.on_behalf' => 'от имени', -'label.role_manager' => '(менеджер)', -'label.role_comanager' => '(ассистент менеджера)', -'label.role_admin' => '(администратор)', 'label.page' => 'Стр', 'label.condition' => 'Условие', 'label.yes' => 'да', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index ab601e94..6eb804d2 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -214,9 +214,6 @@ 'label.ldap_hint' => 'Zadajte prihlasovacie meno do Windowsu a heslo do polí nižšie.', 'label.required_fields' => '* - povinné polia', 'label.on_behalf' => 'v zastúpení', -'label.role_manager' => '(manažér)', -'label.role_comanager' => '(spolu-manažér)', -'label.role_admin' => '(administrátor)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index b8f7e940..1703ba75 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -208,9 +208,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', // 'label.required_fields' => '* - required fields', // 'label.on_behalf' => 'on behalf of', -// 'label.role_manager' => '(manager)', -// 'label.role_comanager' => '(co-manager)', -// 'label.role_admin' => '(administrator)', // 'label.page' => 'Page', // 'label.condition' => 'Condition', // 'label.yes' => 'yes', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index bc98a1d3..fac94f10 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -209,9 +209,6 @@ 'label.ldap_hint' => 'Unesi tvoju Windows prijavu i lozinku u polje ispod.', 'label.required_fields' => '* - obavezna polja', 'label.on_behalf' => 'ispred', -'label.role_manager' => '(menadžer)', -'label.role_comanager' => '(saradnik)', -'label.role_admin' => '(administrator)', 'label.page' => 'Strana', // TODO: translate the following. // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index d977a9a2..64311d4a 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -205,9 +205,6 @@ 'label.ldap_hint' => 'Fyll i ditt användarnamn och lösenord för Windows i fälten nedan.', 'label.required_fields' => '* - Obligatoriska fält', 'label.on_behalf' => 'agerar som', -'label.role_manager' => '(Ansvarig)', -'label.role_comanager' => '(Delansvarig)', -'label.role_admin' => '(Administratör)', 'label.page' => 'Sida', 'label.condition' => 'Villkor', // TODO: translate the following. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index dc8bd073..a41fda46 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -229,9 +229,6 @@ // 'label.ldap_hint' => 'Type your Windows login and password in the fields below.', 'label.required_fields' => '* zorunlu bilgi', 'label.on_behalf' => 'adına', -'label.role_manager' => '(yönetici)', -'label.role_comanager' => '(yardımcı yönetici)', -'label.role_admin' => '(sistem yönetici)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 50cff7bc..e6df6346 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -216,9 +216,6 @@ 'label.ldap_hint' => '在下面的栏目输入您的Windows用户名密码。', 'label.required_fields' => '* 必填栏目', 'label.on_behalf' => '代表', -'label.role_manager' => '(经理)', -'label.role_comanager' => '(合作经理人)', -'label.role_admin' => '(管理员)', 'label.page' => '页码', // TODO: translate the following. // 'label.condition' => 'Condition', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 8bc481b9..353ca1fd 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -221,9 +221,6 @@ 'label.ldap_hint' => '在下麵的欄目輸入您的Windows用戶名密碼。', 'label.required_fields' => '* 必填欄目', 'label.on_behalf' => '代表', -'label.role_manager' => '(經理)', -'label.role_comanager' => '(合作經理人)', -'label.role_admin' => '(管理員)', // TODO: translate the following. // 'label.page' => 'Page', // 'label.condition' => 'Condition', diff --git a/initialize.php b/initialize.php index 07344a41..d2596211 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5617"); +define("APP_VERSION", "1.19.34.5618"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 63fbf04bc85853a1c8a43edfb710009b6531bcce Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Jan 2022 18:08:42 +0000 Subject: [PATCH 095/304] Removed no longer used string from translation files. --- WEB-INF/resources/ca.lang.php | 1 - WEB-INF/resources/cs.lang.php | 1 - WEB-INF/resources/da.lang.php | 1 - WEB-INF/resources/de.lang.php | 1 - WEB-INF/resources/en.lang.php | 1 - WEB-INF/resources/es.lang.php | 1 - WEB-INF/resources/et.lang.php | 1 - WEB-INF/resources/fa.lang.php | 1 - WEB-INF/resources/fi.lang.php | 1 - WEB-INF/resources/fr.lang.php | 1 - WEB-INF/resources/gr.lang.php | 1 - WEB-INF/resources/he.lang.php | 1 - WEB-INF/resources/hu.lang.php | 1 - WEB-INF/resources/it.lang.php | 1 - WEB-INF/resources/ja.lang.php | 1 - WEB-INF/resources/ko.lang.php | 1 - WEB-INF/resources/nl.lang.php | 1 - WEB-INF/resources/no.lang.php | 1 - WEB-INF/resources/pl.lang.php | 1 - WEB-INF/resources/pt-br.lang.php | 1 - WEB-INF/resources/pt.lang.php | 1 - WEB-INF/resources/ro.lang.php | 1 - WEB-INF/resources/ru.lang.php | 1 - WEB-INF/resources/sk.lang.php | 1 - WEB-INF/resources/sl.lang.php | 1 - WEB-INF/resources/sr.lang.php | 1 - WEB-INF/resources/sv.lang.php | 1 - WEB-INF/resources/tr.lang.php | 1 - WEB-INF/resources/zh-cn.lang.php | 1 - WEB-INF/resources/zh-tw.lang.php | 1 - initialize.php | 2 +- 31 files changed, 1 insertion(+), 31 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 196a4441..6b74dced 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -407,7 +407,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index a30d83c8..836ef4f2 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -414,7 +414,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 369c965f..bc042b6e 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -391,7 +391,6 @@ 'dropdown.delete' => 'Slet', 'dropdown.do_not_delete' => 'Slet ikke', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 87f40c84..dae614fb 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -372,7 +372,6 @@ 'dropdown.delete' => 'löschen', 'dropdown.do_not_delete' => 'nicht löschen', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', 'dropdown.paid' => 'bezahlt', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 0d82650c..652c3e48 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -356,7 +356,6 @@ 'dropdown.status_inactive' => 'inactive', 'dropdown.delete' => 'delete', 'dropdown.do_not_delete' => 'do not delete', -'dropdown.pending_approval' => 'pending approval', 'dropdown.approved' => 'approved', 'dropdown.not_approved' => 'not approved', 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 68dcc8c3..f2bb893b 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -406,7 +406,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 431f2956..67210ee6 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -398,7 +398,6 @@ 'dropdown.delete' => 'kustuta', 'dropdown.do_not_delete' => 'ära kustuta', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', 'dropdown.paid' => 'makstud', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 9ae24d01..31c1506f 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -403,7 +403,6 @@ // TODO: translate the following. // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index a9396eba..c0d71266 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -391,7 +391,6 @@ 'dropdown.delete' => 'poista', 'dropdown.do_not_delete' => 'älä poista', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 91e04d79..61570ee8 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -383,7 +383,6 @@ 'dropdown.delete' => 'supprimer', 'dropdown.do_not_delete' => 'ne pas supprimer', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 1fd83890..c795c507 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -381,7 +381,6 @@ 'dropdown.delete' => 'διαγραφή', 'dropdown.do_not_delete' => 'μη το διαγράψετε', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', 'dropdown.paid' => 'εξοφλημένο', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index ef7597cd..72a48ba5 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -408,7 +408,6 @@ // TODO: translate the following. // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 1c446ac5..8b1e0b34 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -408,7 +408,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index e3d19aa5..90167eb2 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -391,7 +391,6 @@ 'dropdown.delete' => 'elimina', 'dropdown.do_not_delete' => 'non eliminare', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', 'dropdown.paid' => 'pagato', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index aa238978..d0bad574 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -408,7 +408,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index cc52c110..3e62d9d2 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -412,7 +412,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 360ddd80..dc86183a 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -348,7 +348,6 @@ 'dropdown.status_inactive' => 'inactief', 'dropdown.delete' => 'verwijderen', 'dropdown.do_not_delete' => 'niet verwijderen', -'dropdown.pending_approval' => 'in afwachting van goedkeuring', 'dropdown.approved' => 'goedgekeurd', 'dropdown.not_approved' => 'afgekeurd', 'dropdown.paid' => 'betaald', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 8202b4e9..59895058 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -410,7 +410,6 @@ // TODO: translate the following. // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index ad4ec2c3..c826441f 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -394,7 +394,6 @@ 'dropdown.delete' => 'usuń', 'dropdown.do_not_delete' => 'nie usuwaj', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 3b8ceccf..ba2ed1d7 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -346,7 +346,6 @@ 'dropdown.status_inactive' => 'inativo', 'dropdown.delete' => 'apagar', 'dropdown.do_not_delete' => 'não apagar', -'dropdown.pending_approval' => 'aprovação pendente', 'dropdown.approved' => 'aprovado', 'dropdown.not_approved' => 'não aprovado', 'dropdown.paid' => 'pago', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 4b6db659..cac4c68e 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -392,7 +392,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index fc8c9a8f..1d97b1fe 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -413,7 +413,6 @@ // TODO: translate the following. // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index e052ba81..20d7d7e6 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -349,7 +349,6 @@ 'dropdown.status_inactive' => 'неактивный', 'dropdown.delete' => 'удалить', 'dropdown.do_not_delete' => 'не удалять', -'dropdown.pending_approval' => 'в ожидании одобрения', 'dropdown.approved' => 'одобрено', 'dropdown.not_approved' => 'не одобрено', 'dropdown.paid' => 'оплачено', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 6eb804d2..89f26abd 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -397,7 +397,6 @@ // TODO: translate the following. // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 1703ba75..56eeb205 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -385,7 +385,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index fac94f10..c88e9d07 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -392,7 +392,6 @@ 'dropdown.delete' => 'obriši', 'dropdown.do_not_delete' => 'nemoj obrisati', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 64311d4a..36c0a325 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -390,7 +390,6 @@ 'dropdown.delete' => 'Ta bort', 'dropdown.do_not_delete' => 'Ta inte bort', // TODO: translate the following. -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index a41fda46..2e5bed2b 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -421,7 +421,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index e6df6346..b1c0667b 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -402,7 +402,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 353ca1fd..5212a3f8 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -406,7 +406,6 @@ // 'dropdown.status_inactive' => 'inactive', // 'dropdown.delete' => 'delete', // 'dropdown.do_not_delete' => 'do not delete', -// 'dropdown.pending_approval' => 'pending approval', // 'dropdown.approved' => 'approved', // 'dropdown.not_approved' => 'not approved', // 'dropdown.paid' => 'paid', diff --git a/initialize.php b/initialize.php index d2596211..8b24ed41 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5618"); +define("APP_VERSION", "1.19.34.5619"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From e0201c7924628b3727cb63b7e4b43d5f284f4326 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 26 Jan 2022 14:33:39 +0000 Subject: [PATCH 096/304] Updated database structure after removing remote work plugin. --- WEB-INF/lib/ttRoleHelper.class.php | 4 +-- dbinstall.php | 13 +++++++--- initialize.php | 2 +- mysql.sql | 40 ++---------------------------- 4 files changed, 14 insertions(+), 45 deletions(-) diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 683f7eba..1ddc839c 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -168,8 +168,8 @@ static function createPredefinedRoles($group_id, $lang) $rights_client = 'view_client_reports,view_client_invoices,manage_own_settings'; $rights_user = 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users'; - $rights_supervisor = $rights_user.',track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_date_lock,override_own_date_lock,swap_roles,update_work'; - $rights_comanager = $rights_supervisor.',manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports,manage_work,bid_on_work'; + $rights_supervisor = $rights_user.',track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_date_lock,override_own_date_lock,swap_roles'; + $rights_comanager = $rights_supervisor.',manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports'; $rights_manager = $rights_comanager.',manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups'; // Active roles. diff --git a/dbinstall.php b/dbinstall.php index 2dfe30d6..c966bdba 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1137,7 +1137,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to11929"]) { + if ($_POST["convert11900to12000"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1172,6 +1172,11 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.23', modified = now() where param_name = 'version_db' and param_value = '1.19.22'"); ttExecute("ALTER TABLE `tt_groups` ADD `entities_modified` datetime default NULL AFTER `modified_by`"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.29', modified = now() where param_name = 'version_db' and param_value = '1.19.23'"); + ttExecute("DROP TABLE `tt_work_currencies`"); + ttExecute("DROP TABLE `tt_work_categories`"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.19.29') set rights = replace(rights, 'swap_roles,update_work', 'swap_roles') where `rank` >= 12"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.19.29') set rights = replace(rights, 'view_all_reports,manage_work,bid_on_work', 'view_all_reports') where `rank` >= 68"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.20.0', modified = now() where param_name = 'version_db' and param_value = '1.19.29'"); } if ($_POST["cleanup"]) { @@ -1222,7 +1227,7 @@ function ttGenerateKeys() {

DB Install

-
Create database structure (v1.19.29) + Create database structure (v1.20.0)
(applies only to new installations, do not execute when updating)
@@ -1271,8 +1276,8 @@ function ttGenerateKeys() {
Update database structure (v1.19 to v1.19.29)Update database structure (v1.19 to v1.20)
diff --git a/initialize.php b/initialize.php index 8b24ed41..e0a6999e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.19.34.5619"); +define("APP_VERSION", "1.20.0.5620"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index 7a87b376..55d8e8b5 100644 --- a/mysql.sql +++ b/mysql.sql @@ -78,7 +78,7 @@ create unique index role_idx on tt_roles(group_id, `rank`, status); # Insert site-wide roles - site administrator and top manager. INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Site administrator', 1024, 'administer_site'); -INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,update_work,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports,manage_work,bid_on_work,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,delete_group'); +INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,delete_group'); # @@ -608,42 +608,6 @@ CREATE TABLE `tt_files` ( ); -# -# Structure for table tt_work_currencies. -# This table keeps currencies supported by remote work plugin. -# -CREATE TABLE `tt_work_currencies` ( - `id` int(10) unsigned NOT NULL, # currency id - `name` varchar(10) NOT NULL, # currency name (USD, CAD, etc.) - PRIMARY KEY (`id`) -); - -# Create an index that guarantees unique work currencies. -create unique index currency_idx on tt_work_currencies(`name`); - -INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD'); - - -# -# Structure for table tt_work_categories. -# This table keeps work categories supported by remote work plugin. -# -CREATE TABLE `tt_work_categories` ( - `id` int(10) unsigned NOT NULL, # Category id. - `parents` text default NULL, # Comma-separated list of parent ids associated with this category. - `name` varchar(64) NOT NULL, # English category name. - `name_localized` text default NULL, # Comma-separated list of localized category names in other languages. - # Example: es:Codificación,ru:Кодирование. - PRIMARY KEY (`id`) -); - -# Insert some default categories. Table content to be updated at run time, though. -INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('1', NULL, 'Coding', 'es:Codificación,ru:Кодирование'); -INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('2', NULL, 'Other', 'es:Otra,ru:Другое'); -INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('3', '1', 'PHP', NULL); -INSERT INTO `tt_work_categories` (`id`, `parents`, `name`, `name_localized`) VALUES ('4', '1', 'C/C++', NULL); - - # # Structure for table tt_site_config. This table stores configuration data # for Time Tracker site as a whole. @@ -657,4 +621,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.19.29', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.20.0', now()); # TODO: change when structure changes. From beb0be399e413bc1ade1d5da86f259154c9782e1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 4 Feb 2022 22:54:34 +0000 Subject: [PATCH 097/304] Remove no longer needed file. --- initialize.php | 3 ++- plugins/work_constants.php | 36 ------------------------------------ 2 files changed, 2 insertions(+), 37 deletions(-) delete mode 100644 plugins/work_constants.php diff --git a/initialize.php b/initialize.php index e0a6999e..73f4e758 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,8 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5620"); +define("APP_VERSION", "1.20.0.5621" + . ""); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/work_constants.php b/plugins/work_constants.php deleted file mode 100644 index 207ca5d3..00000000 --- a/plugins/work_constants.php +++ /dev/null @@ -1,36 +0,0 @@ - Date: Fri, 4 Feb 2022 23:13:49 +0000 Subject: [PATCH 098/304] Fixed a typo problem in previous commit. --- initialize.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/initialize.php b/initialize.php index 73f4e758..c417c1c4 100644 --- a/initialize.php +++ b/initialize.php @@ -12,8 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5621" - . ""); +define("APP_VERSION", "1.20.0.5621"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From fb8b436cabe05c119156de56c24f0b74a042a218 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 7 Feb 2022 19:28:04 +0000 Subject: [PATCH 099/304] Cosmetic maintenance. --- expenses.php | 5 ++++- initialize.php | 2 +- time.php | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/expenses.php b/expenses.php index 578e2d1c..897d64d9 100644 --- a/expenses.php +++ b/expenses.php @@ -189,6 +189,10 @@ // Submit. if ($request->isPost()) { if ($request->getParameter('btn_submit')) { + // Use the "limit" plugin if we have one. Ignore include errors. + // The "limit" plugin is not required for normal operation of Time Tracker. + @include('plugins/limit/access_check.php'); + // Validate user input. if ($user->isPluginEnabled('cl') && $user->isOptionEnabled('client_required') && !$cl_client) $err->add($i18n->get('error.client')); @@ -203,7 +207,6 @@ if ($selected_date->after($browser_today)) $err->add($i18n->get('error.future_date')); } - if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired')); // Finished validating input data. // Prohibit creating entries in locked range. diff --git a/initialize.php b/initialize.php index c417c1c4..ac607dd9 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5621"); +define("APP_VERSION", "1.20.0.5622"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 9202dc1d..6bc95e93 100644 --- a/time.php +++ b/time.php @@ -342,6 +342,11 @@ if ($request->isPost()) { if ($request->getParameter('btn_submit')) { // Submit button clicked. + + // Use the "limit" plugin if we have one. Ignore include errors. + // The "limit" plugin is not required for normal operation of Time Tracker. + @include('plugins/limit/access_check.php'); + // Validate user input. if ($showClient && $user->isOptionEnabled('client_required') && !$cl_client) $err->add($i18n->get('error.client')); @@ -384,7 +389,6 @@ if ($user->isPluginEnabled('tp') && !ttValidTemplateText($cl_note)) { $err->add($i18n->get('error.field'), $i18n->get('label.note')); } - if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired')); // Finished validating user input. // Prohibit creating entries in future. From 58fb0f456312711d175495e8ea6f6116d131a068 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Feb 2022 16:25:10 +0000 Subject: [PATCH 100/304] Addressed several php8 warnings. --- WEB-INF/lib/ttReportHelper.class.php | 8 +++++--- initialize.php | 2 +- login.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 68fc85b2..ffef6e77 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -109,7 +109,7 @@ static function getWhere($options) { } // Prepare sql query part for user list. - $userlist = $options['users'] ? $options['users'] : '-1'; + $userlist = isset($options['users']) ? $options['users'] : '-1'; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $user_list_part = " and l.user_id in ($userlist)"; else @@ -191,7 +191,7 @@ static function getExpenseWhere($options) { } // Prepare sql query part for user list. - $userlist = $options['users'] ? $options['users'] : '-1'; + $userlist = isset($options['users']) ? $options['users'] : '-1'; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) $user_list_part = " and ei.user_id in ($userlist)"; else @@ -571,7 +571,7 @@ static function getItems($options) { } else { $sort_part .= 'date'; } - if (($canViewReports || $isClient) && $options['users'] && !$grouping_by_user) + if (($canViewReports || $isClient) && isset($options['users']) && !$grouping_by_user) $sort_part .= ', user, type'; if ($options['show_start']) $sort_part .= ', unformatted_start'; @@ -584,6 +584,7 @@ static function getItems($options) { $res = $mdb2->query($sql); if (is_a($res, 'PEAR_Error')) die($res->getMessage()); + $report_items = array(); while ($val = $res->fetchRow()) { if ($convertTo12Hour) { if($val['start'] != '') @@ -1526,6 +1527,7 @@ static function getReportOptions($bean) { $options['timesheet'] = $bean->getAttribute('timesheet'); $active_users_in_bean = $bean->getAttribute('users_active'); + $users = ''; if ($active_users_in_bean && is_array($active_users_in_bean)) { $users = join(',', $active_users_in_bean); } diff --git a/initialize.php b/initialize.php index ac607dd9..6e3baf99 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5622"); +define("APP_VERSION", "1.20.0.5623"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index 9e243620..93b1cd08 100644 --- a/login.php +++ b/login.php @@ -66,7 +66,7 @@ $err->add($i18n->get('error.no_groups')); // Determine whether to show login hint. It is currently used only for Windows LDAP authentication. -$show_hint = ('ad' == $GLOBALS['AUTH_MODULE_PARAMS']['type']); +$show_hint = ('ad' == isset($GLOBALS['AUTH_MODULE_PARAMS']['type']) ? $GLOBALS['AUTH_MODULE_PARAMS']['type'] : null); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('show_hint', $show_hint); From 8f06d7527e7e7311b3ac289177ecc1fc77aeebd9 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Feb 2022 17:15:05 +0000 Subject: [PATCH 101/304] Updated dbinstall.php for php8.1 breaking change. --- dbinstall.php | 30 ++++++++++++++++++++---------- initialize.php | 2 +- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/dbinstall.php b/dbinstall.php index c966bdba..12a1e623 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -94,10 +94,16 @@ function ttGenerateKeys() { // $required_version = '5.2.1'; // Something in TCPDF library does not work below this one. $required_version = '5.4.0'; // Week view (week.php) requires 5.4 because of []-way of referencing arrays. // This needs further investigation as we use [] elsewhere without obvious problems. - if (version_compare(phpversion(), $required_version, '>=')) { - echo('PHP version: '.phpversion().', good enough.
'); + // Print a warning about php >= 8.1 because of a breaking change + // with mysqli default error mode, see https://php.watch/versions/8.1/mysqli-error-mode + if (version_compare(phpversion(), '8.1', '>=')) { + echo('Error: This app was not tested with PHP version: '.phpversion().'
'); } else { - echo('Error: PHP version is not high enough: '.phpversion().'. Required: '.$required_version.'.
'); + if (version_compare(phpversion(), $required_version, '>=')) { + echo('PHP version: '.phpversion().', good enough.
'); + } else { + echo('Error: PHP version is not high enough: '.phpversion().'. Required: '.$required_version.'.
'); + } } // Depending on DSN, require either mysqli or mysql extensions. @@ -171,13 +177,17 @@ function ttGenerateKeys() { echo('There are no tables in database. Execute step 1 - Create database structure.
'); } - $sql = "select param_value from tt_site_config where param_name = 'version_db'"; - $res = $conn->query($sql); - if (is_a($res, 'MDB2_Error')) { - echo('Error: database schema version query failed. '.$res->getMessage().'
'); - } else { - $val = $res->fetchRow(); - echo('Database version is: '.$val['param_value'].'.'); + try { + $sql = "select param_value from tt_site_config where param_name = 'version_db'"; + $res = $conn->query($sql); + if (is_a($res, 'MDB2_Error')) { + echo('Error: database schema version query failed. '.$res->getMessage().'
'); + } else { + $val = $res->fetchRow(); + echo('Database version is: '.$val['param_value'].'.'); + } + } catch (Exception $e) { + echo('Caught exception: '.$e->getMessage().'
'); } $conn->disconnect(); diff --git a/initialize.php b/initialize.php index 6e3baf99..27f6705f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5623"); +define("APP_VERSION", "1.20.0.5624"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From d04650cf53ea378f9bd8c7b81104f63c34713936 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Feb 2022 19:28:48 +0000 Subject: [PATCH 102/304] Starting to address numerous php8.1 issues. --- WEB-INF/lib/ttConfigHelper.class.php | 33 +++++----------------------- initialize.php | 2 +- time.php | 10 ++++----- 3 files changed, 11 insertions(+), 34 deletions(-) diff --git a/WEB-INF/lib/ttConfigHelper.class.php b/WEB-INF/lib/ttConfigHelper.class.php index 33e94e51..95bc1e0f 100644 --- a/WEB-INF/lib/ttConfigHelper.class.php +++ b/WEB-INF/lib/ttConfigHelper.class.php @@ -1,30 +1,6 @@ config = trim($config, ' ,'); + if (!is_null($config)) + $this->config = trim($config, ' ,'); if ($this->config) $this->config_array = explode(',', $this->config); } @@ -120,6 +97,6 @@ function setIntValue($name, $value) { // The getConfig returns the config string. function getConfig() { - return trim($this->config, ' ,'); + return (is_null($this->config) ? null : trim($this->config, ' ,')); } } diff --git a/initialize.php b/initialize.php index 27f6705f..7a7f06ef 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5624"); +define("APP_VERSION", "1.20.0.5625"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 6bc95e93..f5f84deb 100644 --- a/time.php +++ b/time.php @@ -129,10 +129,10 @@ } // Initialize variables. -$cl_start = trim($request->getParameter('start')); -$cl_finish = trim($request->getParameter('finish')); -$cl_duration = trim($request->getParameter('duration')); -$cl_note = trim($request->getParameter('note')); +$cl_start = is_null($request->getParameter('start')) ? null : trim($request->getParameter('start')); +$cl_finish = is_null($request->getParameter('finish')) ? null : trim($request->getParameter('finish')); +$cl_duration = is_null($request->getParameter('duration')) ? null : trim($request->getParameter('duration')); +$cl_note = is_null($request->getParameter('note')) ? null : trim($request->getParameter('note')); $cl_billable = 1; if ($showBillable) { if ($request->isPost()) { @@ -161,7 +161,7 @@ 'label' => $timeField['label'], 'type' => $timeField['type'], 'required' => $timeField['required'], - 'value' => trim($cl_control_name)); + 'value' => is_null($cl_control_name) ? null : trim($cl_control_name)); } } From 15c3ecc308bb027469926644af84e4cd49bb8904 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Feb 2022 15:49:30 +0000 Subject: [PATCH 103/304] Started making a replacement for DateAndTime class for php8.1 support. --- WEB-INF/lib/ttDate.class.php | 75 ++++++++++++++++++++++++++++++++++++ initialize.php | 2 +- time.php | 11 ++++++ 3 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 WEB-INF/lib/ttDate.class.php diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php new file mode 100644 index 00000000..519a7662 --- /dev/null +++ b/WEB-INF/lib/ttDate.class.php @@ -0,0 +1,75 @@ +$dateInDbDateFormat = $dateString; + $this->isValid = true; + } else { + $today = date_create(); + $this->dateInDbDateFormat = date_format($today, 'Y-m-d'); + $this->isValid = true; + } + + $this->unixTimestamp = strtotime($this->dateInDbDateFormat); + $this->year = date('Y', $this->unixTimestamp); + $this->month = date('m', $this->unixTimestamp); + $this->day = date('d', $this->unixTimestamp); + $this->dayOfWeek = date('w', $this->unixTimestamp); + } + + + // isValid determines if we have a properly initialized ttDate object. + function isValid() { + return $this->isValid; + } + + + // toString returns a date in specified format. + function toString($format = null) { + if (!$this->isValid) return null; + + if ($format == null || $format == DB_DATEFORMAT) + return $this->dateInDbDateFormat; + else { + return $this->formatDate($format); + } + } + + + // formatDate returns a date string in specified format. + function formatDate($format) { + global $i18n; + + $formattedDate = $format; // Start with unmodified format string. + + // Replace all found elements with data. + $formattedDate = str_replace('%Y', $this->year, $formattedDate); + $formattedDate = str_replace('%m', $this->month, $formattedDate); + $formattedDate = str_replace('%d', $this->day, $formattedDate); + // Replace locale-dependent days of week. + $formattedDate = str_replace('%a', mb_substr($i18n->getWeekDayName($this->dayOfWeek), 0, 3, 'utf-8'), $formattedDate); + return $formattedDate; + } +} diff --git a/initialize.php b/initialize.php index 7a7f06ef..28d4a8d1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5625"); +define("APP_VERSION", "1.20.0.5626"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index f5f84deb..9ee63d91 100644 --- a/time.php +++ b/time.php @@ -11,6 +11,7 @@ import('ttTimeHelper'); import('ttFileHelper'); import('DateAndTime'); +import('ttDate'); // Access checks. if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) { @@ -81,6 +82,16 @@ $cl_date = $selected_date->toString(DB_DATEFORMAT); $_SESSION['date'] = $cl_date; +// Refactoring in progress for php8.1. +// TODO: remove the above block when done. +$selected_date2 = new ttDate(); +if (!$selected_date2->isValid()) + $selected_date2 = new ttDate(); +if(!$cl_date) + $cl_date = $selected_date2->toString(DB_DATEFORMAT); +$_SESSION['date'] = $cl_date; +// End of TODO. + // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); From 496e3ed494343bbd328af0f7a5f288d47a584778 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Feb 2022 16:09:55 +0000 Subject: [PATCH 104/304] Some more refactoring for php8.1. --- initialize.php | 2 +- plugins/MonthlyQuota.class.php | 8 ++++---- time.php | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/initialize.php b/initialize.php index 28d4a8d1..237566d1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5626"); +define("APP_VERSION", "1.20.0.5627"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index f742fd91..76a7c510 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -104,13 +104,13 @@ public function getUserQuota($year, $month) { // from 1st of the month up to and inclusive of $selected_date. public function getUserQuotaFrom1st($selected_date) { // TODO: we may need a better algorithm here. Review. - $monthQuotaMinutes = $this->getUserQuota($selected_date->mYear, $selected_date->mMonth); - $workdaysInMonth = $this->getNumWorkdays($selected_date->mMonth, $selected_date->mYear); + $monthQuotaMinutes = $this->getUserQuota($selected_date->year, $selected_date->month); + $workdaysInMonth = $this->getNumWorkdays($selected_date->month, $selected_date->year); // Iterate from 1st up to selected date. $workdaysFrom1st = 0; - for ($i = 1; $i <= $selected_date->mDate; $i++) { - $date = ttTimeHelper::dateInDatabaseFormat($selected_date->mYear, $selected_date->mMonth, $i); + for ($i = 1; $i <= $selected_date->day; $i++) { + $date = ttTimeHelper::dateInDatabaseFormat($selected_date->year, $selected_date->month, $i); if (!ttTimeHelper::isWeekend($date) && !ttTimeHelper::isHoliday($date)) { $workdaysFrom1st++; } diff --git a/time.php b/time.php index 9ee63d91..6e9dd610 100644 --- a/time.php +++ b/time.php @@ -84,6 +84,7 @@ // Refactoring in progress for php8.1. // TODO: remove the above block when done. +// Also replace all occurrences of $selected_date2 with $selected_date. $selected_date2 = new ttDate(); if (!$selected_date2->isValid()) $selected_date2 = new ttDate(); @@ -124,8 +125,9 @@ if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $month_quota_minutes = $quota->getUserQuota($selected_date->mYear, $selected_date->mMonth); - $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date); + $month_quota_minutes = $quota->getUserQuota($selected_date2->year, $selected_date2->month); + $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date2); + // TODO: refactor ttTimeHelper::getTimeForMonth to use a new ttPeriod class. $month_total = ttTimeHelper::getTimeForMonth($selected_date); $month_total_minutes = ttTimeHelper::toMinutes($month_total); $balance_left = $quota_minutes_from_1st - $month_total_minutes; From 6dd18388f02edf24238aea848cd651380ccbe02a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Feb 2022 12:15:20 +0000 Subject: [PATCH 105/304] Some refactoring for php8.1 support. --- WEB-INF/lib/ttDate.class.php | 34 ++++++++++++++++++++++-- WEB-INF/lib/ttPeriod.class.php | 42 ++++++++++++++++++++++++++++++ WEB-INF/lib/ttTimeHelper.class.php | 27 +++++++++++++++++++ initialize.php | 2 +- time.php | 9 +++---- 5 files changed, 106 insertions(+), 8 deletions(-) create mode 100644 WEB-INF/lib/ttPeriod.class.php diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index 519a7662..791a1e94 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -22,9 +22,8 @@ class ttDate { // Constructor. function __construct($dateString = null) { - // TODO: redo the constructor and initialize year. month, day, and dayOfWeek properly. if (ttValidDbDateFormatDate($dateString)) { - $this->$dateInDbDateFormat = $dateString; + $this->dateInDbDateFormat = $dateString; $this->isValid = true; } else { $today = date_create(); @@ -46,6 +45,25 @@ function isValid() { } + // Returns unix timestamp. + function getTimestamp() { + return $this->unixTimestamp; + } + + + // Resets the object properties from a passed in unix timestamp. + function setFromUnixTimestamp($unixTimestamp) { + $this->unixTimestamp = $unixTimestamp; + + $this->year = date('Y', $this->unixTimestamp); + $this->month = date('m', $this->unixTimestamp); + $this->day = date('d', $this->unixTimestamp); + $this->dayOfWeek = date('w', $this->unixTimestamp); + + $this->dateInDbDateFormat = $this->year.'-'.$this->month.'-'.$this->day; + } + + // toString returns a date in specified format. function toString($format = null) { if (!$this->isValid) return null; @@ -72,4 +90,16 @@ function formatDate($format) { $formattedDate = str_replace('%a', mb_substr($i18n->getWeekDayName($this->dayOfWeek), 0, 3, 'utf-8'), $formattedDate); return $formattedDate; } + + + function before(/*ttDate*/ $obj) { + if ($this->getTimestamp() < $obj->getTimestamp()) return true; + return false; + } + + + function after(/*ttDate*/ $obj) { + if ($this->getTimestamp() > $obj->getTimestamp()) return true; + return false; + } } diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php new file mode 100644 index 00000000..a541663f --- /dev/null +++ b/WEB-INF/lib/ttPeriod.class.php @@ -0,0 +1,42 @@ +getWeekStart(); + + $t_arr = localtime($ttDateInstance->getTimestamp()); + $t_arr[5] = $t_arr[5] + 1900; + + $this->startDate = new ttDate(); + $this->endDate = new ttDate(); + + switch ($period_type) { + case INTERVAL_THIS_MONTH: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); + break; + } + } + + + // Returns start date in specified format. + function getStartDate($format = null) { + return $this->startDate->toString($format); + } + + + // Returns end date in specified format. + function getEndDate($format = null) { + return $this->endDate->toString($format); + } +} \ No newline at end of file diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 75c911e0..917ceb57 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -605,6 +605,7 @@ static function getTimeForWeek($date) { static function getTimeForMonth($date) { global $user; import('Period'); + import('ttPeriod'); $mdb2 = getConnection(); $user_id = $user->getUser(); @@ -612,6 +613,8 @@ static function getTimeForMonth($date) { $org_id = $user->org_id; $period = new Period(INTERVAL_THIS_MONTH, $date); + // TODO: refactoring in progress... + $period2 = new ttPeriod(INTERVAL_THIS_MONTH, $date); $sql = "select sum(time_to_sec(duration)) as sm from tt_log". " where user_id = $user_id and group_id = $group_id and org_id = $org_id". " and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1"; @@ -623,6 +626,30 @@ static function getTimeForMonth($date) { return false; } + // getTimeForMonth2 - gets total time for a user for a given month. + // Refactoring - this is a replacement function for getTimeForMonth above. + // TODO: remove getTimeForMonth after refactoring week view. + static function getTimeForMonth2($date) { + global $user; + import('ttPeriod'); + $mdb2 = getConnection(); + + $user_id = $user->getUser(); + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $period = new ttPeriod(INTERVAL_THIS_MONTH, $date); + $sql = "select sum(time_to_sec(duration)) as sm from tt_log". + " where user_id = $user_id and group_id = $group_id and org_id = $org_id". + " and date >= '".$period->getStartDate()."' and date <= '".$period->getEndDate()."' and status = 1"; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + $val = $res->fetchRow(); + return ttTimeHelper::minutesToDuration($val['sm'] / 60); + } + return false; + } + // getUncompleted - retrieves an uncompleted record for user, if one exists. static function getUncompleted($user_id) { $mdb2 = getConnection(); diff --git a/initialize.php b/initialize.php index 237566d1..e6223498 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5627"); +define("APP_VERSION", "1.20.0.5628"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 6e9dd610..b2030897 100644 --- a/time.php +++ b/time.php @@ -85,7 +85,7 @@ // Refactoring in progress for php8.1. // TODO: remove the above block when done. // Also replace all occurrences of $selected_date2 with $selected_date. -$selected_date2 = new ttDate(); +$selected_date2 = new ttDate($cl_date); if (!$selected_date2->isValid()) $selected_date2 = new ttDate(); if(!$cl_date) @@ -127,8 +127,7 @@ $quota = new MonthlyQuota(); $month_quota_minutes = $quota->getUserQuota($selected_date2->year, $selected_date2->month); $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date2); - // TODO: refactor ttTimeHelper::getTimeForMonth to use a new ttPeriod class. - $month_total = ttTimeHelper::getTimeForMonth($selected_date); + $month_total = ttTimeHelper::getTimeForMonth2($selected_date2); $month_total_minutes = ttTimeHelper::toMinutes($month_total); $balance_left = $quota_minutes_from_1st - $month_total_minutes; $minutes_left = $month_quota_minutes - $month_total_minutes; @@ -406,8 +405,8 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { - $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); - if ($selected_date->after($browser_today)) + $browser_today = new ttDate($request->getParameter('browser_today', null)); + if ($selected_date2->after($browser_today)) $err->add($i18n->get('error.future_date')); } From 82ff14f082c8e03098292b9c9bdf79c22227aa21 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Feb 2022 13:07:48 +0000 Subject: [PATCH 106/304] More refactoring for php8.1. --- WEB-INF/lib/ttPeriod.class.php | 11 +++++++++-- WEB-INF/lib/ttTimeHelper.class.php | 27 ++++++++++++++++++++++++--- WEB-INF/lib/ttUser.class.php | 2 +- initialize.php | 2 +- time.php | 29 +++++++++-------------------- 5 files changed, 44 insertions(+), 27 deletions(-) diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php index a541663f..1d4b2c4d 100644 --- a/WEB-INF/lib/ttPeriod.class.php +++ b/WEB-INF/lib/ttPeriod.class.php @@ -2,6 +2,7 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ +define('INTERVAL_THIS_WEEK', 2); define('INTERVAL_THIS_MONTH', 3); class ttPeriod { @@ -11,16 +12,22 @@ class ttPeriod { function __construct($period_type = INTERVAL_THIS_MONTH, $ttDateInstance) { - // global $user; - // $weekStartDay = $user->getWeekStart(); + global $user; + $weekStartDay = $user->getWeekStart(); $t_arr = localtime($ttDateInstance->getTimestamp()); $t_arr[5] = $t_arr[5] + 1900; + $startWeekBias = ($t_arr[6] < $weekStartDay) ? $weekStartDay - 7 : $weekStartDay; $this->startDate = new ttDate(); $this->endDate = new ttDate(); switch ($period_type) { + case INTERVAL_THIS_WEEK: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); + break; + case INTERVAL_THIS_MONTH: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 917ceb57..60472416 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -600,12 +600,35 @@ static function getTimeForWeek($date) { } return false; } + + // getTimeForWeek2 - gets total time for a user for a given week. + // Refactoring - this is a replacement function for getTimeForWeek above. + // TODO: remove getTimeForWeek after refactoring week view and puncher. + static function getTimeForWeek2($date) { + global $user; + import('ttPeriod'); + $mdb2 = getConnection(); + + $user_id = $user->getUser(); + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $period = new ttPeriod(INTERVAL_THIS_WEEK, $date); + $sql = "select sum(time_to_sec(duration)) as sm from tt_log". + " where user_id = $user_id and group_id = $group_id and org_id = $org_id". + " and date >= '".$period->getStartDate()."' and date <= '".$period->getEndDate()."' and status = 1"; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + $val = $res->fetchRow(); + return ttTimeHelper::minutesToDuration($val['sm'] / 60); + } + return false; + } // getTimeForMonth - gets total time for a user for a given month. static function getTimeForMonth($date) { global $user; import('Period'); - import('ttPeriod'); $mdb2 = getConnection(); $user_id = $user->getUser(); @@ -613,8 +636,6 @@ static function getTimeForMonth($date) { $org_id = $user->org_id; $period = new Period(INTERVAL_THIS_MONTH, $date); - // TODO: refactoring in progress... - $period2 = new ttPeriod(INTERVAL_THIS_MONTH, $date); $sql = "select sum(time_to_sec(duration)) as sm from tt_log". " where user_id = $user_id and group_id = $group_id and org_id = $org_id". " and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."' and status = 1"; diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 320fa623..e6ed7ed7 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -436,7 +436,7 @@ function isDateLocked($date) // Calculate the last occurrence of a lock. $last = tdCron::getLastOccurrence($this->getLockSpec(), time()); - $lockdate = new DateAndTime(DB_DATEFORMAT, strftime('%Y-%m-%d', $last)); + $lockdate = new ttDate(strftime('%Y-%m-%d', $last)); if ($date->before($lockdate)) return true; diff --git a/initialize.php b/initialize.php index e6223498..588dbac7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5628"); +define("APP_VERSION", "1.20.0.5629"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index b2030897..b4dcd84e 100644 --- a/time.php +++ b/time.php @@ -75,24 +75,13 @@ // Initialize and store date in session. $cl_date = $request->getParameter('date', @$_SESSION['date']); -$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); -if($selected_date->isError()) - $selected_date = new DateAndTime(DB_DATEFORMAT); +$selected_date = new ttDate($cl_date); +if (!$selected_date->isValid()) + $selected_date = new ttDate(); if(!$cl_date) - $cl_date = $selected_date->toString(DB_DATEFORMAT); + $cl_date = $selected_date->toString(); $_SESSION['date'] = $cl_date; -// Refactoring in progress for php8.1. -// TODO: remove the above block when done. -// Also replace all occurrences of $selected_date2 with $selected_date. -$selected_date2 = new ttDate($cl_date); -if (!$selected_date2->isValid()) - $selected_date2 = new ttDate(); -if(!$cl_date) - $cl_date = $selected_date2->toString(DB_DATEFORMAT); -$_SESSION['date'] = $cl_date; -// End of TODO. - // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { require_once('plugins/CustomFields.class.php'); @@ -125,9 +114,9 @@ if ($user->isPluginEnabled('mq')){ require_once('plugins/MonthlyQuota.class.php'); $quota = new MonthlyQuota(); - $month_quota_minutes = $quota->getUserQuota($selected_date2->year, $selected_date2->month); - $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date2); - $month_total = ttTimeHelper::getTimeForMonth2($selected_date2); + $month_quota_minutes = $quota->getUserQuota($selected_date->year, $selected_date->month); + $quota_minutes_from_1st = $quota->getUserQuotaFrom1st($selected_date); + $month_total = ttTimeHelper::getTimeForMonth2($selected_date); $month_total_minutes = ttTimeHelper::toMinutes($month_total); $balance_left = $quota_minutes_from_1st - $month_total_minutes; $minutes_left = $month_quota_minutes - $month_total_minutes; @@ -406,7 +395,7 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { $browser_today = new ttDate($request->getParameter('browser_today', null)); - if ($selected_date2->after($browser_today)) + if ($selected_date->after($browser_today)) $err->add($i18n->get('error.future_date')); } @@ -491,7 +480,7 @@ } } // isPost -$week_total = ttTimeHelper::getTimeForWeek($selected_date); +$week_total = ttTimeHelper::getTimeForWeek2($selected_date); $timeRecords = ttTimeHelper::getRecords($cl_date, $showFiles); $showNavigation = ($user->isPluginEnabled('wv') && !$user->isOptionEnabled('week_menu')) || ($user->isPluginEnabled('pu') && !$user->isOptionEnabled('puncher_menu')); From 98534ea6d695fb4fe5f606d9352d0e259f7733d6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Feb 2022 14:14:33 +0000 Subject: [PATCH 107/304] Refactoring for php8.1. --- WEB-INF/lib/common.lib.php | 3 +-- WEB-INF/lib/ttPeriod.class.php | 6 +++--- WEB-INF/lib/ttUser.class.php | 2 +- initialize.php | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 05a06808..fcc36ed4 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -256,8 +256,7 @@ function ttValidDate($val) // ttValidDbDateFormatDate is used to check user input to validate a date in DB_DATEFORMAT. function ttValidDbDateFormatDate($val) { - $val = trim($val); - if (strlen($val) == 0) + if (is_null($val) || strlen($val) == 0) return false; // This should validate a string in format 'YYYY-MM-DD'. diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php index 1d4b2c4d..077aff27 100644 --- a/WEB-INF/lib/ttPeriod.class.php +++ b/WEB-INF/lib/ttPeriod.class.php @@ -24,9 +24,9 @@ function __construct($period_type = INTERVAL_THIS_MONTH, $ttDateInstance) { switch ($period_type) { case INTERVAL_THIS_WEEK: - $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); - $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); - break; + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); + break; case INTERVAL_THIS_MONTH: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index e6ed7ed7..93e71116 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -297,7 +297,7 @@ function isClient() { // isPluginEnabled checks whether a plugin is enabled for user. function isPluginEnabled($plugin) { - return in_array($plugin, explode(',', $this->getPlugins())); + return in_array($plugin, explode(',', $this->getPlugins() ? $this->getPlugins() : '')); } // isOptionEnabled checks whether a config option is enabled for user. diff --git a/initialize.php b/initialize.php index 588dbac7..9514cc4a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5629"); +define("APP_VERSION", "1.20.0.5630"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6c9cddd745b7aa9a985d596633762320a5586d8b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Feb 2022 14:54:42 +0000 Subject: [PATCH 108/304] Started refactoring Calendar.class.php for php8.1. --- WEB-INF/lib/form/Calendar.class.php | 10 ++++++---- WEB-INF/lib/ttDate.class.php | 7 +++++++ initialize.php | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 337737f1..02a6d084 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -64,20 +64,22 @@ function getHtml() { global $user; $selectedDate = $this->value; - if (!$selectedDate) $selectedDate = strftime(DB_DATEFORMAT); // Determine month and year for selected date. - $selectedDateObject = new DateAndTime(DB_DATEFORMAT, $selectedDate); + $selectedDateObject = new ttDate($selectedDate); $selectedMonth = $selectedDateObject->getMonth(); $selectedYear = $selectedDateObject->getYear(); // Determine date for the 1st of next month for calendar navigation. $firstOfNextMonth2AM = mktime(2, 0, 0, $selectedMonth + 1, 1, $selectedYear); // 2 am on the 1st of next month. - $firstOfNextMonth = strftime(DB_DATEFORMAT, $firstOfNextMonth2AM); + $ttDateObject = new ttDate(); + $ttDateObject->setFromUnixTimestamp($firstOfNextMonth2AM); + $firstOfNextMonth = $ttDateObject->toString(); // Determine date for the 1st of previous month. $firstOfPreviousMonth2AM = mktime(2, 0, 0, $selectedMonth - 1, 1, $selectedYear); // 2 am on the 1st of previous month. - $firstOfPreviousMonth = strftime(DB_DATEFORMAT, $firstOfPreviousMonth2AM); + $ttDateObject->setFromUnixTimestamp($firstOfPreviousMonth2AM); + $firstOfPreviousMonth = $ttDateObject->toString(); // Print calendar header. $html = "\n\n\n"; diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index 791a1e94..f2ae4622 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -102,4 +102,11 @@ function after(/*ttDate*/ $obj) { if ($this->getTimestamp() > $obj->getTimestamp()) return true; return false; } + + + // Geters. + function getYear() { return $this->year; } + function getMonth() { return $this->month; } + function getDay() { return $this->day; } + function getDayOfWeek() { return $this->dayOfWeek; } } diff --git a/initialize.php b/initialize.php index 9514cc4a..f98d2cb3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5630"); +define("APP_VERSION", "1.20.0.5631"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 22d3a95aee4e07b29f9b8bd282faa0c595c2a7c5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Feb 2022 21:44:54 +0000 Subject: [PATCH 109/304] More refactoring for php8.1 support. --- WEB-INF/lib/common.lib.php | 4 +++- WEB-INF/lib/form/Calendar.class.php | 8 ++++---- WEB-INF/lib/ttDate.class.php | 15 +++++++++++++++ WEB-INF/lib/ttPeriod.class.php | 2 +- WEB-INF/lib/ttTimeHelper.class.php | 4 ++-- initialize.php | 2 +- 6 files changed, 26 insertions(+), 9 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index fcc36ed4..cabf6262 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -128,7 +128,9 @@ function isTrue($val) // ttValidString is used to check user input to validate a string. function ttValidString($val, $emptyValid = false) { - $val = trim($val); + if(!is_null($val)) + $val = trim($val); + if (strlen($val) == 0 && !$emptyValid) return false; diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 02a6d084..af32eea1 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -157,14 +157,14 @@ function getHtml() { } // Handle selected day. - if ($selectedDate == strftime(DB_DATEFORMAT, $cellDate0am)) + if ($selectedDate == ttDate::dateFromUnixTimestamp($cellDate0am)) $cell_style = ' class="calendarDaySelected"'; $html .= ''; // Handle days with existing entries. if ($active_dates) { // Entries exist. - if (in_array(strftime(DB_DATEFORMAT, $cellDate0am), $active_dates)) { + if (in_array(ttDate::dateFromUnixTimestamp($cellDate0am), $active_dates)) { if ($handleNotCompleteDays && $this->highlight == 'time') { $day_total_minutes = ttTimeHelper::toMinutes(ttTimeHelper::getTimeForDay($date_to_check)); if ($day_total_minutes >= $workday_minutes) @@ -176,7 +176,7 @@ function getHtml() { $link_style = ' class="calendarLinkRecordsExist"'; } } - $html .= "name."=".strftime(DB_DATEFORMAT, $cellDate0am)."\" tabindex=\"-1\">".date("d",$cellDate0am).""; + $html .= "name."=".ttDate::dateFromUnixTimestamp($cellDate0am)."\" tabindex=\"-1\">".date("d",$cellDate0am).""; $html .= ""; } else { $html .= " "; @@ -188,7 +188,7 @@ function getHtml() { // Finished printing calendar table. // Print Today link. - $html .= " name."=".strftime(DB_DATEFORMAT)."\" tabindex=\"-1\">".$i18n->get('label.today')."\n"; + $html .= " name."=".ttDate::dateFromUnixTimestamp()."\" tabindex=\"-1\">".$i18n->get('label.today')."\n"; $html .= "\n"; // Add a hidden control for selected date. diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index f2ae4622..fcf58e60 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -109,4 +109,19 @@ function getYear() { return $this->year; } function getMonth() { return $this->month; } function getDay() { return $this->day; } function getDayOfWeek() { return $this->dayOfWeek; } + + + // A static function to obtain a date in DB_DATEFORMAT from a Unix timestamp. + static function dateFromUnixTimestamp($unixTimestamp = null) { + if ($unixTimestamp == null) { + $today = date_create(); + return date_format($today, 'Y-m-d'); + } + + $year = date('Y', $unixTimestamp); + $month = date('m', $unixTimestamp); + $day = date('d', $unixTimestamp); + $dateInDbFormat = $year.'-'.$month.'-'.$day; + return $dateInDbFormat; + } } diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php index 077aff27..3eb431cc 100644 --- a/WEB-INF/lib/ttPeriod.class.php +++ b/WEB-INF/lib/ttPeriod.class.php @@ -10,7 +10,7 @@ class ttPeriod { var $endDate; // ttDate object. - function __construct($period_type = INTERVAL_THIS_MONTH, $ttDateInstance) { + function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { global $user; $weekStartDay = $user->getWeekStart(); diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 60472416..b45c6d17 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -613,7 +613,7 @@ static function getTimeForWeek2($date) { $group_id = $user->getGroup(); $org_id = $user->org_id; - $period = new ttPeriod(INTERVAL_THIS_WEEK, $date); + $period = new ttPeriod($date, INTERVAL_THIS_WEEK); $sql = "select sum(time_to_sec(duration)) as sm from tt_log". " where user_id = $user_id and group_id = $group_id and org_id = $org_id". " and date >= '".$period->getStartDate()."' and date <= '".$period->getEndDate()."' and status = 1"; @@ -659,7 +659,7 @@ static function getTimeForMonth2($date) { $group_id = $user->getGroup(); $org_id = $user->org_id; - $period = new ttPeriod(INTERVAL_THIS_MONTH, $date); + $period = new ttPeriod($date, INTERVAL_THIS_MONTH); $sql = "select sum(time_to_sec(duration)) as sm from tt_log". " where user_id = $user_id and group_id = $group_id and org_id = $org_id". " and date >= '".$period->getStartDate()."' and date <= '".$period->getEndDate()."' and status = 1"; diff --git a/initialize.php b/initialize.php index f98d2cb3..5874ba02 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5631"); +define("APP_VERSION", "1.20.0.5632"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From b33a06c5f0eb6ef32b0840f3219dfba1f8bcf426 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 19 Feb 2022 17:29:53 +0000 Subject: [PATCH 110/304] Fixed Calendar.class.php with a forgotten import. --- WEB-INF/lib/form/Calendar.class.php | 1 + WEB-INF/lib/ttDate.class.php | 2 +- initialize.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index af32eea1..3f16ed59 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -28,6 +28,7 @@ import('form.FormElement'); import('DateAndTime'); +import('ttDate'); import('ttTimeHelper'); class Calendar extends FormElement { diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index fcf58e60..1b5bad9c 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -104,7 +104,7 @@ function after(/*ttDate*/ $obj) { } - // Geters. + // Getters. function getYear() { return $this->year; } function getMonth() { return $this->month; } function getDay() { return $this->day; } diff --git a/initialize.php b/initialize.php index 5874ba02..29789ed1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5632"); +define("APP_VERSION", "1.20.0.5633"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From eb3210f9fdd97c1a220b874ab2bf73efdc280029 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 19 Feb 2022 19:51:24 +0000 Subject: [PATCH 111/304] Added a missing import to ttUser.class.php. --- WEB-INF/lib/ttUser.class.php | 1 + initialize.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 93e71116..592b5d9c 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -9,6 +9,7 @@ import('form.Form'); import('form.ActionForm'); import('ttTemplateHelper'); +import('ttDate'); class ttUser { var $login = null; // User login. diff --git a/initialize.php b/initialize.php index 29789ed1..03294184 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5633"); +define("APP_VERSION", "1.20.0.5634"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 042398a7f8f0322eb2caa002360172b31c2d2f78 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 19 Feb 2022 21:23:00 +0000 Subject: [PATCH 112/304] Fixed adjusting fav report options for changed user role. --- WEB-INF/lib/ttFavReportHelper.class.php | 11 ++++++++++- initialize.php | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index be23f6a3..303750d6 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -473,6 +473,7 @@ static function adjustOptions($options) { } } else { $users_to_adjust = explode(',', $options['users']); // Users to adjust. + // Adjust user list for a client. if ($user->isClient()) { $users = ttGroupHelper::getUsersForClient(); // Active and inactive users for clients. foreach ($users as $single_user) { @@ -485,7 +486,15 @@ static function adjustOptions($options) { } $options['users'] = implode(',', $adjusted_user_ids); } - // TODO: add checking the existing user list for potentially changed access rights for user. + // Reset user list for a role that no longer has view_reports or view_all_reports rights. + if (!($user->can('view_reports') || $user->can('view_all_reports'))) { + $options['users'] = null; + // Also remove grouping by user if we can't do it. + if (isset($options['group_by1']) && $options['group_by1'] == 'user') unset($options['group_by1']); + if (isset($options['group_by2']) && $options['group_by2'] == 'user') unset($options['group_by2']); + if (isset($options['group_by3']) && $options['group_by3'] == 'user') unset($options['group_by3']); + } + // TODO: improve checking the existing user list for potentially changed access rights for user. } if ($user->isPluginEnabled('ap') && $user->isClient() && !$user->can('view_client_unapproved')) diff --git a/initialize.php b/initialize.php index 03294184..09344a54 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5634"); +define("APP_VERSION", "1.20.0.5635"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 8e8321a78d7dd9c341f7253a18d324a74b039cfc Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 20 Feb 2022 12:54:19 +0000 Subject: [PATCH 113/304] Addressed a php warning. --- WEB-INF/lib/ttReportHelper.class.php | 5 +++-- initialize.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index ffef6e77..20e6d7a4 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -693,6 +693,8 @@ static function getSubtotals($options) { // Execute query. $res = $mdb2->query($sql); if (is_a($res, 'PEAR_Error')) die($res->getMessage()); + + $subtotals = array(); while ($val = $res->fetchRow()) { $time = ttTimeHelper::minutesToDuration($val['time'] / 60); $rowLabel = ttReportHelper::makeGroupByLabel($val['group_field'], $options); @@ -1014,8 +1016,7 @@ static function prepareReportBody($options, $comment = null) $items = ttReportHelper::getItems($options); $grouping = ttReportHelper::grouping($options); - if ($grouping) - $subtotals = ttReportHelper::getSubtotals($options); + $subtotals = $grouping ? ttReportHelper::getSubtotals($options) : array(); $totals = ttReportHelper::getTotals($options); // Use custom fields plugin if it is enabled. diff --git a/initialize.php b/initialize.php index 09344a54..e06256f0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5635"); +define("APP_VERSION", "1.20.0.5636"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 4f95a311ebc6ec1092ad572a4dc2b59ad58a3a79 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 20 Feb 2022 15:20:18 +0000 Subject: [PATCH 114/304] Some refactoring in Calendar class. --- WEB-INF/lib/form/Calendar.class.php | 8 ++------ initialize.php | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 3f16ed59..072b4828 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -27,7 +27,6 @@ // +----------------------------------------------------------------------+ import('form.FormElement'); -import('DateAndTime'); import('ttDate'); import('ttTimeHelper'); @@ -73,14 +72,11 @@ function getHtml() { // Determine date for the 1st of next month for calendar navigation. $firstOfNextMonth2AM = mktime(2, 0, 0, $selectedMonth + 1, 1, $selectedYear); // 2 am on the 1st of next month. - $ttDateObject = new ttDate(); - $ttDateObject->setFromUnixTimestamp($firstOfNextMonth2AM); - $firstOfNextMonth = $ttDateObject->toString(); + $firstOfNextMonth = ttDate::dateFromUnixTimestamp($firstOfNextMonth2AM); // Determine date for the 1st of previous month. $firstOfPreviousMonth2AM = mktime(2, 0, 0, $selectedMonth - 1, 1, $selectedYear); // 2 am on the 1st of previous month. - $ttDateObject->setFromUnixTimestamp($firstOfPreviousMonth2AM); - $firstOfPreviousMonth = $ttDateObject->toString(); + $firstOfPreviousMonth = ttDate::dateFromUnixTimestamp($firstOfPreviousMonth2AM); // Print calendar header. $html = "\n\n\n"; diff --git a/initialize.php b/initialize.php index e06256f0..aa92c01e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5636"); +define("APP_VERSION", "1.20.0.5637"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 28c91182fc500cd9c4a77ada70a24151c6afd7b2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 20 Feb 2022 15:46:25 +0000 Subject: [PATCH 115/304] Resumed refactoring for php8.1. --- WEB-INF/lib/common.lib.php | 10 ++++++---- initialize.php | 2 +- time.php | 1 - 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index cabf6262..d8ed3c8d 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -128,16 +128,18 @@ function isTrue($val) // ttValidString is used to check user input to validate a string. function ttValidString($val, $emptyValid = false) { - if(!is_null($val)) - $val = trim($val); + if (is_null($val)) { + return $emptyValid ? true : false; + } + $val = trim($val); if (strlen($val) == 0 && !$emptyValid) return false; - + // String must not be XSS evil (to insert JavaScript). if (stristr($val, ''; + return ''; } elseif ($encode === 'javascript_charcode') { $string = '' . $text . ''; - for ($x = 0, $y = strlen($string); $x < $y; $x++) { + for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $ord[] = ord($string[ $x ]); } - $_ret = "\n"; - return $_ret; + return ''; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[ 2 ])) { diff --git a/WEB-INF/lib/smarty/plugins/function.math.php b/WEB-INF/lib/smarty/plugins/function.math.php index 7348d964..fd5b3d16 100644 --- a/WEB-INF/lib/smarty/plugins/function.math.php +++ b/WEB-INF/lib/smarty/plugins/function.math.php @@ -12,7 +12,7 @@ * Name: math * Purpose: handle math computations in template * - * @link http://www.smarty.net/manual/en/language.function.math.php {math} + * @link https://www.smarty.net/manual/en/language.function.math.php {math} * (Smarty online manual) * @author Monte Ohrt * @@ -28,7 +28,12 @@ function smarty_function_math($params, $template) 'int' => true, 'abs' => true, 'ceil' => true, + 'acos' => true, + 'acosh' => true, 'cos' => true, + 'cosh' => true, + 'deg2rad' => true, + 'rad2deg' => true, 'exp' => true, 'floor' => true, 'log' => true, @@ -39,27 +44,51 @@ function smarty_function_math($params, $template) 'pow' => true, 'rand' => true, 'round' => true, + 'asin' => true, + 'asinh' => true, 'sin' => true, + 'sinh' => true, 'sqrt' => true, 'srand' => true, - 'tan' => true + 'atan' => true, + 'atanh' => true, + 'tan' => true, + 'tanh' => true ); + // be sure equation parameter is present if (empty($params[ 'equation' ])) { trigger_error("math: missing equation parameter", E_USER_WARNING); return; } $equation = $params[ 'equation' ]; + + // Remove whitespaces + $equation = preg_replace('/\s+/', '', $equation); + + // Adapted from https://www.php.net/manual/en/function.eval.php#107377 + $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number + $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; + $operators = '[+\/*\^%-]'; // Allowed math operators + $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)+\)|\((?1)+\)))(?:'.$operators.'(?1))?)+$/'; + + if (!preg_match($regexp, $equation)) { + trigger_error("math: illegal characters", E_USER_WARNING); + return; + } + // make sure parenthesis are balanced if (substr_count($equation, '(') !== substr_count($equation, ')')) { trigger_error("math: unbalanced parenthesis", E_USER_WARNING); return; } + // disallow backticks if (strpos($equation, '`') !== false) { trigger_error("math: backtick character not allowed in equation", E_USER_WARNING); return; } + // also disallow dollar signs if (strpos($equation, '$') !== false) { trigger_error("math: dollar signs not allowed in equation", E_USER_WARNING); @@ -96,6 +125,7 @@ function smarty_function_math($params, $template) } $smarty_math_result = null; eval("\$smarty_math_result = " . $equation . ";"); + if (empty($params[ 'format' ])) { if (empty($params[ 'assign' ])) { return $smarty_math_result; diff --git a/WEB-INF/lib/smarty/plugins/modifier.date_format.php b/WEB-INF/lib/smarty/plugins/modifier.date_format.php index c8e88c5c..8e7e0b6e 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.date_format.php +++ b/WEB-INF/lib/smarty/plugins/modifier.date_format.php @@ -15,7 +15,7 @@ * - format: strftime format for output * - default_date: default date if $string is empty * - * @link http://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) + * @link https://www.smarty.net/manual/en/language.modifier.date.format.php date_format (Smarty online manual) * @author Monte Ohrt * * @param string $string input date string diff --git a/WEB-INF/lib/smarty/plugins/modifier.escape.php b/WEB-INF/lib/smarty/plugins/modifier.escape.php index 150901c7..47489aa9 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.escape.php +++ b/WEB-INF/lib/smarty/plugins/modifier.escape.php @@ -11,7 +11,7 @@ * Name: escape * Purpose: escape string for output * - * @link http://www.smarty.net/docs/en/language.modifier.escape + * @link https://www.smarty.net/docs/en/language.modifier.escape * @author Monte Ohrt * * @param string $string input string @@ -23,12 +23,9 @@ */ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true) { - static $_double_encode = null; + static $_double_encode = true; static $is_loaded_1 = false; static $is_loaded_2 = false; - if ($_double_encode === null) { - $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); - } if (!$char_set) { $char_set = Smarty::$_CHARSET; } @@ -184,7 +181,11 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ '"' => '\\"', "\r" => '\\r', "\n" => '\\n', - ' '<\/' + ' '<\/', + // see https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements + '#ms', '', $source); // capture html elements not to be messed with $_offset = 0; diff --git a/WEB-INF/lib/smarty/plugins/shared.escape_special_chars.php b/WEB-INF/lib/smarty/plugins/shared.escape_special_chars.php index 6b18d3ee..a204b092 100644 --- a/WEB-INF/lib/smarty/plugins/shared.escape_special_chars.php +++ b/WEB-INF/lib/smarty/plugins/shared.escape_special_chars.php @@ -20,13 +20,7 @@ function smarty_function_escape_special_chars($string) { if (!is_array($string)) { - if (version_compare(PHP_VERSION, '5.2.3', '>=')) { - $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false); - } else { - $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); - $string = htmlspecialchars($string); - $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); - } + $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false); } return $string; } diff --git a/WEB-INF/lib/smarty/plugins/shared.mb_str_replace.php b/WEB-INF/lib/smarty/plugins/shared.mb_str_replace.php index 206cf9ea..226d9035 100644 --- a/WEB-INF/lib/smarty/plugins/shared.mb_str_replace.php +++ b/WEB-INF/lib/smarty/plugins/shared.mb_str_replace.php @@ -44,7 +44,7 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) } } } else { - $parts = mb_split(preg_quote($search), $subject); + $parts = mb_split(preg_quote($search), $subject) ?: array(); $count = count($parts) - 1; $subject = implode($replace, $parts); } diff --git a/WEB-INF/lib/smarty/readme b/WEB-INF/lib/smarty/readme new file mode 100644 index 00000000..91eff478 --- /dev/null +++ b/WEB-INF/lib/smarty/readme @@ -0,0 +1,8 @@ +These are files from Smarty-4.1.0 with 2 modifications in: + +Smarty.class.php +sysplugins/smarty_internal_cacheresource_file.php + +Nik edited these files for php5.4 support, as they use php7.0 features. + + diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_cacheresource_file.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_cacheresource_file.php index 61618449..f6879bc7 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_cacheresource_file.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_cacheresource_file.php @@ -196,12 +196,8 @@ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $e */ public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached) { - if (version_compare(PHP_VERSION, '5.3.0', '>=')) { - clearstatcache(true, $cached->lock_id); - } else { - clearstatcache(); - } - if (is_file($cached->lock_id)) { + clearstatcache(true, $cached->lock_id ?: ''); + if (null !== $cached->lock_id && is_file($cached->lock_id)) { $t = filemtime($cached->lock_id); return $t && (time() - $t < $smarty->locking_timeout); } else { diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_for.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_for.php index 3f113e56..969e22c1 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_for.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_for.php @@ -18,7 +18,7 @@ class Smarty_Internal_Compile_For extends Smarty_Internal_CompileBase { /** * Compiles code for the {for} tag - * Smarty 3 does implement two different syntax's: + * Smarty supports two different syntax's: * - {for $var in $array} * For looping over arrays or iterators * - {for $x=0; $x<$y; $x++} diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_foreach.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_foreach.php index a68da540..edfe358b 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_foreach.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_foreach.php @@ -219,9 +219,9 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) if (isset($itemAttr[ 'index' ])) { $output .= "{$itemVar}->index = -1;\n"; } - $output .= "{$itemVar}->do_else = true;\n"; + $output .= "{$itemVar}->do_else = true;\n"; $output .= "if (\$_from !== null) foreach (\$_from as {$keyTerm}{$itemVar}->value) {\n"; - $output .= "{$itemVar}->do_else = false;\n"; + $output .= "{$itemVar}->do_else = false;\n"; if (isset($attributes[ 'key' ]) && isset($itemAttr[ 'key' ])) { $output .= "\$_smarty_tpl->tpl_vars['{$key}']->value = {$itemVar}->key;\n"; } diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_function.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_function.php index d0f2b0f4..84e9584d 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_function.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_function.php @@ -157,7 +157,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) $output = "template->compiled->nocache_hash}%%*/smarty->ext->_tplFunction->restoreTemplateVariables(\\\$_smarty_tpl, '{$_name}');?>\n"; $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\";\n?>"; - $output .= "template->compiled->nocache_hash}', \$_smarty_tpl->compiled->nocache_hash, ob_get_clean());\n"; + $output .= "template->compiled->nocache_hash}', \$_smarty_tpl->compiled->nocache_hash ?? '', ob_get_clean());\n"; $output .= "}\n}\n"; $output .= "/*/ {$_funcName}_nocache */\n\n"; $output .= "?>\n"; diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_include_php.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_include_php.php deleted file mode 100644 index 1b0fdaad..00000000 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_include_php.php +++ /dev/null @@ -1,110 +0,0 @@ -smarty instanceof SmartyBC)) { - throw new SmartyException("{include_php} is deprecated, use SmartyBC class to enable"); - } - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - /** - * - * - * @var Smarty_Internal_Template $_smarty_tpl - * used in evaluated code - */ - $_smarty_tpl = $compiler->template; - $_filepath = false; - $_file = null; - eval('$_file = @' . $_attr[ 'file' ] . ';'); - if (!isset($compiler->smarty->security_policy) && file_exists($_file)) { - $_filepath = $compiler->smarty->_realpath($_file, true); - } else { - if (isset($compiler->smarty->security_policy)) { - $_dir = $compiler->smarty->security_policy->trusted_dir; - } else { - $_dir = $compiler->smarty->trusted_dir; - } - if (!empty($_dir)) { - foreach ((array)$_dir as $_script_dir) { - $_path = $compiler->smarty->_realpath($_script_dir . DIRECTORY_SEPARATOR . $_file, true); - if (file_exists($_path)) { - $_filepath = $_path; - break; - } - } - } - } - if ($_filepath === false) { - $compiler->trigger_template_error("{include_php} file '{$_file}' is not readable", null, true); - } - if (isset($compiler->smarty->security_policy)) { - $compiler->smarty->security_policy->isTrustedPHPDir($_filepath); - } - if (isset($_attr[ 'assign' ])) { - // output will be stored in a smarty variable instead of being displayed - $_assign = $_attr[ 'assign' ]; - } - $_once = '_once'; - if (isset($_attr[ 'once' ])) { - if ($_attr[ 'once' ] === 'false') { - $_once = ''; - } - } - if (isset($_assign)) { - return "assign({$_assign},ob_get_clean());\n?>"; - } else { - return "\n"; - } - } -} diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_insert.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_insert.php index 4bdc3952..c91ff62c 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_insert.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_insert.php @@ -89,7 +89,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) if (isset($compiler->smarty->security_policy)) { $_dir = $compiler->smarty->security_policy->trusted_dir; } else { - $_dir = $compiler->smarty instanceof SmartyBC ? $compiler->smarty->trusted_dir : null; + $_dir = null; } if (!empty($_dir)) { foreach ((array)$_dir as $_script_dir) { diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_private_php.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_private_php.php deleted file mode 100644 index ff48c6fb..00000000 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_compile_private_php.php +++ /dev/null @@ -1,253 +0,0 @@ -getAttributes($compiler, $args); - $compiler->has_code = false; - if ($_attr[ 'type' ] === 'xml') { - $compiler->tag_nocache = true; - $output = addcslashes($_attr[ 'code' ], "'\\"); - $compiler->parser->current_buffer->append_subtree( - $compiler->parser, - new Smarty_Internal_ParseTree_Tag( - $compiler->parser, - $compiler->processNocacheCode( - "\n", - true - ) - ) - ); - return ''; - } - if ($_attr[ 'type' ] !== 'tag') { - if ($compiler->php_handling === Smarty::PHP_REMOVE) { - return ''; - } elseif ($compiler->php_handling === Smarty::PHP_QUOTE) { - $output = - preg_replace_callback( - '#(<\?(?:php|=)?)|(<%)|()|(\?>)|(%>)|(<\/script>)#i', - array($this, 'quote'), - $_attr[ 'code' ] - ); - $compiler->parser->current_buffer->append_subtree( - $compiler->parser, - new Smarty_Internal_ParseTree_Text($output) - ); - return ''; - } elseif ($compiler->php_handling === Smarty::PHP_PASSTHRU || $_attr[ 'type' ] === 'unmatched') { - $compiler->tag_nocache = true; - $output = addcslashes($_attr[ 'code' ], "'\\"); - $compiler->parser->current_buffer->append_subtree( - $compiler->parser, - new Smarty_Internal_ParseTree_Tag( - $compiler->parser, - $compiler->processNocacheCode( - "\n", - true - ) - ) - ); - return ''; - } elseif ($compiler->php_handling === Smarty::PHP_ALLOW) { - if (!($compiler->smarty instanceof SmartyBC)) { - $compiler->trigger_template_error( - '$smarty->php_handling PHP_ALLOW not allowed. Use SmartyBC to enable it', - null, - true - ); - } - $compiler->has_code = true; - return $_attr[ 'code' ]; - } else { - $compiler->trigger_template_error('Illegal $smarty->php_handling value', null, true); - } - } else { - $compiler->has_code = true; - if (!($compiler->smarty instanceof SmartyBC)) { - $compiler->trigger_template_error( - '{php}{/php} tags not allowed. Use SmartyBC to enable them', - null, - true - ); - } - $ldel = preg_quote($compiler->smarty->left_delimiter, '#'); - $rdel = preg_quote($compiler->smarty->right_delimiter, '#'); - preg_match("#^({$ldel}php\\s*)((.)*?)({$rdel})#", $_attr[ 'code' ], $match); - if (!empty($match[ 2 ])) { - if ('nocache' === trim($match[ 2 ])) { - $compiler->tag_nocache = true; - } else { - $compiler->trigger_template_error("illegal value of option flag '{$match[2]}'", null, true); - } - } - return preg_replace( - array("#^{$ldel}\\s*php\\s*(.)*?{$rdel}#", "#{$ldel}\\s*/\\s*php\\s*{$rdel}$#"), - array(''), - $_attr[ 'code' ] - ); - } - } - - /** - * Lexer code for PHP tags - * - * This code has been moved from lexer here fo easier debugging and maintenance - * - * @param Smarty_Internal_Templatelexer $lex - * - * @throws \SmartyCompilerException - */ - public function parsePhp(Smarty_Internal_Templatelexer $lex) - { - $lex->token = Smarty_Internal_Templateparser::TP_PHP; - $close = 0; - $lex->taglineno = $lex->line; - $closeTag = '?>'; - if (strpos($lex->value, 'is_xml = true; - $lex->phpType = 'xml'; - return; - } elseif (strpos($lex->value, 'phpType = 'php'; - } elseif (strpos($lex->value, '<%') === 0) { - $lex->phpType = 'asp'; - $closeTag = '%>'; - } elseif (strpos($lex->value, '%>') === 0) { - $lex->phpType = 'unmatched'; - } elseif (strpos($lex->value, '?>') === 0) { - if ($lex->is_xml) { - $lex->is_xml = false; - $lex->phpType = 'xml'; - return; - } - $lex->phpType = 'unmatched'; - } elseif (strpos($lex->value, 'phpType = 'script'; - $closeTag = ''; - } elseif (strpos($lex->value, $lex->smarty->left_delimiter) === 0) { - if ($lex->isAutoLiteral()) { - $lex->token = Smarty_Internal_Templateparser::TP_TEXT; - return; - } - $closeTag = "{$lex->smarty->left_delimiter}/php{$lex->smarty->right_delimiter}"; - if ($lex->value === $closeTag) { - $lex->compiler->trigger_template_error("unexpected closing tag '{$closeTag}'"); - } - $lex->phpType = 'tag'; - } - if ($lex->phpType === 'unmatched') { - return; - } - if (($lex->phpType === 'php' || $lex->phpType === 'asp') - && - ($lex->compiler->php_handling === Smarty::PHP_PASSTHRU || - $lex->compiler->php_handling === Smarty::PHP_QUOTE) - ) { - return; - } - $start = $lex->counter + strlen($lex->value); - $body = true; - if (preg_match('~' . preg_quote($closeTag, '~') . '~i', $lex->data, $match, PREG_OFFSET_CAPTURE, $start)) { - $close = $match[ 0 ][ 1 ]; - } else { - $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'"); - } - while ($body) { - if (preg_match( - '~([/][*])|([/][/][^\n]*)|(\'[^\'\\\\]*(?:\\.[^\'\\\\]*)*\')|("[^"\\\\]*(?:\\.[^"\\\\]*)*")~', - $lex->data, - $match, - PREG_OFFSET_CAPTURE, - $start - ) - ) { - $value = $match[ 0 ][ 0 ]; - $from = $pos = $match[ 0 ][ 1 ]; - if ($pos > $close) { - $body = false; - } else { - $start = $pos + strlen($value); - $phpCommentStart = $value === '/*'; - if ($phpCommentStart) { - $phpCommentEnd = preg_match('~([*][/])~', $lex->data, $match, PREG_OFFSET_CAPTURE, $start); - if ($phpCommentEnd) { - $pos2 = $match[ 0 ][ 1 ]; - $start = $pos2 + strlen($match[ 0 ][ 0 ]); - } - } - while ($close > $pos && $close < $start) { - if (preg_match( - '~' . preg_quote($closeTag, '~') . '~i', - $lex->data, - $match, - PREG_OFFSET_CAPTURE, - $from - ) - ) { - $close = $match[ 0 ][ 1 ]; - $from = $close + strlen($match[ 0 ][ 0 ]); - } else { - $lex->compiler->trigger_template_error("missing closing tag '{$closeTag}'"); - } - } - if ($phpCommentStart && (!$phpCommentEnd || $pos2 > $close)) { - $lex->taglineno = $lex->line + substr_count(substr($lex->data, $lex->counter, $start), "\n"); - $lex->compiler->trigger_template_error("missing PHP comment closing tag '*/'"); - } - } - } else { - $body = false; - } - } - $lex->value = substr($lex->data, $lex->counter, $close + strlen($closeTag) - $lex->counter); - } - - /* - * Call back function for $php_handling = PHP_QUOTE - * - */ - /** - * @param $match - * - * @return string - */ - private function quote($match) - { - return htmlspecialchars($match[ 0 ], ENT_QUOTES); - } -} diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_config_file_compiler.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_config_file_compiler.php index 90c5dcef..a9b940e5 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_config_file_compiler.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_config_file_compiler.php @@ -158,7 +158,7 @@ public function compileTemplate(Smarty_Internal_Template $template) } // template header code $template_header = - "template->source->filepath}' */ ?>\n"; $code = 'smarty->ext->configLoad->_loadConfigVars($_smarty_tpl, ' . diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_data.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_data.php index 98e3e57b..1b64185b 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_data.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_data.php @@ -121,7 +121,7 @@ public function assign($tpl_var, $value = null, $nocache = false) * appends values to template variables * * @api Smarty::append() - * @link http://www.smarty.net/docs/en/api.append.tpl + * @link https://www.smarty.net/docs/en/api.append.tpl * * @param array|string $tpl_var the template variable name(s) * @param mixed $value the value to append @@ -182,7 +182,7 @@ public function assignByRef($tpl_var, &$value, $nocache = false) * Returns a single or all template variables * * @api Smarty::getTemplateVars() - * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl + * @link https://www.smarty.net/docs/en/api.get.template.vars.tpl * * @param string $varName variable name or null * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $_ptr optional pointer to data object @@ -195,26 +195,6 @@ public function getTemplateVars($varName = null, Smarty_Internal_Data $_ptr = nu return $this->ext->getTemplateVars->getTemplateVars($this, $varName, $_ptr, $searchParents); } - /** - * gets the object of a Smarty variable - * - * @param string $variable the name of the Smarty variable - * @param Smarty_Internal_Data $_ptr optional pointer to data object - * @param boolean $searchParents search also in parent data - * @param bool $error_enable - * - * @return Smarty_Variable|Smarty_Undefined_Variable the object of the variable - * @deprecated since 3.1.28 please use Smarty_Internal_Data::getTemplateVars() instead. - */ - public function getVariable( - $variable = null, - Smarty_Internal_Data $_ptr = null, - $searchParents = true, - $error_enable = true - ) { - return $this->ext->getTemplateVars->_getVariable($this, $variable, $_ptr, $searchParents, $error_enable); - } - /** * Follow the parent chain an merge template and config variables * diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_errorhandler.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_errorhandler.php index 56dca18f..c2b653ef 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_errorhandler.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_errorhandler.php @@ -1,61 +1,60 @@ previousErrorHandler = set_error_handler([$this, 'handleError']); + } + + /** + * Disable error handler + */ + public function deactivate() { + restore_error_handler(); + $this->previousErrorHandler = null; } /** * Error Handler to mute expected messages * - * @link http://php.net/set_error_handler + * @link https://php.net/set_error_handler * * @param integer $errno Error level * @param $errstr @@ -65,49 +64,21 @@ public static function muteExpectedErrors() * * @return bool */ - public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext = array()) + public function handleError($errno, $errstr, $errfile, $errline, $errcontext = []) { - $_is_muted_directory = false; - // add the SMARTY_DIR to the list of muted directories - if (!isset(self::$mutedDirectories[ SMARTY_DIR ])) { - $smarty_dir = realpath(SMARTY_DIR); - if ($smarty_dir !== false) { - self::$mutedDirectories[ SMARTY_DIR ] = - array('file' => $smarty_dir, 'length' => strlen($smarty_dir),); - } + if ($this->allowUndefinedVars && $errstr == 'Attempt to read property "value" on null') { + return; // suppresses this error } - // walk the muted directories and test against $errfile - foreach (self::$mutedDirectories as $key => &$dir) { - if (!$dir) { - // resolve directory and length for speedy comparisons - $file = realpath($key); - if ($file === false) { - // this directory does not exist, remove and skip it - unset(self::$mutedDirectories[ $key ]); - continue; - } - $dir = array('file' => $file, 'length' => strlen($file),); - } - if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) { - $_is_muted_directory = true; - break; - } - } - // pass to next error handler if this error did not occur inside SMARTY_DIR - // or the error was within smarty but masked to be ignored - if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { - if (self::$previousErrorHandler) { - return call_user_func( - self::$previousErrorHandler, - $errno, - $errstr, - $errfile, - $errline, - $errcontext - ); - } else { - return false; - } + + if ($this->allowUndefinedArrayKeys && preg_match( + '/^(Undefined array key|Trying to access array offset on value of type null)/', + $errstr + )) { + return; // suppresses this error } + + // pass all other errors through to the previous error handler or to the default PHP error handler + return $this->previousErrorHandler ? + call_user_func($this->previousErrorHandler, $errno, $errstr, $errfile, $errline, $errcontext) : false; } } diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_append.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_append.php index 881375ef..e207734e 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_append.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_append.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_Append * appends values to template variables * * @api Smarty::append() - * @link http://www.smarty.net/docs/en/api.append.tpl + * @link https://www.smarty.net/docs/en/api.append.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param array|string $tpl_var the template variable name(s) diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_appendbyref.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_appendbyref.php index c9590446..b5be69b5 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_appendbyref.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_appendbyref.php @@ -15,7 +15,7 @@ class Smarty_Internal_Method_AppendByRef * appends values to template variables by reference * * @api Smarty::appendByRef() - * @link http://www.smarty.net/docs/en/api.append.by.ref.tpl + * @link https://www.smarty.net/docs/en/api.append.by.ref.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string $tpl_var the template variable name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallassign.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallassign.php index 29ff2ffb..6fb0c8f3 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallassign.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallassign.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearAllAssign * clear all the assigned template variables. * * @api Smarty::clearAllAssign() - * @link http://www.smarty.net/docs/en/api.clear.all.assign.tpl + * @link https://www.smarty.net/docs/en/api.clear.all.assign.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallcache.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallcache.php index 30d55f7d..b74d3058 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallcache.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearallcache.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearAllCache * Empty cache folder * * @api Smarty::clearAllCache() - * @link http://www.smarty.net/docs/en/api.clear.all.cache.tpl + * @link https://www.smarty.net/docs/en/api.clear.all.cache.tpl * * @param \Smarty $smarty * @param integer $exp_time expiration time diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearassign.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearassign.php index 22bfa2d3..12b755c0 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearassign.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearassign.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearAssign * clear the given assigned template variable(s). * * @api Smarty::clearAssign() - * @link http://www.smarty.net/docs/en/api.clear.assign.tpl + * @link https://www.smarty.net/docs/en/api.clear.assign.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string|array $tpl_var the template variable(s) to clear diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcache.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcache.php index a5dd4e26..df766eee 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcache.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcache.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearCache * Empty cache for a specific template * * @api Smarty::clearCache() - * @link http://www.smarty.net/docs/en/api.clear.cache.tpl + * @link https://www.smarty.net/docs/en/api.clear.cache.tpl * * @param \Smarty $smarty * @param string $template_name template name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php index bf492980..db0a49b0 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearCompiledTemplate * Delete compiled template file * * @api Smarty::clearCompiledTemplate() - * @link http://www.smarty.net/docs/en/api.clear.compiled.template.tpl + * @link https://www.smarty.net/docs/en/api.clear.compiled.template.tpl * * @param \Smarty $smarty * @param string $resource_name template name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearconfig.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearconfig.php index 15bf492a..d1b73032 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearconfig.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_clearconfig.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ClearConfig * clear a single or all config variables * * @api Smarty::clearConfig() - * @link http://www.smarty.net/docs/en/api.clear.config.tpl + * @link https://www.smarty.net/docs/en/api.clear.config.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string|null $name variable name or null diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_configload.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_configload.php index 2e625488..c3174d2d 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_configload.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_configload.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_ConfigLoad * load a config file, optionally load just selected sections * * @api Smarty::configLoad() - * @link http://www.smarty.net/docs/en/api.config.load.tpl + * @link https://www.smarty.net/docs/en/api.config.load.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string $config_file filename @@ -42,7 +42,7 @@ public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = * load a config file, optionally load just selected sections * * @api Smarty::configLoad() - * @link http://www.smarty.net/docs/en/api.config.load.tpl + * @link https://www.smarty.net/docs/en/api.config.load.tpl * * @param \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template $data * @param string $config_file filename diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_createdata.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_createdata.php index f9509751..c684c087 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_createdata.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_createdata.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_CreateData * creates a data object * * @api Smarty::createData() - * @link http://www.smarty.net/docs/en/api.create.data.tpl + * @link https://www.smarty.net/docs/en/api.create.data.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param \Smarty_Internal_Template|\Smarty_Internal_Data|\Smarty_Data|\Smarty $parent next higher level of Smarty diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getconfigvars.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getconfigvars.php index 1d11e44c..763bdf98 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getconfigvars.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getconfigvars.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_GetConfigVars * Returns a single or all config variables * * @api Smarty::getConfigVars() - * @link http://www.smarty.net/docs/en/api.get.config.vars.tpl + * @link https://www.smarty.net/docs/en/api.get.config.vars.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string $varname variable name or null diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getregisteredobject.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getregisteredobject.php index df6ede13..0b3a071d 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getregisteredobject.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_getregisteredobject.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_GetRegisteredObject * return a reference to a registered object * * @api Smarty::getRegisteredObject() - * @link http://www.smarty.net/docs/en/api.get.registered.object.tpl + * @link https://www.smarty.net/docs/en/api.get.registered.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $object_name object name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettags.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettags.php index c07ae07e..0d1335a8 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettags.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettags.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_GetTags * Return array of tag/attributes of all tags used by an template * * @api Smarty::getTags() - * @link http://www.smarty.net/docs/en/api.get.tags.tpl + * @link https://www.smarty.net/docs/en/api.get.tags.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param null|string|Smarty_Internal_Template $template diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettemplatevars.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettemplatevars.php index 9ef7d46b..0470785b 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettemplatevars.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_gettemplatevars.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_GetTemplateVars * Returns a single or all template variables * * @api Smarty::getTemplateVars() - * @link http://www.smarty.net/docs/en/api.get.template.vars.tpl + * @link https://www.smarty.net/docs/en/api.get.template.vars.tpl * * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data * @param string $varName variable name or null diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_loadfilter.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_loadfilter.php index 66d80d47..af788a24 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_loadfilter.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_loadfilter.php @@ -30,7 +30,7 @@ class Smarty_Internal_Method_LoadFilter * * @api Smarty::loadFilter() * - * @link http://www.smarty.net/docs/en/api.load.filter.tpl + * @link https://www.smarty.net/docs/en/api.load.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type filter type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registercacheresource.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registercacheresource.php index 64836561..5608b3fd 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registercacheresource.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registercacheresource.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_RegisterCacheResource * Registers a resource to fetch a template * * @api Smarty::registerCacheResource() - * @link http://www.smarty.net/docs/en/api.register.cacheresource.tpl + * @link https://www.smarty.net/docs/en/api.register.cacheresource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $name name of resource type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerclass.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerclass.php index 8d18547e..76a69c6e 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerclass.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerclass.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_RegisterClass * Registers static classes to be used in templates * * @api Smarty::registerClass() - * @link http://www.smarty.net/docs/en/api.register.class.tpl + * @link https://www.smarty.net/docs/en/api.register.class.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $class_name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php index a9fb78dc..4cda5b05 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerdefaultpluginhandler.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_RegisterDefaultPluginHandler * Registers a default plugin handler * * @api Smarty::registerDefaultPluginHandler() - * @link http://www.smarty.net/docs/en/api.register.default.plugin.handler.tpl + * @link https://www.smarty.net/docs/en/api.register.default.plugin.handler.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param callable $callback class/method name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerfilter.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerfilter.php index c0f9fff1..9719eb2b 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerfilter.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerfilter.php @@ -30,7 +30,7 @@ class Smarty_Internal_Method_RegisterFilter * * @api Smarty::registerFilter() * - * @link http://www.smarty.net/docs/en/api.register.filter.tpl + * @link https://www.smarty.net/docs/en/api.register.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type filter type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerobject.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerobject.php index 4646e4f2..8e6fe052 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerobject.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerobject.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_RegisterObject * Registers object to be used in templates * * @api Smarty::registerObject() - * @link http://www.smarty.net/docs/en/api.register.object.tpl + * @link https://www.smarty.net/docs/en/api.register.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $object_name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerplugin.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerplugin.php index ed18d84b..74c0ae90 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerplugin.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerplugin.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_RegisterPlugin * Registers plugin to be used in templates * * @api Smarty::registerPlugin() - * @link http://www.smarty.net/docs/en/api.register.plugin.tpl + * @link https://www.smarty.net/docs/en/api.register.plugin.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type plugin type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerresource.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerresource.php index 7c7d0f78..302657ae 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerresource.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_registerresource.php @@ -22,25 +22,18 @@ class Smarty_Internal_Method_RegisterResource * Registers a resource to fetch a template * * @api Smarty::registerResource() - * @link http://www.smarty.net/docs/en/api.register.resource.tpl + * @link https://www.smarty.net/docs/en/api.register.resource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $name name of resource type - * @param Smarty_Resource|array $resource_handler or instance of - * Smarty_Resource, - * or array of - * callbacks to - * handle - * resource - * (deprecated) + * @param Smarty_Resource $resource_handler instance of Smarty_Resource * * @return \Smarty|\Smarty_Internal_Template */ - public function registerResource(Smarty_Internal_TemplateBase $obj, $name, $resource_handler) + public function registerResource(Smarty_Internal_TemplateBase $obj, $name, Smarty_Resource $resource_handler) { $smarty = $obj->_getSmartyObj(); - $smarty->registered_resources[ $name ] = - $resource_handler instanceof Smarty_Resource ? $resource_handler : array($resource_handler, false); + $smarty->registered_resources[ $name ] = $resource_handler; return $obj; } } diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unloadfilter.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unloadfilter.php index 55e1596b..e41e8dff 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unloadfilter.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unloadfilter.php @@ -16,7 +16,7 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil * * @api Smarty::unloadFilter() * - * @link http://www.smarty.net/docs/en/api.unload.filter.tpl + * @link https://www.smarty.net/docs/en/api.unload.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type filter type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregistercacheresource.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregistercacheresource.php index b9990386..377397e9 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregistercacheresource.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregistercacheresource.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_UnregisterCacheResource * Registers a resource to fetch a template * * @api Smarty::unregisterCacheResource() - * @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl + * @link https://www.smarty.net/docs/en/api.unregister.cacheresource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param $name diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterfilter.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterfilter.php index 9cb494a5..ebc9337d 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterfilter.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterfilter.php @@ -16,7 +16,7 @@ class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_Reg * * @api Smarty::unregisterFilter() * - * @link http://www.smarty.net/docs/en/api.unregister.filter.tpl + * @link https://www.smarty.net/docs/en/api.unregister.filter.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type filter type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterobject.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterobject.php index 1e592b33..77d61963 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterobject.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterobject.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_UnregisterObject * Registers plugin to be used in templates * * @api Smarty::unregisterObject() - * @link http://www.smarty.net/docs/en/api.unregister.object.tpl + * @link https://www.smarty.net/docs/en/api.unregister.object.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $object_name name of object diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterplugin.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterplugin.php index f39e3167..2431d5c2 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterplugin.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterplugin.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_UnregisterPlugin * Registers plugin to be used in templates * * @api Smarty::unregisterPlugin() - * @link http://www.smarty.net/docs/en/api.unregister.plugin.tpl + * @link https://www.smarty.net/docs/en/api.unregister.plugin.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type plugin type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterresource.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterresource.php index a79db429..bbb6a861 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterresource.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_method_unregisterresource.php @@ -22,7 +22,7 @@ class Smarty_Internal_Method_UnregisterResource * Registers a resource to fetch a template * * @api Smarty::unregisterResource() - * @link http://www.smarty.net/docs/en/api.unregister.resource.tpl + * @link https://www.smarty.net/docs/en/api.unregister.resource.tpl * * @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj * @param string $type name of resource type diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_template.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_template.php index ab4c3ec3..829c420f 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_template.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_template.php @@ -87,83 +87,83 @@ public function to_smarty_php(Smarty_Internal_Templateparser $parser) $code = ''; foreach ($this->getChunkedSubtrees() as $chunk) { - $text = ''; - switch ($chunk['mode']) { - case 'textstripped': - foreach ($chunk['subtrees'] as $subtree) { - $text .= $subtree->to_smarty_php($parser); - } - $code .= preg_replace( - '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', - "\n", - $parser->compiler->processText($text) - ); - break; - case 'text': - foreach ($chunk['subtrees'] as $subtree) { - $text .= $subtree->to_smarty_php($parser); - } - $code .= preg_replace( - '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', - "\n", - $text - ); - break; - case 'tag': - foreach ($chunk['subtrees'] as $subtree) { - $text = $parser->compiler->appendCode($text, $subtree->to_smarty_php($parser)); - } - $code .= $text; - break; - default: - foreach ($chunk['subtrees'] as $subtree) { - $text = $subtree->to_smarty_php($parser); - } - $code .= $text; + $text = ''; + switch ($chunk['mode']) { + case 'textstripped': + foreach ($chunk['subtrees'] as $subtree) { + $text .= $subtree->to_smarty_php($parser); + } + $code .= preg_replace( + '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', + "\n", + $parser->compiler->processText($text) + ); + break; + case 'text': + foreach ($chunk['subtrees'] as $subtree) { + $text .= $subtree->to_smarty_php($parser); + } + $code .= preg_replace( + '/((<%)|(%>)|(<\?php)|(<\?)|(\?>)|(<\/?script))/', + "\n", + $text + ); + break; + case 'tag': + foreach ($chunk['subtrees'] as $subtree) { + $text = $parser->compiler->appendCode($text, $subtree->to_smarty_php($parser)); + } + $code .= $text; + break; + default: + foreach ($chunk['subtrees'] as $subtree) { + $text = $subtree->to_smarty_php($parser); + } + $code .= $text; - } + } } return $code; } private function getChunkedSubtrees() { - $chunks = array(); - $currentMode = null; - $currentChunk = array(); - for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) { + $chunks = array(); + $currentMode = null; + $currentChunk = array(); + for ($key = 0, $cnt = count($this->subtrees); $key < $cnt; $key++) { - if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, array('textstripped', 'text', 'tag'))) { - continue; - } + if ($this->subtrees[ $key ]->data === '' && in_array($currentMode, array('textstripped', 'text', 'tag'))) { + continue; + } - if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text - && $this->subtrees[ $key ]->isToBeStripped()) { - $newMode = 'textstripped'; - } elseif ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text) { - $newMode = 'text'; - } elseif ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Tag) { - $newMode = 'tag'; - } else { - $newMode = 'other'; - } + if ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text + && $this->subtrees[ $key ]->isToBeStripped()) { + $newMode = 'textstripped'; + } elseif ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Text) { + $newMode = 'text'; + } elseif ($this->subtrees[ $key ] instanceof Smarty_Internal_ParseTree_Tag) { + $newMode = 'tag'; + } else { + $newMode = 'other'; + } - if ($newMode == $currentMode) { - $currentChunk[] = $this->subtrees[ $key ]; - } else { - $chunks[] = array( - 'mode' => $currentMode, - 'subtrees' => $currentChunk - ); - $currentMode = $newMode; - $currentChunk = array($this->subtrees[ $key ]); - } - } - if ($currentMode && $currentChunk) { - $chunks[] = array( - 'mode' => $currentMode, - 'subtrees' => $currentChunk - ); - } - return $chunks; + if ($newMode == $currentMode) { + $currentChunk[] = $this->subtrees[ $key ]; + } else { + $chunks[] = array( + 'mode' => $currentMode, + 'subtrees' => $currentChunk + ); + $currentMode = $newMode; + $currentChunk = array($this->subtrees[ $key ]); + } + } + if ($currentMode && $currentChunk) { + $chunks[] = array( + 'mode' => $currentMode, + 'subtrees' => $currentChunk + ); + } + return $chunks; } } diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_text.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_text.php index 399e8494..58116c81 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_text.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_parsetree_text.php @@ -17,30 +17,30 @@ class Smarty_Internal_ParseTree_Text extends Smarty_Internal_ParseTree { - /** - * Wether this section should be stripped on output to smarty php - * @var bool - */ - private $toBeStripped = false; + /** + * Wether this section should be stripped on output to smarty php + * @var bool + */ + private $toBeStripped = false; - /** - * Create template text buffer - * - * @param string $data text - * @param bool $toBeStripped wether this section should be stripped on output to smarty php - */ + /** + * Create template text buffer + * + * @param string $data text + * @param bool $toBeStripped wether this section should be stripped on output to smarty php + */ public function __construct($data, $toBeStripped = false) { $this->data = $data; $this->toBeStripped = $toBeStripped; } - /** - * Wether this section should be stripped on output to smarty php - * @return bool - */ - public function isToBeStripped() { - return $this->toBeStripped; + /** + * Wether this section should be stripped on output to smarty php + * @return bool + */ + public function isToBeStripped() { + return $this->toBeStripped; } /** diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_registered.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_registered.php deleted file mode 100644 index df526101..00000000 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_registered.php +++ /dev/null @@ -1,101 +0,0 @@ -filepath = $source->type . ':' . $source->name; - $source->uid = sha1($source->filepath . $source->smarty->_joined_template_dir); - $source->timestamp = $this->getTemplateTimestamp($source); - $source->exists = !!$source->timestamp; - } - - /** - * populate Source Object with timestamp and exists from Resource - * - * @param Smarty_Template_Source $source source object - * - * @return void - */ - public function populateTimestamp(Smarty_Template_Source $source) - { - $source->timestamp = $this->getTemplateTimestamp($source); - $source->exists = !!$source->timestamp; - } - - /** - * Get timestamp (epoch) the template source was modified - * - * @param Smarty_Template_Source $source source object - * - * @return integer|boolean timestamp (epoch) the template was modified, false if resources has no timestamp - */ - public function getTemplateTimestamp(Smarty_Template_Source $source) - { - // return timestamp - $time_stamp = false; - call_user_func_array( - $source->smarty->registered_resources[ $source->type ][ 0 ][ 1 ], - array($source->name, &$time_stamp, $source->smarty) - ); - return is_numeric($time_stamp) ? (int)$time_stamp : $time_stamp; - } - - /** - * Load template's source by invoking the registered callback into current template object - * - * @param Smarty_Template_Source $source source object - * - * @return string template source - * @throws SmartyException if source cannot be loaded - */ - public function getContent(Smarty_Template_Source $source) - { - // return template string - $content = null; - $t = call_user_func_array( - $source->smarty->registered_resources[ $source->type ][ 0 ][ 0 ], - array($source->name, &$content, $source->smarty) - ); - if (is_bool($t) && !$t) { - throw new SmartyException("Unable to read template {$source->type} '{$source->name}'"); - } - return $content; - } - - /** - * Determine basename for compiled filename - * - * @param Smarty_Template_Source $source source object - * - * @return string resource's basename - */ - public function getBasename(Smarty_Template_Source $source) - { - return basename($source->name); - } -} diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_stream.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_stream.php index 9956bd07..5f020349 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_stream.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_resource_stream.php @@ -13,7 +13,7 @@ * Smarty Internal Plugin Resource Stream * Implements the streams as resource for Smarty template * - * @link http://php.net/streams + * @link https://php.net/streams * @package Smarty * @subpackage TemplateResources */ diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_runtime_codeframe.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_runtime_codeframe.php index 983ca618..b5361c9b 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_runtime_codeframe.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_runtime_codeframe.php @@ -45,7 +45,7 @@ public function create( $properties[ 'cache_lifetime' ] = $_template->cache_lifetime; } $output = "source->filepath) . "' */\n\n"; $output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n"; $dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' . diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatebase.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatebase.php index 200c11bb..2ffb896f 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatebase.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatebase.php @@ -138,7 +138,7 @@ public function display($template = null, $cache_id = null, $compile_id = null, * test if cache is valid * * @api Smarty::isCached() - * @link http://www.smarty.net/docs/en/api.is.cached.tpl + * @link https://www.smarty.net/docs/en/api.is.cached.tpl * * @param null|string|\Smarty_Internal_Template $template the resource handle of the template file or template * object @@ -199,6 +199,12 @@ private function _execute($template, $cache_id, $compile_id, $parent, $function) try { $_smarty_old_error_level = isset($smarty->error_reporting) ? error_reporting($smarty->error_reporting) : null; + + if ($smarty->isMutingUndefinedOrNullWarnings()) { + $errorHandler = new Smarty_Internal_ErrorHandler(); + $errorHandler->activate(); + } + if ($this->_objType === 2) { /* @var Smarty_Internal_Template $this */ $template->tplFunctions = $this->tplFunctions; @@ -242,6 +248,11 @@ private function _execute($template, $cache_id, $compile_id, $parent, $function) } } } + + if (isset($errorHandler)) { + $errorHandler->deactivate(); + } + if (isset($_smarty_old_error_level)) { error_reporting($_smarty_old_error_level); } @@ -250,6 +261,10 @@ private function _execute($template, $cache_id, $compile_id, $parent, $function) while (ob_get_level() > $level) { ob_end_clean(); } + if (isset($errorHandler)) { + $errorHandler->deactivate(); + } + if (isset($_smarty_old_error_level)) { error_reporting($_smarty_old_error_level); } @@ -261,7 +276,7 @@ private function _execute($template, $cache_id, $compile_id, $parent, $function) * Registers plugin to be used in templates * * @api Smarty::registerPlugin() - * @link http://www.smarty.net/docs/en/api.register.plugin.tpl + * @link https://www.smarty.net/docs/en/api.register.plugin.tpl * * @param string $type plugin type * @param string $name name of template tag @@ -281,7 +296,7 @@ public function registerPlugin($type, $name, $callback, $cacheable = true, $cach * load a filter of specified type and name * * @api Smarty::loadFilter() - * @link http://www.smarty.net/docs/en/api.load.filter.tpl + * @link https://www.smarty.net/docs/en/api.load.filter.tpl * * @param string $type filter type * @param string $name filter name @@ -298,7 +313,7 @@ public function loadFilter($type, $name) * Registers a filter function * * @api Smarty::registerFilter() - * @link http://www.smarty.net/docs/en/api.register.filter.tpl + * @link https://www.smarty.net/docs/en/api.register.filter.tpl * * @param string $type filter type * @param callable $callback @@ -316,7 +331,7 @@ public function registerFilter($type, $callback, $name = null) * Registers object to be used in templates * * @api Smarty::registerObject() - * @link http://www.smarty.net/docs/en/api.register.object.tpl + * @link https://www.smarty.net/docs/en/api.register.object.tpl * * @param string $object_name * @param object $object the referenced PHP object to register diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php index 3cc957de..27261614 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatecompilerbase.php @@ -203,13 +203,6 @@ abstract class Smarty_Internal_TemplateCompilerBase */ public $blockOrFunctionCode = ''; - /** - * php_handling setting either from Smarty or security - * - * @var int - */ - public $php_handling = 0; - /** * flags for used modifier plugins * @@ -438,11 +431,6 @@ public function compileTemplateSource( } $this->smarty->_debug->start_compile($this->template); } - if (isset($this->template->smarty->security_policy)) { - $this->php_handling = $this->template->smarty->security_policy->php_handling; - } else { - $this->php_handling = $this->template->smarty->php_handling; - } $this->parent_compiler = $parent_compiler ? $parent_compiler : $this; $nocache = isset($nocache) ? $nocache : false; if (empty($template->compiled->nocache_hash)) { @@ -627,11 +615,11 @@ public function compilePHPFunctionCall($name, $parameter) $this->trigger_template_error('Illegal number of parameter in "isset()"'); } - $pa = array(); - foreach ($parameter as $p) { - $pa[] = $this->syntaxMatchesVariable($p) ? 'isset(' . $p . ')' : '(' . $p . ' !== null )'; - } - return '(' . implode(' && ', $pa) . ')'; + $pa = array(); + foreach ($parameter as $p) { + $pa[] = $this->syntaxMatchesVariable($p) ? 'isset(' . $p . ')' : '(' . $p . ' !== null )'; + } + return '(' . implode(' && ', $pa) . ')'; } elseif (in_array( $func_name, @@ -649,12 +637,8 @@ public function compilePHPFunctionCall($name, $parameter) $this->trigger_template_error("Illegal number of parameter in '{$func_name()}'"); } if ($func_name === 'empty') { - if (!$this->syntaxMatchesVariable($parameter[0]) && version_compare(PHP_VERSION, '5.5.0', '<')) { - return '(' . $parameter[ 0 ] . ' === false )'; - } else { - return $func_name . '(' . - str_replace("')->value", "',null,true,false)->value", $parameter[ 0 ]) . ')'; - } + return $func_name . '(' . + str_replace("')->value", "',null,true,false)->value", $parameter[ 0 ]) . ')'; } else { return $func_name . '(' . $parameter[ 0 ] . ')'; } @@ -667,16 +651,16 @@ public function compilePHPFunctionCall($name, $parameter) } } - /** - * Determines whether the passed string represents a valid (PHP) variable. - * This is important, because `isset()` only works on variables and `empty()` can only be passed - * a variable prior to php5.5 - * @param $string - * @return bool - */ - private function syntaxMatchesVariable($string) { - static $regex_pattern = '/^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*((->)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|\[.*]*\])*$/'; - return 1 === preg_match($regex_pattern, trim($string)); + /** + * Determines whether the passed string represents a valid (PHP) variable. + * This is important, because `isset()` only works on variables and `empty()` can only be passed + * a variable prior to php5.5 + * @param $string + * @return bool + */ + private function syntaxMatchesVariable($string) { + static $regex_pattern = '/^\$[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*((->)[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*|\[.*]*\])*$/'; + return 1 === preg_match($regex_pattern, trim($string)); } /** @@ -691,11 +675,11 @@ public function processText($text) { if (strpos($text, '<') === false) { - return preg_replace($this->stripRegEx, '', $text); + return preg_replace($this->stripRegEx, '', $text); } - $store = array(); - $_store = 0; + $store = array(); + $_store = 0; // capture html elements not to be messed with $_offset = 0; @@ -1151,7 +1135,7 @@ public function trigger_template_error($args = null, $line = null, $tagline = nu flush(); } $e = new SmartyCompilerException($error_text); - $e->line = $line; + $e->setLine($line); $e->source = trim(preg_replace('![\t\r\n]+!', ' ', $match[ $line - 1 ])); $e->desc = $args; $e->template = $this->template->source->filepath; diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatelexer.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatelexer.php index 867a31d2..5ca48205 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatelexer.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templatelexer.php @@ -18,12 +18,6 @@ */ class Smarty_Internal_Templatelexer { - const TEXT = 1; - const TAG = 2; - const TAGBODY = 3; - const LITERAL = 4; - const DOUBLEQUOTEDSTRING = 5; - /** * Source * @@ -80,7 +74,7 @@ class Smarty_Internal_Templatelexer */ public $phpType = ''; - /** + /** * state number * * @var int @@ -229,10 +223,6 @@ class Smarty_Internal_Templatelexer */ private $yy_global_literal = null; - private $_yy_state = 1; - - private $_yy_stack = array(); - /** * constructor * @@ -245,14 +235,14 @@ public function __construct($source, Smarty_Internal_TemplateCompilerBase $compi $this->dataLength = strlen($this->data); $this->counter = 0; if (preg_match('/^\xEF\xBB\xBF/i', $this->data, $match)) { - $this->counter += strlen($match[ 0 ]); + $this->counter += strlen($match[0]); } $this->line = 1; $this->smarty = $compiler->template->smarty; $this->compiler = $compiler; $this->compiler->initDelimiterPreg(); - $this->smarty_token_names[ 'LDEL' ] = $this->smarty->getLeftDelimiter(); - $this->smarty_token_names[ 'RDEL' ] = $this->smarty->getRightDelimiter(); + $this->smarty_token_names['LDEL'] = $this->smarty->getLeftDelimiter(); + $this->smarty_token_names['RDEL'] = $this->smarty->getRightDelimiter(); } /** @@ -265,17 +255,17 @@ public function PrintTrace() $this->yyTracePrompt = '
'; } - /** + /** * replace placeholders with runtime preg code * * @param string $preg * * @return string */ - public function replace($preg) - { + public function replace($preg) + { return $this->compiler->replaceDelimiter($preg); - } + } /** * check if current value is an autoliteral left delimiter @@ -286,7 +276,11 @@ public function isAutoLiteral() { return $this->smarty->getAutoLiteral() && isset($this->value[ $this->compiler->getLdelLength() ]) ? strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false; - } // end function + } + + + private $_yy_state = 1; + private $_yy_stack = array(); public function yylex() { @@ -296,62 +290,60 @@ public function yylex() public function yypushstate($state) { if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); + fprintf($this->yyTraceFILE, "%sState push %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); } array_push($this->_yy_stack, $this->_yy_state); $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); } } public function yypopstate() { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); + if ($this->yyTraceFILE) { + fprintf($this->yyTraceFILE, "%sState pop %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); } - $this->_yy_state = array_pop($this->_yy_stack); + $this->_yy_state = array_pop($this->_yy_stack); if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); + fprintf($this->yyTraceFILE, "%snew State %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); } + } public function yybegin($state) { - $this->_yy_state = $state; + $this->_yy_state = $state; if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, - isset($this->state_name[ $this->_yy_state ]) ? $this->state_name[ $this->_yy_state ] : $this->_yy_state); + fprintf($this->yyTraceFILE, "%sState set %s\n", $this->yyTracePrompt, isset($this->state_name[$this->_yy_state]) ? $this->state_name[$this->_yy_state] : $this->_yy_state); } } + + public function yylex1() { if (!isset($this->yy_global_pattern1)) { - $this->yy_global_pattern1 = - $this->replace("/\G([{][}])|\G((SMARTYldel)SMARTYal[*])|\G((SMARTYldel)SMARTYalphp([ ].*?)?SMARTYrdel|(SMARTYldel)SMARTYal[\/]phpSMARTYrdel)|\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([<][?]((php\\s+|=)|\\s+)|[<][%]|[<][?]xml\\s+|[<]script\\s+language\\s*=\\s*[\"']?\\s*php\\s*[\"']?\\s*[>]|[?][>]|[%][>])|\G([\S\s])/isS"); + $this->yy_global_pattern1 = $this->replace("/\G([{][}])|\G((SMARTYldel)SMARTYal[*])|\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); } - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } + do { - if (preg_match($this->yy_global_pattern1, $this->data, $yymatches, 0, $this->counter)) { - if (!isset($yymatches[ 0 ][ 1 ])) { - $yymatches = preg_grep("/(.|\s)+/", $yymatches); + if (preg_match($this->yy_global_pattern1,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); } else { $yymatches = array_filter($yymatches); } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TEXT'); + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TEXT'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -369,110 +361,102 @@ public function yylex1() } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } // skip this token continue; - } - } else { - throw new Exception('Unexpected input at line ' . $this->line . - ': ' . $this->data[ $this->counter ]); + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); } break; } while (true); - } + } // end function + + + const TEXT = 1; public function yy_r1_1() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r1_2() { - $to = $this->dataLength; - preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/", $this->data, $match, PREG_OFFSET_CAPTURE, - $this->counter); - if (isset($match[ 0 ][ 1 ])) { - $to = $match[ 0 ][ 1 ] + strlen($match[ 0 ][ 0 ]); + + $to = $this->dataLength; + preg_match("/[*]{$this->compiler->getRdelPreg()}[\n]?/",$this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1] + strlen($match[0][0]); } else { - $this->compiler->trigger_template_error("missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'"); + $this->compiler->trigger_template_error ("missing or misspelled comment closing tag '{$this->smarty->getRightDelimiter()}'"); } - $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->value = substr($this->data,$this->counter,$to-$this->counter); return false; - } - + } public function yy_r1_4() { - $this->compiler->getTagCompiler('private_php')->parsePhp($this); - } - public function yy_r1_8() - { $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } - - public function yy_r1_10() + } + public function yy_r1_6() { + $this->token = Smarty_Internal_Templateparser::TP_LITERALSTART; $this->yypushstate(self::LITERAL); - } - - public function yy_r1_12() + } + public function yy_r1_8() { + $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; $this->yypushstate(self::LITERAL); - } // end function - - public function yy_r1_14() + } + public function yy_r1_10() { + $this->yypushstate(self::TAG); return true; - } - - public function yy_r1_16() + } + public function yy_r1_12() { - $this->compiler->getTagCompiler('private_php')->parsePhp($this); - } - public function yy_r1_19() - { - if (!isset($this->yy_global_text)) { - $this->yy_global_text = - $this->replace('/(SMARTYldel)SMARTYal|[<][?]((php\s+|=)|\s+)|[<][%]|[<][?]xml\s+|[<]script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*[>]|[?][>]|[%][>]SMARTYliteral/isS'); - } - $to = $this->dataLength; - preg_match($this->yy_global_text, $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); - if (isset($match[ 0 ][ 1 ])) { - $to = $match[ 0 ][ 1 ]; - } - $this->value = substr($this->data, $this->counter, $to - $this->counter); - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + if (!isset($this->yy_global_text)) { + $this->yy_global_text = $this->replace('/(SMARTYldel)SMARTYal/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_text, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } + public function yylex2() { if (!isset($this->yy_global_pattern2)) { - $this->yy_global_pattern2 = - $this->replace("/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYalmake_nocache\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$]smarty\\.block\\.(child|parent)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/][0-9]*[a-zA-Z_]\\w*\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS"); + $this->yy_global_pattern2 = $this->replace("/\G((SMARTYldel)SMARTYal(if|elseif|else if|while)\\s+)|\G((SMARTYldel)SMARTYalfor\\s+)|\G((SMARTYldel)SMARTYalforeach(?![^\s]))|\G((SMARTYldel)SMARTYalsetfilter\\s+)|\G((SMARTYldel)SMARTYalmake_nocache\\s+)|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$]smarty\\.block\\.(child|parent)\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/][0-9]*[a-zA-Z_]\\w*\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[$][0-9]*[a-zA-Z_]\\w*(\\s+nocache)?\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal)/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); } - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } + do { - if (preg_match($this->yy_global_pattern2, $this->data, $yymatches, 0, $this->counter)) { - if (!isset($yymatches[ 0 ][ 1 ])) { - $yymatches = preg_grep("/(.|\s)+/", $yymatches); + if (preg_match($this->yy_global_pattern2,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); } else { $yymatches = array_filter($yymatches); } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TAG'); + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TAG'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -490,79 +474,82 @@ public function yylex2() } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } // skip this token continue; - } - } else { - throw new Exception('Unexpected input at line ' . $this->line . - ': ' . $this->data[ $this->counter ]); + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); } break; } while (true); - } + } // end function + + + const TAG = 2; public function yy_r2_1() { + $this->token = Smarty_Internal_Templateparser::TP_LDELIF; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_4() { + $this->token = Smarty_Internal_Templateparser::TP_LDELFOR; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_6() { + $this->token = Smarty_Internal_Templateparser::TP_LDELFOREACH; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_8() { + $this->token = Smarty_Internal_Templateparser::TP_LDELSETFILTER; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_10() { + $this->token = Smarty_Internal_Templateparser::TP_LDELMAKENOCACHE; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_12() { + $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_SIMPLETAG; $this->taglineno = $this->line; - } - + } public function yy_r2_15() { - $this->yypopstate(); - $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; - $this->taglineno = $this->line; - } + $this->yypopstate(); + $this->token = Smarty_Internal_Templateparser::TP_SMARTYBLOCKCHILDPARENT; + $this->taglineno = $this->line; + } public function yy_r2_18() { + $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_CLOSETAG; $this->taglineno = $this->line; - } - + } public function yy_r2_20() { - if ($this->_yy_stack[ count($this->_yy_stack) - 1 ] === self::TEXT) { + + if ($this->_yy_stack[count($this->_yy_stack)-1] === self::TEXT) { $this->yypopstate(); $this->token = Smarty_Internal_Templateparser::TP_SIMPELOUTPUT; $this->taglineno = $this->line; @@ -572,45 +559,46 @@ public function yy_r2_20() $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; } - } // end function - + } public function yy_r2_23() { + $this->token = Smarty_Internal_Templateparser::TP_LDELSLASH; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r2_25() { + $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->yybegin(self::TAGBODY); $this->taglineno = $this->line; - } + } + public function yylex3() { if (!isset($this->yy_global_pattern3)) { - $this->yy_global_pattern3 = - $this->replace("/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); + $this->yy_global_pattern3 = $this->replace("/\G(\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G('[^'\\\\]*(?:\\\\.[^'\\\\]*)*')|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(\\s+is\\s+in\\s+)|\G(\\s+as\\s+)|\G(\\s+to\\s+)|\G(\\s+step\\s+)|\G(\\s+instanceof\\s+)|\G(\\s*([!=][=]{1,2}|[<][=>]?|[>][=]?|[&|]{2})\\s*)|\G(\\s+(eq|ne|neq|gt|ge|gte|lt|le|lte|mod|and|or|xor)\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even|div)\\s+by\\s+)|\G(\\s+is\\s+(not\\s+)?(odd|even))|\G([!]\\s*|not\\s+)|\G([(](int(eger)?|bool(ean)?|float|double|real|string|binary|array|object)[)]\\s*)|\G(\\s*[(]\\s*)|\G(\\s*[)])|\G(\\[\\s*)|\G(\\s*\\])|\G(\\s*[-][>]\\s*)|\G(\\s*[=][>]\\s*)|\G(\\s*[=]\\s*)|\G(([+]|[-]){2})|\G(\\s*([+]|[-])\\s*)|\G(\\s*([*]{1,2}|[%\/^&]|[<>]{2})\\s*)|\G([@])|\G(array\\s*[(]\\s*)|\G([#])|\G(\\s+[0-9]*[a-zA-Z_][a-zA-Z0-9_\-:]*\\s*[=]\\s*)|\G(([0-9]*[a-zA-Z_]\\w*)?(\\\\[0-9]*[a-zA-Z_]\\w*)+)|\G([0-9]*[a-zA-Z_]\\w*)|\G(\\d+)|\G([`])|\G([|][@]?)|\G([.])|\G(\\s*[,]\\s*)|\G(\\s*[;]\\s*)|\G([:]{2})|\G(\\s*[:]\\s*)|\G(\\s*[?]\\s*)|\G(0[xX][0-9a-fA-F]+)|\G(\\s+)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); } - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } + do { - if (preg_match($this->yy_global_pattern3, $this->data, $yymatches, 0, $this->counter)) { - if (!isset($yymatches[ 0 ][ 1 ])) { - $yymatches = preg_grep("/(.|\s)+/", $yymatches); + if (preg_match($this->yy_global_pattern3,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); } else { $yymatches = array_filter($yymatches); } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state TAGBODY'); + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state TAGBODY'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -628,281 +616,285 @@ public function yylex3() } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } // skip this token continue; - } - } else { - throw new Exception('Unexpected input at line ' . $this->line . - ': ' . $this->data[ $this->counter ]); + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); } break; } while (true); - } + } // end function + + + const TAGBODY = 3; public function yy_r3_1() { + $this->token = Smarty_Internal_Templateparser::TP_RDEL; $this->yypopstate(); - } - + } public function yy_r3_2() { + $this->yypushstate(self::TAG); return true; - } - + } public function yy_r3_4() { + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypushstate(self::DOUBLEQUOTEDSTRING); $this->compiler->enterDoubleQuote(); - } - + } public function yy_r3_5() { - $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; - } + $this->token = Smarty_Internal_Templateparser::TP_SINGLEQUOTESTRING; + } public function yy_r3_6() { - $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; - } + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; + } public function yy_r3_7() { - $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; - } + $this->token = Smarty_Internal_Templateparser::TP_DOLLAR; + } public function yy_r3_8() { - $this->token = Smarty_Internal_Templateparser::TP_ISIN; - } + $this->token = Smarty_Internal_Templateparser::TP_ISIN; + } public function yy_r3_9() { - $this->token = Smarty_Internal_Templateparser::TP_AS; - } + $this->token = Smarty_Internal_Templateparser::TP_AS; + } public function yy_r3_10() { - $this->token = Smarty_Internal_Templateparser::TP_TO; - } + $this->token = Smarty_Internal_Templateparser::TP_TO; + } public function yy_r3_11() { - $this->token = Smarty_Internal_Templateparser::TP_STEP; - } + $this->token = Smarty_Internal_Templateparser::TP_STEP; + } public function yy_r3_12() { - $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; - } + $this->token = Smarty_Internal_Templateparser::TP_INSTANCEOF; + } public function yy_r3_13() { - $this->token = Smarty_Internal_Templateparser::TP_LOGOP; - } + $this->token = Smarty_Internal_Templateparser::TP_LOGOP; + } public function yy_r3_15() { - $this->token = Smarty_Internal_Templateparser::TP_SLOGOP; - } + $this->token = Smarty_Internal_Templateparser::TP_SLOGOP; + } public function yy_r3_17() { - $this->token = Smarty_Internal_Templateparser::TP_TLOGOP; - } + $this->token = Smarty_Internal_Templateparser::TP_TLOGOP; + } public function yy_r3_20() { - $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND; - } + $this->token = Smarty_Internal_Templateparser::TP_SINGLECOND; + } public function yy_r3_23() { - $this->token = Smarty_Internal_Templateparser::TP_NOT; - } + $this->token = Smarty_Internal_Templateparser::TP_NOT; + } public function yy_r3_24() { - $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; - } + $this->token = Smarty_Internal_Templateparser::TP_TYPECAST; + } public function yy_r3_28() { - $this->token = Smarty_Internal_Templateparser::TP_OPENP; - } + $this->token = Smarty_Internal_Templateparser::TP_OPENP; + } public function yy_r3_29() { - $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; - } + $this->token = Smarty_Internal_Templateparser::TP_CLOSEP; + } public function yy_r3_30() { - $this->token = Smarty_Internal_Templateparser::TP_OPENB; - } + $this->token = Smarty_Internal_Templateparser::TP_OPENB; + } public function yy_r3_31() { - $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; - } + $this->token = Smarty_Internal_Templateparser::TP_CLOSEB; + } public function yy_r3_32() { - $this->token = Smarty_Internal_Templateparser::TP_PTR; - } + $this->token = Smarty_Internal_Templateparser::TP_PTR; + } public function yy_r3_33() { - $this->token = Smarty_Internal_Templateparser::TP_APTR; - } + $this->token = Smarty_Internal_Templateparser::TP_APTR; + } public function yy_r3_34() { - $this->token = Smarty_Internal_Templateparser::TP_EQUAL; - } + $this->token = Smarty_Internal_Templateparser::TP_EQUAL; + } public function yy_r3_35() { - $this->token = Smarty_Internal_Templateparser::TP_INCDEC; - } + $this->token = Smarty_Internal_Templateparser::TP_INCDEC; + } public function yy_r3_37() { - $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; - } + $this->token = Smarty_Internal_Templateparser::TP_UNIMATH; + } public function yy_r3_39() { - $this->token = Smarty_Internal_Templateparser::TP_MATH; - } + $this->token = Smarty_Internal_Templateparser::TP_MATH; + } public function yy_r3_41() { - $this->token = Smarty_Internal_Templateparser::TP_AT; - } + $this->token = Smarty_Internal_Templateparser::TP_AT; + } public function yy_r3_42() { - $this->token = Smarty_Internal_Templateparser::TP_ARRAYOPEN; - } + $this->token = Smarty_Internal_Templateparser::TP_ARRAYOPEN; + } public function yy_r3_43() { - $this->token = Smarty_Internal_Templateparser::TP_HATCH; - } + $this->token = Smarty_Internal_Templateparser::TP_HATCH; + } public function yy_r3_44() { + // resolve conflicts with shorttag and right_delimiter starting with '=' - if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === - $this->smarty->getRightDelimiter()) { - preg_match('/\s+/', $this->value, $match); - $this->value = $match[ 0 ]; + if (substr($this->data, $this->counter + strlen($this->value) - 1, $this->compiler->getRdelLength()) === $this->smarty->getRightDelimiter()) { + preg_match('/\s+/',$this->value,$match); + $this->value = $match[0]; $this->token = Smarty_Internal_Templateparser::TP_SPACE; } else { $this->token = Smarty_Internal_Templateparser::TP_ATTR; } - } - + } public function yy_r3_45() { - $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE; - } + $this->token = Smarty_Internal_Templateparser::TP_NAMESPACE; + } public function yy_r3_48() { - $this->token = Smarty_Internal_Templateparser::TP_ID; - } + $this->token = Smarty_Internal_Templateparser::TP_ID; + } public function yy_r3_49() { - $this->token = Smarty_Internal_Templateparser::TP_INTEGER; - } + $this->token = Smarty_Internal_Templateparser::TP_INTEGER; + } public function yy_r3_50() { + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; $this->yypopstate(); - } - + } public function yy_r3_51() { - $this->token = Smarty_Internal_Templateparser::TP_VERT; - } + $this->token = Smarty_Internal_Templateparser::TP_VERT; + } public function yy_r3_52() { - $this->token = Smarty_Internal_Templateparser::TP_DOT; - } + $this->token = Smarty_Internal_Templateparser::TP_DOT; + } public function yy_r3_53() { - $this->token = Smarty_Internal_Templateparser::TP_COMMA; - } + $this->token = Smarty_Internal_Templateparser::TP_COMMA; + } public function yy_r3_54() { - $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; - } + $this->token = Smarty_Internal_Templateparser::TP_SEMICOLON; + } public function yy_r3_55() { - $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; - } + $this->token = Smarty_Internal_Templateparser::TP_DOUBLECOLON; + } public function yy_r3_56() { - $this->token = Smarty_Internal_Templateparser::TP_COLON; - } + $this->token = Smarty_Internal_Templateparser::TP_COLON; + } public function yy_r3_57() { - $this->token = Smarty_Internal_Templateparser::TP_QMARK; - } + $this->token = Smarty_Internal_Templateparser::TP_QMARK; + } public function yy_r3_58() { - $this->token = Smarty_Internal_Templateparser::TP_HEX; - } + $this->token = Smarty_Internal_Templateparser::TP_HEX; + } public function yy_r3_59() { - $this->token = Smarty_Internal_Templateparser::TP_SPACE; - } // end function + $this->token = Smarty_Internal_Templateparser::TP_SPACE; + } public function yy_r3_60() { + $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + } + + public function yylex4() { if (!isset($this->yy_global_pattern4)) { - $this->yy_global_pattern4 = - $this->replace("/\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G([\S\s])/isS"); + $this->yy_global_pattern4 = $this->replace("/\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); } - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } + do { - if (preg_match($this->yy_global_pattern4, $this->data, $yymatches, 0, $this->counter)) { - if (!isset($yymatches[ 0 ][ 1 ])) { - $yymatches = preg_grep("/(.|\s)+/", $yymatches); + if (preg_match($this->yy_global_pattern4,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); } else { $yymatches = array_filter($yymatches); } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state LITERAL'); + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state LITERAL'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -920,76 +912,80 @@ public function yylex4() } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } // skip this token continue; - } - } else { - throw new Exception('Unexpected input at line ' . $this->line . - ': ' . $this->data[ $this->counter ]); + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); } break; } while (true); - } + } // end function + + + const LITERAL = 4; public function yy_r4_1() { + $this->literal_cnt++; $this->token = Smarty_Internal_Templateparser::TP_LITERAL; - } - + } public function yy_r4_3() { + if ($this->literal_cnt) { - $this->literal_cnt--; + $this->literal_cnt--; $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } else { $this->token = Smarty_Internal_Templateparser::TP_LITERALEND; $this->yypopstate(); } - } - + } public function yy_r4_5() { - if (!isset($this->yy_global_literal)) { - $this->yy_global_literal = $this->replace('/(SMARTYldel)SMARTYal[\/]?literalSMARTYrdel/isS'); - } - $to = $this->dataLength; - preg_match($this->yy_global_literal, $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); - if (isset($match[ 0 ][ 1 ])) { - $to = $match[ 0 ][ 1 ]; - } else { - $this->compiler->trigger_template_error("missing or misspelled literal closing tag"); - } - $this->value = substr($this->data, $this->counter, $to - $this->counter); - $this->token = Smarty_Internal_Templateparser::TP_LITERAL; - } // end function + if (!isset($this->yy_global_literal)) { + $this->yy_global_literal = $this->replace('/(SMARTYldel)SMARTYal[\/]?literalSMARTYrdel/isS'); + } + $to = $this->dataLength; + preg_match($this->yy_global_literal, $this->data,$match,PREG_OFFSET_CAPTURE,$this->counter); + if (isset($match[0][1])) { + $to = $match[0][1]; + } else { + $this->compiler->trigger_template_error ("missing or misspelled literal closing tag"); + } + $this->value = substr($this->data,$this->counter,$to-$this->counter); + $this->token = Smarty_Internal_Templateparser::TP_LITERAL; + } + + public function yylex5() { if (!isset($this->yy_global_pattern5)) { - $this->yy_global_pattern5 = - $this->replace("/\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\$|`\\$|\"SMARTYliteral)))|\G([\S\s])/isS"); + $this->yy_global_pattern5 = $this->replace("/\G((SMARTYldel)SMARTYautoliteral\\s+SMARTYliteral)|\G((SMARTYldel)SMARTYalliteral\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/]literal\\s*SMARTYrdel)|\G((SMARTYldel)SMARTYal[\/])|\G((SMARTYldel)SMARTYal[0-9]*[a-zA-Z_]\\w*)|\G((SMARTYldel)SMARTYal)|\G([\"])|\G([`][$])|\G([$][0-9]*[a-zA-Z_]\\w*)|\G([$])|\G(([^\"\\\\]*?)((?:\\\\.[^\"\\\\]*?)*?)(?=((SMARTYldel)SMARTYal|\\$|`\\$|\"SMARTYliteral)))|\G([\S\s])/isS"); } if (!isset($this->dataLength)) { $this->dataLength = strlen($this->data); } - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } + do { - if (preg_match($this->yy_global_pattern5, $this->data, $yymatches, 0, $this->counter)) { - if (!isset($yymatches[ 0 ][ 1 ])) { - $yymatches = preg_grep("/(.|\s)+/", $yymatches); + if (preg_match($this->yy_global_pattern5,$this->data, $yymatches, 0, $this->counter)) { + if (!isset($yymatches[ 0 ][1])) { + $yymatches = preg_grep("/(.|\s)+/", $yymatches); } else { $yymatches = array_filter($yymatches); } if (empty($yymatches)) { throw new Exception('Error: lexing failed because a rule matched' . - ' an empty string. Input "' . substr($this->data, - $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); + ' an empty string. Input "' . substr($this->data, + $this->counter, 5) . '... state DOUBLEQUOTEDSTRING'); } next($yymatches); // skip global match $this->token = key($yymatches); // token number @@ -1007,89 +1003,93 @@ public function yylex5() } elseif ($r === false) { $this->counter += strlen($this->value); $this->line += substr_count($this->value, "\n"); - if ($this->counter >= $this->dataLength) { + if ($this->counter >= $this->dataLength) { return false; // end of input } // skip this token continue; - } - } else { - throw new Exception('Unexpected input at line ' . $this->line . - ': ' . $this->data[ $this->counter ]); + } } else { + throw new Exception('Unexpected input at line' . $this->line . + ': ' . $this->data[$this->counter]); } break; } while (true); - } + } // end function + + + const DOUBLEQUOTEDSTRING = 5; public function yy_r5_1() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r5_3() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r5_5() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r5_7() { + $this->yypushstate(self::TAG); return true; - } - + } public function yy_r5_9() { + $this->yypushstate(self::TAG); return true; - } - + } public function yy_r5_11() { + $this->token = Smarty_Internal_Templateparser::TP_LDEL; $this->taglineno = $this->line; $this->yypushstate(self::TAGBODY); - } - + } public function yy_r5_13() { + $this->token = Smarty_Internal_Templateparser::TP_QUOTE; $this->yypopstate(); - } - + } public function yy_r5_14() { + $this->token = Smarty_Internal_Templateparser::TP_BACKTICK; - $this->value = substr($this->value, 0, -1); + $this->value = substr($this->value,0,-1); $this->yypushstate(self::TAGBODY); $this->taglineno = $this->line; - } - + } public function yy_r5_15() { - $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; - } + $this->token = Smarty_Internal_Templateparser::TP_DOLLARID; + } public function yy_r5_16() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r5_17() { - $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } + $this->token = Smarty_Internal_Templateparser::TP_TEXT; + } public function yy_r5_22() { + $to = $this->dataLength; - $this->value = substr($this->data, $this->counter, $to - $this->counter); + $this->value = substr($this->data,$this->counter,$to-$this->counter); $this->token = Smarty_Internal_Templateparser::TP_TEXT; - } -} + } - + } + + \ No newline at end of file diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templateparser.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templateparser.php index aaeae63b..a2dd0d6f 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_templateparser.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_templateparser.php @@ -7,1598 +7,25 @@ class TP_yyStackEntry ** number for the token at this stack level */ public $minor; /* The user-supplied minor token value. This ** is the value of the token */ -} +}; + // line 11 "../smarty/lexer/smarty_internal_templateparser.y" /** - * Smarty Template Parser Class - * - * This is the template parser. - * It is generated from the smarty_internal_templateparser.y file - * - * @author Uwe Tews - */ +* Smarty Template Parser Class +* +* This is the template parser. +* It is generated from the smarty_internal_templateparser.y file +* +* @author Uwe Tews +*/ class Smarty_Internal_Templateparser { - // line 23 "../smarty/lexer/smarty_internal_templateparser.y" - const ERR1 = 'Security error: Call to private object member not allowed'; - const ERR2 = 'Security error: Call to dynamic object member not allowed'; - const ERR3 = 'PHP in template not allowed. Use SmartyBC to enable it'; - const TP_VERT = 1; - const TP_COLON = 2; - const TP_PHP = 3; - const TP_TEXT = 4; - const TP_STRIPON = 5; - const TP_STRIPOFF = 6; - const TP_LITERALSTART = 7; - const TP_LITERALEND = 8; - const TP_LITERAL = 9; - const TP_SIMPELOUTPUT = 10; - const TP_SIMPLETAG = 11; - const TP_SMARTYBLOCKCHILDPARENT = 12; - const TP_LDEL = 13; - const TP_RDEL = 14; - const TP_DOLLARID = 15; - const TP_EQUAL = 16; - const TP_ID = 17; - const TP_PTR = 18; - const TP_LDELMAKENOCACHE = 19; - const TP_LDELIF = 20; - const TP_LDELFOR = 21; - const TP_SEMICOLON = 22; - const TP_INCDEC = 23; - const TP_TO = 24; - const TP_STEP = 25; - const TP_LDELFOREACH = 26; - const TP_SPACE = 27; - const TP_AS = 28; - const TP_APTR = 29; - const TP_LDELSETFILTER = 30; - const TP_CLOSETAG = 31; - const TP_LDELSLASH = 32; - const TP_ATTR = 33; - const TP_INTEGER = 34; - const TP_COMMA = 35; - const TP_OPENP = 36; - const TP_CLOSEP = 37; - const TP_MATH = 38; - const TP_UNIMATH = 39; - const TP_ISIN = 40; - const TP_QMARK = 41; - const TP_NOT = 42; - const TP_TYPECAST = 43; - const TP_HEX = 44; - const TP_DOT = 45; - const TP_INSTANCEOF = 46; - const TP_SINGLEQUOTESTRING = 47; - const TP_DOUBLECOLON = 48; - const TP_NAMESPACE = 49; - const TP_AT = 50; - const TP_HATCH = 51; - const TP_OPENB = 52; - const TP_CLOSEB = 53; - const TP_DOLLAR = 54; - const TP_LOGOP = 55; - const TP_SLOGOP = 56; - const TP_TLOGOP = 57; - const TP_SINGLECOND = 58; - const TP_ARRAYOPEN = 59; - const TP_QUOTE = 60; - const TP_BACKTICK = 61; - const YY_NO_ACTION = 516; - const YY_ACCEPT_ACTION = 515; - const YY_ERROR_ACTION = 514; - const YY_SZ_ACTTAB = 2071; - const YY_SHIFT_USE_DFLT = -31; - const YY_SHIFT_MAX = 230; - const YY_REDUCE_USE_DFLT = -91; - const YY_REDUCE_MAX = 178; - const YYNOCODE = 110; - const YYSTACKDEPTH = 500; - const YYNSTATE = 327; - const YYNRULE = 187; - const YYERRORSYMBOL = 62; - const YYERRSYMDT = 'yy0'; - const YYFALLBACK = 0; - - public static $yy_action = array( - 251, 234, 237, 1, 144, 127, 428, 184, 199, 212, - 10, 54, 19, 175, 282, 215, 109, 389, 428, 428, - 224, 321, 223, 303, 203, 389, 13, 389, 281, 43, - 389, 428, 41, 40, 266, 225, 389, 213, 389, 194, - 389, 52, 4, 308, 301, 383, 34, 209, 222, 3, - 50, 153, 251, 234, 237, 1, 199, 131, 383, 198, - 305, 212, 10, 54, 383, 16, 199, 428, 109, 385, - 132, 18, 224, 321, 223, 222, 221, 12, 32, 428, - 116, 43, 385, 262, 41, 40, 266, 225, 385, 233, - 95, 194, 16, 52, 4, 131, 301, 252, 18, 265, - 164, 3, 50, 324, 251, 234, 237, 1, 23, 130, - 229, 198, 150, 212, 10, 54, 326, 11, 170, 284, - 109, 42, 22, 239, 224, 321, 223, 193, 221, 261, - 13, 52, 157, 43, 301, 286, 41, 40, 266, 225, - 205, 233, 5, 194, 96, 52, 4, 263, 301, 301, - 99, 349, 96, 3, 50, 199, 251, 234, 237, 1, - 238, 130, 241, 181, 349, 212, 10, 54, 382, 240, - 349, 36, 109, 185, 104, 256, 224, 321, 223, 132, - 191, 382, 13, 49, 91, 43, 12, 382, 41, 40, - 266, 225, 257, 233, 152, 194, 457, 52, 4, 457, - 301, 301, 228, 457, 282, 3, 50, 285, 251, 234, - 237, 1, 301, 131, 441, 198, 238, 212, 10, 54, - 349, 441, 325, 175, 109, 30, 349, 273, 224, 321, - 223, 20, 221, 295, 32, 211, 457, 39, 166, 49, - 41, 40, 266, 225, 87, 233, 205, 194, 279, 52, - 4, 24, 301, 204, 200, 280, 99, 3, 50, 199, - 251, 234, 237, 1, 31, 130, 96, 198, 205, 212, - 10, 54, 350, 55, 293, 207, 109, 283, 99, 96, - 224, 321, 223, 199, 180, 350, 13, 134, 230, 43, - 222, 350, 41, 40, 266, 225, 104, 233, 316, 194, - 279, 52, 4, 24, 301, 165, 284, 280, 85, 3, - 50, 25, 251, 234, 237, 1, 131, 129, 210, 198, - 14, 212, 10, 54, 269, 270, 301, 116, 109, 295, - 216, 211, 224, 321, 223, 171, 221, 95, 13, 28, - 219, 43, 323, 9, 41, 40, 266, 225, 151, 233, - 324, 194, 52, 52, 4, 301, 301, 30, 282, 302, - 178, 3, 50, 7, 251, 234, 237, 1, 136, 130, - 304, 179, 238, 212, 10, 54, 279, 175, 282, 24, - 109, 238, 429, 280, 224, 321, 223, 177, 221, 270, - 13, 255, 281, 43, 429, 49, 41, 40, 266, 225, - 275, 233, 318, 194, 49, 52, 4, 276, 301, 163, - 26, 199, 8, 3, 50, 119, 251, 234, 237, 1, - 11, 93, 291, 51, 107, 212, 10, 54, 226, 428, - 206, 201, 109, 148, 178, 322, 224, 321, 223, 441, - 221, 428, 13, 282, 9, 43, 441, 115, 41, 40, - 266, 225, 167, 233, 227, 194, 457, 52, 4, 457, - 301, 96, 158, 457, 101, 3, 50, 271, 251, 234, - 237, 1, 282, 130, 235, 186, 135, 212, 10, 54, - 199, 37, 119, 315, 109, 165, 284, 176, 224, 321, - 223, 104, 221, 149, 13, 281, 146, 43, 281, 300, - 41, 40, 266, 225, 30, 233, 289, 194, 21, 52, - 4, 272, 301, 211, 18, 301, 161, 3, 50, 110, - 251, 234, 237, 1, 137, 128, 282, 198, 268, 212, - 10, 54, 222, 169, 515, 92, 109, 172, 284, 31, - 224, 321, 223, 29, 221, 238, 6, 260, 53, 43, - 232, 139, 41, 40, 266, 225, 154, 233, 178, 194, - 168, 52, 4, 214, 301, 145, 99, 33, 49, 3, - 50, 245, 208, 211, 320, 282, 90, 111, 311, 183, - 98, 70, 309, 297, 236, 178, 95, 319, 142, 258, - 247, 267, 249, 264, 250, 195, 231, 199, 246, 324, - 317, 253, 254, 259, 126, 137, 133, 251, 234, 237, - 1, 326, 290, 105, 143, 156, 212, 10, 54, 88, - 84, 83, 484, 109, 322, 282, 37, 224, 321, 223, - 245, 208, 211, 320, 281, 90, 111, 298, 182, 98, - 56, 245, 298, 211, 178, 95, 103, 147, 258, 197, - 102, 75, 141, 250, 195, 231, 95, 246, 324, 258, - 279, 242, 89, 24, 250, 195, 231, 280, 246, 324, - 298, 298, 298, 298, 298, 298, 298, 16, 298, 192, - 277, 298, 298, 18, 294, 44, 45, 38, 298, 298, - 251, 234, 237, 2, 298, 296, 298, 298, 298, 212, - 10, 54, 310, 312, 313, 314, 109, 162, 298, 298, - 224, 321, 223, 298, 298, 298, 294, 282, 298, 42, - 22, 239, 251, 234, 237, 2, 298, 296, 298, 298, - 298, 212, 10, 54, 298, 159, 298, 298, 109, 298, - 298, 17, 224, 321, 223, 282, 298, 42, 22, 239, - 298, 298, 245, 298, 211, 278, 298, 103, 111, 298, - 183, 98, 70, 298, 298, 298, 298, 95, 298, 298, - 258, 298, 292, 17, 298, 250, 195, 231, 279, 246, - 324, 24, 298, 395, 245, 280, 211, 298, 298, 103, - 298, 298, 197, 102, 75, 16, 298, 140, 298, 95, - 298, 18, 258, 298, 298, 298, 298, 250, 195, 231, - 298, 246, 324, 298, 298, 298, 298, 428, 298, 395, - 395, 395, 202, 277, 298, 245, 298, 211, 298, 428, - 103, 298, 298, 197, 120, 69, 395, 395, 395, 395, - 95, 298, 298, 258, 298, 298, 298, 160, 250, 195, - 231, 86, 246, 324, 245, 16, 211, 282, 298, 103, - 196, 18, 197, 120, 69, 298, 44, 45, 38, 95, - 298, 298, 258, 298, 298, 298, 178, 250, 195, 231, - 298, 246, 324, 310, 312, 313, 314, 298, 298, 190, - 245, 298, 211, 298, 298, 103, 298, 298, 197, 102, - 75, 298, 298, 298, 298, 95, 298, 298, 258, 298, - 298, 298, 298, 250, 195, 231, 298, 246, 324, 298, - 298, 298, 245, 298, 211, 298, 199, 100, 298, 288, - 197, 120, 47, 298, 106, 298, 298, 95, 298, 353, - 258, 155, 298, 218, 298, 250, 195, 231, 298, 246, - 324, 282, 16, 42, 22, 239, 298, 245, 18, 211, - 298, 428, 103, 298, 298, 197, 120, 69, 298, 298, - 298, 298, 95, 428, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 100, 189, 298, 197, 120, 59, 245, 207, 211, - 298, 95, 103, 298, 258, 197, 120, 81, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 80, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 67, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 57, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 58, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 82, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 97, 76, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 71, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 187, 120, 61, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 63, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 94, 79, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 59, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 77, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 188, 108, 64, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 65, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 97, 66, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 68, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 62, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 60, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 74, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 72, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 48, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 120, 46, 298, 298, - 298, 298, 95, 298, 298, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 120, 78, 245, 298, 211, - 298, 95, 103, 298, 258, 197, 120, 73, 298, 250, - 195, 231, 95, 246, 324, 258, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 125, 298, 298, 298, - 298, 298, 95, 298, 298, 298, 298, 298, 298, 244, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 114, 298, 245, 298, 211, - 298, 95, 103, 298, 298, 197, 122, 298, 243, 250, - 195, 231, 95, 246, 324, 298, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 117, 298, 298, 298, - 298, 298, 95, 298, 298, 298, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 121, 298, 245, 298, 211, - 298, 95, 103, 298, 298, 197, 124, 298, 298, 250, - 195, 231, 95, 246, 324, 298, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 298, 245, 298, 211, - 298, 298, 103, 298, 298, 197, 118, 298, 298, 298, - 298, 298, 95, 298, 298, 298, 298, 298, 298, 298, - 250, 195, 231, 298, 246, 324, 245, 298, 211, 298, - 298, 103, 298, 298, 197, 123, 298, 245, 298, 211, - 298, 95, 103, 298, 298, 197, 113, 298, 298, 250, - 195, 231, 95, 246, 324, 298, 298, 298, 298, 298, - 250, 195, 231, 220, 246, 324, 298, 27, 298, 16, - 298, 457, 298, 298, 457, 18, 298, 26, 457, 441, - 44, 45, 38, 217, 44, 45, 38, 298, 298, 298, - 298, 298, 298, 298, 298, 298, 298, 310, 312, 313, - 314, 310, 312, 313, 314, 298, 441, 298, 298, 441, - 298, 457, 220, 441, 457, 298, 298, 457, 298, 298, - 457, 457, 441, 457, 298, 298, 220, 457, 441, 298, - 298, 298, 298, 298, 457, 298, 298, 457, 298, 298, - 5, 457, 441, 298, 298, 298, 298, 298, 298, 441, - 298, 298, 441, 298, 457, 441, 441, 298, 441, 298, - 457, 298, 441, 306, 298, 298, 298, 298, 298, 441, - 298, 298, 441, 298, 457, 220, 441, 298, 298, 298, - 298, 298, 298, 457, 298, 298, 457, 298, 298, 15, - 457, 441, 35, 274, 44, 45, 38, 457, 298, 298, - 457, 298, 298, 298, 457, 441, 298, 298, 298, 298, - 298, 310, 312, 313, 314, 298, 298, 298, 441, 298, - 298, 441, 298, 457, 298, 441, 287, 298, 44, 45, - 38, 298, 441, 298, 298, 441, 298, 457, 298, 441, - 248, 298, 298, 298, 298, 310, 312, 313, 314, 298, - 44, 45, 38, 298, 298, 112, 298, 44, 45, 38, - 298, 173, 298, 298, 44, 45, 38, 310, 312, 313, - 314, 44, 45, 38, 310, 312, 313, 314, 298, 298, - 299, 310, 312, 313, 314, 44, 45, 38, 310, 312, - 313, 314, 174, 298, 298, 298, 138, 298, 298, 298, - 298, 298, 310, 312, 313, 314, 44, 45, 38, 298, - 298, 298, 44, 45, 38, 298, 44, 45, 38, 298, - 44, 45, 38, 310, 312, 313, 314, 307, 298, 310, - 312, 313, 314, 310, 312, 313, 314, 310, 312, 313, - 314, - ); - - public static $yy_lookahead = array( - 10, 11, 12, 13, 74, 15, 36, 17, 1, 19, - 20, 21, 29, 103, 84, 45, 26, 14, 48, 36, - 30, 31, 32, 53, 34, 22, 36, 24, 98, 39, - 27, 48, 42, 43, 44, 45, 33, 47, 35, 49, - 37, 51, 52, 53, 54, 14, 16, 16, 45, 59, - 60, 96, 10, 11, 12, 13, 1, 15, 27, 17, - 53, 19, 20, 21, 33, 27, 1, 36, 26, 14, - 45, 33, 30, 31, 32, 45, 34, 52, 36, 48, - 72, 39, 27, 75, 42, 43, 44, 45, 33, 47, - 82, 49, 27, 51, 52, 15, 54, 17, 33, 91, - 83, 59, 60, 95, 10, 11, 12, 13, 13, 15, - 15, 17, 17, 19, 20, 21, 97, 35, 99, 100, - 26, 86, 87, 88, 30, 31, 32, 66, 34, 49, - 36, 51, 96, 39, 54, 53, 42, 43, 44, 45, - 72, 47, 16, 49, 18, 51, 52, 79, 54, 54, - 82, 14, 18, 59, 60, 1, 10, 11, 12, 13, - 23, 15, 15, 17, 27, 19, 20, 21, 14, 17, - 33, 13, 26, 15, 48, 17, 30, 31, 32, 45, - 34, 27, 36, 46, 83, 39, 52, 33, 42, 43, - 44, 45, 34, 47, 74, 49, 10, 51, 52, 13, - 54, 54, 50, 17, 84, 59, 60, 14, 10, 11, - 12, 13, 54, 15, 45, 17, 23, 19, 20, 21, - 27, 52, 100, 103, 26, 35, 33, 37, 30, 31, - 32, 22, 34, 67, 36, 69, 50, 39, 83, 46, - 42, 43, 44, 45, 35, 47, 72, 49, 10, 51, - 52, 13, 54, 79, 80, 17, 82, 59, 60, 1, - 10, 11, 12, 13, 16, 15, 18, 17, 72, 19, - 20, 21, 14, 107, 108, 79, 26, 71, 82, 18, - 30, 31, 32, 1, 34, 27, 36, 15, 50, 39, - 45, 33, 42, 43, 44, 45, 48, 47, 53, 49, - 10, 51, 52, 13, 54, 99, 100, 17, 36, 59, - 60, 29, 10, 11, 12, 13, 15, 15, 17, 17, - 13, 19, 20, 21, 8, 9, 54, 72, 26, 67, - 75, 69, 30, 31, 32, 78, 34, 82, 36, 24, - 50, 39, 17, 36, 42, 43, 44, 45, 74, 47, - 95, 49, 51, 51, 52, 54, 54, 35, 84, 37, - 103, 59, 60, 36, 10, 11, 12, 13, 74, 15, - 108, 17, 23, 19, 20, 21, 10, 103, 84, 13, - 26, 23, 36, 17, 30, 31, 32, 7, 34, 9, - 36, 17, 98, 39, 48, 46, 42, 43, 44, 45, - 17, 47, 53, 49, 46, 51, 52, 93, 54, 78, - 16, 1, 36, 59, 60, 101, 10, 11, 12, 13, - 35, 15, 37, 17, 48, 19, 20, 21, 18, 36, - 65, 66, 26, 74, 103, 104, 30, 31, 32, 45, - 34, 48, 36, 84, 36, 39, 52, 17, 42, 43, - 44, 45, 15, 47, 17, 49, 10, 51, 52, 13, - 54, 18, 74, 17, 82, 59, 60, 34, 10, 11, - 12, 13, 84, 15, 93, 17, 15, 19, 20, 21, - 1, 2, 101, 101, 26, 99, 100, 17, 30, 31, - 32, 48, 34, 96, 36, 98, 96, 39, 98, 71, - 42, 43, 44, 45, 35, 47, 37, 49, 27, 51, - 52, 67, 54, 69, 33, 54, 74, 59, 60, 17, - 10, 11, 12, 13, 96, 15, 84, 17, 34, 19, - 20, 21, 45, 78, 63, 64, 26, 99, 100, 16, - 30, 31, 32, 16, 34, 23, 36, 17, 17, 39, - 23, 51, 42, 43, 44, 45, 72, 47, 103, 49, - 78, 51, 52, 17, 54, 74, 82, 41, 46, 59, - 60, 67, 68, 69, 70, 84, 72, 73, 53, 75, - 76, 77, 53, 61, 15, 103, 82, 14, 51, 85, - 14, 37, 17, 8, 90, 91, 92, 1, 94, 95, - 3, 4, 5, 6, 7, 96, 82, 10, 11, 12, - 13, 97, 84, 81, 96, 74, 19, 20, 21, 78, - 82, 82, 1, 26, 104, 84, 2, 30, 31, 32, - 67, 68, 69, 70, 98, 72, 73, 109, 75, 76, - 77, 67, 109, 69, 103, 82, 72, 96, 85, 75, - 76, 77, 96, 90, 91, 92, 82, 94, 95, 85, - 10, 14, 96, 13, 90, 91, 92, 17, 94, 95, - 109, 109, 109, 109, 109, 109, 109, 27, 109, 105, - 106, 109, 109, 33, 4, 38, 39, 40, 109, 109, - 10, 11, 12, 13, 109, 15, 109, 109, 109, 19, - 20, 21, 55, 56, 57, 58, 26, 74, 109, 109, - 30, 31, 32, 109, 109, 109, 4, 84, 109, 86, - 87, 88, 10, 11, 12, 13, 109, 15, 109, 109, - 109, 19, 20, 21, 109, 74, 109, 109, 26, 109, - 60, 61, 30, 31, 32, 84, 109, 86, 87, 88, - 109, 109, 67, 109, 69, 70, 109, 72, 73, 109, - 75, 76, 77, 109, 109, 109, 109, 82, 109, 109, - 85, 109, 60, 61, 109, 90, 91, 92, 10, 94, - 95, 13, 109, 2, 67, 17, 69, 109, 109, 72, - 109, 109, 75, 76, 77, 27, 109, 29, 109, 82, - 109, 33, 85, 109, 109, 109, 109, 90, 91, 92, - 109, 94, 95, 109, 109, 109, 109, 36, 109, 38, - 39, 40, 105, 106, 109, 67, 109, 69, 109, 48, - 72, 109, 109, 75, 76, 77, 55, 56, 57, 58, - 82, 109, 109, 85, 109, 109, 109, 74, 90, 91, - 92, 78, 94, 95, 67, 27, 69, 84, 109, 72, - 102, 33, 75, 76, 77, 109, 38, 39, 40, 82, - 109, 109, 85, 109, 109, 109, 103, 90, 91, 92, - 109, 94, 95, 55, 56, 57, 58, 109, 109, 102, - 67, 109, 69, 109, 109, 72, 109, 109, 75, 76, - 77, 109, 109, 109, 109, 82, 109, 109, 85, 109, - 109, 109, 109, 90, 91, 92, 109, 94, 95, 109, - 109, 109, 67, 109, 69, 109, 1, 72, 109, 106, - 75, 76, 77, 109, 79, 109, 109, 82, 109, 14, - 85, 74, 109, 18, 109, 90, 91, 92, 109, 94, - 95, 84, 27, 86, 87, 88, 109, 67, 33, 69, - 109, 36, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 48, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 102, 109, 75, 76, 77, 67, 79, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 77, 109, 109, - 109, 109, 82, 109, 109, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 77, 67, 109, 69, - 109, 82, 72, 109, 85, 75, 76, 77, 109, 90, - 91, 92, 82, 94, 95, 85, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 109, 109, 109, - 109, 109, 82, 109, 109, 109, 109, 109, 109, 89, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 109, 67, 109, 69, - 109, 82, 72, 109, 109, 75, 76, 109, 89, 90, - 91, 92, 82, 94, 95, 109, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 109, 109, 109, - 109, 109, 82, 109, 109, 109, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 109, 67, 109, 69, - 109, 82, 72, 109, 109, 75, 76, 109, 109, 90, - 91, 92, 82, 94, 95, 109, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 109, 67, 109, 69, - 109, 109, 72, 109, 109, 75, 76, 109, 109, 109, - 109, 109, 82, 109, 109, 109, 109, 109, 109, 109, - 90, 91, 92, 109, 94, 95, 67, 109, 69, 109, - 109, 72, 109, 109, 75, 76, 109, 67, 109, 69, - 109, 82, 72, 109, 109, 75, 76, 109, 109, 90, - 91, 92, 82, 94, 95, 109, 109, 109, 109, 109, - 90, 91, 92, 2, 94, 95, 109, 25, 109, 27, - 109, 10, 109, 109, 13, 33, 109, 16, 17, 18, - 38, 39, 40, 37, 38, 39, 40, 109, 109, 109, - 109, 109, 109, 109, 109, 109, 109, 55, 56, 57, - 58, 55, 56, 57, 58, 109, 45, 109, 109, 48, - 109, 50, 2, 52, 10, 109, 109, 13, 109, 109, - 10, 17, 18, 13, 109, 109, 2, 17, 18, 109, - 109, 109, 109, 109, 10, 109, 109, 13, 109, 109, - 16, 17, 18, 109, 109, 109, 109, 109, 109, 45, - 109, 109, 48, 109, 50, 45, 52, 109, 48, 109, - 50, 109, 52, 53, 109, 109, 109, 109, 109, 45, - 109, 109, 48, 109, 50, 2, 52, 109, 109, 109, - 109, 109, 109, 10, 109, 109, 13, 109, 109, 2, - 17, 18, 2, 37, 38, 39, 40, 10, 109, 109, - 13, 109, 109, 109, 17, 18, 109, 109, 109, 109, - 109, 55, 56, 57, 58, 109, 109, 109, 45, 109, - 109, 48, 109, 50, 109, 52, 14, 109, 38, 39, - 40, 109, 45, 109, 109, 48, 109, 50, 109, 52, - 14, 109, 109, 109, 109, 55, 56, 57, 58, 109, - 38, 39, 40, 109, 109, 22, 109, 38, 39, 40, - 109, 14, 109, 109, 38, 39, 40, 55, 56, 57, - 58, 38, 39, 40, 55, 56, 57, 58, 109, 109, - 61, 55, 56, 57, 58, 38, 39, 40, 55, 56, - 57, 58, 14, 109, 109, 109, 28, 109, 109, 109, - 109, 109, 55, 56, 57, 58, 38, 39, 40, 109, - 109, 109, 38, 39, 40, 109, 38, 39, 40, 109, - 38, 39, 40, 55, 56, 57, 58, 53, 109, 55, - 56, 57, 58, 55, 56, 57, 58, 55, 56, 57, - 58, - ); - - public static $yy_shift_ofst = array( - -31, 406, 406, 458, 458, 94, 510, 94, 94, 94, - 510, 458, -10, 94, 94, 354, 146, 94, 94, 94, - 94, 146, 94, 94, 94, 94, 250, 94, 94, 94, - 94, 94, 94, 302, 94, 94, 94, 198, 42, 42, - 42, 42, 42, 42, 42, 42, 1772, 828, 828, 80, - 712, 925, 301, 65, 272, 680, 1942, 1920, 1886, 1776, - 647, 1949, 1977, 2008, 2004, 1963, 1998, 1956, 2012, 2012, - 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, 2012, - 2012, 2012, 2012, 768, 650, 272, 65, 272, 65, 134, - 126, 479, 597, 1854, 154, 290, 95, 55, 258, 366, - 248, 366, 282, 443, 437, 38, 38, 437, 7, 481, - 410, 38, 461, 621, 596, 596, 261, 596, 596, 261, - 596, 596, 596, 596, 596, -31, -31, 1840, 1791, 1917, - 1903, 1834, 158, 238, 394, 446, 38, 25, 147, 169, - 147, 25, 169, 25, 38, 38, 25, 25, 38, 25, - 307, 38, 38, 25, 527, 38, 38, 25, 38, 38, - 38, 38, 38, 596, 624, 261, 624, 327, 596, 596, - 261, 596, 261, -31, -31, -31, -31, -31, -31, 781, - 3, 31, 193, 137, -30, 186, -17, 522, 349, 469, - 322, 30, 82, 316, 346, 376, 190, 358, 393, 152, - 209, 380, 385, 245, 315, 523, 585, 554, 576, 575, - 537, 573, 569, 529, 525, 546, 500, 526, 531, 325, - 530, 487, 494, 502, 470, 433, 430, 408, 383, 327, - 374, - ); - - public static $yy_reduce_ofst = array( - 471, 504, 563, 717, 574, 685, 919, 890, 787, 758, - 855, 823, 1240, 1199, 1140, 1100, 1070, 1129, 1170, 1210, - 1269, 1280, 1310, 1339, 1350, 1380, 1409, 1420, 1450, 1479, - 1490, 1059, 1030, 1000, 930, 960, 989, 1520, 1549, 1700, - 1619, 1689, 1660, 1630, 1590, 1560, 633, 661, 867, 8, - 166, 773, 255, 541, 174, 262, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 294, -70, 196, 120, 68, 274, 19, - 206, 331, 444, 428, 257, 400, 382, 257, 257, 400, - 386, 397, 257, 386, 381, 388, 359, 314, 257, 442, - 482, 491, 484, 257, 257, 455, 386, 257, 257, 438, - 257, 257, 257, 257, 257, 257, 365, 509, 509, 509, - 509, 509, 524, 536, 509, 509, 528, 514, 539, 551, - 538, 514, 556, 514, 528, 528, 514, 514, 528, 514, - 518, 528, 528, 514, 532, 528, 528, 514, 528, 528, - 528, 528, 528, -90, 520, 122, 520, 566, -90, -90, - 122, -90, 122, -45, 36, 155, 101, 61, 17, - ); - - public static $yyExpectedTokens = array( - array(), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 53, 54, 59, - 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array( - 10, 11, 12, 13, 15, 17, 19, 20, 21, 26, 30, 31, 32, 34, 36, 39, 42, 43, 44, 45, 47, 49, 51, 52, 54, 59, 60, - ), - array(25, 27, 33, 38, 39, 40, 55, 56, 57, 58,), - array(27, 33, 38, 39, 40, 55, 56, 57, 58,), - array(27, 33, 38, 39, 40, 55, 56, 57, 58,), - array(15, 17, 49, 51, 54,), - array(4, 10, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 60, 61,), - array(1, 14, 18, 27, 33, 36, 48,), - array(15, 17, 51, 54,), - array(1, 27, 33,), - array(15, 36, 54,), - array(4, 10, 11, 12, 13, 15, 19, 20, 21, 26, 30, 31, 32, 60, 61,), - array(14, 38, 39, 40, 55, 56, 57, 58,), - array(2, 38, 39, 40, 55, 56, 57, 58,), - array(37, 38, 39, 40, 55, 56, 57, 58,), - array(37, 38, 39, 40, 55, 56, 57, 58,), - array(14, 38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58, 61,), - array(14, 38, 39, 40, 55, 56, 57, 58,), - array(14, 38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 53, 55, 56, 57, 58,), - array(22, 38, 39, 40, 55, 56, 57, 58,), - array(28, 38, 39, 40, 55, 56, 57, 58,), - array(14, 38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(38, 39, 40, 55, 56, 57, 58,), - array(10, 13, 17, 27, 29, 33,), - array(10, 13, 17, 27, 33,), - array(15, 36, 54,), - array(1, 27, 33,), - array(15, 36, 54,), - array(1, 27, 33,), - array(18, 45, 52,), - array(16, 18, 48,), - array(1, 2,), - array(3, 4, 5, 6, 7, 10, 11, 12, 13, 19, 20, 21, 26, 30, 31, 32,), - array(2, 10, 13, 16, 17, 18, 45, 48, 50, 52,), - array(1, 14, 27, 33,), - array(10, 13, 17, 50,), - array(13, 15, 17, 54,), - array(1, 14, 27, 33,), - array(1, 14, 27, 33,), - array(10, 13, 17,), - array(16, 18, 48,), - array(10, 13, 17,), - array(1, 29,), - array(18, 48,), - array(15, 17,), - array(27, 33,), - array(27, 33,), - array(15, 17,), - array(1, 53,), - array(27, 33,), - array(1, 18,), - array(27, 33,), - array(15, 54,), - array(1,), - array(1,), - array(1,), - array(18,), - array(1,), - array(1,), - array(18,), - array(1,), - array(1,), - array(1,), - array(1,), - array(1,), - array(), - array(), - array(2, 10, 13, 17, 18, 45, 48, 50, 52, 53,), - array(2, 10, 13, 16, 17, 18, 45, 48, 50, 52,), - array(2, 10, 13, 17, 18, 45, 48, 50, 52,), - array(2, 10, 13, 17, 18, 45, 48, 50, 52,), - array(10, 13, 17, 18, 45, 48, 50, 52,), - array(13, 15, 17, 34, 54,), - array(10, 13, 17, 50,), - array(16, 45, 52,), - array(10, 13, 17,), - array(27, 33,), - array(45, 52,), - array(15, 54,), - array(45, 52,), - array(15, 54,), - array(45, 52,), - array(45, 52,), - array(45, 52,), - array(27, 33,), - array(27, 33,), - array(45, 52,), - array(45, 52,), - array(27, 33,), - array(45, 52,), - array(13, 36,), - array(27, 33,), - array(27, 33,), - array(45, 52,), - array(16, 23,), - array(27, 33,), - array(27, 33,), - array(45, 52,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(27, 33,), - array(1,), - array(2,), - array(18,), - array(2,), - array(36,), - array(1,), - array(1,), - array(18,), - array(1,), - array(18,), - array(), - array(), - array(), - array(), - array(), - array(), - array(2, 36, 38, 39, 40, 48, 55, 56, 57, 58,), - array(14, 22, 24, 27, 33, 35, 37, 45,), - array(14, 16, 27, 33, 36, 48,), - array(14, 23, 27, 33, 46,), - array(14, 23, 27, 33, 46,), - array(36, 45, 48, 53,), - array(10, 13, 17, 50,), - array(29, 36, 48,), - array(23, 46, 61,), - array(23, 46, 53,), - array(35, 37,), - array(35, 37,), - array(16, 45,), - array(35, 53,), - array(8, 9,), - array(36, 48,), - array(36, 48,), - array(35, 37,), - array(23, 46,), - array(36, 48,), - array(17, 50,), - array(22, 35,), - array(7, 9,), - array(35, 37,), - array(45, 53,), - array(24,), - array(16,), - array(8,), - array(37,), - array(14,), - array(17,), - array(51,), - array(14,), - array(15,), - array(53,), - array(53,), - array(17,), - array(51,), - array(41,), - array(17,), - array(17,), - array(17,), - array(45,), - array(34,), - array(17,), - array(17,), - array(34,), - array(17,), - array(36,), - array(17,), - array(36,), - array(17,), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - array(), - ); - - public static $yy_default = array( - 338, 514, 514, 499, 499, 514, 514, 476, 476, 476, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 514, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 379, 358, 379, 514, - 514, 415, 514, 379, 514, 514, 351, 514, 514, 514, - 514, 514, 514, 514, 514, 514, 384, 514, 399, 475, - 351, 403, 390, 474, 500, 502, 384, 501, 363, 381, - 404, 386, 391, 379, 379, 514, 379, 514, 379, 489, - 431, 370, 327, 430, 393, 441, 514, 393, 393, 441, - 431, 441, 393, 431, 514, 379, 360, 514, 393, 379, - 373, 379, 514, 406, 402, 375, 431, 396, 398, 486, - 393, 408, 397, 407, 406, 483, 336, 430, 430, 430, - 430, 430, 514, 443, 457, 441, 367, 438, 514, 436, - 514, 435, 434, 466, 368, 348, 439, 437, 361, 467, - 441, 356, 354, 468, 514, 366, 355, 469, 362, 359, - 352, 369, 365, 371, 478, 463, 477, 441, 374, 376, - 490, 424, 487, 441, 441, 482, 482, 336, 482, 415, - 411, 415, 405, 405, 415, 442, 415, 405, 405, 514, - 514, 411, 514, 514, 425, 514, 514, 405, 415, 514, - 514, 334, 514, 411, 387, 514, 514, 514, 514, 514, - 514, 514, 514, 420, 514, 514, 514, 417, 514, 514, - 514, 411, 413, 514, 514, 514, 514, 488, 514, 457, - 514, 421, 364, 420, 340, 422, 357, 341, 409, 400, - 480, 457, 462, 401, 485, 423, 426, 342, 447, 380, - 416, 339, 428, 329, 330, 444, 445, 446, 394, 331, - 395, 429, 419, 388, 332, 418, 410, 392, 412, 333, - 335, 414, 337, 472, 417, 479, 427, 497, 347, 461, - 460, 459, 378, 346, 464, 510, 495, 511, 498, 473, - 377, 496, 503, 506, 513, 512, 509, 507, 504, 508, - 345, 458, 471, 448, 505, 454, 452, 455, 456, 450, - 491, 449, 492, 493, 494, 470, 451, 328, 453, 343, - 344, 372, 481, 432, 433, 465, 440, - ); - - public static $yyFallback = array(); - - public static $yyRuleName = array( - 'start ::= template', - 'template ::= template PHP', - 'template ::= template TEXT', - 'template ::= template STRIPON', - 'template ::= template STRIPOFF', - 'template ::= template LITERALSTART literal_e2 LITERALEND', - 'literal_e2 ::= literal_e1 LITERALSTART literal_e1 LITERALEND', - 'literal_e2 ::= literal_e1', - 'literal_e1 ::= literal_e1 LITERAL', - 'literal_e1 ::=', - 'template ::= template smartytag', - 'template ::=', - 'smartytag ::= SIMPELOUTPUT', - 'smartytag ::= SIMPLETAG', - 'smartytag ::= SMARTYBLOCKCHILDPARENT', - 'smartytag ::= LDEL tagbody RDEL', - 'smartytag ::= tag RDEL', - 'tagbody ::= outattr', - 'tagbody ::= DOLLARID eqoutattr', - 'tagbody ::= varindexed eqoutattr', - 'eqoutattr ::= EQUAL outattr', - 'outattr ::= output attributes', - 'output ::= variable', - 'output ::= value', - 'output ::= expr', - 'tag ::= LDEL ID attributes', - 'tag ::= LDEL ID', - 'tag ::= LDEL ID modifierlist attributes', - 'tag ::= LDEL ID PTR ID attributes', - 'tag ::= LDEL ID PTR ID modifierlist attributes', - 'tag ::= LDELMAKENOCACHE DOLLARID', - 'tag ::= LDELIF expr', - 'tag ::= LDELIF expr attributes', - 'tag ::= LDELIF statement', - 'tag ::= LDELIF statement attributes', - 'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes', - 'foraction ::= EQUAL expr', - 'foraction ::= INCDEC', - 'tag ::= LDELFOR statement TO expr attributes', - 'tag ::= LDELFOR statement TO expr STEP expr attributes', - 'tag ::= LDELFOREACH SPACE expr AS varvar attributes', - 'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', - 'tag ::= LDELFOREACH attributes', - 'tag ::= LDELSETFILTER ID modparameters', - 'tag ::= LDELSETFILTER ID modparameters modifierlist', - 'smartytag ::= CLOSETAG', - 'tag ::= LDELSLASH ID', - 'tag ::= LDELSLASH ID modifierlist', - 'tag ::= LDELSLASH ID PTR ID', - 'tag ::= LDELSLASH ID PTR ID modifierlist', - 'attributes ::= attributes attribute', - 'attributes ::= attribute', - 'attributes ::=', - 'attribute ::= SPACE ID EQUAL ID', - 'attribute ::= ATTR expr', - 'attribute ::= ATTR value', - 'attribute ::= SPACE ID', - 'attribute ::= SPACE expr', - 'attribute ::= SPACE value', - 'attribute ::= SPACE INTEGER EQUAL expr', - 'statements ::= statement', - 'statements ::= statements COMMA statement', - 'statement ::= DOLLARID EQUAL INTEGER', - 'statement ::= DOLLARID EQUAL expr', - 'statement ::= varindexed EQUAL expr', - 'statement ::= OPENP statement CLOSEP', - 'expr ::= value', - 'expr ::= ternary', - 'expr ::= DOLLARID COLON ID', - 'expr ::= expr MATH value', - 'expr ::= expr UNIMATH value', - 'expr ::= expr tlop value', - 'expr ::= expr lop expr', - 'expr ::= expr scond', - 'expr ::= expr ISIN array', - 'expr ::= expr ISIN value', - 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr', - 'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', - 'value ::= variable', - 'value ::= UNIMATH value', - 'value ::= NOT value', - 'value ::= TYPECAST value', - 'value ::= variable INCDEC', - 'value ::= HEX', - 'value ::= INTEGER', - 'value ::= INTEGER DOT INTEGER', - 'value ::= INTEGER DOT', - 'value ::= DOT INTEGER', - 'value ::= ID', - 'value ::= function', - 'value ::= OPENP expr CLOSEP', - 'value ::= variable INSTANCEOF ns1', - 'value ::= variable INSTANCEOF variable', - 'value ::= SINGLEQUOTESTRING', - 'value ::= doublequoted_with_quotes', - 'value ::= varindexed DOUBLECOLON static_class_access', - 'value ::= smartytag', - 'value ::= value modifierlist', - 'value ::= NAMESPACE', - 'value ::= arraydef', - 'value ::= ns1 DOUBLECOLON static_class_access', - 'ns1 ::= ID', - 'ns1 ::= NAMESPACE', - 'variable ::= DOLLARID', - 'variable ::= varindexed', - 'variable ::= varvar AT ID', - 'variable ::= object', - 'variable ::= HATCH ID HATCH', - 'variable ::= HATCH ID HATCH arrayindex', - 'variable ::= HATCH variable HATCH', - 'variable ::= HATCH variable HATCH arrayindex', - 'varindexed ::= DOLLARID arrayindex', - 'varindexed ::= varvar arrayindex', - 'arrayindex ::= arrayindex indexdef', - 'arrayindex ::=', - 'indexdef ::= DOT DOLLARID', - 'indexdef ::= DOT varvar', - 'indexdef ::= DOT varvar AT ID', - 'indexdef ::= DOT ID', - 'indexdef ::= DOT INTEGER', - 'indexdef ::= DOT LDEL expr RDEL', - 'indexdef ::= OPENB ID CLOSEB', - 'indexdef ::= OPENB ID DOT ID CLOSEB', - 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB', - 'indexdef ::= OPENB INTEGER CLOSEB', - 'indexdef ::= OPENB DOLLARID CLOSEB', - 'indexdef ::= OPENB variable CLOSEB', - 'indexdef ::= OPENB value CLOSEB', - 'indexdef ::= OPENB expr CLOSEB', - 'indexdef ::= OPENB CLOSEB', - 'varvar ::= DOLLARID', - 'varvar ::= DOLLAR', - 'varvar ::= varvar varvarele', - 'varvarele ::= ID', - 'varvarele ::= SIMPELOUTPUT', - 'varvarele ::= LDEL expr RDEL', - 'object ::= varindexed objectchain', - 'objectchain ::= objectelement', - 'objectchain ::= objectchain objectelement', - 'objectelement ::= PTR ID arrayindex', - 'objectelement ::= PTR varvar arrayindex', - 'objectelement ::= PTR LDEL expr RDEL arrayindex', - 'objectelement ::= PTR ID LDEL expr RDEL arrayindex', - 'objectelement ::= PTR method', - 'function ::= ns1 OPENP params CLOSEP', - 'method ::= ID OPENP params CLOSEP', - 'method ::= DOLLARID OPENP params CLOSEP', - 'params ::= params COMMA expr', - 'params ::= expr', - 'params ::=', - 'modifierlist ::= modifierlist modifier modparameters', - 'modifierlist ::= modifier modparameters', - 'modifier ::= VERT AT ID', - 'modifier ::= VERT ID', - 'modparameters ::= modparameters modparameter', - 'modparameters ::=', - 'modparameter ::= COLON value', - 'modparameter ::= COLON UNIMATH value', - 'modparameter ::= COLON array', - 'static_class_access ::= method', - 'static_class_access ::= method objectchain', - 'static_class_access ::= ID', - 'static_class_access ::= DOLLARID arrayindex', - 'static_class_access ::= DOLLARID arrayindex objectchain', - 'lop ::= LOGOP', - 'lop ::= SLOGOP', - 'tlop ::= TLOGOP', - 'scond ::= SINGLECOND', - 'arraydef ::= OPENB arrayelements CLOSEB', - 'arraydef ::= ARRAYOPEN arrayelements CLOSEP', - 'arrayelements ::= arrayelement', - 'arrayelements ::= arrayelements COMMA arrayelement', - 'arrayelements ::=', - 'arrayelement ::= value APTR expr', - 'arrayelement ::= ID APTR expr', - 'arrayelement ::= expr', - 'doublequoted_with_quotes ::= QUOTE QUOTE', - 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE', - 'doublequoted ::= doublequoted doublequotedcontent', - 'doublequoted ::= doublequotedcontent', - 'doublequotedcontent ::= BACKTICK variable BACKTICK', - 'doublequotedcontent ::= BACKTICK expr BACKTICK', - 'doublequotedcontent ::= DOLLARID', - 'doublequotedcontent ::= LDEL variable RDEL', - 'doublequotedcontent ::= LDEL expr RDEL', - 'doublequotedcontent ::= smartytag', - 'doublequotedcontent ::= TEXT', - ); +// line 23 "../smarty/lexer/smarty_internal_templateparser.y" - public static $yyRuleInfo = array( - array(0 => 63, 1 => 1), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 4), - array(0 => 65, 1 => 4), - array(0 => 65, 1 => 1), - array(0 => 66, 1 => 2), - array(0 => 66, 1 => 0), - array(0 => 64, 1 => 2), - array(0 => 64, 1 => 0), - array(0 => 67, 1 => 1), - array(0 => 67, 1 => 1), - array(0 => 67, 1 => 1), - array(0 => 67, 1 => 3), - array(0 => 67, 1 => 2), - array(0 => 68, 1 => 1), - array(0 => 68, 1 => 2), - array(0 => 68, 1 => 2), - array(0 => 71, 1 => 2), - array(0 => 70, 1 => 2), - array(0 => 73, 1 => 1), - array(0 => 73, 1 => 1), - array(0 => 73, 1 => 1), - array(0 => 69, 1 => 3), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 4), - array(0 => 69, 1 => 5), - array(0 => 69, 1 => 6), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 3), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 3), - array(0 => 69, 1 => 8), - array(0 => 81, 1 => 2), - array(0 => 81, 1 => 1), - array(0 => 69, 1 => 5), - array(0 => 69, 1 => 7), - array(0 => 69, 1 => 6), - array(0 => 69, 1 => 8), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 3), - array(0 => 69, 1 => 4), - array(0 => 67, 1 => 1), - array(0 => 69, 1 => 2), - array(0 => 69, 1 => 3), - array(0 => 69, 1 => 4), - array(0 => 69, 1 => 5), - array(0 => 74, 1 => 2), - array(0 => 74, 1 => 1), - array(0 => 74, 1 => 0), - array(0 => 84, 1 => 4), - array(0 => 84, 1 => 2), - array(0 => 84, 1 => 2), - array(0 => 84, 1 => 2), - array(0 => 84, 1 => 2), - array(0 => 84, 1 => 2), - array(0 => 84, 1 => 4), - array(0 => 80, 1 => 1), - array(0 => 80, 1 => 3), - array(0 => 79, 1 => 3), - array(0 => 79, 1 => 3), - array(0 => 79, 1 => 3), - array(0 => 79, 1 => 3), - array(0 => 77, 1 => 1), - array(0 => 77, 1 => 1), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 2), - array(0 => 77, 1 => 3), - array(0 => 77, 1 => 3), - array(0 => 85, 1 => 7), - array(0 => 85, 1 => 7), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 3), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 3), - array(0 => 76, 1 => 3), - array(0 => 76, 1 => 3), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 3), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 2), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 1), - array(0 => 76, 1 => 3), - array(0 => 91, 1 => 1), - array(0 => 91, 1 => 1), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 1), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 4), - array(0 => 75, 1 => 3), - array(0 => 75, 1 => 4), - array(0 => 72, 1 => 2), - array(0 => 72, 1 => 2), - array(0 => 96, 1 => 2), - array(0 => 96, 1 => 0), - array(0 => 97, 1 => 2), - array(0 => 97, 1 => 2), - array(0 => 97, 1 => 4), - array(0 => 97, 1 => 2), - array(0 => 97, 1 => 2), - array(0 => 97, 1 => 4), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 5), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 3), - array(0 => 97, 1 => 2), - array(0 => 82, 1 => 1), - array(0 => 82, 1 => 1), - array(0 => 82, 1 => 2), - array(0 => 98, 1 => 1), - array(0 => 98, 1 => 1), - array(0 => 98, 1 => 3), - array(0 => 95, 1 => 2), - array(0 => 99, 1 => 1), - array(0 => 99, 1 => 2), - array(0 => 100, 1 => 3), - array(0 => 100, 1 => 3), - array(0 => 100, 1 => 5), - array(0 => 100, 1 => 6), - array(0 => 100, 1 => 2), - array(0 => 90, 1 => 4), - array(0 => 101, 1 => 4), - array(0 => 101, 1 => 4), - array(0 => 102, 1 => 3), - array(0 => 102, 1 => 1), - array(0 => 102, 1 => 0), - array(0 => 78, 1 => 3), - array(0 => 78, 1 => 2), - array(0 => 103, 1 => 3), - array(0 => 103, 1 => 2), - array(0 => 83, 1 => 2), - array(0 => 83, 1 => 0), - array(0 => 104, 1 => 2), - array(0 => 104, 1 => 3), - array(0 => 104, 1 => 2), - array(0 => 93, 1 => 1), - array(0 => 93, 1 => 2), - array(0 => 93, 1 => 1), - array(0 => 93, 1 => 2), - array(0 => 93, 1 => 3), - array(0 => 87, 1 => 1), - array(0 => 87, 1 => 1), - array(0 => 86, 1 => 1), - array(0 => 88, 1 => 1), - array(0 => 94, 1 => 3), - array(0 => 94, 1 => 3), - array(0 => 105, 1 => 1), - array(0 => 105, 1 => 3), - array(0 => 105, 1 => 0), - array(0 => 106, 1 => 3), - array(0 => 106, 1 => 3), - array(0 => 106, 1 => 1), - array(0 => 92, 1 => 2), - array(0 => 92, 1 => 3), - array(0 => 107, 1 => 2), - array(0 => 107, 1 => 1), - array(0 => 108, 1 => 3), - array(0 => 108, 1 => 3), - array(0 => 108, 1 => 1), - array(0 => 108, 1 => 3), - array(0 => 108, 1 => 3), - array(0 => 108, 1 => 1), - array(0 => 108, 1 => 1), - ); - - public static $yyReduceMap = array( - 0 => 0, - 1 => 1, - 2 => 2, - 3 => 3, - 4 => 4, - 5 => 5, - 6 => 6, - 7 => 7, - 22 => 7, - 23 => 7, - 24 => 7, - 37 => 7, - 57 => 7, - 58 => 7, - 66 => 7, - 67 => 7, - 78 => 7, - 83 => 7, - 84 => 7, - 89 => 7, - 93 => 7, - 94 => 7, - 98 => 7, - 99 => 7, - 101 => 7, - 106 => 7, - 170 => 7, - 175 => 7, - 8 => 8, - 9 => 9, - 10 => 10, - 12 => 12, - 13 => 13, - 14 => 14, - 15 => 15, - 16 => 16, - 17 => 17, - 18 => 18, - 19 => 19, - 20 => 20, - 21 => 21, - 25 => 25, - 26 => 26, - 27 => 27, - 28 => 28, - 29 => 29, - 30 => 30, - 31 => 31, - 32 => 32, - 34 => 32, - 33 => 33, - 35 => 35, - 36 => 36, - 38 => 38, - 39 => 39, - 40 => 40, - 41 => 41, - 42 => 42, - 43 => 43, - 44 => 44, - 45 => 45, - 46 => 46, - 47 => 47, - 48 => 48, - 49 => 49, - 50 => 50, - 51 => 51, - 60 => 51, - 148 => 51, - 152 => 51, - 156 => 51, - 158 => 51, - 52 => 52, - 149 => 52, - 155 => 52, - 53 => 53, - 54 => 54, - 55 => 54, - 56 => 56, - 133 => 56, - 59 => 59, - 61 => 61, - 62 => 62, - 63 => 62, - 64 => 64, - 65 => 65, - 68 => 68, - 69 => 69, - 70 => 69, - 71 => 71, - 72 => 72, - 73 => 73, - 74 => 74, - 75 => 75, - 76 => 76, - 77 => 77, - 79 => 79, - 81 => 79, - 82 => 79, - 113 => 79, - 80 => 80, - 85 => 85, - 86 => 86, - 87 => 87, - 88 => 88, - 90 => 90, - 91 => 91, - 92 => 91, - 95 => 95, - 96 => 96, - 97 => 97, - 100 => 100, - 102 => 102, - 103 => 103, - 104 => 104, - 105 => 105, - 107 => 107, - 108 => 108, - 109 => 109, - 110 => 110, - 111 => 111, - 112 => 112, - 114 => 114, - 172 => 114, - 115 => 115, - 116 => 116, - 117 => 117, - 118 => 118, - 119 => 119, - 120 => 120, - 128 => 120, - 121 => 121, - 122 => 122, - 123 => 123, - 124 => 123, - 126 => 123, - 127 => 123, - 125 => 125, - 129 => 129, - 130 => 130, - 131 => 131, - 176 => 131, - 132 => 132, - 134 => 134, - 135 => 135, - 136 => 136, - 137 => 137, - 138 => 138, - 139 => 139, - 140 => 140, - 141 => 141, - 142 => 142, - 143 => 143, - 144 => 144, - 145 => 145, - 146 => 146, - 147 => 147, - 150 => 150, - 151 => 151, - 153 => 153, - 154 => 154, - 157 => 157, - 159 => 159, - 160 => 160, - 161 => 161, - 162 => 162, - 163 => 163, - 164 => 164, - 165 => 165, - 166 => 166, - 167 => 167, - 168 => 168, - 169 => 168, - 171 => 171, - 173 => 173, - 174 => 174, - 177 => 177, - 178 => 178, - 179 => 179, - 180 => 180, - 183 => 180, - 181 => 181, - 184 => 181, - 182 => 182, - 185 => 185, - 186 => 186, - ); + const ERR1 = 'Security error: Call to private object member not allowed'; + const ERR2 = 'Security error: Call to dynamic object member not allowed'; /** * result status @@ -1654,13 +81,19 @@ class Smarty_Internal_Templateparser */ public $lex; + /** + * internal error flag + * + * @var bool + */ + private $internalError = false; + /** * {strip} status * * @var bool */ public $strip = false; - /** * compiler object * @@ -1710,54 +143,6 @@ class Smarty_Internal_Templateparser */ public $template_postfix = array(); - public $yyTraceFILE; - - public $yyTracePrompt; - - public $yyidx; - - public $yyerrcnt; - - public $yystack = array(); - - public $yyTokenName = array( - '$', 'VERT', 'COLON', 'PHP', - 'TEXT', 'STRIPON', 'STRIPOFF', 'LITERALSTART', - 'LITERALEND', 'LITERAL', 'SIMPELOUTPUT', 'SIMPLETAG', - 'SMARTYBLOCKCHILDPARENT', 'LDEL', 'RDEL', 'DOLLARID', - 'EQUAL', 'ID', 'PTR', 'LDELMAKENOCACHE', - 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', - 'TO', 'STEP', 'LDELFOREACH', 'SPACE', - 'AS', 'APTR', 'LDELSETFILTER', 'CLOSETAG', - 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', - 'OPENP', 'CLOSEP', 'MATH', 'UNIMATH', - 'ISIN', 'QMARK', 'NOT', 'TYPECAST', - 'HEX', 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', - 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', - 'OPENB', 'CLOSEB', 'DOLLAR', 'LOGOP', - 'SLOGOP', 'TLOGOP', 'SINGLECOND', 'ARRAYOPEN', - 'QUOTE', 'BACKTICK', 'error', 'start', - 'template', 'literal_e2', 'literal_e1', 'smartytag', - 'tagbody', 'tag', 'outattr', 'eqoutattr', - 'varindexed', 'output', 'attributes', 'variable', - 'value', 'expr', 'modifierlist', 'statement', - 'statements', 'foraction', 'varvar', 'modparameters', - 'attribute', 'ternary', 'tlop', 'lop', - 'scond', 'array', 'function', 'ns1', - 'doublequoted_with_quotes', 'static_class_access', 'arraydef', 'object', - 'arrayindex', 'indexdef', 'varvarele', 'objectchain', - 'objectelement', 'method', 'params', 'modifier', - 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', - 'doublequotedcontent', - ); - - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; /* Index of top element in stack */ - private $_retvalue; /* Shifts left before out of the error */ /** * constructor * @@ -1772,16 +157,9 @@ public function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_ $this->smarty = $this->template->smarty; $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); - } /* The parser's stack */ - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } } - /** + /** * insert PHP code in current buffer * * @param string $code @@ -1823,6 +201,898 @@ public function mergePrefixCode($code) return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); } + + const TP_VERT = 1; + const TP_COLON = 2; + const TP_TEXT = 3; + const TP_STRIPON = 4; + const TP_STRIPOFF = 5; + const TP_LITERALSTART = 6; + const TP_LITERALEND = 7; + const TP_LITERAL = 8; + const TP_SIMPELOUTPUT = 9; + const TP_SIMPLETAG = 10; + const TP_SMARTYBLOCKCHILDPARENT = 11; + const TP_LDEL = 12; + const TP_RDEL = 13; + const TP_DOLLARID = 14; + const TP_EQUAL = 15; + const TP_ID = 16; + const TP_PTR = 17; + const TP_LDELMAKENOCACHE = 18; + const TP_LDELIF = 19; + const TP_LDELFOR = 20; + const TP_SEMICOLON = 21; + const TP_INCDEC = 22; + const TP_TO = 23; + const TP_STEP = 24; + const TP_LDELFOREACH = 25; + const TP_SPACE = 26; + const TP_AS = 27; + const TP_APTR = 28; + const TP_LDELSETFILTER = 29; + const TP_CLOSETAG = 30; + const TP_LDELSLASH = 31; + const TP_ATTR = 32; + const TP_INTEGER = 33; + const TP_COMMA = 34; + const TP_OPENP = 35; + const TP_CLOSEP = 36; + const TP_MATH = 37; + const TP_UNIMATH = 38; + const TP_ISIN = 39; + const TP_QMARK = 40; + const TP_NOT = 41; + const TP_TYPECAST = 42; + const TP_HEX = 43; + const TP_DOT = 44; + const TP_INSTANCEOF = 45; + const TP_SINGLEQUOTESTRING = 46; + const TP_DOUBLECOLON = 47; + const TP_NAMESPACE = 48; + const TP_AT = 49; + const TP_HATCH = 50; + const TP_OPENB = 51; + const TP_CLOSEB = 52; + const TP_DOLLAR = 53; + const TP_LOGOP = 54; + const TP_SLOGOP = 55; + const TP_TLOGOP = 56; + const TP_SINGLECOND = 57; + const TP_ARRAYOPEN = 58; + const TP_QUOTE = 59; + const TP_BACKTICK = 60; + const YY_NO_ACTION = 514; + const YY_ACCEPT_ACTION = 513; + const YY_ERROR_ACTION = 512; + + const YY_SZ_ACTTAB = 1997; +public static $yy_action = array( + 249, 250, 239, 1, 27, 127, 220, 184, 160, 213, + 11, 54, 278, 10, 173, 34, 108, 387, 282, 279, + 223, 321, 221, 8, 194, 387, 18, 387, 85, 41, + 387, 285, 42, 44, 264, 222, 387, 209, 387, 198, + 387, 52, 5, 307, 288, 288, 164, 283, 224, 4, + 50, 249, 250, 239, 1, 232, 131, 381, 189, 205, + 213, 11, 54, 39, 35, 243, 31, 108, 94, 17, + 381, 223, 321, 221, 439, 226, 381, 33, 49, 426, + 41, 439, 89, 42, 44, 264, 222, 9, 235, 163, + 198, 426, 52, 5, 131, 288, 212, 284, 102, 106, + 4, 50, 249, 250, 239, 1, 232, 129, 426, 189, + 347, 213, 11, 54, 175, 324, 347, 208, 108, 22, + 426, 301, 223, 321, 221, 302, 226, 135, 18, 49, + 52, 41, 26, 288, 42, 44, 264, 222, 16, 235, + 294, 198, 204, 52, 5, 170, 288, 32, 90, 267, + 268, 4, 50, 249, 250, 239, 1, 20, 129, 185, + 179, 255, 213, 11, 54, 455, 288, 192, 455, 108, + 175, 167, 455, 223, 321, 221, 439, 226, 256, 18, + 55, 292, 41, 439, 132, 42, 44, 264, 222, 427, + 235, 12, 198, 165, 52, 5, 232, 288, 288, 347, + 153, 427, 4, 50, 249, 250, 239, 1, 232, 129, + 286, 181, 347, 213, 11, 54, 24, 13, 347, 49, + 108, 232, 320, 426, 223, 321, 221, 195, 201, 173, + 18, 49, 139, 41, 296, 426, 42, 44, 264, 222, + 7, 235, 286, 198, 49, 52, 5, 147, 288, 117, + 150, 317, 263, 4, 50, 249, 250, 239, 1, 95, + 130, 173, 189, 155, 213, 11, 54, 22, 244, 271, + 192, 108, 323, 286, 101, 223, 321, 221, 294, 226, + 204, 18, 348, 257, 41, 166, 283, 42, 44, 264, + 222, 28, 235, 300, 198, 348, 52, 5, 247, 288, + 117, 348, 94, 206, 4, 50, 249, 250, 239, 1, + 95, 129, 22, 189, 277, 213, 11, 54, 91, 274, + 224, 426, 108, 323, 216, 156, 223, 321, 221, 132, + 180, 262, 18, 426, 100, 41, 12, 288, 42, 44, + 264, 222, 15, 235, 216, 198, 254, 52, 5, 233, + 288, 210, 190, 192, 100, 4, 50, 249, 250, 239, + 1, 3, 131, 94, 189, 192, 213, 11, 54, 269, + 10, 204, 290, 108, 325, 216, 224, 223, 321, 221, + 23, 226, 211, 33, 315, 100, 45, 513, 92, 42, + 44, 264, 222, 102, 235, 178, 198, 268, 52, 5, + 275, 288, 161, 192, 37, 25, 4, 50, 249, 250, + 239, 1, 286, 129, 172, 187, 305, 213, 11, 54, + 164, 283, 310, 141, 108, 281, 281, 236, 223, 321, + 221, 169, 226, 230, 18, 122, 171, 41, 225, 175, + 42, 44, 264, 222, 144, 235, 303, 198, 134, 52, + 5, 265, 288, 151, 286, 192, 175, 4, 50, 249, + 250, 239, 1, 286, 128, 94, 189, 143, 213, 11, + 54, 219, 152, 207, 193, 108, 149, 281, 31, 223, + 321, 221, 100, 226, 21, 6, 286, 288, 41, 158, + 16, 42, 44, 264, 222, 102, 235, 238, 198, 286, + 52, 5, 157, 288, 281, 122, 168, 283, 4, 50, + 249, 250, 239, 1, 30, 93, 308, 51, 215, 213, + 11, 54, 53, 251, 140, 248, 108, 245, 304, 116, + 223, 321, 221, 111, 226, 176, 18, 270, 266, 41, + 224, 322, 42, 44, 264, 222, 7, 235, 259, 198, + 147, 52, 5, 257, 288, 43, 40, 38, 83, 4, + 50, 241, 214, 204, 319, 280, 88, 107, 138, 182, + 97, 64, 311, 312, 313, 316, 95, 281, 298, 258, + 142, 234, 94, 105, 272, 197, 231, 482, 237, 323, + 37, 133, 324, 241, 214, 204, 319, 314, 88, 107, + 296, 183, 97, 82, 84, 43, 40, 38, 95, 296, + 296, 258, 296, 296, 296, 159, 272, 197, 231, 296, + 237, 323, 311, 312, 313, 316, 241, 296, 204, 296, + 296, 103, 296, 296, 199, 104, 77, 296, 296, 110, + 296, 95, 296, 296, 258, 278, 296, 296, 34, 272, + 197, 231, 279, 237, 323, 43, 40, 38, 296, 296, + 296, 241, 26, 204, 196, 276, 103, 296, 16, 199, + 104, 77, 311, 312, 313, 316, 95, 192, 296, 258, + 146, 296, 296, 296, 272, 197, 231, 296, 237, 323, + 286, 393, 39, 35, 243, 296, 296, 296, 296, 191, + 276, 296, 26, 318, 252, 253, 126, 296, 16, 249, + 250, 239, 1, 296, 296, 131, 296, 261, 213, 11, + 54, 296, 296, 296, 426, 108, 393, 393, 393, 223, + 321, 221, 241, 296, 204, 299, 426, 103, 107, 296, + 183, 97, 82, 393, 393, 393, 393, 95, 296, 260, + 258, 52, 296, 296, 288, 272, 197, 231, 296, 237, + 323, 293, 296, 296, 296, 296, 296, 249, 250, 239, + 2, 296, 295, 296, 296, 296, 213, 11, 54, 296, + 296, 177, 296, 108, 136, 296, 296, 223, 321, 221, + 296, 296, 296, 293, 43, 40, 38, 296, 296, 249, + 250, 239, 2, 296, 295, 43, 40, 38, 213, 11, + 54, 311, 312, 313, 316, 108, 296, 291, 14, 223, + 321, 221, 311, 312, 313, 316, 296, 296, 241, 296, + 204, 296, 192, 103, 296, 296, 199, 104, 77, 296, + 296, 296, 296, 95, 383, 296, 258, 296, 296, 297, + 14, 272, 197, 231, 296, 237, 323, 383, 296, 296, + 241, 296, 204, 383, 296, 99, 296, 287, 199, 120, + 48, 241, 112, 204, 296, 95, 103, 296, 258, 199, + 120, 74, 296, 272, 197, 231, 95, 237, 323, 258, + 455, 296, 296, 455, 272, 197, 231, 455, 237, 323, + 241, 296, 204, 296, 296, 103, 200, 296, 199, 120, + 74, 296, 296, 296, 296, 95, 296, 296, 258, 278, + 296, 296, 34, 272, 197, 231, 279, 237, 323, 241, + 455, 204, 296, 296, 99, 202, 296, 199, 120, 56, + 241, 211, 204, 296, 95, 103, 296, 258, 199, 120, + 74, 296, 272, 197, 231, 95, 237, 323, 258, 227, + 296, 296, 296, 272, 197, 231, 296, 237, 323, 241, + 296, 204, 148, 296, 103, 203, 86, 199, 120, 73, + 296, 296, 286, 296, 95, 296, 296, 258, 278, 296, + 296, 34, 272, 197, 231, 279, 237, 323, 241, 296, + 204, 175, 296, 103, 296, 296, 199, 120, 75, 241, + 296, 204, 296, 95, 103, 296, 258, 199, 120, 63, + 296, 272, 197, 231, 95, 237, 323, 258, 229, 192, + 296, 296, 272, 197, 231, 296, 237, 323, 241, 296, + 204, 380, 296, 103, 296, 296, 199, 120, 58, 296, + 296, 296, 296, 95, 380, 296, 258, 296, 296, 296, + 380, 272, 197, 231, 296, 237, 323, 241, 296, 204, + 296, 296, 103, 296, 296, 199, 120, 71, 241, 296, + 204, 296, 95, 103, 296, 258, 199, 120, 79, 296, + 272, 197, 231, 95, 237, 323, 258, 296, 296, 296, + 154, 272, 197, 231, 87, 237, 323, 241, 296, 204, + 286, 296, 103, 296, 296, 199, 120, 70, 296, 296, + 296, 296, 95, 296, 296, 258, 296, 296, 296, 175, + 272, 197, 231, 296, 237, 323, 241, 296, 204, 296, + 296, 103, 296, 296, 199, 120, 56, 241, 296, 204, + 296, 95, 103, 296, 258, 199, 120, 46, 296, 272, + 197, 231, 95, 237, 323, 258, 296, 296, 296, 296, + 272, 197, 231, 296, 237, 323, 241, 296, 204, 296, + 296, 103, 296, 296, 199, 120, 78, 296, 296, 296, + 296, 95, 296, 296, 258, 296, 296, 296, 296, 272, + 197, 231, 296, 237, 323, 241, 296, 204, 296, 296, + 103, 296, 296, 199, 120, 66, 241, 296, 204, 296, + 95, 103, 296, 258, 199, 120, 59, 296, 272, 197, + 231, 95, 237, 323, 258, 296, 296, 296, 296, 272, + 197, 231, 296, 237, 323, 241, 296, 204, 296, 296, + 103, 296, 296, 186, 109, 57, 296, 296, 296, 296, + 95, 296, 296, 258, 296, 296, 296, 296, 272, 197, + 231, 296, 237, 323, 241, 296, 204, 296, 296, 103, + 296, 296, 188, 120, 67, 241, 296, 204, 296, 95, + 103, 296, 258, 199, 96, 62, 296, 272, 197, 231, + 95, 237, 323, 258, 296, 296, 296, 296, 272, 197, + 231, 296, 237, 323, 241, 296, 204, 296, 296, 103, + 296, 296, 199, 120, 80, 296, 296, 296, 296, 95, + 296, 296, 258, 296, 296, 296, 296, 272, 197, 231, + 296, 237, 323, 241, 296, 204, 296, 296, 103, 296, + 296, 199, 120, 76, 241, 296, 204, 296, 95, 103, + 296, 258, 199, 120, 81, 296, 272, 197, 231, 95, + 237, 323, 258, 296, 296, 296, 296, 272, 197, 231, + 296, 237, 323, 241, 296, 204, 296, 296, 103, 296, + 296, 199, 120, 65, 296, 296, 296, 296, 95, 296, + 296, 258, 296, 296, 296, 296, 272, 197, 231, 296, + 237, 323, 241, 296, 204, 296, 296, 103, 296, 296, + 199, 96, 68, 241, 296, 204, 296, 95, 103, 296, + 258, 199, 120, 61, 296, 272, 197, 231, 95, 237, + 323, 258, 296, 296, 296, 296, 272, 197, 231, 296, + 237, 323, 241, 296, 204, 296, 296, 103, 296, 296, + 199, 98, 69, 296, 296, 296, 296, 95, 296, 296, + 258, 296, 296, 296, 296, 272, 197, 231, 296, 237, + 323, 241, 296, 204, 296, 296, 103, 296, 296, 199, + 120, 72, 241, 296, 204, 296, 95, 103, 296, 258, + 199, 120, 47, 296, 272, 197, 231, 95, 237, 323, + 258, 296, 296, 296, 296, 272, 197, 231, 296, 237, + 323, 241, 192, 204, 296, 296, 103, 296, 296, 199, + 120, 60, 296, 296, 351, 296, 95, 296, 217, 258, + 296, 296, 296, 296, 272, 197, 231, 26, 237, 323, + 241, 296, 204, 16, 296, 103, 426, 296, 199, 125, + 296, 241, 296, 204, 296, 95, 103, 296, 426, 199, + 118, 296, 242, 272, 197, 231, 95, 237, 323, 296, + 296, 296, 296, 246, 272, 197, 231, 296, 237, 323, + 241, 296, 204, 278, 296, 103, 34, 296, 199, 121, + 279, 296, 296, 296, 296, 95, 296, 296, 296, 296, + 26, 296, 162, 272, 197, 231, 16, 237, 323, 241, + 296, 204, 296, 296, 103, 296, 296, 199, 123, 296, + 241, 296, 204, 296, 95, 103, 296, 296, 199, 114, + 296, 296, 272, 197, 231, 95, 237, 323, 296, 296, + 296, 296, 296, 272, 197, 231, 296, 237, 323, 241, + 296, 204, 296, 145, 103, 296, 296, 199, 124, 296, + 296, 296, 296, 286, 95, 39, 35, 243, 296, 296, + 296, 296, 272, 197, 231, 296, 237, 323, 241, 296, + 204, 296, 296, 103, 296, 296, 199, 115, 296, 241, + 296, 204, 296, 95, 103, 296, 296, 199, 113, 296, + 296, 272, 197, 231, 95, 237, 323, 296, 296, 296, + 296, 296, 272, 197, 231, 228, 237, 323, 241, 296, + 204, 296, 455, 103, 296, 455, 199, 119, 3, 455, + 439, 296, 296, 95, 296, 296, 296, 296, 296, 296, + 296, 272, 197, 231, 228, 237, 323, 296, 296, 296, + 296, 455, 296, 296, 455, 296, 296, 439, 455, 439, + 439, 228, 455, 296, 439, 296, 296, 137, 455, 296, + 296, 455, 296, 296, 32, 455, 439, 286, 296, 39, + 35, 243, 29, 296, 26, 296, 439, 296, 296, 439, + 16, 455, 296, 439, 306, 43, 40, 38, 296, 296, + 296, 296, 296, 439, 296, 296, 439, 296, 455, 296, + 439, 26, 311, 312, 313, 316, 296, 16, 228, 296, + 296, 296, 43, 40, 38, 455, 296, 296, 455, 296, + 296, 296, 455, 439, 296, 296, 19, 296, 296, 311, + 312, 313, 316, 455, 296, 296, 455, 296, 296, 296, + 455, 439, 296, 296, 296, 43, 40, 38, 296, 296, + 439, 296, 296, 439, 174, 455, 296, 439, 296, 240, + 309, 296, 311, 312, 313, 316, 296, 289, 439, 296, + 36, 439, 296, 455, 296, 439, 296, 296, 43, 40, + 38, 296, 296, 43, 40, 38, 296, 296, 296, 296, + 296, 43, 40, 38, 296, 311, 312, 313, 316, 296, + 311, 312, 313, 316, 296, 43, 40, 38, 311, 312, + 313, 316, 273, 43, 40, 38, 296, 296, 296, 296, + 296, 296, 311, 312, 313, 316, 296, 296, 296, 296, + 311, 312, 313, 316, 455, 296, 296, 455, 43, 40, + 38, 455, 439, 218, 43, 40, 38, 296, 296, 296, + 296, 296, 296, 296, 296, 311, 312, 313, 316, 296, + 296, 311, 312, 313, 316, 296, 296, 296, 296, 439, + 296, 296, 439, 296, 455, 296, 439, + ); + public static $yy_lookahead = array( + 9, 10, 11, 12, 12, 14, 14, 16, 16, 18, + 19, 20, 9, 34, 102, 12, 25, 13, 70, 16, + 29, 30, 31, 35, 33, 21, 35, 23, 95, 38, + 26, 52, 41, 42, 43, 44, 32, 46, 34, 48, + 36, 50, 51, 52, 53, 53, 98, 99, 44, 58, + 59, 9, 10, 11, 12, 22, 14, 13, 16, 15, + 18, 19, 20, 85, 86, 87, 15, 25, 17, 21, + 26, 29, 30, 31, 44, 33, 32, 35, 45, 35, + 38, 51, 34, 41, 42, 43, 44, 35, 46, 77, + 48, 47, 50, 51, 14, 53, 16, 13, 47, 47, + 58, 59, 9, 10, 11, 12, 22, 14, 35, 16, + 26, 18, 19, 20, 102, 103, 32, 44, 25, 34, + 47, 36, 29, 30, 31, 52, 33, 14, 35, 45, + 50, 38, 26, 53, 41, 42, 43, 44, 32, 46, + 66, 48, 68, 50, 51, 77, 53, 15, 35, 7, + 8, 58, 59, 9, 10, 11, 12, 12, 14, 14, + 16, 16, 18, 19, 20, 9, 53, 1, 12, 25, + 102, 82, 16, 29, 30, 31, 44, 33, 33, 35, + 106, 107, 38, 51, 44, 41, 42, 43, 44, 35, + 46, 51, 48, 82, 50, 51, 22, 53, 53, 13, + 73, 47, 58, 59, 9, 10, 11, 12, 22, 14, + 83, 16, 26, 18, 19, 20, 28, 12, 32, 45, + 25, 22, 70, 35, 29, 30, 31, 65, 33, 102, + 35, 45, 73, 38, 60, 47, 41, 42, 43, 44, + 35, 46, 83, 48, 45, 50, 51, 95, 53, 71, + 95, 52, 74, 58, 59, 9, 10, 11, 12, 81, + 14, 102, 16, 73, 18, 19, 20, 34, 90, 36, + 1, 25, 94, 83, 81, 29, 30, 31, 66, 33, + 68, 35, 13, 96, 38, 98, 99, 41, 42, 43, + 44, 15, 46, 100, 48, 26, 50, 51, 14, 53, + 71, 32, 17, 74, 58, 59, 9, 10, 11, 12, + 81, 14, 34, 16, 36, 18, 19, 20, 82, 107, + 44, 35, 25, 94, 71, 95, 29, 30, 31, 44, + 33, 78, 35, 47, 81, 38, 51, 53, 41, 42, + 43, 44, 15, 46, 71, 48, 16, 50, 51, 22, + 53, 78, 79, 1, 81, 58, 59, 9, 10, 11, + 12, 15, 14, 17, 16, 1, 18, 19, 20, 66, + 34, 68, 36, 25, 16, 71, 44, 29, 30, 31, + 28, 33, 78, 35, 52, 81, 38, 62, 63, 41, + 42, 43, 44, 47, 46, 6, 48, 8, 50, 51, + 16, 53, 73, 1, 2, 40, 58, 59, 9, 10, + 11, 12, 83, 14, 77, 16, 52, 18, 19, 20, + 98, 99, 52, 95, 25, 97, 97, 92, 29, 30, + 31, 77, 33, 49, 35, 100, 14, 38, 16, 102, + 41, 42, 43, 44, 73, 46, 14, 48, 14, 50, + 51, 36, 53, 73, 83, 1, 102, 58, 59, 9, + 10, 11, 12, 83, 14, 17, 16, 50, 18, 19, + 20, 17, 71, 64, 65, 25, 73, 97, 15, 29, + 30, 31, 81, 33, 26, 35, 83, 53, 38, 73, + 32, 41, 42, 43, 44, 47, 46, 92, 48, 83, + 50, 51, 95, 53, 97, 100, 98, 99, 58, 59, + 9, 10, 11, 12, 23, 14, 52, 16, 16, 18, + 19, 20, 16, 7, 50, 16, 25, 13, 13, 16, + 29, 30, 31, 16, 33, 16, 35, 33, 33, 38, + 44, 16, 41, 42, 43, 44, 35, 46, 16, 48, + 95, 50, 51, 96, 53, 37, 38, 39, 81, 58, + 59, 66, 67, 68, 69, 83, 71, 72, 95, 74, + 75, 76, 54, 55, 56, 57, 81, 97, 60, 84, + 95, 13, 17, 80, 89, 90, 91, 1, 93, 94, + 2, 81, 103, 66, 67, 68, 69, 99, 71, 72, + 108, 74, 75, 76, 81, 37, 38, 39, 81, 108, + 108, 84, 108, 108, 108, 95, 89, 90, 91, 108, + 93, 94, 54, 55, 56, 57, 66, 108, 68, 108, + 108, 71, 108, 108, 74, 75, 76, 108, 108, 21, + 108, 81, 108, 108, 84, 9, 108, 108, 12, 89, + 90, 91, 16, 93, 94, 37, 38, 39, 108, 108, + 108, 66, 26, 68, 104, 105, 71, 108, 32, 74, + 75, 76, 54, 55, 56, 57, 81, 1, 108, 84, + 73, 108, 108, 108, 89, 90, 91, 108, 93, 94, + 83, 2, 85, 86, 87, 108, 108, 108, 108, 104, + 105, 108, 26, 3, 4, 5, 6, 108, 32, 9, + 10, 11, 12, 108, 108, 14, 108, 16, 18, 19, + 20, 108, 108, 108, 35, 25, 37, 38, 39, 29, + 30, 31, 66, 108, 68, 69, 47, 71, 72, 108, + 74, 75, 76, 54, 55, 56, 57, 81, 108, 48, + 84, 50, 108, 108, 53, 89, 90, 91, 108, 93, + 94, 3, 108, 108, 108, 108, 108, 9, 10, 11, + 12, 108, 14, 108, 108, 108, 18, 19, 20, 108, + 108, 13, 108, 25, 27, 108, 108, 29, 30, 31, + 108, 108, 108, 3, 37, 38, 39, 108, 108, 9, + 10, 11, 12, 108, 14, 37, 38, 39, 18, 19, + 20, 54, 55, 56, 57, 25, 108, 59, 60, 29, + 30, 31, 54, 55, 56, 57, 108, 108, 66, 108, + 68, 108, 1, 71, 108, 108, 74, 75, 76, 108, + 108, 108, 108, 81, 13, 108, 84, 108, 108, 59, + 60, 89, 90, 91, 108, 93, 94, 26, 108, 108, + 66, 108, 68, 32, 108, 71, 108, 105, 74, 75, + 76, 66, 78, 68, 108, 81, 71, 108, 84, 74, + 75, 76, 108, 89, 90, 91, 81, 93, 94, 84, + 9, 108, 108, 12, 89, 90, 91, 16, 93, 94, + 66, 108, 68, 108, 108, 71, 101, 108, 74, 75, + 76, 108, 108, 108, 108, 81, 108, 108, 84, 9, + 108, 108, 12, 89, 90, 91, 16, 93, 94, 66, + 49, 68, 108, 108, 71, 101, 108, 74, 75, 76, + 66, 78, 68, 108, 81, 71, 108, 84, 74, 75, + 76, 108, 89, 90, 91, 81, 93, 94, 84, 49, + 108, 108, 108, 89, 90, 91, 108, 93, 94, 66, + 108, 68, 73, 108, 71, 101, 77, 74, 75, 76, + 108, 108, 83, 108, 81, 108, 108, 84, 9, 108, + 108, 12, 89, 90, 91, 16, 93, 94, 66, 108, + 68, 102, 108, 71, 108, 108, 74, 75, 76, 66, + 108, 68, 108, 81, 71, 108, 84, 74, 75, 76, + 108, 89, 90, 91, 81, 93, 94, 84, 49, 1, + 108, 108, 89, 90, 91, 108, 93, 94, 66, 108, + 68, 13, 108, 71, 108, 108, 74, 75, 76, 108, + 108, 108, 108, 81, 26, 108, 84, 108, 108, 108, + 32, 89, 90, 91, 108, 93, 94, 66, 108, 68, + 108, 108, 71, 108, 108, 74, 75, 76, 66, 108, + 68, 108, 81, 71, 108, 84, 74, 75, 76, 108, + 89, 90, 91, 81, 93, 94, 84, 108, 108, 108, + 73, 89, 90, 91, 77, 93, 94, 66, 108, 68, + 83, 108, 71, 108, 108, 74, 75, 76, 108, 108, + 108, 108, 81, 108, 108, 84, 108, 108, 108, 102, + 89, 90, 91, 108, 93, 94, 66, 108, 68, 108, + 108, 71, 108, 108, 74, 75, 76, 66, 108, 68, + 108, 81, 71, 108, 84, 74, 75, 76, 108, 89, + 90, 91, 81, 93, 94, 84, 108, 108, 108, 108, + 89, 90, 91, 108, 93, 94, 66, 108, 68, 108, + 108, 71, 108, 108, 74, 75, 76, 108, 108, 108, + 108, 81, 108, 108, 84, 108, 108, 108, 108, 89, + 90, 91, 108, 93, 94, 66, 108, 68, 108, 108, + 71, 108, 108, 74, 75, 76, 66, 108, 68, 108, + 81, 71, 108, 84, 74, 75, 76, 108, 89, 90, + 91, 81, 93, 94, 84, 108, 108, 108, 108, 89, + 90, 91, 108, 93, 94, 66, 108, 68, 108, 108, + 71, 108, 108, 74, 75, 76, 108, 108, 108, 108, + 81, 108, 108, 84, 108, 108, 108, 108, 89, 90, + 91, 108, 93, 94, 66, 108, 68, 108, 108, 71, + 108, 108, 74, 75, 76, 66, 108, 68, 108, 81, + 71, 108, 84, 74, 75, 76, 108, 89, 90, 91, + 81, 93, 94, 84, 108, 108, 108, 108, 89, 90, + 91, 108, 93, 94, 66, 108, 68, 108, 108, 71, + 108, 108, 74, 75, 76, 108, 108, 108, 108, 81, + 108, 108, 84, 108, 108, 108, 108, 89, 90, 91, + 108, 93, 94, 66, 108, 68, 108, 108, 71, 108, + 108, 74, 75, 76, 66, 108, 68, 108, 81, 71, + 108, 84, 74, 75, 76, 108, 89, 90, 91, 81, + 93, 94, 84, 108, 108, 108, 108, 89, 90, 91, + 108, 93, 94, 66, 108, 68, 108, 108, 71, 108, + 108, 74, 75, 76, 108, 108, 108, 108, 81, 108, + 108, 84, 108, 108, 108, 108, 89, 90, 91, 108, + 93, 94, 66, 108, 68, 108, 108, 71, 108, 108, + 74, 75, 76, 66, 108, 68, 108, 81, 71, 108, + 84, 74, 75, 76, 108, 89, 90, 91, 81, 93, + 94, 84, 108, 108, 108, 108, 89, 90, 91, 108, + 93, 94, 66, 108, 68, 108, 108, 71, 108, 108, + 74, 75, 76, 108, 108, 108, 108, 81, 108, 108, + 84, 108, 108, 108, 108, 89, 90, 91, 108, 93, + 94, 66, 108, 68, 108, 108, 71, 108, 108, 74, + 75, 76, 66, 108, 68, 108, 81, 71, 108, 84, + 74, 75, 76, 108, 89, 90, 91, 81, 93, 94, + 84, 108, 108, 108, 108, 89, 90, 91, 108, 93, + 94, 66, 1, 68, 108, 108, 71, 108, 108, 74, + 75, 76, 108, 108, 13, 108, 81, 108, 17, 84, + 108, 108, 108, 108, 89, 90, 91, 26, 93, 94, + 66, 108, 68, 32, 108, 71, 35, 108, 74, 75, + 108, 66, 108, 68, 108, 81, 71, 108, 47, 74, + 75, 108, 88, 89, 90, 91, 81, 93, 94, 108, + 108, 108, 108, 88, 89, 90, 91, 108, 93, 94, + 66, 108, 68, 9, 108, 71, 12, 108, 74, 75, + 16, 108, 108, 108, 108, 81, 108, 108, 108, 108, + 26, 108, 28, 89, 90, 91, 32, 93, 94, 66, + 108, 68, 108, 108, 71, 108, 108, 74, 75, 108, + 66, 108, 68, 108, 81, 71, 108, 108, 74, 75, + 108, 108, 89, 90, 91, 81, 93, 94, 108, 108, + 108, 108, 108, 89, 90, 91, 108, 93, 94, 66, + 108, 68, 108, 73, 71, 108, 108, 74, 75, 108, + 108, 108, 108, 83, 81, 85, 86, 87, 108, 108, + 108, 108, 89, 90, 91, 108, 93, 94, 66, 108, + 68, 108, 108, 71, 108, 108, 74, 75, 108, 66, + 108, 68, 108, 81, 71, 108, 108, 74, 75, 108, + 108, 89, 90, 91, 81, 93, 94, 108, 108, 108, + 108, 108, 89, 90, 91, 2, 93, 94, 66, 108, + 68, 108, 9, 71, 108, 12, 74, 75, 15, 16, + 17, 108, 108, 81, 108, 108, 108, 108, 108, 108, + 108, 89, 90, 91, 2, 93, 94, 108, 108, 108, + 108, 9, 108, 108, 12, 108, 108, 44, 16, 17, + 47, 2, 49, 108, 51, 108, 108, 73, 9, 108, + 108, 12, 108, 108, 15, 16, 17, 83, 108, 85, + 86, 87, 24, 108, 26, 108, 44, 108, 108, 47, + 32, 49, 108, 51, 52, 37, 38, 39, 108, 108, + 108, 108, 108, 44, 108, 108, 47, 108, 49, 108, + 51, 26, 54, 55, 56, 57, 108, 32, 2, 108, + 108, 108, 37, 38, 39, 9, 108, 108, 12, 108, + 108, 108, 16, 17, 108, 108, 2, 108, 108, 54, + 55, 56, 57, 9, 108, 108, 12, 108, 108, 108, + 16, 17, 108, 108, 108, 37, 38, 39, 108, 108, + 44, 108, 108, 47, 13, 49, 108, 51, 108, 13, + 52, 108, 54, 55, 56, 57, 108, 13, 44, 108, + 2, 47, 108, 49, 108, 51, 108, 108, 37, 38, + 39, 108, 108, 37, 38, 39, 108, 108, 108, 108, + 108, 37, 38, 39, 108, 54, 55, 56, 57, 108, + 54, 55, 56, 57, 108, 37, 38, 39, 54, 55, + 56, 57, 36, 37, 38, 39, 108, 108, 108, 108, + 108, 108, 54, 55, 56, 57, 108, 108, 108, 108, + 54, 55, 56, 57, 9, 108, 108, 12, 37, 38, + 39, 16, 17, 36, 37, 38, 39, 108, 108, 108, + 108, 108, 108, 108, 108, 54, 55, 56, 57, 108, + 108, 54, 55, 56, 57, 108, 108, 108, 108, 44, + 108, 108, 47, 108, 49, 108, 51, +); + const YY_SHIFT_USE_DFLT = -22; + const YY_SHIFT_MAX = 230; + public static $yy_shift_ofst = array( + -22, 501, 501, 93, 399, 399, 450, 93, 93, 93, + 399, 450, -9, 93, 93, 93, 93, 93, 93, 144, + 93, 195, 93, 93, 93, 246, 195, 93, 93, 93, + 93, 93, 297, 93, 93, 93, 93, 348, 42, 42, + 42, 42, 42, 42, 42, 42, 1768, 1795, 1795, 701, + 758, 1521, 80, 676, 113, 790, 1927, 1828, 1896, 568, + 768, 1861, 757, 1866, 1874, 1888, 618, 518, 1921, 1921, + 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, + 1921, 1921, 1921, 1584, 636, 285, 676, 676, 346, 113, + 113, 402, 700, 1723, -8, 910, 831, 269, 1028, 51, + 3, 3, 422, 448, 352, 106, 422, 106, 458, 364, + 434, 454, 106, 166, 166, 166, 166, 565, 166, 166, + 166, 586, 565, 166, 166, -22, -22, 1752, 1769, 1826, + 1844, 1945, 145, 979, 156, 132, 284, 106, 140, 106, + 30, 140, 140, 30, 106, 106, 106, 140, 106, 106, + 140, 106, 327, 106, 106, 106, 140, 140, 106, 140, + 205, 106, 284, 166, 565, 588, 565, 588, 565, 166, + 166, -12, 166, -22, -22, -22, -22, -22, -22, 689, + 4, 44, 84, 186, 73, 881, 199, 188, 174, 286, + 48, 336, 384, 389, 332, 142, -21, 52, 154, 33, + 85, 276, 278, 233, 515, 509, 474, 516, 502, 464, + 491, 415, 417, 432, 514, 370, 463, 506, 365, 513, + -12, 517, 504, 519, 505, 511, 496, 525, 532, 330, + 358, +); + const YY_REDUCE_USE_DFLT = -89; + const YY_REDUCE_MAX = 178; + public static $yy_reduce_ofst = array( + 325, 527, 495, 666, 595, 560, 863, 874, 834, 805, + 762, 794, 1179, 1455, 1208, 1012, 1386, 1139, 1070, 1110, + 1150, 1219, 1248, 1277, 1288, 1317, 1346, 1357, 1415, 1426, + 1081, 1041, 1001, 972, 943, 932, 903, 1484, 1495, 1622, + 1633, 1662, 1593, 1564, 1553, 1524, 1704, 607, 1590, 178, + 74, 1027, 229, 899, 273, 212, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, + -22, -22, -22, 380, 329, 187, 159, 127, -52, 253, + 304, 12, 303, 152, 193, 328, 68, 68, 68, 322, + 328, 407, 405, 322, 68, 190, 335, 416, 403, 68, + 401, 354, 371, 68, 68, 68, 337, 322, 68, 68, + 68, 68, 408, 68, 68, 68, 409, 455, 455, 455, + 455, 455, 510, 480, 455, 455, 477, 482, 457, 482, + 473, 457, 457, 485, 482, 482, 482, 457, 482, 482, + 457, 482, 503, 482, 482, 482, 457, 457, 482, 457, + 520, 482, 523, -88, 498, 489, 498, 489, 498, -88, + -88, -67, -88, 111, 155, 89, 236, 230, 162, +); + public static $yyExpectedTokens = array( + array(), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 52, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(9, 10, 11, 12, 14, 16, 18, 19, 20, 25, 29, 30, 31, 33, 35, 38, 41, 42, 43, 44, 46, 48, 50, 51, 53, 58, 59, ), + array(24, 26, 32, 37, 38, 39, 54, 55, 56, 57, ), + array(26, 32, 37, 38, 39, 54, 55, 56, 57, ), + array(26, 32, 37, 38, 39, 54, 55, 56, 57, ), + array(14, 16, 48, 50, 53, ), + array(3, 9, 10, 11, 12, 14, 18, 19, 20, 25, 29, 30, 31, 59, 60, ), + array(1, 13, 17, 26, 32, 35, 47, ), + array(14, 16, 50, 53, ), + array(1, 26, 32, ), + array(14, 35, 53, ), + array(3, 9, 10, 11, 12, 14, 18, 19, 20, 25, 29, 30, 31, 59, 60, ), + array(36, 37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 52, 54, 55, 56, 57, ), + array(36, 37, 38, 39, 54, 55, 56, 57, ), + array(13, 37, 38, 39, 54, 55, 56, 57, ), + array(13, 37, 38, 39, 54, 55, 56, 57, ), + array(13, 37, 38, 39, 54, 55, 56, 57, ), + array(27, 37, 38, 39, 54, 55, 56, 57, ), + array(13, 37, 38, 39, 54, 55, 56, 57, ), + array(13, 37, 38, 39, 54, 55, 56, 57, ), + array(2, 37, 38, 39, 54, 55, 56, 57, ), + array(21, 37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, 60, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(37, 38, 39, 54, 55, 56, 57, ), + array(9, 12, 16, 26, 28, 32, ), + array(9, 12, 16, 26, 32, ), + array(17, 44, 51, ), + array(1, 26, 32, ), + array(1, 26, 32, ), + array(15, 17, 47, ), + array(14, 35, 53, ), + array(14, 35, 53, ), + array(1, 2, ), + array(3, 4, 5, 6, 9, 10, 11, 12, 18, 19, 20, 25, 29, 30, 31, ), + array(2, 9, 12, 15, 16, 17, 44, 47, 49, 51, ), + array(12, 14, 16, 53, ), + array(9, 12, 16, 49, ), + array(1, 13, 26, 32, ), + array(1, 13, 26, 32, ), + array(1, 13, 26, 32, ), + array(15, 17, 47, ), + array(9, 12, 16, ), + array(9, 12, 16, ), + array(14, 16, ), + array(17, 47, ), + array(1, 28, ), + array(26, 32, ), + array(14, 16, ), + array(26, 32, ), + array(26, 32, ), + array(1, 52, ), + array(14, 53, ), + array(1, 17, ), + array(26, 32, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(17, ), + array(1, ), + array(1, ), + array(1, ), + array(1, ), + array(17, ), + array(1, ), + array(1, ), + array(), + array(), + array(2, 9, 12, 16, 17, 44, 47, 49, 51, 52, ), + array(2, 9, 12, 15, 16, 17, 44, 47, 49, 51, ), + array(2, 9, 12, 16, 17, 44, 47, 49, 51, ), + array(2, 9, 12, 16, 17, 44, 47, 49, 51, ), + array(9, 12, 16, 17, 44, 47, 49, 51, ), + array(12, 14, 16, 33, 53, ), + array(9, 12, 16, 49, ), + array(9, 12, 16, ), + array(15, 44, 51, ), + array(14, 53, ), + array(26, 32, ), + array(44, 51, ), + array(26, 32, ), + array(44, 51, ), + array(44, 51, ), + array(44, 51, ), + array(44, 51, ), + array(26, 32, ), + array(26, 32, ), + array(26, 32, ), + array(44, 51, ), + array(26, 32, ), + array(26, 32, ), + array(44, 51, ), + array(26, 32, ), + array(15, 22, ), + array(26, 32, ), + array(26, 32, ), + array(26, 32, ), + array(44, 51, ), + array(44, 51, ), + array(26, 32, ), + array(44, 51, ), + array(12, 35, ), + array(26, 32, ), + array(14, 53, ), + array(1, ), + array(17, ), + array(2, ), + array(17, ), + array(2, ), + array(17, ), + array(1, ), + array(1, ), + array(35, ), + array(1, ), + array(), + array(), + array(), + array(), + array(), + array(), + array(2, 35, 37, 38, 39, 47, 54, 55, 56, 57, ), + array(13, 21, 23, 26, 32, 34, 36, 44, ), + array(13, 15, 26, 32, 35, 47, ), + array(13, 22, 26, 32, 45, ), + array(13, 22, 26, 32, 45, ), + array(35, 44, 47, 52, ), + array(9, 12, 16, 49, ), + array(22, 45, 52, ), + array(28, 35, 47, ), + array(22, 45, 60, ), + array(35, 47, ), + array(21, 34, ), + array(34, 36, ), + array(16, 49, ), + array(6, 8, ), + array(44, 52, ), + array(7, 8, ), + array(34, 52, ), + array(35, 47, ), + array(35, 47, ), + array(22, 45, ), + array(34, 36, ), + array(15, 44, ), + array(34, 36, ), + array(34, 36, ), + array(13, ), + array(16, ), + array(50, ), + array(7, ), + array(16, ), + array(52, ), + array(23, ), + array(36, ), + array(50, ), + array(14, ), + array(13, ), + array(52, ), + array(15, ), + array(16, ), + array(40, ), + array(16, ), + array(35, ), + array(16, ), + array(33, ), + array(16, ), + array(33, ), + array(35, ), + array(44, ), + array(16, ), + array(16, ), + array(16, ), + array(16, ), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), + array(), +); + public static $yy_default = array( + 336, 512, 512, 512, 497, 497, 512, 474, 474, 474, + 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 377, 377, 356, 512, + 512, 413, 512, 377, 512, 512, 512, 512, 512, 512, + 512, 512, 382, 512, 349, 512, 512, 512, 382, 379, + 389, 388, 384, 402, 473, 397, 498, 500, 401, 361, + 472, 499, 349, 377, 377, 487, 377, 377, 429, 512, + 512, 368, 326, 428, 512, 439, 391, 391, 391, 429, + 439, 439, 512, 429, 391, 377, 512, 377, 377, 391, + 512, 371, 358, 395, 394, 396, 373, 429, 400, 404, + 391, 404, 484, 406, 405, 481, 334, 428, 428, 428, + 428, 428, 512, 441, 439, 455, 512, 363, 435, 354, + 434, 437, 433, 432, 359, 357, 364, 436, 353, 367, + 466, 365, 512, 352, 350, 360, 467, 465, 346, 464, + 439, 366, 512, 369, 461, 475, 488, 476, 485, 372, + 422, 439, 374, 480, 439, 480, 480, 439, 334, 413, + 409, 413, 403, 403, 413, 440, 403, 413, 403, 413, + 512, 512, 512, 332, 409, 512, 512, 512, 423, 403, + 512, 409, 512, 512, 512, 512, 512, 512, 512, 418, + 385, 512, 512, 512, 512, 512, 512, 512, 415, 512, + 455, 512, 512, 512, 411, 486, 409, 512, 512, 512, + 512, 419, 407, 362, 445, 418, 425, 424, 420, 339, + 460, 421, 483, 398, 416, 340, 399, 455, 378, 337, + 338, 330, 328, 329, 442, 443, 444, 438, 392, 393, + 427, 426, 386, 417, 408, 390, 410, 331, 333, 335, + 412, 470, 414, 415, 503, 478, 495, 471, 459, 458, + 375, 457, 344, 462, 508, 493, 376, 496, 456, 509, + 494, 501, 504, 511, 510, 507, 505, 502, 506, 345, + 468, 469, 446, 355, 341, 452, 450, 454, 448, 453, + 447, 489, 490, 491, 463, 449, 492, 451, 327, 342, + 343, 370, 430, 431, 479, 477, +); + const YYNOCODE = 109; + const YYSTACKDEPTH = 500; + const YYNSTATE = 326; + const YYNRULE = 186; + const YYERRORSYMBOL = 61; + const YYERRSYMDT = 'yy0'; + const YYFALLBACK = 0; + public static $yyFallback = array( + ); public function Trace($TraceFILE, $zTracePrompt) { if (!$TraceFILE) { @@ -1840,18 +1110,250 @@ public function PrintTrace() $this->yyTracePrompt = '
'; } + public $yyTraceFILE; + public $yyTracePrompt; + public $yyidx; /* Index of top element in stack */ + public $yyerrcnt; /* Shifts left before out of the error */ + public $yystack = array(); /* The parser's stack */ + + public $yyTokenName = array( + '$', 'VERT', 'COLON', 'TEXT', + 'STRIPON', 'STRIPOFF', 'LITERALSTART', 'LITERALEND', + 'LITERAL', 'SIMPELOUTPUT', 'SIMPLETAG', 'SMARTYBLOCKCHILDPARENT', + 'LDEL', 'RDEL', 'DOLLARID', 'EQUAL', + 'ID', 'PTR', 'LDELMAKENOCACHE', 'LDELIF', + 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', + 'STEP', 'LDELFOREACH', 'SPACE', 'AS', + 'APTR', 'LDELSETFILTER', 'CLOSETAG', 'LDELSLASH', + 'ATTR', 'INTEGER', 'COMMA', 'OPENP', + 'CLOSEP', 'MATH', 'UNIMATH', 'ISIN', + 'QMARK', 'NOT', 'TYPECAST', 'HEX', + 'DOT', 'INSTANCEOF', 'SINGLEQUOTESTRING', 'DOUBLECOLON', + 'NAMESPACE', 'AT', 'HATCH', 'OPENB', + 'CLOSEB', 'DOLLAR', 'LOGOP', 'SLOGOP', + 'TLOGOP', 'SINGLECOND', 'ARRAYOPEN', 'QUOTE', + 'BACKTICK', 'error', 'start', 'template', + 'literal_e2', 'literal_e1', 'smartytag', 'tagbody', + 'tag', 'outattr', 'eqoutattr', 'varindexed', + 'output', 'attributes', 'variable', 'value', + 'expr', 'modifierlist', 'statement', 'statements', + 'foraction', 'varvar', 'modparameters', 'attribute', + 'ternary', 'tlop', 'lop', 'scond', + 'array', 'function', 'ns1', 'doublequoted_with_quotes', + 'static_class_access', 'arraydef', 'object', 'arrayindex', + 'indexdef', 'varvarele', 'objectchain', 'objectelement', + 'method', 'params', 'modifier', 'modparameter', + 'arrayelements', 'arrayelement', 'doublequoted', 'doublequotedcontent', + ); + + public static $yyRuleName = array( + 'start ::= template', + 'template ::= template TEXT', + 'template ::= template STRIPON', + 'template ::= template STRIPOFF', + 'template ::= template LITERALSTART literal_e2 LITERALEND', + 'literal_e2 ::= literal_e1 LITERALSTART literal_e1 LITERALEND', + 'literal_e2 ::= literal_e1', + 'literal_e1 ::= literal_e1 LITERAL', + 'literal_e1 ::=', + 'template ::= template smartytag', + 'template ::=', + 'smartytag ::= SIMPELOUTPUT', + 'smartytag ::= SIMPLETAG', + 'smartytag ::= SMARTYBLOCKCHILDPARENT', + 'smartytag ::= LDEL tagbody RDEL', + 'smartytag ::= tag RDEL', + 'tagbody ::= outattr', + 'tagbody ::= DOLLARID eqoutattr', + 'tagbody ::= varindexed eqoutattr', + 'eqoutattr ::= EQUAL outattr', + 'outattr ::= output attributes', + 'output ::= variable', + 'output ::= value', + 'output ::= expr', + 'tag ::= LDEL ID attributes', + 'tag ::= LDEL ID', + 'tag ::= LDEL ID modifierlist attributes', + 'tag ::= LDEL ID PTR ID attributes', + 'tag ::= LDEL ID PTR ID modifierlist attributes', + 'tag ::= LDELMAKENOCACHE DOLLARID', + 'tag ::= LDELIF expr', + 'tag ::= LDELIF expr attributes', + 'tag ::= LDELIF statement', + 'tag ::= LDELIF statement attributes', + 'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes', + 'foraction ::= EQUAL expr', + 'foraction ::= INCDEC', + 'tag ::= LDELFOR statement TO expr attributes', + 'tag ::= LDELFOR statement TO expr STEP expr attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar attributes', + 'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', + 'tag ::= LDELFOREACH attributes', + 'tag ::= LDELSETFILTER ID modparameters', + 'tag ::= LDELSETFILTER ID modparameters modifierlist', + 'smartytag ::= CLOSETAG', + 'tag ::= LDELSLASH ID', + 'tag ::= LDELSLASH ID modifierlist', + 'tag ::= LDELSLASH ID PTR ID', + 'tag ::= LDELSLASH ID PTR ID modifierlist', + 'attributes ::= attributes attribute', + 'attributes ::= attribute', + 'attributes ::=', + 'attribute ::= SPACE ID EQUAL ID', + 'attribute ::= ATTR expr', + 'attribute ::= ATTR value', + 'attribute ::= SPACE ID', + 'attribute ::= SPACE expr', + 'attribute ::= SPACE value', + 'attribute ::= SPACE INTEGER EQUAL expr', + 'statements ::= statement', + 'statements ::= statements COMMA statement', + 'statement ::= DOLLARID EQUAL INTEGER', + 'statement ::= DOLLARID EQUAL expr', + 'statement ::= varindexed EQUAL expr', + 'statement ::= OPENP statement CLOSEP', + 'expr ::= value', + 'expr ::= ternary', + 'expr ::= DOLLARID COLON ID', + 'expr ::= expr MATH value', + 'expr ::= expr UNIMATH value', + 'expr ::= expr tlop value', + 'expr ::= expr lop expr', + 'expr ::= expr scond', + 'expr ::= expr ISIN array', + 'expr ::= expr ISIN value', + 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr', + 'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', + 'value ::= variable', + 'value ::= UNIMATH value', + 'value ::= NOT value', + 'value ::= TYPECAST value', + 'value ::= variable INCDEC', + 'value ::= HEX', + 'value ::= INTEGER', + 'value ::= INTEGER DOT INTEGER', + 'value ::= INTEGER DOT', + 'value ::= DOT INTEGER', + 'value ::= ID', + 'value ::= function', + 'value ::= OPENP expr CLOSEP', + 'value ::= variable INSTANCEOF ns1', + 'value ::= variable INSTANCEOF variable', + 'value ::= SINGLEQUOTESTRING', + 'value ::= doublequoted_with_quotes', + 'value ::= varindexed DOUBLECOLON static_class_access', + 'value ::= smartytag', + 'value ::= value modifierlist', + 'value ::= NAMESPACE', + 'value ::= arraydef', + 'value ::= ns1 DOUBLECOLON static_class_access', + 'ns1 ::= ID', + 'ns1 ::= NAMESPACE', + 'variable ::= DOLLARID', + 'variable ::= varindexed', + 'variable ::= varvar AT ID', + 'variable ::= object', + 'variable ::= HATCH ID HATCH', + 'variable ::= HATCH ID HATCH arrayindex', + 'variable ::= HATCH variable HATCH', + 'variable ::= HATCH variable HATCH arrayindex', + 'varindexed ::= DOLLARID arrayindex', + 'varindexed ::= varvar arrayindex', + 'arrayindex ::= arrayindex indexdef', + 'arrayindex ::=', + 'indexdef ::= DOT DOLLARID', + 'indexdef ::= DOT varvar', + 'indexdef ::= DOT varvar AT ID', + 'indexdef ::= DOT ID', + 'indexdef ::= DOT INTEGER', + 'indexdef ::= DOT LDEL expr RDEL', + 'indexdef ::= OPENB ID CLOSEB', + 'indexdef ::= OPENB ID DOT ID CLOSEB', + 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB', + 'indexdef ::= OPENB INTEGER CLOSEB', + 'indexdef ::= OPENB DOLLARID CLOSEB', + 'indexdef ::= OPENB variable CLOSEB', + 'indexdef ::= OPENB value CLOSEB', + 'indexdef ::= OPENB expr CLOSEB', + 'indexdef ::= OPENB CLOSEB', + 'varvar ::= DOLLARID', + 'varvar ::= DOLLAR', + 'varvar ::= varvar varvarele', + 'varvarele ::= ID', + 'varvarele ::= SIMPELOUTPUT', + 'varvarele ::= LDEL expr RDEL', + 'object ::= varindexed objectchain', + 'objectchain ::= objectelement', + 'objectchain ::= objectchain objectelement', + 'objectelement ::= PTR ID arrayindex', + 'objectelement ::= PTR varvar arrayindex', + 'objectelement ::= PTR LDEL expr RDEL arrayindex', + 'objectelement ::= PTR ID LDEL expr RDEL arrayindex', + 'objectelement ::= PTR method', + 'function ::= ns1 OPENP params CLOSEP', + 'method ::= ID OPENP params CLOSEP', + 'method ::= DOLLARID OPENP params CLOSEP', + 'params ::= params COMMA expr', + 'params ::= expr', + 'params ::=', + 'modifierlist ::= modifierlist modifier modparameters', + 'modifierlist ::= modifier modparameters', + 'modifier ::= VERT AT ID', + 'modifier ::= VERT ID', + 'modparameters ::= modparameters modparameter', + 'modparameters ::=', + 'modparameter ::= COLON value', + 'modparameter ::= COLON UNIMATH value', + 'modparameter ::= COLON array', + 'static_class_access ::= method', + 'static_class_access ::= method objectchain', + 'static_class_access ::= ID', + 'static_class_access ::= DOLLARID arrayindex', + 'static_class_access ::= DOLLARID arrayindex objectchain', + 'lop ::= LOGOP', + 'lop ::= SLOGOP', + 'tlop ::= TLOGOP', + 'scond ::= SINGLECOND', + 'arraydef ::= OPENB arrayelements CLOSEB', + 'arraydef ::= ARRAYOPEN arrayelements CLOSEP', + 'arrayelements ::= arrayelement', + 'arrayelements ::= arrayelements COMMA arrayelement', + 'arrayelements ::=', + 'arrayelement ::= value APTR expr', + 'arrayelement ::= ID APTR expr', + 'arrayelement ::= expr', + 'doublequoted_with_quotes ::= QUOTE QUOTE', + 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE', + 'doublequoted ::= doublequoted doublequotedcontent', + 'doublequoted ::= doublequotedcontent', + 'doublequotedcontent ::= BACKTICK variable BACKTICK', + 'doublequotedcontent ::= BACKTICK expr BACKTICK', + 'doublequotedcontent ::= DOLLARID', + 'doublequotedcontent ::= LDEL variable RDEL', + 'doublequotedcontent ::= LDEL expr RDEL', + 'doublequotedcontent ::= smartytag', + 'doublequotedcontent ::= TEXT', + ); + public function tokenName($tokenType) { if ($tokenType === 0) { return 'End of Input'; } if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { - return $this->yyTokenName[ $tokenType ]; + return $this->yyTokenName[$tokenType]; } else { return 'Unknown'; } } + public static function yy_destructor($yymajor, $yypminor) + { + switch ($yymajor) { + default: break; /* If no destructor action specified: do nothing */ + } + } + public function yy_pop_parser_stack() { if (empty($this->yystack)) { @@ -1860,18 +1362,19 @@ public function yy_pop_parser_stack() $yytos = array_pop($this->yystack); if ($this->yyTraceFILE && $this->yyidx >= 0) { fwrite($this->yyTraceFILE, - $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . - "\n"); + $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[$yytos->major] . + "\n"); } $yymajor = $yytos->major; self::yy_destructor($yymajor, $yytos->minor); $this->yyidx--; + return $yymajor; } public function __destruct() { - while ($this->yystack !== array()) { + while ($this->yystack !== Array()) { $this->yy_pop_parser_stack(); } if (is_resource($this->yyTraceFILE)) { @@ -1883,14 +1386,14 @@ public function yy_get_expected_tokens($token) { static $res3 = array(); static $res4 = array(); - $state = $this->yystack[ $this->yyidx ]->stateno; - $expected = self::$yyExpectedTokens[ $state ]; - if (isset($res3[ $state ][ $token ])) { - if ($res3[ $state ][ $token ]) { + $state = $this->yystack[$this->yyidx]->stateno; + $expected = self::$yyExpectedTokens[$state]; + if (isset($res3[$state][$token])) { + if ($res3[$state][$token]) { return $expected; } } else { - if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + if ($res3[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { return $expected; } } @@ -1910,21 +1413,20 @@ public function yy_get_expected_tokens($token) return array_unique($expected); } $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; $nextstate = $this->yy_find_reduce_action( - $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset(self::$yyExpectedTokens[ $nextstate ])) { - $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); - if (isset($res4[ $nextstate ][ $token ])) { - if ($res4[ $nextstate ][ $token ]) { + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset(self::$yyExpectedTokens[$nextstate])) { + $expected = array_merge($expected, self::$yyExpectedTokens[$nextstate]); + if (isset($res4[$nextstate][$token])) { + if ($res4[$nextstate][$token]) { $this->yyidx = $yyidx; $this->yystack = $stack; return array_unique($expected); } } else { - if ($res4[ $nextstate ][ $token ] = - in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) { + if ($res4[$nextstate][$token] = in_array($token, self::$yyExpectedTokens[$nextstate], true)) { $this->yyidx = $yyidx; $this->yystack = $stack; return array_unique($expected); @@ -1936,8 +1438,8 @@ public function yy_get_expected_tokens($token) $this->yyidx++; $x = new TP_yyStackEntry; $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; continue 2; } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; @@ -1958,8 +1460,9 @@ public function yy_get_expected_tokens($token) } break; } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; + $this->yyidx = $yyidx; + $this->yystack = $stack; + return array_unique($expected); } @@ -1970,16 +1473,16 @@ public function yy_is_expected_token($token) if ($token === 0) { return true; // 0 is not part of this } - $state = $this->yystack[ $this->yyidx ]->stateno; - if (isset($res[ $state ][ $token ])) { - if ($res[ $state ][ $token ]) { + $state = $this->yystack[$this->yyidx]->stateno; + if (isset($res[$state][$token])) { + if ($res[$state][$token]) { return true; } } else { - if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { + if ($res[$state][$token] = in_array($token, self::$yyExpectedTokens[$state], true)) { return true; } - } + } $stack = $this->yystack; $yyidx = $this->yyidx; do { @@ -1996,20 +1499,18 @@ public function yy_is_expected_token($token) return true; } $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $this->yyidx -= self::$yyRuleInfo[$yyruleno][1]; $nextstate = $this->yy_find_reduce_action( - $this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset($res2[ $nextstate ][ $token ])) { - if ($res2[ $nextstate ][ $token ]) { + $this->yystack[$this->yyidx]->stateno, + self::$yyRuleInfo[$yyruleno][0]); + if (isset($res2[$nextstate][$token])) { + if ($res2[$nextstate][$token]) { $this->yyidx = $yyidx; $this->yystack = $stack; return true; } } else { - if ($res2[ $nextstate ][ $token ] = - (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, self::$yyExpectedTokens[ $nextstate ], true))) { + if ($res2[$nextstate][$token] = (isset(self::$yyExpectedTokens[$nextstate]) && in_array($token, self::$yyExpectedTokens[$nextstate], true))) { $this->yyidx = $yyidx; $this->yystack = $stack; return true; @@ -2020,8 +1521,8 @@ public function yy_is_expected_token($token) $this->yyidx++; $x = new TP_yyStackEntry; $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; + $x->major = self::$yyRuleInfo[$yyruleno][0]; + $this->yystack[$this->yyidx] = $x; continue 2; } elseif ($nextstate === self::YYNSTATE + self::YYNRULE + 1) { $this->yyidx = $yyidx; @@ -2048,65 +1549,69 @@ public function yy_is_expected_token($token) } while (true); $this->yyidx = $yyidx; $this->yystack = $stack; + return true; } - public function yy_find_shift_action($iLookAhead) + public function yy_find_shift_action($iLookAhead) { - $stateno = $this->yystack[ $this->yyidx ]->stateno; + $stateno = $this->yystack[$this->yyidx]->stateno; + /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ - if (!isset(self::$yy_shift_ofst[ $stateno ])) { + if (!isset(self::$yy_shift_ofst[$stateno])) { // no shift actions - return self::$yy_default[ $stateno ]; + return self::$yy_default[$stateno]; } - $i = self::$yy_shift_ofst[ $stateno ]; + $i = self::$yy_shift_ofst[$stateno]; if ($i === self::YY_SHIFT_USE_DFLT) { - return self::$yy_default[ $stateno ]; + return self::$yy_default[$stateno]; } if ($iLookAhead === self::YYNOCODE) { return self::YY_NO_ACTION; } $i += $iLookAhead; if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[ $i ] != $iLookAhead) { + self::$yy_lookahead[$i] != $iLookAhead) { if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) - && ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0) { + && ($iFallback = self::$yyFallback[$iLookAhead]) != 0) { if ($this->yyTraceFILE) { fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'FALLBACK ' . - $this->yyTokenName[ $iLookAhead ] . ' => ' . - $this->yyTokenName[ $iFallback ] . "\n"); + $this->yyTokenName[$iLookAhead] . ' => ' . + $this->yyTokenName[$iFallback] . "\n"); } + return $this->yy_find_shift_action($iFallback); } - return self::$yy_default[ $stateno ]; + + return self::$yy_default[$stateno]; } else { - return self::$yy_action[ $i ]; + return self::$yy_action[$i]; } } public function yy_find_reduce_action($stateno, $iLookAhead) { /* $stateno = $this->yystack[$this->yyidx]->stateno; */ - if (!isset(self::$yy_reduce_ofst[ $stateno ])) { - return self::$yy_default[ $stateno ]; + + if (!isset(self::$yy_reduce_ofst[$stateno])) { + return self::$yy_default[$stateno]; } - $i = self::$yy_reduce_ofst[ $stateno ]; + $i = self::$yy_reduce_ofst[$stateno]; if ($i === self::YY_REDUCE_USE_DFLT) { - return self::$yy_default[ $stateno ]; + return self::$yy_default[$stateno]; } if ($iLookAhead === self::YYNOCODE) { return self::YY_NO_ACTION; } $i += $iLookAhead; if ($i < 0 || $i >= self::YY_SZ_ACTTAB || - self::$yy_lookahead[ $i ] != $iLookAhead) { - return self::$yy_default[ $stateno ]; + self::$yy_lookahead[$i] != $iLookAhead) { + return self::$yy_default[$stateno]; } else { - return self::$yy_action[ $i ]; + return self::$yy_action[$i]; } } - // line 234 "../smarty/lexer/smarty_internal_templateparser.y" public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; @@ -2118,9 +1623,11 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - // line 221 "../smarty/lexer/smarty_internal_templateparser.y" - $this->internalError = true; - $this->compiler->trigger_template_error('Stack overflow in template parser'); +// line 220 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->compiler->trigger_template_error('Stack overflow in template parser'); + return; } $yytos = new TP_yyStackEntry; @@ -2134,1357 +1641,1150 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); for ($i = 1; $i <= $this->yyidx; $i++) { fprintf($this->yyTraceFILE, " %s", - $this->yyTokenName[ $this->yystack[ $i ]->major ]); + $this->yyTokenName[$this->yystack[$i]->major]); } - fwrite($this->yyTraceFILE, "\n"); + fwrite($this->yyTraceFILE,"\n"); } } - // line 242 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r0() - { - $this->root_buffer->prepend_array($this, $this->template_prefix); - $this->root_buffer->append_array($this, $this->template_postfix); - $this->_retvalue = $this->root_buffer->to_smarty_php($this); - } + public static $yyRuleInfo = array( + array( 0 => 62, 1 => 1 ), + array( 0 => 63, 1 => 2 ), + array( 0 => 63, 1 => 2 ), + array( 0 => 63, 1 => 2 ), + array( 0 => 63, 1 => 4 ), + array( 0 => 64, 1 => 4 ), + array( 0 => 64, 1 => 1 ), + array( 0 => 65, 1 => 2 ), + array( 0 => 65, 1 => 0 ), + array( 0 => 63, 1 => 2 ), + array( 0 => 63, 1 => 0 ), + array( 0 => 66, 1 => 1 ), + array( 0 => 66, 1 => 1 ), + array( 0 => 66, 1 => 1 ), + array( 0 => 66, 1 => 3 ), + array( 0 => 66, 1 => 2 ), + array( 0 => 67, 1 => 1 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 67, 1 => 2 ), + array( 0 => 70, 1 => 2 ), + array( 0 => 69, 1 => 2 ), + array( 0 => 72, 1 => 1 ), + array( 0 => 72, 1 => 1 ), + array( 0 => 72, 1 => 1 ), + array( 0 => 68, 1 => 3 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 4 ), + array( 0 => 68, 1 => 5 ), + array( 0 => 68, 1 => 6 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 3 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 3 ), + array( 0 => 68, 1 => 8 ), + array( 0 => 80, 1 => 2 ), + array( 0 => 80, 1 => 1 ), + array( 0 => 68, 1 => 5 ), + array( 0 => 68, 1 => 7 ), + array( 0 => 68, 1 => 6 ), + array( 0 => 68, 1 => 8 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 3 ), + array( 0 => 68, 1 => 4 ), + array( 0 => 66, 1 => 1 ), + array( 0 => 68, 1 => 2 ), + array( 0 => 68, 1 => 3 ), + array( 0 => 68, 1 => 4 ), + array( 0 => 68, 1 => 5 ), + array( 0 => 73, 1 => 2 ), + array( 0 => 73, 1 => 1 ), + array( 0 => 73, 1 => 0 ), + array( 0 => 83, 1 => 4 ), + array( 0 => 83, 1 => 2 ), + array( 0 => 83, 1 => 2 ), + array( 0 => 83, 1 => 2 ), + array( 0 => 83, 1 => 2 ), + array( 0 => 83, 1 => 2 ), + array( 0 => 83, 1 => 4 ), + array( 0 => 79, 1 => 1 ), + array( 0 => 79, 1 => 3 ), + array( 0 => 78, 1 => 3 ), + array( 0 => 78, 1 => 3 ), + array( 0 => 78, 1 => 3 ), + array( 0 => 78, 1 => 3 ), + array( 0 => 76, 1 => 1 ), + array( 0 => 76, 1 => 1 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 2 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 76, 1 => 3 ), + array( 0 => 84, 1 => 7 ), + array( 0 => 84, 1 => 7 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 2 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 1 ), + array( 0 => 75, 1 => 3 ), + array( 0 => 90, 1 => 1 ), + array( 0 => 90, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 1 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 4 ), + array( 0 => 74, 1 => 3 ), + array( 0 => 74, 1 => 4 ), + array( 0 => 71, 1 => 2 ), + array( 0 => 71, 1 => 2 ), + array( 0 => 95, 1 => 2 ), + array( 0 => 95, 1 => 0 ), + array( 0 => 96, 1 => 2 ), + array( 0 => 96, 1 => 2 ), + array( 0 => 96, 1 => 4 ), + array( 0 => 96, 1 => 2 ), + array( 0 => 96, 1 => 2 ), + array( 0 => 96, 1 => 4 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 5 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 3 ), + array( 0 => 96, 1 => 2 ), + array( 0 => 81, 1 => 1 ), + array( 0 => 81, 1 => 1 ), + array( 0 => 81, 1 => 2 ), + array( 0 => 97, 1 => 1 ), + array( 0 => 97, 1 => 1 ), + array( 0 => 97, 1 => 3 ), + array( 0 => 94, 1 => 2 ), + array( 0 => 98, 1 => 1 ), + array( 0 => 98, 1 => 2 ), + array( 0 => 99, 1 => 3 ), + array( 0 => 99, 1 => 3 ), + array( 0 => 99, 1 => 5 ), + array( 0 => 99, 1 => 6 ), + array( 0 => 99, 1 => 2 ), + array( 0 => 89, 1 => 4 ), + array( 0 => 100, 1 => 4 ), + array( 0 => 100, 1 => 4 ), + array( 0 => 101, 1 => 3 ), + array( 0 => 101, 1 => 1 ), + array( 0 => 101, 1 => 0 ), + array( 0 => 77, 1 => 3 ), + array( 0 => 77, 1 => 2 ), + array( 0 => 102, 1 => 3 ), + array( 0 => 102, 1 => 2 ), + array( 0 => 82, 1 => 2 ), + array( 0 => 82, 1 => 0 ), + array( 0 => 103, 1 => 2 ), + array( 0 => 103, 1 => 3 ), + array( 0 => 103, 1 => 2 ), + array( 0 => 92, 1 => 1 ), + array( 0 => 92, 1 => 2 ), + array( 0 => 92, 1 => 1 ), + array( 0 => 92, 1 => 2 ), + array( 0 => 92, 1 => 3 ), + array( 0 => 86, 1 => 1 ), + array( 0 => 86, 1 => 1 ), + array( 0 => 85, 1 => 1 ), + array( 0 => 87, 1 => 1 ), + array( 0 => 93, 1 => 3 ), + array( 0 => 93, 1 => 3 ), + array( 0 => 104, 1 => 1 ), + array( 0 => 104, 1 => 3 ), + array( 0 => 104, 1 => 0 ), + array( 0 => 105, 1 => 3 ), + array( 0 => 105, 1 => 3 ), + array( 0 => 105, 1 => 1 ), + array( 0 => 91, 1 => 2 ), + array( 0 => 91, 1 => 3 ), + array( 0 => 106, 1 => 2 ), + array( 0 => 106, 1 => 1 ), + array( 0 => 107, 1 => 3 ), + array( 0 => 107, 1 => 3 ), + array( 0 => 107, 1 => 1 ), + array( 0 => 107, 1 => 3 ), + array( 0 => 107, 1 => 3 ), + array( 0 => 107, 1 => 1 ), + array( 0 => 107, 1 => 1 ), + ); - // line 251 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r1() - { - $code = - $this->compiler->compileTag('private_php', - array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), array('type' => $this->lex->phpType)), - array()); - if ($this->compiler->has_code && !empty($code)) { - $tmp = ''; - foreach ($this->compiler->prefix_code as $code) { - $tmp .= $code; + public static $yyReduceMap = array( + 0 => 0, + 1 => 1, + 2 => 2, + 3 => 3, + 4 => 4, + 5 => 5, + 6 => 6, + 21 => 6, + 22 => 6, + 23 => 6, + 36 => 6, + 56 => 6, + 57 => 6, + 65 => 6, + 66 => 6, + 77 => 6, + 82 => 6, + 83 => 6, + 88 => 6, + 92 => 6, + 93 => 6, + 97 => 6, + 98 => 6, + 100 => 6, + 105 => 6, + 169 => 6, + 174 => 6, + 7 => 7, + 8 => 8, + 9 => 9, + 11 => 11, + 12 => 12, + 13 => 13, + 14 => 14, + 15 => 15, + 16 => 16, + 17 => 17, + 18 => 18, + 19 => 19, + 20 => 20, + 24 => 24, + 25 => 25, + 26 => 26, + 27 => 27, + 28 => 28, + 29 => 29, + 30 => 30, + 31 => 31, + 33 => 31, + 32 => 32, + 34 => 34, + 35 => 35, + 37 => 37, + 38 => 38, + 39 => 39, + 40 => 40, + 41 => 41, + 42 => 42, + 43 => 43, + 44 => 44, + 45 => 45, + 46 => 46, + 47 => 47, + 48 => 48, + 49 => 49, + 50 => 50, + 59 => 50, + 147 => 50, + 151 => 50, + 155 => 50, + 157 => 50, + 51 => 51, + 148 => 51, + 154 => 51, + 52 => 52, + 53 => 53, + 54 => 53, + 55 => 55, + 132 => 55, + 58 => 58, + 60 => 60, + 61 => 61, + 62 => 61, + 63 => 63, + 64 => 64, + 67 => 67, + 68 => 68, + 69 => 68, + 70 => 70, + 71 => 71, + 72 => 72, + 73 => 73, + 74 => 74, + 75 => 75, + 76 => 76, + 78 => 78, + 80 => 78, + 81 => 78, + 112 => 78, + 79 => 79, + 84 => 84, + 85 => 85, + 86 => 86, + 87 => 87, + 89 => 89, + 90 => 90, + 91 => 90, + 94 => 94, + 95 => 95, + 96 => 96, + 99 => 99, + 101 => 101, + 102 => 102, + 103 => 103, + 104 => 104, + 106 => 106, + 107 => 107, + 108 => 108, + 109 => 109, + 110 => 110, + 111 => 111, + 113 => 113, + 171 => 113, + 114 => 114, + 115 => 115, + 116 => 116, + 117 => 117, + 118 => 118, + 119 => 119, + 127 => 119, + 120 => 120, + 121 => 121, + 122 => 122, + 123 => 122, + 125 => 122, + 126 => 122, + 124 => 124, + 128 => 128, + 129 => 129, + 130 => 130, + 175 => 130, + 131 => 131, + 133 => 133, + 134 => 134, + 135 => 135, + 136 => 136, + 137 => 137, + 138 => 138, + 139 => 139, + 140 => 140, + 141 => 141, + 142 => 142, + 143 => 143, + 144 => 144, + 145 => 145, + 146 => 146, + 149 => 149, + 150 => 150, + 152 => 152, + 153 => 153, + 156 => 156, + 158 => 158, + 159 => 159, + 160 => 160, + 161 => 161, + 162 => 162, + 163 => 163, + 164 => 164, + 165 => 165, + 166 => 166, + 167 => 167, + 168 => 167, + 170 => 170, + 172 => 172, + 173 => 173, + 176 => 176, + 177 => 177, + 178 => 178, + 179 => 179, + 182 => 179, + 180 => 180, + 183 => 180, + 181 => 181, + 184 => 184, + 185 => 185, + ); +// line 233 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r0(){ + $this->root_buffer->prepend_array($this, $this->template_prefix); + $this->root_buffer->append_array($this, $this->template_postfix); + $this->_retvalue = $this->root_buffer->to_smarty_php($this); + } +// line 240 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r1(){ + $text = $this->yystack[ $this->yyidx + 0 ]->minor; + + if ((string)$text == '') { + $this->current_buffer->append_subtree($this, null); + } + + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($text, $this->strip)); + } +// line 250 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r2(){ + $this->strip = true; + } +// line 254 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r3(){ + $this->strip = false; + } +// line 259 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r4(){ + $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($this->yystack[$this->yyidx + -1]->minor)); + } +// line 264 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r5(){ + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor.$this->yystack[$this->yyidx + -1]->minor; + } +// line 267 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r6(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 271 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r7(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; + + } +// line 276 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r8(){ + $this->_retvalue = ''; + } +// line 280 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r9(){ + if ($this->compiler->has_code) { + $this->current_buffer->append_subtree($this, $this->mergePrefixCode($this->yystack[$this->yyidx + 0]->minor)); + } + $this->compiler->has_variable_string = false; + $this->block_nesting_level = count($this->compiler->_tag_stack); + } +// line 292 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r11(){ + $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { + $this->_retvalue = $this->compiler->compileTag('private_print_expression',array('nocache'),array('value'=>$this->compiler->compileVariable('\''.$match[1].'\''))); + } else { + $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->compiler->compileVariable('\''.$var.'\''))); + } + } +// line 302 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r12(){ + $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength())); + if ($tag == 'strip') { + $this->strip = true; + $this->_retvalue = null; + } else { + if (defined($tag)) { + if ($this->security) { + $this->security->isTrustedConstant($tag, $this->compiler); + } + $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$tag)); + } else { + if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { + $this->_retvalue = $this->compiler->compileTag($match[1],array('\'nocache\'')); + } else { + $this->_retvalue = $this->compiler->compileTag($tag,array()); } - $this->compiler->prefix_code = array(); - $this->current_buffer->append_subtree($this, - new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $code, true))); } } - - // line 255 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r2() - { - $text = $this->yystack[ $this->yyidx + 0 ]->minor; - - if ((string)$text == '') { - $this->current_buffer->append_subtree($this, null); - } - - $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Text($text, $this->strip)); } - - // line 259 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r3() - { - $this->strip = true; +// line 323 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r13(){ + $j = strrpos($this->yystack[$this->yyidx + 0]->minor,'.'); + if ($this->yystack[$this->yyidx + 0]->minor[$j+1] == 'c') { + // {$smarty.block.child} + $this->_retvalue = $this->compiler->compileTag('child',array(),array($this->yystack[$this->yyidx + 0]->minor)); + } else { + // {$smarty.block.parent} + $this->_retvalue = $this->compiler->compileTag('parent',array(),array($this->yystack[$this->yyidx + 0]->minor)); + } + } +// line 334 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r14(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 338 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r15(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + } +// line 342 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r16(){ + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor[1],array('value'=>$this->yystack[$this->yyidx + 0]->minor[0])); + } +// line 351 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r17(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'')),$this->yystack[$this->yyidx + 0]->minor[1])); + } +// line 355 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r18(){ + $this->_retvalue = $this->compiler->compileTag('assign',array_merge(array(array('value'=>$this->yystack[$this->yyidx + 0]->minor[0]),array('var'=>$this->yystack[$this->yyidx + -1]->minor['var'])),$this->yystack[$this->yyidx + 0]->minor[1]),array('smarty_internal_index'=>$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'])); + } +// line 359 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r19(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } +// line 363 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r20(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +// line 378 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r24(){ + if (defined($this->yystack[$this->yyidx + -1]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + -1]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor,array('value'=>$this->yystack[$this->yyidx + -1]->minor)); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } } - - // line 264 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r4() - { +// line 388 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r25(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compileTag('private_print_expression',array(),array('value'=>$this->yystack[$this->yyidx + 0]->minor)); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor,array()); + } + } +// line 401 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r26(){ + if (defined($this->yystack[$this->yyidx + -2]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + -2]->minor, $this->compiler); + } + $this->_retvalue = $this->compiler->compileTag('private_print_expression',$this->yystack[$this->yyidx + 0]->minor,array('value'=>$this->yystack[$this->yyidx + -2]->minor, 'modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); + } else { + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor,$this->yystack[$this->yyidx + 0]->minor, array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor)); + } + } +// line 413 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r27(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor,$this->yystack[$this->yyidx + 0]->minor,array('object_method'=>$this->yystack[$this->yyidx + -1]->minor)); + } +// line 418 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r28(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -4]->minor,$this->yystack[$this->yyidx + 0]->minor,array('modifierlist'=>$this->yystack[$this->yyidx + -1]->minor, 'object_method'=>$this->yystack[$this->yyidx + -2]->minor)); + } +// line 423 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r29(){ + $this->_retvalue = $this->compiler->compileTag('make_nocache',array(array('var'=>'\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''))); + } +// line 428 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r30(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 433 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r31(){ + $tag = trim(substr($this->yystack[$this->yyidx + -2]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,$this->yystack[$this->yyidx + 0]->minor,array('if condition'=>$this->yystack[$this->yyidx + -1]->minor)); + } +// line 438 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r32(){ + $tag = trim(substr($this->yystack[$this->yyidx + -1]->minor,$this->compiler->getLdelLength())); + $this->_retvalue = $this->compiler->compileTag(($tag === 'else if')? 'elseif' : $tag,array(),array('if condition'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 449 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r34(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -6]->minor),array('ifexp'=>$this->yystack[$this->yyidx + -4]->minor),array('var'=>$this->yystack[$this->yyidx + -2]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),1); + } +// line 453 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r35(){ + $this->_retvalue = '='.$this->yystack[$this->yyidx + 0]->minor; + } +// line 461 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r37(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -3]->minor),array('to'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +// line 465 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r38(){ + $this->_retvalue = $this->compiler->compileTag('for',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('start'=>$this->yystack[$this->yyidx + -5]->minor),array('to'=>$this->yystack[$this->yyidx + -3]->minor),array('step'=>$this->yystack[$this->yyidx + -1]->minor))),0); + } +// line 470 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r39(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -3]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor)))); + } +// line 474 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r40(){ + $this->_retvalue = $this->compiler->compileTag('foreach',array_merge($this->yystack[$this->yyidx + 0]->minor,array(array('from'=>$this->yystack[$this->yyidx + -5]->minor),array('item'=>$this->yystack[$this->yyidx + -1]->minor),array('key'=>$this->yystack[$this->yyidx + -3]->minor)))); + } +// line 477 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r41(){ + $this->_retvalue = $this->compiler->compileTag('foreach',$this->yystack[$this->yyidx + 0]->minor); + } +// line 482 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r42(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array(array_merge(array($this->yystack[$this->yyidx + -1]->minor),$this->yystack[$this->yyidx + 0]->minor)))); + } +// line 486 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r43(){ + $this->_retvalue = $this->compiler->compileTag('setfilter',array(),array('modifier_list'=>array_merge(array(array_merge(array($this->yystack[$this->yyidx + -2]->minor),$this->yystack[$this->yyidx + -1]->minor)),$this->yystack[$this->yyidx + 0]->minor))); + } +// line 492 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r44(){ + $tag = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' /'); + if ($tag === 'strip') { $this->strip = false; + $this->_retvalue = null; + } else { + $this->_retvalue = $this->compiler->compileTag($tag.'close',array()); + } + } +// line 501 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r45(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + 0]->minor.'close',array()); + } +// line 505 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r46(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -1]->minor.'close',array(),array('modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 510 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r47(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -2]->minor.'close',array(),array('object_method'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 514 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r48(){ + $this->_retvalue = $this->compiler->compileTag($this->yystack[$this->yyidx + -3]->minor.'close',array(),array('object_method'=>$this->yystack[$this->yyidx + -1]->minor, 'modifier_list'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 522 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r49(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; + $this->_retvalue[] = $this->yystack[$this->yyidx + 0]->minor; + } +// line 528 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r50(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +// line 533 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r51(){ + $this->_retvalue = array(); + } +// line 538 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r52(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { + if ($this->security) { + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); + } + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); + } else { + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>'\''.$this->yystack[$this->yyidx + 0]->minor.'\''); } - - // line 269 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r5() - { - $this->current_buffer->append_subtree($this, - new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + -1 ]->minor)); } - - // line 272 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r6() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -3 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor; +// line 549 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r53(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor," =\n\r\t")=>$this->yystack[$this->yyidx + 0]->minor); } - - // line 276 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r7() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; +// line 557 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r55(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } - - // line 281 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r8() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 569 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r58(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor=>$this->yystack[$this->yyidx + 0]->minor); } - - // line 285 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r9() - { - $this->_retvalue = ''; +// line 582 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r60(){ + $this->yystack[$this->yyidx + -2]->minor[]=$this->yystack[$this->yyidx + 0]->minor; + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor; } - - // line 297 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r10() - { - if ($this->compiler->has_code) { - $this->current_buffer->append_subtree($this, - $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor)); - } - $this->compiler->has_variable_string = false; - $this->block_nesting_level = count($this->compiler->_tag_stack); +// line 587 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r61(){ + $this->_retvalue = array('var' => '\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'', 'value'=>$this->yystack[$this->yyidx + 0]->minor); } - - // line 307 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r12() - { - $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), ' $'); - if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', array('nocache'), - array('value' => $this->compiler->compileVariable('\'' . $match[ 1 ] . '\''))); - } else { - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', array(), - array('value' => $this->compiler->compileVariable('\'' . $var . '\''))); - } +// line 594 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r63(){ + $this->_retvalue = array('var' => $this->yystack[$this->yyidx + -2]->minor, 'value'=>$this->yystack[$this->yyidx + 0]->minor); } - - // line 328 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r13() - { - $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength())); - if ($tag == 'strip') { - $this->strip = true; - $this->_retvalue = null; - } else { - if (defined($tag)) { - if ($this->security) { - $this->security->isTrustedConstant($tag, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag)); - } else { - if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { - $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array('\'nocache\'')); - } else { - $this->_retvalue = $this->compiler->compileTag($tag, array()); - } - } - } +// line 598 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r64(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } - - // line 339 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r14() - { - $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); - if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') { - // {$smarty.block.child} - $this->_retvalue = - $this->compiler->compileTag('child', array(), array($this->yystack[ $this->yyidx + 0 ]->minor)); - } else { - // {$smarty.block.parent} - $this->_retvalue = - $this->compiler->compileTag('parent', array(), array($this->yystack[ $this->yyidx + 0 ]->minor)); - } +// line 618 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r67(){ + $this->_retvalue = '$_smarty_tpl->getStreamVariable(\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'://' . $this->yystack[$this->yyidx + 0]->minor . '\')'; } - - // line 343 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r15() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; +// line 623 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r68(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor . trim($this->yystack[$this->yyidx + -1]->minor) . $this->yystack[$this->yyidx + 0]->minor; } - - // line 347 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r16() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; +// line 633 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r70(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor['pre']. $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor['op'].$this->yystack[$this->yyidx + 0]->minor .')'; } - - // line 356 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r17() - { - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ], - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ])); +// line 637 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r71(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } - - // line 360 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r18() - { - $this->_retvalue = - $this->compiler->compileTag('assign', array_merge(array( - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ]), - array('var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') - ), $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ])); +// line 641 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r72(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor . $this->yystack[$this->yyidx + -1]->minor . ')'; } - - // line 364 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r19() - { - $this->_retvalue = - $this->compiler->compileTag('assign', array_merge(array( - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ]), - array('var' => $this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) - ), $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]), array( - 'smarty_internal_index' => $this->yystack[ $this->yyidx + - -1 ]->minor[ 'smarty_internal_index' ] - )); - } - - // line 368 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r20() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; +// line 645 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r73(){ + $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor.')'; } - - // line 383 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r21() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); - } - - // line 393 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r25() - { - if (defined($this->yystack[ $this->yyidx + -1 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + -1 ]->minor)); - } else { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor); - } - } - - // line 406 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r26() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', array(), - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array()); - } - } - - // line 418 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r27() - { - if (defined($this->yystack[ $this->yyidx + -2 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array( - 'value' => $this->yystack[ $this->yyidx + -2 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor - )); - } else { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor)); - } - } - - // line 423 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r28() - { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('object_method' => $this->yystack[ $this->yyidx + -1 ]->minor)); - } - - // line 428 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r29() - { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -4 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, array( - 'modifierlist' => $this->yystack[ $this->yyidx + -1 ]->minor, - 'object_method' => $this->yystack[ $this->yyidx + -2 ]->minor - )); - } - - // line 433 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r30() - { - $this->_retvalue = - $this->compiler->compileTag('make_nocache', - array(array('var' => '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''))); - } - - // line 438 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r31() - { - $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = - $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, array(), - array('if condition' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - // line 443 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r32() - { - $tag = trim(substr($this->yystack[ $this->yyidx + -2 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = - $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('if condition' => $this->yystack[ $this->yyidx + -1 ]->minor)); - } - - // line 454 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r33() - { - $tag = trim(substr($this->yystack[ $this->yyidx + -1 ]->minor, $this->compiler->getLdelLength())); - $this->_retvalue = - $this->compiler->compileTag(($tag === 'else if') ? 'elseif' : $tag, array(), - array('if condition' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - // line 458 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r35() - { - $this->_retvalue = - $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( - array('start' => $this->yystack[ $this->yyidx + -6 ]->minor), - array('ifexp' => $this->yystack[ $this->yyidx + -4 ]->minor), - array('var' => $this->yystack[ $this->yyidx + -2 ]->minor), - array('step' => $this->yystack[ $this->yyidx + -1 ]->minor) - )), 1); - } - - // line 466 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r36() - { - $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 470 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r38() - { - $this->_retvalue = - $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( - array('start' => $this->yystack[ $this->yyidx + -3 ]->minor), - array('to' => $this->yystack[ $this->yyidx + -1 ]->minor) - )), 0); - } - - // line 475 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r39() - { - $this->_retvalue = - $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( - array('start' => $this->yystack[ $this->yyidx + -5 ]->minor), - array('to' => $this->yystack[ $this->yyidx + -3 ]->minor), - array('step' => $this->yystack[ $this->yyidx + -1 ]->minor) - )), 0); - } - - // line 479 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r40() - { - $this->_retvalue = - $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( - array('from' => $this->yystack[ $this->yyidx + -3 ]->minor), - array('item' => $this->yystack[ $this->yyidx + -1 ]->minor) - ))); - } - - // line 482 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r41() - { - $this->_retvalue = - $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, array( - array('from' => $this->yystack[ $this->yyidx + -5 ]->minor), - array('item' => $this->yystack[ $this->yyidx + -1 ]->minor), - array('key' => $this->yystack[ $this->yyidx + -3 ]->minor) - ))); - } - - // line 487 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r42() - { - $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); - } - - // line 491 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r43() - { - $this->_retvalue = - $this->compiler->compileTag('setfilter', array(), array( - 'modifier_list' => array( - array_merge(array($this->yystack[ $this->yyidx + -1 ]->minor), - $this->yystack[ $this->yyidx + 0 ]->minor) - ) - )); - } - - // line 497 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r44() - { - $this->_retvalue = - $this->compiler->compileTag('setfilter', array(), array( - 'modifier_list' => array_merge(array( - array_merge(array( - $this->yystack[ $this->yyidx + - -2 ]->minor - ), $this->yystack[ $this->yyidx + -1 ]->minor) - ), $this->yystack[ $this->yyidx + 0 ]->minor) - )); - } - - // line 506 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r45() - { - $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), ' /'); - if ($tag === 'strip') { - $this->strip = false; - $this->_retvalue = null; - } else { - $this->_retvalue = $this->compiler->compileTag($tag . 'close', array()); - } - } - - // line 510 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r46() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); - } - - // line 515 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r47() - { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -1 ]->minor . 'close', array(), - array('modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - // line 519 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r48() - { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -2 ]->minor . 'close', array(), - array('object_method' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - // line 527 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r49() - { - $this->_retvalue = - $this->compiler->compileTag($this->yystack[ $this->yyidx + -3 ]->minor . 'close', array(), array( - 'object_method' => $this->yystack[ $this->yyidx + -1 ]->minor, - 'modifier_list' => $this->yystack[ $this->yyidx + 0 ]->minor - )); - } - - // line 533 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r50() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; - $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 538 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r51() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); - } - - // line 543 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r52() - { - $this->_retvalue = array(); - } - - // line 554 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r53() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = - array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); - } else { - $this->_retvalue = - array( - $this->yystack[ $this->yyidx + -2 ]->minor => '\'' . - $this->yystack[ $this->yyidx + 0 ]->minor . - '\'' - ); - } - } - - // line 562 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r54() - { - $this->_retvalue = - array( - trim($this->yystack[ $this->yyidx + -1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + - 0 ]->minor - ); - } - - // line 574 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r56() - { - $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; - } - - // line 587 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r59() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + -2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - // line 592 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r61() - { - $this->yystack[ $this->yyidx + -2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; - $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor; - } - - // line 599 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r62() - { - $this->_retvalue = - array( - 'var' => '\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'', - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor - ); - } - - // line 603 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r64() - { - $this->_retvalue = - array( - 'var' => $this->yystack[ $this->yyidx + -2 ]->minor, - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor - ); - } - - // line 623 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r65() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; - } - - // line 628 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r68() - { - $this->_retvalue = - '$_smarty_tpl->getStreamVariable(\'' . - substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . - '://' . - $this->yystack[ $this->yyidx + 0 ]->minor . - '\')'; - } - - // line 638 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r69() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . - trim($this->yystack[ $this->yyidx + -1 ]->minor) . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 642 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r71() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -1 ]->minor[ 'pre' ] . - $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + -1 ]->minor[ 'op' ] . - $this->yystack[ $this->yyidx + 0 ]->minor . - ')'; - } - - // line 646 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r72() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + -1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 650 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r73() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; - } - - // line 654 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r74() - { - $this->_retvalue = - 'in_array(' . - $this->yystack[ $this->yyidx + -2 ]->minor . - ',' . - $this->yystack[ $this->yyidx + 0 ]->minor . - ')'; - } - - // line 662 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r75() - { - $this->_retvalue = - 'in_array(' . - $this->yystack[ $this->yyidx + -2 ]->minor . - ',(array)' . - $this->yystack[ $this->yyidx + 0 ]->minor . - ')'; - } - - // line 666 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r76() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -5 ]->minor . - ' ? ' . - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + -2 ]->minor, 1) . '\'') . - ' : ' . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 676 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r77() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -5 ]->minor . - ' ? ' . - $this->yystack[ $this->yyidx + -2 ]->minor . - ' : ' . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 681 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r79() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 702 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r80() - { - $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 706 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r85() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 710 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r86() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.'; - } - - // line 715 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r87() - { - $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 732 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r88() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } else { - $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; - } - } - - // line 736 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r90() - { - $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; - } - - // line 754 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r91() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + -1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 765 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r95() - { - $prefixVar = $this->compiler->getNewPrefixVariable(); - if ($this->yystack[ $this->yyidx + -2 ]->minor[ 'var' ] === '\'smarty\'') { - $this->compiler->appendPrefixCode("compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + - -2 ]->minor[ 'smarty_internal_index' ]) . - ';?>'); - } else { - $this->compiler->appendPrefixCode("compiler->compileVariable($this->yystack[ $this->yyidx + - -2 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + -2 ]->minor[ 'smarty_internal_index' ] . - ';?>'); - } - $this->_retvalue = - $prefixVar . - '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } - - // line 772 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r96() - { - $prefixVar = $this->compiler->getNewPrefixVariable(); - $tmp = $this->compiler->appendCode('', $this->yystack[ $this->yyidx + 0 ]->minor); - $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); - $this->_retvalue = $prefixVar; - } - - // line 785 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r97() - { - $this->_retvalue = - $this->compiler->compileTag('private_modifier', array(), array( - 'value' => $this->yystack[ $this->yyidx + -1 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + 0 ]->minor - )); +// line 649 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r74(){ + $this->_retvalue = 'in_array('.$this->yystack[$this->yyidx + -2]->minor.',(array)'.$this->yystack[$this->yyidx + 0]->minor.')'; } - - // line 804 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r100() - { - if (!in_array(strtolower($this->yystack[ $this->yyidx + -2 ]->minor), array('self', 'parent')) && - (!$this->security || - $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler))) { - if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ])) { - $this->_retvalue = - $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + -2 ]->minor ] . - '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } else { - $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . - '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } - } else { - $this->compiler->trigger_template_error('static class \'' . - $this->yystack[ $this->yyidx + -2 ]->minor . - '\' is undefined or not allowed by security setting'); - } - } - - // line 815 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r102() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 818 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r103() - { - $this->_retvalue = - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); +// line 657 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r75(){ + $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '. $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -2]->minor,1).'\'') . ' : '.$this->yystack[$this->yyidx + 0]->minor; } - - // line 831 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r104() - { - if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] === '\'smarty\'') { - $smarty_var = - $this->compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]); - $this->_retvalue = $smarty_var; - } else { - // used for array reset,next,prev,end,current - $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]; - $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - $this->_retvalue = - $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - } +// line 661 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r76(){ + $this->_retvalue = $this->yystack[$this->yyidx + -5]->minor.' ? '.$this->yystack[$this->yyidx + -2]->minor.' : '.$this->yystack[$this->yyidx + 0]->minor; } - - // line 841 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r105() - { - $this->_retvalue = - '$_smarty_tpl->tpl_vars[' . - $this->yystack[ $this->yyidx + -2 ]->minor . - ']->' . - $this->yystack[ $this->yyidx + 0 ]->minor; +// line 671 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r78(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } - - // line 845 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r107() - { - $this->_retvalue = - $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\''); +// line 676 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r79(){ + $this->_retvalue = '!'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 849 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r108() - { - $this->_retvalue = - '(is_array($tmp = ' . - $this->compiler->compileConfigVariable('\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'') . - ') ? $tmp' . - $this->yystack[ $this->yyidx + 0 ]->minor . - ' :null)'; +// line 697 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r84(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 853 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r109() - { - $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -1 ]->minor); - } - - // line 857 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r110() - { - $this->_retvalue = - '(is_array($tmp = ' . - $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + -2 ]->minor) . - ') ? $tmp' . - $this->yystack[ $this->yyidx + 0 ]->minor . - ' : null)'; - } - - // line 860 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r111() - { - $this->_retvalue = - array( - 'var' => '\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'', - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor - ); - } - - // line 873 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r112() - { - $this->_retvalue = - array( - 'var' => $this->yystack[ $this->yyidx + -1 ]->minor, - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor - ); - } - - // line 879 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r114() - { - return; - } - - // line 882 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r115() - { - $this->_retvalue = - '[' . - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . - ']'; - } - - // line 886 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r116() - { - $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; - } - - // line 890 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r117() - { - $this->_retvalue = - '[' . - $this->compiler->compileVariable($this->yystack[ $this->yyidx + -2 ]->minor) . - '->' . - $this->yystack[ $this->yyidx + 0 ]->minor . - ']'; - } - - // line 894 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r118() - { - $this->_retvalue = '[\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\']'; - } - - // line 899 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r119() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; - } - - // line 904 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r120() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; - } - - // line 908 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r121() - { - $this->_retvalue = - '[' . - $this->compiler->compileTag('private_special_variable', array(), - '[\'section\'][\'' . $this->yystack[ $this->yyidx + -1 ]->minor . '\'][\'index\']') . - ']'; - } - - // line 911 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r122() - { - $this->_retvalue = - '[' . - $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . - $this->yystack[ $this->yyidx + - -3 ]->minor . - '\'][\'' . - $this->yystack[ $this->yyidx + - -1 ]->minor . - '\']') . - ']'; - } - - // line 917 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r123() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + -1 ]->minor . ']'; - } - - // line 933 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r125() - { - $this->_retvalue = - '[' . - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + -1 ]->minor, 1) . '\'') . - ']'; - } - - // line 943 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r129() - { - $this->_retvalue = '[]'; - } - - // line 947 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r130() - { - $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; - } - - // line 952 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r131() - { - $this->_retvalue = '\'\''; - } - - // line 960 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r132() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 966 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r134() - { - $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler->getLdelLength(), - -$this->compiler->getRdelLength()), ' $'); - $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); - } - - // line 973 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r135() - { - $this->_retvalue = '(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; - } - - // line 982 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r136() - { - if ($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ] === '\'smarty\'') { - $this->_retvalue = - $this->compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor; - } else { - $this->_retvalue = - $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + -1 ]->minor[ 'smarty_internal_index' ] . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - } - - // line 987 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r137() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - // line 992 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r138() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 701 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r85(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'; } - - // line 999 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r139() - { - if ($this->security && substr($this->yystack[ $this->yyidx + -1 ]->minor, 0, 1) === '_') { - $this->compiler->trigger_template_error(self::ERR1); - } - $this->_retvalue = - '->' . $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 705 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r86(){ + $this->_retvalue = '.'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1006 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r140() - { +// line 710 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r87(){ + if (defined($this->yystack[$this->yyidx + 0]->minor)) { if ($this->security) { - $this->compiler->trigger_template_error(self::ERR2); + $this->security->isTrustedConstant($this->yystack[$this->yyidx + 0]->minor, $this->compiler); } - $this->_retvalue = - '->{' . - $this->compiler->compileVariable($this->yystack[ $this->yyidx + -1 ]->minor) . - $this->yystack[ $this->yyidx + 0 ]->minor . - '}'; + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = '\''.$this->yystack[$this->yyidx + 0]->minor.'\''; } - - // line 1013 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r141() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::ERR2); - } - $this->_retvalue = - '->{' . $this->yystack[ $this->yyidx + -2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; } - - // line 1021 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r142() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::ERR2); - } - $this->_retvalue = - '->{\'' . - $this->yystack[ $this->yyidx + -4 ]->minor . - '\'.' . - $this->yystack[ $this->yyidx + -2 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor . - '}'; +// line 727 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r89(){ + $this->_retvalue = '('. $this->yystack[$this->yyidx + -1]->minor .')'; } - - // line 1029 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r143() - { - $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 731 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r90(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1037 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r144() - { - $this->_retvalue = - $this->compiler->compilePHPFunctionCall($this->yystack[ $this->yyidx + -3 ]->minor, - $this->yystack[ $this->yyidx + -1 ]->minor); +// line 749 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r94(){ + if ($this->security && $this->security->static_classes !== array()) { + $this->compiler->trigger_template_error('dynamic static class not allowed by security setting'); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + if ($this->yystack[$this->yyidx + -2]->minor['var'] === '\'smarty\'') { + $this->compiler->appendPrefixCode("compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index']).';?>'); + } else { + $this->compiler->appendPrefixCode("compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor['var']).$this->yystack[$this->yyidx + -2]->minor['smarty_internal_index'].';?>'); + } + $this->_retvalue = $prefixVar .'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } +// line 760 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r95(){ + $prefixVar = $this->compiler->getNewPrefixVariable(); + $tmp = $this->compiler->appendCode('', $this->yystack[$this->yyidx + 0]->minor); + $this->compiler->appendPrefixCode($this->compiler->appendCode($tmp, "")); + $this->_retvalue = $prefixVar; + } +// line 767 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r96(){ + $this->_retvalue = $this->compiler->compileTag('private_modifier',array(),array('value'=>$this->yystack[$this->yyidx + -1]->minor,'modifierlist'=>$this->yystack[$this->yyidx + 0]->minor)); + } +// line 780 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r99(){ + if (!in_array(strtolower($this->yystack[$this->yyidx + -2]->minor), array('self', 'parent')) && (!$this->security || $this->security->isTrustedStaticClassAccess($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor, $this->compiler))) { + if (isset($this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor])) { + $this->_retvalue = $this->smarty->registered_classes[$this->yystack[$this->yyidx + -2]->minor].'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } else { + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'::'.$this->yystack[$this->yyidx + 0]->minor[0].$this->yystack[$this->yyidx + 0]->minor[1]; + } + } else { + $this->compiler->trigger_template_error ('static class \''.$this->yystack[$this->yyidx + -2]->minor.'\' is undefined or not allowed by security setting'); } - - // line 1044 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r145() - { - if ($this->security && substr($this->yystack[ $this->yyidx + -3 ]->minor, 0, 1) === '_') { - $this->compiler->trigger_template_error(self::ERR1); - } - $this->_retvalue = - $this->yystack[ $this->yyidx + -3 ]->minor . - '(' . - implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . - ')'; } - - // line 1055 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r146() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::ERR2); +// line 799 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r101(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } - $prefixVar = $this->compiler->getNewPrefixVariable(); - $this->compiler->appendPrefixCode("compiler->compileVariable('\'' . - substr($this->yystack[ $this->yyidx + - -3 ]->minor, 1) . - '\'') . - ';?>'); - $this->_retvalue = $prefixVar . '(' . implode(',', $this->yystack[ $this->yyidx + -1 ]->minor) . ')'; - } - - // line 1072 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r147() - { - $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); +// line 810 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r102(){ + $this->_retvalue = $this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''); + } +// line 813 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r103(){ + if ($this->yystack[$this->yyidx + 0]->minor['var'] === '\'smarty\'') { + $smarty_var = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']); + $this->_retvalue = $smarty_var; + } else { + // used for array reset,next,prev,end,current + $this->last_variable = $this->yystack[$this->yyidx + 0]->minor['var']; + $this->last_index = $this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; + $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor['var']).$this->yystack[$this->yyidx + 0]->minor['smarty_internal_index']; + } + } +// line 826 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r104(){ + $this->_retvalue = '$_smarty_tpl->tpl_vars['. $this->yystack[$this->yyidx + -2]->minor .']->'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 836 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r106(){ + $this->_retvalue = $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -1]->minor . '\''); + } +// line 840 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r107(){ + $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable('\'' . $this->yystack[$this->yyidx + -2]->minor . '\'') . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' :null)'; + } +// line 844 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r108(){ + $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -1]->minor); + } +// line 848 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r109(){ + $this->_retvalue = '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[$this->yyidx + -2]->minor) . ') ? $tmp'.$this->yystack[$this->yyidx + 0]->minor.' : null)'; + } +// line 852 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r110(){ + $this->_retvalue = array('var'=>'\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'', 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 855 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r111(){ + $this->_retvalue = array('var'=>$this->yystack[$this->yyidx + -1]->minor, 'smarty_internal_index'=>$this->yystack[$this->yyidx + 0]->minor); + } +// line 868 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r113(){ + return; + } +// line 874 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r114(){ + $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\'').']'; + } +// line 877 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r115(){ + $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + 0]->minor).']'; + } +// line 881 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r116(){ + $this->_retvalue = '['.$this->compiler->compileVariable($this->yystack[$this->yyidx + -2]->minor).'->'.$this->yystack[$this->yyidx + 0]->minor.']'; + } +// line 885 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r117(){ + $this->_retvalue = '[\''. $this->yystack[$this->yyidx + 0]->minor .'\']'; + } +// line 889 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r118(){ + $this->_retvalue = '['. $this->yystack[$this->yyidx + 0]->minor .']'; + } +// line 894 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r119(){ + $this->_retvalue = '['. $this->yystack[$this->yyidx + -1]->minor .']'; } - - // line 1076 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r150() - { - $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + -2 ]->minor, array( - array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor) - )); +// line 899 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r120(){ + $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\'][\'index\']').']'; + } +// line 903 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r121(){ + $this->_retvalue = '['.$this->compiler->compileTag('private_special_variable',array(),'[\'section\'][\''.$this->yystack[$this->yyidx + -3]->minor.'\'][\''.$this->yystack[$this->yyidx + -1]->minor.'\']').']'; + } +// line 906 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r122(){ + $this->_retvalue = '['.$this->yystack[$this->yyidx + -1]->minor.']'; + } +// line 912 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r124(){ + $this->_retvalue = '['.$this->compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -1]->minor,1).'\'').']'; + } +// line 928 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r128(){ + $this->_retvalue = '[]'; + } +// line 938 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r129(){ + $this->_retvalue = '\''.substr($this->yystack[$this->yyidx + 0]->minor,1).'\''; + } +// line 942 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r130(){ + $this->_retvalue = '\'\''; + } +// line 947 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r131(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.'.'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1084 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r151() - { - $this->_retvalue = - array(array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); +// line 955 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r133(){ + $var = trim(substr($this->yystack[$this->yyidx + 0]->minor, $this->compiler->getLdelLength(), -$this->compiler->getRdelLength()), ' $'); + $this->_retvalue = $this->compiler->compileVariable('\''.$var.'\''); } - - // line 1092 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r153() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); +// line 961 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r134(){ + $this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; } - - // line 1105 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r154() - { - $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); +// line 968 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r135(){ + if ($this->yystack[$this->yyidx + -1]->minor['var'] === '\'smarty\'') { + $this->_retvalue = $this->compiler->compileTag('private_special_variable',array(),$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor; + } else { + $this->_retvalue = $this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor['var']).$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; } - - // line 1114 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r157() - { - $this->_retvalue = - array(trim($this->yystack[ $this->yyidx + -1 ]->minor) . $this->yystack[ $this->yyidx + 0 ]->minor); } - - // line 1119 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r159() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); +// line 977 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r136(){ + $this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; } - - // line 1124 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r160() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); +// line 982 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r137(){ + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1129 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r161() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); +// line 987 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r138(){ + if ($this->security && substr($this->yystack[$this->yyidx + -1]->minor,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); } - - // line 1134 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r162() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + -1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); - } - - // line 1140 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r163() - { - $this->_retvalue = - array( - $this->yystack[ $this->yyidx + -2 ]->minor, - $this->yystack[ $this->yyidx + -1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor, 'property' - ); + $this->_retvalue = '->'.$this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1144 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r164() - { - $this->_retvalue = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; - } - - // line 1163 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r165() - { - static $lops = array( - 'eq' => ' == ', - 'ne' => ' != ', - 'neq' => ' != ', - 'gt' => ' > ', - 'ge' => ' >= ', - 'gte' => ' >= ', - 'lt' => ' < ', - 'le' => ' <= ', - 'lte' => ' <= ', - 'mod' => ' % ', - 'and' => ' && ', - 'or' => ' || ', - 'xor' => ' xor ', - ); - $op = strtolower(preg_replace('/\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor)); - $this->_retvalue = $lops[ $op ]; - } - - // line 1176 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r166() - { - static $tlops = array( - 'isdivby' => array('op' => ' % ', 'pre' => '!('), - 'isnotdivby' => array('op' => ' % ', 'pre' => '('), - 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), - 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), - 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), - 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '), - ); - $op = strtolower(preg_replace('/\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor)); - $this->_retvalue = $tlops[ $op ]; - } - - // line 1190 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r167() - { - static $scond = array( - 'iseven' => '!(1 & ', +// line 994 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r139(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->_retvalue = '->{'.$this->compiler->compileVariable($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1001 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r140(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->_retvalue = '->{'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1008 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r141(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $this->_retvalue = '->{\''.$this->yystack[$this->yyidx + -4]->minor.'\'.'.$this->yystack[$this->yyidx + -2]->minor.$this->yystack[$this->yyidx + 0]->minor.'}'; + } +// line 1016 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r142(){ + $this->_retvalue = '->'.$this->yystack[$this->yyidx + 0]->minor; + } +// line 1024 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r143(){ + $this->_retvalue = $this->compiler->compilePHPFunctionCall($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + -1]->minor); + } +// line 1032 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r144(){ + if ($this->security && substr($this->yystack[$this->yyidx + -3]->minor,0,1) === '_') { + $this->compiler->trigger_template_error (self::ERR1); + } + $this->_retvalue = $this->yystack[$this->yyidx + -3]->minor . '('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; + } +// line 1039 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r145(){ + if ($this->security) { + $this->compiler->trigger_template_error (self::ERR2); + } + $prefixVar = $this->compiler->getNewPrefixVariable(); + $this->compiler->appendPrefixCode("compiler->compileVariable('\''.substr($this->yystack[$this->yyidx + -3]->minor,1).'\'').';?>'); + $this->_retvalue = $prefixVar .'('. implode(',',$this->yystack[$this->yyidx + -1]->minor) .')'; + } +// line 1050 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r146(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array($this->yystack[$this->yyidx + 0]->minor)); + } +// line 1067 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r149(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -2]->minor,array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor))); + } +// line 1071 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r150(){ + $this->_retvalue = array(array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor)); + } +// line 1079 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r152(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor); + } +// line 1087 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r153(){ + $this->_retvalue = array_merge($this->yystack[$this->yyidx + -1]->minor,$this->yystack[$this->yyidx + 0]->minor); + } +// line 1100 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r156(){ + $this->_retvalue = array(trim($this->yystack[$this->yyidx + -1]->minor).$this->yystack[$this->yyidx + 0]->minor); + } +// line 1109 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r158(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, '', 'method'); + } +// line 1114 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r159(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'method'); + } +// line 1119 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r160(){ + $this->_retvalue = array($this->yystack[$this->yyidx + 0]->minor, ''); + } +// line 1124 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r161(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor, 'property'); + } +// line 1129 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r162(){ + $this->_retvalue = array($this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor.$this->yystack[$this->yyidx + 0]->minor, 'property'); + } +// line 1135 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r163(){ + $this->_retvalue = ' '. trim($this->yystack[$this->yyidx + 0]->minor) . ' '; + } +// line 1139 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r164(){ + static $lops = array( + 'eq' => ' == ', + 'ne' => ' != ', + 'neq' => ' != ', + 'gt' => ' > ', + 'ge' => ' >= ', + 'gte' => ' >= ', + 'lt' => ' < ', + 'le' => ' <= ', + 'lte' => ' <= ', + 'mod' => ' % ', + 'and' => ' && ', + 'or' => ' || ', + 'xor' => ' xor ', + ); + $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $lops[$op]; + } +// line 1158 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r165(){ + static $tlops = array( + 'isdivby' => array('op' => ' % ', 'pre' => '!('), + 'isnotdivby' => array('op' => ' % ', 'pre' => '('), + 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), + 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), + 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '), + ); + $op = strtolower(preg_replace('/\s*/', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $tlops[$op]; + } +// line 1171 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r166(){ + static $scond = array ( + 'iseven' => '!(1 & ', 'isnoteven' => '(1 & ', - 'isodd' => '(1 & ', - 'isnotodd' => '!(1 & ', + 'isodd' => '(1 & ', + 'isnotodd' => '!(1 & ', ); - $op = strtolower(str_replace(' ', '', $this->yystack[ $this->yyidx + 0 ]->minor)); - $this->_retvalue = $scond[ $op ]; + $op = strtolower(str_replace(' ', '', $this->yystack[$this->yyidx + 0]->minor)); + $this->_retvalue = $scond[$op]; } - - // line 1201 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r168() - { - $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'; +// line 1185 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r167(){ + $this->_retvalue = 'array('.$this->yystack[$this->yyidx + -1]->minor.')'; } - - // line 1209 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r171() - { - $this->_retvalue = $this->yystack[ $this->yyidx + -2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 1196 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r170(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.','.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1213 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r173() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + -2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 1204 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r172(){ + $this->_retvalue = $this->yystack[$this->yyidx + -2]->minor.'=>'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1229 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r174() - { - $this->_retvalue = - '\'' . $this->yystack[ $this->yyidx + -2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; +// line 1208 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r173(){ + $this->_retvalue = '\''.$this->yystack[$this->yyidx + -2]->minor.'\'=>'.$this->yystack[$this->yyidx + 0]->minor; } - - // line 1235 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r177() - { - $this->compiler->leaveDoubleQuote(); - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor->to_smarty_php($this); +// line 1224 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r176(){ + $this->compiler->leaveDoubleQuote(); + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor->to_smarty_php($this); } - - // line 1240 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r178() - { - $this->yystack[ $this->yyidx + -1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); - $this->_retvalue = $this->yystack[ $this->yyidx + -1 ]->minor; +// line 1230 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r177(){ + $this->yystack[$this->yyidx + -1]->minor->append_subtree($this, $this->yystack[$this->yyidx + 0]->minor); + $this->_retvalue = $this->yystack[$this->yyidx + -1]->minor; } - - // line 1244 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r179() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); +// line 1235 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r178(){ + $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[$this->yyidx + 0]->minor); } - - // line 1248 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r180() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + -1 ]->minor); +// line 1239 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r179(){ + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)'.$this->yystack[$this->yyidx + -1]->minor); } - - // line 1252 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r181() - { - $this->_retvalue = - new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + -1 ]->minor . ')'); +// line 1243 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r180(){ + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)('.$this->yystack[$this->yyidx + -1]->minor.')'); } - - // line 1264 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r182() - { - $this->_retvalue = - new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . - substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . - '\']->value'); +// line 1247 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r181(){ + $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\''. substr($this->yystack[$this->yyidx + 0]->minor,1) .'\']->value'); } - - // line 1268 "../smarty/lexer/smarty_internal_templateparser.y" - public function yy_r185() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); +// line 1259 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r184(){ + $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[$this->yyidx + 0]->minor); } - - public function yy_r186() - { - $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); +// line 1263 "../smarty/lexer/smarty_internal_templateparser.y" + public function yy_r185(){ + $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[$this->yyidx + 0]->minor); } + private $_retvalue; + public function yy_reduce($yyruleno) { if ($this->yyTraceFILE && $yyruleno >= 0 - && $yyruleno < count(self::$yyRuleName)) { + && $yyruleno < count(self::$yyRuleName)) { fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, - self::$yyRuleName[ $yyruleno ]); + self::$yyRuleName[$yyruleno]); } + $this->_retvalue = $yy_lefthand_side = null; - if (isset(self::$yyReduceMap[ $yyruleno ])) { + if (isset(self::$yyReduceMap[$yyruleno])) { // call the action $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); + $this->{'yy_r' . self::$yyReduceMap[$yyruleno]}(); $yy_lefthand_side = $this->_retvalue; } - $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; + $yygoto = self::$yyRuleInfo[$yyruleno][0]; + $yysize = self::$yyRuleInfo[$yyruleno][1]; $this->yyidx -= $yysize; for ($i = $yysize; $i; $i--) { // pop all of the right-hand side parameters array_pop($this->yystack); } - $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); + $yyact = $this->yy_find_reduce_action($this->yystack[$this->yyidx]->stateno, $yygoto); if ($yyact < self::YYNSTATE) { if (!$this->yyTraceFILE && $yysize) { $this->yyidx++; @@ -3492,7 +2792,7 @@ public function yy_reduce($yyruleno) $x->stateno = $yyact; $x->major = $yygoto; $x->minor = $yy_lefthand_side; - $this->yystack[ $this->yyidx ] = $x; + $this->yystack[$this->yyidx] = $x; } else { $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); } @@ -3505,37 +2805,38 @@ public function yy_parse_failed() { if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { + } while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } } public function yy_syntax_error($yymajor, $TOKEN) { - // line 214 "../smarty/lexer/smarty_internal_templateparser.y" - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); +// line 213 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->internalError = true; + $this->yymajor = $yymajor; + $this->compiler->trigger_template_error(); } public function yy_accept() { if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { + } while ($this->yyidx >= 0) { $this->yy_pop_parser_stack(); } - // line 207 "../smarty/lexer/smarty_internal_templateparser.y" - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; +// line 206 "../smarty/lexer/smarty_internal_templateparser.y" + + $this->successful = !$this->internalError; + $this->internalError = false; + $this->retvalue = $this->_retvalue; } public function doParse($yymajor, $yytokenvalue) { $yyerrorhit = 0; /* True if yymajor has invoked an error */ + if ($this->yyidx === null || $this->yyidx < 0) { $this->yyidx = 0; $this->yyerrcnt = -1; @@ -3545,15 +2846,17 @@ public function doParse($yymajor, $yytokenvalue) $this->yystack = array(); $this->yystack[] = $x; } - $yyendofinput = ($yymajor == 0); + $yyendofinput = ($yymajor==0); + if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sInput %s\n", - $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); } + do { $yyact = $this->yy_find_shift_action($yymajor); if ($yymajor < self::YYERRORSYMBOL && - !$this->yy_is_expected_token($yymajor)) { + !$this->yy_is_expected_token($yymajor)) { // force a syntax error $yyact = self::YY_ERROR_ACTION; } @@ -3576,22 +2879,22 @@ public function doParse($yymajor, $yytokenvalue) if ($this->yyerrcnt < 0) { $this->yy_syntax_error($yymajor, $yytokenvalue); } - $yymx = $this->yystack[ $this->yyidx ]->major; + $yymx = $this->yystack[$this->yyidx]->major; if ($yymx === self::YYERRORSYMBOL || $yyerrorhit) { if ($this->yyTraceFILE) { fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", - $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); + $this->yyTracePrompt, $this->yyTokenName[$yymajor]); } $this->yy_destructor($yymajor, $yytokenvalue); $yymajor = self::YYNOCODE; } else { while ($this->yyidx >= 0 && - $yymx !== self::YYERRORSYMBOL && - ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE - ) { + $yymx !== self::YYERRORSYMBOL && + ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE + ){ $this->yy_pop_parser_stack(); } - if ($this->yyidx < 0 || $yymajor == 0) { + if ($this->yyidx < 0 || $yymajor==0) { $this->yy_destructor($yymajor, $yytokenvalue); $this->yy_parse_failed(); $yymajor = self::YYNOCODE; diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_internal_testinstall.php b/WEB-INF/lib/smarty/sysplugins/smarty_internal_testinstall.php index 504a4582..1fac79b7 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_internal_testinstall.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_internal_testinstall.php @@ -362,7 +362,6 @@ public static function testInstall(Smarty $smarty, &$errors = null) 'smarty_internal_compile_function.php' => true, 'smarty_internal_compile_if.php' => true, 'smarty_internal_compile_include.php' => true, - 'smarty_internal_compile_include_php.php' => true, 'smarty_internal_compile_insert.php' => true, 'smarty_internal_compile_ldelim.php' => true, 'smarty_internal_compile_make_nocache.php' => true, @@ -373,7 +372,6 @@ public static function testInstall(Smarty $smarty, &$errors = null) 'smarty_internal_compile_private_modifier.php' => true, 'smarty_internal_compile_private_object_block_function.php' => true, 'smarty_internal_compile_private_object_function.php' => true, - 'smarty_internal_compile_private_php.php' => true, 'smarty_internal_compile_private_print_expression.php' => true, 'smarty_internal_compile_private_registered_block.php' => true, 'smarty_internal_compile_private_registered_function.php' => true, @@ -388,7 +386,6 @@ public static function testInstall(Smarty $smarty, &$errors = null) 'smarty_internal_config_file_compiler.php' => true, 'smarty_internal_data.php' => true, 'smarty_internal_debug.php' => true, - 'smarty_internal_errorhandler.php' => true, 'smarty_internal_extension_handler.php' => true, 'smarty_internal_method_addautoloadfilters.php' => true, 'smarty_internal_method_adddefaultmodifiers.php' => true, @@ -450,7 +447,6 @@ public static function testInstall(Smarty $smarty, &$errors = null) 'smarty_internal_resource_extends.php' => true, 'smarty_internal_resource_file.php' => true, 'smarty_internal_resource_php.php' => true, - 'smarty_internal_resource_registered.php' => true, 'smarty_internal_resource_stream.php' => true, 'smarty_internal_resource_string.php' => true, 'smarty_internal_runtime_cachemodify.php' => true, diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_resource.php b/WEB-INF/lib/smarty/sysplugins/smarty_resource.php index aae7e42f..7fe84536 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_resource.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_resource.php @@ -72,9 +72,7 @@ public static function load(Smarty $smarty, $type) } // try registered resource if (isset($smarty->registered_resources[ $type ])) { - return $smarty->_cache[ 'resource_handlers' ][ $type ] = - $smarty->registered_resources[ $type ] instanceof Smarty_Resource ? - $smarty->registered_resources[ $type ] : new Smarty_Internal_Resource_Registered(); + return $smarty->_cache[ 'resource_handlers' ][ $type ] = $smarty->registered_resources[ $type ]; } // try sysplugins dir if (isset(self::$sysplugins[ $type ])) { diff --git a/WEB-INF/lib/smarty/sysplugins/smarty_security.php b/WEB-INF/lib/smarty/sysplugins/smarty_security.php index 441a7e28..3c29c813 100644 --- a/WEB-INF/lib/smarty/sysplugins/smarty_security.php +++ b/WEB-INF/lib/smarty/sysplugins/smarty_security.php @@ -21,19 +21,6 @@ */ class Smarty_Security { - /** - * This determines how Smarty handles "" tags in templates. - * possible values: - *
    - *
  • Smarty::PHP_PASSTHRU -> echo PHP tags as they are
  • - *
  • Smarty::PHP_QUOTE -> escape tags as entities
  • - *
  • Smarty::PHP_REMOVE -> remove php tags
  • - *
  • Smarty::PHP_ALLOW -> execute php tags
  • - *
- * - * @var integer - */ - public $php_handling = Smarty::PHP_PASSTHRU; /** * This is the list of template directories that are considered secure. diff --git a/WEB-INF/lib/smarty/sysplugins/smartycompilerexception.php b/WEB-INF/lib/smarty/sysplugins/smartycompilerexception.php index f7ad39b9..8833aa52 100644 --- a/WEB-INF/lib/smarty/sysplugins/smartycompilerexception.php +++ b/WEB-INF/lib/smarty/sysplugins/smartycompilerexception.php @@ -16,12 +16,12 @@ public function __toString() } /** - * The line number of the template error - * - * @type int|null + * @param int $line */ - public $line = null; - + public function setLine($line) + { + $this->line = $line; + } /** * The template source snippet relating to the error * diff --git a/initialize.php b/initialize.php index 911c1f71..f8d3cf7d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5638"); +define("APP_VERSION", "1.20.0.5639"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 0924ef499c2b0833a20c2d180b04fa70c6484b6d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 20 Feb 2022 20:46:15 +0000 Subject: [PATCH 117/304] Fixed Smarty.class.php so that it is possible to use it with php5.4. --- WEB-INF/lib/smarty/Smarty.class.php | 16 +++++++++++++++- WEB-INF/lib/smarty/readme | 7 +++---- initialize.php | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/WEB-INF/lib/smarty/Smarty.class.php b/WEB-INF/lib/smarty/Smarty.class.php index 05325a23..85a3d9a6 100644 --- a/WEB-INF/lib/smarty/Smarty.class.php +++ b/WEB-INF/lib/smarty/Smarty.class.php @@ -60,6 +60,18 @@ */ define('SMARTY_MBSTRING', function_exists('mb_get_info')); } + +// Note: Nik put this back in from smarty3 for php5.4 that we still support. +// See also comment around Smarty::$_CHARSET. +if (!defined('SMARTY_RESOURCE_CHAR_SET')) { + // UTF-8 can only be done properly when mbstring is available! + /** + * @deprecated in favor of Smarty::$_CHARSET + */ + define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'); +} +// End of inserted fragment by Nik. + /** * Load Smarty_Autoloader */ @@ -160,7 +172,9 @@ class Smarty extends Smarty_Internal_TemplateBase /** * The character set to adhere to (e.g. "UTF-8") */ - public static $_CHARSET = SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'; + // public static $_CHARSET = SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'; + // Note by Nik: the above assignment only works with php >= 5.6, rolling back to SMARTY_RESOURCE_CHAR_SET as in smarty3. + public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; /** * The date format to be used internally diff --git a/WEB-INF/lib/smarty/readme b/WEB-INF/lib/smarty/readme index 91eff478..0a894518 100644 --- a/WEB-INF/lib/smarty/readme +++ b/WEB-INF/lib/smarty/readme @@ -1,8 +1,7 @@ -These are files from Smarty-4.1.0 with 2 modifications in: +The files in this directory are from Smarty-4.1.0. +There are 2 modified files though to support older versions of php such as 5.4. Smarty.class.php sysplugins/smarty_internal_cacheresource_file.php -Nik edited these files for php5.4 support, as they use php7.0 features. - - +Nik edited these files in a few places for php5.4 support, as they use php7.0 and php5.6 features. diff --git a/initialize.php b/initialize.php index f8d3cf7d..221f3f6c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5639"); +define("APP_VERSION", "1.20.0.5640"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 992bcdd2f13da3ffa7161bbb9ed7c7d118e9297a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 21 Feb 2022 13:12:10 +0000 Subject: [PATCH 118/304] Added a comment about required php version. Dutch file improved. --- WEB-INF/resources/nl.lang.php | 2 +- dbinstall.php | 4 ++++ initialize.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index dc86183a..79baaa97 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -110,7 +110,7 @@ 'button.stop' => 'Stop', 'button.approve' => 'Goedkeuren', 'button.disapprove' => 'Afkeuren', -// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. +'button.sync' => 'Sychroniseer', // Labels for controls on forms. Labels in this section are used on multiple forms. 'label.menu' => 'Menu', diff --git a/dbinstall.php b/dbinstall.php index 12a1e623..a3168bbf 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -94,6 +94,10 @@ function ttGenerateKeys() { // $required_version = '5.2.1'; // Something in TCPDF library does not work below this one. $required_version = '5.4.0'; // Week view (week.php) requires 5.4 because of []-way of referencing arrays. // This needs further investigation as we use [] elsewhere without obvious problems. + // Note: unmodified smarty 4.1.0 that we needed for php 8.1 support uses plp 5.6 and 7.0 features. + // Currently, embedded smarty in this product is adjusted to still support php 5.4. + // Next time we update smarty we may need to increase $required_version. + // Print a warning about php >= 8.1 because of a breaking change // with mysqli default error mode, see https://php.watch/versions/8.1/mysqli-error-mode if (version_compare(phpversion(), '8.1', '>=')) { diff --git a/initialize.php b/initialize.php index 221f3f6c..295d77ca 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5640"); +define("APP_VERSION", "1.20.0.5641"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 0e2d6563e2d969209c502a1eae4ddd8e87b73299 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 21 Feb 2022 14:56:48 +0000 Subject: [PATCH 119/304] Addressed an sql injection vulnerability in puncher.php. --- initialize.php | 2 +- puncher.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index 295d77ca..039438f0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5641"); +define("APP_VERSION", "1.20.0.5642"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 787c6f34..0cfd37f2 100644 --- a/puncher.php +++ b/puncher.php @@ -19,6 +19,13 @@ header('Location: feature_disabled.php'); exit(); } +// If we are passed in a date, make sure it is in correct format. +// TODO: redo this temporary sql injection fix as we are not supposed to pass a date. +$date = $request->getParameter('date'); +if ($date && !ttValidDbDateFormatDate($date)) { + header('Location: access_denied.php'); + exit(); +} if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); From 1804ff3d538651464545e1fac8fefcf10442ad7b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 22 Feb 2022 17:25:34 +0000 Subject: [PATCH 120/304] Improved puncher plugin. --- WEB-INF/lib/common.lib.php | 13 +++++++++ WEB-INF/lib/ttDate.class.php | 6 ++++ initialize.php | 2 +- puncher.php | 55 ++++++++++++++++++------------------ 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index d8ed3c8d..f5baa1a1 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -270,6 +270,19 @@ function ttValidDbDateFormatDate($val) return true; } +// ttValidTime is used to check user input for time post. +function ttValidTime($val) +{ + if (is_null($val) || strlen($val) == 0) + return false; + + // This should validate a yime string in 24 hour format hh:mm. + if (!preg_match('/^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/', $val)) + return false; + + return true; +} + // ttValidInteger is used to check user input to validate an integer. function ttValidInteger($val, $emptyValid = false) { diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index 1b5bad9c..176692f8 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -111,6 +111,12 @@ function getDay() { return $this->day; } function getDayOfWeek() { return $this->dayOfWeek; } + // incrementDay increments our date by a number of days. + function incrementDay(/*int*/ $days = 1) { + $this->setFromUnixTimestamp(@mktime(0, 0, 0, $this->month, $this->day + $days, $this->year)); + } + + // A static function to obtain a date in DB_DATEFORMAT from a Unix timestamp. static function dateFromUnixTimestamp($unixTimestamp = null) { if ($unixTimestamp == null) { diff --git a/initialize.php b/initialize.php index 039438f0..9328d3c0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5642"); +define("APP_VERSION", "1.20.0.5643"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 0cfd37f2..55c42e36 100644 --- a/puncher.php +++ b/puncher.php @@ -8,7 +8,7 @@ import('ttGroupHelper'); import('ttClientHelper'); import('ttTimeHelper'); -import('DateAndTime'); +import('ttDate'); // Access check. if (!ttAccessAllowed('track_own_time')) { @@ -19,13 +19,8 @@ header('Location: feature_disabled.php'); exit(); } -// If we are passed in a date, make sure it is in correct format. -// TODO: redo this temporary sql injection fix as we are not supposed to pass a date. -$date = $request->getParameter('date'); -if ($date && !ttValidDbDateFormatDate($date)) { - header('Location: access_denied.php'); - exit(); -} +// If we are passed in browser_today, make sure it is in correct format. +$browser_today = null; // Reused below beyond access checks. if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); @@ -34,6 +29,16 @@ exit(); } } +// If we are passed in browser_ttime, make sure it is in correct format. +$browser_time = null; // Reused below beyond access checks. +if ($request->isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_time = $request->getParameter('browser_time'); + if ($browser_time && !ttValidTime($browser_time)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. $showClient = $user->isPluginEnabled('cl'); @@ -44,15 +49,9 @@ $taskRequired = false; if ($showTask) $taskRequired = $user->getConfigOption('task_required'); -// Initialize and store date in session. -$cl_date = $request->getParameter('date', @$_SESSION['date']); -$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); -if($selected_date->isError()) - $selected_date = new DateAndTime(DB_DATEFORMAT); -if(!$cl_date) - $cl_date = $selected_date->toString(DB_DATEFORMAT); -$_SESSION['date'] = $cl_date; -// TODO: for timer page we may limit the day to today only. +// Initialize $cl_date. +$date_today = new ttDate($browser_today); // Initialize to browser today if we are passed it in, otherwise server today. +$cl_date = $date_today->toString(); // Use custom fields plugin if it is enabled. if ($user->isPluginEnabled('cf')) { @@ -66,8 +65,8 @@ $enable_controls = ($uncompleted == null); // Initialize variables. -$cl_start = trim($request->getParameter('browser_time')); -$cl_finish = trim($request->getParameter('browser_time')); +$cl_start = $browser_time; +$cl_finish = $browser_time; $cl_duration = $cl_note = null; // Disabled controls are not posted. Therefore, && $enable_controls condition in several places below. // This allows us to get values from session when controls are disabled and reset to null when not. @@ -204,9 +203,9 @@ // Start and stop buttons. $enable_start = $uncompleted ? false : true; if (!$uncompleted) - $form->addInput(array('type'=>'submit','name'=>'btn_start','onclick'=>'browser_time.value=get_time()','value'=>$i18n->get('button.start'),'enable'=>$enable_start)); + $form->addInput(array('type'=>'submit','name'=>'btn_start','onclick'=>'browser_today.value=get_date();browser_time.value=get_time()','value'=>$i18n->get('button.start'),'enable'=>$enable_start)); else - $form->addInput(array('type'=>'submit','name'=>'btn_stop','onclick'=>'browser_time.value=get_time()','value'=>$i18n->get('button.stop'),'enable'=>!$enable_start)); + $form->addInput(array('type'=>'submit','name'=>'btn_stop','onclick'=>'browser_today.value=get_date();browser_time.value=get_time()','value'=>$i18n->get('button.stop'),'enable'=>!$enable_start)); // Submit. if ($request->isPost()) { @@ -232,15 +231,17 @@ } // Finished validating user input. - // Prohibit creating entries in future. + // Prohibit creating entries in future. Tricky with a bogus browser_today data in post. if (!$user->isOptionEnabled('future_entries')) { - $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); - if ($selected_date->after($browser_today)) + // Just check if the date we are using is after server tomorrow. + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($date_today->after($server_tomorrow)) $err->add($i18n->get('error.future_date')); } // Prohibit creating time entries in locked interval. - if ($user->isDateLocked($selected_date)) + if ($user->isDateLocked($date_today)) $err->add($i18n->get('error.range_locked')); // Prohibit creating another uncompleted record. @@ -309,7 +310,7 @@ } } // isPost -$week_total = ttTimeHelper::getTimeForWeek($cl_date); +$week_total = ttTimeHelper::getTimeForWeek2($date_today); $timeRecords = ttTimeHelper::getRecords($cl_date); $smarty->assign('week_total', $week_total); @@ -329,7 +330,7 @@ $smarty->assign('task_list', $task_list); $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="fillDropdowns()"'); -$smarty->assign('timestring', $selected_date->toString($user->date_format)); +$smarty->assign('timestring', $date_today->toString($user->getDateFormat())); $smarty->assign('title', $i18n->get('title.puncher')); $smarty->assign('content_page_name', 'puncher.tpl'); $smarty->display('index.tpl'); From c6e71668ca55e91c8d0f039949656a0994b3be81 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 23 Feb 2022 13:55:58 +0000 Subject: [PATCH 121/304] Improved a check for valid date. --- WEB-INF/lib/common.lib.php | 5 +++-- initialize.php | 2 +- puncher.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index f5baa1a1..6702919b 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -267,7 +267,8 @@ function ttValidDbDateFormatDate($val) if (!preg_match('/^\d\d\d\d-\d\d-\d\d$/', $val)) return false; - return true; + $date_parts = explode('-', $val); + return checkdate($date_parts[1], $date_parts[2], $date_parts[0]); } // ttValidTime is used to check user input for time post. @@ -276,7 +277,7 @@ function ttValidTime($val) if (is_null($val) || strlen($val) == 0) return false; - // This should validate a yime string in 24 hour format hh:mm. + // This should validate a time string in 24 hour format hh:mm. if (!preg_match('/^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/', $val)) return false; diff --git a/initialize.php b/initialize.php index 9328d3c0..827e9ce2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5643"); +define("APP_VERSION", "1.20.0.5644"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 55c42e36..d23fbd1f 100644 --- a/puncher.php +++ b/puncher.php @@ -29,7 +29,7 @@ exit(); } } -// If we are passed in browser_ttime, make sure it is in correct format. +// If we are passed in browser_time, make sure it is in correct format. $browser_time = null; // Reused below beyond access checks. if ($request->isPost()) { // Validate that browser_today parameter is in correct format. From bb7d08fa61a40369e8eeb07e476ec0a674e2f092 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 23 Feb 2022 14:31:36 +0000 Subject: [PATCH 122/304] Replaced emoji with an asterisk for subgroups dropdown because it does not display properly in Chrome 98. --- WEB-INF/lib/ttUser.class.php | 5 +++-- initialize.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 592b5d9c..19e689b5 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -555,9 +555,10 @@ function getGroupsForDropdown() { // addGroupToDropdown is a recursive function to populate a tree of groups, used with getGroupsForDropdown(). function addGroupToDropdown(&$groups, $group_id, $subgroup_level) { $name = ''; - // Add indentation markup to indicate subdirectory level. + // Add indentation markup to indicate a subdirectory level. for ($i = 0; $i < $subgroup_level; $i++) { - $name .= '🛑'; // Unicode stop sign. + $name .= '*'; + // $name .= '🛑'; // Unicode stop sign. Does not display properly in Chrome 98. } if ($subgroup_level) $name .= ' '; // Add an extra space. $name .= ttGroupHelper::getGroupName($group_id); diff --git a/initialize.php b/initialize.php index 827e9ce2..62c2c0f8 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5644"); +define("APP_VERSION", "1.20.0.5645"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6aaad31630500d13b6c8459daa9f406fd5eb4330 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 23 Feb 2022 15:43:34 +0000 Subject: [PATCH 123/304] Addressed stored XSS vulnerability when displaying primary group name. --- WEB-INF/lib/ttUser.class.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 19e689b5..f1eb3e09 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -834,7 +834,7 @@ function getUserPartForHeader() { $user_part .= ', '.htmlspecialchars($this->behalf_group_name).''; } else { if ($this->group_name) // Note: we did not require group names in the past. - $user_part .= ', '.$this->group_name; + $user_part .= ', '.htmlspecialchars($this->group_name); } return $user_part; } diff --git a/initialize.php b/initialize.php index 62c2c0f8..b4ad492f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5645"); +define("APP_VERSION", "1.20.0.5646"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 48a36e432dbd8789b032499eb2a8ef5549b0c5f1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 2 Mar 2022 17:24:06 +0000 Subject: [PATCH 124/304] A fix for issue #118. --- WEB-INF/lib/ttClientHelper.class.php | 45 +++++++++++++++++++++++++++ WEB-INF/lib/ttProjectHelper.class.php | 7 ++++- initialize.php | 2 +- 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttClientHelper.class.php b/WEB-INF/lib/ttClientHelper.class.php index ba62d0f3..5c9dff34 100644 --- a/WEB-INF/lib/ttClientHelper.class.php +++ b/WEB-INF/lib/ttClientHelper.class.php @@ -358,4 +358,49 @@ static function deleteProjectFromClient($project_id, $client_id) { $affected = $mdb2->exec($sql); return (!is_a($affected, 'PEAR_Error')); } + + // unassignProjectFromAllClients - removes a project reference from all clients in tt_clients table + // and also from tt_client_project_binds. + static function unassignProjectFromAllClients($project_id) { + global $user; + $mdb2 = getConnection(); + + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $project_id = (int) $project_id; // Cast for sql injection protection, just in case. + + // Start with cleaning up tt_client_project_binds table. + $sql = "delete from tt_client_project_binds". + " where project_id = $project_id and group_id = $group_id and org_id = $org_id"; + $affected = $mdb2->exec($sql); + if (is_a($affected, 'PEAR_Error')) + return false; + + // Continue with tt_clients table. + $sql = "select id, projects from tt_clients where projects like '%$project_id%' and group_id = $group_id and org_id = $org_id"; + $res = $mdb2->query($sql); + while ($val = $res->fetchRow()) { + + $client_id = (int) $val['id']; + $projectListed = false; + + $projects = explode(',', $val['projects']); + if (($key = array_search($project_id, $projects)) !== false) { + unset($projects[$key]); + $projectListed = true; + } + if (!$projectListed) + continue; // Project not listed, continue iterating. + + // If we are here, project is listed and we need to remove it. + $comma_separated = implode(',', $projects); + $sql = "update tt_clients set projects = ".$mdb2->quote($comma_separated). + " where id = $client_id and group_id = $group_id and org_id = $org_id"; + $affected = $mdb2->exec($sql); + if (is_a($affected, 'PEAR_Error')) + return false; + } + return true; + } } diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index dd6e35cb..97a9dbc2 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -357,7 +357,12 @@ static function update($fields) { return false; } // End of updating tt_project_task_binds table. - + + // If we are making the project inactive, remove references to it in tt_client_project_binds table. + if (constant('INACTIVE') == $status) { + ttClientHelper::unassignProjectFromAllClients($project_id); + } + // Update project name, description, tasks and status in tt_projects table. $comma_separated = implode(",", $tasks_to_bind); // This is a comma-separated list of associated task ids. $sql = "update tt_projects set name = ".$mdb2->quote($name).", description = ".$mdb2->quote($description). diff --git a/initialize.php b/initialize.php index b4ad492f..5d433ef6 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.0.5646"); +define("APP_VERSION", "1.20.1.5647"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bcb15ae43e46f2ae8a326374286f95a7436647de Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 2 Mar 2022 17:27:20 +0000 Subject: [PATCH 125/304] Cosmetic. Comment changed for clarity. --- WEB-INF/lib/ttProjectHelper.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index 97a9dbc2..4a827189 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -358,7 +358,7 @@ static function update($fields) { } // End of updating tt_project_task_binds table. - // If we are making the project inactive, remove references to it in tt_client_project_binds table. + // If we are making the project inactive, unassign it from all clients. if (constant('INACTIVE') == $status) { ttClientHelper::unassignProjectFromAllClients($project_id); } From 407e6c65271d30c058377ece5a885ecfc852aaea Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 3 Mar 2022 18:56:25 +0000 Subject: [PATCH 126/304] Improved a check for overlap. Existing code was not working when finish is start as in uncompleted records. --- WEB-INF/lib/ttTimeHelper.class.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index b45c6d17..70b98458 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -718,7 +718,7 @@ static function overlaps($user_id, $date, $start, $finish, $record_id = null) { and start is not null and duration is not null and status = 1 and ( (cast(".$mdb2->quote($start)." as time) >= start and cast(".$mdb2->quote($start)." as time) < addtime(start, duration))"; if ($finish) { - $sql .= " or (cast(".$mdb2->quote($finish)." as time) <= addtime(start, duration) and cast(".$mdb2->quote($finish)." as time) > start) + $sql .= " or (cast(".$mdb2->quote($finish)." as time) < addtime(start, duration) and cast(".$mdb2->quote($finish)." as time) >= start) or (cast(".$mdb2->quote($start)." as time) < start and cast(".$mdb2->quote($finish)." as time) > addtime(start, duration))"; } $sql .= ")"; diff --git a/initialize.php b/initialize.php index 5d433ef6..61208f77 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.1.5647"); +define("APP_VERSION", "1.20.1.5648"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From d3fcdf90b38f68f7ce1bed7f05ee74fa70fdeb7b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 4 Mar 2022 15:08:48 +0000 Subject: [PATCH 127/304] Rolling back a change from previous commit. --- WEB-INF/lib/ttTimeHelper.class.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index 70b98458..b45c6d17 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -718,7 +718,7 @@ static function overlaps($user_id, $date, $start, $finish, $record_id = null) { and start is not null and duration is not null and status = 1 and ( (cast(".$mdb2->quote($start)." as time) >= start and cast(".$mdb2->quote($start)." as time) < addtime(start, duration))"; if ($finish) { - $sql .= " or (cast(".$mdb2->quote($finish)." as time) < addtime(start, duration) and cast(".$mdb2->quote($finish)." as time) >= start) + $sql .= " or (cast(".$mdb2->quote($finish)." as time) <= addtime(start, duration) and cast(".$mdb2->quote($finish)." as time) > start) or (cast(".$mdb2->quote($start)." as time) < start and cast(".$mdb2->quote($finish)." as time) > addtime(start, duration))"; } $sql .= ")"; diff --git a/initialize.php b/initialize.php index 61208f77..27e30248 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.1.5648"); +define("APP_VERSION", "1.20.1.5649"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 4bf1cc9e8a50d630db7571a2894cb6d87670ea3f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 10 Mar 2022 16:57:53 +0000 Subject: [PATCH 128/304] Added all users option to charts. --- WEB-INF/lib/ttChartHelper.class.php | 20 +++++++++--- WEB-INF/lib/ttRoleHelper.class.php | 2 +- WEB-INF/templates/header.tpl | 2 +- WEB-INF/templates/site_map.tpl | 2 +- charts.php | 48 +++++++++++++++++++++-------- dbinstall.php | 10 +++--- initialize.php | 2 +- mysql.sql | 4 +-- 8 files changed, 63 insertions(+), 27 deletions(-) diff --git a/WEB-INF/lib/ttChartHelper.class.php b/WEB-INF/lib/ttChartHelper.class.php index 60c9897c..faf18263 100644 --- a/WEB-INF/lib/ttChartHelper.class.php +++ b/WEB-INF/lib/ttChartHelper.class.php @@ -40,6 +40,11 @@ class ttChartHelper { // getTotals - returns total times by project or task for a given user in a specified period. static function getTotals($user_id, $chart_type, $selected_date, $interval_type) { + global $user; + $user_id = (int) $user_id; // Cast to int just in case for sql injections. + $group_id = $user->getGroup(); + $org_id = $user->org_id; + $period = null; switch ($interval_type) { case INTERVAL_THIS_DAY: @@ -62,25 +67,32 @@ static function getTotals($user_id, $chart_type, $selected_date, $interval_type) $result = array(); $mdb2 = getConnection(); + $userIdPart = ''; + if ($user_id > 0) { + // -1 here means "all users in group" both active and inactive. + // Therefore, we will not be using user id. + $userIdPart = "and l.user_id = $user_id"; + } + $q_period = ''; if ($period != null) { - $q_period = " and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."'"; + $q_period = "and date >= '".$period->getStartDate(DB_DATEFORMAT)."' and date <= '".$period->getEndDate(DB_DATEFORMAT)."'"; } if (CHART_PROJECTS == $chart_type) { // Data for projects. $sql = "select p.name as name, sum(time_to_sec(l.duration)) as time from tt_log l left join tt_projects p on (p.id = l.project_id) - where l.status = 1 and l.user_id = $user_id $q_period group by l.project_id"; + where l.status = 1 $userIdPart and l.group_id = $group_id and l.org_id = $org_id $q_period group by l.project_id"; } elseif (CHART_TASKS == $chart_type) { // Data for tasks. $sql = "select t.name as name, sum(time_to_sec(l.duration)) as time from tt_log l left join tt_tasks t on (t.id = l.task_id) - where l.status = 1 and l.user_id = $user_id $q_period group by l.task_id"; + where l.status = 1 $userIdPart and l.group_id = $group_id and l.org_id = $org_id $q_period group by l.task_id"; } elseif (CHART_CLIENTS == $chart_type) { // Data for clients. $sql = "select c.name as name, sum(time_to_sec(l.duration)) as time from tt_log l left join tt_clients c on (c.id = l.client_id) - where l.status = 1 and l.user_id = $user_id $q_period group by l.client_id"; + where l.status = 1 $userIdPart and l.group_id = $group_id and l.org_id = $org_id $q_period group by l.client_id"; } $res = $mdb2->query($sql); diff --git a/WEB-INF/lib/ttRoleHelper.class.php b/WEB-INF/lib/ttRoleHelper.class.php index 1ddc839c..fa6739a5 100644 --- a/WEB-INF/lib/ttRoleHelper.class.php +++ b/WEB-INF/lib/ttRoleHelper.class.php @@ -169,7 +169,7 @@ static function createPredefinedRoles($group_id, $lang) $rights_client = 'view_client_reports,view_client_invoices,manage_own_settings'; $rights_user = 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users'; $rights_supervisor = $rights_user.',track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_date_lock,override_own_date_lock,swap_roles'; - $rights_comanager = $rights_supervisor.',manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports'; + $rights_comanager = $rights_supervisor.',manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_charts,view_all_reports'; $rights_manager = $rights_comanager.',manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups'; // Active roles. diff --git a/WEB-INF/templates/header.tpl b/WEB-INF/templates/header.tpl index a189e50e..af6151ac 100644 --- a/WEB-INF/templates/header.tpl +++ b/WEB-INF/templates/header.tpl @@ -114,7 +114,7 @@ {if $user->exists() && $user->isPluginEnabled('iv') && ($user->can('manage_invoices') || $user->can('view_client_invoices'))} {$i18n.title.invoices} {/if} - {if ($user->exists() && $user->isPluginEnabled('ch') && ($user->can('view_own_charts') || $user->can('view_charts'))) && + {if ($user->exists() && $user->isPluginEnabled('ch') && ($user->can('view_own_charts') || $user->can('view_charts') || $user->can('view_all_charts'))) && (constant('MODE_PROJECTS') == $user->getTrackingMode() || constant('MODE_PROJECTS_AND_TASKS') == $user->getTrackingMode() || $user->isPluginEnabled('cl'))} {$i18n.menu.charts} diff --git a/WEB-INF/templates/site_map.tpl b/WEB-INF/templates/site_map.tpl index 54ff8818..8688f767 100644 --- a/WEB-INF/templates/site_map.tpl +++ b/WEB-INF/templates/site_map.tpl @@ -37,7 +37,7 @@ {if $user->exists() && $user->isPluginEnabled('iv') && ($user->can('manage_invoices') || $user->can('view_client_invoices'))} {/if} - {if ($user->exists() && $user->isPluginEnabled('ch') && ($user->can('view_own_charts') || $user->can('view_charts'))) && + {if ($user->exists() && $user->isPluginEnabled('ch') && ($user->can('view_own_charts') || $user->can('view_charts') || $user->can('view_all_charts'))) && (constant('MODE_PROJECTS') == $user->getTrackingMode() || constant('MODE_PROJECTS_AND_TASKS') == $user->getTrackingMode() || $user->isPluginEnabled('cl'))} diff --git a/charts.php b/charts.php index 88878f6b..cfd01c5f 100644 --- a/charts.php +++ b/charts.php @@ -13,8 +13,10 @@ import('ttUserHelper'); import('ttTeamHelper'); +define('ALL_USERS_OPTION_ID', -1); // An identifier for "all users" seclection in User dropdown. + // Access checks. -if (!(ttAccessAllowed('view_own_charts') || ttAccessAllowed('view_charts'))) { +if (!(ttAccessAllowed('view_own_charts') || ttAccessAllowed('view_charts') || ttAccessAllowed('view_all_charts'))) { header('Location: access_denied.php'); exit(); } @@ -26,7 +28,7 @@ header('Location: access_denied.php'); // Nobody to display a chart for. exit(); } -if ($user->behalf_id && (!$user->can('view_charts') || !$user->checkBehalfId())) { +if ($user->behalf_id && (!($user->can('view_charts') || $user->can('view_all_charts')) || !$user->checkBehalfId())) { header('Location: access_denied.php'); // Trying on behalf, but no right or wrong user. exit(); } @@ -34,8 +36,13 @@ header('Location: access_denied.php'); // Trying as self, but no right for self, and noone to view on behalf. exit(); } +$userDropdownSelectionId = (int) $request->getParameter('user'); // Resused below access checks. if ($request->isPost() && $request->getParameter('user')) { - if (!$user->isUserValid((int)$request->getParameter('user'))) { + if ($userDropdownSelectionId == constant('ALL_USERS_OPTION_ID') && !ttAccessAllowed('view_all_charts')) { + header('Location: access_denied.php'); // All users option is only for users with view_all_charts access right. + exit(); + } + if ($userDropdownSelectionId != constant('ALL_USERS_OPTION_ID') && !$user->isUserValid($userDropdownSelectionId)) { header('Location: access_denied.php'); // Wrong user id on post. exit(); } @@ -47,13 +54,16 @@ } // End of access checks. -// Determine user for which we display this page. -$userChanged = (int)$request->getParameter('user_changed'); -if ($request->isPost() && $userChanged) { - $user_id = (int)$request->getParameter('user'); - $user->setOnBehalfUser($user_id); -} else { - $user_id = $user->getUser(); +// Determine user for whom we display this page. +$userChanged = (int) $request->getParameter('user_changed'); +if ($request->isPost() && $userChanged ) { + if ($userDropdownSelectionId != constant('ALL_USERS_OPTION_ID')) { + $user->setOnBehalfUser($userDropdownSelectionId); + } +} +if ($request->isGet()) { + $userDropdownSelectionId = $user->getUser(); + // Note that this may change to ALL_USERS_OPTION_ID below from session. } $uc = new ttUserConfig(); @@ -77,6 +87,9 @@ if (!$cl_type) $cl_type = ttChartHelper::adjustType($cl_type); $_SESSION['chart_type'] = $cl_type; $uc->setValue(SYSC_CHART_TYPE, $cl_type); + + // Remember all users selection in session. + $_SESSION['chart_all_users'] = $userDropdownSelectionId == constant('ALL_USERS_OPTION_ID') ? true : false; } else { // Initialize chart interval. $cl_interval = @$_SESSION['chart_interval']; @@ -89,6 +102,11 @@ if (!$cl_type) $cl_type = $uc->getValue(SYSC_CHART_TYPE); $cl_type = ttChartHelper::adjustType($cl_type); $_SESSION['chart_type'] = $cl_type; + + // Set user selection to all users, if necessary. + $allUsersSetInSession = @$_SESSION['chart_all_users']; + if ($allUsersSetInSession) + $userDropdownSelectionId = constant('ALL_USERS_OPTION_ID'); } // Elements of chartForm. @@ -96,18 +114,22 @@ $largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. // User dropdown. Changes the user "on behalf" of whom we are working. -if ($user->can('view_charts')) { +if ($user->can('view_charts') || $user->can('view_all_charts')) { $rank = $user->getMaxRankForGroup($user->getGroup()); if ($user->can('view_own_charts')) $options = array('status'=>ACTIVE,'max_rank'=>$rank,'include_self'=>true,'self_first'=>true); else $options = array('status'=>ACTIVE,'max_rank'=>$rank); $user_list = $user->getUsers($options); + // Add the --- all --- option to dropdown. + if ($user->can('view_all_charts')) { + $user_list[] = array('id'=>'-1','group_id'=>$user->getGroup(), 'name'=>$i18n->get('dropdown.all'), 'rights'=>''); + } if (count($user_list) >= 1) { $chart_form->addInput(array('type'=>'combobox', 'onchange'=>'this.form.user_changed.value=1;this.form.submit();', 'name'=>'user', - 'value'=>$user_id, + 'value'=>$userDropdownSelectionId, 'data'=>$user_list, 'datakeys'=>array('id','name'), )); @@ -159,7 +181,7 @@ $chart_form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar // Get data for our chart. -$totals = ttChartHelper::getTotals($user_id, $cl_type, $cl_date, $cl_interval); +$totals = ttChartHelper::getTotals($userDropdownSelectionId, $cl_type, $cl_date, $cl_interval); $smarty->assign('totals', $totals); // Prepare chart for drawing. diff --git a/dbinstall.php b/dbinstall.php index a3168bbf..182910ad 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1151,7 +1151,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to12000"]) { + if ($_POST["convert11900to12100"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1191,6 +1191,8 @@ function ttGenerateKeys() { ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.19.29') set rights = replace(rights, 'swap_roles,update_work', 'swap_roles') where `rank` >= 12"); ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.19.29') set rights = replace(rights, 'view_all_reports,manage_work,bid_on_work', 'view_all_reports') where `rank` >= 68"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.20.0', modified = now() where param_name = 'version_db' and param_value = '1.19.29'"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.20.0') set rights = replace(rights, 'manage_basic_settings,view_all_reports', 'manage_basic_settings,view_all_charts,view_all_reports') where `rank` >= 68"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.0', modified = now() where param_name = 'version_db' and param_value = '1.20.0'"); } if ($_POST["cleanup"]) { @@ -1241,7 +1243,7 @@ function ttGenerateKeys() {

DB Install

-
Create database structure (v1.20.0) + Create database structure (v1.21.0)
(applies only to new installations, do not execute when updating)
@@ -1290,8 +1292,8 @@ function ttGenerateKeys() { - Update database structure (v1.19 to v1.20) - + Update database structure (v1.19 to v1.21) + diff --git a/initialize.php b/initialize.php index 27e30248..48af9888 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.20.1.5649"); +define("APP_VERSION", "1.21.0.5650"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index 55d8e8b5..05743ee5 100644 --- a/mysql.sql +++ b/mysql.sql @@ -78,7 +78,7 @@ create unique index role_idx on tt_roles(group_id, `rank`, status); # Insert site-wide roles - site administrator and top manager. INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Site administrator', 1024, 'administer_site'); -INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_reports,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,delete_group'); +INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_charts,view_all_reports,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,delete_group'); # @@ -621,4 +621,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.20.0', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.0', now()); # TODO: change when structure changes. From d6ee66fa1e218b13c093e7c7d0b34f34cb15bd06 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 12 Mar 2022 16:12:19 +0000 Subject: [PATCH 129/304] Updated links. --- .htaccess | 2 +- CONTRIBUTING.md | 4 ++-- WEB-INF/config.php.dist | 4 ++-- WEB-INF/lib/Auth.class.php | 2 +- WEB-INF/lib/DateAndTime.class.php | 2 +- WEB-INF/lib/I18n.class.php | 2 +- WEB-INF/lib/Period.class.php | 2 +- WEB-INF/lib/form/ActionErrors.class.php | 2 +- WEB-INF/lib/form/ActionForm.class.php | 2 +- WEB-INF/lib/form/Calendar.class.php | 2 +- WEB-INF/lib/form/Checkbox.class.php | 2 +- WEB-INF/lib/form/CheckboxCellRenderer.class.php | 2 +- WEB-INF/lib/form/CheckboxGroup.class.php | 2 +- WEB-INF/lib/form/DefaultCellRenderer.class.php | 2 +- WEB-INF/lib/form/FloatField.class.php | 2 +- WEB-INF/lib/form/Hidden.class.php | 2 +- WEB-INF/lib/form/Submit.class.php | 2 +- WEB-INF/lib/form/Table.class.php | 2 +- WEB-INF/lib/form/TableColumn.class.php | 2 +- WEB-INF/lib/form/TextArea.class.php | 2 +- WEB-INF/lib/form/TextField.class.php | 2 +- WEB-INF/lib/form/UploadFile.class.php | 2 +- WEB-INF/lib/html/HttpRequest.class.php | 2 +- WEB-INF/lib/mail/Mailer.class.php | 2 +- WEB-INF/lib/ttBehalfUser.class.php | 2 +- WEB-INF/lib/ttChartHelper.class.php | 2 +- WEB-INF/lib/ttCronJobHelper.class.php | 2 +- WEB-INF/lib/ttDebugTracer.class.php | 2 +- WEB-INF/lib/ttNotificationHelper.class.php | 2 +- WEB-INF/lib/ttOrgExportHelper.class.php | 2 +- WEB-INF/lib/ttOrgHelper.class.php | 2 +- WEB-INF/lib/ttPredefinedExpenseHelper.class.php | 2 +- WEB-INF/lib/ttProjectHelper.class.php | 2 +- WEB-INF/lib/ttTeamHelper.class.php | 2 +- initialize.php | 2 +- plugins/CustomFields.class.php | 2 +- plugins/MonthlyQuota.class.php | 2 +- readme.txt | 10 +++++----- 38 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.htaccess b/.htaccess index 189e6b4b..3b6168c7 100644 --- a/.htaccess +++ b/.htaccess @@ -2,7 +2,7 @@ AddDefaultCharset utf-8 # Restrict access to Time Tracker only from certain IPs. # -# See https://www.anuko.com/time_tracker/faq/restrict_access_by_ip.htm for help. +# See https://www.anuko.com/time-tracker/faq/restrict-access-by-ip.htm for help. # For this to work make sure AllowOverride is set to All in web server config file. # Uncomment 3 lines below and set your IP accordingly. # diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7311238..58c97180 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Resources -* [docs](https://www.anuko.com/time_tracker/features.htm) - detailed documentation about this project (needs updating). +* [docs](https://www.anuko.com/time-tracker/features.htm) - detailed documentation about this project (needs updating). * [forum](https://www.anuko.com/forum/viewforum.php?f=4) - general discussion. @@ -29,4 +29,4 @@ usr: admin psw: secret ``` -Without docker, perform a manual install of a web server, php, database server, and Time Tracker. Full installation and setup guide can be found [here](https://www.anuko.com/time_tracker/install_guide/index.htm). +Without docker, perform a manual install of a web server, php, database server, and Time Tracker. Full installation and setup guide can be found [here](https://www.anuko.com/time-tracker/install-guide/index.htm). diff --git a/WEB-INF/config.php.dist b/WEB-INF/config.php.dist index 9d9d90df..6b6a68d8 100644 --- a/WEB-INF/config.php.dist +++ b/WEB-INF/config.php.dist @@ -88,7 +88,7 @@ define('SENDER', 'Anuko Time Tracker '); // MAIL_MODE - mail sending mode. Can be 'mail' or 'smtp'. // 'mail' - sending through php mail() function. // 'smtp' - sending directly through SMTP server. -// See https://www.anuko.com/time_tracker/install_guide/mail.htm +// See https://www.anuko.com/time-tracker/install-guide/mail.htm // define('MAIL_MODE', 'smtp'); define('MAIL_SMTP_HOST', 'localhost'); // For gmail use 'ssl://smtp.gmail.com' instead of 'localhost' and port 465. @@ -133,7 +133,7 @@ define('REPORT_FOOTER', true); define('AUTH_MODULE', 'db'); // LDAP authentication examples. -// Go to https://www.anuko.com/time_tracker/install_guide/ldap_auth/index.htm for detailed configuration instructions. +// Go to https://www.anuko.com/time-tracker/install-guide/ldap-auth/index.htm for detailed configuration instructions. // Configuration example for OpenLDAP server: // define('AUTH_MODULE', 'ldap'); diff --git a/WEB-INF/lib/Auth.class.php b/WEB-INF/lib/Auth.class.php index ccf2d915..78372109 100644 --- a/WEB-INF/lib/Auth.class.php +++ b/WEB-INF/lib/Auth.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class Auth { diff --git a/WEB-INF/lib/DateAndTime.class.php b/WEB-INF/lib/DateAndTime.class.php index 1184bd85..e7224598 100644 --- a/WEB-INF/lib/DateAndTime.class.php +++ b/WEB-INF/lib/DateAndTime.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ /** diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index ed838081..1760da48 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class I18n { diff --git a/WEB-INF/lib/Period.class.php b/WEB-INF/lib/Period.class.php index 2d2269e5..57ea0e44 100644 --- a/WEB-INF/lib/Period.class.php +++ b/WEB-INF/lib/Period.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ define('INTERVAL_THIS_DAY', 1); diff --git a/WEB-INF/lib/form/ActionErrors.class.php b/WEB-INF/lib/form/ActionErrors.class.php index 3eaf6872..ba35ea63 100644 --- a/WEB-INF/lib/form/ActionErrors.class.php +++ b/WEB-INF/lib/form/ActionErrors.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class ActionErrors { diff --git a/WEB-INF/lib/form/ActionForm.class.php b/WEB-INF/lib/form/ActionForm.class.php index 8e2ad8af..abc5e006 100644 --- a/WEB-INF/lib/form/ActionForm.class.php +++ b/WEB-INF/lib/form/ActionForm.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import("DateAndTime"); diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 072b4828..7de81d87 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/Checkbox.class.php b/WEB-INF/lib/form/Checkbox.class.php index c4acbc5f..619d39fb 100644 --- a/WEB-INF/lib/form/Checkbox.class.php +++ b/WEB-INF/lib/form/Checkbox.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/CheckboxCellRenderer.class.php b/WEB-INF/lib/form/CheckboxCellRenderer.class.php index d117c12e..cd968270 100644 --- a/WEB-INF/lib/form/CheckboxCellRenderer.class.php +++ b/WEB-INF/lib/form/CheckboxCellRenderer.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.DefaultCellRenderer'); diff --git a/WEB-INF/lib/form/CheckboxGroup.class.php b/WEB-INF/lib/form/CheckboxGroup.class.php index 9488b5cc..68b24853 100644 --- a/WEB-INF/lib/form/CheckboxGroup.class.php +++ b/WEB-INF/lib/form/CheckboxGroup.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/DefaultCellRenderer.class.php b/WEB-INF/lib/form/DefaultCellRenderer.class.php index 1e36f79b..55f4bbca 100644 --- a/WEB-INF/lib/form/DefaultCellRenderer.class.php +++ b/WEB-INF/lib/form/DefaultCellRenderer.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class DefaultCellRenderer { diff --git a/WEB-INF/lib/form/FloatField.class.php b/WEB-INF/lib/form/FloatField.class.php index 5b939754..e6cbf106 100644 --- a/WEB-INF/lib/form/FloatField.class.php +++ b/WEB-INF/lib/form/FloatField.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.TextField'); diff --git a/WEB-INF/lib/form/Hidden.class.php b/WEB-INF/lib/form/Hidden.class.php index 6e59bc8e..89e90c7e 100644 --- a/WEB-INF/lib/form/Hidden.class.php +++ b/WEB-INF/lib/form/Hidden.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/Submit.class.php b/WEB-INF/lib/form/Submit.class.php index 5f8da37e..151600b3 100644 --- a/WEB-INF/lib/form/Submit.class.php +++ b/WEB-INF/lib/form/Submit.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/Table.class.php b/WEB-INF/lib/form/Table.class.php index d617f8b3..acdf4813 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/TableColumn.class.php b/WEB-INF/lib/form/TableColumn.class.php index cb4bebf1..87538eaa 100644 --- a/WEB-INF/lib/form/TableColumn.class.php +++ b/WEB-INF/lib/form/TableColumn.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.DefaultCellRenderer'); diff --git a/WEB-INF/lib/form/TextArea.class.php b/WEB-INF/lib/form/TextArea.class.php index 715a6ea9..4faac144 100644 --- a/WEB-INF/lib/form/TextArea.class.php +++ b/WEB-INF/lib/form/TextArea.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/TextField.class.php b/WEB-INF/lib/form/TextField.class.php index bb05c673..bfc0e551 100644 --- a/WEB-INF/lib/form/TextField.class.php +++ b/WEB-INF/lib/form/TextField.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/form/UploadFile.class.php b/WEB-INF/lib/form/UploadFile.class.php index 50e8aad5..36d0d92a 100644 --- a/WEB-INF/lib/form/UploadFile.class.php +++ b/WEB-INF/lib/form/UploadFile.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('form.FormElement'); diff --git a/WEB-INF/lib/html/HttpRequest.class.php b/WEB-INF/lib/html/HttpRequest.class.php index 2eb26f0a..bc32debc 100644 --- a/WEB-INF/lib/html/HttpRequest.class.php +++ b/WEB-INF/lib/html/HttpRequest.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class ttHttpRequest { diff --git a/WEB-INF/lib/mail/Mailer.class.php b/WEB-INF/lib/mail/Mailer.class.php index 30f0ffb6..4c7eb013 100644 --- a/WEB-INF/lib/mail/Mailer.class.php +++ b/WEB-INF/lib/mail/Mailer.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class Mailer { diff --git a/WEB-INF/lib/ttBehalfUser.class.php b/WEB-INF/lib/ttBehalfUser.class.php index 408602a1..e85770c1 100644 --- a/WEB-INF/lib/ttBehalfUser.class.php +++ b/WEB-INF/lib/ttBehalfUser.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttConfigHelper'); diff --git a/WEB-INF/lib/ttChartHelper.class.php b/WEB-INF/lib/ttChartHelper.class.php index faf18263..4e4f9c83 100644 --- a/WEB-INF/lib/ttChartHelper.class.php +++ b/WEB-INF/lib/ttChartHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('Period'); diff --git a/WEB-INF/lib/ttCronJobHelper.class.php b/WEB-INF/lib/ttCronJobHelper.class.php index 8c44756c..15393895 100644 --- a/WEB-INF/lib/ttCronJobHelper.class.php +++ b/WEB-INF/lib/ttCronJobHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttRoleHelper'); diff --git a/WEB-INF/lib/ttDebugTracer.class.php b/WEB-INF/lib/ttDebugTracer.class.php index 46469a90..33921e9d 100644 --- a/WEB-INF/lib/ttDebugTracer.class.php +++ b/WEB-INF/lib/ttDebugTracer.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttConfigHelper'); diff --git a/WEB-INF/lib/ttNotificationHelper.class.php b/WEB-INF/lib/ttNotificationHelper.class.php index 35c30904..8189e5a9 100644 --- a/WEB-INF/lib/ttNotificationHelper.class.php +++ b/WEB-INF/lib/ttNotificationHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ // Class ttNotificationHelper is used to help with notification related tasks. diff --git a/WEB-INF/lib/ttOrgExportHelper.class.php b/WEB-INF/lib/ttOrgExportHelper.class.php index 2dd54f1b..277eac3a 100644 --- a/WEB-INF/lib/ttOrgExportHelper.class.php +++ b/WEB-INF/lib/ttOrgExportHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttTeamHelper'); diff --git a/WEB-INF/lib/ttOrgHelper.class.php b/WEB-INF/lib/ttOrgHelper.class.php index 81169032..656450f0 100644 --- a/WEB-INF/lib/ttOrgHelper.class.php +++ b/WEB-INF/lib/ttOrgHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ // Class ttOrgHelper contains helper functions that operate with organizations. diff --git a/WEB-INF/lib/ttPredefinedExpenseHelper.class.php b/WEB-INF/lib/ttPredefinedExpenseHelper.class.php index c6bc3f35..6d60d533 100644 --- a/WEB-INF/lib/ttPredefinedExpenseHelper.class.php +++ b/WEB-INF/lib/ttPredefinedExpenseHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index 4a827189..e1d5754c 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttUserHelper'); diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 9bb53891..981f01b5 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttUserHelper'); diff --git a/initialize.php b/initialize.php index 48af9888..d9e800df 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.0.5650"); +define("APP_VERSION", "1.21.0.5651"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index 1a7b94e9..4e2f1319 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -24,7 +24,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ class CustomFields { diff --git a/plugins/MonthlyQuota.class.php b/plugins/MonthlyQuota.class.php index 76a7c510..b291d373 100644 --- a/plugins/MonthlyQuota.class.php +++ b/plugins/MonthlyQuota.class.php @@ -23,7 +23,7 @@ // | // +----------------------------------------------------------------------+ // | Contributors: -// | https://www.anuko.com/time_tracker/credits.htm +// | https://www.anuko.com/time-tracker/credits.htm // +----------------------------------------------------------------------+ import('ttTimeHelper'); diff --git a/readme.txt b/readme.txt index 421a18cd..90cdc970 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ Anuko Time Tracker Copyright (c) Anuko (https://www.anuko.com) -Project home page: https://www.anuko.com/time_tracker/index.htm +Project home page: https://www.anuko.com/time-tracker/index.htm Forum: https://www.anuko.com/forum/viewforum.php?f=4 -Info for developers: https://www.anuko.com/time_tracker/info_for_developers.htm +Info for developers: https://www.anuko.com/time-tracker/info-for-developers.htm Free hosting of Time Tracker for individuals and small groups is available at https://timetracker.anuko.com Unless otherwise noted, files in this archive are protected by the LIBERAL FREEWARE LICENSE. @@ -12,7 +12,7 @@ Read the file license.txt for details. INSTALLATION INSTRUCTIONS -Documentation is available at https://www.anuko.com/time_tracker/install_guide/index.htm +Documentation is available at https://www.anuko.com/time-tracker/install-guide/index.htm The general installation procedure looks like this: @@ -40,7 +40,7 @@ The general installation procedure looks like this: UPGRADE FROM EARLIER VERSIONS -See https://www.anuko.com/time_tracker/upgrade.htm +See https://www.anuko.com/time-tracker/install-guide/upgrade.htm BLANK PAGES IN TIME TRACKER @@ -62,4 +62,4 @@ Support is available on per-incident basis - see https://www.anuko.com/support.h CHANGE LOG -Change log is available at https://www.anuko.com/time_tracker/change_log/index.htm \ No newline at end of file +Change log is available at https://www.anuko.com/time-tracker/change-log/index.htm \ No newline at end of file From 84638df3b637f376deb70ed060cb4a4b6d015295 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 13 Mar 2022 14:56:32 +0000 Subject: [PATCH 130/304] Starting working on password complexity. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/group_advanced_edit.tpl | 11 +++++++++++ group_advanced_edit.php | 7 ++++++- 32 files changed, 49 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 6b74dced..a9937cea 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -584,6 +584,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 836ef4f2..9d533173 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -596,6 +596,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index bc042b6e..22aba0de 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -562,6 +562,7 @@ // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index dae614fb..9a845d1f 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -537,6 +537,7 @@ 'form.group_edit.confirm_save' => 'Speichern bestätigen', 'form.group_edit.allow_ip' => 'Erlaube IP', // TODO: translate the following. +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 652c3e48..ab776955 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -520,6 +520,7 @@ 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', 'form.group_edit.confirm_save' => 'Confirm saving', 'form.group_edit.allow_ip' => 'Allow IP', +'form.group_edit.password_complexity' => 'Password complexity', 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index f2bb893b..b7942fbe 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -598,6 +598,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 67210ee6..e14416bc 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -571,6 +571,7 @@ 'form.group_edit.confirm_save' => 'Kinnita salvestamine', 'form.group_edit.allow_ip' => 'Luba IP', // TODO: translate the following. +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 31c1506f..8ccc29f0 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -584,6 +584,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index c0d71266..26c15088 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -568,6 +568,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 61570ee8..892b0291 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -558,6 +558,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index c795c507..f1dbbc3c 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -549,6 +549,7 @@ // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 72a48ba5..4f2a4923 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -588,6 +588,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 8b1e0b34..924b4acc 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -588,6 +588,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 90167eb2..383b1ab1 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -564,6 +564,7 @@ // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index d0bad574..b3fd57f4 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -590,6 +590,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 3e62d9d2..d182519a 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -588,6 +588,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 79baaa97..8c1afa7f 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -506,6 +506,8 @@ 'form.group_edit.uncompleted_indicators' => 'Onvolledige indicatoren', 'form.group_edit.confirm_save' => 'Bevestigen dat je wilt opslaan', 'form.group_edit.allow_ip' => 'Toegestane IP adressen', +// TODO: translate the following. +// 'form.group_edit.password_complexity' => 'Password complexity', 'form.group_edit.advanced_settings' => 'Geavanceerde instellingen', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 59895058..8b5e13f0 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -591,6 +591,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index c826441f..97ac1e0d 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -570,6 +570,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index ba2ed1d7..b01e94d3 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -504,6 +504,8 @@ 'form.group_edit.uncompleted_indicators' => 'Indicadores incompletos', 'form.group_edit.confirm_save' => 'Confirme o salvamento', 'form.group_edit.allow_ip' => 'Permitir IP', +// TODO: translate the following. +// 'form.group_edit.password_complexity' => 'Password complexity', 'form.group_edit.advanced_settings' => 'Configurações avançadas', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index cac4c68e..7c724cd2 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -570,6 +570,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 1d97b1fe..33c4547d 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -592,6 +592,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 20d7d7e6..3707ce74 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -507,6 +507,7 @@ 'form.group_edit.uncompleted_indicators' => 'Индикаторы незавершения', 'form.group_edit.confirm_save' => 'Предупреждать при сохранении', 'form.group_edit.allow_ip' => 'Разрешить доступ с IP', +'form.group_edit.password_complexity' => 'Сложность пароля', 'form.group_edit.advanced_settings' => 'Продвинутые настройки', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 89f26abd..345666d8 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -574,6 +574,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 56eeb205..d5b56f4a 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -565,6 +565,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index c88e9d07..652eaa89 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -570,6 +570,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 36c0a325..b39366bc 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -568,6 +568,7 @@ // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 2e5bed2b..2aae8ed9 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -605,6 +605,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index b1c0667b..f423fab8 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -579,6 +579,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 5212a3f8..92f5dbf5 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -582,6 +582,7 @@ // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', +// 'form.group_edit.password_complexity' => 'Password complexity', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl index 1f55adf7..66fa4103 100644 --- a/WEB-INF/templates/group_advanced_edit.tpl +++ b/WEB-INF/templates/group_advanced_edit.tpl @@ -32,6 +32,17 @@ License: See license.txt *} {$i18n.label.what_is_it} +{if constant('PASSWORD_COMPLEXITY_DEBUG')} +
+ + + + {$forms.groupAdvancedForm.password_complexity.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} + + +{/if}
{$i18n.label.required_fields}
diff --git a/group_advanced_edit.php b/group_advanced_edit.php index d0801757..a950b8d2 100644 --- a/group_advanced_edit.php +++ b/group_advanced_edit.php @@ -22,11 +22,13 @@ $cl_description = trim($request->getParameter('description')); $cl_bcc_email = trim($request->getParameter('bcc_email')); $cl_allow_ip = trim($request->getParameter('allow_ip')); + $cl_password_compexity = trim($request->getParameter('password_complexity')); } else { $cl_group = $group['name']; $cl_description = $group['description']; $cl_bcc_email = $group['bcc_email']; $cl_allow_ip = $group['allow_ip']; + $cl_password_compexity = $group['password_complexity']; } $form = new Form('groupAdvancedForm'); @@ -34,6 +36,7 @@ $form->addInput(array('type'=>'textarea','name'=>'description','value'=>$cl_description)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'bcc_email','value'=>$cl_bcc_email)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'allow_ip','value'=>$cl_allow_ip)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'password_complexity','value'=>$cl_password_complexity)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); @@ -44,6 +47,7 @@ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc')); if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip')); + // TODO: add validation for password complexity field. // Finished validating user input. if ($err->no()) { @@ -51,7 +55,8 @@ 'name' => $cl_group, 'description' => $cl_description, 'bcc_email' => $cl_bcc_email, - 'allow_ip' => $cl_allow_ip))) { + 'allow_ip' => $cl_allow_ip, + 'password_complexity' => $cl_password_complexity))) { header('Location: success.php'); exit(); } else From 26c4bcf64643c64b6bd3c5e36f0b3e99ede56b38 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 13 Mar 2022 17:27:48 +0000 Subject: [PATCH 131/304] Some mnore progress on password complexity. --- WEB-INF/lib/common.lib.php | 10 ++++++++++ WEB-INF/lib/ttUser.class.php | 3 ++- group_advanced_edit.php | 6 +++--- initialize.php | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 6702919b..365452f8 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -396,6 +396,16 @@ function ttValidHolidays($val) return true; } +// ttValidPasswordComplexity is used to check user input for password complexity field. +function ttValidPasswordComplexity($val) +{ + // Password complexity example may contain a-z, A-Z, 0-9, and a #. + if (!preg_match('/^[a-zA-Z0-9#]*$/', $val)) + return false; + + return true; +} + // ttAccessAllowed checks whether user is allowed access to a particular page. // It is used as an initial check on all publicly available pages // (except login.php, register.php, and others where we don't have to check). diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index f1eb3e09..ff9295d0 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -693,6 +693,7 @@ function updateGroup($fields) { if (isset($fields['record_type'])) $record_type_part = ', record_type = '.(int) $fields['record_type']; if (isset($fields['bcc_email'])) $bcc_email_part = ', bcc_email = '.$mdb2->quote($fields['bcc_email']); if (isset($fields['allow_ip'])) $allow_ip_part = ', allow_ip = '.$mdb2->quote($fields['allow_ip']); + if (isset($fields['password_complexity'])) $password_complexity_part = ', password_complexity = '.$mdb2->quote($fields['password_complexity']); if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']); if (isset($fields['config'])) $config_part = ', config = '.$mdb2->quote($fields['config']); if (isset($fields['custom_css'])) $custom_css_part = ', custom_css = '.$mdb2->quote($fields['custom_css']); @@ -703,7 +704,7 @@ function updateGroup($fields) { $parts = trim($name_part.$description_part.$currency_part.$lang_part.$decimal_mark_part.$date_format_part. $time_format_part.$week_start_part.$tracking_mode_part.$project_required_part.$record_type_part. - $bcc_email_part.$allow_ip_part.$plugins_part.$config_part.$custom_css_part.$lock_spec_part.$holidays_part.$workday_minutes_part.$modified_part, ','); + $bcc_email_part.$allow_ip_part.$password_complexity_part.$plugins_part.$config_part.$custom_css_part.$lock_spec_part.$holidays_part.$workday_minutes_part.$modified_part, ','); $sql = "update tt_groups set $parts where id = $group_id and org_id = $this->org_id"; $affected = $mdb2->exec($sql); diff --git a/group_advanced_edit.php b/group_advanced_edit.php index a950b8d2..7683d879 100644 --- a/group_advanced_edit.php +++ b/group_advanced_edit.php @@ -22,13 +22,13 @@ $cl_description = trim($request->getParameter('description')); $cl_bcc_email = trim($request->getParameter('bcc_email')); $cl_allow_ip = trim($request->getParameter('allow_ip')); - $cl_password_compexity = trim($request->getParameter('password_complexity')); + $cl_password_complexity = trim($request->getParameter('password_complexity')); } else { $cl_group = $group['name']; $cl_description = $group['description']; $cl_bcc_email = $group['bcc_email']; $cl_allow_ip = $group['allow_ip']; - $cl_password_compexity = $group['password_complexity']; + $cl_password_complexity = $group['password_complexity']; } $form = new Form('groupAdvancedForm'); @@ -47,7 +47,7 @@ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc')); if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip')); - // TODO: add validation for password complexity field. + if (!ttValidPasswordComplexity($cl_password_complexity, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.password_complexity')); // Finished validating user input. if ($err->no()) { diff --git a/initialize.php b/initialize.php index d9e800df..8a7e9390 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.0.5651"); +define("APP_VERSION", "1.21.0.5652"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From a7c55a3af569745243e29dcc3e45125a27e70fd6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 13 Mar 2022 18:13:27 +0000 Subject: [PATCH 132/304] Introduced error.weak_password to translation files. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 2 ++ WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 2 ++ WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 2 ++ WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 2 ++ WEB-INF/resources/ko.lang.php | 2 ++ WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 2 ++ WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 2 ++ WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 2 ++ initialize.php | 2 +- user_add.php | 3 +++ 32 files changed, 54 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index a9937cea..f1a31d7d 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -74,6 +74,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Usuari o parula de pas incorrecta.', // TODO: translate the following. +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 9d533173..c54d09d6 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -76,6 +76,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nesprávné jméno nebo heslo.', // TODO: translate the following. +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 22aba0de..84ec205c 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -66,6 +66,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Forkert brugernavn eller adgangskode.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Brugernavn eksistere allerede.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 9a845d1f..6a79d397 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -64,6 +64,8 @@ 'error.report' => 'Bericht auswählen.', 'error.record' => 'Eintrag auswählen.', 'error.auth' => 'Benutzername oder Passwort ungültig.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Benutzer mit diesem Konto ist bereits vorhanden.', 'error.object_exists' => 'Objekt mit diesem Namen ist bereits vorhanden.', 'error.invoice_exists' => 'Rechnung mit dieser Nummer existiert bereits.', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index ab776955..3a4b699c 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -60,6 +60,7 @@ 'error.report' => 'Select report.', 'error.record' => 'Select record.', 'error.auth' => 'Incorrect login or password.', +'error.weak_password' => 'Weak password.', 'error.user_exists' => 'User with this login already exists.', 'error.object_exists' => 'Object with this name already exists.', 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index b7942fbe..d622d857 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -72,6 +72,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Usuario o contraseña incorrecta.', // TODO: translate the following. +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index e14416bc..6a6d5d02 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -65,6 +65,8 @@ 'error.report' => 'Vali raport.', 'error.record' => 'Vali kirje.', 'error.auth' => 'Autentimine ebaõnnestus.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Selle nimega kasutaja on juba kasutusel.', 'error.object_exists' => 'Sellise nimega objekt on juba olemas.', 'error.invoice_exists' => 'Arve number on juba kasutusel.', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 8ccc29f0..bde6ab03 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -71,6 +71,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => 'نام کاربری یا رمز عبور اشتباه است.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'کاربری با این نام کاربری موجود است.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 26c15088..db49d601 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -68,6 +68,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Virheellinen käyttäjänimi tai salasana.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Tämä käyttäjänimi on jo olemassa.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 892b0291..73d9ae28 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -66,6 +66,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Nom d\\\'utilisateur ou mot de passe incorrect.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Un utilisateur avec cet identifiant existe déjà.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index f1dbbc3c..d8cf3d68 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -63,6 +63,8 @@ 'error.report' => 'Επιλογή αναφοράς.', 'error.record' => 'Επιλογή εγγραφής.', 'error.auth' => 'Λανθασμένο όνομα εισόδου ή κωδικός.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Ο χρήστης με αυτήν τη σύνδεση υπάρχει ήδη.', 'error.object_exists' => 'Το αντικείμενο με αυτό το όνομα υπάρχει ήδη.', 'error.invoice_exists' => 'Το τιμολόγιο με αυτόν τον αριθμό υπάρχει ήδη.', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 4f2a4923..0a607469 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -81,6 +81,8 @@ // 'error.report' => 'Select report.' // 'error.record' => 'Select record.', 'error.auth' => 'שם משתמש או סיסמה שגויים', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'שם משתמש כבר קיים', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 924b4acc..172e49fa 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -74,6 +74,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 383b1ab1..8dc20586 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -65,6 +65,8 @@ 'error.report' => 'Seleziona rapporto.', 'error.record' => 'Seleziona record.', 'error.auth' => 'Login o password errati.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Esiste già un utente con questo username.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index b3fd57f4..cc9edc0d 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -73,6 +73,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => '不正確なログインあるいはパスワードが不正確です。', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'このログインと関連されたユーザーは既に存在します。', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index d182519a..18b6ec6c 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -73,6 +73,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => '부정확한 로그인 혹은 암호가 틀립니다.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => '본 로그인과 연계된 사용자가 이미 있습니다.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 8c1afa7f..6e93f166 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -59,6 +59,8 @@ 'error.report' => 'Kies rapport.', 'error.record' => 'Kies record.', 'error.auth' => 'Onjuiste inlognaam of wachtwoord.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Een gebruiker met deze inlognaam bestaat al.', 'error.object_exists' => 'Een object met deze naam bestaat al.', 'error.invoice_exists' => 'Dit nummer is al eens toegekend aan een factuur.', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 8b5e13f0..1e38bd0c 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -74,6 +74,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => 'Feil brukernavn eller passord.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Bruker med et slikt brukernavn eksisterer allerede.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 97ac1e0d..2fc57348 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -69,6 +69,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Błędny login lub hasło.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Użytkownik o takiej nazwie już istnieje.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index b01e94d3..7f5601ef 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -59,6 +59,8 @@ 'error.report' => 'Selecione relatório.', 'error.record' => 'Selecione o registro.', 'error.auth' => 'Usuário ou senha incorretos.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Já existe usuário com este login.', 'error.object_exists' => 'Já existe um objeto com este nome.', 'error.invoice_exists' => 'Já existe fatura com este número.', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 7c724cd2..2806b843 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -72,6 +72,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 33c4547d..8619ea27 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -78,6 +78,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nume de utilizator sau parola incorecta.', // TODO: translate the following. +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 3707ce74..41c95c84 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -59,6 +59,7 @@ 'error.report' => 'Выберите отчёт.', 'error.record' => 'Выберите запись.', 'error.auth' => 'Неправильно введен логин или пароль.', +'error.weak_password' => 'Слабый пароль.', 'error.user_exists' => 'Пользователь с таким логином уже существует.', 'error.object_exists' => 'Объект с таким именем уже есть.', 'error.invoice_exists' => 'Счёт с таким номером уже есть.', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 345666d8..e45b0651 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -70,6 +70,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => 'Nesprávne prihlasovacie meno alebo heslo.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Používateľ s týmto prihlasovacím menom už existuje.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index d5b56f4a..4e519bcf 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -69,6 +69,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 652eaa89..7aa5f100 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -66,6 +66,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Pogrešno korisničko ime ili lozinka.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Korisnik pod ovim imenom već postoji.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index b39366bc..f641ef69 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -65,6 +65,8 @@ // TODO: translate the following. // 'error.record' => 'Select record.', 'error.auth' => 'Ogiltigt användarnamn eller lösenord.', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Det finns redan en användare med det här användarnamnet.', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 2aae8ed9..9691b950 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -81,6 +81,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Hatalı kullanıcı adı veya parola.', // TODO: translate the following. +// 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', // 'error.invoice_exists' => 'Invoice with this number already exists.', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index f423fab8..afe7588a 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -68,6 +68,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => '不正确的用户名或密码。', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => '该用户登录信息已经存在。', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 92f5dbf5..29431289 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -71,6 +71,8 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', 'error.auth' => '不正確的用戶名或密碼。', +// TODO: translate the following. +// 'error.weak_password' => 'Weak password.', 'error.user_exists' => '該使用者登錄資訊已經存在。', // TODO: translate the following. // 'error.object_exists' => 'Object with this name already exists.', diff --git a/initialize.php b/initialize.php index 8a7e9390..7d6e96ba 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.0.5652"); +define("APP_VERSION", "1.21.0.5653"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/user_add.php b/user_add.php index 8d584afb..f294cf71 100644 --- a/user_add.php +++ b/user_add.php @@ -158,6 +158,9 @@ function render(&$table, $value, $row, $column, $selected = false) { if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); if ($cl_password1 !== $cl_password2) $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + // Check password complexity. + // if (!ttCheckPasswordComplexity($cl_password1)) + // $err->add($i18n->get('error.weak_password')); } if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); // Require selection of a client for a client role. From 596e07d7c3164ea98083b60bf9dec22df87bb5f6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 13 Mar 2022 21:05:17 +0000 Subject: [PATCH 133/304] Added a capability and enforcement of password complexity for users. --- WEB-INF/lib/common.lib.php | 42 ++++++++++++++++++++++++++++++++++-- WEB-INF/lib/ttUser.class.php | 5 +++++ initialize.php | 2 +- password_change.php | 3 +++ profile_edit.php | 3 +++ user_add.php | 4 ++-- user_edit.php | 3 +++ 7 files changed, 57 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 365452f8..122987f1 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -397,15 +397,53 @@ function ttValidHolidays($val) } // ttValidPasswordComplexity is used to check user input for password complexity field. -function ttValidPasswordComplexity($val) +function ttValidPasswordComplexity($complexityExample) { // Password complexity example may contain a-z, A-Z, 0-9, and a #. - if (!preg_match('/^[a-zA-Z0-9#]*$/', $val)) + if (!preg_match('/^[a-zA-Z0-9#]*$/', $complexityExample)) return false; return true; } +// ttCheckPasswordComplexity checks password complexity. +function ttCheckPasswordComplexity($password) +{ + global $user; + $complexity = $user->getPasswordComplexity(); + if (empty($complexity)) + return true; + + // Password complexity must be enforced. + if (strlen($password) < strlen($complexity)) + return false; // Password is too short. + + $numDigitsRequired = preg_match_all( "/[0-9]/", $complexity); + $numDigitsSupplied = preg_match_all( "/[0-9]/", $password); + if ($numDigitsSupplied < $numDigitsRequired) + return false; // Number of digits in password is less than required number in complexity example. + + $numCapitalsRequired = preg_match_all( "/[A-Z]/", $complexity); + $numCapitalsSupplied = preg_match_all( "/[A-Z]/", $password); + if ($numCapitalsSupplied < $numCapitalsRequired) + return false; // Number of capitals A-Z in password is less than required number in complexity example. + + $numLowercaseRequired = preg_match_all( "/[a-z]/", $complexity); + $numLowercaseSupplied = preg_match_all( "/[a-z]/", $password); + if ($numLowercaseSupplied < $numLowercaseRequired) + return false; // Number of lowercase letter a-z in password is less than required number in complexity example. + + // Finally check the number of "all other" characters that are not alphanumeric. This includes utf-8 characters. + $numNotAlphanumericRequired = preg_match_all( "/[#]/", $complexity); + $passwordRemainder = preg_replace("/[a-zA-Z0-9]/", "", $password); + $numNotAlphanumericSupplied = mb_strlen($passwordRemainder); + if ($numNotAlphanumericSupplied < $numNotAlphanumericRequired) + return false; + + return true; +} + + // ttAccessAllowed checks whether user is allowed access to a particular page. // It is used as an initial check on all publicly available pages // (except login.php, register.php, and others where we don't have to check). diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index ff9295d0..7114bc7c 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -169,6 +169,11 @@ function getEmail() { return ($this->behalfUser ? $this->behalfUser->email : $this->email); } + // getPasswordComplexity returns password complexity for active user. + function getPasswordComplexity() { + return ($this->behalfUser ? $this->behalfUser->password_complexity : $this->password_complexity); + } + // The getGroup returns group id on behalf of which the current user is operating. function getGroup() { return ($this->behalfGroup ? $this->behalfGroup->id : $this->group_id); diff --git a/initialize.php b/initialize.php index 7d6e96ba..a4df18dd 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.0.5653"); +define("APP_VERSION", "1.21.1.5654"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/password_change.php b/password_change.php index 992bdd87..d395b639 100644 --- a/password_change.php +++ b/password_change.php @@ -49,6 +49,9 @@ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); if ($cl_password1 !== $cl_password2) $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + // Check password complexity. + if (!ttCheckPasswordComplexity($cl_password1)) + $err->add($i18n->get('error.weak_password')); if ($err->no()) { // Use the "limit" plugin if we have one. Ignore include errors. diff --git a/profile_edit.php b/profile_edit.php index a9f11fc2..3958a401 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -67,6 +67,9 @@ if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); if ($cl_password1 !== $cl_password2) $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + // Check password complexity. + if (!ttCheckPasswordComplexity($cl_password1)) + $err->add($i18n->get('error.weak_password')); } if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); // Finished validating user input. diff --git a/user_add.php b/user_add.php index f294cf71..e75e0901 100644 --- a/user_add.php +++ b/user_add.php @@ -159,8 +159,8 @@ function render(&$table, $value, $row, $column, $selected = false) { if ($cl_password1 !== $cl_password2) $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); // Check password complexity. - // if (!ttCheckPasswordComplexity($cl_password1)) - // $err->add($i18n->get('error.weak_password')); + if (!ttCheckPasswordComplexity($cl_password1)) + $err->add($i18n->get('error.weak_password')); } if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); // Require selection of a client for a client role. diff --git a/user_edit.php b/user_edit.php index 57133eb3..6bdbef69 100644 --- a/user_edit.php +++ b/user_edit.php @@ -190,6 +190,9 @@ function render(&$table, $value, $row, $column, $selected = false) { if (!ttValidString($cl_password2)) $err->add($i18n->get('error.field'), $i18n->get('label.confirm_password')); if ($cl_password1 !== $cl_password2) $err->add($i18n->get('error.not_equal'), $i18n->get('label.password'), $i18n->get('label.confirm_password')); + // Check password complexity. + if (!ttCheckPasswordComplexity($cl_password1)) + $err->add($i18n->get('error.weak_password')); } if (!ttValidEmail($cl_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.email')); // Require selection of a client for a client role. From 0261c3ffa9017327d54d0be9f315057707b43d91 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 13 Mar 2022 21:08:34 +0000 Subject: [PATCH 134/304] Removed a debug condition for password complextity feature. --- WEB-INF/templates/group_advanced_edit.tpl | 2 -- initialize.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl index 66fa4103..528daf46 100644 --- a/WEB-INF/templates/group_advanced_edit.tpl +++ b/WEB-INF/templates/group_advanced_edit.tpl @@ -32,7 +32,6 @@ License: See license.txt *} {$i18n.label.what_is_it} -{if constant('PASSWORD_COMPLEXITY_DEBUG')}
@@ -42,7 +41,6 @@ License: See license.txt *} {$i18n.label.what_is_it} -{/if}
{$i18n.label.required_fields}
diff --git a/initialize.php b/initialize.php index a4df18dd..73b69341 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5654"); +define("APP_VERSION", "1.21.1.5655"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 76667fa583dc775400db420fe77973f890b36954 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 14 Mar 2022 13:56:25 +0000 Subject: [PATCH 135/304] Dutch translation improved. --- WEB-INF/resources/nl.lang.php | 6 ++---- initialize.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 6e93f166..5d866e61 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -59,8 +59,7 @@ 'error.report' => 'Kies rapport.', 'error.record' => 'Kies record.', 'error.auth' => 'Onjuiste inlognaam of wachtwoord.', -// TODO: translate the following. -// 'error.weak_password' => 'Weak password.', +'error.weak_password' => 'Zwak wachtwoord.', 'error.user_exists' => 'Een gebruiker met deze inlognaam bestaat al.', 'error.object_exists' => 'Een object met deze naam bestaat al.', 'error.invoice_exists' => 'Dit nummer is al eens toegekend aan een factuur.', @@ -508,8 +507,7 @@ 'form.group_edit.uncompleted_indicators' => 'Onvolledige indicatoren', 'form.group_edit.confirm_save' => 'Bevestigen dat je wilt opslaan', 'form.group_edit.allow_ip' => 'Toegestane IP adressen', -// TODO: translate the following. -// 'form.group_edit.password_complexity' => 'Password complexity', +'form.group_edit.password_complexity' => 'Wachtwoord complexiteit', 'form.group_edit.advanced_settings' => 'Geavanceerde instellingen', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/initialize.php b/initialize.php index 73b69341..eb15642a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5655"); +define("APP_VERSION", "1.21.1.5656"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 1990edf7a7cc17f520c98f8ff929b54d509203e2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 14 Mar 2022 14:53:20 +0000 Subject: [PATCH 136/304] Improved password complexity specification by allowing an asterisk in there for better password length control. --- WEB-INF/lib/common.lib.php | 4 ++-- initialize.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 122987f1..db00923a 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -399,8 +399,8 @@ function ttValidHolidays($val) // ttValidPasswordComplexity is used to check user input for password complexity field. function ttValidPasswordComplexity($complexityExample) { - // Password complexity example may contain a-z, A-Z, 0-9, and a #. - if (!preg_match('/^[a-zA-Z0-9#]*$/', $complexityExample)) + // Password complexity example may contain a-z, A-Z, 0-9, #, and *. + if (!preg_match('/^[a-zA-Z0-9#*]*$/', $complexityExample)) return false; return true; diff --git a/initialize.php b/initialize.php index eb15642a..23e3c733 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5656"); +define("APP_VERSION", "1.21.1.5657"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 4ce11322cefcf172b8103ae23b3c1c9684dd91ee Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Mar 2022 15:32:34 +0000 Subject: [PATCH 137/304] Starting work on 2fa. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + initialize.php | 2 +- 31 files changed, 32 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index f1a31d7d..e862f97f 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -586,6 +586,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index c54d09d6..d73ef53d 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -598,6 +598,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 84ec205c..4c1f1b24 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -565,6 +565,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 6a79d397..cbe69a21 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -540,6 +540,7 @@ 'form.group_edit.allow_ip' => 'Erlaube IP', // TODO: translate the following. // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 3a4b699c..4c2b74b4 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -522,6 +522,7 @@ 'form.group_edit.confirm_save' => 'Confirm saving', 'form.group_edit.allow_ip' => 'Allow IP', 'form.group_edit.password_complexity' => 'Password complexity', +'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index d622d857..80683acc 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -600,6 +600,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 6a6d5d02..9c2a1c61 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -574,6 +574,7 @@ 'form.group_edit.allow_ip' => 'Luba IP', // TODO: translate the following. // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index bde6ab03..1deb7547 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -587,6 +587,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index db49d601..82c84df8 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -571,6 +571,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 73d9ae28..b39b0aad 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -561,6 +561,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index d8cf3d68..d30201fc 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -552,6 +552,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 0a607469..19ce3768 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -591,6 +591,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 172e49fa..83b82426 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -590,6 +590,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 8dc20586..acf7cc5b 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -567,6 +567,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index cc9edc0d..3f68a935 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -593,6 +593,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 18b6ec6c..60b307f7 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -591,6 +591,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 5d866e61..f2b0da6f 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -508,6 +508,8 @@ 'form.group_edit.confirm_save' => 'Bevestigen dat je wilt opslaan', 'form.group_edit.allow_ip' => 'Toegestane IP adressen', 'form.group_edit.password_complexity' => 'Wachtwoord complexiteit', +// TODO: translate the following. +// form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Geavanceerde instellingen', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 1e38bd0c..281f1768 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -594,6 +594,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 2fc57348..b6610eef 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -573,6 +573,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 7f5601ef..334db5ca 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -508,6 +508,7 @@ 'form.group_edit.allow_ip' => 'Permitir IP', // TODO: translate the following. // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Configurações avançadas', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 2806b843..d3aac4e3 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -572,6 +572,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 8619ea27..170642ef 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -594,6 +594,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 41c95c84..e186fbef 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -509,6 +509,7 @@ 'form.group_edit.confirm_save' => 'Предупреждать при сохранении', 'form.group_edit.allow_ip' => 'Разрешить доступ с IP', 'form.group_edit.password_complexity' => 'Сложность пароля', +'form.group_edit.2fa' => 'Двухфакторная аутентификация', 'form.group_edit.advanced_settings' => 'Продвинутые настройки', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index e45b0651..7fcc9940 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -577,6 +577,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 4e519bcf..88aee694 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -567,6 +567,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 7aa5f100..2aead0d8 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -573,6 +573,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index f641ef69..87b062f5 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -571,6 +571,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 9691b950..cf2694c4 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -607,6 +607,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index afe7588a..5686e268 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -582,6 +582,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 29431289..62a9e9ce 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -585,6 +585,7 @@ // 'form.group_edit.confirm_save' => 'Confirm saving', // 'form.group_edit.allow_ip' => 'Allow IP', // 'form.group_edit.password_complexity' => 'Password complexity', +// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php diff --git a/initialize.php b/initialize.php index 23e3c733..faf98ef3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5657"); +define("APP_VERSION", "1.21.1.5658"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 992a7adb6f2001a5639605f8bb1e64dc68d0edd5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Mar 2022 16:06:13 +0000 Subject: [PATCH 138/304] Refactoring in translation files. --- WEB-INF/resources/ca.lang.php | 6 ++++++ WEB-INF/resources/cs.lang.php | 6 ++++++ WEB-INF/resources/da.lang.php | 6 ++++++ WEB-INF/resources/de.lang.php | 6 ++++++ WEB-INF/resources/en.lang.php | 5 +++++ WEB-INF/resources/es.lang.php | 6 ++++++ WEB-INF/resources/et.lang.php | 6 ++++++ WEB-INF/resources/fa.lang.php | 6 ++++++ WEB-INF/resources/fi.lang.php | 6 ++++++ WEB-INF/resources/fr.lang.php | 6 ++++++ WEB-INF/resources/gr.lang.php | 6 ++++++ WEB-INF/resources/he.lang.php | 6 ++++++ WEB-INF/resources/hu.lang.php | 6 ++++++ WEB-INF/resources/it.lang.php | 6 ++++++ WEB-INF/resources/ja.lang.php | 6 ++++++ WEB-INF/resources/ko.lang.php | 6 ++++++ WEB-INF/resources/nl.lang.php | 6 ++++++ WEB-INF/resources/no.lang.php | 6 ++++++ WEB-INF/resources/pl.lang.php | 6 ++++++ WEB-INF/resources/pt-br.lang.php | 6 ++++++ WEB-INF/resources/pt.lang.php | 6 ++++++ WEB-INF/resources/ro.lang.php | 6 ++++++ WEB-INF/resources/ru.lang.php | 5 +++++ WEB-INF/resources/sk.lang.php | 6 ++++++ WEB-INF/resources/sl.lang.php | 6 ++++++ WEB-INF/resources/sr.lang.php | 6 ++++++ WEB-INF/resources/sv.lang.php | 6 ++++++ WEB-INF/resources/tr.lang.php | 6 ++++++ WEB-INF/resources/zh-cn.lang.php | 6 ++++++ WEB-INF/resources/zh-tw.lang.php | 6 ++++++ initialize.php | 2 +- 31 files changed, 179 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index e862f97f..dbbeb403 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -589,6 +589,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index d73ef53d..8b5e5006 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -601,6 +601,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 4c1f1b24..6860b8e3 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -568,6 +568,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index cbe69a21..10431c2a 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -543,6 +543,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Erlaube IP', +// TODO: Translate the following. +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php 'form.group_delete.hint' => 'Sind Sie sicher, dass Sie die gesamte Gruppe löschen möchten?', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 4c2b74b4..7505043c 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -525,6 +525,11 @@ 'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Allow IP', +'form.group_advanced_edit.password_complexity' => 'Password complexity', +'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 80683acc..0e94644a 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -603,6 +603,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 9c2a1c61..4177bfff 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -577,6 +577,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Luba IP', +// TODO: Translate the following. +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php 'form.group_delete.hint' => 'Oled kindel, et soovid kogu gruppi kustutada?', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 1deb7547..f37c789c 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -590,6 +590,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 82c84df8..e124c61a 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -574,6 +574,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index b39b0aad..503327a9 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -564,6 +564,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index d30201fc..310d6bd0 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -555,6 +555,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 19ce3768..95175c93 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -594,6 +594,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 83b82426..c4745c0a 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -593,6 +593,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index acf7cc5b..5676164e 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -570,6 +570,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 3f68a935..f8f80c4f 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -596,6 +596,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 60b307f7..f578659b 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -594,6 +594,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index f2b0da6f..a3e415b1 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -512,6 +512,12 @@ // form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Geavanceerde instellingen', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Toegestane IP adressen', +'form.group_advanced_edit.password_complexity' => 'Wachtwoord complexiteit', +// TODO: Translate the following. +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php 'form.group_delete.hint' => 'Bent u er zeker van dat u de hele groep wilt verwijderen?', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 281f1768..82fca5f1 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -597,6 +597,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index b6610eef..d4a5be37 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -576,6 +576,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 334db5ca..195cbc85 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -511,6 +511,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Configurações avançadas', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Permitir IP', +// TODO: Translate the following. +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php. 'form.group_delete.hint' => 'Tem certeza de que deseja excluir todo o grupo?', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index d3aac4e3..fa8c8384 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -575,6 +575,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 170642ef..eab876d0 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -597,6 +597,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index e186fbef..30737a76 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -512,6 +512,11 @@ 'form.group_edit.2fa' => 'Двухфакторная аутентификация', 'form.group_edit.advanced_settings' => 'Продвинутые настройки', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +'form.group_advanced_edit.allow_ip' => 'Разрешить доступ с IP', +'form.group_advanced_edit.password_complexity' => 'Сложность пароля', +'form.group_advanced_edit.2fa' => 'Двухфакторная аутентификация', + // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php 'form.group_delete.hint' => 'Вы уверены, что хотите удалить всю группу?', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 7fcc9940..ae1a0376 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -580,6 +580,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 88aee694..d6499cb1 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -570,6 +570,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 2aead0d8..d05a97ee 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -576,6 +576,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 87b062f5..80f6657b 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -574,6 +574,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index cf2694c4..ca1dacae 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -610,6 +610,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 5686e268..068ed52a 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -585,6 +585,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 62a9e9ce..34e18441 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -588,6 +588,12 @@ // 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', +// Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. +// TODO: Translate the following. +// 'form.group_advanced_edit.allow_ip' => 'Allow IP', +// 'form.group_advanced_edit.password_complexity' => 'Password complexity', +// 'form.group_advanced_edit.2fa' => 'Two factor authentication', + // 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?', diff --git a/initialize.php b/initialize.php index faf98ef3..3389203c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5658"); +define("APP_VERSION", "1.21.1.5659"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bc1c36f9fa327aa478b71ecb7beb1a34f3ba405a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Mar 2022 16:29:36 +0000 Subject: [PATCH 139/304] Refactoring of translation files. --- WEB-INF/resources/ca.lang.php | 3 --- WEB-INF/resources/cs.lang.php | 3 --- WEB-INF/resources/da.lang.php | 3 --- WEB-INF/resources/de.lang.php | 3 --- WEB-INF/resources/en.lang.php | 2 -- WEB-INF/resources/es.lang.php | 3 --- WEB-INF/resources/et.lang.php | 3 --- WEB-INF/resources/fa.lang.php | 3 --- WEB-INF/resources/fi.lang.php | 3 --- WEB-INF/resources/fr.lang.php | 3 --- WEB-INF/resources/gr.lang.php | 3 --- WEB-INF/resources/he.lang.php | 3 --- WEB-INF/resources/hu.lang.php | 3 --- WEB-INF/resources/it.lang.php | 3 --- WEB-INF/resources/ja.lang.php | 3 --- WEB-INF/resources/ko.lang.php | 3 --- WEB-INF/resources/nl.lang.php | 4 ---- WEB-INF/resources/no.lang.php | 3 --- WEB-INF/resources/pl.lang.php | 3 --- WEB-INF/resources/pt-br.lang.php | 4 ---- WEB-INF/resources/pt.lang.php | 3 --- WEB-INF/resources/ro.lang.php | 3 --- WEB-INF/resources/ru.lang.php | 3 --- WEB-INF/resources/sk.lang.php | 3 --- WEB-INF/resources/sl.lang.php | 3 --- WEB-INF/resources/sr.lang.php | 3 --- WEB-INF/resources/sv.lang.php | 3 --- WEB-INF/resources/tr.lang.php | 3 --- WEB-INF/resources/zh-cn.lang.php | 3 --- WEB-INF/resources/zh-tw.lang.php | 3 --- WEB-INF/templates/group_advanced_edit.tpl | 8 ++++---- group_advanced_edit.php | 4 ++-- initialize.php | 2 +- 33 files changed, 7 insertions(+), 98 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index dbbeb403..e1f9a191 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -584,9 +584,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 8b5e5006..562253c4 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -596,9 +596,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 6860b8e3..6070d5ab 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -563,9 +563,6 @@ 'form.group_edit.uncompleted_indicators' => 'Uafsluttede indikatore', // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 10431c2a..f627e77f 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -537,10 +537,7 @@ 'form.group_edit.future_entries' => 'Einträge in der Zukunft', 'form.group_edit.uncompleted_indicators' => 'Zeige unfertige Einträge', 'form.group_edit.confirm_save' => 'Speichern bestätigen', -'form.group_edit.allow_ip' => 'Erlaube IP', // TODO: translate the following. -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 7505043c..1cd30f07 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -520,9 +520,7 @@ 'form.group_edit.future_entries' => 'Future entries', 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', 'form.group_edit.confirm_save' => 'Confirm saving', -'form.group_edit.allow_ip' => 'Allow IP', 'form.group_edit.password_complexity' => 'Password complexity', -'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 0e94644a..9cc4aabd 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -598,9 +598,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 4177bfff..9dd7d02d 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -571,10 +571,7 @@ 'form.group_edit.future_entries' => 'Tuleviku kirjed', 'form.group_edit.uncompleted_indicators' => 'Lõpetamata kirjete indikaator', // TODO: Fix this. Indicators (plural), not indicator. 'form.group_edit.confirm_save' => 'Kinnita salvestamine', -'form.group_edit.allow_ip' => 'Luba IP', // TODO: translate the following. -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index f37c789c..a7560fc4 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -585,9 +585,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index e124c61a..1f483ef1 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -569,9 +569,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 503327a9..22132849 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -559,9 +559,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 310d6bd0..f2606c41 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -550,9 +550,6 @@ 'form.group_edit.uncompleted_indicators' => 'Μη ολοκληρωμένες ενδείξεις', // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 95175c93..52892dbc 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -589,9 +589,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index c4745c0a..b880b22f 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -588,9 +588,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 5676164e..40bca63e 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -565,9 +565,6 @@ 'form.group_edit.uncompleted_indicators' => 'Indicatori incompleti', // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index f8f80c4f..518c4269 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -591,9 +591,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index f578659b..dde93402 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -589,9 +589,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index a3e415b1..bd1ad69c 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -506,10 +506,6 @@ 'form.group_edit.future_entries' => 'Toevoegingen toestaan in de toekomst', 'form.group_edit.uncompleted_indicators' => 'Onvolledige indicatoren', 'form.group_edit.confirm_save' => 'Bevestigen dat je wilt opslaan', -'form.group_edit.allow_ip' => 'Toegestane IP adressen', -'form.group_edit.password_complexity' => 'Wachtwoord complexiteit', -// TODO: translate the following. -// form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Geavanceerde instellingen', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 82fca5f1..c38c74dd 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -592,9 +592,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index d4a5be37..86556229 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -571,9 +571,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 195cbc85..bbabafcb 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -505,10 +505,6 @@ 'form.group_edit.future_entries' => 'Entradas futuros', 'form.group_edit.uncompleted_indicators' => 'Indicadores incompletos', 'form.group_edit.confirm_save' => 'Confirme o salvamento', -'form.group_edit.allow_ip' => 'Permitir IP', -// TODO: translate the following. -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', 'form.group_edit.advanced_settings' => 'Configurações avançadas', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index fa8c8384..41e06c0f 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -570,9 +570,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index eab876d0..7f3168d4 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -592,9 +592,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 30737a76..35966616 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -507,9 +507,6 @@ 'form.group_edit.future_entries' => 'Будущие записи', 'form.group_edit.uncompleted_indicators' => 'Индикаторы незавершения', 'form.group_edit.confirm_save' => 'Предупреждать при сохранении', -'form.group_edit.allow_ip' => 'Разрешить доступ с IP', -'form.group_edit.password_complexity' => 'Сложность пароля', -'form.group_edit.2fa' => 'Двухфакторная аутентификация', 'form.group_edit.advanced_settings' => 'Продвинутые настройки', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index ae1a0376..c52d5460 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -575,9 +575,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index d6499cb1..1302ccd6 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -565,9 +565,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index d05a97ee..ba65b461 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -571,9 +571,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 80f6657b..bd815b25 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -569,9 +569,6 @@ 'form.group_edit.uncompleted_indicators' => 'Indikatorer för oavslutad registrering', // TODO: translate the following. // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index ca1dacae..a2f50330 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -605,9 +605,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 068ed52a..7932da3b 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -580,9 +580,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 34e18441..78e3b25b 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -583,9 +583,6 @@ // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', // 'form.group_edit.confirm_save' => 'Confirm saving', -// 'form.group_edit.allow_ip' => 'Allow IP', -// 'form.group_edit.password_complexity' => 'Password complexity', -// 'form.group_edit.2fa' => 'Two factor authentication', // 'form.group_edit.advanced_settings' => 'Advanced settings', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl index 528daf46..4bcaedf4 100644 --- a/WEB-INF/templates/group_advanced_edit.tpl +++ b/WEB-INF/templates/group_advanced_edit.tpl @@ -24,18 +24,18 @@ License: See license.txt *}
- + - + {$forms.groupAdvancedForm.allow_ip.control} {$i18n.label.what_is_it} {$i18n.label.what_is_it}
- + - + {$forms.groupAdvancedForm.password_complexity.control} {$i18n.label.what_is_it} {$i18n.label.what_is_it} diff --git a/group_advanced_edit.php b/group_advanced_edit.php index 7683d879..a4cf540e 100644 --- a/group_advanced_edit.php +++ b/group_advanced_edit.php @@ -46,8 +46,8 @@ if (!ttValidString($cl_group)) $err->add($i18n->get('error.field'), $i18n->get('label.group_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->get('error.field'), $i18n->get('label.bcc')); - if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.allow_ip')); - if (!ttValidPasswordComplexity($cl_password_complexity, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_edit.password_complexity')); + if (!ttValidIP($cl_allow_ip, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_advanced_edit.allow_ip')); + if (!ttValidPasswordComplexity($cl_password_complexity, true)) $err->add($i18n->get('error.field'), $i18n->get('form.group_advanced_edit.password_complexity')); // Finished validating user input. if ($err->no()) { diff --git a/initialize.php b/initialize.php index 3389203c..74d3da0a 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5659"); +define("APP_VERSION", "1.21.1.5660"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 81b2e03236fd74fe773105841b0f26fdcaa5ab59 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 15 Mar 2022 17:45:26 +0000 Subject: [PATCH 140/304] Implmeneted handling of 2fa setting on advanced group settings page. --- WEB-INF/templates/group_advanced_edit.tpl | 11 +++++++++++ group_advanced_edit.php | 11 ++++++++++- initialize.php | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl index 4bcaedf4..d4bd55a1 100644 --- a/WEB-INF/templates/group_advanced_edit.tpl +++ b/WEB-INF/templates/group_advanced_edit.tpl @@ -41,6 +41,17 @@ License: See license.txt *} {$i18n.label.what_is_it} +{if constant('2FA_DEBUG')} +
+ + + + {$forms.groupAdvancedForm.2fa.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} + + +{/if}
{$i18n.label.required_fields}
diff --git a/group_advanced_edit.php b/group_advanced_edit.php index a4cf540e..26134c78 100644 --- a/group_advanced_edit.php +++ b/group_advanced_edit.php @@ -16,6 +16,7 @@ // End of access checks. $group = ttGroupHelper::getGroupAttrs($user->getGroup()); +$config = $user->getConfigHelper(); if ($request->isPost()) { $cl_group = trim($request->getParameter('group_name')); @@ -23,12 +24,14 @@ $cl_bcc_email = trim($request->getParameter('bcc_email')); $cl_allow_ip = trim($request->getParameter('allow_ip')); $cl_password_complexity = trim($request->getParameter('password_complexity')); + $cl_2fa = (bool) $request->getParameter('2fa'); } else { $cl_group = $group['name']; $cl_description = $group['description']; $cl_bcc_email = $group['bcc_email']; $cl_allow_ip = $group['allow_ip']; $cl_password_complexity = $group['password_complexity']; + $cl_2fa = $config->getDefinedValue('2fa'); } $form = new Form('groupAdvancedForm'); @@ -37,6 +40,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'bcc_email','value'=>$cl_bcc_email)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'allow_ip','value'=>$cl_allow_ip)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'password_complexity','value'=>$cl_password_complexity)); +$form->addInput(array('type'=>'checkbox','name'=>'2fa','value'=>$cl_2fa)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); @@ -51,12 +55,17 @@ // Finished validating user input. if ($err->no()) { + // Update config. + $config->setDefinedValue('2fa', $cl_2fa); + + // Update group. if ($user->updateGroup(array( 'name' => $cl_group, 'description' => $cl_description, 'bcc_email' => $cl_bcc_email, 'allow_ip' => $cl_allow_ip, - 'password_complexity' => $cl_password_complexity))) { + 'password_complexity' => $cl_password_complexity, + 'config' => $config->getConfig()))) { header('Location: success.php'); exit(); } else diff --git a/initialize.php b/initialize.php index 74d3da0a..1eb308b0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5660"); +define("APP_VERSION", "1.21.1.5661"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 178417e79adcf25143ab28b2a4505f625136f3ea Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 16 Mar 2022 14:54:46 +0000 Subject: [PATCH 141/304] Work in progress on 2fa. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 2 ++ WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 5 +++-- WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 2 ++ WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 2 ++ WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 2 ++ WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 1 + initialize.php | 2 +- login.php | 13 +++++++++++++ 32 files changed, 62 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index e1f9a191..6c577de0 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -418,6 +418,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '¿Ha oblidat la seva paraula de pas?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 562253c4..feee2237 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -425,6 +425,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zapomenuté heslo?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 6070d5ab..6a598edb 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -402,6 +402,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Har du glemt din adgangskode?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker er et open source tidsregistrerings system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index f627e77f..ad6727fb 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -389,6 +389,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Passwort vergessen?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker ist ein Open-Source Zeiterfassungssystem.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 1cd30f07..8df7601d 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -371,6 +371,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Forgot password?', +'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 9cc4aabd..441b4258 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -422,6 +422,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '¿Olvido su contraseña?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 9dd7d02d..715b68bc 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -410,6 +410,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Unustasid salasõna?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker on avatud lähtekoodiga ajaarvestussüsteem.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index a7560fc4..f470be33 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -419,8 +419,9 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'بازیابی رمز عبور؟', -// TODO: translate form.login.about. -'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', +// 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'درخواست بازیابی رمزعبور به ایمیل فرستاده شد.', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 1f483ef1..db157940 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -407,6 +407,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Salasana unohtunut?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: check translation of form.login.about - is open source "vapaan koodin"? 'form.login.about' => 'Anuko Time Tracker on vapaan koodin tuntiseurantaohjelmisto.', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 22132849..d68e4cb4 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -399,6 +399,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Mot de passe oublié?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker est un système de gestion du temps, open source.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index f2606c41..7c8e3956 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -398,6 +398,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Ξεχάσατε τον κωδικό πρόσβασης;', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker είναι ένα ανοικτού κώδικα σύστημα παρακολούθησης χρόνου.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 52892dbc..fddf8d50 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -424,6 +424,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'שכחת סיסמה?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker הינה מערכת פשוטה, קלה לשימוש וחינמית לניהול זמן.', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index b880b22f..d3cbd7f9 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -419,6 +419,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Elfelejtetted a jelszót?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 40bca63e..8d2cfaa0 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -408,6 +408,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Password dimenticata?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker è un sistema open source per registrare i tempi di lavoro.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 518c4269..3dc0b877 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -420,6 +420,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'パスワードを忘れましたか?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index dde93402..63999c23 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -424,6 +424,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '암호를 잊으셨습니까?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index bd1ad69c..131d7993 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -363,6 +363,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Wachtwoord vergeten?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker is een open source tijdregistratiesysteem.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index c38c74dd..d2a934ee 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -421,6 +421,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Glemt passordet?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker er et enkelt, brukervennlig tidsregistreringssystem basert på åpen kildekode.', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 86556229..4316435a 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -410,6 +410,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Nie pamiętasz hasła?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker jest otwartoźródłowym systemem śledzenia czasu.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index bbabafcb..c5a670a0 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -362,6 +362,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Esqueceu a senha?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker é um sistema de código aberto de rastreamento do tempo.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 41e06c0f..a40d8ed8 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -403,6 +403,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Esqueceu a senha?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 7f3168d4..97c9a854 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -424,6 +424,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Parola pierduta?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 35966616..faa1c7ab 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -364,6 +364,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Забыли пароль?', +'form.login.2fa_code' => '2FA код', 'form.login.about' => 'Anuko Time Tracker - это открытая (open source) система трекинга рабочего времени.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index c52d5460..356e4e0a 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -413,6 +413,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zabudnuté heslo?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker je systém na sledovanie času s otvoreným zdrojovým kódom.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 1302ccd6..2bcba236 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -396,6 +396,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. // TODO: translate the following. // 'form.login.forgot_password' => 'Forgot password?', +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index ba65b461..dff5f262 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -408,6 +408,8 @@ // Forma prijave. Pogledajte primer na https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zaboravili ste lozinku?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker je jednostavan i lak za korišćenje za praćenje radnog vremena.', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index bd815b25..62a747e1 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -406,6 +406,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Glömt lösenordet?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker är en lättanvänd applikation byggd med öppen källkod som enkelt låter dig spåra och hålla koll på arbetstider.', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index a2f50330..e0a291f0 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -432,6 +432,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Parolanızı unuttunuz mu?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 7932da3b..7dc37961 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -413,6 +413,8 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '忘记密码?', +// TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker 是一种简单、易用、开放源代码的实时跟踪系统。', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 78e3b25b..2497f7ce 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -418,6 +418,7 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '忘記密碼?', // TODO: translate the following. +// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/initialize.php b/initialize.php index 1eb308b0..2f537eb6 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5661"); +define("APP_VERSION", "1.21.1.5662"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index 93b1cd08..5ea77d18 100644 --- a/login.php +++ b/login.php @@ -48,6 +48,19 @@ setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); $user = new ttUser(null, $auth->getUserId()); + + // Determine if we have to additionally use two-factor authentication. + $config = $user->getConfigHelper(); + $use2FA = $config->getDefinedValue('2fa'); + if ($use2FA) { + + // TODO: send 2fa code to user. + $auth->doLogout(); + + header('Location: 2fa.php'); + exit(); + } + // Redirect, depending on user role. if ($user->can('administer_site')) { header('Location: admin_groups.php'); From f2fbe6e5a6251cf86be04f5aa8baa8c1bee038c7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 16 Mar 2022 15:25:33 +0000 Subject: [PATCH 142/304] Some refactoring in translation files related to 2fa. --- 2fa.php | 87 ++++++++++++++++++++++++++++++++ WEB-INF/resources/ca.lang.php | 5 +- WEB-INF/resources/cs.lang.php | 5 +- WEB-INF/resources/da.lang.php | 6 ++- WEB-INF/resources/de.lang.php | 6 ++- WEB-INF/resources/en.lang.php | 3 ++ WEB-INF/resources/es.lang.php | 5 +- WEB-INF/resources/et.lang.php | 6 ++- WEB-INF/resources/fa.lang.php | 5 +- WEB-INF/resources/fi.lang.php | 8 +-- WEB-INF/resources/fr.lang.php | 6 ++- WEB-INF/resources/gr.lang.php | 6 ++- WEB-INF/resources/he.lang.php | 6 ++- WEB-INF/resources/hu.lang.php | 5 +- WEB-INF/resources/it.lang.php | 6 ++- WEB-INF/resources/ja.lang.php | 5 +- WEB-INF/resources/ko.lang.php | 5 +- WEB-INF/resources/nl.lang.php | 6 ++- WEB-INF/resources/no.lang.php | 6 ++- WEB-INF/resources/pl.lang.php | 6 ++- WEB-INF/resources/pt-br.lang.php | 6 ++- WEB-INF/resources/pt.lang.php | 5 +- WEB-INF/resources/ro.lang.php | 5 +- WEB-INF/resources/ru.lang.php | 4 +- WEB-INF/resources/sk.lang.php | 6 ++- WEB-INF/resources/sl.lang.php | 5 +- WEB-INF/resources/sr.lang.php | 6 ++- WEB-INF/resources/sv.lang.php | 6 ++- WEB-INF/resources/tr.lang.php | 5 +- WEB-INF/resources/zh-cn.lang.php | 6 ++- WEB-INF/resources/zh-tw.lang.php | 5 +- WEB-INF/templates/2fa.tpl | 24 +++++++++ 32 files changed, 230 insertions(+), 46 deletions(-) create mode 100644 2fa.php create mode 100644 WEB-INF/templates/2fa.tpl diff --git a/2fa.php b/2fa.php new file mode 100644 index 00000000..7c1728d2 --- /dev/null +++ b/2fa.php @@ -0,0 +1,87 @@ +isPost()) { + // Validate that browser_today parameter is in correct format. + $browser_today = $request->getParameter('browser_today'); + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + header('Location: access_denied.php'); + exit(); + } +} +// End of access checks. + +$cl_2fa_code = $request->getParameter('2fa_code'); +$cl_password = $request->getParameter('password'); + +$form = new Form('2faForm'); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'2fa_code','value'=>$cl_2fa_code)); +$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_login click. +$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.login'))); + +if ($request->isPost()) { + // Validate user input. + if (!ttValidString($cl_2fa_code)) $err->add($i18n->get('error.field'), $i18n->get('fprm.2fa.2fa_code')); + + if ($err->no()) { + // Use the "limit" plugin if we have one. Ignore include errors. + // The "limit" plugin is not required for normal operation of Time Tracker. + @include('plugins/limit/access_check.php'); + + if ($auth->doLogin($cl_login, $cl_password)) { + // Set current user date (as determined by user browser) into session. + $current_user_date = $request->getParameter('browser_today', null); + if ($current_user_date) + $_SESSION['date'] = $current_user_date; + + // Remember user login in a cookie. + setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); + + $user = new ttUser(null, $auth->getUserId()); + + // Determine if we have to additionally use two-factor authentication. + $config = $user->getConfigHelper(); + $use2FA = $config->getDefinedValue('2fa'); + if ($use2FA) { + + // TODO: send 2fa code to user. + $auth->doLogout(); + + header('Location: 2fa.php'); + exit(); + } + + // Redirect, depending on user role. + if ($user->can('administer_site')) { + header('Location: admin_groups.php'); + } elseif ($user->isClient()) { + header('Location: reports.php'); + } else { + header('Location: time.php'); + } + exit(); + } else + $err->add($i18n->get('error.auth')); + } +} // isPost + +if(!isTrue('MULTIORG_MODE') && !ttOrgHelper::getOrgs()) + $err->add($i18n->get('error.no_groups')); + +// Determine whether to show login hint. It is currently used only for Windows LDAP authentication. +$show_hint = ('ad' == isset($GLOBALS['AUTH_MODULE_PARAMS']['type']) ? $GLOBALS['AUTH_MODULE_PARAMS']['type'] : null); + +$smarty->assign('forms', array($form->getName()=>$form->toArray())); +$smarty->assign('show_hint', $show_hint); +$smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"'); +$smarty->assign('about_text', $i18n->get('form.login.about')); +$smarty->assign('title', $i18n->get('title.login')); +$smarty->assign('content_page_name', '2fa.tpl'); +$smarty->display('index.tpl'); diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 6c577de0..3bd936dd 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -418,9 +418,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '¿Ha oblidat la seva paraula de pas?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'S\\\'ha enviat la petició de restablir paraula de pas.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Sol·licitud de restabliment de la paraula de pas de Anuko Time Tracker', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index feee2237..a4f11602 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -425,9 +425,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zapomenuté heslo?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Zaslán požadavek k vymazání hesla.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Tracker požadavek na vymazání hesla', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 6a598edb..d1b991f4 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -402,10 +402,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Har du glemt din adgangskode?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker er et open source tidsregistrerings system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Nulstilling af adgangskode er sendt på email.', 'form.reset_password.email_subject' => 'Anuko Time Tracker - Anmodning om nulstilling af adgangskode', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index ad6727fb..75c2c0a7 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -389,10 +389,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Passwort vergessen?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker ist ein Open-Source Zeiterfassungssystem.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Anfrage zur Zurücksetzung des Passwortes wurde per E-mail gesendet.', 'form.reset_password.email_subject' => 'Anuko Time Tracker Anfrage zur Zurücksetzung des Passwortes', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 8df7601d..7adacead 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -374,6 +374,9 @@ 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Password reset request sent by email.', 'form.reset_password.email_subject' => 'Anuko Time Tracker password reset request', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 441b4258..a78f1e6f 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -422,9 +422,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '¿Olvido su contraseña?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. // TODO: check / improve translation of form.reset_password.message. // English form is: 'form.reset_password.message' => 'Password reset request sent by email.', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 715b68bc..854a52e0 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -410,10 +410,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Unustasid salasõna?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker on avatud lähtekoodiga ajaarvestussüsteem.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Salasõna tühistamise teade on saadetud e-postile.', 'form.reset_password.email_subject' => 'Anuko Time Tracker, parooli tühistamise nõue', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index f470be33..bda4a475 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -420,9 +420,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'بازیابی رمز عبور؟', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'درخواست بازیابی رمزعبور به ایمیل فرستاده شد.', // TODO: check translation of form.reset_password.email_subject. This is the subject for email message for password reset. Below is the English original. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index db157940..1d90ef23 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -407,11 +407,13 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Salasana unohtunut?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', - // TODO: check translation of form.login.about - is open source "vapaan koodin"? +// TODO: check translation of form.login.about - is open source "vapaan koodin"? 'form.login.about' => 'Anuko Time Tracker on vapaan koodin tuntiseurantaohjelmisto.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Salasanan nollauspyyntöviesti lähetetty.', 'form.reset_password.email_subject' => 'Anuko Time Tracker -salasanan nollauspyyntö', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index d68e4cb4..ccb42935 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -399,10 +399,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Mot de passe oublié?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker est un système de gestion du temps, open source.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Une demande de réinitialisation du mot de passe a été envoyé par courriel.', 'form.reset_password.email_subject' => 'Demande de réinitialisation de mot de passe Anuko Time Tracker', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 7c8e3956..4cf1f64f 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -398,10 +398,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Ξεχάσατε τον κωδικό πρόσβασης;', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker είναι ένα ανοικτού κώδικα σύστημα παρακολούθησης χρόνου.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Το αίτημα επαναφοράς κωδικού πρόσβασης αποστέλλεται μέσω ηλεκτρονικού ταχυδρομείου.', 'form.reset_password.email_subject' => 'Αίτημα επαναφοράς κωδικού Anuko Time Tracker', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index fddf8d50..4342ea84 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -424,12 +424,14 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'שכחת סיסמה?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker הינה מערכת פשוטה, קלה לשימוש וחינמית לניהול זמן.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'הבקשה לאיפוס בסיסמה נשלחה בדואר אלקטרוני.', 'form.reset_password.email_subject' => 'בקשה לאיפוס סיסמה למערכת Anuko Time Tracker', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index d3cbd7f9..b105d248 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -419,9 +419,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Elfelejtetted a jelszót?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. // TODO: translate the following. // 'form.reset_password.message' => 'Password reset request sent by email.', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 8d2cfaa0..16727cfe 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -408,10 +408,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Password dimenticata?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker è un sistema open source per registrare i tempi di lavoro.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Richiesta di reset password inviata via mail.', 'form.reset_password.email_subject' => 'Richiesta reset password per Anuko Time Tracker', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 3dc0b877..46c70553 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -420,9 +420,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'パスワードを忘れましたか?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => '送信したパスワードの初期化の要求。', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Trackerのパスワードの初期化の要求', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 63999c23..a8235693 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -424,9 +424,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '암호를 잊으셨습니까?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => '송신한 암호 재설정 요청.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Tracker 암호 재설정 요청', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 131d7993..9a7c1707 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -363,10 +363,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Wachtwoord vergeten?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker is een open source tijdregistratiesysteem.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Het verzoek om het wachtwoord te herstellen is verzonden per email.', 'form.reset_password.email_subject' => 'Anuko Time Tracker wachtwoord herstel verzoek', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index d2a934ee..b7500bba 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -421,12 +421,14 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Glemt passordet?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker er et enkelt, brukervennlig tidsregistreringssystem basert på åpen kildekode.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. // TODO: translate the following. // 'form.reset_password.message' => 'Password reset request sent by email.', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 4316435a..0e482eeb 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -410,10 +410,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Nie pamiętasz hasła?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker jest otwartoźródłowym systemem śledzenia czasu.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Instrukcje zmiany hasła zostały wysłane na adres e-mail połączony z kontem.', 'form.reset_password.email_subject' => 'Anuko Time Tracker - żądanie zmiany hasła', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index c5a670a0..f0b564de 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -362,10 +362,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Esqueceu a senha?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker é um sistema de código aberto de rastreamento do tempo.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Pedido para resetar a senha enviado por e-mail.', 'form.reset_password.email_subject' => 'Pedido de alteração de senha no Anuko Time Tracker', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index a40d8ed8..dcb0d035 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -403,9 +403,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Esqueceu a senha?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. // TODO: translate the following. // 'form.reset_password.message' => 'Password reset request sent by email.', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 97c9a854..7a5b41a3 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -424,9 +424,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Parola pierduta?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Cererea de resetare a parolei a fost trimisa.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Tracker - cerere de resetare a parolei', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index faa1c7ab..da8d8b0f 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -364,9 +364,11 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Забыли пароль?', -'form.login.2fa_code' => '2FA код', 'form.login.about' => 'Anuko Time Tracker - это открытая (open source) система трекинга рабочего времени.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +'form.2fa.2fa_code' => '2FA код', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Запрос на сброс пароля отослан по e-mail.', 'form.reset_password.email_subject' => 'Сброс пароля к Anuko Time Tracker', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 356e4e0a..3bdc0e4b 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -413,10 +413,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zabudnuté heslo?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker je systém na sledovanie času s otvoreným zdrojovým kódom.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Žiadosť o obnovenie hesla bola odoslaná e-mailom.', 'form.reset_password.email_subject' => 'Žiadosť o obnovenie hesla do Anuko Time Tracker', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 2bcba236..d7406f37 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -396,9 +396,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. // TODO: translate the following. // 'form.login.forgot_password' => 'Forgot password?', -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Zahteva za razveljavitev gesla je bila poslana.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Tracker zahteva za razveljavitev gesla', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index dff5f262..b26d4f04 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -408,12 +408,14 @@ // Forma prijave. Pogledajte primer na https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Zaboravili ste lozinku?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker je jednostavan i lak za korišćenje za praćenje radnog vremena.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Izmena forme za lozinku. Pogledajte primer na https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Zahtev za izmenu lozinke je poslat mejlom.', 'form.reset_password.email_subject' => 'Anuko Time Tracker zahtev za izmenu lozinke', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 62a747e1..1c139a0e 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -406,12 +406,14 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Glömt lösenordet?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker är en lättanvänd applikation byggd med öppen källkod som enkelt låter dig spåra och hålla koll på arbetstider.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Begäran om att återställa lösenordet skickades via e-post.', 'form.reset_password.email_subject' => 'Återställning av lösenord för Anuko Time Tracker begärd', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index e0a291f0..9f57fa3e 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -432,9 +432,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Parolanızı unuttunuz mu?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Parola sıfırlama talebi yollandı.', // TODO: add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko Time Tracker parola sıfırlama talebi', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 7dc37961..400529f6 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -413,12 +413,14 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '忘记密码?', -// TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // TODO: re-translate form.login.about as it has changed. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker 是一种简单、易用、开放源代码的实时跟踪系统。', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => '密码重设请求已经发送。', // TODO: Add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko时间追踪器密码重设请求', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 2497f7ce..3ece1f0f 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -418,9 +418,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => '忘記密碼?', // TODO: translate the following. -// 'form.login.2fa_code' => '2FA code', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +// TODO: translate the following. +// 'form.2fa.2fa_code' => '2FA code', + // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => '密碼重設請求已經發送。', // TODO: Add "by email" to match the English string. 'form.reset_password.email_subject' => 'Anuko時間追蹤器密碼重設請求', diff --git a/WEB-INF/templates/2fa.tpl b/WEB-INF/templates/2fa.tpl new file mode 100644 index 00000000..e634b624 --- /dev/null +++ b/WEB-INF/templates/2fa.tpl @@ -0,0 +1,24 @@ +{* Copyright (c) Anuko International Ltd. https://www.anuko.com +License: See license.txt *} + + + +{$forms.2faForm.open} + + + + + + + + + + +
{$forms.2faForm.2fa_code.control}
{$forms.2faForm.btn_login.control}
+{$forms.2faForm.close} + From 3c7cba88f69edd54f694f34f0907990977673b79 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 16 Mar 2022 15:40:39 +0000 Subject: [PATCH 143/304] Added title.2fa string to translation files. --- 2fa.php | 7 ++----- WEB-INF/resources/ca.lang.php | 2 ++ WEB-INF/resources/cs.lang.php | 2 ++ WEB-INF/resources/da.lang.php | 2 ++ WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 2 ++ WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 2 ++ WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 2 ++ WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 2 ++ WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 2 ++ WEB-INF/resources/ko.lang.php | 2 ++ WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 3 ++- WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 3 ++- WEB-INF/resources/ro.lang.php | 2 ++ WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 2 ++ WEB-INF/resources/sr.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 2 ++ WEB-INF/resources/tr.lang.php | 4 +++- WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 2 ++ initialize.php | 2 +- 32 files changed, 62 insertions(+), 9 deletions(-) diff --git a/2fa.php b/2fa.php index 7c1728d2..15d1a262 100644 --- a/2fa.php +++ b/2fa.php @@ -28,12 +28,9 @@ if ($request->isPost()) { // Validate user input. - if (!ttValidString($cl_2fa_code)) $err->add($i18n->get('error.field'), $i18n->get('fprm.2fa.2fa_code')); + if (!ttValidString($cl_2fa_code)) $err->add($i18n->get('error.field'), $i18n->get('form.2fa.2fa_code')); if ($err->no()) { - // Use the "limit" plugin if we have one. Ignore include errors. - // The "limit" plugin is not required for normal operation of Time Tracker. - @include('plugins/limit/access_check.php'); if ($auth->doLogin($cl_login, $cl_password)) { // Set current user date (as determined by user browser) into session. @@ -82,6 +79,6 @@ $smarty->assign('show_hint', $show_hint); $smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"'); $smarty->assign('about_text', $i18n->get('form.login.about')); -$smarty->assign('title', $i18n->get('title.login')); +$smarty->assign('title', $i18n->get('title.2fa')); $smarty->assign('content_page_name', '2fa.tpl'); $smarty->display('index.tpl'); diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 3bd936dd..8be97f9b 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -277,6 +277,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Sessió iniciada', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Grups', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index a4f11602..a9cc1182 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -286,6 +286,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Přihlásit', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Týmy', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index d1b991f4..74a239ca 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -266,6 +266,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Login', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Teams', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 75c2c0a7..e55d0564 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -257,6 +257,8 @@ 'title.error' => 'Fehler', 'title.success' => 'Erfol', 'title.login' => 'Anmelden', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Gruppen', 'title.add_group' => 'Gruppe anlegen', 'title.edit_group' => 'Gruppe bearbeiten', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 7adacead..f48c96eb 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -241,6 +241,7 @@ 'title.error' => 'Error', 'title.success' => 'Success', 'title.login' => 'Login', +'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Groups', 'title.add_group' => 'Adding Group', 'title.edit_group' => 'Editing Group', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index a78f1e6f..b7fbecd1 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -276,6 +276,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Sesión iniciada', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Grupos', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 854a52e0..a81b9021 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -277,6 +277,8 @@ 'title.error' => 'Viga', 'title.success' => 'Õnnestumine', 'title.login' => 'Sisene', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Grupid', 'title.add_group' => 'Lisa grupp', 'title.edit_group' => 'Muuda gruppi', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index bda4a475..af722d6e 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -277,6 +277,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'ورود', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'تیم ها', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 1d90ef23..86ee80d8 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -270,6 +270,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Kirjautuminen', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Tiimit', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index ccb42935..9debf467 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -264,6 +264,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Connexion', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Équipes', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 4cf1f64f..587e719a 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -259,6 +259,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Σύνδεση', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Ομάδες', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 4342ea84..bde356c9 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -285,6 +285,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'כניסה', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'צוותים', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index b105d248..a8fc41ef 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -278,6 +278,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Bejelentkezés', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Csoportok', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 16727cfe..af53176e 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -267,6 +267,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Login', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Gruppi', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 46c70553..f4cfc565 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -282,6 +282,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'ログイン', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'チーム', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index a8235693..1c677aa9 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -282,6 +282,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => '로그인', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => '팀', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 9a7c1707..dd89e356 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -235,6 +235,8 @@ 'title.error' => 'Fout', 'title.success' => 'Succes', 'title.login' => 'Aanmelden', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Groepen', 'title.add_group' => 'Groep toevoegen', 'title.edit_group' => 'Groep bewerken', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index b7500bba..55cd54d4 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -281,7 +281,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Innlogging', -// TODO: translate the following. +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', // 'title.groups' => 'Groups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 0e482eeb..021e30cd 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -271,6 +271,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Logowanie', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Zespoły', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index f0b564de..b2b71608 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -238,6 +238,8 @@ 'title.error' => 'Erro', 'title.success' => 'Sucesso', 'title.login' => 'Login', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Grupos', 'title.add_group' => 'Adicionando grupo', 'title.edit_group' => 'Editando grupo', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index dcb0d035..ebbc50b3 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -267,7 +267,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Login', -// TODO: translate the following. +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', // 'title.groups' => 'Groups', // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 7a5b41a3..670d00dc 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -283,6 +283,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Autentificare', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Echipe', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index da8d8b0f..9ef4dc02 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -236,6 +236,7 @@ 'title.error' => 'Ошибка', 'title.success' => 'Успех', 'title.login' => 'Вход в систему', +'title.2fa' => 'Двухфакторная аутентификация', 'title.groups' => 'Группы', 'title.add_group' => 'Добавление группы', 'title.edit_group' => 'Редактирование группы', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 3bdc0e4b..e75e0f2e 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -274,6 +274,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Prihlásenie', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Tímy', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index d7406f37..15026929 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -263,6 +263,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Prijava', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Timi', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index b26d4f04..44ad24e3 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -269,6 +269,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Prijava', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Timovi', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 1c139a0e..2098b705 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -265,6 +265,8 @@ // TODO: Translate the following. // 'title.success' => 'Success', 'title.login' => 'Logga in', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => 'Grupper', // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 9f57fa3e..4df3f5bd 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -292,7 +292,9 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => 'Giriş', -'title.groups' => 'Ekipler', // TODO: change "teams" to "groups". +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', + 'title.groups' => 'Ekipler', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', // 'title.edit_group' => 'Editing Group', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 400529f6..7fc1e3a1 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -274,6 +274,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => '登录', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => '团队', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 3ece1f0f..0d3885b2 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -279,6 +279,8 @@ // 'title.error' => 'Error', // 'title.success' => 'Success', 'title.login' => '登錄', +// TODO: translate the follolwing. +// 'title.2fa' => 'Two Factor Authentication', 'title.groups' => '團隊', // TODO: change "teams" to "groups". // TODO: translate the following. // 'title.add_group' => 'Adding Group', diff --git a/initialize.php b/initialize.php index 2f537eb6..3fb0921f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5662"); +define("APP_VERSION", "1.21.1.5663"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 3ce1ed036de850af767d163d322dad93907a9df6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 16 Mar 2022 19:03:50 +0000 Subject: [PATCH 144/304] Smoe more work in progress on 2fa. --- WEB-INF/resources/ca.lang.php | 5 ++ WEB-INF/resources/cs.lang.php | 5 ++ WEB-INF/resources/da.lang.php | 5 ++ WEB-INF/resources/de.lang.php | 5 ++ WEB-INF/resources/en.lang.php | 5 +- WEB-INF/resources/es.lang.php | 5 ++ WEB-INF/resources/et.lang.php | 5 ++ WEB-INF/resources/fa.lang.php | 5 ++ WEB-INF/resources/fi.lang.php | 5 ++ WEB-INF/resources/fr.lang.php | 5 ++ WEB-INF/resources/gr.lang.php | 5 ++ WEB-INF/resources/he.lang.php | 5 ++ WEB-INF/resources/hu.lang.php | 5 ++ WEB-INF/resources/it.lang.php | 5 ++ WEB-INF/resources/ja.lang.php | 5 ++ WEB-INF/resources/ko.lang.php | 5 ++ WEB-INF/resources/nl.lang.php | 5 ++ WEB-INF/resources/no.lang.php | 5 ++ WEB-INF/resources/pl.lang.php | 5 ++ WEB-INF/resources/pt-br.lang.php | 5 ++ WEB-INF/resources/pt.lang.php | 5 ++ WEB-INF/resources/ro.lang.php | 5 ++ WEB-INF/resources/ru.lang.php | 4 + WEB-INF/resources/sk.lang.php | 5 ++ WEB-INF/resources/sl.lang.php | 5 ++ WEB-INF/resources/sr.lang.php | 5 ++ WEB-INF/resources/sv.lang.php | 5 ++ WEB-INF/resources/tr.lang.php | 5 ++ WEB-INF/resources/zh-cn.lang.php | 5 ++ WEB-INF/resources/zh-tw.lang.php | 5 ++ initialize.php | 2 +- login.php | 121 ++++++++++++++++++++++--------- 32 files changed, 236 insertions(+), 36 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 8be97f9b..cdf0c7ed 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -422,6 +422,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index a9cc1182..2c64a859 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -429,6 +429,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 74a239ca..53644ed9 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -406,6 +406,11 @@ 'form.login.forgot_password' => 'Har du glemt din adgangskode?', 'form.login.about' => 'Anuko Time Tracker er et open source tidsregistrerings system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index e55d0564..006d7b89 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -393,6 +393,11 @@ 'form.login.forgot_password' => 'Passwort vergessen?', 'form.login.about' => 'Anuko Time Tracker ist ein Open-Source Zeiterfassungssystem.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index f48c96eb..3d5e59a8 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -372,9 +372,12 @@ // Login form. See example at https://timetracker.anuko.com/login.php. 'form.login.forgot_password' => 'Forgot password?', -'form.login.2fa_code' => '2FA code', 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index b7fbecd1..9ce3cb25 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -426,6 +426,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index a81b9021..884d0e32 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -414,6 +414,11 @@ 'form.login.forgot_password' => 'Unustasid salasõna?', 'form.login.about' => 'Anuko Time Tracker on avatud lähtekoodiga ajaarvestussüsteem.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index af722d6e..2eb5e532 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -424,6 +424,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 86ee80d8..5b85ba63 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -412,6 +412,11 @@ // TODO: check translation of form.login.about - is open source "vapaan koodin"? 'form.login.about' => 'Anuko Time Tracker on vapaan koodin tuntiseurantaohjelmisto.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 9debf467..19c3fbaa 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -403,6 +403,11 @@ 'form.login.forgot_password' => 'Mot de passe oublié?', 'form.login.about' => 'Anuko Time Tracker est un système de gestion du temps, open source.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 587e719a..9c07dd52 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -402,6 +402,11 @@ 'form.login.forgot_password' => 'Ξεχάσατε τον κωδικό πρόσβασης;', 'form.login.about' => 'Anuko Time Tracker είναι ένα ανοικτού κώδικα σύστημα παρακολούθησης χρόνου.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index bde356c9..3cb53daf 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -430,6 +430,11 @@ // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker הינה מערכת פשוטה, קלה לשימוש וחינמית לניהול זמן.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index a8fc41ef..61438d08 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -423,6 +423,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index af53176e..373587f5 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -412,6 +412,11 @@ 'form.login.forgot_password' => 'Password dimenticata?', 'form.login.about' => 'Anuko Time Tracker è un sistema open source per registrare i tempi di lavoro.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index f4cfc565..b86ed26e 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -424,6 +424,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 1c677aa9..1a810638 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -428,6 +428,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index dd89e356..b2a7fd84 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -367,6 +367,11 @@ 'form.login.forgot_password' => 'Wachtwoord vergeten?', 'form.login.about' => 'Anuko Time Tracker is een open source tijdregistratiesysteem.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 55cd54d4..6cabab82 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -426,6 +426,11 @@ // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker er et enkelt, brukervennlig tidsregistreringssystem basert på åpen kildekode.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 021e30cd..0aac60b4 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -414,6 +414,11 @@ 'form.login.forgot_password' => 'Nie pamiętasz hasła?', 'form.login.about' => 'Anuko Time Tracker jest otwartoźródłowym systemem śledzenia czasu.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index b2b71608..d311c7a8 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -366,6 +366,11 @@ 'form.login.forgot_password' => 'Esqueceu a senha?', 'form.login.about' => 'Anuko Time Tracker é um sistema de código aberto de rastreamento do tempo.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index ebbc50b3..942ce209 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -406,6 +406,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 670d00dc..39e507f7 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -428,6 +428,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 9ef4dc02..98b6694a 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -367,6 +367,10 @@ 'form.login.forgot_password' => 'Забыли пароль?', 'form.login.about' => 'Anuko Time Tracker - это открытая (open source) система трекинга рабочего времени.', +// Email subject and body for two-factor authentication. +'email.2fa_code.subject' => 'Anuko Time Tracker код для двухфакторной аутентификации', +'email.2fa_code.body' => "Уважаемый пользователь,\n\nВаш код для двухфакторной аутентификации:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. 'form.2fa.2fa_code' => '2FA код', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index e75e0f2e..08bda858 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -417,6 +417,11 @@ 'form.login.forgot_password' => 'Zabudnuté heslo?', 'form.login.about' => 'Anuko Time Tracker je systém na sledovanie času s otvoreným zdrojovým kódom.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 15026929..804b7fc8 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -400,6 +400,11 @@ // 'form.login.forgot_password' => 'Forgot password?', // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 44ad24e3..6f349550 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -414,6 +414,11 @@ // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker je jednostavan i lak za korišćenje za praćenje radnog vremena.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 2098b705..4cb93fa0 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -412,6 +412,11 @@ // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker är en lättanvänd applikation byggd med öppen källkod som enkelt låter dig spåra och hålla koll på arbetstider.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 4df3f5bd..12bdebf3 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -436,6 +436,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 7fc1e3a1..c37b5661 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -419,6 +419,11 @@ // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', 'form.login.about' => 'Anuko Time Tracker 是一种简单、易用、开放源代码的实时跟踪系统。', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 0d3885b2..fd78f3e3 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -422,6 +422,11 @@ // TODO: translate the following. // 'form.login.about' => 'Anuko Time Tracker is an open source time tracking system.', +// Email subject and body for two-factor authentication. +// TODO: translate the following. +// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', +// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", + // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. // 'form.2fa.2fa_code' => '2FA code', diff --git a/initialize.php b/initialize.php index 3fb0921f..c8b41c6d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5663"); +define("APP_VERSION", "1.21.1.5664"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index 5ea77d18..da59757b 100644 --- a/login.php +++ b/login.php @@ -4,8 +4,9 @@ require_once('initialize.php'); import('form.Form'); -import('ttOrgHelper'); +//import('ttOrgHelper'); import('ttUser'); +import('ttUserHelper'); // Access checks. if ($request->isPost()) { @@ -33,46 +34,98 @@ if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login')); if (!ttValidString($cl_password)) $err->add($i18n->get('error.field'), $i18n->get('label.password')); + $loginSucceeded = $use2FA = false; if ($err->no()) { // Use the "limit" plugin if we have one. Ignore include errors. // The "limit" plugin is not required for normal operation of Time Tracker. @include('plugins/limit/access_check.php'); - if ($auth->doLogin($cl_login, $cl_password)) { - // Set current user date (as determined by user browser) into session. - $current_user_date = $request->getParameter('browser_today', null); - if ($current_user_date) - $_SESSION['date'] = $current_user_date; - - // Remember user login in a cookie. - setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); - - $user = new ttUser(null, $auth->getUserId()); - - // Determine if we have to additionally use two-factor authentication. - $config = $user->getConfigHelper(); - $use2FA = $config->getDefinedValue('2fa'); - if ($use2FA) { - - // TODO: send 2fa code to user. - $auth->doLogout(); - - header('Location: 2fa.php'); - exit(); - } - - // Redirect, depending on user role. - if ($user->can('administer_site')) { - header('Location: admin_groups.php'); - } elseif ($user->isClient()) { - header('Location: reports.php'); - } else { - header('Location: time.php'); - } - exit(); + // Check user login. + $loginSucceeded = $auth->doLogin($cl_login, $cl_password); + } + + // Do we have to use 2FA? + if ($err->no() && $loginSucceeded) { + $user = new ttUser(null, $auth->getUserId()); + + // Determine if we have to additionally use two-factor authentication. + $config = $user->getConfigHelper(); + $use2FA = $config->getDefinedValue('2fa'); + } + + // If we have to use 2FA, create and email auith code to user. + if ($use2FA) { + // To keep things simple, we use the same code as for password resets. + $cryptographically_strong = true; + $random_bytes = openssl_random_pseudo_bytes(16, $cryptographically_strong); + if ($random_bytes === false) die ("openssl_random_pseudo_bytes function call failed..."); + $temp_ref = bin2hex($random_bytes); + ttUserHelper::saveTmpRef($temp_ref, $user->id); + + // For user languague in email. + $user_i18n = null; + if ($user->lang != $i18n->lang) { + $user_i18n = new I18n(); + $user_i18n->load($user->lang); } else - $err->add($i18n->get('error.auth')); + $user_i18n = &$i18n; + + // Where do we email to? + $receiver = null; + if ($user->email) + $receiver = $user->email; + else { + if (ttValidEmail($user->login)) + $receiver = $user->login; + } + if (!$receiver) $err->add($user_i18n->get('error.no_email')); + + // Send 2FA_code email to user. + if ($receiver) { + import('mail.Mailer'); + $mailer = new Mailer(); + $mailer->setCharSet(CHARSET); + $mailer->setSender(SENDER); + $mailer->setReceiver("$receiver"); + + $subject = $user_i18n->get('email.2fa_code.subject'); + $body = sprintf($user_i18n->get('email.2fa_code.body'), $temp_ref); + + $mailer->setMailMode(MAIL_MODE); + if (!$mailer->send($subject, $body)) + $err->add($i18n->get('error.mail_send')); + } + + $auth->doLogout(); + + // Redirect to 2fa.php if we have no errors. + if ($err->no()) { + header('Location: 2fa.php'); + exit(); + } } + + if ($err->no() && $loginSucceeded) { + + // Set current user date (as determined by user browser) into session. + $current_user_date = $request->getParameter('browser_today', null); + if ($current_user_date) + $_SESSION['date'] = $current_user_date; + + // Remember user login in a cookie. + setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); + + // Redirect, depending on user role. + if ($user->can('administer_site')) { + header('Location: admin_groups.php'); + } elseif ($user->isClient()) { + header('Location: reports.php'); + } else { + header('Location: time.php'); + } + exit(); + } else + $err->add($i18n->get('error.auth')); } // isPost if(!isTrue('MULTIORG_MODE') && !ttOrgHelper::getOrgs()) From 3d74117cda7abf4b2ae2634eb1a623d0a04794e0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 16 Mar 2022 22:19:44 +0000 Subject: [PATCH 145/304] A bit more progress on 2fa. --- 2fa.php | 74 ++++++++------------------------ WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 + WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/2fa.tpl | 11 +---- login.php | 9 ++-- 33 files changed, 56 insertions(+), 69 deletions(-) diff --git a/2fa.php b/2fa.php index 15d1a262..005b4ea4 100644 --- a/2fa.php +++ b/2fa.php @@ -4,81 +4,43 @@ require_once('initialize.php'); import('form.Form'); -import('ttOrgHelper'); import('ttUser'); +import('ttUserHelper'); // Access checks. -if ($request->isPost()) { - // Validate that browser_today parameter is in correct format. - $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { - header('Location: access_denied.php'); - exit(); - } -} +// ... anything to check? // End of access checks. $cl_2fa_code = $request->getParameter('2fa_code'); -$cl_password = $request->getParameter('password'); $form = new Form('2faForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'2fa_code','value'=>$cl_2fa_code)); -$form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // User current date, which gets filled in on btn_login click. -$form->addInput(array('type'=>'submit','name'=>'btn_login','onclick'=>'browser_today.value=get_date()','value'=>$i18n->get('button.login'))); +$form->addInput(array('type'=>'submit','name'=>'btn_login','value'=>$i18n->get('button.login'))); if ($request->isPost()) { // Validate user input. if (!ttValidString($cl_2fa_code)) $err->add($i18n->get('error.field'), $i18n->get('form.2fa.2fa_code')); - if ($err->no()) { - - if ($auth->doLogin($cl_login, $cl_password)) { - // Set current user date (as determined by user browser) into session. - $current_user_date = $request->getParameter('browser_today', null); - if ($current_user_date) - $_SESSION['date'] = $current_user_date; - - // Remember user login in a cookie. - setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); - - $user = new ttUser(null, $auth->getUserId()); + // Get user id. + $user_id = ttUserHelper::getUserIdByTmpRef($cl_2fa_code); + if (!$user_id) $err->add($i18n->get('error.2fa_code')); - // Determine if we have to additionally use two-factor authentication. - $config = $user->getConfigHelper(); - $use2FA = $config->getDefinedValue('2fa'); - if ($use2FA) { - - // TODO: send 2fa code to user. - $auth->doLogout(); - - header('Location: 2fa.php'); - exit(); - } - - // Redirect, depending on user role. - if ($user->can('administer_site')) { - header('Location: admin_groups.php'); - } elseif ($user->isClient()) { - header('Location: reports.php'); - } else { - header('Location: time.php'); - } - exit(); - } else - $err->add($i18n->get('error.auth')); + if ($err->no()) { + $user = new ttUser(null, $user_id); // Note: reusing $user from initialize.php. + $auth->setAuth($user_id, $user->login); + + // Redirect, depending on user role. + if ($user->isClient()) { + header('Location: reports.php'); + } else { + header('Location: time.php'); + } + exit(); } } // isPost -if(!isTrue('MULTIORG_MODE') && !ttOrgHelper::getOrgs()) - $err->add($i18n->get('error.no_groups')); - -// Determine whether to show login hint. It is currently used only for Windows LDAP authentication. -$show_hint = ('ad' == isset($GLOBALS['AUTH_MODULE_PARAMS']['type']) ? $GLOBALS['AUTH_MODULE_PARAMS']['type'] : null); - $smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('show_hint', $show_hint); -$smarty->assign('onload', 'onLoad="document.loginForm.'.(!$cl_login?'login':'password').'.focus()"'); -$smarty->assign('about_text', $i18n->get('form.login.about')); +$smarty->assign('onload', 'onLoad="document.2faForm.2fa_code.focus()"'); $smarty->assign('title', $i18n->get('title.2fa')); $smarty->assign('content_page_name', '2fa.tpl'); $smarty->display('index.tpl'); diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index cdf0c7ed..ef2d2ea6 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -74,6 +74,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Usuari o parula de pas incorrecta.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 2c64a859..0f44c1cc 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -76,6 +76,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nesprávné jméno nebo heslo.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 53644ed9..a159edfa 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -67,6 +67,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Forkert brugernavn eller adgangskode.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Brugernavn eksistere allerede.', // TODO: translate the following. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 006d7b89..5e2c19d5 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -65,6 +65,7 @@ 'error.record' => 'Eintrag auswählen.', 'error.auth' => 'Benutzername oder Passwort ungültig.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Benutzer mit diesem Konto ist bereits vorhanden.', 'error.object_exists' => 'Objekt mit diesem Namen ist bereits vorhanden.', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 3d5e59a8..89cfcd26 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -60,6 +60,7 @@ 'error.report' => 'Select report.', 'error.record' => 'Select record.', 'error.auth' => 'Incorrect login or password.', +'error.2fa_code' => 'Invalid 2FA code.', 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'User with this login already exists.', 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 9ce3cb25..96988bdc 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -72,6 +72,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Usuario o contraseña incorrecta.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 884d0e32..035fb644 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -66,6 +66,7 @@ 'error.record' => 'Vali kirje.', 'error.auth' => 'Autentimine ebaõnnestus.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Selle nimega kasutaja on juba kasutusel.', 'error.object_exists' => 'Sellise nimega objekt on juba olemas.', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 2eb5e532..e040921c 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -72,6 +72,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'نام کاربری یا رمز عبور اشتباه است.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'کاربری با این نام کاربری موجود است.', // TODO: translate the following. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 5b85ba63..3dfa9443 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -69,6 +69,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Virheellinen käyttäjänimi tai salasana.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Tämä käyttäjänimi on jo olemassa.', // TODO: translate the following. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 19c3fbaa..a7ef4f23 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -67,6 +67,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nom d\\\'utilisateur ou mot de passe incorrect.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Un utilisateur avec cet identifiant existe déjà.', // TODO: translate the following. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 9c07dd52..72037b0e 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -64,6 +64,7 @@ 'error.record' => 'Επιλογή εγγραφής.', 'error.auth' => 'Λανθασμένο όνομα εισόδου ή κωδικός.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Ο χρήστης με αυτήν τη σύνδεση υπάρχει ήδη.', 'error.object_exists' => 'Το αντικείμενο με αυτό το όνομα υπάρχει ήδη.', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 3cb53daf..1e03b4f7 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -82,6 +82,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'שם משתמש או סיסמה שגויים', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'שם משתמש כבר קיים', // TODO: translate the following. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 61438d08..1b4cf6d2 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -74,6 +74,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 373587f5..8c12f14c 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -66,6 +66,7 @@ 'error.record' => 'Seleziona record.', 'error.auth' => 'Login o password errati.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Esiste già un utente con questo username.', // TODO: translate the following. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index b86ed26e..30156d52 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -74,6 +74,7 @@ // 'error.record' => 'Select record.', 'error.auth' => '不正確なログインあるいはパスワードが不正確です。', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'このログインと関連されたユーザーは既に存在します。', // TODO: translate the following. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 1a810638..49e904b0 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -74,6 +74,7 @@ // 'error.record' => 'Select record.', 'error.auth' => '부정확한 로그인 혹은 암호가 틀립니다.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => '본 로그인과 연계된 사용자가 이미 있습니다.', // TODO: translate the following. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index b2a7fd84..85899c8a 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -59,6 +59,8 @@ 'error.report' => 'Kies rapport.', 'error.record' => 'Kies record.', 'error.auth' => 'Onjuiste inlognaam of wachtwoord.', +// TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', 'error.weak_password' => 'Zwak wachtwoord.', 'error.user_exists' => 'Een gebruiker met deze inlognaam bestaat al.', 'error.object_exists' => 'Een object met deze naam bestaat al.', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 6cabab82..75910ddc 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -75,6 +75,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Feil brukernavn eller passord.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Bruker med et slikt brukernavn eksisterer allerede.', // TODO: translate the following. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 0aac60b4..4a4f9e72 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -70,6 +70,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Błędny login lub hasło.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Użytkownik o takiej nazwie już istnieje.', // TODO: translate the following. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index d311c7a8..ef122e23 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -60,6 +60,7 @@ 'error.record' => 'Selecione o registro.', 'error.auth' => 'Usuário ou senha incorretos.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Já existe usuário com este login.', 'error.object_exists' => 'Já existe um objeto com este nome.', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 942ce209..d6ded651 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -72,6 +72,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 39e507f7..39e2f379 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -78,6 +78,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nume de utilizator sau parola incorecta.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 98b6694a..e4474b2f 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -59,6 +59,7 @@ 'error.report' => 'Выберите отчёт.', 'error.record' => 'Выберите запись.', 'error.auth' => 'Неправильно введен логин или пароль.', +'error.2fa_code' => 'Неверный код 2FA.', 'error.weak_password' => 'Слабый пароль.', 'error.user_exists' => 'Пользователь с таким логином уже существует.', 'error.object_exists' => 'Объект с таким именем уже есть.', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 08bda858..76337a61 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -71,6 +71,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Nesprávne prihlasovacie meno alebo heslo.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Používateľ s týmto prihlasovacím menom už existuje.', // TODO: translate the following. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 804b7fc8..9730c474 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -69,6 +69,7 @@ // 'error.report' => 'Select report.', // 'error.record' => 'Select record.', // 'error.auth' => 'Incorrect login or password.', +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 6f349550..3c490d20 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -67,6 +67,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Pogrešno korisničko ime ili lozinka.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Korisnik pod ovim imenom već postoji.', // TODO: translate the following. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 4cb93fa0..30ed6da0 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -66,6 +66,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Ogiltigt användarnamn eller lösenord.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => 'Det finns redan en användare med det här användarnamnet.', // TODO: translate the following. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 12bdebf3..5251ee8f 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -81,6 +81,7 @@ // 'error.record' => 'Select record.', 'error.auth' => 'Hatalı kullanıcı adı veya parola.', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', // 'error.user_exists' => 'User with this login already exists.', // 'error.object_exists' => 'Object with this name already exists.', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index c37b5661..fa7f78a3 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -69,6 +69,7 @@ // 'error.record' => 'Select record.', 'error.auth' => '不正确的用户名或密码。', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => '该用户登录信息已经存在。', // TODO: translate the following. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index fd78f3e3..71587399 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -72,6 +72,7 @@ // 'error.record' => 'Select record.', 'error.auth' => '不正確的用戶名或密碼。', // TODO: translate the following. +// 'error.2fa_code' => 'Invalid 2FA code.', // 'error.weak_password' => 'Weak password.', 'error.user_exists' => '該使用者登錄資訊已經存在。', // TODO: translate the following. diff --git a/WEB-INF/templates/2fa.tpl b/WEB-INF/templates/2fa.tpl index e634b624..1754f035 100644 --- a/WEB-INF/templates/2fa.tpl +++ b/WEB-INF/templates/2fa.tpl @@ -1,18 +1,11 @@ {* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt *} - - {$forms.2faForm.open} - + - + diff --git a/login.php b/login.php index da59757b..dbf5d0c3 100644 --- a/login.php +++ b/login.php @@ -35,6 +35,7 @@ if (!ttValidString($cl_password)) $err->add($i18n->get('error.field'), $i18n->get('label.password')); $loginSucceeded = $use2FA = false; + if ($err->no()) { // Use the "limit" plugin if we have one. Ignore include errors. // The "limit" plugin is not required for normal operation of Time Tracker. @@ -42,6 +43,8 @@ // Check user login. $loginSucceeded = $auth->doLogin($cl_login, $cl_password); + if (!$loginSucceeded) + $err->add($i18n->get('error.auth')); } // Do we have to use 2FA? @@ -53,7 +56,7 @@ $use2FA = $config->getDefinedValue('2fa'); } - // If we have to use 2FA, create and email auith code to user. + // If we have to use 2FA, create and email auth code to user. if ($use2FA) { // To keep things simple, we use the same code as for password resets. $cryptographically_strong = true; @@ -106,7 +109,6 @@ } if ($err->no() && $loginSucceeded) { - // Set current user date (as determined by user browser) into session. $current_user_date = $request->getParameter('browser_today', null); if ($current_user_date) @@ -124,8 +126,7 @@ header('Location: time.php'); } exit(); - } else - $err->add($i18n->get('error.auth')); + } } // isPost if(!isTrue('MULTIORG_MODE') && !ttOrgHelper::getOrgs()) From 274906af2c15cda962c21c8d8d7addc42482b7fd Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Mar 2022 00:32:38 +0000 Subject: [PATCH 146/304] Added a hint for 2fa.php page to translation files. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 1 + WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/2fa.tpl | 1 + initialize.php | 2 +- 32 files changed, 32 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index ef2d2ea6..5db49232 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -430,6 +430,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 0f44c1cc..c689bafb 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -437,6 +437,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index a159edfa..e2a0da44 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -414,6 +414,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 5e2c19d5..10c6cba4 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -401,6 +401,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 89cfcd26..fb31f0f8 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -380,6 +380,7 @@ 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 96988bdc..bbb923fd 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -434,6 +434,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 035fb644..e698f939 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -422,6 +422,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index e040921c..7a2e8fbc 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -432,6 +432,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 3dfa9443..4b6a1832 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -420,6 +420,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index a7ef4f23..b6d17027 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -411,6 +411,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 72037b0e..a7eec732 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -410,6 +410,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 1e03b4f7..e4ebe519 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -438,6 +438,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 1b4cf6d2..7c761eec 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -431,6 +431,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 8c12f14c..a873bb47 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -420,6 +420,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 30156d52..9d580707 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -432,6 +432,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 49e904b0..59222f08 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -436,6 +436,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 85899c8a..6503da02 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -376,6 +376,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 75910ddc..25549560 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -434,6 +434,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 4a4f9e72..3a91e417 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -422,6 +422,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index ef122e23..af1c6e94 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -374,6 +374,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index d6ded651..8b915d4d 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -414,6 +414,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 39e2f379..5f267efa 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -436,6 +436,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index e4474b2f..c64c8e9c 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -373,6 +373,7 @@ 'email.2fa_code.body' => "Уважаемый пользователь,\n\nВаш код для двухфакторной аутентификации:\n\n%s\n\n", // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. +'form.2fa.hint' => 'Проверьте электронную почту и введите высланный вам 2FA код здесь.', 'form.2fa.2fa_code' => '2FA код', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 76337a61..98d42961 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -425,6 +425,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 9730c474..0f757c7d 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -408,6 +408,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 3c490d20..60c504ca 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -422,6 +422,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Izmena forme za lozinku. Pogledajte primer na https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 30ed6da0..06e7f46a 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -420,6 +420,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 5251ee8f..9d8ef411 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -444,6 +444,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index fa7f78a3..1a91e596 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -427,6 +427,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 71587399..0a2f8510 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -430,6 +430,7 @@ // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. // TODO: translate the following. +// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', // 'form.2fa.2fa_code' => '2FA code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. diff --git a/WEB-INF/templates/2fa.tpl b/WEB-INF/templates/2fa.tpl index 1754f035..bd7e2f01 100644 --- a/WEB-INF/templates/2fa.tpl +++ b/WEB-INF/templates/2fa.tpl @@ -1,6 +1,7 @@ {* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt *} +
{$i18n.form.2fa.hint}
{$forms.2faForm.open}
{$forms.2faForm.2fa_code.control}
diff --git a/initialize.php b/initialize.php index c8b41c6d..31f4096b 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5664"); +define("APP_VERSION", "1.21.1.5665"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 09c609f8f08d9d1f9a5d5daf9d53462c495a4d08 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Mar 2022 13:39:56 +0000 Subject: [PATCH 147/304] Introduced override_2fa access right for top managers. --- dbinstall.php | 12 ++++++++---- initialize.php | 2 +- mysql.sql | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/dbinstall.php b/dbinstall.php index 182910ad..f8e1b936 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1151,7 +1151,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to12100"]) { + if ($_POST["convert11900to12102"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1193,6 +1193,10 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.20.0', modified = now() where param_name = 'version_db' and param_value = '1.19.29'"); ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.20.0') set rights = replace(rights, 'manage_basic_settings,view_all_reports', 'manage_basic_settings,view_all_charts,view_all_reports') where `rank` >= 68"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.0', modified = now() where param_name = 'version_db' and param_value = '1.20.0'"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, 'view_client_unapproved,delete_group', 'view_client_unapproved,override_2fa,delete_group') where `rank` = 512"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, ',manage_work', '')"); + ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, ',update_work', '')"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.2', modified = now() where param_name = 'version_db' and param_value = '1.21.0'"); } if ($_POST["cleanup"]) { @@ -1243,7 +1247,7 @@ function ttGenerateKeys() {

DB Install

-
Create database structure (v1.21.0) + Create database structure (v1.21.2)
(applies only to new installations, do not execute when updating)
@@ -1292,8 +1296,8 @@ function ttGenerateKeys() { - Update database structure (v1.19 to v1.21) - + Update database structure (v1.19 to v1.21.2) + diff --git a/initialize.php b/initialize.php index 31f4096b..8ed35c5c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.1.5665"); +define("APP_VERSION", "1.21.2.5666"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index 05743ee5..0856f94a 100644 --- a/mysql.sql +++ b/mysql.sql @@ -78,7 +78,7 @@ create unique index role_idx on tt_roles(group_id, `rank`, status); # Insert site-wide roles - site administrator and top manager. INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Site administrator', 1024, 'administer_site'); -INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_charts,view_all_reports,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,delete_group'); +INSERT INTO `tt_roles` (`group_id`, `name`, `rank`, `rights`) VALUES (0, 'Top manager', 512, 'track_own_time,track_own_expenses,view_own_reports,view_own_charts,view_own_projects,view_own_tasks,manage_own_settings,view_users,view_client_reports,view_client_invoices,track_time,track_expenses,view_reports,approve_reports,approve_timesheets,view_charts,view_own_clients,override_punch_mode,override_own_punch_mode,override_date_lock,override_own_date_lock,swap_roles,manage_own_account,manage_users,manage_projects,manage_tasks,manage_custom_fields,manage_clients,manage_invoices,override_allow_ip,manage_basic_settings,view_all_charts,view_all_reports,manage_features,manage_advanced_settings,manage_roles,export_data,approve_all_reports,approve_own_timesheets,manage_subgroups,view_client_unapproved,override_2fa,delete_group'); # @@ -621,4 +621,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.0', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.2', now()); # TODO: change when structure changes. From a201018610d9d9f82c886104a7af879a28e1325a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Mar 2022 13:56:41 +0000 Subject: [PATCH 148/304] Started to use override_2fa access right. --- initialize.php | 2 +- login.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/initialize.php b/initialize.php index 8ed35c5c..d56c43b3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.2.5666"); +define("APP_VERSION", "1.21.2.5667"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index dbf5d0c3..a097c888 100644 --- a/login.php +++ b/login.php @@ -56,8 +56,8 @@ $use2FA = $config->getDefinedValue('2fa'); } - // If we have to use 2FA, create and email auth code to user. - if ($use2FA) { + // If we have to use 2FA, email auth code to user and redirect to 2fa.php. + if ($use2FA && !$user->can('override_2fa')) { // To keep things simple, we use the same code as for password resets. $cryptographically_strong = true; $random_bytes = openssl_random_pseudo_bytes(16, $cryptographically_strong); From f2358bfc5e20cd3b741166379779505e8b149be8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 17 Mar 2022 15:26:17 +0000 Subject: [PATCH 149/304] Initial implementation of two factor authentication. --- 2fa.php | 54 +++++++++++++++-------- WEB-INF/templates/2fa.tpl | 24 +++++++--- WEB-INF/templates/group_advanced_edit.tpl | 2 - initialize.php | 2 +- login.php | 9 ++-- 5 files changed, 60 insertions(+), 31 deletions(-) diff --git a/2fa.php b/2fa.php index 005b4ea4..a7e3dbb2 100644 --- a/2fa.php +++ b/2fa.php @@ -11,36 +11,54 @@ // ... anything to check? // End of access checks. -$cl_2fa_code = $request->getParameter('2fa_code'); -$form = new Form('2faForm'); -$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'2fa_code','value'=>$cl_2fa_code)); +$cl_login = $request->getParameter('login'); +if ($cl_login == null && $request->isGet()) $cl_login = @$_COOKIE[LOGIN_COOKIE_NAME]; +$cl_password = $request->getParameter('password'); +$cl_auth_code = $request->getParameter('auth_code'); + +$form = new Form('twoFactorAuthForm'); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'login','value'=>$cl_login)); +$form->getElement('login')->setEnabled(false); +$form->addInput(array('type'=>'password','maxlength'=>'50','name'=>'password','value'=>$cl_password)); +$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'auth_code','value'=>$cl_auth_code)); $form->addInput(array('type'=>'submit','name'=>'btn_login','value'=>$i18n->get('button.login'))); if ($request->isPost()) { // Validate user input. - if (!ttValidString($cl_2fa_code)) $err->add($i18n->get('error.field'), $i18n->get('form.2fa.2fa_code')); - - // Get user id. - $user_id = ttUserHelper::getUserIdByTmpRef($cl_2fa_code); - if (!$user_id) $err->add($i18n->get('error.2fa_code')); + if (!ttValidString($cl_login)) $err->add($i18n->get('error.field'), $i18n->get('label.login')); + if (!ttValidString($cl_password)) $err->add($i18n->get('error.field'), $i18n->get('label.password')); + if (!ttValidString($cl_auth_code)) $err->add($i18n->get('error.field'), $i18n->get('form.2fa.2fa_code')); if ($err->no()) { - $user = new ttUser(null, $user_id); // Note: reusing $user from initialize.php. - $auth->setAuth($user_id, $user->login); - - // Redirect, depending on user role. - if ($user->isClient()) { - header('Location: reports.php'); - } else { - header('Location: time.php'); + // Get user id. + $user_id = ttUserHelper::getUserIdByTmpRef($cl_auth_code); + if (!$user_id) + $err->add($i18n->get('error.2fa_code')); + + if ($err->no()) { + // Additionally check user password for better protection + // against brute force attacks guessing 2FA codes. + $user = new ttUser(null, $user_id); // Note: reusing $user from initialize.php. + // Check user password. + if (!$auth->doLogin($user->login, $cl_password)) + $err->add($i18n->get('error.auth')); + } + + if ($err->no()) { + // Redirect, depending on user role. + if ($user->isClient()) { + header('Location: reports.php'); + } else { + header('Location: time.php'); + } + exit(); } - exit(); } } // isPost $smarty->assign('forms', array($form->getName()=>$form->toArray())); -$smarty->assign('onload', 'onLoad="document.2faForm.2fa_code.focus()"'); +$smarty->assign('onload', 'onLoad="document.twoFactorAuthForm.auth_code.focus()"'); $smarty->assign('title', $i18n->get('title.2fa')); $smarty->assign('content_page_name', '2fa.tpl'); $smarty->display('index.tpl'); diff --git a/WEB-INF/templates/2fa.tpl b/WEB-INF/templates/2fa.tpl index bd7e2f01..d425cbc1 100644 --- a/WEB-INF/templates/2fa.tpl +++ b/WEB-INF/templates/2fa.tpl @@ -2,17 +2,29 @@ License: See license.txt *}
{$i18n.form.2fa.hint}
-{$forms.2faForm.open} +{$forms.twoFactorAuthForm.open} - + - - + + + - + + + + + + + + + + + +
{$forms.2faForm.2fa_code.control}{$forms.twoFactorAuthForm.login.control}
{$forms.2faForm.btn_login.control}{$forms.twoFactorAuthForm.password.control}
{$forms.twoFactorAuthForm.auth_code.control}
{$forms.twoFactorAuthForm.btn_login.control}
-{$forms.2faForm.close} +{$forms.twoFactorAuthForm.close} diff --git a/WEB-INF/templates/group_advanced_edit.tpl b/WEB-INF/templates/group_advanced_edit.tpl index d4bd55a1..82eac702 100644 --- a/WEB-INF/templates/group_advanced_edit.tpl +++ b/WEB-INF/templates/group_advanced_edit.tpl @@ -41,7 +41,6 @@ License: See license.txt *} {$i18n.label.what_is_it} -{if constant('2FA_DEBUG')}
@@ -51,7 +50,6 @@ License: See license.txt *} {$i18n.label.what_is_it} -{/if}
{$i18n.label.required_fields}
diff --git a/initialize.php b/initialize.php index d56c43b3..f3138065 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.2.5667"); +define("APP_VERSION", "1.21.2.5668"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index a097c888..69377fed 100644 --- a/login.php +++ b/login.php @@ -43,8 +43,12 @@ // Check user login. $loginSucceeded = $auth->doLogin($cl_login, $cl_password); - if (!$loginSucceeded) + if ($loginSucceeded) { + // Remember user login in a cookie. + setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); + } else { $err->add($i18n->get('error.auth')); + } } // Do we have to use 2FA? @@ -114,9 +118,6 @@ if ($current_user_date) $_SESSION['date'] = $current_user_date; - // Remember user login in a cookie. - setcookie(LOGIN_COOKIE_NAME, $cl_login, time() + COOKIE_EXPIRE, '/'); - // Redirect, depending on user role. if ($user->can('administer_site')) { header('Location: admin_groups.php'); From e4f35b788164da94bbbdbb9f376d9e3ee970ed1a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 19 Mar 2022 14:16:55 +0000 Subject: [PATCH 150/304] Starting work on allowing multiple uncompleted entries. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/group_edit.tpl | 11 +++++++++++ group_edit.php | 6 ++++++ initialize.php | 2 +- 33 files changed, 53 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 5db49232..8b318204 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -593,6 +593,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index c689bafb..fd4ba142 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -605,6 +605,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index e2a0da44..4e41f9dd 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -571,6 +571,7 @@ 'form.group_edit.type_duration' => 'Varighed', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', 'form.group_edit.uncompleted_indicators' => 'Uafsluttede indikatore', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 10c6cba4..989afc57 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -546,6 +546,8 @@ 'form.group_edit.type_start_finish' => 'Start und Ende', 'form.group_edit.type_duration' => 'Dauer', 'form.group_edit.punch_mode' => 'Stechuhr-Modus', +// TODO: translate the following. +// 'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Erlaube Überschneidung', 'form.group_edit.future_entries' => 'Einträge in der Zukunft', 'form.group_edit.uncompleted_indicators' => 'Zeige unfertige Einträge', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index fb31f0f8..576be5b9 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -526,6 +526,7 @@ 'form.group_edit.type_start_finish' => 'start and finish', 'form.group_edit.type_duration' => 'duration', 'form.group_edit.punch_mode' => 'Punch mode', +'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Allow overlap', 'form.group_edit.future_entries' => 'Future entries', 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index bbb923fd..3f815af0 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -607,6 +607,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index e698f939..76417e94 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -580,6 +580,8 @@ 'form.group_edit.type_start_finish' => 'algus ja lõpp', 'form.group_edit.type_duration' => 'vahemik', 'form.group_edit.punch_mode' => 'Kellast-kellani režiim', +// TODO: translate the following. +// 'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Luba ajaline ülekate', 'form.group_edit.future_entries' => 'Tuleviku kirjed', 'form.group_edit.uncompleted_indicators' => 'Lõpetamata kirjete indikaator', // TODO: Fix this. Indicators (plural), not indicator. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 7a2e8fbc..d4a52de8 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -594,6 +594,7 @@ 'form.group_edit.type_duration' => 'مدت زمان', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 4b6a1832..d4850d85 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -578,6 +578,7 @@ 'form.group_edit.type_duration' => 'kesto', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index b6d17027..7d2bb08c 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -568,6 +568,7 @@ 'form.group_edit.type_duration' => 'Durée', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index a7eec732..222c98b0 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -558,6 +558,8 @@ 'form.group_edit.type_start_finish' => 'αρχή και τέλος', 'form.group_edit.type_duration' => 'διάρκεια', 'form.group_edit.punch_mode' => 'Λειτουργία διάτρησης', +// TODO: translate the following. +// 'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Επικάλυψη επιτρεπτή', 'form.group_edit.future_entries' => 'Μελλοντικές καταχωρήσεις', 'form.group_edit.uncompleted_indicators' => 'Μη ολοκληρωμένες ενδείξεις', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index e4ebe519..450fa585 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -598,6 +598,7 @@ 'form.group_edit.type_duration' => 'משך זמן', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 7c761eec..3b4069a3 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -597,6 +597,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index a873bb47..d1925e63 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -573,6 +573,7 @@ 'form.group_edit.type_duration' => 'durata', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', 'form.group_edit.uncompleted_indicators' => 'Indicatori incompleti', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 9d580707..602427b1 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -600,6 +600,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 59222f08..2200b708 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -598,6 +598,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 6503da02..497d941e 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -516,6 +516,8 @@ 'form.group_edit.type_start_finish' => 'begin en einde', 'form.group_edit.type_duration' => 'duur', 'form.group_edit.punch_mode' => 'Start/stop modus', +// TODO: translate the following. +// 'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Sta overlapping van tijden toe', 'form.group_edit.future_entries' => 'Toevoegingen toestaan in de toekomst', 'form.group_edit.uncompleted_indicators' => 'Onvolledige indicatoren', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 25549560..f45cbf12 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -600,6 +600,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 3a91e417..e6bf9b24 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -580,6 +580,7 @@ 'form.group_edit.type_duration' => 'czas trwania', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index af1c6e94..36a20c20 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -514,6 +514,8 @@ 'form.group_edit.type_start_finish' => 'início e fim', 'form.group_edit.type_duration' => 'duração', 'form.group_edit.punch_mode' => 'Modo punch', +// TODO: translate the following. +// 'form.group_edit.one_uncompleted' => 'One uncompleted', 'form.group_edit.allow_overlap' => 'Permitir sobreposição', 'form.group_edit.future_entries' => 'Entradas futuros', 'form.group_edit.uncompleted_indicators' => 'Indicadores incompletos', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 8b915d4d..5def6759 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -578,6 +578,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 5f267efa..05e6fe5a 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -601,6 +601,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index c64c8e9c..2fbe0dfb 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -513,6 +513,7 @@ 'form.group_edit.type_start_finish' => 'начало и конец', 'form.group_edit.type_duration' => 'длительность', 'form.group_edit.punch_mode' => 'Пробивать время', +'form.group_edit.one_uncompleted' => 'Одна незавершённая', 'form.group_edit.allow_overlap' => 'Возможное перекрывание', 'form.group_edit.future_entries' => 'Будущие записи', 'form.group_edit.uncompleted_indicators' => 'Индикаторы незавершения', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 98d42961..440944c7 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -584,6 +584,7 @@ 'form.group_edit.type_duration' => 'trvanie', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 0f757c7d..7ad63d0e 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -574,6 +574,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 60c504ca..1fc9691f 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -580,6 +580,7 @@ 'form.group_edit.type_duration' => 'trajanje', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 06e7f46a..f3a94315 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -577,6 +577,7 @@ 'form.group_edit.type_duration' => 'Varaktighet', // TODO: translate the following. // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', 'form.group_edit.uncompleted_indicators' => 'Indikatorer för oavslutad registrering', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 9d8ef411..b8763bf2 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -614,6 +614,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 1a91e596..4c797a3c 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -589,6 +589,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 0a2f8510..1cf542d9 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -592,6 +592,7 @@ // 'form.group_edit.type_start_finish' => 'start and finish', // 'form.group_edit.type_duration' => 'duration', // 'form.group_edit.punch_mode' => 'Punch mode', +// 'form.group_edit.one_uncompleted' => 'One uncompleted', // 'form.group_edit.allow_overlap' => 'Allow overlap', // 'form.group_edit.future_entries' => 'Future entries', // 'form.group_edit.uncompleted_indicators' => 'Uncompleted indicators', diff --git a/WEB-INF/templates/group_edit.tpl b/WEB-INF/templates/group_edit.tpl index 05a134dd..673af5e2 100644 --- a/WEB-INF/templates/group_edit.tpl +++ b/WEB-INF/templates/group_edit.tpl @@ -110,6 +110,17 @@ function chLocation(newLocation) { document.location = newLocation; } {$i18n.label.what_is_it} +{if constant('ONE_UNCOMPLETED_DEBUG')} +
+ + + + {$forms.groupForm.one_uncompleted.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} + + +{/if}
diff --git a/group_edit.php b/group_edit.php index ab3065d5..dbfca56b 100644 --- a/group_edit.php +++ b/group_edit.php @@ -66,6 +66,7 @@ $cl_project_required = $request->getParameter('project_required'); $cl_record_type = $request->getParameter('record_type'); $cl_punch_mode = (bool)$request->getParameter('punch_mode'); + $cl_one_uncompleted = (bool)$request->getParameter('one_uncompleted'); $cl_allow_overlap = (bool)$request->getParameter('allow_overlap'); $cl_future_entries = (bool)$request->getParameter('future_entries'); $cl_uncompleted_indicators = (bool)$request->getParameter('uncompleted_indicators'); @@ -82,6 +83,7 @@ $cl_project_required = $group['project_required']; $cl_record_type = $group['record_type']; $cl_punch_mode = $config->getDefinedValue('punch_mode'); + $cl_one_uncompleted = $config->getDefinedValue('one_uncompleted'); $cl_allow_overlap = $config->getDefinedValue('allow_overlap'); $cl_future_entries = $config->getDefinedValue('future_entries'); $cl_uncompleted_indicators = $config->getDefinedValue('uncompleted_indicators'); @@ -166,6 +168,9 @@ // Punch mode checkbox. $form->addInput(array('type'=>'checkbox','name'=>'punch_mode','value'=>$cl_punch_mode)); +// One uncompleted. +$form->addInput(array('type'=>'checkbox','name'=>'one_uncompleted','value'=>$cl_one_uncompleted)); + // Allow overlap checkbox. $form->addInput(array('type'=>'checkbox','name'=>'allow_overlap','value'=>$cl_allow_overlap)); @@ -200,6 +205,7 @@ if ($err->no()) { // Update config. $config->setDefinedValue('punch_mode', $cl_punch_mode); + $config->setDefinedValue('one_uncompleted', $cl_one_uncompleted); $config->setDefinedValue('allow_overlap', $cl_allow_overlap); $config->setDefinedValue('future_entries', $cl_future_entries); $config->setDefinedValue('uncompleted_indicators', $cl_uncompleted_indicators); diff --git a/initialize.php b/initialize.php index f3138065..0295c2bc 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.2.5668"); +define("APP_VERSION", "1.21.2.5669"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 630f9ded901a89ccdf665405bf708961540eb6d3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 20 Mar 2022 15:25:17 +0000 Subject: [PATCH 151/304] Implemented multiple uncompleted entries with config option. --- WEB-INF/lib/ttTimeHelper.class.php | 44 ++++++++++++++++++++++++++---- WEB-INF/templates/group_edit.tpl | 2 -- WEB-INF/templates/puncher.tpl | 6 ++-- WEB-INF/templates/time.tpl | 6 ---- WEB-INF/templates/time_script.tpl | 16 +++++++++++ initialize.php | 2 +- puncher.php | 20 ++++++++------ time.php | 4 ++- time_edit.php | 4 ++- 9 files changed, 77 insertions(+), 27 deletions(-) diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index b45c6d17..fa110fa4 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -449,7 +449,6 @@ static function insert($fields) } else { $duration = ttTimeHelper::toDuration($start, $finish); if ($duration === false) $duration = 0; - if (!$duration && ttTimeHelper::getUncompleted($user_id)) return false; $sql = "insert into tt_log (user_id, group_id, org_id, date, start, duration, client_id, project_id, task_id, invoice_id, comment, billable, paid, created, created_ip, created_by) ". "values ($user_id, $group_id, $org_id, ".$mdb2->quote($date).", '$start', '$duration', ".$mdb2->quote($client).", ".$mdb2->quote($project).", ".$mdb2->quote($task).", ".$mdb2->quote($invoice).", ".$mdb2->quote($note).", $billable, $paid $created_v)"; @@ -512,9 +511,9 @@ static function update($fields) $duration = ttTimeHelper::toDuration($start, $finish); if ($duration === false) $duration = 0; - $uncompleted = ttTimeHelper::getUncompleted($user_id); - if (!$duration && $uncompleted && ($uncompleted['id'] != $id)) - return false; + //$uncompleted = ttTimeHelper::getUncompleted($user_id); + //if (!$duration && $uncompleted && ($uncompleted['id'] != $id)) +// return false; $sql = "UPDATE tt_log SET start = '$start', duration = '$duration', client_id = ".$mdb2->quote($client).", project_id = ".$mdb2->quote($project).", task_id = ".$mdb2->quote($task).", ". "comment = ".$mdb2->quote($note)."$billable_part $paid_part $modified_part, date = '$date' WHERE id = $id and user_id = $user_id and group_id = $group_id and org_id = $org_id"; @@ -673,10 +672,43 @@ static function getTimeForMonth2($date) { // getUncompleted - retrieves an uncompleted record for user, if one exists. static function getUncompleted($user_id) { + + global $user; + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $mdb2 = getConnection(); + + $sql = "select id, start, date from tt_log". + " where user_id = $user_id and start is not null and time_to_sec(duration) = 0 and status = 1". + " and group_id = $group_id and org_id = $org_id"; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + if (!$res->numRows()) { + return false; + } + if ($val = $res->fetchRow()) { + return $val; + } + } + return false; + } + + // getFirstUncompletedForDate - retrieves first found uncompleted record for user for a specific date, if one exists. + static function getFirstUncompletedForDate($user_id, $date) { + + $user_id = (int) $user_id; // Protection against sql injection. + + global $user; + $group_id = $user->getGroup(); + $org_id = $user->org_id; + $mdb2 = getConnection(); $sql = "select id, start, date from tt_log". - " where user_id = $user_id and start is not null and time_to_sec(duration) = 0 and status = 1"; + " where user_id = $user_id and start is not null and time_to_sec(duration) = 0 and status = 1". + " and group_id = $group_id and org_id = $org_id and date = ".$mdb2->quote($date). + " order by start"; // Ordering by start time to get the eraliest uncompleted for date. $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { if (!$res->numRows()) { @@ -740,6 +772,8 @@ static function overlaps($user_id, $date, $start, $finish, $record_id = null) { // getRecord - retrieves a time record identified by its id. static function getRecord($id) { global $user; + + $id = (int) $id; // Protection against sql injections. $user_id = $user->getUser(); $group_id = $user->getGroup(); diff --git a/WEB-INF/templates/group_edit.tpl b/WEB-INF/templates/group_edit.tpl index 673af5e2..909b485e 100644 --- a/WEB-INF/templates/group_edit.tpl +++ b/WEB-INF/templates/group_edit.tpl @@ -110,7 +110,6 @@ function chLocation(newLocation) { document.location = newLocation; } {$i18n.label.what_is_it} -{if constant('ONE_UNCOMPLETED_DEBUG')}
@@ -120,7 +119,6 @@ function chLocation(newLocation) { document.location = newLocation; } {$i18n.label.what_is_it} -{/if}
diff --git a/WEB-INF/templates/puncher.tpl b/WEB-INF/templates/puncher.tpl index 8060c2ff..9190af39 100644 --- a/WEB-INF/templates/puncher.tpl +++ b/WEB-INF/templates/puncher.tpl @@ -48,11 +48,11 @@ function stopTimer() { } -{if $uncompleted} +{if $uncompleted_today} + {if $show_navigation}
{$i18n.label.day_view} @@ -113,6 +121,9 @@ License: See license.txt *} {if $time_records} + + +
@@ -177,10 +188,13 @@ License: See license.txt *} {/if} {/if} - diff --git a/initialize.php b/initialize.php index 84470d54..2f7224b8 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5691"); +define("APP_VERSION", "1.21.4.5692"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 92f500d8..2b25462d 100644 --- a/puncher.php +++ b/puncher.php @@ -32,7 +32,7 @@ // If we are passed in browser_time, make sure it is in correct format. $browser_time = null; // Reused below beyond access checks. if ($request->isPost()) { - // Validate that browser_today parameter is in correct format. + // Validate that browser_time parameter is in correct format. $browser_time = $request->getParameter('browser_time'); if ($browser_time && !ttValidTime($browser_time)) { header('Location: access_denied.php'); diff --git a/time.php b/time.php index 4f08cfe2..faf064a4 100644 --- a/time.php +++ b/time.php @@ -46,6 +46,30 @@ exit(); } } +// Additional checks for hidden controls used for completion of uncompleted records. +// browser_date, browser_time, record_id. +if ($request->isPost() && $request->getParameter('btn_stop')) { + $recordId = (int) $request->getParameter('record_id'); + $time_rec = ttTimeHelper::getRecord($recordId); + if (!$time_rec) { + // We are passed a bogus record id. + header('Location: access_denied.php'); + exit(); + } + + // Validate that browser_date parameter is in correct format. + $browser_date = $request->getParameter('browser_date'); + if ($browser_date && !ttValidDbDateFormatDate($browser_date)) { + header('Location: access_denied.php'); + exit(); + } + // Validate that browser_time parameter is in correct format. + $browser_time = $request->getParameter('browser_time'); + if ($browser_time && !ttValidTime($browser_time)) { + header('Location: access_denied.php'); + exit(); + } +} // End of access checks. // Determine user for whom we display this page. From c88dfcd6d32eea8818f266e39144732f9c263184 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 9 Apr 2022 15:18:33 +0000 Subject: [PATCH 174/304] Resuming refactoring. --- WEB-INF/lib/common.lib.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index fc27d294..2d8e287d 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -577,7 +577,7 @@ function ttEndsWith($string, $endString) function ttDateToUserFormat($date) { global $user; - $o_date = new DateAndTime(DB_DATEFORMAT, $date); + $o_date = new ttDate($date); return $o_date->toString($user->date_format); } diff --git a/initialize.php b/initialize.php index 2f7224b8..e787e27b 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5692"); +define("APP_VERSION", "1.21.4.5693"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ba5e71ff40894946290f51979dc07f4ab00e21d0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 9 Apr 2022 16:52:18 +0000 Subject: [PATCH 175/304] Incremental refactoring. --- WEB-INF/lib/form/ActionForm.class.php | 43 +++++++-------------------- initialize.php | 2 +- time_edit.php | 1 - week.php | 1 - 4 files changed, 12 insertions(+), 35 deletions(-) diff --git a/WEB-INF/lib/form/ActionForm.class.php b/WEB-INF/lib/form/ActionForm.class.php index abc5e006..5b88292c 100644 --- a/WEB-INF/lib/form/ActionForm.class.php +++ b/WEB-INF/lib/form/ActionForm.class.php @@ -1,32 +1,9 @@ mValues[$name] = $value; if ($this->mForm) { if (isset($this->mForm->elements[$name])) { if ($this->mForm->elements[$name]->class=="DateField") { - $dt = new DateAndTime($user->date_format, $value); - $value = $dt->toString(DB_DATEFORMAT); + // TODO: It appears that we never get here. Refactor this entire class. + $dt = new ttDate($user->date_format, $value); + $value = $dt->toString(); } $this->mForm->elements[$name]->setValueSafe($value); } @@ -140,8 +118,9 @@ function setAttributes($value) { if ($this->mForm) { if (isset($this->mForm->elements[$name])) { if ($this->mForm->elements[$name]->class=="DateField") { - $dt = new DateAndTime($user->date_format, $value); - $value = $dt->toString(DB_DATEFORMAT); + // TODO: It appears that we never get here. Refactor this entire class. + $dt = new ttDate($user->date_format, $value); + $value = $dt->toString(); } $this->mForm->elements[$name]->setValueSafe($value); } diff --git a/initialize.php b/initialize.php index e787e27b..a8b14bca 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5693"); +define("APP_VERSION", "1.21.4.5694"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time_edit.php b/time_edit.php index a00f6605..03c72119 100644 --- a/time_edit.php +++ b/time_edit.php @@ -9,7 +9,6 @@ import('ttClientHelper'); import('ttTimeHelper'); import('ttConfigHelper'); -import('DateAndTime'); import('ttDate'); // Access checks. diff --git a/week.php b/week.php index 1e0ec1b4..92eb95ee 100644 --- a/week.php +++ b/week.php @@ -13,7 +13,6 @@ import('ttClientHelper'); import('ttTimeHelper'); import('ttDate'); -import('DateAndTime'); // Access checks. if (!(ttAccessAllowed('track_own_time') || ttAccessAllowed('track_time'))) { From 43b0cadb33efc2bb97b3a62a95d6a7da5d93874b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 9 Apr 2022 18:40:23 +0000 Subject: [PATCH 176/304] More refactoring. --- expense_edit.php | 16 ++++++++-------- initialize.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/expense_edit.php b/expense_edit.php index 258437b3..e57db88d 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -5,9 +5,9 @@ require_once('initialize.php'); import('form.Form'); import('ttGroupHelper'); -import('DateAndTime'); import('ttTimeHelper'); import('ttExpenseHelper'); +import('ttDate'); // Access checks. if (!(ttAccessAllowed('track_own_expenses') || ttAccessAllowed('track_expenses'))) { @@ -37,7 +37,7 @@ } // End of access checks. -$item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']); +$item_date = new ttDate($expense_item['date']); $confirm_save = $user->getConfigOption('confirm_save'); $trackingMode = $user->getTrackingMode(); $show_project = MODE_PROJECTS == $trackingMode || MODE_PROJECTS_AND_TASKS == $trackingMode; @@ -150,11 +150,11 @@ if (!ttValidDate($cl_date)) $err->add($i18n->get('error.field'), $i18n->get('label.date')); // This is a new date for the expense item. - $new_date = new DateAndTime($user->getDateFormat(), $cl_date); + $new_date = new ttDate($cl_date, $user->getDateFormat()); // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { - $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); + $browser_today = new ttDate($request->getParameter('browser_today', null)); if ($new_date->after($browser_today)) $err->add($i18n->get('error.future_date')); } @@ -178,9 +178,9 @@ // Now, an update. if ($err->no()) { - if (ttExpenseHelper::update(array('id'=>$cl_id,'date'=>$new_date->toString(DB_DATEFORMAT), + if (ttExpenseHelper::update(array('id'=>$cl_id,'date'=>$new_date->toString(), 'client_id'=>$cl_client,'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'paid'=>$cl_paid))) { - header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT)); + header('Location: expenses.php?date='.$new_date->toString()); exit(); } } @@ -194,9 +194,9 @@ // Now, a new insert. if ($err->no()) { - if (ttExpenseHelper::insert(array('date'=>$new_date->toString(DB_DATEFORMAT),'client_id'=>$cl_client, + if (ttExpenseHelper::insert(array('date'=>$new_date->toString(),'client_id'=>$cl_client, 'project_id'=>$cl_project,'name'=>$cl_item_name,'cost'=>$cl_cost,'status'=>1))) { - header('Location: expenses.php?date='.$new_date->toString(DB_DATEFORMAT)); + header('Location: expenses.php?date='.$new_date->toString()); exit(); } else $err->add($i18n->get('error.db')); diff --git a/initialize.php b/initialize.php index a8b14bca..45fa6778 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5694"); +define("APP_VERSION", "1.21.4.5695"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 49ef4b11da9b456e26d5e1592fa79a3194a49b7e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 16:04:20 +0000 Subject: [PATCH 177/304] Resuming refactoring. --- WEB-INF/lib/ttDate.class.php | 9 +++++++++ initialize.php | 2 +- reports.php | 33 +++++++++++++++++---------------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index 1f1dfeaa..3b798214 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -153,6 +153,15 @@ function after(/*ttDate*/ $obj) { } + function compare(/*ttDate*/ $obj) { + $ts1 = $this->getTimestamp(); + $ts2 = $obj->getTimestamp(); + if ($ts1 < $ts2) return -1; + if ($ts1 == $ts2) return 0; + if ($ts1 > $ts2) return 1; + } + + // Getters. function getYear() { return $this->year; } function getMonth() { return $this->month; } diff --git a/initialize.php b/initialize.php index 45fa6778..201e96f4 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5695"); +define("APP_VERSION", "1.21.4.5696"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index c1df0438..858ca61c 100644 --- a/reports.php +++ b/reports.php @@ -5,13 +5,13 @@ require_once('initialize.php'); import('form.Form'); import('form.ActionForm'); -import('DateAndTime'); import('ttGroupHelper'); -import('Period'); import('ttProjectHelper'); import('ttFavReportHelper'); import('ttClientHelper'); import('ttReportHelper'); +import('ttDate'); +import('ttPeriod'); // Access check. if (!(ttAccessAllowed('view_own_reports') || ttAccessAllowed('view_reports') || ttAccessAllowed('view_all_reports') || ttAccessAllowed('view_client_reports'))) { @@ -357,9 +357,9 @@ if ($request->isGet() && !$bean->isSaved()) { // No previous form data were found in session. Use the following default values. $form->setValueByElement('users_active', array_keys((array)$user_list_active)); - $period = new Period(INTERVAL_THIS_MONTH, new DateAndTime($user->getDateFormat())); - $form->setValueByElement('start_date', $period->getStartDate()); - $form->setValueByElement('end_date', $period->getEndDate()); + $period = new ttPeriod(new ttDate(), INTERVAL_THIS_MONTH); + $form->setValueByElement('start_date', $period->getStartDate($user->getDateFormat())); + $form->setValueByElement('end_date', $period->getEndDate($user->getDateFormat())); $form->setValueByElement('chclient', '1'); $form->setValueByElement('chstart', '1'); @@ -438,17 +438,18 @@ } else { // Generate button pressed. Check some values. if (!$bean->getAttribute('period')) { - $start_date = new DateAndTime($user->getDateFormat(), $bean->getAttribute('start_date')); - - if ($start_date->isError() || !$bean->getAttribute('start_date')) - $err->add($i18n->get('error.field'), $i18n->get('label.start_date')); - - $end_date = new DateAndTime($user->getDateFormat(), $bean->getAttribute('end_date')); - if ($end_date->isError() || !$bean->getAttribute('end_date')) - $err->add($i18n->get('error.field'), $i18n->get('label.end_date')); - - if ($start_date->compare($end_date) > 0) - $err->add($i18n->get('error.interval'), $i18n->get('label.end_date'), $i18n->get('label.start_date')); + // Validate start date. + if (!ttValidDate($bean->getAttribute('start_date'))) $err->add($i18n->get('error.field'), $i18n->get('label.start_date')); + // Validate end date. + if (!ttValidDate($bean->getAttribute('end_date'))) $err->add($i18n->get('error.field'), $i18n->get('label.end_date')); + // Make sure that the end date is equal or after the start date. + if ($err->no()) { + $startDate = new ttDate($bean->getAttribute('start_date'), $user->getDateFormat()); + $endDate = new ttDate($bean->getAttribute('end_date'), $user->getDateFormat()); + if ($startDate->compare($endDate) > 0) { + $err->add($i18n->get('error.interval'), $i18n->get('label.end_date'), $i18n->get('label.start_date')); + } + } } $group_by1 = $bean->getAttribute('group_by1'); $group_by2 = $bean->getAttribute('group_by2'); From 66ee957d754819df5f672746af4d62aad44771a7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 16:15:10 +0000 Subject: [PATCH 178/304] A bit more refactoring. --- initialize.php | 2 +- invoice_view.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/initialize.php b/initialize.php index 201e96f4..5703b55b 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5696"); +define("APP_VERSION", "1.21.4.5697"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/invoice_view.php b/invoice_view.php index b03b719e..b1fcf91f 100644 --- a/invoice_view.php +++ b/invoice_view.php @@ -3,7 +3,7 @@ License: See license.txt */ require_once('initialize.php'); -import('DateAndTime'); +import('ttDate'); import('ttInvoiceHelper'); import('ttClientHelper'); import('form.Form'); @@ -25,7 +25,7 @@ } // End of access checks. -$invoice_date = new DateAndTime(DB_DATEFORMAT, $invoice['date']); +$invoice_date = new ttDate($invoice['date']); $client = ttClientHelper::getClient($invoice['client_id'], true); if (!$client) // In case client was deleted. $client = ttClientHelper::getDeletedClient($invoice['client_id']); From a44ba11b58ef6f76c7570a3092bb94c0088b2008 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 16:39:55 +0000 Subject: [PATCH 179/304] More refactoring. --- expenses.php | 11 +++++------ initialize.php | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/expenses.php b/expenses.php index 897d64d9..34169b7d 100644 --- a/expenses.php +++ b/expenses.php @@ -6,7 +6,7 @@ import('form.Form'); import('ttUserHelper'); import('ttGroupHelper'); -import('DateAndTime'); +import('ttDate'); import('ttTimeHelper'); import('ttExpenseHelper'); import('ttFileHelper'); @@ -65,13 +65,12 @@ // Initialize and store date in session. $cl_date = $request->getParameter('date', @$_SESSION['date']); -$selected_date = new DateAndTime(DB_DATEFORMAT, $cl_date); -if($selected_date->isError()) - $selected_date = new DateAndTime(DB_DATEFORMAT); +$selected_date = new ttDate($cl_date); if(!$cl_date) - $cl_date = $selected_date->toString(DB_DATEFORMAT); + $cl_date = $selected_date->toString(); $_SESSION['date'] = $cl_date; + $tracking_mode = $user->getTrackingMode(); $show_project = MODE_PROJECTS == $tracking_mode || MODE_PROJECTS_AND_TASKS == $tracking_mode; $showFiles = $user->isPluginEnabled('at'); @@ -203,7 +202,7 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { - $browser_today = new DateAndTime(DB_DATEFORMAT, $request->getParameter('browser_today', null)); + $browser_today = new ttDate($request->getParameter('browser_today', null)); if ($selected_date->after($browser_today)) $err->add($i18n->get('error.future_date')); } diff --git a/initialize.php b/initialize.php index 5703b55b..e1a5ffd0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5697"); +define("APP_VERSION", "1.21.4.5698"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 8b66de3dd6a21fc65fa26a3a6fcbf940d8d2b05f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 16:53:05 +0000 Subject: [PATCH 180/304] A bit more refactoring. --- charts.php | 6 +++--- expense_delete.php | 4 ++-- initialize.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/charts.php b/charts.php index cfd01c5f..1ad1c88d 100644 --- a/charts.php +++ b/charts.php @@ -6,7 +6,7 @@ require_once('initialize.php'); import('form.Form'); -import('DateAndTime'); +import('ttDate'); import('ttChartHelper'); import('ttUserConfig'); import('PieChartEx'); @@ -72,8 +72,8 @@ // Initialize and store date in session. $cl_date = $request->getParameter('date', @$_SESSION['date']); if(!$cl_date) { - $now = new DateAndTime(DB_DATEFORMAT); - $cl_date = $now->toString(DB_DATEFORMAT); + $now = new ttDate(); + $cl_date = $now->toString(); } $_SESSION['date'] = $cl_date; diff --git a/expense_delete.php b/expense_delete.php index 6c5cb791..6dbf421a 100644 --- a/expense_delete.php +++ b/expense_delete.php @@ -4,7 +4,7 @@ require_once('initialize.php'); import('form.Form'); -import('DateAndTime'); +import('ttDate'); import('ttExpenseHelper'); // Access checks. @@ -30,7 +30,7 @@ if ($request->getParameter('delete_button')) { // Delete button pressed. // Determine if it is okay to delete the record. - $item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']); + $item_date = new ttDate($expense_item['date']); if ($user->isDateLocked($item_date)) $err->add($i18n->get('error.range_locked')); diff --git a/initialize.php b/initialize.php index e1a5ffd0..6be6126d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5698"); +define("APP_VERSION", "1.21.4.5699"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 0a61c1b2469f7c519419b35712223838a37f40b9 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 17:28:27 +0000 Subject: [PATCH 181/304] Cleanup. --- WEB-INF/lib/ttTeamHelper.class.php | 30 ++---------------------------- WEB-INF/lib/ttTimeHelper.class.php | 2 -- initialize.php | 2 +- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/WEB-INF/lib/ttTeamHelper.class.php b/WEB-INF/lib/ttTeamHelper.class.php index 981f01b5..e12c2575 100644 --- a/WEB-INF/lib/ttTeamHelper.class.php +++ b/WEB-INF/lib/ttTeamHelper.class.php @@ -1,33 +1,8 @@ query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { - $dt = new DateAndTime(DB_DATEFORMAT); while ($val = $res->fetchRow()) { $result[] = $val; } diff --git a/WEB-INF/lib/ttTimeHelper.class.php b/WEB-INF/lib/ttTimeHelper.class.php index dd097747..2e9eddbb 100644 --- a/WEB-INF/lib/ttTimeHelper.class.php +++ b/WEB-INF/lib/ttTimeHelper.class.php @@ -2,8 +2,6 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -import('DateAndTime'); - // The ttTimeHelper is a class to help with time-related values. class ttTimeHelper { diff --git a/initialize.php b/initialize.php index 6be6126d..9ae6dcdb 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5699"); +define("APP_VERSION", "1.21.4.5700"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 2cf98d9ab1e736794ff0131a41cb642374198fe5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 17:45:17 +0000 Subject: [PATCH 182/304] A bit more cleanup and refactoring. --- WEB-INF/lib/ttGroupHelper.class.php | 4 +--- initialize.php | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttGroupHelper.class.php b/WEB-INF/lib/ttGroupHelper.class.php index 81b0c7f3..81d1af69 100644 --- a/WEB-INF/lib/ttGroupHelper.class.php +++ b/WEB-INF/lib/ttGroupHelper.class.php @@ -431,10 +431,9 @@ static function getActiveInvoices($sort_options = false) $res = $mdb2->query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { - $dt = new DateAndTime(DB_DATEFORMAT); while ($val = $res->fetchRow()) { // Localize date. - $dt->parseVal($val['date']); + $dt = new ttDate($val['date']); $val['date'] = $dt->toString($user->getDateFormat()); if ($addPaidStatus) $val['paid'] = ttInvoiceHelper::isPaid($val['id']); @@ -679,7 +678,6 @@ static function getRecentInvoices($client_id) { $res = $mdb2->query($sql); $result = array(); if (!is_a($res, 'PEAR_Error')) { - $dt = new DateAndTime(DB_DATEFORMAT); while ($val = $res->fetchRow()) { $result[] = $val; } diff --git a/initialize.php b/initialize.php index 9ae6dcdb..6b4471a2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5700"); +define("APP_VERSION", "1.21.4.5701"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 912ffe1bfcbb21a8e87e6a162b57148321109a22 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 20:01:41 +0000 Subject: [PATCH 183/304] Refactoring in progress. --- WEB-INF/lib/ttChartHelper.class.php | 40 ++++++----------------------- WEB-INF/lib/ttPeriod.class.php | 12 +++++++++ initialize.php | 2 +- 3 files changed, 21 insertions(+), 33 deletions(-) diff --git a/WEB-INF/lib/ttChartHelper.class.php b/WEB-INF/lib/ttChartHelper.class.php index 4e4f9c83..f0523036 100644 --- a/WEB-INF/lib/ttChartHelper.class.php +++ b/WEB-INF/lib/ttChartHelper.class.php @@ -1,32 +1,8 @@ endDate = new ttDate(); switch ($period_type) { + case INTERVAL_THIS_DAY: + $this->startDate->setFromUnixTimestamp($ttDateInstance->getTimestamp()); + $this->endDate->setFromUnixTimestamp($ttDateInstance->getTimestamp()); + break; + case INTERVAL_THIS_WEEK: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); @@ -32,6 +39,11 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); break; + + case INTERVAL_THIS_YEAR: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,1,1,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,12,31,$t_arr[5])); + break; } } diff --git a/initialize.php b/initialize.php index 6b4471a2..a078f888 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5701"); +define("APP_VERSION", "1.21.4.5702"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 50e2643ca231372b72c42d4094cd195903efe31d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 10 Apr 2022 20:36:34 +0000 Subject: [PATCH 184/304] Refactoring in progress. --- WEB-INF/lib/ttPeriod.class.php | 24 ++++++++++++++++++++++++ WEB-INF/lib/ttReportHelper.class.php | 10 ++++++---- initialize.php | 2 +- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php index 85022a85..1d63ad9d 100644 --- a/WEB-INF/lib/ttPeriod.class.php +++ b/WEB-INF/lib/ttPeriod.class.php @@ -6,6 +6,10 @@ define('INTERVAL_THIS_WEEK', 2); define('INTERVAL_THIS_MONTH', 3); define('INTERVAL_THIS_YEAR', 4); +define('INTERVAL_ALL_TIME', 5); +define('INTERVAL_LAST_WEEK', 6); +define('INTERVAL_LAST_MONTH', 7); +define('INTERVAL_LAST_DAY', 8); class ttPeriod { var $startDate; // ttDate object. @@ -30,16 +34,31 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { $this->endDate->setFromUnixTimestamp($ttDateInstance->getTimestamp()); break; + case INTERVAL_LAST_DAY: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); + break; + case INTERVAL_THIS_WEEK: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); break; + case INTERVAL_LAST_WEEK: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-7+$startWeekBias,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-1+$startWeekBias,$t_arr[5])); + break; + case INTERVAL_THIS_MONTH: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); break; + case INTERVAL_LAST_MONTH: + $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4],1,$t_arr[5])); + $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,0,$t_arr[5])); + break; + case INTERVAL_THIS_YEAR: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,1,1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,12,31,$t_arr[5])); @@ -47,6 +66,11 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { } } + // Sets period to designated start and and dates. + function setPeriod($start_date, $end_date) { + $this->startDate = $start_date; + $this->endDate = $end_date; + } // Returns start date in specified format. function getStartDate($format = null) { diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 20e6d7a4..bafa4022 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -4,7 +4,9 @@ import('ttClientHelper'); import('DateAndTime'); +import('ttDate'); import('Period'); +import('ttPeriod'); import('ttTimeHelper'); import('ttConfigHelper'); @@ -119,12 +121,12 @@ static function getWhere($options) { // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); if ($options['period']) - $period = new Period($options['period'], new DateAndTime($dateFormat)); + $period = new ttPeriod(new ttDate(), $options['period']); else { - $period = new Period(); + $period = new ttPeriod(new ttDate()); $period->setPeriod( - new DateAndTime($dateFormat, $options['period_start']), - new DateAndTime($dateFormat, $options['period_end'])); + new ttDate($options['period_start'], $dateFormat), + new ttDate($options['period_end'], $dateFormat)); } $where = " where l.status = 1 and l.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'". " $user_list_part $dropdown_parts $cf_text_parts"; diff --git a/initialize.php b/initialize.php index a078f888..7fbdc50f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5702"); +define("APP_VERSION", "1.21.4.5703"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 094e353b2f55375aedd70f14f495c23f179e1f24 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 15:43:46 +0000 Subject: [PATCH 185/304] Resuming refactoring. --- WEB-INF/lib/ttReportHelper.class.php | 29 +++++++++++++--------------- initialize.php | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index bafa4022..995cfa2b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -3,9 +3,7 @@ License: See license.txt */ import('ttClientHelper'); -import('DateAndTime'); import('ttDate'); -import('Period'); import('ttPeriod'); import('ttTimeHelper'); import('ttConfigHelper'); @@ -128,7 +126,7 @@ static function getWhere($options) { new ttDate($options['period_start'], $dateFormat), new ttDate($options['period_end'], $dateFormat)); } - $where = " where l.status = 1 and l.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and l.date <= '".$period->getEndDate(DB_DATEFORMAT)."'". + $where = " where l.status = 1 and l.date >= '".$period->getStartDate()."' and l.date <= '".$period->getEndDate()."'". " $user_list_part $dropdown_parts $cf_text_parts"; return $where; } @@ -203,14 +201,14 @@ static function getExpenseWhere($options) { // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); if ($options['period']) - $period = new Period($options['period'], new DateAndTime($dateFormat)); + $period = new ttPeriod(new ttDate(), $options['period']); else { - $period = new Period(); + $period = new ttPeriod(new ttDate()); $period->setPeriod( - new DateAndTime($dateFormat, $options['period_start']), - new DateAndTime($dateFormat, $options['period_end'])); + new ttDate($options['period_start'], $dateFormat), + new ttDate($options['period_end'], $dateFormat)); } - $where = " where ei.status = 1 and ei.date >= '".$period->getStartDate(DB_DATEFORMAT)."' and ei.date <= '".$period->getEndDate(DB_DATEFORMAT)."'". + $where = " where ei.status = 1 and ei.date >= '".$period->getStartDate()."' and ei.date <= '".$period->getEndDate()."'". " $user_list_part $dropdown_parts $cf_text_parts"; return $where; } @@ -883,17 +881,16 @@ static function getTotals($options) $dateFormat = $user->getDateFormat(); if (isset($options['period']) && $options['period']) - $period = new Period($options['period'], new DateAndTime($dateFormat)); + $period = new ttPeriod(new ttDate(), $options['period']); else { - $period = new Period(); - if (isset($options['period_start']) && isset($options['period_end'])) - $period->setPeriod( - new DateAndTime($dateFormat, $options['period_start']), - new DateAndTime($dateFormat, $options['period_end'])); + $period = new ttPeriod(new ttDate()); + $period->setPeriod( + new ttDate($options['period_start'], $dateFormat), + new ttDate($options['period_end'], $dateFormat)); } - $totals['start_date'] = $period->getStartDate(); - $totals['end_date'] = $period->getEndDate(); + $totals['start_date'] = $period->getStartDate($user->getDateFormat()); + $totals['end_date'] = $period->getEndDate($user->getDateFormat()); $totals['time'] = $total_time; $totals['minutes'] = $val['time'] / 60; $totals['units'] = isset($val['units']) ? $val['units'] : null; diff --git a/initialize.php b/initialize.php index 7fbdc50f..88849a73 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5703"); +define("APP_VERSION", "1.21.4.5705"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 83b155b827c5ec9923b6aadd74ad462f7d8e3b61 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 16:31:38 +0000 Subject: [PATCH 186/304] Refactoring. Fully replaced older Period class usage with newer ttPeriod. --- WEB-INF/lib/Period.class.php | 136 ------------------------ WEB-INF/lib/ttTimesheetHelper.class.php | 14 +-- initialize.php | 2 +- 3 files changed, 9 insertions(+), 143 deletions(-) delete mode 100644 WEB-INF/lib/Period.class.php diff --git a/WEB-INF/lib/Period.class.php b/WEB-INF/lib/Period.class.php deleted file mode 100644 index 57ea0e44..00000000 --- a/WEB-INF/lib/Period.class.php +++ /dev/null @@ -1,136 +0,0 @@ -getWeekStart(); - - $this->startDate = new DateAndTime(); - $this->startDate->setFormat($date_point->getFormat()); - $this->endDate = new DateAndTime(); - $this->endDate->setFormat($date_point->getFormat()); - $t_arr = localtime($date_point->getTimestamp()); - $t_arr[5] = $t_arr[5] + 1900; - - if ($t_arr[6] < $weekStartDay) { - $startWeekBias = $weekStartDay - 7; - } else { - $startWeekBias = $weekStartDay; - } - - switch ($period_type) { - case INTERVAL_THIS_DAY: - $this->startDate->setTimestamp($date_point->getTimestamp()); - $this->endDate->setTimestamp($date_point->getTimestamp()); - break; - - case INTERVAL_LAST_DAY: - $this->startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); - $this->endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); - break; - - case INTERVAL_THIS_WEEK: - $this->startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+$startWeekBias,$t_arr[5])); - $this->endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); - break; - case INTERVAL_LAST_WEEK: - $this->startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-7+$startWeekBias,$t_arr[5])); - $this->endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-1+$startWeekBias,$t_arr[5])); - break; - case INTERVAL_THIS_MONTH: - $this->startDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,1,$t_arr[5])); - $this->endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); - break; - case INTERVAL_LAST_MONTH: - $this->startDate->setTimestamp(mktime(0,0,0,$t_arr[4],1,$t_arr[5])); - $this->endDate->setTimestamp(mktime(0,0,0,$t_arr[4]+1,0,$t_arr[5])); - break; - - case INTERVAL_THIS_YEAR: - $this->startDate->setTimestamp(mktime(0, 0, 0, 1, 1, $t_arr[5])); - $this->endDate->setTimestamp(mktime(0, 0, 0, 12, 31, $t_arr[5])); - break; - } - } - - function setPeriod($b_date, $e_date) { - $this->startDate = $b_date; - $this->endDate = $e_date; - } - - // return date string - function getStartDate($format="") { - return $this->startDate->toString($format); - } - - // return date string - function getEndDate($format="") { - return $this->endDate->toString($format); - } -} diff --git a/WEB-INF/lib/ttTimesheetHelper.class.php b/WEB-INF/lib/ttTimesheetHelper.class.php index 5ca3abe6..ec2032ef 100644 --- a/WEB-INF/lib/ttTimesheetHelper.class.php +++ b/WEB-INF/lib/ttTimesheetHelper.class.php @@ -4,6 +4,8 @@ import('ttUserHelper'); import('ttFileHelper'); +import('ttPeriod'); +import('ttDate'); // Class ttTimesheetHelper is used to help with project related tasks. class ttTimesheetHelper { @@ -545,15 +547,15 @@ static function getMatchingTimesheets($options) { // Determine start and end dates. $dateFormat = $user->getDateFormat(); if ($options['period']) - $period = new Period($options['period'], new DateAndTime($dateFormat)); + $period = new ttPeriod(new ttDate(), $options['period']); else { - $period = new Period(); + $period = new ttPeriod(new ttDate()); $period->setPeriod( - new DateAndTime($dateFormat, $options['period_start']), - new DateAndTime($dateFormat, $options['period_end'])); + new ttDate($options['period_start'], $dateFormat), + new ttDate($options['period_end'], $dateFormat)); } - $start = $period->getStartDate(DB_DATEFORMAT); - $end = $period->getEndDate(DB_DATEFORMAT); + $start = $period->getStartDate(); + $end = $period->getEndDate(); $result = false; $sql = "select id, name from tt_timesheets". diff --git a/initialize.php b/initialize.php index 88849a73..242fa0ab 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5705"); +define("APP_VERSION", "1.21.4.5706"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 87386884d31673d31421cfb331f0957dc28ae971 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 16:45:51 +0000 Subject: [PATCH 187/304] Incremental refactoring. --- WEB-INF/lib/ttInvoiceHelper.class.php | 8 ++++---- WEB-INF/lib/ttReportHelper.class.php | 4 ++-- WEB-INF/lib/ttTimesheetHelper.class.php | 2 +- initialize.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/ttInvoiceHelper.class.php b/WEB-INF/lib/ttInvoiceHelper.class.php index 9a20730a..3fa4f2ce 100644 --- a/WEB-INF/lib/ttInvoiceHelper.class.php +++ b/WEB-INF/lib/ttInvoiceHelper.class.php @@ -226,11 +226,11 @@ static function invoiceableItemsExist($fields) { $client_id = (int) $fields['client_id']; - $start_date = new DateAndTime($user->date_format, $fields['start_date']); - $start = $start_date->toString(DB_DATEFORMAT); + $start_date = new ttDate($fields['start_date'], $user->getDateFormat()); + $start = $start_date->toString(); - $end_date = new DateAndTime($user->date_format, $fields['end_date']); - $end = $end_date->toString(DB_DATEFORMAT); + $end_date = new ttDate($fields['end_date'], $user->getDateFormat()); + $end = $end_date->toString(); $project_id = null; $project_part = ''; diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 995cfa2b..693fe652 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -118,7 +118,7 @@ static function getWhere($options) { // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); - if ($options['period']) + if (isset($options['period']) && $options['period']) $period = new ttPeriod(new ttDate(), $options['period']); else { $period = new ttPeriod(new ttDate()); @@ -200,7 +200,7 @@ static function getExpenseWhere($options) { // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); - if ($options['period']) + if (isset($options['period']) && $options['period']) $period = new ttPeriod(new ttDate(), $options['period']); else { $period = new ttPeriod(new ttDate()); diff --git a/WEB-INF/lib/ttTimesheetHelper.class.php b/WEB-INF/lib/ttTimesheetHelper.class.php index ec2032ef..070d31d7 100644 --- a/WEB-INF/lib/ttTimesheetHelper.class.php +++ b/WEB-INF/lib/ttTimesheetHelper.class.php @@ -546,7 +546,7 @@ static function getMatchingTimesheets($options) { // Determine start and end dates. $dateFormat = $user->getDateFormat(); - if ($options['period']) + if (isset($options['period']) && $options['period']) $period = new ttPeriod(new ttDate(), $options['period']); else { $period = new ttPeriod(new ttDate()); diff --git a/initialize.php b/initialize.php index 242fa0ab..ee6c4692 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5706"); +define("APP_VERSION", "1.21.4.5707"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From a299407343dd43cb46a90ac3063fa9bcc5b7d700 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 17:01:00 +0000 Subject: [PATCH 188/304] A bit more refactoring. --- WEB-INF/lib/ttInvoiceHelper.class.php | 17 ++++++++--------- initialize.php | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/WEB-INF/lib/ttInvoiceHelper.class.php b/WEB-INF/lib/ttInvoiceHelper.class.php index 3fa4f2ce..2ac63db4 100644 --- a/WEB-INF/lib/ttInvoiceHelper.class.php +++ b/WEB-INF/lib/ttInvoiceHelper.class.php @@ -3,7 +3,7 @@ License: See license.txt */ import('ttClientHelper'); -import('DateAndTime'); +import('ttDate'); // Class ttInvoiceHelper is used for help with invoices. class ttInvoiceHelper { @@ -159,9 +159,8 @@ static function getInvoiceItems($invoice_id) { $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { - $dt = new DateAndTime(DB_DATEFORMAT); while ($val = $res->fetchRow()) { - $dt->parseVal($val['date']); + $dt = new ttDate($val['date']); $val['date'] = $dt->toString($user->getDateFormat()); $result[] = $val; } @@ -304,14 +303,14 @@ static function createInvoice($fields) { $client_id = (int) $fields['client_id']; - $invoice_date = new DateAndTime($user->date_format, $fields['date']); - $date = $invoice_date->toString(DB_DATEFORMAT); + $invoice_date = new ttDate($fields['date'], $user->getDateFormat()); + $date = $invoice_date->toString(); - $start_date = new DateAndTime($user->date_format, $fields['start_date']); - $start = $start_date->toString(DB_DATEFORMAT); + $start_date = new ttDate($fields['start_date'], $user->getDateFormat()); + $start = $start_date->toString(); - $end_date = new DateAndTime($user->date_format, $fields['end_date']); - $end = $end_date->toString(DB_DATEFORMAT); + $end_date = new ttDate($fields['end_date'], $user->getDateFormat()); + $end = $end_date->toString(); $project_id = null; $project_part = ''; diff --git a/initialize.php b/initialize.php index ee6c4692..97e7b770 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5707"); +define("APP_VERSION", "1.21.4.5708"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From d17164a8ecd5880d4b16a5eff98bd130566bc5ce Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 17:54:04 +0000 Subject: [PATCH 189/304] More progress with refactoring. --- WEB-INF/lib/ttTimesheetHelper.class.php | 24 ++++++++++++------------ initialize.php | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/WEB-INF/lib/ttTimesheetHelper.class.php b/WEB-INF/lib/ttTimesheetHelper.class.php index 070d31d7..16d74029 100644 --- a/WEB-INF/lib/ttTimesheetHelper.class.php +++ b/WEB-INF/lib/ttTimesheetHelper.class.php @@ -47,11 +47,11 @@ static function createTimesheet($fields) $name = $fields['name']; $comment = $fields['comment']; - $start_date = new DateAndTime($user->date_format, $fields['start_date']); - $start = $start_date->toString(DB_DATEFORMAT); + $start_date = new ttDate($fields['start_date'], $user->getDateFormat()); + $start = $start_date->toString(); - $end_date = new DateAndTime($user->date_format, $fields['end_date']); - $end = $end_date->toString(DB_DATEFORMAT); + $end_date = new ttDate($fields['end_date'], $user->getDateFormat()); + $end = $end_date->toString(); $created_part = ', now(), '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', '.$user->id; @@ -448,11 +448,11 @@ static function timesheetItemsExist($fields) { if (isset($fields['client_id'])) $client_id = (int) $fields['client_id']; if (isset($fields['project_id'])) $project_id = (int) $fields['project_id']; - $start_date = new DateAndTime($user->date_format, $fields['start_date']); - $start = $start_date->toString(DB_DATEFORMAT); + $start_date = new ttDate($fields['start_date'], $user->getDateFormat()); + $start = $start_date->toString(); - $end_date = new DateAndTime($user->date_format, $fields['end_date']); - $end = $end_date->toString(DB_DATEFORMAT); + $end_date = new ttDate($fields['end_date'], $user->getDateFormat()); + $end = $end_date->toString(); // sql parts. $client_part = $project_part = ''; @@ -488,12 +488,12 @@ static function overlaps($fields) { if (isset($fields['client_id'])) $client_id = (int) $fields['client_id']; if (isset($fields['project_id'])) $project_id = (int) $fields['project_id']; - $start_date = new DateAndTime($user->date_format, $fields['start_date']); - $start = $start_date->toString(DB_DATEFORMAT); + $start_date = new ttDate($fields['start_date'], $user->getDateFormat()); + $start = $start_date->toString(); $quoted_start = $mdb2->quote($start); - $end_date = new DateAndTime($user->date_format, $fields['end_date']); - $end = $end_date->toString(DB_DATEFORMAT); + $end_date = new ttDate($fields['end_date'], $user->getDateFormat()); + $end = $end_date->toString(); $quoted_end = $mdb2->quote($end); // sql parts. diff --git a/initialize.php b/initialize.php index 97e7b770..b567181c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5708"); +define("APP_VERSION", "1.21.4.5709"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 24d68b74cec8556cb594366e59a75d2107ff1e3c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 19:29:44 +0000 Subject: [PATCH 190/304] Fixed loading fav reports. --- WEB-INF/lib/form/ActionForm.class.php | 8 ++++---- WEB-INF/lib/ttFavReportHelper.class.php | 9 +++++---- initialize.php | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/WEB-INF/lib/form/ActionForm.class.php b/WEB-INF/lib/form/ActionForm.class.php index 5b88292c..253091b4 100644 --- a/WEB-INF/lib/form/ActionForm.class.php +++ b/WEB-INF/lib/form/ActionForm.class.php @@ -88,8 +88,8 @@ function setAttribute($name,$value) { if ($this->mForm) { if (isset($this->mForm->elements[$name])) { if ($this->mForm->elements[$name]->class=="DateField") { - // TODO: It appears that we never get here. Refactor this entire class. - $dt = new ttDate($user->date_format, $value); + // We get here when loading a fav report. Refactor this entire class. + $dt = new ttDate($value, $user->getDateFormat()); $value = $dt->toString(); } $this->mForm->elements[$name]->setValueSafe($value); @@ -118,8 +118,8 @@ function setAttributes($value) { if ($this->mForm) { if (isset($this->mForm->elements[$name])) { if ($this->mForm->elements[$name]->class=="DateField") { - // TODO: It appears that we never get here. Refactor this entire class. - $dt = new ttDate($user->date_format, $value); + // We get here when changing to --- no --- fav report. Refactor this entire class. + $dt = new ttDate($value, $user->getDateFormat()); $value = $dt->toString(); } $this->mForm->elements[$name]->setValueSafe($value); diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 303750d6..9e1827e0 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -3,6 +3,7 @@ License: See license.txt */ import('ttGroupHelper'); +import('ttDate'); // Class ttFavReportHelper is used to help with favorite report related tasks. class ttFavReportHelper { @@ -212,12 +213,12 @@ static function saveReport($bean) { } if ($bean->getAttribute('start_date')) { - $dt = new DateAndTime($user->getDateFormat(), $bean->getAttribute('start_date')); - $from = $dt->toString(DB_DATEFORMAT); + $dt = new ttDate($bean->getAttribute('start_date'), $user->getDateFormat()); + $from = $dt->toString(); } if ($bean->getAttribute('end_date')) { - $dt = new DateAndTime($user->getDateFormat(), $bean->getAttribute('end_date')); - $to = $dt->toString(DB_DATEFORMAT); + $dt = new ttDate($bean->getAttribute('end_date'), $user->getDateFormat()); + $to = $dt->toString(); } $fields = array( diff --git a/initialize.php b/initialize.php index b567181c..17750f01 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.4.5709"); +define("APP_VERSION", "1.21.5.5710"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 7478a60d4496328cf020a94c6e8b5b02aece11ab Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 11 Apr 2022 20:41:55 +0000 Subject: [PATCH 191/304] Refactoring. Finished replacing older DateAndTime class with newer ttDate class. --- WEB-INF/lib/DateAndTime.class.php | 348 ------------------------ WEB-INF/lib/form/DateField.class.php | 14 +- WEB-INF/lib/ttDate.class.php | 1 - WEB-INF/lib/ttFavReportHelper.class.php | 4 +- 4 files changed, 7 insertions(+), 360 deletions(-) delete mode 100644 WEB-INF/lib/DateAndTime.class.php diff --git a/WEB-INF/lib/DateAndTime.class.php b/WEB-INF/lib/DateAndTime.class.php deleted file mode 100644 index e7224598..00000000 --- a/WEB-INF/lib/DateAndTime.class.php +++ /dev/null @@ -1,348 +0,0 @@ -$sDate parsed, or false on error. - */ - -function my_strptime($sDate, $sFormat) -{ - $aResult = array - ( - 'tm_sec' => 0, - 'tm_min' => 0, - 'tm_hour' => 0, - 'tm_mday' => 1, - 'tm_mon' => 0, - 'tm_year' => 0, - 'tm_wday' => 0, - 'tm_yday' => 0, - 'unparsed' => $sDate, - ); - - while($sFormat != "") - { - // ===== Search a %x element, Check the static string before the %x ===== - $nIdxFound = strpos($sFormat, '%'); - if($nIdxFound === false) - { - - // There is no more format. Check the last static string. - $aResult['unparsed'] = ($sFormat == $sDate) ? "" : $sDate; - break; - } - - $sFormatBefore = mb_substr($sFormat, 0, $nIdxFound); - $sDateBefore = mb_substr($sDate, 0, $nIdxFound); - - if($sFormatBefore != $sDateBefore) break; - - // ===== Read the value of the %x found ===== - $sFormat = mb_substr($sFormat, $nIdxFound); - $sDate = mb_substr($sDate, $nIdxFound); - - $aResult['unparsed'] = $sDate; - - $sFormatCurrent = mb_substr($sFormat, 0, 2); - $sFormatAfter = mb_substr($sFormat, 2); - - $nValue = -1; - $sDateAfter = ""; - switch($sFormatCurrent) - { - case '%S': // Seconds after the minute (0-59) - - sscanf($sDate, "%2d%[^\\n]", $nValue, $sDateAfter); - - if(($nValue < 0) || ($nValue > 59)) return false; - - $aResult['tm_sec'] = $nValue; - break; - - // ---------- - case '%M': // Minutes after the hour (0-59) - sscanf($sDate, "%2d%[^\\n]", $nValue, $sDateAfter); - - if(($nValue < 0) || ($nValue > 59)) return false; - - $aResult['tm_min'] = $nValue; - break; - - // ---------- - case '%H': // Hour since midnight (0-23) - sscanf($sDate, "%2d%[^\\n]", $nValue, $sDateAfter); - - if(($nValue < 0) || ($nValue > 23)) return false; - - $aResult['tm_hour'] = $nValue; - break; - - // ---------- - case '%d': // Day of the month (1-31) - sscanf($sDate, "%2d%[^\\n]", $nValue, $sDateAfter); - - if(($nValue < 1) || ($nValue > 31)) return false; - - $aResult['tm_mday'] = $nValue; - break; - - // ---------- - case '%m': // Months since January (0-11) - sscanf($sDate, "%2d%[^\\n]", $nValue, $sDateAfter); - - if(($nValue < 1) || ($nValue > 12)) return false; - - $aResult['tm_mon'] = ($nValue - 1); - break; - - // ---------- - case '%Y': // Years since 1900 - sscanf($sDate, "%4d%[^\\n]", $nValue, $sDateAfter); - - if($nValue < 1900) return false; - - $aResult['tm_year'] = ($nValue - 1900); - break; - - // ---------- - default: - //sscanf($sDate, "%s%[^\\n]", $skip, $sDateAfter); - preg_match('/^(.+)(\s|$)/uU', $sDate, $matches); - if (isset($matches[1])) { - $sDateAfter = mb_substr($sDate, mb_strlen($matches[1])); - } else { - $sDateAfter = ''; - } - //break 2; // Break Switch and while - break; - } - - // ===== Next please ===== - $sFormat = $sFormatAfter; - $sDate = $sDateAfter; - - $aResult['unparsed'] = $sDate; - - } // END while($sFormat != "") - - - // ===== Create the other value of the result array ===== - $nParsedDateTimestamp = mktime($aResult['tm_hour'], $aResult['tm_min'], $aResult['tm_sec'], - $aResult['tm_mon'] + 1, $aResult['tm_mday'], $aResult['tm_year'] + 1900); - - // Before PHP 5.1 return -1 when error - if(($nParsedDateTimestamp === false) - ||($nParsedDateTimestamp === -1)) return false; - - $aResult['tm_wday'] = (int) strftime("%w", $nParsedDateTimestamp); // Days since Sunday (0-6) - $aResult['tm_yday'] = (strftime("%j", $nParsedDateTimestamp) - 1); // Days since January 1 (0-365) - - return $aResult; -} // END of function - -class DateAndTime { - var $mHour = 0; - var $mMinute = 0; - var $mSecond = 0; - var $mMonth; - var $mDay; // day of week - var $mDate; // day of month - var $mYear; - var $mIntrFormat = "%d.%m.%Y %H:%M:%S"; //29.02.2004 16:21:42 internal format date - var $mLocalFormat; - var $mParseResult = 0; - var $mAutoComplete = true; - - /** - * Constructor - * - * @param String $format - * @param String $strfDateTime - * @return DateAndTime - */ - function __construct($format="",$strfDateTime="") { - $this->mLocalFormat = ($format ? $format : $this->mIntrFormat); - $d = ($strfDateTime ? $strfDateTime : $this->do_strftime($this->mLocalFormat)); - $this->parseVal($d); - } - - function setFormat($format) { - $this->mLocalFormat = $format; - } - - function getFormat() { - return $this->mLocalFormat; - } - - //01 to 31 - function getDate() { return $this->mDate; } - - //0 (for Sunday) through 6 (for Saturday) - function getDay() { return $this->mDay; } - - //01 through 12 - function getMonth() { return $this->mMonth; } - - //1999 or 2003 - function getYear() { return $this->mYear; } - - function setDate($value) { $this->mDate = $value; } - function setMonth($value) { $this->mMonth = $value; } - function setYear($value) { $this->mYear = $value; } - - function setTimestamp($ts) { - $this->mDate = date("d",$ts); - $this->mDay = date("w",$ts); - $this->mMonth = date("m",$ts); - $this->mYear = date("Y",$ts); - $this->mHour = date("H",$ts); - $this->mMinute = date("i",$ts); - $this->mSecond = date("s",$ts); - } - - /** - * Return UNIX timestamp - */ - function getTimestamp() { - return @mktime($this->mHour, $this->mMinute, $this->mSecond, $this->mMonth, $this->mDate, $this->mYear); - } - - function compare($datetime) { - $ts1 = $this->getTimestamp(); - $ts2 = $datetime->getTimestamp(); - if ($ts1<$ts2) return -1; - if ($ts1==$ts2) return 0; - if ($ts1>$ts2) return 1; - } - - function toString($format="") { - if ($this->mParseResult==0) { - if ($format) { - return $this->do_strftime($format, $this->getTimestamp()); - } else { - return $this->do_strftime($this->mLocalFormat, $this->getTimestamp()); - } - } else { - if ($format) { - return $this->do_strftime($format); - } else { - return $this->do_strftime($this->mLocalFormat); - } - } - } - - function parseVal($szDate, $format="") { - $useformat = ($format ? $format : $this->mLocalFormat); - $res = my_strptime($szDate, $useformat); - if ($res !== false) { - $this->mDate = $res['tm_mday']; - $this->mDay = $res['tm_wday']; - $this->mMonth = $res['tm_mon'] + 1; // tm_mon - Months since January (0-11) - $this->mYear = 1900 + $res['tm_year']; // tm_year - Years since 1900 - $this->mHour = $res['tm_hour']; - $this->mMinute = $res['tm_min']; - $this->mSecond = $res['tm_sec']; - $this->mParseResult = 0; - } elseif ($this->mAutoComplete) { - $this->setTimestamp(time()); - $this->mParseResult = 1; - } - } - - function isError() { - if ($this->mParseResult != 0) return true; - return false; - } - - function before(/*DateAndTime*/ $obj) { - if ($this->getTimestamp() < $obj->getTimestamp()) return true; - return false; - } - - function after(/*DateAndTime*/ $obj) { - if ($this->getTimestamp() > $obj->getTimestamp()) return true; - return false; - } - - function equals(/*DateAndTime*/ $obj) { - if ($this->getTimestamp() == $obj->getTimestamp()) return true; - return false; - } - - function decDay(/*int*/$days=1) { - $this->setTimestamp(@mktime($this->mHour, $this->mMinute, $this->mSecond, $this->mMonth, $this->mDate - $days, $this->mYear)); - } - - function incDay(/*int*/$days=1) { - $this->setTimestamp(@mktime($this->mHour, $this->mMinute, $this->mSecond, $this->mMonth, $this->mDate + $days, $this->mYear)); - } - - /** - * @param $format string Datetime format string - * @return string Preprocessed string with all locale-depended format - * characters replaced by localized i18n strings. - */ - function preprocessFormatString($format) { - global $i18n; - - // replace locale-dependent strings - $format = str_replace('%a', mb_substr($i18n->getWeekDayName($this->mDay), 0, 3, 'utf-8'), $format); - $format = str_replace('%A', $i18n->getWeekDayName($this->mDay), $format); - /* This block is commented out because we currently do not use these formatters. - $abbrev_month = mb_substr($i18n->monthNames[$this->mMonth], 0, 3, 'utf-8'); - $format = str_replace('%b', $abbrev_month, $format); - $format = str_replace('%h', $abbrev_month, $format); - $format = str_replace('%z', date('O'), $format); - $format = str_replace('%Z', date('O'), $format); // format as 'O' for consistency with JS strftime - if (strpos($format, '%c') !== false) { - $format = str_replace('%c', $this->preprocessFormatString('%a %d %b %Y %T %Z'), $format); - }*/ - return $format; - } - - function do_strftime($format, $timestamp = null) - { - if (!is_null($timestamp)) { - return strftime($this->preprocessFormatString($format), $timestamp); - } else { - return strftime($this->preprocessFormatString($format)); - } - } -} diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index 922e8bf5..d349d568 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -3,20 +3,18 @@ License: See license.txt */ import('form.TextField'); -import('DateAndTime'); +import('ttDate'); class DateField extends TextField { var $mWeekStartDay = 0; var $mDateFormat = "d/m/Y"; var $lToday = "Today"; - var $mDateObj; var $lCalendarButtons = array('today'=>'Today', 'close'=>'Close'); function __construct($name) { $this->class = 'DateField'; $this->name = $name; - $this->mDateObj = new DateAndTime(); $this->localize(); } @@ -24,8 +22,6 @@ function localize() { global $user; global $i18n; - $this->mDateObj->setFormat($user->getDateFormat()); - $this->mMonthNames = $i18n->monthNames; $this->mWeekDayShortNames = $i18n->weekdayShortNames; $this->lToday = $i18n->get('label.today'); @@ -39,15 +35,15 @@ function localize() { // set current value taken from session or database function setValueSafe($value) { if (isset($value) && (strlen($value) > 0)) { - $this->mDateObj->parseVal($value, DB_DATEFORMAT); - $this->value = $this->mDateObj->toString($this->mDateFormat); //? + $ttDate = new ttDate($value); + $this->value = $ttDate->toString($this->mDateFormat); } } // get value for storing in session or database function getValueSafe() { if (strlen($this->value)>0) { - $this->mDateObj->parseVal($this->value, $this->mDateFormat); //? - return $this->mDateObj->toString(DB_DATEFORMAT); + $ttDate = new ttDate($this->value, $this->mDateFormat); + return $ttDate->toString(); } else { return null; } diff --git a/WEB-INF/lib/ttDate.class.php b/WEB-INF/lib/ttDate.class.php index 3b798214..25dc4874 100644 --- a/WEB-INF/lib/ttDate.class.php +++ b/WEB-INF/lib/ttDate.class.php @@ -5,7 +5,6 @@ import('I18n'); // ttDate class is used to represent a date in Time Tracker. -// It is a planned replacement for DateAndTime class, which is problematic with php8.1. class ttDate { var $year; // year diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 9e1827e0..3de0c94c 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -340,11 +340,11 @@ static function loadReport(&$bean) { $bean->setAttribute('users_inactive', explode(',', $val['users'])); $bean->setAttribute('period', $val['period']); if ($val['period_start']) { - $dt = new DateAndTime(DB_DATEFORMAT, $val['period_start']); + $dt = new ttDate($val['period_start']); $bean->setAttribute('start_date', $dt->toString($user->getDateFormat())); } if ($val['period_end']) { - $dt = new DateAndTime(DB_DATEFORMAT, $val['period_end']); + $dt = new ttDate($val['period_end']); $bean->setAttribute('end_date', $dt->toString($user->getDateFormat())); } $bean->setAttribute('chclient', $val['show_client']); From 886f8979d84e84a4b67207ec512d5e794f34e455 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 15 Apr 2022 14:19:03 +0000 Subject: [PATCH 192/304] Fixed ttUser::getUserDetails to work on top managers in subgroups. --- WEB-INF/lib/ttUser.class.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 7114bc7c..e0565b3d 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -603,7 +603,7 @@ function getUserDetails($user_id) { // Determine max rank. If we are searching in on behalf group // then rank restriction does not apply. - $max_rank = $this->behalfGroup ? MAX_RANK : $this->rank; + $max_rank = $this->behalfGroup ? MAX_RANK + 1 : $this->rank; $sql = "select u.id, u.name, u.login, u.role_id, u.client_id, u.status, u.rate, u.quota_percent, u.email from tt_users u". " left join tt_roles r on (u.role_id = r.id)". diff --git a/initialize.php b/initialize.php index 17750f01..8709beed 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5710"); +define("APP_VERSION", "1.21.5.5712"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From b292d803a1bd81bb82cff089e7d19e2786e7319a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 15 Apr 2022 16:02:52 +0000 Subject: [PATCH 193/304] Fixed browser_today population on time.php. --- WEB-INF/templates/time.tpl | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/time.tpl b/WEB-INF/templates/time.tpl index b04959cf..6f6f7394 100644 --- a/WEB-INF/templates/time.tpl +++ b/WEB-INF/templates/time.tpl @@ -122,7 +122,7 @@ function handleStop(buttonElement) { {if $time_records} - +
{$i18n.label.files} + {if $record.approved || $record.timesheet_id || $record.invoice_id}   {else} + {if ($record.duration == '0:00' && $record.start <> '')} + + {/if} {$i18n.label.edit} {/if}
diff --git a/initialize.php b/initialize.php index 8709beed..b5707136 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5712"); +define("APP_VERSION", "1.21.5.5713"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From e5a3f1ce50205b3fa4b6bc1ca3570ab29e75d101 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 15 Apr 2022 18:06:47 +0000 Subject: [PATCH 194/304] Improved a check for browser today. --- WEB-INF/lib/common.lib.php | 16 ++++++++++++++++ expense_edit.php | 2 +- expenses.php | 2 +- initialize.php | 2 +- puncher.php | 2 +- time.php | 4 ++-- time_edit.php | 2 +- week.php | 2 +- 8 files changed, 24 insertions(+), 8 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 2d8e287d..52d82ed3 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -308,6 +308,22 @@ function ttValidDbDateFormatDate($val) return checkdate($date_parts[1], $date_parts[2], $date_parts[0]); } +// ttValidBrowserToday is used to check browser today parameter for sanity. +function ttValidBrowserToday($val) +{ + if (!ttValidDbDateFormatDate($val)) + return false; + + // Check if browser today is after server tomorrow. + $browser_today = new ttDate($val); + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($browser_today->after($server_tomorrow)) + return false; + + return true; +} + // ttValidTime is used to check user input for time post. function ttValidTime($val) { diff --git a/expense_edit.php b/expense_edit.php index e57db88d..0281c2cf 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -30,7 +30,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } diff --git a/expenses.php b/expenses.php index 34169b7d..b86c34d5 100644 --- a/expenses.php +++ b/expenses.php @@ -47,7 +47,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } diff --git a/initialize.php b/initialize.php index b5707136..f91645a7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5713"); +define("APP_VERSION", "1.21.5.5714"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 2b25462d..b959dcfb 100644 --- a/puncher.php +++ b/puncher.php @@ -24,7 +24,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } diff --git a/time.php b/time.php index faf064a4..32920344 100644 --- a/time.php +++ b/time.php @@ -41,7 +41,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } @@ -59,7 +59,7 @@ // Validate that browser_date parameter is in correct format. $browser_date = $request->getParameter('browser_date'); - if ($browser_date && !ttValidDbDateFormatDate($browser_date)) { + if ($browser_date && !ttValidBrowserToday($browser_date)) { header('Location: access_denied.php'); exit(); } diff --git a/time_edit.php b/time_edit.php index 03c72119..ad673ffe 100644 --- a/time_edit.php +++ b/time_edit.php @@ -27,7 +27,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } diff --git a/week.php b/week.php index 92eb95ee..cb3a1d9f 100644 --- a/week.php +++ b/week.php @@ -47,7 +47,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { + if ($browser_today && !ttValidBrowserToday($browser_today)) { header('Location: access_denied.php'); exit(); } From aa5adfb54c3823b3172280be5914534e98279587 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 16 Apr 2022 13:24:42 +0000 Subject: [PATCH 195/304] Improved handling of future entries by tolerating out of time synced browsers. --- WEB-INF/lib/common.lib.php | 16 ---------------- expense_edit.php | 6 ++++-- expenses.php | 6 ++++-- initialize.php | 2 +- puncher.php | 2 +- time.php | 8 +++++--- time_edit.php | 6 ++++-- week.php | 2 +- 8 files changed, 20 insertions(+), 28 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 52d82ed3..2d8e287d 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -308,22 +308,6 @@ function ttValidDbDateFormatDate($val) return checkdate($date_parts[1], $date_parts[2], $date_parts[0]); } -// ttValidBrowserToday is used to check browser today parameter for sanity. -function ttValidBrowserToday($val) -{ - if (!ttValidDbDateFormatDate($val)) - return false; - - // Check if browser today is after server tomorrow. - $browser_today = new ttDate($val); - $server_tomorrow = new ttDate(); - $server_tomorrow->incrementDay(); - if ($browser_today->after($server_tomorrow)) - return false; - - return true; -} - // ttValidTime is used to check user input for time post. function ttValidTime($val) { diff --git a/expense_edit.php b/expense_edit.php index 0281c2cf..98098a19 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -30,7 +30,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } @@ -155,7 +155,9 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { $browser_today = new ttDate($request->getParameter('browser_today', null)); - if ($new_date->after($browser_today)) + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($new_date->after($browser_today) || $new_date->after($server_tomorrow)) $err->add($i18n->get('error.future_date')); } if (!ttTimeHelper::canAdd()) $err->add($i18n->get('error.expired')); diff --git a/expenses.php b/expenses.php index b86c34d5..ba091a63 100644 --- a/expenses.php +++ b/expenses.php @@ -47,7 +47,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } @@ -203,7 +203,9 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { $browser_today = new ttDate($request->getParameter('browser_today', null)); - if ($selected_date->after($browser_today)) + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($selected_date->after($browser_today) || $selected_date->after($server_tomorrow)) $err->add($i18n->get('error.future_date')); } // Finished validating input data. diff --git a/initialize.php b/initialize.php index f91645a7..a67bd344 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5714"); +define("APP_VERSION", "1.21.5.5715"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index b959dcfb..2b25462d 100644 --- a/puncher.php +++ b/puncher.php @@ -24,7 +24,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } diff --git a/time.php b/time.php index 32920344..766ee5fd 100644 --- a/time.php +++ b/time.php @@ -41,7 +41,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } @@ -59,7 +59,7 @@ // Validate that browser_date parameter is in correct format. $browser_date = $request->getParameter('browser_date'); - if ($browser_date && !ttValidBrowserToday($browser_date)) { + if ($browser_date && !ttValidDbDateFormatDate($browser_date)) { header('Location: access_denied.php'); exit(); } @@ -417,7 +417,9 @@ // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { $browser_today = new ttDate($request->getParameter('browser_today', null)); - if ($selected_date->after($browser_today)) + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($selected_date->after($browser_today) || $selected_date->after($server_tomorrow)) $err->add($i18n->get('error.future_date')); } diff --git a/time_edit.php b/time_edit.php index ad673ffe..7c3491ea 100644 --- a/time_edit.php +++ b/time_edit.php @@ -27,7 +27,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } @@ -332,7 +332,9 @@ // Prohibit creating entries in future. if ($err->no() && !$user->isOptionEnabled('future_entries')) { $browser_today = new ttDate($request->getParameter('browser_today', null)); - if ($new_date->after($browser_today)) + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($new_date->after($browser_today) || $new_date->after($server_tomorrow)) $err->add($i18n->get('error.future_date')); } diff --git a/week.php b/week.php index cb3a1d9f..92eb95ee 100644 --- a/week.php +++ b/week.php @@ -47,7 +47,7 @@ if ($request->isPost()) { // Validate that browser_today parameter is in correct format. $browser_today = $request->getParameter('browser_today'); - if ($browser_today && !ttValidBrowserToday($browser_today)) { + if ($browser_today && !ttValidDbDateFormatDate($browser_today)) { header('Location: access_denied.php'); exit(); } From 855e71a0b04fdc3bc449b961c56dcaa495daec3a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 16 Apr 2022 14:31:43 +0000 Subject: [PATCH 196/304] Cosmetic improvement to handling of future entries. --- WEB-INF/lib/ttWeekViewHelper.class.php | 4 +++- initialize.php | 2 +- puncher.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index deefd8a1..9908d12b 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -504,7 +504,9 @@ static function insertDurationFromWeekView($fields, $custom_fields, $err) { // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries') && $fields['browser_today']) { $objBrowserToday = new ttDate($fields['browser_today']); - if ($objEntryDate->after($objBrowserToday)) { + $server_tomorrow = new ttDate(); + $server_tomorrow->incrementDay(); + if ($objEntryDate->after($objBrowserToday) || $objEntryDate->after($server_tomorrow)) { $err->add($i18n->get('error.future_date')); return false; } diff --git a/initialize.php b/initialize.php index a67bd344..3a99f518 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5715"); +define("APP_VERSION", "1.21.5.5716"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 2b25462d..9714ac24 100644 --- a/puncher.php +++ b/puncher.php @@ -235,9 +235,9 @@ } // Finished validating user input. - // Prohibit creating entries in future. Tricky with a bogus browser_today data in post. + // Prohibit creating entries in future. if (!$user->isOptionEnabled('future_entries')) { - // Just check if the date we are using is after server tomorrow. + // $date_today is already browser_today, just check if the date we are using is after server tomorrow. $server_tomorrow = new ttDate(); $server_tomorrow->incrementDay(); if ($date_today->after($server_tomorrow)) From 38797d661ba091cc7fbb8f92e2a9dc4ef94f8750 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 19 Apr 2022 15:55:49 +0000 Subject: [PATCH 197/304] Introduced an option defining whether or not to show weekends on week view. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/week_view.tpl | 9 +++++++++ initialize.php | 2 +- week.php | 27 ++++++++++++++++++++++++++- week_view.php | 4 ++++ 34 files changed, 74 insertions(+), 2 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 7964ede5..1326d15a 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -243,6 +243,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Només totals', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 5b930374..d65c6dab 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -252,6 +252,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Pouze součty', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 9c4d6c21..3fba7380 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -236,6 +236,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Kun Total', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 2cf17c45..fe487464 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -228,6 +228,8 @@ 'label.mark_paid' => 'Als bezahlt setzen', 'label.week_note' => 'Wochennotiz', 'label.week_list' => 'Wochenliste', +// TODO: translate the following: +// 'label.weekends' => 'Weekends', 'label.work_units' => 'Arbeitseinheiten', 'label.work_units_short' => 'Einheiten', 'label.totals_only' => 'Nur Gesamtstunden', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index bffac8f7..5b433b0a 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -214,6 +214,7 @@ 'label.mark_paid' => 'Mark paid', 'label.week_note' => 'Week note', 'label.week_list' => 'Week list', +'label.weekends' => 'Weekends', 'label.work_units' => 'Work units', 'label.work_units_short' => 'Units', 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 3d16d8e2..f57f5795 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -246,6 +246,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Solo totales', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 849eff78..57b92ff3 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -244,6 +244,8 @@ 'label.mark_paid' => 'Märgi makstuks', 'label.week_note' => 'Nädala märge', 'label.week_list' => 'Nädala nimekiri', +// TODO: translate the following: +// 'label.weekends' => 'Weekends', 'label.work_units' => 'Töö ühikud', 'label.work_units_short' => 'Ühikud', 'label.totals_only' => 'Ainult summad', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index bdddffa4..62b70671 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -248,6 +248,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 074ee794..fa1dd973 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -240,6 +240,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Vain yhteissummat', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 548d6e0c..7472ddf6 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -234,6 +234,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Totaux uniquement', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 4de8f91d..93fb5fba 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -229,6 +229,7 @@ 'label.week_note' => 'Σημείωση εβδομάδας', 'label.week_list' => 'Λίστα εβδομάδων', // TODO: translate the following. +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Σύνολα μόνο', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 6abbd474..388622c2 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -255,6 +255,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'labl.totals_only' => 'סיכומים בלבד', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index b90ffdc5..635147d8 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -249,6 +249,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 34ca3745..55ea5deb 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -233,6 +233,7 @@ 'label.week_note' => 'Nota settimanale', 'label.week_list' => 'Lista settimanale', // TODO: translate the following. +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Solo i totali', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 8794e2ed..0cf54775 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -252,6 +252,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => '全体だけ', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 69f6fd6c..42648461 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -252,6 +252,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => '오직 전체만', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 012f9d14..eacfd5a1 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -209,6 +209,8 @@ 'label.mark_paid' => 'Markeer als betaald', 'label.week_note' => 'Week aantekening', 'label.week_list' => 'Week overzicht', +// TODO: translate the following. +// 'label.weekends' => 'Weekends', 'label.work_units' => 'Werk eenheid', 'label.work_units_short' => 'Eenheid', 'label.totals_only' => 'Alleen totalen', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 9ffef320..dd92cc78 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -252,6 +252,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 430416f5..50ac9c62 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -241,6 +241,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Tylko sumy', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index d156ccda..0b250d69 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -211,6 +211,8 @@ 'label.mark_paid' => 'Marcar como pago', 'label.week_note' => 'Anotação da semana', 'label.week_list' => 'Lista da semana', +// TODO: translate the following. +// 'label.weekends' => 'Weekends', 'label.work_units' => 'Unidades de trabalho', 'label.work_units_short' => 'Unidades', 'label.totals_only' => 'Somente totais', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 4277ff18..e7b16d92 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -238,6 +238,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 755e2c47..b160169d 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -250,6 +250,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Numai totaluri', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 61777ff4..f24aa6f7 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -209,6 +209,7 @@ 'label.mark_paid' => 'Отметить оплату', 'label.week_note' => 'Комментарий недели', 'label.week_list' => 'Список недели', +'label.weekends' => 'Выходные', 'label.work_units' => 'Единицы работы', 'label.work_units_short' => 'Единицы', 'label.totals_only' => 'Только итоги', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index fb8fae3e..ca4f0535 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -244,6 +244,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Iba celkové', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 02e79b40..574c32f0 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -234,6 +234,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 3917fc0a..06867886 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -240,6 +240,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', 'label.totals_only' => 'Samo zbirno', // TODO: translate the following. diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index c638d213..9f5725b8 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -235,6 +235,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Visa endast summeringar', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index c55b901e..f8fa7dd2 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -257,6 +257,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', 'label.totals_only' => 'Sadece toplamlar', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 2550f758..ca1709d3 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -245,6 +245,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 08928dec..c59a87ef 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -250,6 +250,7 @@ // 'label.mark_paid' => 'Mark paid', // 'label.week_note' => 'Week note', // 'label.week_list' => 'Week list', +// 'label.weekends' => 'Weekends', // 'label.work_units' => 'Work units', // 'label.work_units_short' => 'Units', // 'label.totals_only' => 'Totals only', diff --git a/WEB-INF/templates/week_view.tpl b/WEB-INF/templates/week_view.tpl index 3226e0c4..00e6cd1d 100644 --- a/WEB-INF/templates/week_view.tpl +++ b/WEB-INF/templates/week_view.tpl @@ -39,6 +39,15 @@ License: See license.txt *} + + + + + +
{$forms.weekViewForm.weekends.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} +
{$forms.weekViewForm.btn_save.control}
{$forms.weekViewForm.close} diff --git a/initialize.php b/initialize.php index 3a99f518..7b2064ad 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.5.5716"); +define("APP_VERSION", "1.21.6.5717"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index 92eb95ee..302e4dfb 100644 --- a/week.php +++ b/week.php @@ -73,6 +73,7 @@ if ($showTask) $taskRequired = $user->getConfigOption('task_required'); $showWeekNote = $user->isOptionEnabled('week_note'); $showWeekNotes = $user->isOptionEnabled('week_notes'); +$showWeekends = $user->isOptionEnabled('weekends'); $recordType = $user->getRecordType(); $showStart = TYPE_START_FINISH == $recordType || TYPE_ALL == $recordType; $showFiles = $user->isPluginEnabled('at'); @@ -158,6 +159,22 @@ // Get column headers, which are day numbers in month. $dayHeaders = ttWeekViewHelper::getDayHeadersForWeek($startDate->toString()); $lockedDays = ttWeekViewHelper::getLockedDaysForWeek($startDate->toString()); +// If we are not showing weekends, reduce the above arrays to 5 days only. +$weekend_start_idx = $weekend_end_idx = 0; +if (!$showWeekends) { + if (defined('WEEKEND_START_DAY')) { + $weekend_start_idx = (7 + WEEKEND_START_DAY - $weekStartDay) % 7; + $weekend_end_idx = (7 + WEEKEND_START_DAY + 1 - $weekStartDay) % 7; + } else { + $weekend_start_idx = 6 - $weekStartDay; + $weekend_end_idx = (7 - $weekStartDay) % 7; + } + unset($dayHeaders[$weekend_start_idx]); + unset($dayHeaders[$weekend_end_idx]); + unset($lockedDays[$weekend_start_idx]); + unset($lockedDays[$weekend_end_idx]); +} + // Get already existing records. $records = ttWeekViewHelper::getRecordsForInterval($startDate->toString(), $endDate->toString(), $showFiles); // Build data array for the table. Format is described in ttWeekViewHelper::getDataForWeekView function. @@ -273,8 +290,16 @@ function render(&$table, $value, $row, $column, $selected = false) { $table->setData($dataArray); // Add columns to table. $table->addColumn(new TableColumn('label', '', new LabelCellRenderer(), $dayTotals['label'])); + + + for ($i = 0; $i < 7; $i++) { - $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]])); + if ($showWeekends) + $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]])); + else { + if ($i <> $weekend_start_idx && $i <> $weekend_end_idx) + $table->addColumn(new TableColumn($dayHeaders[$i], $dayHeaders[$i], new WeekViewCellRenderer(), $dayTotals[$dayHeaders[$i]])); + } } $table->setInteractive(false); $form->addInputElement($table); diff --git a/week_view.php b/week_view.php index 1718afd4..7db10226 100644 --- a/week_view.php +++ b/week_view.php @@ -18,11 +18,13 @@ $cl_week_note = (bool)$request->getParameter('week_note'); $cl_week_list = (bool)$request->getParameter('week_list'); $cl_notes = (bool)$request->getParameter('notes'); + $cl_weekends = (bool)$request->getParameter('weekends'); } else { $cl_week_menu = $config->getDefinedValue('week_menu'); $cl_week_note = $config->getDefinedValue('week_note'); $cl_week_list = $config->getDefinedValue('week_list'); $cl_notes = $config->getDefinedValue('week_notes'); + $cl_weekends = $config->getDefinedValue('weekends'); } $form = new Form('weekViewForm'); @@ -30,6 +32,7 @@ $form->addInput(array('type'=>'checkbox','name'=>'week_note','value'=>$cl_week_note)); $form->addInput(array('type'=>'checkbox','name'=>'week_list','value'=>$cl_week_list)); $form->addInput(array('type'=>'checkbox','name'=>'notes','value'=>$cl_notes)); +$form->addInput(array('type'=>'checkbox','name'=>'weekends','value'=>$cl_weekends)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); if ($request->isPost()){ @@ -38,6 +41,7 @@ $config->setDefinedValue('week_note', $cl_week_note); $config->setDefinedValue('week_list', $cl_week_list); $config->setDefinedValue('week_notes', $cl_notes); + $config->setDefinedValue('weekends', $cl_weekends); if (!$user->updateGroup(array('config' => $config->getConfig()))) { $err->add($i18n->get('error.db')); } From f3ecd48c47df8af907cb46dec59cdd62793535e6 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 19 Apr 2022 16:00:27 +0000 Subject: [PATCH 198/304] Fixed label in html. --- WEB-INF/templates/week_view.tpl | 4 ++-- initialize.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/week_view.tpl b/WEB-INF/templates/week_view.tpl index 00e6cd1d..9cd7b90a 100644 --- a/WEB-INF/templates/week_view.tpl +++ b/WEB-INF/templates/week_view.tpl @@ -39,9 +39,9 @@ License: See license.txt *}
- + - + {$forms.weekViewForm.weekends.control} {$i18n.label.what_is_it} {$i18n.label.what_is_it} diff --git a/initialize.php b/initialize.php index 7b2064ad..89c734ad 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.6.5717"); +define("APP_VERSION", "1.21.6.5718"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From dcfeafbc71bb9e1329f997bfc7e7b42050174453 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 26 Apr 2022 15:52:14 +0000 Subject: [PATCH 199/304] Dutch translation improved. --- WEB-INF/resources/nl.lang.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index eacfd5a1..949a3ac8 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -209,8 +209,7 @@ 'label.mark_paid' => 'Markeer als betaald', 'label.week_note' => 'Week aantekening', 'label.week_list' => 'Week overzicht', -// TODO: translate the following. -// 'label.weekends' => 'Weekends', +'label.weekends' => 'Weekeinden', 'label.work_units' => 'Werk eenheid', 'label.work_units_short' => 'Eenheid', 'label.totals_only' => 'Alleen totalen', diff --git a/initialize.php b/initialize.php index 89c734ad..53810201 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.6.5718"); +define("APP_VERSION", "1.21.6.5719"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 761d451e6382b59fd96f133b5c9dc9cca3ccb753 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 30 Jun 2022 14:00:35 +0000 Subject: [PATCH 200/304] Starting to work on filtering by notes in reports. --- WEB-INF/resources/ca.lang.php | 2 ++ WEB-INF/resources/cs.lang.php | 2 ++ WEB-INF/resources/da.lang.php | 2 ++ WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 2 ++ WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 2 ++ WEB-INF/resources/fi.lang.php | 2 ++ WEB-INF/resources/fr.lang.php | 2 ++ WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 2 ++ WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 2 ++ WEB-INF/resources/ko.lang.php | 2 ++ WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 2 ++ WEB-INF/resources/pl.lang.php | 2 ++ WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 2 ++ WEB-INF/resources/ro.lang.php | 2 ++ WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 2 ++ WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 2 ++ WEB-INF/resources/sv.lang.php | 2 ++ WEB-INF/resources/tr.lang.php | 2 ++ WEB-INF/resources/zh-cn.lang.php | 2 ++ WEB-INF/resources/zh-tw.lang.php | 2 ++ WEB-INF/templates/reports.tpl | 8 ++++++++ reports.php | 5 +++++ 32 files changed, 69 insertions(+) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 1326d15a..f2eec1b5 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -474,6 +474,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Seleccionar període de temps', 'form.reports.set_period' => 'o establir dates', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Mostrar camps', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index d65c6dab..8573d71c 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -482,6 +482,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Výberte období', 'form.reports.set_period' => 'nebo určete dny', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Zobrazit pole', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 3fba7380..dd1abd39 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -459,6 +459,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Vælg en periode', 'form.reports.set_period' => 'eller sæt datoer', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Vis felter', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index fe487464..e295e728 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -442,6 +442,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Zeitraum auswählen', 'form.reports.set_period' => 'oder Datum eingeben', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Felder anzeigen', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 5b433b0a..5df99c40 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -425,6 +425,7 @@ 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Select time period', 'form.reports.set_period' => 'or set dates', +'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Show fields', 'form.reports.time_fields' => 'Time fields', 'form.reports.user_fields' => 'User fields', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index f57f5795..7c59d3ae 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -487,6 +487,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Seleccionar período de tiempo', 'form.reports.set_period' => 'o establecer fechas', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Mostrar campos', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 57b92ff3..7a53024b 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -472,6 +472,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Vali ajaperiood', 'form.reports.set_period' => 'või märgi kuupäevad', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Näita välju', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 62b70671..2963414e 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -480,6 +480,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'انتخاب بازه زمانی', 'form.reports.set_period' => 'یا تعیین تاریخ', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'نمایش فیلدها', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index fa1dd973..112dc6b6 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -465,6 +465,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Valitse ajanjakso', 'form.reports.set_period' => 'tai aseta päivät', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Näytä kentät', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 7472ddf6..a1268d1a 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -456,6 +456,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Sélectionner la période de temps', 'form.reports.set_period' => 'ou dates indiquées', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Afficher les champs', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 93fb5fba..9f1bf5d9 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -451,6 +451,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Επιλογή χρονικής περιόδου', 'form.reports.set_period' => 'ή εύρος ημερομηνιών', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Εμφάνιση πεδίων', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 388622c2..3167fd8d 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -483,6 +483,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'בחר תקופת זמן', 'form.reports.set_period' => 'או הגדר תאריכים', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'הראה שדות', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 635147d8..636c29d0 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -478,6 +478,7 @@ 'form.reports.select_period' => 'Jelölj meg egy időszakot', 'form.reports.set_period' => 'vagy állíts be konkrét dátumot', // TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', // 'form.reports.show_fields' => 'Show fields', // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 55ea5deb..d517fded 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -464,6 +464,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Seleziona il periodo di tempo', 'form.reports.set_period' => 'oppure setta le date', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Mostra i campi', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 0cf54775..59500e01 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -482,6 +482,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => '時間期間の選択', 'form.reports.set_period' => 'あるいは日付を設定', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'フィールドの表示', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 42648461..e2f16cce 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -480,6 +480,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => '시간 기간을 선택', 'form.reports.set_period' => '혹은 날짜를 설정', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => '필드들을 보기', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 949a3ac8..9f846bc5 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -411,6 +411,8 @@ 'form.reports.include_pending' => 'in afwachting', 'form.reports.select_period' => 'Kies periode', 'form.reports.set_period' => 'of stel datums in', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Toon velden', 'form.reports.time_fields' => 'Tijd velden', 'form.reports.user_fields' => 'Medewerker velden', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index dd92cc78..cba06a82 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -482,6 +482,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Velg tidsperiode', 'form.reports.set_period' => 'eller sett dato', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Vis feltene', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 50ac9c62..3470add1 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -467,6 +467,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Wybierz okres', 'form.reports.set_period' => 'lub ustaw daty', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Pokaż pola', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 0b250d69..60d50576 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -414,6 +414,8 @@ 'form.reports.include_pending' => 'pendente', 'form.reports.select_period' => 'Selecione o período de tempo', 'form.reports.set_period' => 'ou selecionar datas', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Exibir campos', 'form.reports.time_fields' => 'Campos de tempo', 'form.reports.user_fields' => 'Campos de usuário', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index e7b16d92..d5a4413a 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -459,6 +459,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Selecione o período de tempo', 'form.reports.set_period' => 'ou selecionar datas', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Exibir campos', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index b160169d..f450bfd4 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -482,6 +482,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Alege perioada', 'form.reports.set_period' => 'sau introdu intervalul de date', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Arata campuri', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index f24aa6f7..47f87d49 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -412,6 +412,7 @@ 'form.reports.include_pending' => 'в ожидании', 'form.reports.select_period' => 'Выберите интервал времени', 'form.reports.set_period' => 'или укажите даты', +'form.reports.note_containing' => 'Комментарий содержит', 'form.reports.show_fields' => 'Показывать поля', 'form.reports.time_fields' => 'Поля времени', 'form.reports.user_fields' => 'Поля пользователя', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index ca4f0535..1909ec9d 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -470,6 +470,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Vyberte časový rozsah', 'form.reports.set_period' => 'alebo nastavte dátumy', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Zobraziť polia', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 574c32f0..304da23a 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -456,6 +456,7 @@ // 'form.reports.include_pending' => 'pending', // 'form.reports.select_period' => 'Select time period', // 'form.reports.set_period' => 'or set dates', +// 'form.reports.note_containing' => 'Note containing', // 'form.reports.show_fields' => 'Show fields', // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 06867886..d1fb802e 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -467,6 +467,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Odaberi vremenski raspon', 'form.reports.set_period' => 'ili podesi datum', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Prikaži polja u izveštaju', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 9f5725b8..1df983ec 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -465,6 +465,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Välj intervall', 'form.reports.set_period' => 'eller ställ in datum', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Visa fält', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index f8fa7dd2..c6fe800a 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -493,6 +493,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => 'Zaman aralığını seç', 'form.reports.set_period' => 'ya da tarihleri belirle', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => 'Alanları göster', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index ca1709d3..5b701c85 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -471,6 +471,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => '选择时间段', 'form.reports.set_period' => '或设定日期', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => '显示栏目', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index c59a87ef..14ef3c26 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -474,6 +474,8 @@ // 'form.reports.include_pending' => 'pending', 'form.reports.select_period' => '選擇時間段', 'form.reports.set_period' => '或設定日期', +// TODO: translate the following. +// 'form.reports.note_containing' => 'Note containing', 'form.reports.show_fields' => '顯示欄目', // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index aa8e9d63..d2dfcb47 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -358,6 +358,14 @@ License: See license.txt *}
{/if} +{if isTrue('FILTER_BY_NOTES_DEBUG')} + + + + {$forms.reportForm.notes_containing.control} + +
+{/if}
diff --git a/reports.php b/reports.php index 858ca61c..8cf3736b 100644 --- a/reports.php +++ b/reports.php @@ -239,6 +239,11 @@ $form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'start_date')); $form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'end_date')); +// Add control for notes containing. +if (isTrue('FILTER_BY_NOTES_DEBUG')) { + $form->addInput(array('type'=>'text','maxlength'=>'256','name'=>'notes_containing')); +} + // Add checkboxes for "Show fields" block. if ($showClient) $form->addInput(array('type'=>'checkbox','name'=>'chclient')); From a18e57436cb9170c22c6de7128053113913e289e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 6 Jul 2022 19:19:56 +0000 Subject: [PATCH 201/304] Initial implementation of report filter by notes. --- WEB-INF/lib/ttFavReportHelper.class.php | 7 +++++-- WEB-INF/lib/ttReportHelper.class.php | 17 +++++++++++++++-- WEB-INF/templates/reports.tpl | 6 +++--- dbinstall.php | 9 +++++---- initialize.php | 2 +- mysql.sql | 3 ++- reports.php | 2 +- 7 files changed, 32 insertions(+), 14 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 3de0c94c..df756649 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -98,7 +98,7 @@ static function insertReport($fields) { $sql = "insert into tt_fav_reports". " (name, user_id, group_id, org_id, report_spec, client_id, project_id, task_id,". - " billable, approved, invoice, timesheet, paid_status, users, period, period_start,". + " billable, approved, invoice, timesheet, paid_status, note_containing, users, period, period_start,". " period_end, show_client, show_invoice, show_paid, show_ip,". " show_project, show_timesheet, show_start, show_duration, show_cost,". " show_task, show_end, show_note, show_approved, show_work_units,". @@ -110,7 +110,7 @@ static function insertReport($fields) { $mdb2->quote($fields['project']).", ".$mdb2->quote($fields['task']).", ". $mdb2->quote($fields['billable']).", ".$mdb2->quote($fields['approved']).", ". $mdb2->quote($fields['invoice']).", ".$mdb2->quote($fields['timesheet']).", ". - $mdb2->quote($fields['paid_status']).", ". + $mdb2->quote($fields['paid_status']).", ".$mdb2->quote($fields['note_containing']).",". $mdb2->quote($fields['users']).", ".$mdb2->quote($fields['period']).", ". $mdb2->quote($fields['from']).", ".$mdb2->quote($fields['to']).", ". $fields['chclient'].", ".$fields['chinvoice'].", ".$fields['chpaid'].", ".$fields['chip'].", ". @@ -146,6 +146,7 @@ static function updateReport($fields) { "invoice = ".$mdb2->quote($fields['invoice']).", ". "timesheet = ".$mdb2->quote($fields['timesheet']).", ". "paid_status = ".$mdb2->quote($fields['paid_status']).", ". + "note_containing = ".$mdb2->quote($fields['note_containing']).", ". "users = ".$mdb2->quote($fields['users']).", ". "period = ".$mdb2->quote($fields['period']).", ". "period_start = ".$mdb2->quote($fields['from']).", ". @@ -233,6 +234,7 @@ static function saveReport($bean) { 'paid_status'=>$bean->getAttribute('paid_status'), 'invoice'=>$bean->getAttribute('invoice'), 'timesheet'=>$bean->getAttribute('timesheet'), + 'note_containing'=>$bean->getAttribute('note_containing'), 'users'=>$users, 'period'=>$bean->getAttribute('period'), 'from'=>$from, @@ -336,6 +338,7 @@ static function loadReport(&$bean) { $bean->setAttribute('invoice', $val['invoice']); $bean->setAttribute('paid_status', $val['paid_status']); $bean->setAttribute('timesheet', $val['timesheet']); + $bean->setAttribute('note_containing', $val['note_containing']); $bean->setAttribute('users_active', explode(',', $val['users'])); $bean->setAttribute('users_inactive', explode(',', $val['users'])); $bean->setAttribute('period', $val['period']); diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 693fe652..45b6ec1b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -116,6 +116,12 @@ static function getWhere($options) { $user_list_part = " and l.user_id = ".$user->getUser(); $user_list_part .= " and l.group_id = $group_id and l.org_id = $org_id"; + // Prepare part for note_containing using LIKE operator. + $note_containing_part = ''; + if (isset($options['note_containing']) && !empty($options['note_containing'])) { + $note_containing_part = " and l.comment like ".$mdb2->quote('%'.$options['note_containing'].'%'); + } + // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); if (isset($options['period']) && $options['period']) @@ -127,7 +133,7 @@ static function getWhere($options) { new ttDate($options['period_end'], $dateFormat)); } $where = " where l.status = 1 and l.date >= '".$period->getStartDate()."' and l.date <= '".$period->getEndDate()."'". - " $user_list_part $dropdown_parts $cf_text_parts"; + $user_list_part.$dropdown_parts.$cf_text_parts.$note_containing_part; return $where; } @@ -198,6 +204,12 @@ static function getExpenseWhere($options) { $user_list_part = " and ei.user_id = ".$user->getUser(); $user_list_part .= " and ei.group_id = $group_id and ei.org_id = $org_id"; + // Prepare part for note_containing using LIKE operator. + $note_containing_part = ''; + if (isset($options['note_containing']) && !empty($options['note_containing'])) { + $note_containing_part = " and ei.name like ".$mdb2->quote('%'.$options['note_containing'].'%'); + } + // Prepare sql query part for where. $dateFormat = $user->getDateFormat(); if (isset($options['period']) && $options['period']) @@ -209,7 +221,7 @@ static function getExpenseWhere($options) { new ttDate($options['period_end'], $dateFormat)); } $where = " where ei.status = 1 and ei.date >= '".$period->getStartDate()."' and ei.date <= '".$period->getEndDate()."'". - " $user_list_part $dropdown_parts $cf_text_parts"; + $user_list_part.$dropdown_parts.$cf_text_parts.$note_containing_part; return $where; } @@ -1541,6 +1553,7 @@ static function getReportOptions($bean) { $options['period'] = $bean->getAttribute('period'); $options['period_start'] = $bean->getAttribute('start_date'); $options['period_end'] = $bean->getAttribute('end_date'); + $options['note_containing'] = $bean->getAttribute('note_containing'); $options['show_client'] = $bean->getAttribute('chclient'); $options['show_invoice'] = $bean->getAttribute('chinvoice'); $options['show_approved'] = $bean->getAttribute('chapproved'); diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index d2dfcb47..3edec9d8 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -359,10 +359,10 @@ License: See license.txt *} {/if} {if isTrue('FILTER_BY_NOTES_DEBUG')} - + - - + + {/if} diff --git a/dbinstall.php b/dbinstall.php index f8e1b936..bc0db6a0 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1151,7 +1151,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to12102"]) { + if ($_POST["convert11900to12107"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1197,6 +1197,7 @@ function ttGenerateKeys() { ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, ',manage_work', '')"); ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, ',update_work', '')"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.2', modified = now() where param_name = 'version_db' and param_value = '1.21.0'"); + ttExecute("ALTER TABLE tt_fav_reports ADD COLUMN `note_containing` varchar(80) default NULL after `paid_status`"); } if ($_POST["cleanup"]) { @@ -1247,7 +1248,7 @@ function ttGenerateKeys() {

DB Install

{$forms.reportForm.notes_containing.control}{$forms.reportForm.note_containing.control}
-
Create database structure (v1.21.2) + Create database structure (v1.21.7)
(applies only to new installations, do not execute when updating)
@@ -1296,8 +1297,8 @@ function ttGenerateKeys() { - Update database structure (v1.19 to v1.21.2) - + Update database structure (v1.19 to v1.21.7) + diff --git a/initialize.php b/initialize.php index 53810201..7ab83978 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.6.5719"); +define("APP_VERSION", "1.21.7.5720"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index 0856f94a..4fd33fa9 100644 --- a/mysql.sql +++ b/mysql.sql @@ -273,6 +273,7 @@ CREATE TABLE `tt_fav_reports` ( `invoice` tinyint(4) default NULL, # whether to include invoiced, not invoiced, or all records `timesheet` tinyint(4) default NULL, # include records with a specific timesheet status, or all records `paid_status` tinyint(4) default NULL, # whether to include paid, not paid, or all records + `note_containing` varchar(80) default NULL, # include only records with notes containing this text `users` text default NULL, # Comma-separated list of user ids. Nothing here means "all" users. `period` tinyint(4) default NULL, # selected period type for report `period_start` date default NULL, # period start @@ -621,4 +622,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.2', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.7', now()); # TODO: change when structure changes. diff --git a/reports.php b/reports.php index 8cf3736b..0dbc79a8 100644 --- a/reports.php +++ b/reports.php @@ -241,7 +241,7 @@ // Add control for notes containing. if (isTrue('FILTER_BY_NOTES_DEBUG')) { - $form->addInput(array('type'=>'text','maxlength'=>'256','name'=>'notes_containing')); + $form->addInput(array('type'=>'text','maxlength'=>'80','name'=>'note_containing')); } // Add checkboxes for "Show fields" block. From d50ff284a5dcb55e3fd276f5499ef05a700a41a7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 8 Jul 2022 15:56:44 +0000 Subject: [PATCH 202/304] Removed FILTER_BY_NOTES_DEBUG condition. --- WEB-INF/templates/reports.tpl | 2 -- dbinstall.php | 1 + initialize.php | 2 +- reports.php | 4 +--- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 3edec9d8..51c98212 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -358,14 +358,12 @@ License: See license.txt *}
{/if} -{if isTrue('FILTER_BY_NOTES_DEBUG')} {$forms.reportForm.note_containing.control}
-{/if}
diff --git a/dbinstall.php b/dbinstall.php index bc0db6a0..85d3f021 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1198,6 +1198,7 @@ function ttGenerateKeys() { ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.21.0') set rights = replace(rights, ',update_work', '')"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.2', modified = now() where param_name = 'version_db' and param_value = '1.21.0'"); ttExecute("ALTER TABLE tt_fav_reports ADD COLUMN `note_containing` varchar(80) default NULL after `paid_status`"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.7', modified = now() where param_name = 'version_db' and param_value = '1.21.2'"); } if ($_POST["cleanup"]) { diff --git a/initialize.php b/initialize.php index 7ab83978..0eb176f0 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.7.5720"); +define("APP_VERSION", "1.21.7.5721"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index 0dbc79a8..65aba65d 100644 --- a/reports.php +++ b/reports.php @@ -240,9 +240,7 @@ $form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'end_date')); // Add control for notes containing. -if (isTrue('FILTER_BY_NOTES_DEBUG')) { - $form->addInput(array('type'=>'text','maxlength'=>'80','name'=>'note_containing')); -} +$form->addInput(array('type'=>'text','maxlength'=>'80','name'=>'note_containing')); // Add checkboxes for "Show fields" block. if ($showClient) From 01bb80be971ad6c7d685c88c9da0150060eb4ff0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 8 Jul 2022 16:11:18 +0000 Subject: [PATCH 203/304] Fixed export / import for note_containing in fav reports. --- WEB-INF/lib/ttGroupExportHelper.class.php | 1 + WEB-INF/lib/ttOrgExportHelper.class.php | 28 ++--------------------- WEB-INF/lib/ttOrgImportHelper.class.php | 5 ++-- initialize.php | 2 +- 4 files changed, 7 insertions(+), 29 deletions(-) diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index a464f2e2..b7b6491e 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -566,6 +566,7 @@ function writeData() { $fav_report_part .= " invoice=\"".$fav_report['invoice']."\""; $fav_report_part .= " timesheet=\"".$fav_report['timesheet']."\""; $fav_report_part .= " paid_status=\"".$fav_report['paid_status']."\""; + $fav_report_part .= " note_containing=\"".$fav_report['note_containing']."\""; $fav_report_part .= " users=\"".$user_list."\""; $fav_report_part .= " period=\"".$fav_report['period']."\""; $fav_report_part .= " period_start=\"".$fav_report['period_start']."\""; diff --git a/WEB-INF/lib/ttOrgExportHelper.class.php b/WEB-INF/lib/ttOrgExportHelper.class.php index 277eac3a..9380231e 100644 --- a/WEB-INF/lib/ttOrgExportHelper.class.php +++ b/WEB-INF/lib/ttOrgExportHelper.class.php @@ -1,30 +1,6 @@ $attrs['INVOICE'], 'timesheet' => $attrs['TIMESHEET'], 'paid_status' => $attrs['PAID_STATUS'], + 'note_containing' => $attrs['NOTE_CONTAINING'], 'users' => $user_list, 'period' => $attrs['PERIOD'], 'from' => $attrs['PERIOD_START'], @@ -1049,7 +1050,7 @@ private function insertFavReport($fields) { $sql = "insert into tt_fav_reports". " (name, user_id, group_id, org_id, report_spec, client_id, project_id, task_id,". - " billable, approved, invoice, timesheet, paid_status, users, period, period_start, period_end,". + " billable, approved, invoice, timesheet, paid_status, note_containing, users, period, period_start, period_end,". " show_client, show_invoice, show_paid, show_ip,". " show_project, show_timesheet, show_start, show_duration, show_cost,". " show_task, show_end, show_note, show_approved, show_work_units,". @@ -1060,7 +1061,7 @@ private function insertFavReport($fields) { $mdb2->quote($fields['project']).", ".$mdb2->quote($fields['task']).", ". $mdb2->quote($fields['billable']).", ".$mdb2->quote($fields['approved']).", ". $mdb2->quote($fields['invoice']).", ".$mdb2->quote($fields['timesheet']).", ". - $mdb2->quote($fields['paid_status']).", ". + $mdb2->quote($fields['paid_status']).", ".$mdb2->quote($fields['note_containing']).", ". $mdb2->quote($fields['users']).", ".$mdb2->quote($fields['period']).", ". $mdb2->quote($fields['from']).", ".$mdb2->quote($fields['to']).", ". $fields['chclient'].", ".$fields['chinvoice'].", ".$fields['chpaid'].", ".$fields['chip'].", ". diff --git a/initialize.php b/initialize.php index 0eb176f0..183c62f9 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.7.5721"); +define("APP_VERSION", "1.21.7.5722"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 821535bfa70fae447bede1c617e375458dd31751 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 19 Aug 2022 13:45:10 +0000 Subject: [PATCH 204/304] Resolved a few compatibility issues with php8. --- WEB-INF/lib/ttOrgImportHelper.class.php | 6 ++++-- initialize.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 61ed9ec7..92ba6276 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -167,6 +167,7 @@ function startElement($parser, $name, $attrs) { // We get here when processing tags for the current group. // Prepare a list of task ids. + $mapped_tasks = null; if ($attrs['TASKS']) { $tasks = explode(',', $attrs['TASKS']); foreach ($tasks as $id) @@ -193,6 +194,7 @@ function startElement($parser, $name, $attrs) { // We get here when processing tags for the current group. // Prepare a list of project ids. + $mapped_projects = array(); if ($attrs['PROJECTS']) { $projects = explode(',', $attrs['PROJECTS']); foreach ($projects as $id) @@ -218,7 +220,6 @@ function startElement($parser, $name, $attrs) { if ($name == 'USER') { // We get here when processing tags for the current group. - $role_id = $attrs['ROLE_ID'] === '0' ? $this->top_role_id : $this->currentGroupRoleMap[$attrs['ROLE_ID']]; // 0 (not null) means top manager role. $user_id = $this->insertUser(array( @@ -899,7 +900,7 @@ private function insertProject($fields) $org_id = (int) $fields['org_id']; $name = $fields['name']; $description = $fields['description']; - $tasks = $fields['tasks']; + $tasks = isset($fields['tasks']) ? $fields['tasks'] : array(); $comma_separated = implode(',', $tasks); // This is a comma-separated list of associated task ids. $status = $fields['status']; @@ -1014,6 +1015,7 @@ private function insertClient($fields) $address = $fields['address']; $tax = $fields['tax']; $projects = $fields['projects']; + $comma_separated = null; if ($projects) $comma_separated = implode(',', $projects); // This is a comma-separated list of associated projects ids. $status = $fields['status']; diff --git a/initialize.php b/initialize.php index 183c62f9..f16a12b2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.7.5722"); +define("APP_VERSION", "1.21.8.5723"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 8392a26f00e6303095a2ff06680f054ea4fb431f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 20 Aug 2022 14:22:15 +0000 Subject: [PATCH 205/304] Fixed a bug in export-import. --- WEB-INF/lib/ttGroupExportHelper.class.php | 1 + WEB-INF/lib/ttOrgImportHelper.class.php | 8 +++++--- initialize.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index b7b6491e..fb0f6002 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -424,6 +424,7 @@ function writeData() { $custom_field_option_part = $this->indentation.' '."customFieldOptionMap[$option['id']]."\""; $custom_field_option_part .= " field_id=\"".$this->customFieldMap[$option['field_id']]."\""; $custom_field_option_part .= " value=\"".htmlspecialchars($option['value'])."\""; + $custom_field_option_part .= " status=\"".$option['status']."\""; $custom_field_option_part .= ">\n"; fwrite($this->file, $custom_field_option_part); } diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index 92ba6276..aae3267c 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -349,7 +349,8 @@ function startElement($parser, $name, $attrs) { 'group_id' => $this->current_group_id, 'org_id' => $this->org_id, 'field_id' => $this->currentGroupCustomFieldMap[$attrs['FIELD_ID']], - 'value' => $attrs['VALUE'])); + 'value' => $attrs['VALUE'], + 'status' => $attrs['STATUS'])); if ($custom_field_option_id) { // Add a mapping. $this->currentGroupCustomFieldOptionMap[$attrs['ID']] = $custom_field_option_id; @@ -1153,9 +1154,10 @@ private function insertCustomFieldOption($fields) { $org_id = (int) $fields['org_id']; $field_id = (int) $fields['field_id']; $value = $fields['value']; + $status = $fields['status']; - $sql = "insert into tt_custom_field_options (group_id, org_id, field_id, value)". - " values ($group_id, $org_id, $field_id, ".$mdb2->quote($value).")"; + $sql = "insert into tt_custom_field_options (group_id, org_id, field_id, value, status)". + " values ($group_id, $org_id, $field_id, ".$mdb2->quote($value).", ".$mdb2->quote($status).")"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/initialize.php b/initialize.php index f16a12b2..07317888 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.8.5723"); +define("APP_VERSION", "1.21.9.5724"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From a3ec5e331f92641bb774b6f0310303d3043023be Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 16 Sep 2022 13:02:36 +0000 Subject: [PATCH 206/304] Fixed a JavaScript error condition (issue #128). --- WEB-INF/templates/user_edit.tpl | 6 +++++- initialize.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/user_edit.tpl b/WEB-INF/templates/user_edit.tpl index 744e8c40..e4d916a5 100644 --- a/WEB-INF/templates/user_edit.tpl +++ b/WEB-INF/templates/user_edit.tpl @@ -57,7 +57,11 @@ function setRate(element) { // handleClientRole - manages visibility and content of controls related to client role, // also hides and unselects projects when client role is selected. function handleClientRole() { - var selectedRoleId = document.getElementById("role").value; + var roleControl = document.getElementById("role"); + if (roleControl == null) { + return; // Role control not available, nothing to do... + } + var selectedRoleId = roleControl.value; var clientControl = document.getElementById("client"); var clientBlock = document.getElementById("client_block"); var nonClientBlock = document.getElementById("non_client_block"); diff --git a/initialize.php b/initialize.php index 07317888..c5cb7fe3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5724"); +define("APP_VERSION", "1.21.9.5725"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 20ec9b24e53bc00b14241c6041dbd6c0f1fb0666 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 21 Sep 2022 20:51:28 +0000 Subject: [PATCH 207/304] Dutch translation improved. --- WEB-INF/resources/nl.lang.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 9f846bc5..2e87007c 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -411,8 +411,7 @@ 'form.reports.include_pending' => 'in afwachting', 'form.reports.select_period' => 'Kies periode', 'form.reports.set_period' => 'of stel datums in', -// TODO: translate the following. -// 'form.reports.note_containing' => 'Note containing', +'form.reports.note_containing' => 'Notitie bevat', 'form.reports.show_fields' => 'Toon velden', 'form.reports.time_fields' => 'Tijd velden', 'form.reports.user_fields' => 'Medewerker velden', diff --git a/initialize.php b/initialize.php index c5cb7fe3..92a3f313 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5725"); +define("APP_VERSION", "1.21.9.5726"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 491f6c4a35c723ab7e6ddd58c0065166dcfff25d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 17 Oct 2022 15:17:19 +0000 Subject: [PATCH 208/304] Starting to implement cost per hour column on reports. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 1 + WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/display_options.tpl | 10 ++++++++++ display_options.php | 4 ++++ initialize.php | 2 +- 33 files changed, 46 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index f2eec1b5..ae5a1df7 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -677,5 +677,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 8573d71c..18c04aa6 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -689,5 +689,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index dd1abd39..9e4a61c9 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -655,5 +655,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index e295e728..a2e730dd 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -630,5 +630,6 @@ // TODO: translate the following. // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 5df99c40..f55cef6f 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -601,5 +601,6 @@ 'form.display_options.note_on_separate_row' => 'Note on separate row', 'form.display_options.not_complete_days' => 'Not complete days', 'form.display_options.inactive_projects' => 'Inactive projects', +'form.display_options.cost_per_hour' => 'Cost per hour', 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 7c59d3ae..b7ec4116 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -692,5 +692,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 7a53024b..0b2fd1d8 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -665,5 +665,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 2963414e..ec3dfe6d 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -678,5 +678,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 112dc6b6..28033da2 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -662,5 +662,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index a1268d1a..20bc298f 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -651,5 +651,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 9f1bf5d9..db2aa859 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -644,5 +644,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 3167fd8d..ef6e20f3 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -683,5 +683,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 636c29d0..5987b885 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -680,5 +680,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index d517fded..63c2ada5 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -657,5 +657,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 59500e01..5e7070b1 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -684,5 +684,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index e2f16cce..a4ea97c2 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -682,5 +682,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 2e87007c..73265f98 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -586,5 +586,7 @@ 'form.display_options.note_on_separate_row' => 'Notitie in aparte kolom', // Translator (Henk) comment: "kolom is the right word in Dutch." 'form.display_options.not_complete_days' => 'Niet complete dagen', 'form.display_options.inactive_projects' => 'Niet actieve projecten', +// TODO: translate the following. +// 'form.display_options.cost_per_hour' => 'Cost per hour', 'form.display_options.custom_css' => 'Aangepaste CSS', ); diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index cba06a82..8e3c4c88 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -684,5 +684,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 3470add1..bf04ee74 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -663,5 +663,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 60d50576..36dca948 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -594,6 +594,7 @@ 'form.display_options.not_complete_days' => 'Dias não completos', // TODO: translate the following. // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', 'form.display_options.custom_css' => 'CSS customizado', ); diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index d5a4413a..cce36ad0 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -662,5 +662,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index f450bfd4..03e7a992 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -685,5 +685,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 47f87d49..5a037b84 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -587,5 +587,6 @@ 'form.display_options.note_on_separate_row' => 'Комментарий в отдельном ряду', 'form.display_options.not_complete_days' => 'Незавершенные дни', 'form.display_options.inactive_projects' => 'Неактивные проекты', +'form.display_options.cost_per_hour' => 'Стоимость за час', 'form.display_options.custom_css' => 'Пользовательская CSS', ); diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 1909ec9d..c3ad4da5 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -667,5 +667,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 304da23a..04e70974 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -657,5 +657,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index d1fb802e..9823f810 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -665,5 +665,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 1df983ec..4250318c 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -663,5 +663,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index c6fe800a..32838159 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -698,5 +698,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 5b701c85..967a172e 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -673,5 +673,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 14ef3c26..2fd31a76 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -676,5 +676,6 @@ // 'form.display_options.note_on_separate_row' => 'Note on separate row', // 'form.display_options.not_complete_days' => 'Not complete days', // 'form.display_options.inactive_projects' => 'Inactive projects', +// 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', ); diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index 6486c0b2..c09a18e9 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -49,6 +49,16 @@ License: See license.txt *} {$i18n.label.what_is_it} +{if defined('REPORT_COST_PER_HOUR')} + + + + + +{/if} diff --git a/display_options.php b/display_options.php index 6e0ccc54..e449c3c9 100644 --- a/display_options.php +++ b/display_options.php @@ -21,6 +21,7 @@ $cl_record_custom_fields = (bool)$request->getParameter('record_custom_fields'); $cl_report_note_on_separate_row = (bool)$request->getParameter('report_note_on_separate_row'); $cl_report_inactive_projects = (bool)($request->getParameter('report_inactive_projects')); + $cl_report_cost_per_hour = (bool)$request->getParameter('report_cost_per_hour'); $cl_custom_css = trim($request->getParameter('custom_css')); } else { $cl_time_note_on_separate_row = $config->getDefinedValue('time_note_on_separate_row'); @@ -28,6 +29,7 @@ $cl_record_custom_fields = $config->getDefinedValue('record_custom_fields'); $cl_report_note_on_separate_row = $config->getDefinedValue('report_note_on_separate_row'); $cl_report_inactive_projects = $config->getDefinedValue('report_inactive_projects'); + $cl_report_cost_per_hour = $config->getDefinedValue('report_cost_per_hour'); $cl_custom_css = $user->getCustomCss(); } @@ -49,6 +51,7 @@ // Reports. $form->addInput(array('type'=>'checkbox','name'=>'report_note_on_separate_row','value'=>$cl_report_note_on_separate_row)); $form->addInput(array('type'=>'checkbox','name'=>'report_inactive_projects','value'=>$cl_report_inactive_projects)); +$form->addInput(array('type'=>'checkbox','name'=>'report_cost_per_hour','value'=>$cl_report_cost_per_hour)); // TODO: add PDF break controller here. $form->addInput(array('type'=>'textarea','name'=>'custom_css','value'=>$cl_custom_css)); @@ -66,6 +69,7 @@ $config->setDefinedValue('record_custom_fields', $cl_record_custom_fields); $config->setDefinedValue('report_note_on_separate_row', $cl_report_note_on_separate_row); $config->setDefinedValue('report_inactive_projects', $cl_report_inactive_projects); + $config->setDefinedValue('report_cost_per_hour', $cl_report_cost_per_hour); if ($user->updateGroup(array( 'config' => $config->getConfig(), 'custom_css' => $cl_custom_css))) { diff --git a/initialize.php b/initialize.php index 92a3f313..86aad804 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5726"); +define("APP_VERSION", "1.21.9.5727"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 69de200456a6ad941f2a268f2efb406512b3973e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 17 Oct 2022 18:50:39 +0000 Subject: [PATCH 209/304] Work in progress on including cost per hour in reports. --- WEB-INF/lib/ttReportHelper.class.php | 13 ++++++-- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 2 ++ WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 2 ++ WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 2 ++ WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 2 ++ WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/puncher.tpl | 2 +- WEB-INF/templates/report.tpl | 45 ++++++++++++++++++---------- WEB-INF/templates/time.tpl | 2 +- WEB-INF/templates/week.tpl | 2 +- report.php | 8 ++++- 36 files changed, 87 insertions(+), 21 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 45b6ec1b..d15d1e9b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -333,12 +333,19 @@ static function getItems($options) { // Handle cost. $includeCost = $options['show_cost']; if ($includeCost) { - if (MODE_TIME == $trackingMode) + $includeCostPerHour = $user->getConfigOption('report_cost_per_hour'); + if (MODE_TIME == $trackingMode) { + if ($includeCostPerHour) + array_push($fields, "cast(l.billable * coalesce(u.rate, 0) as decimal(10,2)) as cost_per_hour"); // Use default user rate. array_push($fields, "cast(l.billable * coalesce(u.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2)) as cost"); // Use default user rate. - else + } else { + if ($includeCostPerHour) + array_push($fields, "cast(l.billable * coalesce(upb.rate, 0) as decimal(10,2)) as cost_per_hour"); // Use project rate for user. array_push($fields, "cast(l.billable * coalesce(upb.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2)) as cost"); // Use project rate for user. + } array_push($fields, "null as expense"); } + // Add the fields used to determine if we show an edit icon for record. array_push($fields, 'l.approved'); array_push($fields, 'l.timesheet_id'); @@ -501,6 +508,8 @@ static function getItems($options) { // Use the note field to print item name. if ($options['show_note']) array_push($fields, 'ei.name as note'); + if ($user->getConfigOption('report_cost_per_hour')) + array_push($fields, 'null as cost_per_hour'); // null for cost_per_hour. array_push($fields, 'ei.cost as cost'); array_push($fields, 'ei.cost as expense'); // Add the fields used to determine if we show an edit icon for record. diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index ae5a1df7..a06c8a69 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -494,6 +494,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportar', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 18c04aa6..e8d297ed 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -502,6 +502,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportovat', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 9e4a61c9..6e27e537 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -477,6 +477,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Eksport', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index a2e730dd..8d5e030c 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -459,6 +459,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportiere', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Zu Rechnung hinzufügen', // TODO: translate the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index f55cef6f..2f42d273 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -440,6 +440,7 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Export', +'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Assign to invoice', 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index b7ec4116..6dbfd29a 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -507,6 +507,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportar', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 0b2fd1d8..dc08bd01 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -489,6 +489,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Eksport', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Lisa arvele', // TODO: translate the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index ec3dfe6d..f8d8f684 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -498,6 +498,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'پشتیبانی', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 28033da2..8d5ec21e 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -483,6 +483,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Vie', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 20bc298f..8e728971 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -474,6 +474,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exporter', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index db2aa859..dc03db95 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -468,6 +468,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Εξαγωγή', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Ανάθεση στο τιμολόγιο', // TODO: translate the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index ef6e20f3..5249ee8e 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -502,6 +502,7 @@ // TODO: form.report.export is just "Export" now in the English file. Shorten this translation. 'form.report.export' => 'ייצא נתונים בתבנית', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 5987b885..f19593ba 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -496,6 +496,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportálása', // TODO: is this correct? // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 63c2ada5..f936ef12 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -481,6 +481,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Esporta', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Assegna alla fattura', // TODO: translate the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 5e7070b1..02d4ad22 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -502,6 +502,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => '輸出する', // TODO: is this correct? // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index a4ea97c2..491631d0 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -500,6 +500,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => '익스포트', // TODO: is this correct? // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 73265f98..90ee0769 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -426,6 +426,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exporteer', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Voeg toe aan factuur', 'form.report.assign_to_timesheet' => 'Wijs toe aan tijdenoverzicht', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 8e3c4c88..9fd52043 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -501,6 +501,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Eksporter', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index bf04ee74..325948cd 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -485,6 +485,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Eksport', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 36dca948..279d9eb6 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -430,6 +430,8 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportar', +// TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', 'form.report.assign_to_invoice' => 'Atribuir a fatura', 'form.report.assign_to_timesheet' => 'Atribuir a planilha de horas', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index cce36ad0..d5c248b8 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -477,6 +477,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). // TODO: translate the following. // 'form.report.export' => 'Export', +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 03e7a992..0984a779 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -501,6 +501,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exporta', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 5a037b84..faab0e60 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -427,6 +427,7 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Экспортировать', +'form.report.per_hour' => 'За час', 'form.report.assign_to_invoice' => 'Включить в счёт', 'form.report.assign_to_timesheet' => 'Включить в табель', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index c3ad4da5..8ba54629 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -488,6 +488,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportovať', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 04e70974..d041eaee 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -473,6 +473,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). // TODO: translate the following. // 'form.report.export' => 'Export', +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 9823f810..ac51518d 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -485,6 +485,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Izvoz', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 4250318c..3c43c91c 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -483,6 +483,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportera som', // TODO: translate the following. +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 32838159..d37a1c54 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -513,6 +513,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). // TODO: translate the following. // 'form.report.export' => 'Export', +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 967a172e..93c85118 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -491,6 +491,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). // TODO: translate the following. // 'form.report.export' => 'Export', +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 2fd31a76..75ac102b 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -494,6 +494,7 @@ // (after generating a report at https://timetracker.anuko.com/reports.php). // TODO: translate the following. // 'form.report.export' => 'Export', +// 'form.report.per_hour' => 'Per hour', // 'form.report.assign_to_invoice' => 'Assign to invoice', // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/WEB-INF/templates/puncher.tpl b/WEB-INF/templates/puncher.tpl index 9190af39..98bd5ca2 100644 --- a/WEB-INF/templates/puncher.tpl +++ b/WEB-INF/templates/puncher.tpl @@ -145,7 +145,7 @@ startTimer(); {if $show_client} {/if} - {* record custom fileds *} + {* record custom fields *} {if $show_record_custom_fields && isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="control_name" value='time_field_'|cat:$timeField['id']} diff --git a/WEB-INF/templates/report.tpl b/WEB-INF/templates/report.tpl index 8ae981a3..3bd9f448 100644 --- a/WEB-INF/templates/report.tpl +++ b/WEB-INF/templates/report.tpl @@ -38,7 +38,7 @@ License: See license.txt *} {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}{/if} - {* user custom fileds *} + {* user custom fields *} {if isset($custom_fields) && $custom_fields->userFields} {foreach $custom_fields->userFields as $userField} {assign var="checkbox_control_name" value='show_user_field_'|cat:$userField['id']} @@ -48,7 +48,7 @@ License: See license.txt *} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} {if $bean->getAttribute('chtask')}{/if} - {* time custom fileds *} + {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="checkbox_control_name" value='show_time_field_'|cat:$timeField['id']} @@ -60,7 +60,10 @@ License: See license.txt *} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} - {if $bean->getAttribute('chcost')}{/if} + {if $bean->getAttribute('chcost')} + {if $show_cost_per_hour}{/if} + + {/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} {if $bean->getAttribute('chip')}{/if} @@ -79,7 +82,7 @@ License: See license.txt *} {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}{/if} - {* user custom fileds *} + {* user custom fields *} {if isset($custom_fields) && $custom_fields->userFields} {foreach $custom_fields->userFields as $userField} {assign var="checkbox_control_name" value='show_user_field_'|cat:$userField['id']} @@ -90,7 +93,7 @@ License: See license.txt *} {if $bean->getAttribute('chproject')}{/if} {if $bean->getAttribute('chtask')}{/if} - {* time custom fileds *} + {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="checkbox_control_name" value='show_time_field_'|cat:$timeField['id']} @@ -102,7 +105,10 @@ License: See license.txt *} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} - {if $bean->getAttribute('chcost')}{/if} + {if $bean->getAttribute('chcost')} + {if $show_cost_per_hour}{/if} + + {/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} {if $bean->getAttribute('chip')}{/if} @@ -120,7 +126,7 @@ License: See license.txt *} {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}{/if} - {* user custom fileds *} + {* user custom fields *} {if isset($custom_fields) && $custom_fields->userFields} {foreach $custom_fields->userFields as $userField} {assign var="control_name" value='user_field_'|cat:$userField['id']} @@ -131,7 +137,7 @@ License: See license.txt *} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} {if $bean->getAttribute('chtask')}{/if} - {* time custom fileds *} + {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="control_name" value='time_field_'|cat:$timeField['id']} @@ -144,7 +150,10 @@ License: See license.txt *} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} - {if $bean->getAttribute('chcost')}{/if} + {if $bean->getAttribute('chcost')} + {if $show_cost_per_hour}{/if} + + {/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} {if $bean->getAttribute('chip')}{/if} @@ -180,7 +189,7 @@ License: See license.txt *} {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}{/if} - {* user custom fileds *} + {* user custom fields *} {if isset($custom_fields) && $custom_fields->userFields} {foreach $custom_fields->userFields as $userField} {assign var="checkbox_control_name" value='show_user_field_'|cat:$userField['id']} @@ -190,7 +199,7 @@ License: See license.txt *} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} {if $bean->getAttribute('chtask')}{/if} - {* time custom fileds *} + {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="checkbox_control_name" value='show_time_field_'|cat:$timeField['id']} @@ -202,7 +211,10 @@ License: See license.txt *} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} - {if $bean->getAttribute('chcost')}{/if} + {if $bean->getAttribute('chcost')} + {if $show_cost_per_hour}{/if} + + {/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} {if $bean->getAttribute('chip')}{/if} @@ -218,7 +230,7 @@ License: See license.txt *} {if $user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()}{/if} - {* user custom fileds *} + {* user custom fields *} {if isset($custom_fields) && $custom_fields->userFields} {foreach $custom_fields->userFields as $userField} {assign var="checkbox_control_name" value='show_user_field_'|cat:$userField['id']} @@ -228,7 +240,7 @@ License: See license.txt *} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} {if $bean->getAttribute('chtask')}{/if} - {* time custom fileds *} + {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="checkbox_control_name" value='show_time_field_'|cat:$timeField['id']} @@ -240,7 +252,10 @@ License: See license.txt *} {if $bean->getAttribute('chduration')}{/if} {if $bean->getAttribute('chunits')}{/if} {if $bean->getAttribute('chnote') && !$note_on_separate_row}{/if} - {if $bean->getAttribute('chcost')}{/if} + {if $bean->getAttribute('chcost')} + {if $show_cost_per_hour}{/if} + + {/if} {if $bean->getAttribute('chapproved')}{/if} {if $bean->getAttribute('chpaid')}{/if} {if $bean->getAttribute('chip')}{/if} diff --git a/WEB-INF/templates/time.tpl b/WEB-INF/templates/time.tpl index 6f6f7394..b601531b 100644 --- a/WEB-INF/templates/time.tpl +++ b/WEB-INF/templates/time.tpl @@ -160,7 +160,7 @@ function handleStop(buttonElement) { {if $show_client} {/if} - {* record custom fileds *} + {* record custom fields *} {if $show_record_custom_fields && isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="control_name" value='time_field_'|cat:$timeField['id']} diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 41568f60..74e94053 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -130,7 +130,7 @@ function fillDropdowns() { {foreach $time_records as $record} - {* record custom fileds *} + {* record custom fields *} {if $show_record_custom_fields && isset($custom_fields) && $custom_fields->timeFields} {foreach $custom_fields->timeFields as $timeField} {assign var="control_name" value='time_field_'|cat:$timeField['id']} diff --git a/report.php b/report.php index bd2576f1..38e57fe2 100644 --- a/report.php +++ b/report.php @@ -18,6 +18,7 @@ // End of access checks. $config = new ttConfigHelper($user->getConfig()); +$show_cost_per_hour = $config->getDefinedValue('report_cost_per_hour'); if ($user->isPluginEnabled('ap')) { $cl_mark_approved_select_option = $request->getParameter('mark_approved_select_options', ($request->isPost() ? null : @$_SESSION['mark_approved_select_option'])); @@ -298,7 +299,11 @@ if ($bean->getAttribute('chduration')) $colspan++; if (!$user->getConfigOption('report_note_on_separate_row') && $bean->getAttribute('chnote')) $colspan++; if ($bean->getAttribute('chunits')) $colspan++; -if ($bean->getAttribute('chcost')) $colspan++; +if ($bean->getAttribute('chcost')) { + if ($show_cost_per_hour) + $colspan++; + $colspan++; +} if ($bean->getAttribute('chapproved')) $colspan++; if ($bean->getAttribute('chpaid')) $colspan++; if ($bean->getAttribute('chip')) $colspan++; @@ -316,6 +321,7 @@ $smarty->assign('report_items', $report_items); $smarty->assign('subtotals', $subtotals); $smarty->assign('totals', $totals); +$smarty->assign('show_cost_per_hour', $show_cost_per_hour); $smarty->assign('note_on_separate_row', $user->getConfigOption('report_note_on_separate_row')); $smarty->assign('colspan', $colspan); $smarty->assign('bean', $bean); From 350f206391875be2a1b1e3847f80030aca02210f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 18 Oct 2022 18:02:06 +0000 Subject: [PATCH 210/304] Fixed report exports for cost_per_hour column. --- WEB-INF/lib/ttReportHelper.class.php | 4 ++++ initialize.php | 2 +- report.php | 2 +- tofile.php | 20 +++++++++++++++++--- topdf.php | 7 +++++++ 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index d15d1e9b..cfcc6435 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -613,6 +613,10 @@ static function getItems($options) { if($val['finish'] != '') $val['finish'] = ttTimeHelper::to12HourFormat($val['finish']); } + if (isset($val['cost_per_hour'])) { + if ('.' != $decimalMark) + $val['cost_per_hour'] = str_replace('.', $decimalMark, $val['cost_per_hour']); + } if (isset($val['cost'])) { if ('.' != $decimalMark) $val['cost'] = str_replace('.', $decimalMark, $val['cost']); diff --git a/initialize.php b/initialize.php index 86aad804..ed2fe659 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5727"); +define("APP_VERSION", "1.21.9.5728"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/report.php b/report.php index 38e57fe2..4945ac17 100644 --- a/report.php +++ b/report.php @@ -18,7 +18,7 @@ // End of access checks. $config = new ttConfigHelper($user->getConfig()); -$show_cost_per_hour = $config->getDefinedValue('report_cost_per_hour'); +$show_cost_per_hour = $config->getDefinedValue('report_cost_per_hour') && ($user->can('manage_invoices') || $user->isClient()); if ($user->isPluginEnabled('ap')) { $cl_mark_approved_select_option = $request->getParameter('mark_approved_select_options', ($request->isPost() ? null : @$_SESSION['mark_approved_select_option'])); diff --git a/tofile.php b/tofile.php index 530d2f7d..6ea39ad8 100644 --- a/tofile.php +++ b/tofile.php @@ -20,6 +20,8 @@ $custom_fields = new CustomFields(); } +$show_cost_per_hour = $user->getConfigOption('report_cost_per_hour') && ($user->can('manage_invoices') || $user->isClient()); + // Report settings are stored in session bean before we get here. $bean = new ActionForm('reportBean', new Form('reportForm'), $request); @@ -123,6 +125,11 @@ } if ($bean->getAttribute('chunits')) print "\t\n"; if ($bean->getAttribute('chnote')) print "\t\n"; + if ($bean->getAttribute('chcost') && $show_cost_per_hour) { + print "\t\n"; + } if ($bean->getAttribute('chcost')) { print "\tcan('manage_invoices') || $user->isClient()) @@ -213,7 +220,11 @@ if ($bean->getAttribute('chduration')) print ',"'.$i18n->get('label.duration').'"'; if ($bean->getAttribute('chunits')) print ',"'.$i18n->get('label.work_units_short').'"'; if ($bean->getAttribute('chnote')) print ',"'.$i18n->get('label.note').'"'; - if ($bean->getAttribute('chcost')) print ',"'.$i18n->get('label.cost').'"'; + if ($bean->getAttribute('chcost')) { + if ($show_cost_per_hour) + print ',"'.$i18n->get('form.report.per_hour').'"'; + print ',"'.$i18n->get('label.cost').'"'; + } if ($bean->getAttribute('chapproved')) print ',"'.$i18n->get('label.approved').'"'; if ($bean->getAttribute('chpaid')) print ',"'.$i18n->get('label.paid').'"'; if ($bean->getAttribute('chip')) print ',"'.$i18n->get('label.ip').'"'; @@ -255,10 +266,13 @@ if ($bean->getAttribute('chunits')) print ',"'.$item['units'].'"'; if ($bean->getAttribute('chnote')) print ',"'.ttNeutralizeForCsv($item['note']).'"'; if ($bean->getAttribute('chcost')) { - if ($user->can('manage_invoices') || $user->isClient()) + if ($user->can('manage_invoices') || $user->isClient()) { + if ($show_cost_per_hour) + print ',"'.$item['cost_per_hour'].'"'; print ',"'.$item['cost'].'"'; - else + } else { print ',"'.$item['expense'].'"'; + } } if ($bean->getAttribute('chapproved')) print ',"'.$item['approved'].'"'; if ($bean->getAttribute('chpaid')) print ',"'.$item['paid'].'"'; diff --git a/topdf.php b/topdf.php index 85ff8d84..931fa814 100644 --- a/topdf.php +++ b/topdf.php @@ -38,6 +38,7 @@ $config = new ttConfigHelper($user->getConfig()); $show_note_column = $bean->getAttribute('chnote') && !$config->getDefinedValue('report_note_on_separate_row'); $show_note_row = $bean->getAttribute('chnote') && $config->getDefinedValue('report_note_on_separate_row'); +$show_cost_per_hour = $config->getDefinedValue('report_cost_per_hour') && ($user->can('manage_invoices') || $user->isClient()); // There are 2 variations of report: totals only, or normal. Totals only means that the report // is grouped by either date, user, client, project, or task and user only needs to see subtotals by group. @@ -152,6 +153,7 @@ if ($bean->getAttribute('chduration')) { $colspan++; $html .= "'; } if ($bean->getAttribute('chunits')) { $colspan++; $html .= "'; } if ($show_note_column) { $colspan++; $html .= ''; } + if ($bean->getAttribute('chcost') && $show_cost_per_hour) { $colspan++; $html .= "'; } if ($bean->getAttribute('chcost')) { $colspan++; $html .= "'; } if ($bean->getAttribute('chapproved')) { $colspan++; $html .= "'; } if ($bean->getAttribute('chpaid')) { $colspan++; $html .= "'; } @@ -266,6 +268,11 @@ if ($bean->getAttribute('chduration')) $html .= "'; if ($bean->getAttribute('chunits')) $html .= "'; if ($show_note_column) $html .= ''; + if ($bean->getAttribute('chcost') && $show_cost_per_hour) { + $html .= "'; + } if ($bean->getAttribute('chcost')) { $html .= "'; if ($show_note_column) $body .= ''; + if ($show_cost_per_hour) + $body .= ''; if ($options['show_cost']) $body .= ''; if ($options['show_approved']) @@ -1263,6 +1267,7 @@ static function prepareReportBody($options, $comment = null) if ($options['show_duration']) $body .= ''; if ($options['show_work_units']) $body .= ''; if ($show_note_column) $body .= ''; + if ($show_cost_per_hour) $body .= ''; if ($options['show_cost']) { $body .= ''; if ($show_note_column) $body .= ''; + if ($show_cost_per_hour) + $body .= ''; if ($options['show_cost']) $body .= ''; if ($options['show_approved']) { @@ -1382,6 +1389,7 @@ static function prepareReportBody($options, $comment = null) if ($options['show_duration']) $body .= ''; if ($options['show_work_units']) $body .= ''; if ($show_note_column) $body .= ''; + if ($show_cost_per_hour) $body .= ''; if ($options['show_cost']) { $body .= ''; if ($options['show_work_units']) $body .= ''; if ($show_note_column) $body .= ''; + if ($show_cost_per_hour) $body .= ''; if ($options['show_cost']) { $body .= ' -{if defined('REPORT_COST_PER_HOUR')} @@ -58,7 +57,6 @@ License: See license.txt *} {$i18n.label.what_is_it} -{/if} diff --git a/initialize.php b/initialize.php index 25386c62..e58e54a1 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5729"); +define("APP_VERSION", "1.21.10.5730"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From dc03995e430b92b0e3f814d32f586a994996dc81 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 20 Oct 2022 22:01:13 +0000 Subject: [PATCH 213/304] German translation improved. --- WEB-INF/resources/de.lang.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 8d5e030c..95d9af2c 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -459,8 +459,7 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exportiere', -// TODO: translate the following. -// 'form.report.per_hour' => 'Per hour', +'form.report.per_hour' => 'Stundensatz', 'form.report.assign_to_invoice' => 'Zu Rechnung hinzufügen', // TODO: translate the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', diff --git a/initialize.php b/initialize.php index e58e54a1..90872e60 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5730"); +define("APP_VERSION", "1.21.10.5731"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From e8b8d42fc07ebce3d8a08303c21c488a3165019e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 21 Oct 2022 14:53:20 +0000 Subject: [PATCH 214/304] Starting to work on project custom fields. --- WEB-INF/templates/cf_custom_fields.tpl | 2 ++ cf_custom_field_add.php | 16 ++++++++++++---- initialize.php | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/WEB-INF/templates/cf_custom_fields.tpl b/WEB-INF/templates/cf_custom_fields.tpl index 70253cb3..812943db 100644 --- a/WEB-INF/templates/cf_custom_fields.tpl +++ b/WEB-INF/templates/cf_custom_fields.tpl @@ -19,6 +19,8 @@ License: See license.txt *} {elseif CustomFields::ENTITY_USER == $field['entity_type']} + {elseif CustomFields::ENTITY_PROJECT == $field['entity_type']} + {else} {/if} diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index 6cfd8725..38d67282 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -27,10 +27,18 @@ $form = new Form('fieldForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>'')); -$form->addInput(array('type'=>'combobox','name'=>'entity', - 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), - CustomFields::ENTITY_USER=>$i18n->get('entity.user')) -)); +if (defined('DEBUG_PROJECT_CUSTOM_FIELDS')) { + $form->addInput(array('type'=>'combobox','name'=>'entity', + 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), + CustomFields::ENTITY_USER=>$i18n->get('entity.user'), + CustomFields::ENTITY_PROJECT=>$i18n->get('entity.project')) + )); +} else { + $form->addInput(array('type'=>'combobox','name'=>'entity', + 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), + CustomFields::ENTITY_USER=>$i18n->get('entity.user')) + )); +} $form->addInput(array('type'=>'combobox','name'=>'type', 'data'=>array(CustomFields::TYPE_TEXT=>$i18n->get('label.type_text'), CustomFields::TYPE_DROPDOWN=>$i18n->get('label.type_dropdown')) diff --git a/initialize.php b/initialize.php index 90872e60..6033d935 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5731"); +define("APP_VERSION", "1.21.10.5732"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From b0381c6478f062d37bdbb38714d23ee6c2151805 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 21 Oct 2022 16:16:14 +0000 Subject: [PATCH 215/304] Work in progress on project custom fields. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + WEB-INF/templates/reports.tpl | 16 +++++++++++++--- initialize.php | 2 +- plugins/CustomFields.class.php | 29 ++--------------------------- reports.php | 17 +++++++++++++++++ 34 files changed, 65 insertions(+), 31 deletions(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index a06c8a69..13d8237c 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -480,6 +480,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Agrupar per', 'form.reports.group_by_no' => '--- no agrupar ---', 'form.reports.group_by_date' => 'data', diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index e8d297ed..4a93086d 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -488,6 +488,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Seskupit podle', // TODO: translate the following. // 'form.reports.group_by_no' => '--- no grouping ---', diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 6e27e537..595590f0 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -465,6 +465,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Gruppér ved', 'form.reports.group_by_no' => '--- Ingen gruppereing ---', 'form.reports.group_by_date' => 'Dato', diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 95d9af2c..209df6b7 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -448,6 +448,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Gruppieren nach', 'form.reports.group_by_no' => '--- keine Gruppierung ---', 'form.reports.group_by_date' => 'Datum', diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 2f42d273..83808aa4 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -429,6 +429,7 @@ 'form.reports.show_fields' => 'Show fields', 'form.reports.time_fields' => 'Time fields', 'form.reports.user_fields' => 'User fields', +'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Group by', 'form.reports.group_by_no' => '--- no grouping ---', 'form.reports.group_by_date' => 'date', diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 6dbfd29a..507bbcaa 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -493,6 +493,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Agrupar por', 'form.reports.group_by_no' => '--- no agrupar ---', 'form.reports.group_by_date' => 'fecha', diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index dc08bd01..0295dc70 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -478,6 +478,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Grupeeri', 'form.reports.group_by_no' => '--- grupeerimata ---', 'form.reports.group_by_date' => 'kuupäev', diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index f8d8f684..07887202 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -486,6 +486,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'گروه بندی شده با', 'form.reports.group_by_no' => '--- بدون گروه ---', 'form.reports.group_by_date' => 'تاریخ', diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index 8d5ec21e..e9e92e01 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -471,6 +471,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Ryhmittelyperuste', 'form.reports.group_by_no' => '--- ei ryhmitystä ---', 'form.reports.group_by_date' => 'päivä', diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 8e728971..145fcb28 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -462,6 +462,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Regroupés par', 'form.reports.group_by_no' => '--- Aucun regroupement ---', 'form.reports.group_by_date' => 'Date', diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index dc03db95..6265976d 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -457,6 +457,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Ομαδοποίηση με βάση', 'form.reports.group_by_no' => '--- χωρίς ομαδοποίηση ---', 'form.reports.group_by_date' => 'ημερομηνία', diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 5249ee8e..727b0b76 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -489,6 +489,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'סדר לפי', 'form.reports.group_by_no' => '--- ללא סדר ---', 'form.reports.group_by_date' => 'תאריך', diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index f19593ba..8b0be952 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -482,6 +482,7 @@ // 'form.reports.show_fields' => 'Show fields', // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Csoportosítva', 'form.reports.group_by_no' => '--- csoportosítás nélkül ---', 'form.reports.group_by_date' => 'dátum', diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index f936ef12..d283830a 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -470,6 +470,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Raggruppa per', 'form.reports.group_by_no' => '--- non raggruppare ---', 'form.reports.group_by_date' => 'data', diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 02d4ad22..112e454c 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -488,6 +488,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => '次のようにグループ化', 'form.reports.group_by_no' => '--- グループの機能がありません ---', 'form.reports.group_by_date' => '日付', diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 491631d0..6bb78d77 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -486,6 +486,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => '다음것에 의한 그룹화', 'form.reports.group_by_no' => '--- 그룹화되지 않음 ---', 'form.reports.group_by_date' => '날짜', diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 90ee0769..38d93efd 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -415,6 +415,8 @@ 'form.reports.show_fields' => 'Toon velden', 'form.reports.time_fields' => 'Tijd velden', 'form.reports.user_fields' => 'Medewerker velden', +// TODO: translate the following. +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Groeperen op', 'form.reports.group_by_no' => '--- niet groeperen ---', 'form.reports.group_by_date' => 'datum', diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 9fd52043..18e1ee69 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -488,6 +488,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', // 'form.reports.group_by' => 'Group by', // 'form.reports.group_by_no' => '--- no grouping ---', 'form.reports.group_by_date' => 'dato', diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index 325948cd..b7dd5024 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -473,6 +473,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Grupowanie wg', 'form.reports.group_by_no' => '--- bez grupowania ---', 'form.reports.group_by_date' => 'daty', diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 279d9eb6..fff94fa3 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -419,6 +419,8 @@ 'form.reports.show_fields' => 'Exibir campos', 'form.reports.time_fields' => 'Campos de tempo', 'form.reports.user_fields' => 'Campos de usuário', +// TODO: translate the following. +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Agrupar por', 'form.reports.group_by_no' => '--- sem agrupar ---', 'form.reports.group_by_date' => 'data', diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index d5c248b8..075e7b41 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -465,6 +465,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', // 'form.reports.group_by' => 'Group by', // 'form.reports.group_by_no' => '--- no grouping ---', // 'form.reports.group_by_date' => 'date', diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 0984a779..0d8fe6d1 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -488,6 +488,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Grupat dupa', 'form.reports.group_by_no' => '--- fara grupare ---', 'form.reports.group_by_date' => 'data', diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index faab0e60..805be45b 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -416,6 +416,7 @@ 'form.reports.show_fields' => 'Показывать поля', 'form.reports.time_fields' => 'Поля времени', 'form.reports.user_fields' => 'Поля пользователя', +'form.reports.project_fields' => 'Поля проекта', 'form.reports.group_by' => 'Группировать по', 'form.reports.group_by_no' => '--- без группировки ---', 'form.reports.group_by_date' => 'дате', diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 8ba54629..e57e63d7 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -476,6 +476,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', // 'form.reports.group_by' => 'Group by', // 'form.reports.group_by_no' => '--- no grouping ---', 'form.reports.group_by_date' => 'dátum', diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index d041eaee..8ea8c445 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -460,6 +460,7 @@ // 'form.reports.show_fields' => 'Show fields', // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', // 'form.reports.group_by' => 'Group by', // 'form.reports.group_by_no' => '--- no grouping ---', // 'form.reports.group_by_date' => 'date', diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index ac51518d..055545b3 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -473,6 +473,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Grupiši po', 'form.reports.group_by_no' => '--- nemoj grupisati ---', 'form.reports.group_by_date' => 'datum', diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 3c43c91c..e0d212b9 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -471,6 +471,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Gruppera efter', 'form.reports.group_by_no' => '--- Ingen gruppering ---', 'form.reports.group_by_date' => 'Datum', diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index d37a1c54..09887171 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -499,6 +499,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => 'Gruplandırma kıstas', 'form.reports.group_by_no' => '--- gruplama yok ---', 'form.reports.group_by_date' => 'tarih', diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 93c85118..87f1cc1c 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -477,6 +477,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => '分组方式', 'form.reports.group_by_no' => '--- 没有分组 ---', 'form.reports.group_by_date' => '日期', diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 75ac102b..181756e7 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -480,6 +480,7 @@ // TODO: translate the following. // 'form.reports.time_fields' => 'Time fields', // 'form.reports.user_fields' => 'User fields', +// 'form.reports.project_fields' => 'Project fields', 'form.reports.group_by' => '分組方式', 'form.reports.group_by_no' => '--- 沒有分組 ---', 'form.reports.group_by_date' => '日期', diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 51c98212..370a6d46 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -245,9 +245,6 @@ function handleCheckboxes() { } -{* Copyright (c) Anuko International Ltd. https://www.anuko.com -License: See license.txt *} - {$forms.reportForm.open}
{$forms.displayOptionsForm.report_cost_per_hour.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} +
{$i18n.form.display_options.custom_css}
{$record.client|escape}
{$i18n.label.date}{$i18n.label.user}{$i18n.label.client}{$i18n.label.project}{$i18n.label.task}{$i18n.label.duration}{$i18n.label.work_units_short}{$i18n.label.note}{$i18n.label.cost}{$i18n.form.report.per_hour}{$i18n.label.cost}{$i18n.label.approved}{$i18n.label.paid}{$i18n.label.ip}
{$i18n.label.subtotal}{$subtotals[$prev_grouped_by]['user']|escape}{$subtotals[$prev_grouped_by]['project']|escape}{$subtotals[$prev_grouped_by]['task']|escape}{$subtotals[$prev_grouped_by]['time']}{$subtotals[$prev_grouped_by]['units']}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}
{$item.date}{$item.user|escape}{$item.client|escape}{$item.project|escape}{$item.task|escape}{$item.duration}{$item.units}{$item.note|escape}{if $user->can('manage_invoices') || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}{if $user->can('manage_invoices') || $user->isClient()}{$item.cost_per_hour}{/if}{if $user->can('manage_invoices') || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}{if $item.approved == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{if $item.modified}{$item.modified_ip} {$item.modified}{else}{$item.created_ip} {$item.created}{/if}{$i18n.label.subtotal}{$subtotals[$cur_grouped_by]['user']|escape}{$subtotals[$cur_grouped_by]['client']|escape}{$subtotals[$cur_grouped_by]['project']|escape}{$subtotals[$cur_grouped_by]['task']|escape}{$subtotals[$cur_grouped_by]['time']}{$subtotals[$cur_grouped_by]['units']}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}{if $user->can('manage_invoices') || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}
{$i18n.label.total}{$totals['time']}{$totals['units']}{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}{$user->currency|escape} {if $user->can('manage_invoices') || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}{$record.client|escape}
{$record.date}".$i18n->get('label.duration').'".$i18n->get('label.work_units_short').''.$i18n->get('label.note').'".$i18n->get('form.report.per_hour').'".$i18n->get('label.cost').'".$i18n->get('label.approved').'".$i18n->get('label.paid').'".$item['duration'].'".$item['units'].''.htmlspecialchars($item['note']).'"; + $html .= $item['cost_per_hour']; + $html .= '"; if ($user->can('manage_invoices') || $user->isClient()) From 85c1f6d14ceb9df215bae6c7478bc0ec363e2b77 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 18 Oct 2022 18:16:56 +0000 Subject: [PATCH 211/304] Fixed emailed reports for cost_per_hour column. --- WEB-INF/lib/ttReportHelper.class.php | 9 +++++++++ initialize.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index cfcc6435..056f4d4f 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1037,6 +1037,7 @@ static function prepareReportBody($options, $comment = null) $config = new ttConfigHelper($user->getConfig()); $show_note_column = $options['show_note'] && !$config->getDefinedValue('report_note_on_separate_row'); $show_note_row = $options['show_note'] && $config->getDefinedValue('report_note_on_separate_row'); + $show_cost_per_hour = $options['show_cost'] && $config->getDefinedValue('report_cost_per_hour') && ($user->can('manage_invoices') || $user->isClient()); $items = ttReportHelper::getItems($options); $grouping = ttReportHelper::grouping($options); @@ -1085,6 +1086,7 @@ static function prepareReportBody($options, $comment = null) if ($options['show_end']) $colspan++; if ($options['show_duration']) $colspan++; if ($options['show_work_units']) $colspan++; + if ($show_cost_per_hour) $colspan++; if ($options['show_cost']) $colspan++; if ($options['show_approved']) $colspan++; if ($options['show_paid']) $colspan++; @@ -1201,6 +1203,8 @@ static function prepareReportBody($options, $comment = null) $body .= ''.$i18n->get('label.work_units_short').''.$i18n->get('label.note').''.$i18n->get('form.report.per_hour').''.$i18n->get('label.cost').''.$subtotals[$prev_grouped_by]['time'].''.$subtotals[$prev_grouped_by]['units'].''; $body .= ($canViewReports || $isClient) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses']; @@ -1318,6 +1323,8 @@ static function prepareReportBody($options, $comment = null) $body .= ''.$record['units'].''.htmlspecialchars($record['note']).''.$record['cost_per_hour'].''.$record['cost'].''.$subtotals[$cur_grouped_by]['time'].''.$subtotals[$cur_grouped_by]['units'].''; $body .= ($canViewReports || $isClient) ? $subtotals[$cur_grouped_by]['cost'] : $subtotals[$cur_grouped_by]['expenses']; @@ -1424,6 +1432,7 @@ static function prepareReportBody($options, $comment = null) if ($options['show_duration']) $body .= ''.$totals['time'].''.$totals['units'].''.htmlspecialchars($user->currency).' '; $body .= ($canViewReports || $isClient) ? $totals['cost'] : $totals['expenses']; diff --git a/initialize.php b/initialize.php index ed2fe659..25386c62 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.9.5728"); +define("APP_VERSION", "1.21.9.5729"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bd30ae8c78ced5dea93d10b0153f5b677e87891c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 18 Oct 2022 19:32:54 +0000 Subject: [PATCH 212/304] Finished adding cost per hour column in reports. --- WEB-INF/templates/display_options.tpl | 2 -- initialize.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index c09a18e9..5b487ec8 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -49,7 +49,6 @@ License: See license.txt *} {$i18n.label.what_is_it}
{$i18n.form.display_options.custom_css}
{$i18n.entity.time}{$i18n.entity.user}{$i18n.entity.project}
@@ -513,6 +510,19 @@ License: See license.txt *} {/foreach} {/if} +{if isset($custom_fields) && $custom_fields->projectFields} + + {foreach $custom_fields->projectFields as $projectField} + {assign var="control_name" value='project_field_'|cat:$projectField['id']} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + + + + + + + {/foreach} +{/if}
{$i18n.label.fav_report}:
{$i18n.form.reports.project_fields}
{$forms.reportForm.$control_name.control} {$forms.reportForm.$checkbox_control_name.control}
diff --git a/initialize.php b/initialize.php index 6033d935..e6e45730 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5732"); +define("APP_VERSION", "1.21.10.5733"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index 4e2f1319..0e52871e 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -1,31 +1,6 @@ projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + $form->addInput(array('type'=>'text','name'=>$field_name,)); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'data'=>CustomFields::getOptions($projectField['id']), + 'empty'=>array(''=>$i18n->get('dropdown.all')))); + } + // Also add a checkbox (to print the field or not). + $form->addInput(array('type'=>'checkbox','name'=>$checkbox_field_name)); + } +} + // Add group by control. $group_by_options['no_grouping'] = $i18n->get('form.reports.group_by_no'); $group_by_options['date'] = $i18n->get('form.reports.group_by_date'); From ac2e96281d8be1c80d50cc08290609b60fc9f997 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 21 Oct 2022 19:28:55 +0000 Subject: [PATCH 216/304] Added handling of custom fields on project_add, project_edit, and project_delete pages. --- WEB-INF/lib/ttProjectHelper.class.php | 11 ++++ WEB-INF/templates/project_add.tpl | 11 ++++ WEB-INF/templates/project_edit.tpl | 12 +++++ project_add.php | 54 +++++++++++++++++-- project_edit.php | 75 ++++++++++++++++++++++++--- user_edit.php | 2 +- 6 files changed, 153 insertions(+), 12 deletions(-) diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index e1d5754c..e6459bd0 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -220,6 +220,17 @@ static function delete($id) { if (!ttClientHelper::deleteProject($id)) return false; + // Mark project custom fields as deleted, + require_once('plugins/CustomFields.class.php'); + $entity_type = CustomFields::ENTITY_PROJECT; + $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($user->id); + $sql = "update tt_entity_custom_fields set status = null $modified_part". + " where entity_type = $entity_type and entity_id = $id". + " and group_id = $group_id and org_id = $org_id"; + $affected = $mdb2->exec($sql); + if (is_a($affected, 'PEAR_Error')) + return false; + // Update entities_modified, too. if (!ttGroupHelper::updateEntitiesModified()) return false; diff --git a/WEB-INF/templates/project_add.tpl b/WEB-INF/templates/project_add.tpl index 8cc43fca..7b1fd835 100644 --- a/WEB-INF/templates/project_add.tpl +++ b/WEB-INF/templates/project_add.tpl @@ -15,6 +15,17 @@ License: See license.txt *} +{if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="control_name" value='project_field_'|cat:$projectField['id']} + + + + + + + {/foreach} +{/if} {if $show_files} diff --git a/WEB-INF/templates/project_edit.tpl b/WEB-INF/templates/project_edit.tpl index 3ecc85a8..4e3b02e7 100644 --- a/WEB-INF/templates/project_edit.tpl +++ b/WEB-INF/templates/project_edit.tpl @@ -15,6 +15,18 @@ License: See license.txt *} +{if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="control_name" value='project_field_'|cat:$projectField['id']} + + + + + + + {/foreach} +{/if} + diff --git a/project_add.php b/project_add.php index 35b45c97..859fdc25 100644 --- a/project_add.php +++ b/project_add.php @@ -19,6 +19,13 @@ } // End of access checks. +// Use custom fields plugin if it is enabled. +if ($user->isPluginEnabled('cf')) { + require_once('plugins/CustomFields.class.php'); + $custom_fields = new CustomFields(); + $smarty->assign('custom_fields', $custom_fields); +} + $showFiles = $user->isPluginEnabled('at'); $users = ttGroupHelper::getActiveUsers(); foreach ($users as $user_item) @@ -35,6 +42,18 @@ $cl_description = trim($request->getParameter('description')); $cl_users = $request->getParameter('users', array()); $cl_tasks = $request->getParameter('tasks', array()); + // If we have project custom fields - collect input. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $control_name = 'project_field_'.$projectField['id']; + $projectCustomFields[$projectField['id']] = array('field_id' => $projectField['id'], + 'control_name' => $control_name, + 'label' => $projectField['label'], + 'type' => $projectField['type'], + 'required' => $projectField['required'], + 'value' => trim($request->getParameter($control_name))); + } + } } else { foreach ($users as $user_item) $cl_users[] = $user_item['id']; @@ -45,6 +64,20 @@ $form = new Form('projectForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','value'=>$cl_description)); +// If we have custom fields - add controls for them. +if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$projectCustomFields[$projectField['id']]['value'])); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'data'=>CustomFields::getOptions($projectField['id']), + 'value'=>$projectCustomFields[$projectField['id']]['value'], + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + } + } +} if ($showFiles) $form->addInput(array('type'=>'upload','name'=>'newfile','value'=>$i18n->get('button.submit'))); $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users)); @@ -56,26 +89,37 @@ // Validate user input. if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); + // Validate input in project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($projectCustomFields as $projectField) { + // Validation is the same for text and dropdown fields. + if (!ttValidString($projectField['value'], !$projectField['required'])) $err->add($i18n->get('error.field'), htmlspecialchars($projectField['label'])); + } + } if (!ttGroupHelper::validateCheckboxGroupInput($cl_users, 'tt_users')) $err->add($i18n->get('error.field'), $i18n->get('label.users')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_tasks, 'tt_tasks')) $err->add($i18n->get('error.field'), $i18n->get('label.tasks')); if ($err->no()) { if (!ttProjectHelper::getProjectByName($cl_name)) { - $id = ttProjectHelper::insert(array('name' => $cl_name, + $project_id = ttProjectHelper::insert(array('name' => $cl_name, 'description' => $cl_description, 'users' => $cl_users, 'tasks' => $cl_tasks, 'status' => ACTIVE)); - + // Insert project custom fields if we have them. + $result = true; + if ($project_id && isset($custom_fields) && $custom_fields->projectFields) { + $result = $custom_fields->insertEntityFields(CustomFields::ENTITY_PROJECT, $project_id, $projectCustomFields); + } // Put a new file in storage if we have it. - if ($id && $showFiles && $_FILES['newfile']['name']) { + if ($project_id && $showFiles && $_FILES['newfile']['name']) { $fileHelper = new ttFileHelper($err); $fields = array('entity_type'=>'project', - 'entity_id' => $id, + 'entity_id' => $project_id, 'file_name' => $_FILES['newfile']['name']); $fileHelper->putFile($fields); } - if ($id) { + if ($project_id && $result) { header('Location: projects.php'); exit(); } else diff --git a/project_edit.php b/project_edit.php index 7d8e113d..a0190ff8 100644 --- a/project_edit.php +++ b/project_edit.php @@ -24,6 +24,13 @@ } // End of access checks. +// Use custom fields plugin if it is enabled. +if ($user->isPluginEnabled('cf')) { + require_once('plugins/CustomFields.class.php'); + $custom_fields = new CustomFields(); + $smarty->assign('custom_fields', $custom_fields); +} + $users = ttGroupHelper::getActiveUsers(); foreach ($users as $user_item) $all_users[$user_item['id']] = $user_item['name']; @@ -39,9 +46,33 @@ $cl_status = $request->getParameter('status'); $cl_users = $request->getParameter('users', array()); $cl_tasks = $request->getParameter('tasks', array()); + // If we have project custom fields - collect input. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $control_name = 'project_field_'.$projectField['id']; + $projectCustomFields[$projectField['id']] = array('field_id' => $projectField['id'], + 'control_name' => $control_name, + 'label' => $projectField['label'], + 'type' => $projectField['type'], + 'required' => $projectField['required'], + 'value' => trim($request->getParameter($control_name))); + } + } } else { $cl_name = $project['name']; $cl_description = $project['description']; + // If we have project custom fields - collect values from database. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $control_name = 'project_field_'.$projectField['id']; + $projectCustomFields[$projectField['id']] = array('field_id' => $projectField['id'], + 'control_name' => $control_name, + 'label' => $projectField['label'], + 'type' => $projectField['type'], + 'required' => $projectField['required'], + 'value' => $custom_fields->getEntityFieldValue(CustomFields::ENTITY_PROJECT, $cl_project_id, $projectField['id'], $projectField['type'])); + } + } $cl_status = $project['status']; $cl_users = ttProjectHelper::getAssignedUsers($cl_project_id); $cl_tasks = explode(',', $project['tasks']); @@ -51,6 +82,20 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','value'=>$cl_description)); +// If we have custom fields - add controls for them. +if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + $form->addInput(array('type'=>'text','name'=>$field_name,'value'=>$projectCustomFields[$projectField['id']]['value'])); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $form->addInput(array('type'=>'combobox','name'=>$field_name, + 'data'=>CustomFields::getOptions($projectField['id']), + 'value'=>$projectCustomFields[$projectField['id']]['value'], + 'empty'=>array(''=>$i18n->get('dropdown.select')))); + } + } +} $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status, 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive')))); $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users)); @@ -63,6 +108,13 @@ // Validate user input. if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); + // Validate input in project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($projectCustomFields as $projectField) { + // Validation is the same for text and dropdown fields. + if (!ttValidString($projectField['value'], !$projectField['required'])) $err->add($i18n->get('error.field'), htmlspecialchars($projectField['label'])); + } + } if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_users, 'tt_users')) $err->add($i18n->get('error.field'), $i18n->get('label.users')); if (!ttGroupHelper::validateCheckboxGroupInput($cl_tasks, 'tt_tasks')) $err->add($i18n->get('error.field'), $i18n->get('label.tasks')); @@ -72,28 +124,39 @@ $existing_project = ttProjectHelper::getProjectByName($cl_name); if (!$existing_project || ($cl_project_id == $existing_project['id'])) { // Update project information. - if (ttProjectHelper::update(array( + $result = ttProjectHelper::update(array( 'id' => $cl_project_id, 'name' => $cl_name, 'description' => $cl_description, 'status' => $cl_status, 'users' => $cl_users, - 'tasks' => $cl_tasks))) { + 'tasks' => $cl_tasks)); + // Update project custom fields if we have them. + if ($result && isset($custom_fields) && $custom_fields->projectFields) { + $result = $custom_fields->updateEntityFields(CustomFields::ENTITY_PROJECT, $cl_project_id, $projectCustomFields); + } + if ($result) { header('Location: projects.php'); exit(); - } else + } else $err->add($i18n->get('error.db')); - } else + } else $err->add($i18n->get('error.object_exists')); } if ($request->getParameter('btn_copy')) { if (!ttProjectHelper::getProjectByName($cl_name)) { - if (ttProjectHelper::insert(array('name' => $cl_name, + $project_id = ttProjectHelper::insert(array('name' => $cl_name, 'description' => $cl_description, 'users' => $cl_users, 'tasks' => $cl_tasks, - 'status' => ACTIVE))) { + 'status' => ACTIVE)); + // Insert project custom fields if we have them. + $result = true; + if ($project_id && isset($custom_fields) && $custom_fields->projectFields) { + $result = $custom_fields->insertEntityFields(CustomFields::ENTITY_PROJECT, $project_id, $projectCustomFields); + } + if ($project_id && $result) { header('Location: projects.php'); exit(); } else diff --git a/user_edit.php b/user_edit.php index 6bdbef69..0633e8a1 100644 --- a/user_edit.php +++ b/user_edit.php @@ -199,7 +199,7 @@ function render(&$table, $value, $row, $column, $selected = false) { if ($user->isPluginEnabled('cl') && ttRoleHelper::isClientRole($cl_role_id) && !$cl_client_id) $err->add($i18n->get('error.client')); if (!ttValidStatus($cl_status)) $err->add($i18n->get('error.field'), $i18n->get('label.status')); if (!ttValidFloat($cl_quota_percent, true)) $err->add($i18n->get('error.field'), $i18n->get('label.quota')); - // Validate input in user custom fields. + // Validate input in user custom fields. if (isset($custom_fields) && $custom_fields->userFields) { foreach ($userCustomFields as $userField) { // Validation is the same for text and dropdown fields. From 2700f1d275ac01a18beeae8f9d3cd124fc214193 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 22 Oct 2022 13:51:57 +0000 Subject: [PATCH 217/304] Added a condition on including project custom fields on reports. --- WEB-INF/templates/reports.tpl | 2 +- initialize.php | 2 +- reports.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 370a6d46..6a5ecbbe 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -510,7 +510,7 @@ function handleCheckboxes() { {/foreach} {/if} -{if isset($custom_fields) && $custom_fields->projectFields} +{if $show_project && isset($custom_fields) && $custom_fields->projectFields} {foreach $custom_fields->projectFields as $projectField} {assign var="control_name" value='project_field_'|cat:$projectField['id']} diff --git a/initialize.php b/initialize.php index e6e45730..f31382c7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5733"); +define("APP_VERSION", "1.21.10.5734"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index 2fb61ccd..6d5b441a 100644 --- a/reports.php +++ b/reports.php @@ -316,7 +316,7 @@ } // If we have projects custom fields - add controls for them. -if (isset($custom_fields) && $custom_fields->projectFields) { +if ($showProject && isset($custom_fields) && $custom_fields->projectFields) { foreach ($custom_fields->projectFields as $projectField) { $field_name = 'project_field_'.$projectField['id']; $checkbox_field_name = 'show_'.$field_name; From 318f74cc352cbbbd049077bc61375d7e2d4d6ff1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 22 Oct 2022 19:11:06 +0000 Subject: [PATCH 218/304] Made progress on including project custom fields on reports. --- WEB-INF/lib/ttProjectHelper.class.php | 2 +- WEB-INF/lib/ttReportHelper.class.php | 276 +++++++++++++++++++++++++- WEB-INF/templates/report.tpl | 36 ++++ initialize.php | 2 +- reports.php | 7 + 5 files changed, 318 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/ttProjectHelper.class.php b/WEB-INF/lib/ttProjectHelper.class.php index e6459bd0..bd166e86 100644 --- a/WEB-INF/lib/ttProjectHelper.class.php +++ b/WEB-INF/lib/ttProjectHelper.class.php @@ -166,7 +166,7 @@ static function getProjectByName($name) { } - // delete - deletes things associated with a project and marks the project as deleted. + // delete - deletes things associated with a project and marks the project and its custom fields as deleted. static function delete($id) { global $user; $mdb2 = getConnection(); diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 056f4d4f..85c4d80b 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -108,6 +108,30 @@ static function getWhere($options) { } } + // Add project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + if ($projectField['type'] == CustomFields::TYPE_DROPDOWN && $field_value) { + $cfoTable = 'cfo'.$projectField['id']; + $dropdown_parts .= " and $cfoTable.id = $field_value"; + } + } + } + + // Continue preparing part for text custom fields using LIKE operator. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + if ($projectField['type'] == CustomFields::TYPE_TEXT && $field_value) { + $ecfTableName = 'ecf'.$projectField['id']; + $cf_text_parts .= " and $ecfTableName.value like ".$mdb2->quote("%$field_value%"); + } + } + } + // Prepare sql query part for user list. $userlist = isset($options['users']) ? $options['users'] : '-1'; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) @@ -196,6 +220,30 @@ static function getExpenseWhere($options) { } } + // Add project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + if ($projectField['type'] == CustomFields::TYPE_DROPDOWN && $field_value) { + $cfoTable = 'cfo'.$projectField['id']; + $dropdown_parts .= " and $cfoTable.id = $field_value"; + } + } + } + + // Continue prparing parts for text custom fields using LIKE operator. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + if ($projectField['type'] == CustomFields::TYPE_TEXT && $field_value) { + $ecfTableName = 'ecf'.$projectField['id']; + $cf_text_parts .= " and $ecfTableName.value like ".$mdb2->quote("%$field_value%"); + } + } + } + // Prepare sql query part for user list. $userlist = isset($options['users']) ? $options['users'] : '-1'; if ($user->can('view_reports') || $user->can('view_all_reports') || $user->isClient()) @@ -306,6 +354,22 @@ static function getItems($options) { } } } + // Add project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + if ($options[$checkbox_field_name] || ttReportHelper::groupingBy($field_name, $options)) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + $ecfTableName = 'ecf'.$projectField['id']; + array_push($fields, "$ecfTableName.value as $field_name"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTableName = 'cfo'.$projectField['id']; + array_push($fields, "$cfoTableName.value as $field_name"); + } + } + } + } // Add start time. if ($options['show_start']) { array_push($fields, "l.start as unformatted_start"); @@ -372,8 +436,7 @@ static function getItems($options) { // Prepare sql query part for left joins. $left_joins = null; - // Left joins for custom fields. - // 1 join is required for each text field, 2 joins for each dropdown. + // Left joins for user custom fields. if (isset($custom_fields) && $custom_fields->userFields) { foreach ($custom_fields->userFields as $userField) { $field_name = 'user_field_'.$userField['id']; @@ -393,6 +456,26 @@ static function getItems($options) { } } } + // Left joins for project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($options[$field_name] || $options[$checkbox_field_name] || ttReportHelper::groupingBy($field_name, $options)) { + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } if ($options['show_client'] || $grouping_by_client) $left_joins .= " left join tt_clients c on (c.id = l.client_id)"; if (($canViewReports || $isClient) && $options['show_invoice']) @@ -495,6 +578,22 @@ static function getItems($options) { } } } + // Add project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + if ($options[$checkbox_field_name] || ttReportHelper::groupingBy($field_name, $options)) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + $ecfTableName = 'ecf'.$projectField['id']; + array_push($fields, "$ecfTableName.value as $field_name"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTableName = 'cfo'.$projectField['id']; + array_push($fields, "$cfoTableName.value as $field_name"); + } + } + } + } if ($options['show_start']) { array_push($fields, 'null'); // null for unformatted_start. array_push($fields, 'null'); // null for start. @@ -557,6 +656,26 @@ static function getItems($options) { } } } + // Left joins for project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($options[$field_name] || $options[$checkbox_field_name] || ttReportHelper::groupingBy($field_name, $options)) { + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } if ($canViewReports || $isClient) $left_joins .= " left join tt_users u on (u.id = ei.user_id)"; if ($options['show_client'] || $grouping_by_client) @@ -826,6 +945,26 @@ static function getTotals($options) } } } + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($field_value) { + // We need to add left joins when input is not null. + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } if (isset($options['show_cost']) && $options['show_cost']) { if (MODE_TIME == $trackingMode) { $left_joins .= " left join tt_users u on (l.user_id = u.id)"; @@ -876,6 +1015,26 @@ static function getTotals($options) } } } + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($field_value) { + // We need to add left joins when input is not null. + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } $sql_for_expenses .= ", sum(cost) as cost, sum(cost) as expenses from tt_expense_items ei $left_joins $where"; @@ -1617,7 +1776,15 @@ static function getReportOptions($bean) { } } - // TODO: add project fields here. + // Project fields. + if ($custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $control_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$control_name; + $options[$control_name] = $bean->getAttribute($control_name); + $options[$checkbox_control_name] = $bean->getAttribute($checkbox_control_name); + } + } } $options['group_by1'] = $bean->getAttribute('group_by1'); @@ -1795,6 +1962,19 @@ static function makeSingleDropdownConcatCustomFieldPart($dropdown_value) { } } } + // Iterate through project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($dropdown_value == $field_name) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + return (", ' - ', coalesce(ecf".$projectField['id'].".value, 'Null')"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + return (", ' - ', coalesce(cfo".$projectField['id'].".value, 'Null')"); + } + } + } + } // Iterate through time custom fields. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { @@ -1829,6 +2009,19 @@ static function makeSingleDropdownConcatCustomFieldExpensesPart($dropdown_value) } } } + // Iterate through project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($dropdown_value == $field_name) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + return (", ' - ', coalesce(ecf".$projectField['id'].".value, 'Null')"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + return (", ' - ', coalesce(cfo".$projectField['id'].".value, 'Null')"); + } + } + } + } // Iterate through time custom fields. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { @@ -1882,6 +2075,19 @@ static function makeSingleDropdownGroupByCustomFieldPart($dropdown_value) { } } } + // Iterate through project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($dropdown_value == $field_name) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + return (", ecf".$projectField['id'].".value as $field_name"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + return (", cfo".$projectField['id'].".value as $field_name"); + } + } + } + } // Iterate through time custom fields. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { @@ -1916,6 +2122,19 @@ static function makeSingleDropdownGroupByCustomFieldExpensesPart($dropdown_value } } } + // Iterate through project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($dropdown_value == $field_name) { + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + return (", ecf".$projectField['id'].".value as $field_name"); + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + return (", cfo".$projectField['id'].".value as $field_name"); + } + } + } + } // Iterate through time custom fields. if ($custom_fields && $custom_fields->timeFields) { foreach ($custom_fields->timeFields as $timeField) { @@ -2151,6 +2370,27 @@ static function makeJoinPart($options) { } } } + // Left joins for project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($field_value || ttReportHelper::groupingBy($field_name, $options)) { + // We need to add left joins when input is not null. + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = l.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } // Prepare inner joins. $inner_joins = null; @@ -2240,6 +2480,27 @@ static function makeJoinExpensesPart($options) { } } } + // Left joins for project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = $options[$field_name]; + $entity_type = CustomFields::ENTITY_PROJECT; + if ($field_value || ttReportHelper::groupingBy($field_name, $options)) { + // We need to add left joins when input is not null. + $ecfTable = 'ecf'.$projectField['id']; + if ($projectField['type'] == CustomFields::TYPE_TEXT) { + // Add one join for each text field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + } elseif ($projectField['type'] == CustomFields::TYPE_DROPDOWN) { + $cfoTable = 'cfo'.$projectField['id']; + // Add two joins for each dropdown field. + $left_joins .= " left join tt_entity_custom_fields $ecfTable on ($ecfTable.entity_type = $entity_type and $ecfTable.entity_id = ei.project_id and $ecfTable.field_id = ".$projectField['id'].")"; + $left_joins .= " left join tt_custom_field_options $cfoTable on ($cfoTable.field_id = $ecfTable.field_id and $cfoTable.id = $ecfTable.option_id)"; + } + } + } + } return $left_joins; } @@ -2299,6 +2560,15 @@ static function makeGroupByHeaderPart($dropdown_value) { } } } + // Process project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + if ($dropdown_value == $field_name) { + return $projectField['label']; + } + } + } // Return null if nothing is found. return null; diff --git a/WEB-INF/templates/report.tpl b/WEB-INF/templates/report.tpl index 3bd9f448..b63e505f 100644 --- a/WEB-INF/templates/report.tpl +++ b/WEB-INF/templates/report.tpl @@ -47,6 +47,13 @@ License: See license.txt *} {/if} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} + {* project custom fields *} + {if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + {if $bean->getAttribute($checkbox_control_name)}{/if} + {/foreach} + {/if} {if $bean->getAttribute('chtask')}{/if} {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} @@ -91,6 +98,13 @@ License: See license.txt *} {/if} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} + {* project custom fields *} + {if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + {if $bean->getAttribute($checkbox_control_name)}{/if} + {/foreach} + {/if} {if $bean->getAttribute('chtask')}{/if} {* time custom fields *} @@ -136,6 +150,14 @@ License: See license.txt *} {/if} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} + {* project custom fields *} + {if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="control_name" value='project_field_'|cat:$projectField['id']} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + {if $bean->getAttribute($checkbox_control_name)}{/if} + {/foreach} + {/if} {if $bean->getAttribute('chtask')}{/if} {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} @@ -198,6 +220,13 @@ License: See license.txt *} {/if} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} + {* project custom fields *} + {if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + {if $bean->getAttribute($checkbox_control_name)}{/if} + {/foreach} + {/if} {if $bean->getAttribute('chtask')}{/if} {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} @@ -239,6 +268,13 @@ License: See license.txt *} {/if} {if $bean->getAttribute('chclient')}{/if} {if $bean->getAttribute('chproject')}{/if} + {* project custom fields *} + {if isset($custom_fields) && $custom_fields->projectFields} + {foreach $custom_fields->projectFields as $projectField} + {assign var="checkbox_control_name" value='show_project_field_'|cat:$projectField['id']} + {if $bean->getAttribute($checkbox_control_name)}{/if} + {/foreach} + {/if} {if $bean->getAttribute('chtask')}{/if} {* time custom fields *} {if isset($custom_fields) && $custom_fields->timeFields} diff --git a/initialize.php b/initialize.php index f31382c7..90cd7347 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5734"); +define("APP_VERSION", "1.21.10.5735"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index 6d5b441a..057787e7 100644 --- a/reports.php +++ b/reports.php @@ -357,6 +357,13 @@ $group_by_options[$field_name] = $userField['label']; } } +// If we have project custom fields - add group by options for them. +if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $group_by_options[$field_name] = $projectField['label']; + } +} $group_by_options_size = sizeof($group_by_options); $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by1','data'=>$group_by_options)); if ($group_by_options_size > 2) $form->addInput(array('type'=>'combobox','onchange'=>'handleCheckboxes();','name'=>'group_by2','data'=>$group_by_options)); From 3837b1a97765e4533b3aa4baf13cc9c78cc6a3fe Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 23 Oct 2022 15:29:04 +0000 Subject: [PATCH 219/304] Fixed pdf reports for per hour cost column, fixed all report exports for project custom fields. --- WEB-INF/lib/common.lib.php | 14 +++++++-- WEB-INF/lib/ttReportHelper.class.php | 11 +++++-- initialize.php | 2 +- tofile.php | 24 ++++++++++++++++ topdf.php | 43 ++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 5 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 2d8e287d..370816cb 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -555,7 +555,7 @@ function ttMitigateCSRF() { return true; } -// ttStartsWith functions checks if a string starts with a given substring. +// ttStartsWith function checks if a string starts with a given substring. function ttStartsWith($string, $startString) { if (is_null($string)) @@ -565,7 +565,7 @@ function ttStartsWith($string, $startString) return (substr($string, 0, $len) === $startString); } -// ttEndsWith functions checks if a string ends with a given substring. +// ttEndsWith function checks if a string ends with a given substring. function ttEndsWith($string, $endString) { $len = strlen($endString); @@ -573,6 +573,16 @@ function ttEndsWith($string, $endString) return (substr($string, -$len) === $endString); } +// ttContains functions checks if a string contains a given substring. +function ttContains($string, $part) +{ + // Note: in php8 we can use str_contanins. + if (strpos($string, $part) !== false) + return true; + + return false; +} + // ttDateToUserFormat converts a date from database format to user format. function ttDateToUserFormat($date) { diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 85c4d80b..6cfc1464 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -232,7 +232,7 @@ static function getExpenseWhere($options) { } } - // Continue prparing parts for text custom fields using LIKE operator. + // Continue preparing parts for text custom fields using LIKE operator. if (isset($custom_fields) && $custom_fields->projectFields) { foreach ($custom_fields->projectFields as $projectField) { $field_name = 'project_field_'.$projectField['id']; @@ -2533,7 +2533,7 @@ static function makeGroupByHeaderPart($dropdown_value) { // First, try to get a label from a translation file, which is the most likely scenario // such as grouping by date, user, project, or task. - if (!ttStartsWith($dropdown_value, 'time_field_') && !ttStartsWith($dropdown_value, 'user_field_')) { + if (!ttContains($dropdown_value, '_field_')) { $key = 'label.'.$dropdown_value; $part = $i18n->get($key); if ($part) return $part; @@ -2605,6 +2605,13 @@ static function makeGroupByHeader($options) { // makeGroupByXmlTag creates an xml tag for a totals only report using group_by1, // group_by2, and group_by3 values passed in $options. static function makeGroupByXmlTag($options) { + // Note: there is a problem with this function for custom fields. + // Returned xml tags are like "project_field_1134" and not their user entered labels. + // This is on purpose because we are trying to avoid potential XML parsing problems. + // See https://stackoverflow.com/questions/1478486/using-in-xml-element-name + // Perhaps review this if someone complains, but there are W3C standard (section 2.3) rules + // on names (including starting character). + $tag = ''; if ($options['group_by1'] != null && $options['group_by1'] != 'no_grouping') { // We have group_by1. diff --git a/initialize.php b/initialize.php index 90cd7347..d24ca7fa 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.10.5735"); +define("APP_VERSION", "1.21.11.5736"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/tofile.php b/tofile.php index 6ea39ad8..0134885f 100644 --- a/tofile.php +++ b/tofile.php @@ -106,6 +106,14 @@ } if ($bean->getAttribute('chclient')) print "\t\n"; if ($bean->getAttribute('chproject')) print "\t\n"; + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) print "\t<$field_name>\n"; + } + } if ($bean->getAttribute('chtask')) print "\t\n"; // Time custom fields. if (isset($custom_fields) && $custom_fields->timeFields) { @@ -206,6 +214,14 @@ } if ($bean->getAttribute('chclient')) print ',"'.$i18n->get('label.client').'"'; if ($bean->getAttribute('chproject')) print ',"'.$i18n->get('label.project').'"'; + // Project custom field labels. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) print ',"'.ttNeutralizeForCsv($projectField['label']).'"'; + } + } if ($bean->getAttribute('chtask')) print ',"'.$i18n->get('label.task').'"'; // Time custom field labels. if (isset($custom_fields) && $custom_fields->timeFields) { @@ -246,6 +262,14 @@ } if ($bean->getAttribute('chclient')) print ',"'.ttNeutralizeForCsv($item['client']).'"'; if ($bean->getAttribute('chproject')) print ',"'.ttNeutralizeForCsv($item['project']).'"'; + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) print ',"'.ttNeutralizeForCsv($item[$field_name]).'"'; + } + } if ($bean->getAttribute('chtask')) print ',"'.ttNeutralizeForCsv($item['task']).'"'; // Time custom fields. if (isset($custom_fields) && $custom_fields->timeFields) { diff --git a/topdf.php b/topdf.php index 931fa814..4e1e677d 100644 --- a/topdf.php +++ b/topdf.php @@ -139,6 +139,14 @@ } if ($bean->getAttribute('chclient')) { $colspan++; $html .= ''; } if ($bean->getAttribute('chproject')) { $colspan++; $html .= ''; } + // Project custom field labels. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) { $colspan++; $html .= ''; } + } + } if ($bean->getAttribute('chtask')) { $colspan++; $html .= ''; } // Time custom field labels. if (isset($custom_fields) && $custom_fields->timeFields) { @@ -194,6 +202,14 @@ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']); $html .= ''; } + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) $html .= ''; + } + } if ($bean->getAttribute('chtask')) { $html .= ''; if ($bean->getAttribute('chunits')) $html .= "'; if ($show_note_column) $html .= ''; + if ($bean->getAttribute('chcost') && $show_cost_per_hour) $html .= ''; if ($bean->getAttribute('chcost')) { $html .= "'; if ($bean->getAttribute('chproject')) $html .= ''; + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) $html .= ''; + } + } if ($bean->getAttribute('chtask')) $html .= ''; // Time custom fields. if (isset($custom_fields) && $custom_fields->timeFields) { @@ -339,6 +364,14 @@ $html .= htmlspecialchars($subtotals[$prev_grouped_by]['project']); $html .= ''; } + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) $html .= ''; + } + } if ($bean->getAttribute('chtask')) { $html .= ''; if ($bean->getAttribute('chunits')) $html .= "'; if ($show_note_column) $html .= ''; + if ($bean->getAttribute('chcost') && $show_cost_per_hour) $html .= ''; if ($bean->getAttribute('chcost')) { $html .= "'; if ($bean->getAttribute('chproject')) $html .= ''; + // Project custom fields. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($bean->getAttribute($checkbox_control_name)) $html .= ''; + } + } if ($bean->getAttribute('chtask')) $html .= ''; // Time custom fields. if (isset($custom_fields) && $custom_fields->timeFields) { @@ -402,6 +444,7 @@ if ($bean->getAttribute('chduration')) $html .= "'; if ($bean->getAttribute('chunits')) $html .= "'; if ($show_note_column) $html .= ''; + if ($bean->getAttribute('chcost') && $show_cost_per_hour) $html .= ''; if ($bean->getAttribute('chcost')) { $html .= "'; if ($options['show_project']) $body .= ''; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $body .= ''; + } + } if ($options['show_task']) $body .= ''; // Time custom fields. @@ -1412,6 +1428,14 @@ static function prepareReportBody($options, $comment = null) } if ($options['show_client']) $body .= ''; if ($options['show_project']) $body .= ''; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $body .= ''; + } + } if ($options['show_task']) $body .= ''; // Time custom fields. if ($custom_fields && $custom_fields->timeFields) { @@ -1462,6 +1486,14 @@ static function prepareReportBody($options, $comment = null) $body .= ''; if ($options['show_project']) $body .= ''; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $body .= ''; + } + } if ($options['show_task']) $body .= ''; // Time custom fields. @@ -1534,6 +1566,14 @@ static function prepareReportBody($options, $comment = null) } if ($options['show_client']) $body .= ''; if ($options['show_project']) $body .= ''; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $body .= ''; + } + } if ($options['show_task']) $body .= ''; // Time custom fields. if ($custom_fields && $custom_fields->timeFields) { @@ -1577,6 +1617,14 @@ static function prepareReportBody($options, $comment = null) } if ($options['show_client']) $body .= ''; if ($options['show_project']) $body .= ''; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $body .= ''; + } + } if ($options['show_task']) $body .= ''; // Time custom fields. if ($custom_fields && $custom_fields->timeFields) { diff --git a/initialize.php b/initialize.php index d24ca7fa..d310471e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.11.5736"); +define("APP_VERSION", "1.21.11.5737"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 95481ddf41d2914555d8b48b6dcfd7acb7aa25f1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 23 Oct 2022 16:15:16 +0000 Subject: [PATCH 221/304] Fixed fav reports to keep project custom fields settings. --- WEB-INF/lib/ttFavReportHelper.class.php | 23 +++++++++++++++++++++++ initialize.php | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index df756649..0d8cc071 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -328,6 +328,17 @@ static function loadReport(&$bean) { $bean->setAttribute($checkbox_field_name, $checkbox_value); } } + // Project custom field settings. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + $field_value = ttFavReportHelper::getFieldSettingFromReportSpec($field_name, $report_spec); + $bean->setAttribute($field_name, $field_value); + $checkbox_value = ttFavReportHelper::getFieldSettingFromReportSpec($checkbox_field_name, $report_spec); + $bean->setAttribute($checkbox_field_name, $checkbox_value); + } + } } $bean->setAttribute('client', $val['client_id']); @@ -579,6 +590,18 @@ static function makeReportSpec($bean) { } } + // Add project custom field settings. + if (isset($custom_fields) && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $field_value = str_replace(',',',',$bean->getAttribute($field_name)); + $checkbox_field_name = 'show_'.$field_name; + $checkbox_field_value = (int) $bean->getAttribute($checkbox_field_name); + if ($field_value) $reportSpecArray[] = $field_name.':'.$field_value; + if ($checkbox_field_value) $reportSpecArray[] = $checkbox_field_name.':1'; + } + } + $reportSpec = null; if (isset($reportSpecArray)) $reportSpec = implode(',', $reportSpecArray); diff --git a/initialize.php b/initialize.php index d310471e..5ff39645 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.11.5737"); +define("APP_VERSION", "1.21.11.5738"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 10713c13048462dbd2c33c7cc38492f4c7a140af Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 23 Oct 2022 16:24:37 +0000 Subject: [PATCH 222/304] Fixed adjusting fav report options for cron. --- WEB-INF/lib/ttFavReportHelper.class.php | 12 +++++++++++- initialize.php | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/ttFavReportHelper.class.php b/WEB-INF/lib/ttFavReportHelper.class.php index 0d8cc071..00a1bd5b 100644 --- a/WEB-INF/lib/ttFavReportHelper.class.php +++ b/WEB-INF/lib/ttFavReportHelper.class.php @@ -541,7 +541,17 @@ static function adjustOptions($options) { $options[$checkbox_field_name] = $checkbox_value; } } - // TODO: add project fields here. + // Project fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_field_name = 'show_'.$field_name; + $field_value = ttFavReportHelper::getFieldSettingFromReportSpec($field_name, $report_spec); + $options[$field_name] = $field_value; + $checkbox_value = ttFavReportHelper::getFieldSettingFromReportSpec($checkbox_field_name, $report_spec); + $options[$checkbox_field_name] = $checkbox_value; + } + } } // Adjust period_start and period_end to user date format. diff --git a/initialize.php b/initialize.php index 5ff39645..5fd8012f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.11.5738"); +define("APP_VERSION", "1.21.11.5739"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 00a75a7ed04fa22de4211891580deee454f04ec2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 23 Oct 2022 16:32:14 +0000 Subject: [PATCH 223/304] Initial implementation of project custom fields. --- cf_custom_field_add.php | 17 +++++------------ initialize.php | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index 38d67282..c1080375 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -27,18 +27,11 @@ $form = new Form('fieldForm'); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>'')); -if (defined('DEBUG_PROJECT_CUSTOM_FIELDS')) { - $form->addInput(array('type'=>'combobox','name'=>'entity', - 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), - CustomFields::ENTITY_USER=>$i18n->get('entity.user'), - CustomFields::ENTITY_PROJECT=>$i18n->get('entity.project')) - )); -} else { - $form->addInput(array('type'=>'combobox','name'=>'entity', - 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), - CustomFields::ENTITY_USER=>$i18n->get('entity.user')) - )); -} +$form->addInput(array('type'=>'combobox','name'=>'entity', + 'data'=>array(CustomFields::ENTITY_TIME=>$i18n->get('entity.time'), + CustomFields::ENTITY_USER=>$i18n->get('entity.user'), + CustomFields::ENTITY_PROJECT=>$i18n->get('entity.project')) +)); $form->addInput(array('type'=>'combobox','name'=>'type', 'data'=>array(CustomFields::TYPE_TEXT=>$i18n->get('label.type_text'), CustomFields::TYPE_DROPDOWN=>$i18n->get('label.type_dropdown')) diff --git a/initialize.php b/initialize.php index 5fd8012f..552e5e2c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.11.5739"); +define("APP_VERSION", "1.21.12.5740"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From c0ae1e6d07f2a64e4d54e47133b5bfda29ffcf87 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 25 Oct 2022 16:26:46 +0000 Subject: [PATCH 224/304] Added a what is it link explaining note cotaining option in reports. --- WEB-INF/templates/reports.tpl | 5 ++++- initialize.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 6a5ecbbe..42cdd661 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -358,7 +358,10 @@ function handleCheckboxes() { - +
{$forms.projectForm.description.control}
{$forms.projectForm.$control_name.control}
{$forms.projectForm.description.control}
{$forms.projectForm.$control_name.control}
{$i18n.form.reports.project_fields}
{$i18n.label.client}{$i18n.label.project}{{$projectField['label']|escape}}{$i18n.label.task}{$subtotals[$prev_grouped_by]['client']|escape}{$subtotals[$prev_grouped_by]['project']|escape}{$subtotals[$prev_grouped_by]['task']|escape}{$item.client|escape}{$item.project|escape}{$item.$control_name|escape}{$item.task|escape}{$subtotals[$cur_grouped_by]['client']|escape}{$subtotals[$cur_grouped_by]['project']|escape}{$subtotals[$cur_grouped_by]['task']|escape}'.$i18n->get('label.client').''.$i18n->get('label.project').''.htmlspecialchars($projectField['label']).''.$i18n->get('label.task').''; $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']); @@ -212,6 +228,7 @@ if ($bean->getAttribute('chduration')) $html .= "".$subtotals[$prev_grouped_by]['time'].'".$subtotals[$prev_grouped_by]['units'].'"; if ($user->can('manage_invoices') || $user->isClient()) @@ -254,6 +271,14 @@ } if ($bean->getAttribute('chclient')) $html .= ''.htmlspecialchars($item['client']).''.htmlspecialchars($item['project']).''.htmlspecialchars($item[$field_name]).''.htmlspecialchars($item['task']).''; $html .= htmlspecialchars($subtotals[$prev_grouped_by]['task']); @@ -357,6 +390,7 @@ if ($bean->getAttribute('chduration')) $html .= "".$subtotals[$prev_grouped_by]['time'].'".$subtotals[$prev_grouped_by]['units'].'"; if ($user->can('manage_invoices') || $user->isClient()) @@ -388,6 +422,14 @@ } if ($bean->getAttribute('chclient')) $html .= '".$totals['time'].'".$totals['units'].'".htmlspecialchars($user->currency).' '; if ($user->can('manage_invoices') || $user->isClient()) From 0ec60fc296df0ca7447db3e2b725c8bbcac24e39 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 23 Oct 2022 15:46:07 +0000 Subject: [PATCH 220/304] Fixed emailed reports to handle project custom fields. --- WEB-INF/lib/common.lib.php | 2 +- WEB-INF/lib/ttReportHelper.class.php | 48 ++++++++++++++++++++++++++++ initialize.php | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 370816cb..0f38f80f 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -573,7 +573,7 @@ function ttEndsWith($string, $endString) return (substr($string, -$len) === $endString); } -// ttContains functions checks if a string contains a given substring. +// ttContains function checks if a string contains a given substring. function ttContains($string, $part) { // Note: in php8 we can use str_contanins. diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php index 6cfc1464..a3f89449 100644 --- a/WEB-INF/lib/ttReportHelper.class.php +++ b/WEB-INF/lib/ttReportHelper.class.php @@ -1232,6 +1232,14 @@ static function prepareReportBody($options, $comment = null) } if ($options['show_client']) $colspan++; if ($options['show_project']) $colspan++; + // Project custom fields. + if ($custom_fields && $custom_fields->projectFields) { + foreach ($custom_fields->projectFields as $projectField) { + $field_name = 'project_field_'.$projectField['id']; + $checkbox_control_name = 'show_'.$field_name; + if ($options[$checkbox_control_name]) $colspan++; + } + } if ($options['show_task']) $colspan++; // Time custom fields. if ($custom_fields && $custom_fields->timeFields) { @@ -1342,6 +1350,14 @@ static function prepareReportBody($options, $comment = null) $body .= ''.$i18n->get('label.client').''.$i18n->get('label.project').''.htmlspecialchars($projectField['label']).''.$i18n->get('label.task').''.$subtotals[$prev_grouped_by]['client'].''.$subtotals[$prev_grouped_by]['project'].''.$subtotals[$prev_grouped_by]['task'].''.htmlspecialchars($record['client']).''.htmlspecialchars($record['project']).''.htmlspecialchars($record[$field_name]).''.htmlspecialchars($record['task']).''.$subtotals[$prev_grouped_by]['client'].''.$subtotals[$prev_grouped_by]['project'].''.$subtotals[$prev_grouped_by]['task'].'
{$forms.reportForm.note_containing.control}{$forms.reportForm.note_containing.control} + {$i18n.label.what_is_it} + {$i18n.label.what_is_it} +
diff --git a/initialize.php b/initialize.php index 552e5e2c..0e90ef89 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.12.5740"); +define("APP_VERSION", "1.21.12.5741"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 3102ef6e950150eccccee5f63922bf25fae8a83c Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 27 Oct 2022 15:18:50 +0000 Subject: [PATCH 225/304] Version change for 1.22 release. --- initialize.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index 0e90ef89..7fcb17aa 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.21.12.5741"); +define("APP_VERSION", "1.22.0.5742"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From c4d2026603df8fa31a31f2ea440df436d67df7a7 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 27 Oct 2022 19:55:16 +0000 Subject: [PATCH 226/304] Addressed some php8 warnings. --- WEB-INF/lib/ttUser.class.php | 2 +- WEB-INF/lib/ttWeekViewHelper.class.php | 108 +++++++++++++++++++------ initialize.php | 2 +- 3 files changed, 86 insertions(+), 26 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index e0565b3d..2e7ff279 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -682,7 +682,7 @@ function updateGroup($fields) { $name_part = $description_part = $currency_part = $lang_part = $decimal_mark_part = $date_format_part = $time_format_part = $week_start_part = $tracking_mode_part = $project_required_part = $record_type_part = $bcc_email_part = $allow_ip_part = - $plugins_part = $config_part = $custom_css_part = $lock_spec_part = $holidays_part = $workday_minutes_part = ''; + $password_complexity_part = $plugins_part = $config_part = $custom_css_part = $lock_spec_part = $holidays_part = $workday_minutes_part = ''; if (isset($fields['name'])) $name_part = ', name = '.$mdb2->quote($fields['name']); if (isset($fields['description'])) $description_part = ', description = '.$mdb2->quote($fields['description']); if (isset($fields['currency'])) $currency_part = ', currency = '.$mdb2->quote($fields['currency']); diff --git a/WEB-INF/lib/ttWeekViewHelper.class.php b/WEB-INF/lib/ttWeekViewHelper.class.php index 9908d12b..4ee5346a 100644 --- a/WEB-INF/lib/ttWeekViewHelper.class.php +++ b/WEB-INF/lib/ttWeekViewHelper.class.php @@ -167,22 +167,37 @@ static function getDataForWeekView($records, $dayHeaders) { global $i18n; $dataArray = array(); + $includeWeekends = $user->isOptionEnabled('weekends'); $includeNotes = $user->isOptionEnabled('week_notes'); // Construct the first row for a brand new entry. $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row. // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = '0_'. $dayHeaders[$i]; - $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = '0_'. $dayHeaders[$i]; + $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = '0_'. $dayHeaders[$i]; + $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } } if ($includeNotes) { // Construct the second row for daily comments for a brand new entry. $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row. // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = '1_'. $dayHeaders[$i]; - $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = '1_'. $dayHeaders[$i]; + $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = '1_'. $dayHeaders[$i]; + $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } } } @@ -205,18 +220,32 @@ static function getDataForWeekView($records, $dayHeaders) { $dataArray[] = array('row_id' => $row_id,'label' => ttWeekViewHelper::makeRowLabel($record)); $pos = ttWeekViewHelper::findRow($row_id, $dataArray); // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = $pos.'_'. $dayHeaders[$i]; - $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } } // Insert row for comments. if ($includeNotes) { $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':'); $pos++; // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = $pos.'_'. $dayHeaders[$i]; - $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } } $pos--; } @@ -267,21 +296,38 @@ static function prePopulateFromPastWeeks($startDate, $dayHeaders) { } } + // We will need this for iterations below. + $includeWeekends = $user->isOptionEnabled('weekends'); + // Construct the first row for a brand new entry. $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row. // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = '0_'. $dayHeaders[$i]; - $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = '0_'. $dayHeaders[$i]; + $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = '0_'. $dayHeaders[$i]; + $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } } $includeNotes = $user->isOptionEnabled('week_notes'); if ($includeNotes) { // Construct the second row for daily comments for a brand new entry. $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row. // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = '1_'. $dayHeaders[$i]; - $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = '1_'. $dayHeaders[$i]; + $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = '1_'. $dayHeaders[$i]; + $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } } } @@ -296,18 +342,32 @@ static function prePopulateFromPastWeeks($startDate, $dayHeaders) { $dataArray[] = array('row_id' => $row_id,'label' => ttWeekViewHelper::makeRowLabel($record)); $pos = ttWeekViewHelper::findRow($row_id, $dataArray); // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = $pos.'_'. $dayHeaders[$i]; - $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null); + } } // Insert row for comments. if ($includeNotes) { $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':'); $pos++; // Insert empty cells with proper control ids. - for ($i = 0; $i < 7; $i++) { - $control_id = $pos.'_'. $dayHeaders[$i]; - $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + if ($includeWeekends) { + for ($i = 0; $i < 7; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } + } else { + for ($i = 1; $i < 6; $i++) { + $control_id = $pos.'_'. $dayHeaders[$i]; + $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null); + } } $pos--; } diff --git a/initialize.php b/initialize.php index 7fcb17aa..04f1245c 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.0.5742"); +define("APP_VERSION", "1.22.0.5743"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From c2c48e291c4b12bb2e8fb5c64fc25ea5d1ae17b5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 28 Oct 2022 13:57:06 +0000 Subject: [PATCH 227/304] Fixed a bug on week view related to locking. Addressed a few php8 warnings. --- WEB-INF/templates/charts.tpl | 2 +- WEB-INF/templates/expenses.tpl | 2 +- WEB-INF/templates/time.tpl | 2 +- WEB-INF/templates/timesheets.tpl | 2 +- WEB-INF/templates/week.tpl | 2 +- initialize.php | 2 +- week.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WEB-INF/templates/charts.tpl b/WEB-INF/templates/charts.tpl index ff15ea8f..b38988e8 100644 --- a/WEB-INF/templates/charts.tpl +++ b/WEB-INF/templates/charts.tpl @@ -25,7 +25,7 @@ function adjustTodayLinks() {
{$forms.chartForm.date.control}
-{if $user_dropdown} +{if isset($user_dropdown)} diff --git a/WEB-INF/templates/expenses.tpl b/WEB-INF/templates/expenses.tpl index 5b1da05f..859ae350 100644 --- a/WEB-INF/templates/expenses.tpl +++ b/WEB-INF/templates/expenses.tpl @@ -119,7 +119,7 @@ function recalculateCost() {
{$forms.expensesForm.date.control}
{$forms.chartForm.date.control}
-{if $user_dropdown} +{if isset($user_dropdown)} diff --git a/WEB-INF/templates/time.tpl b/WEB-INF/templates/time.tpl index b601531b..fa24e806 100644 --- a/WEB-INF/templates/time.tpl +++ b/WEB-INF/templates/time.tpl @@ -23,7 +23,7 @@ function handleStop(buttonElement) {
{$forms.timeRecordForm.date.control}
{$forms.expensesForm.date.control}
-{if $user_dropdown} +{if isset($user_dropdown)} diff --git a/WEB-INF/templates/timesheets.tpl b/WEB-INF/templates/timesheets.tpl index e5f9abdb..2bd92736 100644 --- a/WEB-INF/templates/timesheets.tpl +++ b/WEB-INF/templates/timesheets.tpl @@ -7,7 +7,7 @@ License: See license.txt *} {$forms.timesheetsForm.open}
{$forms.timeRecordForm.date.control}
-{if $user_dropdown} +{if isset($user_dropdown)} diff --git a/WEB-INF/templates/week.tpl b/WEB-INF/templates/week.tpl index 74e94053..6032d4eb 100644 --- a/WEB-INF/templates/week.tpl +++ b/WEB-INF/templates/week.tpl @@ -28,7 +28,7 @@ function fillDropdowns() {
{$forms.weekTimeForm.date.control}
-{if $user_dropdown} +{if isset($user_dropdown)} diff --git a/initialize.php b/initialize.php index 04f1245c..1ebbab82 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.0.5743"); +define("APP_VERSION", "1.22.1.5744"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/week.php b/week.php index 302e4dfb..9d96abfb 100644 --- a/week.php +++ b/week.php @@ -228,7 +228,7 @@ function render(&$table, $value, $row, $column, $selected = false) { $field = new TextField($field_name); // Disable control if the date is locked. global $lockedDays; - if ($lockedDays[$column-1]) + if ($lockedDays[$column]) $field->setEnabled(false); $field->setFormName($table->getFormName()); $field->setStyle('width: 60px;'); // TODO: need to style everything properly, eventually. From 50796b8d606dae53f1c39fa08e44be4f86e863f4 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 28 Oct 2022 15:40:46 +0000 Subject: [PATCH 228/304] Addressed a few more php8 warnings. --- WEB-INF/lib/ttUser.class.php | 2 +- WEB-INF/lib/ttUserHelper.class.php | 3 ++- initialize.php | 2 +- topdf.php | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 2e7ff279..b32c2779 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -151,7 +151,7 @@ function __construct($login, $id = null) { // getUser returns user id on behalf of whom the current user is operating. function getUser() { - return ($this->behalfUser ? $this->behalfUser->id : $this->id); + return (isset($this->behalfUser) ? $this->behalfUser->id : $this->id); } // getName returns user name on behalf of whom the current user is operating. diff --git a/WEB-INF/lib/ttUserHelper.class.php b/WEB-INF/lib/ttUserHelper.class.php index 122c7889..2aeada43 100644 --- a/WEB-INF/lib/ttUserHelper.class.php +++ b/WEB-INF/lib/ttUserHelper.class.php @@ -68,7 +68,8 @@ static function getUserIdByTmpRef($ref) { if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); - return $val['user_id']; + if ($val) + return $val['user_id']; } return false; } diff --git a/initialize.php b/initialize.php index 1ebbab82..432cbb89 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.1.5744"); +define("APP_VERSION", "1.22.1.5745"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/topdf.php b/topdf.php index 4e1e677d..6393d5f5 100644 --- a/topdf.php +++ b/topdf.php @@ -55,6 +55,7 @@ $totals = ttReportHelper::getTotals($options); // Totals for the entire report. // Assign variables that are used to print subtotals. +$print_subtotals = $first_pass = false; if ($items && $grouping) { $print_subtotals = true; $first_pass = true; From 89cae455e41364dec480637ec387e3e849e84c25 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 5 Nov 2022 14:59:31 +0000 Subject: [PATCH 229/304] Started work on adding a fav report selector on charts. --- WEB-INF/templates/charts.tpl | 67 ++++++++++++++++++++++++++++++------ charts.php | 16 ++++++++- initialize.php | 2 +- 3 files changed, 73 insertions(+), 12 deletions(-) diff --git a/WEB-INF/templates/charts.tpl b/WEB-INF/templates/charts.tpl index b38988e8..ee0c4834 100644 --- a/WEB-INF/templates/charts.tpl +++ b/WEB-INF/templates/charts.tpl @@ -19,26 +19,59 @@ function adjustTodayLinks() { } } } + +// handleFavReportSelection - manages visibility of controls that are not relevant +// when a fav report is selected. +function handleFavReportSelection() { + var selectedFavReportId = document.getElementById("favorite_report").value; + + var userLabel = document.getElementById("user_label"); + var userControl = document.getElementById("user_control"); + var intervalLabel = document.getElementById("interval_label"); + var intervalControl = document.getElementById("interval_control"); + + if (selectedFavReportId == -1) { + if (userLabel != null) { + userLabel.style.display = ""; + } + if (userControl != null) { + userControl.style.display = ""; + } + if (intervalLabel != null) { + intervalLabel.style.display = ""; + } + if (intervalControl != null) { + intervalControl.style.display = ""; + } + } else { + if (userLabel != null) { + userLabel.style.display = "none"; + } + if (userControl != null) { + userControl.style.display = "none"; + } + if (intervalLabel != null) { + intervalLabel.style.display = "none"; + } + if (intervalControl != null) { + intervalControl.style.display = "none"; + } + } +} {$forms.chartForm.open}
{$forms.chartForm.date.control}
{$forms.weekTimeForm.date.control}
-{if isset($user_dropdown)} - +{if defined('FAV_REPORTS_ON_CHARTS_DEBUG')} + - - + + {/if} - - - - - - {if $chart_selector} @@ -47,6 +80,20 @@ function adjustTodayLinks() { {/if} +{if isset($user_dropdown)} + + + + + + +{/if} + + + + + +
{$forms.chartForm.date.control}
{$forms.chartForm.user.control}{$forms.chartForm.favorite_report.control}
{$forms.chartForm.interval.control}
{$forms.chartForm.user.control}
{$forms.chartForm.interval.control}
diff --git a/charts.php b/charts.php index 1ad1c88d..10335594 100644 --- a/charts.php +++ b/charts.php @@ -12,6 +12,7 @@ import('PieChartEx'); import('ttUserHelper'); import('ttTeamHelper'); +import('ttFavReportHelper'); define('ALL_USERS_OPTION_ID', -1); // An identifier for "all users" seclection in User dropdown. @@ -106,7 +107,7 @@ // Set user selection to all users, if necessary. $allUsersSetInSession = @$_SESSION['chart_all_users']; if ($allUsersSetInSession) - $userDropdownSelectionId = constant('ALL_USERS_OPTION_ID'); + $userDropdownSelectionId = constant('ALL_USERS_OPTION_ID'); } // Elements of chartForm. @@ -177,6 +178,19 @@ $largeScreenCalendarRowSpan += 2; } +// Fav report control. +if (defined('FAV_REPORTS_ON_CHARTS_DEBUG')) { + // Get saved favorite reports for user. + $report_list = ttFavReportHelper::getReports(); + $chart_form->addInput(array('type'=>'combobox', + 'name'=>'favorite_report', + 'onchange'=>'handleFavReportSelection();this.form.submit();', + 'data'=>$report_list, + 'datakeys'=>array('id','name'), + 'empty'=>array('-1'=>$i18n->get('dropdown.no')))); + $largeScreenCalendarRowSpan += 2; +} + // Calendar. $chart_form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar diff --git a/initialize.php b/initialize.php index 432cbb89..8bc3c5f4 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.1.5745"); +define("APP_VERSION", "1.22.1.5746"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6f0f261a87ab5c4bd59866a45c087f17af044cd3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 5 Nov 2022 16:17:41 +0000 Subject: [PATCH 230/304] Some progress on handling fav reports in charts. --- charts.php | 97 ++++++++++++++++++++++++++++---------------------- initialize.php | 2 +- 2 files changed, 55 insertions(+), 44 deletions(-) diff --git a/charts.php b/charts.php index 10335594..aa0b9bd5 100644 --- a/charts.php +++ b/charts.php @@ -79,10 +79,9 @@ $_SESSION['date'] = $cl_date; if ($request->isPost()) { - $cl_interval = (int)$request->getParameter('interval'); - if (!$cl_interval) $cl_interval = INTERVAL_THIS_MONTH; - $_SESSION['chart_interval'] = $cl_interval; - $uc->setValue(SYSC_CHART_INTERVAL, $cl_interval); + $cl_fav_report = (int)$request->getParameter('favorite_report'); + if (!$cl_fav_report) $cl_fav_report = -1; + $_SESSION['fav_report'] = $cl_fav_report; $cl_type = (int)$request->getParameter('type'); if (!$cl_type) $cl_type = ttChartHelper::adjustType($cl_type); @@ -91,12 +90,16 @@ // Remember all users selection in session. $_SESSION['chart_all_users'] = $userDropdownSelectionId == constant('ALL_USERS_OPTION_ID') ? true : false; -} else { - // Initialize chart interval. - $cl_interval = @$_SESSION['chart_interval']; - if (!$cl_interval) $cl_interval = $uc->getValue(SYSC_CHART_INTERVAL); + + $cl_interval = (int)$request->getParameter('interval'); if (!$cl_interval) $cl_interval = INTERVAL_THIS_MONTH; $_SESSION['chart_interval'] = $cl_interval; + $uc->setValue(SYSC_CHART_INTERVAL, $cl_interval); +} else { + // Initialize fav report selector. + $cl_fav_report = @$_SESSION['fav_report']; + if (!$cl_fav_report) $cl_fav_report = -1; + $_SESSION['fav_report'] = $cl_fav_report; // Initialize chart type. $cl_type = @$_SESSION['chart_type']; @@ -108,12 +111,53 @@ $allUsersSetInSession = @$_SESSION['chart_all_users']; if ($allUsersSetInSession) $userDropdownSelectionId = constant('ALL_USERS_OPTION_ID'); + + // Initialize chart interval. + $cl_interval = @$_SESSION['chart_interval']; + if (!$cl_interval) $cl_interval = $uc->getValue(SYSC_CHART_INTERVAL); + if (!$cl_interval) $cl_interval = INTERVAL_THIS_MONTH; + $_SESSION['chart_interval'] = $cl_interval; } // Elements of chartForm. $chart_form = new Form('chartForm'); $largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. +// Fav report control. +if (defined('FAV_REPORTS_ON_CHARTS_DEBUG')) { + // Get saved favorite reports for user. + $report_list = ttFavReportHelper::getReports(); + $chart_form->addInput(array('type'=>'combobox', + 'name'=>'favorite_report', + 'onchange'=>'handleFavReportSelection();this.form.submit();', + 'data'=>$report_list, + 'value' => $cl_fav_report, + 'datakeys'=>array('id','name'), + 'empty'=>array('-1'=>$i18n->get('dropdown.no')))); + $largeScreenCalendarRowSpan += 2; +} + +// Chart type options. +$chart_selector = (MODE_PROJECTS_AND_TASKS == $tracking_mode || $user->isPluginEnabled('cl')); +if ($chart_selector) { + $types = array(); + if (MODE_PROJECTS == $tracking_mode || MODE_PROJECTS_AND_TASKS == $tracking_mode) + $types[CHART_PROJECTS] = $i18n->get('dropdown.projects'); + if (MODE_PROJECTS_AND_TASKS == $tracking_mode) + $types[CHART_TASKS] = $i18n->get('dropdown.tasks'); + if ($user->isPluginEnabled('cl')) + $types[CHART_CLIENTS] = $i18n->get('dropdown.clients'); + + // Add chart type dropdown. + $chart_form->addInput(array('type' => 'combobox', + 'onchange' => 'this.form.submit();', + 'name' => 'type', + 'value' => $cl_type, + 'data' => $types + )); + $largeScreenCalendarRowSpan += 2; +} + // User dropdown. Changes the user "on behalf" of whom we are working. if ($user->can('view_charts') || $user->can('view_all_charts')) { $rank = $user->getMaxRankForGroup($user->getGroup()); @@ -157,44 +201,11 @@ )); $largeScreenCalendarRowSpan += 2; -// Chart type options. -$chart_selector = (MODE_PROJECTS_AND_TASKS == $tracking_mode || $user->isPluginEnabled('cl')); -if ($chart_selector) { - $types = array(); - if (MODE_PROJECTS == $tracking_mode || MODE_PROJECTS_AND_TASKS == $tracking_mode) - $types[CHART_PROJECTS] = $i18n->get('dropdown.projects'); - if (MODE_PROJECTS_AND_TASKS == $tracking_mode) - $types[CHART_TASKS] = $i18n->get('dropdown.tasks'); - if ($user->isPluginEnabled('cl')) - $types[CHART_CLIENTS] = $i18n->get('dropdown.clients'); - - // Add chart type dropdown. - $chart_form->addInput(array('type' => 'combobox', - 'onchange' => 'this.form.submit();', - 'name' => 'type', - 'value' => $cl_type, - 'data' => $types - )); - $largeScreenCalendarRowSpan += 2; -} - -// Fav report control. -if (defined('FAV_REPORTS_ON_CHARTS_DEBUG')) { - // Get saved favorite reports for user. - $report_list = ttFavReportHelper::getReports(); - $chart_form->addInput(array('type'=>'combobox', - 'name'=>'favorite_report', - 'onchange'=>'handleFavReportSelection();this.form.submit();', - 'data'=>$report_list, - 'datakeys'=>array('id','name'), - 'empty'=>array('-1'=>$i18n->get('dropdown.no')))); - $largeScreenCalendarRowSpan += 2; -} - // Calendar. $chart_form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar // Get data for our chart. +// TODO: adjust this call below for fav report selection. $totals = ttChartHelper::getTotals($userDropdownSelectionId, $cl_type, $cl_date, $cl_interval); $smarty->assign('totals', $totals); @@ -243,7 +254,7 @@ $smarty->assign('large_screen_calendar_row_span', $largeScreenCalendarRowSpan); $smarty->assign('img_file_name', $img_ref); $smarty->assign('chart_selector', $chart_selector); -$smarty->assign('onload', 'onLoad="adjustTodayLinks()"'); +$smarty->assign('onload', 'onLoad="adjustTodayLinks();handleFavReportSelection();"'); $smarty->assign('forms', array($chart_form->getName() => $chart_form->toArray())); $smarty->assign('title', $i18n->get('title.charts')); $smarty->assign('content_page_name', 'charts.tpl'); diff --git a/initialize.php b/initialize.php index 8bc3c5f4..c99e16dc 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.1.5746"); +define("APP_VERSION", "1.22.1.5747"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6b0489f569695247ba373b3a8c3e39f96fe7eacb Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 5 Nov 2022 17:30:23 +0000 Subject: [PATCH 231/304] Initial implenentation of fav reports on charts. --- WEB-INF/lib/ttChartHelper.class.php | 100 +++++++++++++++++++++++++++- charts.php | 6 +- initialize.php | 2 +- 3 files changed, 104 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttChartHelper.class.php b/WEB-INF/lib/ttChartHelper.class.php index f0523036..7ee71279 100644 --- a/WEB-INF/lib/ttChartHelper.class.php +++ b/WEB-INF/lib/ttChartHelper.class.php @@ -4,6 +4,8 @@ import('ttPeriod'); import('ttTimeHelper'); +import('ttFavReportHelper'); +import('ttReportHelper'); // Definitions for chart types. define('CHART_PROJECTS', 1); @@ -13,7 +15,7 @@ // Class ttChartHelper is a helper class for charts. class ttChartHelper { - // getTotals - returns total times by project or task for a given user in a specified period. + // getTotals - returns total times by project, task, or client for a given user in a specified period. static function getTotals($user_id, $chart_type, $selected_date, $interval_type) { global $user; @@ -123,6 +125,102 @@ static function getTotals($user_id, $chart_type, $selected_date, $interval_type) return $result; } + + // getTotals - returns total times by project, task, or client for a selected fav report. + static function getTotalsForFavReport($fav_report_id, $chart_type) { + + global $user; + + // Use custom fields plugin if it is enabled. + if ($user->isPluginEnabled('cf')) { + require_once('plugins/CustomFields.class.php'); + $custom_fields = new CustomFields(); + } + + $result = array(); + $mdb2 = getConnection(); + + // Get favorite report details. + $options = ttFavReportHelper::getReportOptions($fav_report_id); + if (!$options) + return $result; // Return empty array if something went wrong. + + $options = ttFavReportHelper::adjustOptions($options); + + // Obtain the where clause for fav report. + $where = ttReportHelper::getWhere($options); + + // Build sql query according to selected chart type. + if (CHART_PROJECTS == $chart_type) { + // Data for projects. + $sql = "select p.name as name, sum(time_to_sec(l.duration)) as time from tt_log l + left join tt_projects p on (p.id = l.project_id) + $where group by l.project_id"; + } elseif (CHART_TASKS == $chart_type) { + // Data for tasks. + $sql = "select t.name as name, sum(time_to_sec(l.duration)) as time from tt_log l + left join tt_tasks t on (t.id = l.task_id) + $where group by l.task_id"; + } elseif (CHART_CLIENTS == $chart_type) { + // Data for clients. + $sql = "select c.name as name, sum(time_to_sec(l.duration)) as time from tt_log l + left join tt_clients c on (c.id = l.client_id) + $where group by l.client_id"; + } + + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + while ($val = $res->fetchRow()) { + if ($val['time'] > 0) // Only positive totals make sense in pie charts. Skip negatives entirely. + $result[] = array('name'=>$val['name'],'time'=>$val['time']); // name - entity name, time - total for entity in seconds. + } + } + + // Get total time. We'll need it to calculate percentages (for labels to the right of diagram). + $total = 0; + foreach ($result as $one_val) { + $total += $one_val['time']; + } + // Add a string representation of time + percentage to names. Example: "Time Tracker (1:15 - 6%)". + foreach ($result as &$one_val) { + $percent = round(100*$one_val['time']/$total).'%'; + $one_val['name'] .= ' ('.ttTimeHelper::minutesToDuration($one_val['time'] / 60).' - '.$percent.')'; + } + + // Note: the remaining code here is needed to display labels on the side of the diagram. + // We print labels ourselves (not using libchart.php) because quality of libchart labels is not good. + + // Note: Optimize this sorting and reversing. + $result = mu_sort($result, 'time'); + $result = array_reverse($result); // This is to assign correct colors to labels. + + // Add color to array items. This is used in labels on the side of a chart. + $colors = array( + array(2, 78, 0), + array(148, 170, 36), + array(233, 191, 49), + array(240, 127, 41), + array(243, 63, 34), + array(190, 71, 47), + array(135, 81, 60), + array(128, 78, 162), + array(121, 75, 255), + array(142, 165, 250), + array(162, 254, 239), + array(137, 240, 166), + array(104, 221, 71), + array(98, 174, 35), + array(93, 129, 1) + ); + for ($i = 0; $i < count($result); $i++) { + $color = $colors[$i%count($colors)]; + $result[$i]['color_html'] = sprintf('#%02x%02x%02x', $color[0], $color[1], $color[2]); + } + + return $result; + } + + // adjustType - adjust chart type to something that is available for a group. static function adjustType($requested_type) { global $user; diff --git a/charts.php b/charts.php index aa0b9bd5..9a67e86e 100644 --- a/charts.php +++ b/charts.php @@ -205,8 +205,10 @@ $chart_form->addInput(array('type'=>'calendar','name'=>'date','value'=>$cl_date)); // calendar // Get data for our chart. -// TODO: adjust this call below for fav report selection. -$totals = ttChartHelper::getTotals($userDropdownSelectionId, $cl_type, $cl_date, $cl_interval); +if ($cl_fav_report == -1) + $totals = ttChartHelper::getTotals($userDropdownSelectionId, $cl_type, $cl_date, $cl_interval); +else + $totals = ttChartHelper::getTotalsForFavReport($cl_fav_report, $cl_type); $smarty->assign('totals', $totals); // Prepare chart for drawing. diff --git a/initialize.php b/initialize.php index c99e16dc..c54bf1d7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.1.5747"); +define("APP_VERSION", "1.22.2.5748"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From e9193034b33070e621e010ff13accee708fa7b3a Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 6 Nov 2022 13:26:53 +0000 Subject: [PATCH 232/304] Removed debug condition for fav reports on charts feature. --- WEB-INF/templates/charts.tpl | 2 -- charts.php | 21 +++++++++------------ initialize.php | 2 +- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/WEB-INF/templates/charts.tpl b/WEB-INF/templates/charts.tpl index ee0c4834..41a6fd1e 100644 --- a/WEB-INF/templates/charts.tpl +++ b/WEB-INF/templates/charts.tpl @@ -64,14 +64,12 @@ function handleFavReportSelection() {
{$forms.chartForm.date.control}
-{if defined('FAV_REPORTS_ON_CHARTS_DEBUG')} -{/if} {if $chart_selector} diff --git a/charts.php b/charts.php index 9a67e86e..1fd7792b 100644 --- a/charts.php +++ b/charts.php @@ -124,18 +124,15 @@ $largeScreenCalendarRowSpan = 1; // Number of rows calendar spans on large screens. // Fav report control. -if (defined('FAV_REPORTS_ON_CHARTS_DEBUG')) { - // Get saved favorite reports for user. - $report_list = ttFavReportHelper::getReports(); - $chart_form->addInput(array('type'=>'combobox', - 'name'=>'favorite_report', - 'onchange'=>'handleFavReportSelection();this.form.submit();', - 'data'=>$report_list, - 'value' => $cl_fav_report, - 'datakeys'=>array('id','name'), - 'empty'=>array('-1'=>$i18n->get('dropdown.no')))); - $largeScreenCalendarRowSpan += 2; -} +$report_list = ttFavReportHelper::getReports(); +$chart_form->addInput(array('type'=>'combobox', + 'name'=>'favorite_report', + 'onchange'=>'handleFavReportSelection();this.form.submit();', + 'data'=>$report_list, + 'value' => $cl_fav_report, + 'datakeys'=>array('id','name'), + 'empty'=>array('-1'=>$i18n->get('dropdown.no')))); +$largeScreenCalendarRowSpan += 2; // Chart type options. $chart_selector = (MODE_PROJECTS_AND_TASKS == $tracking_mode || $user->isPluginEnabled('cl')); diff --git a/initialize.php b/initialize.php index c54bf1d7..43ef2f37 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5748"); +define("APP_VERSION", "1.22.2.5749"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 876d5387cce5819f2724e7dab3407ae44ccdb1a3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 6 Nov 2022 13:47:57 +0000 Subject: [PATCH 233/304] Improved charts by hiding calendar for fav reports. --- WEB-INF/templates/charts.tpl | 18 ++++++++++++++++-- initialize.php | 2 +- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/WEB-INF/templates/charts.tpl b/WEB-INF/templates/charts.tpl index 41a6fd1e..27d335ff 100644 --- a/WEB-INF/templates/charts.tpl +++ b/WEB-INF/templates/charts.tpl @@ -29,6 +29,8 @@ function handleFavReportSelection() { var userControl = document.getElementById("user_control"); var intervalLabel = document.getElementById("interval_label"); var intervalControl = document.getElementById("interval_control"); + var smallScreenCalendarDiv = document.getElementById("small_screen_calendar"); + var largeScreenCalendarDiv = document.getElementById("large_screen_calendar"); if (selectedFavReportId == -1) { if (userLabel != null) { @@ -43,6 +45,12 @@ function handleFavReportSelection() { if (intervalControl != null) { intervalControl.style.display = ""; } + if (smallScreenCalendarDiv != null) { + smallScreenCalendarDiv.style.display = ""; + } + if (largeScreenCalendarDiv != null) { + largeScreenCalendarDiv.style.display = ""; + } } else { if (userLabel != null) { userLabel.style.display = "none"; @@ -56,14 +64,20 @@ function handleFavReportSelection() { if (intervalControl != null) { intervalControl.style.display = "none"; } + if (smallScreenCalendarDiv != null) { + smallScreenCalendarDiv.style.display = "none"; + } + if (largeScreenCalendarDiv != null) { + largeScreenCalendarDiv.style.display = "none"; + } } } {$forms.chartForm.open} -
{$forms.chartForm.date.control}
+
{$forms.chartForm.date.control}
{$forms.chartForm.date.control}
{$forms.chartForm.favorite_report.control}
- + diff --git a/initialize.php b/initialize.php index 43ef2f37..60af5b19 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5749"); +define("APP_VERSION", "1.22.2.5750"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 66d2e4776f8e906b233783d91632f1aa0a80a287 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 18 Nov 2022 14:19:31 +0000 Subject: [PATCH 234/304] Removed a redundant call in puncher. --- initialize.php | 2 +- puncher.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/initialize.php b/initialize.php index 60af5b19..71a97bb7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5750"); +define("APP_VERSION", "1.22.2.5751"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/puncher.php b/puncher.php index 9714ac24..26b371fc 100644 --- a/puncher.php +++ b/puncher.php @@ -324,7 +324,6 @@ $smarty->assign('show_project', $showProject); $smarty->assign('show_task', $showTask); $smarty->assign('task_required', $taskRequired); -$smarty->assign('time_records', ttTimeHelper::getRecords($cl_date)); $smarty->assign('day_total', ttTimeHelper::getTimeForDay($cl_date)); $smarty->assign('time_records', $timeRecords); $smarty->assign('show_record_custom_fields', $user->isOptionEnabled('record_custom_fields')); From 4692f7163525e25c5efff09de72bd3fb73690f08 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 6 Dec 2022 22:02:58 +0000 Subject: [PATCH 235/304] Dutch translation improved. --- WEB-INF/resources/nl.lang.php | 9 +++------ initialize.php | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 38d93efd..c162f858 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -415,8 +415,7 @@ 'form.reports.show_fields' => 'Toon velden', 'form.reports.time_fields' => 'Tijd velden', 'form.reports.user_fields' => 'Medewerker velden', -// TODO: translate the following. -// 'form.reports.project_fields' => 'Project fields', +'form.reports.project_fields' => 'Project velden', 'form.reports.group_by' => 'Groeperen op', 'form.reports.group_by_no' => '--- niet groeperen ---', 'form.reports.group_by_date' => 'datum', @@ -428,8 +427,7 @@ // Report form. See example at https://timetracker.anuko.com/report.php // (after generating a report at https://timetracker.anuko.com/reports.php). 'form.report.export' => 'Exporteer', -// TODO: translate the following. -// 'form.report.per_hour' => 'Per hour', +'form.report.per_hour' => 'Per uur', 'form.report.assign_to_invoice' => 'Voeg toe aan factuur', 'form.report.assign_to_timesheet' => 'Wijs toe aan tijdenoverzicht', @@ -590,7 +588,6 @@ 'form.display_options.note_on_separate_row' => 'Notitie in aparte kolom', // Translator (Henk) comment: "kolom is the right word in Dutch." 'form.display_options.not_complete_days' => 'Niet complete dagen', 'form.display_options.inactive_projects' => 'Niet actieve projecten', -// TODO: translate the following. -// 'form.display_options.cost_per_hour' => 'Cost per hour', +'form.display_options.cost_per_hour' => 'Kosten per uur', 'form.display_options.custom_css' => 'Aangepaste CSS', ); diff --git a/initialize.php b/initialize.php index 71a97bb7..6c62a5c9 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5751"); +define("APP_VERSION", "1.22.2.5752"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 136681fa3019c4e80ef9e93a59d5334925486121 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 8 Dec 2022 16:36:09 +0000 Subject: [PATCH 236/304] Added previous month option on charts. --- WEB-INF/lib/ttChartHelper.class.php | 4 ++++ WEB-INF/lib/ttPeriod.class.php | 12 ++++++------ charts.php | 1 + initialize.php | 2 +- reports.php | 6 +++--- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/WEB-INF/lib/ttChartHelper.class.php b/WEB-INF/lib/ttChartHelper.class.php index 7ee71279..eaa5a4c0 100644 --- a/WEB-INF/lib/ttChartHelper.class.php +++ b/WEB-INF/lib/ttChartHelper.class.php @@ -37,6 +37,10 @@ static function getTotals($user_id, $chart_type, $selected_date, $interval_type) $period = new ttPeriod(new ttDate($selected_date), INTERVAL_THIS_MONTH); break; + case INTERVAL_PREVIOUS_MONTH: + $period = new ttPeriod(new ttDate($selected_date), INTERVAL_PREVIOUS_MONTH); + break; + case INTERVAL_THIS_YEAR: $period = new ttPeriod(new ttDate($selected_date), INTERVAL_THIS_YEAR); break; diff --git a/WEB-INF/lib/ttPeriod.class.php b/WEB-INF/lib/ttPeriod.class.php index 1d63ad9d..0dcbf71c 100644 --- a/WEB-INF/lib/ttPeriod.class.php +++ b/WEB-INF/lib/ttPeriod.class.php @@ -7,9 +7,9 @@ define('INTERVAL_THIS_MONTH', 3); define('INTERVAL_THIS_YEAR', 4); define('INTERVAL_ALL_TIME', 5); -define('INTERVAL_LAST_WEEK', 6); -define('INTERVAL_LAST_MONTH', 7); -define('INTERVAL_LAST_DAY', 8); +define('INTERVAL_PREVIOUS_WEEK', 6); +define('INTERVAL_PREVIOUS_MONTH', 7); +define('INTERVAL_PREVIOUS_DAY', 8); class ttPeriod { var $startDate; // ttDate object. @@ -34,7 +34,7 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { $this->endDate->setFromUnixTimestamp($ttDateInstance->getTimestamp()); break; - case INTERVAL_LAST_DAY: + case INTERVAL_PREVIOUS_DAY: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-1,$t_arr[5])); break; @@ -44,7 +44,7 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]+6+$startWeekBias,$t_arr[5])); break; - case INTERVAL_LAST_WEEK: + case INTERVAL_PREVIOUS_WEEK: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-7+$startWeekBias,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,$t_arr[3]-$t_arr[6]-1+$startWeekBias,$t_arr[5])); break; @@ -54,7 +54,7 @@ function __construct($ttDateInstance, $period_type = INTERVAL_THIS_MONTH) { $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+2,0,$t_arr[5])); break; - case INTERVAL_LAST_MONTH: + case INTERVAL_PREVIOUS_MONTH: $this->startDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4],1,$t_arr[5])); $this->endDate->setFromUnixTimestamp(mktime(0,0,0,$t_arr[4]+1,0,$t_arr[5])); break; diff --git a/charts.php b/charts.php index 1fd7792b..a4c24f0a 100644 --- a/charts.php +++ b/charts.php @@ -186,6 +186,7 @@ $intervals[INTERVAL_THIS_DAY] = $i18n->get('dropdown.selected_day'); $intervals[INTERVAL_THIS_WEEK] = $i18n->get('dropdown.selected_week'); $intervals[INTERVAL_THIS_MONTH] = $i18n->get('dropdown.selected_month'); +$intervals[INTERVAL_PREVIOUS_MONTH] = $i18n->get('dropdown.previous_month'); $intervals[INTERVAL_THIS_YEAR] = $i18n->get('dropdown.selected_year'); $intervals[INTERVAL_ALL_TIME] = $i18n->get('dropdown.all_time'); diff --git a/initialize.php b/initialize.php index 6c62a5c9..d499de94 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5752"); +define("APP_VERSION", "1.22.2.5753"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/reports.php b/reports.php index 057787e7..fd4ca156 100644 --- a/reports.php +++ b/reports.php @@ -229,11 +229,11 @@ $form->addInput(array('type'=>'combobox', 'name'=>'period', 'data'=>array(INTERVAL_THIS_MONTH=>$i18n->get('dropdown.current_month'), - INTERVAL_LAST_MONTH=>$i18n->get('dropdown.previous_month'), + INTERVAL_PREVIOUS_MONTH=>$i18n->get('dropdown.previous_month'), INTERVAL_THIS_WEEK=>$i18n->get('dropdown.current_week'), - INTERVAL_LAST_WEEK=>$i18n->get('dropdown.previous_week'), + INTERVAL_PREVIOUS_WEEK=>$i18n->get('dropdown.previous_week'), INTERVAL_THIS_DAY=>$i18n->get('dropdown.current_day'), - INTERVAL_LAST_DAY=>$i18n->get('dropdown.previous_day')), + INTERVAL_PREVIOUS_DAY=>$i18n->get('dropdown.previous_day')), 'empty'=>array(''=>$i18n->get('dropdown.select')))); // Add controls for start and end dates. $form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'start_date')); From 700d2e19cd276432dd03e3817a5e03aa056ea3cc Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 18 Dec 2022 13:53:20 +0000 Subject: [PATCH 237/304] Started to work on custom translation feature. --- dbinstall.php | 10 ++++++---- initialize.php | 2 +- mysql.sql | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dbinstall.php b/dbinstall.php index 85d3f021..c79cd558 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -1151,7 +1151,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to12107"]) { + if ($_POST["convert11900to12203"]) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1199,6 +1199,8 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.2', modified = now() where param_name = 'version_db' and param_value = '1.21.0'"); ttExecute("ALTER TABLE tt_fav_reports ADD COLUMN `note_containing` varchar(80) default NULL after `paid_status`"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.21.7', modified = now() where param_name = 'version_db' and param_value = '1.21.2'"); + ttExecute("ALTER TABLE `tt_groups` ADD `custom_translation` text default NULL AFTER `custom_css`"); + ttExecute("UPDATE `tt_site_config` SET param_value = '1.22.3', modified = now() where param_name = 'version_db' and param_value = '1.21.7'"); } if ($_POST["cleanup"]) { @@ -1249,7 +1251,7 @@ function ttGenerateKeys() {

DB Install

{$forms.chartForm.date.control}
{$forms.chartForm.date.control}
-
Create database structure (v1.21.7) + Create database structure (v1.22.3)
(applies only to new installations, do not execute when updating)
@@ -1298,8 +1300,8 @@ function ttGenerateKeys() { - Update database structure (v1.19 to v1.21.7) - + Update database structure (v1.19 to v1.22.3) + diff --git a/initialize.php b/initialize.php index d499de94..7c1e90f6 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.2.5753"); +define("APP_VERSION", "1.22.3.5754"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/mysql.sql b/mysql.sql index 4fd33fa9..d50b6c46 100644 --- a/mysql.sql +++ b/mysql.sql @@ -39,6 +39,7 @@ CREATE TABLE `tt_groups` ( `custom_logo` tinyint(4) default 0, # whether to use a custom logo or not `config` text default NULL, # miscellaneous group configuration settings `custom_css` text default NULL, # custom css for group + `custom_translation` text default NULL, # custom translation for group `created` datetime default NULL, # creation timestamp `created_ip` varchar(45) default NULL, # creator ip `created_by` int(11) default NULL, # creator user_id @@ -622,4 +623,4 @@ CREATE TABLE `tt_site_config` ( PRIMARY KEY (`param_name`) ); -INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.21.7', now()); # TODO: change when structure changes. +INSERT INTO `tt_site_config` (`param_name`, `param_value`, `created`) VALUES ('version_db', '1.22.3', now()); # TODO: change when structure changes. From 6908f224aa200ae785a9b819ca73f81bb9af6f7f Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 18 Dec 2022 15:03:08 +0000 Subject: [PATCH 238/304] Added localization string for custom translation. --- WEB-INF/resources/ca.lang.php | 1 + WEB-INF/resources/cs.lang.php | 1 + WEB-INF/resources/da.lang.php | 1 + WEB-INF/resources/de.lang.php | 1 + WEB-INF/resources/en.lang.php | 1 + WEB-INF/resources/es.lang.php | 1 + WEB-INF/resources/et.lang.php | 1 + WEB-INF/resources/fa.lang.php | 1 + WEB-INF/resources/fi.lang.php | 1 + WEB-INF/resources/fr.lang.php | 1 + WEB-INF/resources/gr.lang.php | 1 + WEB-INF/resources/he.lang.php | 1 + WEB-INF/resources/hu.lang.php | 1 + WEB-INF/resources/it.lang.php | 1 + WEB-INF/resources/ja.lang.php | 1 + WEB-INF/resources/ko.lang.php | 1 + WEB-INF/resources/nl.lang.php | 2 ++ WEB-INF/resources/no.lang.php | 1 + WEB-INF/resources/pl.lang.php | 1 + WEB-INF/resources/pt-br.lang.php | 2 ++ WEB-INF/resources/pt.lang.php | 1 + WEB-INF/resources/ro.lang.php | 1 + WEB-INF/resources/ru.lang.php | 1 + WEB-INF/resources/sk.lang.php | 1 + WEB-INF/resources/sl.lang.php | 1 + WEB-INF/resources/sr.lang.php | 1 + WEB-INF/resources/sv.lang.php | 1 + WEB-INF/resources/tr.lang.php | 1 + WEB-INF/resources/zh-cn.lang.php | 1 + WEB-INF/resources/zh-tw.lang.php | 1 + initialize.php | 2 +- 31 files changed, 33 insertions(+), 1 deletion(-) diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 13d8237c..3cb54751 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -681,4 +681,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 4a93086d..2c32c964 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -693,4 +693,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 595590f0..8c86b742 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -659,4 +659,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 209df6b7..eadc49e7 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -634,4 +634,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index 83808aa4..c1defcb5 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -605,4 +605,5 @@ 'form.display_options.inactive_projects' => 'Inactive projects', 'form.display_options.cost_per_hour' => 'Cost per hour', 'form.display_options.custom_css' => 'Custom CSS', +'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 507bbcaa..63e6fbac 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -696,4 +696,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 0295dc70..59f6ecf5 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -670,4 +670,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index 07887202..bfe8044d 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -682,4 +682,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index e9e92e01..d5cbe928 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -666,4 +666,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index 145fcb28..a0df933e 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -655,4 +655,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index 6265976d..c5c0c2b7 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -649,4 +649,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 727b0b76..1d0c24f4 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -687,4 +687,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 8b0be952..4c133d9f 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -684,4 +684,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index d283830a..7cf157ba 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -662,4 +662,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 112e454c..16a882f8 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -688,4 +688,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index 6bb78d77..f0c695e0 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -686,4 +686,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index c162f858..febb14a9 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -590,4 +590,6 @@ 'form.display_options.inactive_projects' => 'Niet actieve projecten', 'form.display_options.cost_per_hour' => 'Kosten per uur', 'form.display_options.custom_css' => 'Aangepaste CSS', +// TODO: translate the following. +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index 18e1ee69..ec80e93e 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -688,4 +688,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index b7dd5024..e6eba052 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -667,4 +667,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index fff94fa3..04f86045 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -600,5 +600,7 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', 'form.display_options.custom_css' => 'CSS customizado', +// TODO: translate the following. +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index 075e7b41..fdedcf43 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -666,4 +666,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 0d8fe6d1..55d010f8 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -689,4 +689,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 805be45b..3e804c7d 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -591,4 +591,5 @@ 'form.display_options.inactive_projects' => 'Неактивные проекты', 'form.display_options.cost_per_hour' => 'Стоимость за час', 'form.display_options.custom_css' => 'Пользовательская CSS', +'form.display_options.custom_translation' => 'Пользовательский перевод', ); diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index e57e63d7..1802f518 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -671,4 +671,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index 8ea8c445..cd614967 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -661,4 +661,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 055545b3..18c64ec7 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -669,4 +669,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index e0d212b9..6b2a0d2b 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -667,4 +667,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 09887171..0473d081 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -702,4 +702,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 87f1cc1c..44dc443e 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -677,4 +677,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index 181756e7..e5faa1cb 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -680,4 +680,5 @@ // 'form.display_options.inactive_projects' => 'Inactive projects', // 'form.display_options.cost_per_hour' => 'Cost per hour', // 'form.display_options.custom_css' => 'Custom CSS', +// 'form.display_options.custom_translation' => 'Custom translation', ); diff --git a/initialize.php b/initialize.php index 7c1e90f6..54e0c36d 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.3.5754"); +define("APP_VERSION", "1.22.3.5755"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 08fbd9a080c042685df6ccc40b9fd0eba0914795 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 19 Dec 2022 15:44:16 +0000 Subject: [PATCH 239/304] Work in progress on custom translation. --- WEB-INF/lib/common.lib.php | 14 ++++++++++++++ WEB-INF/lib/ttUser.class.php | 17 ++++++++++++++--- WEB-INF/templates/display_options.tpl | 7 +++++++ default.css | 4 ++-- display_options.php | 7 ++++++- initialize.php | 2 +- 6 files changed, 44 insertions(+), 7 deletions(-) diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 0f38f80f..7a79e0a7 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -162,6 +162,20 @@ function ttValidCss($val) return true; } +// ttValidTranslation is used to check user input for custom translation. +function ttValidTranslation($val) +{ + $val = trim($val); + if (strlen($val) == 0) + return true; + + // String must not contain any tags. + if (stristr($val, '<')) + return false; + + return false; // Not implemented yet. +} + // ttValidTemplateText is used to check template-based user input. // When templates are used, required input parts must be filled by user. // We identify these parts by 3 "stop sign" emojis (aka "octagonal sign" U+1F6D1). diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index b32c2779..37591fa5 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -50,6 +50,7 @@ class ttUser { var $config = null; // Comma-separated list of miscellaneous config options. var $configHelper = null; // An instance of ttConfigHelper class. var $custom_css = null; // Custom css. + var $custom_translation = null; // Custom translation. var $custom_logo = 0; // Whether to use a custom logo for group. var $lock_spec = null; // Cron specification for record locking. @@ -73,7 +74,8 @@ function __construct($login, $id = null) { $sql = "SELECT u.id, u.login, u.name, u.group_id, u.role_id, r.rank, r.name as role_name, r.rights, u.client_id,". " u.quota_percent, u.email, g.org_id, g.group_key, g.name as group_name, g.currency, g.lang, g.decimal_mark, g.date_format,". " g.time_format, g.week_start, g.tracking_mode, g.project_required, g.record_type,". - " g.bcc_email, g.allow_ip, g.password_complexity, g.plugins, g.config, g.lock_spec, g.custom_css, g.holidays, g.workday_minutes, g.custom_logo". + " g.bcc_email, g.allow_ip, g.password_complexity, g.plugins, g.config, g.lock_spec, g.custom_css, g.custom_translation,". + " g.holidays, g.workday_minutes, g.custom_logo". " FROM tt_users u LEFT JOIN tt_groups g ON (u.group_id = g.id) LEFT JOIN tt_roles r on (r.id = u.role_id) WHERE "; if ($id) $sql .= "u.id = $id"; @@ -131,6 +133,7 @@ function __construct($login, $id = null) { $this->allow_overlap = $this->configHelper->getDefinedValue('allow_overlap'); $this->custom_css = $val['custom_css']; + $this->custom_translation = $val['custom_translation']; // Set "on behalf" id and name (user). if (isset($_SESSION['behalf_id'])) { @@ -290,6 +293,11 @@ function getCustomCss() { return ($this->behalfGroup ? $this->behalfGroup->custom_css : $this->custom_css); } + // getCustomTranslation returns custom translation for active group. + function getCustomTranslation() { + return ($this->behalfGroup ? $this->behalfGroup->custom_translation : $this->custom_translation); + } + // can - determines whether user has a right to do something. function can($do_something) { return in_array($do_something, $this->rights); @@ -682,7 +690,8 @@ function updateGroup($fields) { $name_part = $description_part = $currency_part = $lang_part = $decimal_mark_part = $date_format_part = $time_format_part = $week_start_part = $tracking_mode_part = $project_required_part = $record_type_part = $bcc_email_part = $allow_ip_part = - $password_complexity_part = $plugins_part = $config_part = $custom_css_part = $lock_spec_part = $holidays_part = $workday_minutes_part = ''; + $password_complexity_part = $plugins_part = $config_part = $custom_css_part = $custom_translation_part = $lock_spec_part = + $holidays_part = $workday_minutes_part = ''; if (isset($fields['name'])) $name_part = ', name = '.$mdb2->quote($fields['name']); if (isset($fields['description'])) $description_part = ', description = '.$mdb2->quote($fields['description']); if (isset($fields['currency'])) $currency_part = ', currency = '.$mdb2->quote($fields['currency']); @@ -702,6 +711,7 @@ function updateGroup($fields) { if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']); if (isset($fields['config'])) $config_part = ', config = '.$mdb2->quote($fields['config']); if (isset($fields['custom_css'])) $custom_css_part = ', custom_css = '.$mdb2->quote($fields['custom_css']); + if (isset($fields['custom_translation'])) $custom_translation_part = ', custom_translation = '.$mdb2->quote($fields['custom_translation']); if (isset($fields['lock_spec'])) $lock_spec_part = ', lock_spec = '.$mdb2->quote($fields['lock_spec']); if (isset($fields['holidays'])) $holidays_part = ', holidays = '.$mdb2->quote($fields['holidays']); if (isset($fields['workday_minutes'])) $workday_minutes_part = ', workday_minutes = '.$mdb2->quote($fields['workday_minutes']); @@ -709,7 +719,8 @@ function updateGroup($fields) { $parts = trim($name_part.$description_part.$currency_part.$lang_part.$decimal_mark_part.$date_format_part. $time_format_part.$week_start_part.$tracking_mode_part.$project_required_part.$record_type_part. - $bcc_email_part.$allow_ip_part.$password_complexity_part.$plugins_part.$config_part.$custom_css_part.$lock_spec_part.$holidays_part.$workday_minutes_part.$modified_part, ','); + $bcc_email_part.$allow_ip_part.$password_complexity_part.$plugins_part.$config_part.$custom_css_part. + $custom_translation_part.$lock_spec_part.$holidays_part.$workday_minutes_part.$modified_part, ','); $sql = "update tt_groups set $parts where id = $group_id and org_id = $this->org_id"; $affected = $mdb2->exec($sql); diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index 5b487ec8..a6abe34f 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -63,6 +63,13 @@ License: See license.txt *} {$forms.displayOptionsForm.custom_css.control} {$i18n.label.what_is_it}
+{if defined('CUSTOM_TRANSLATION_DEBUG')} +
+ {$i18n.form.display_options.custom_translation} + {$forms.displayOptionsForm.custom_translation.control} + {$i18n.label.what_is_it} +
+{/if}
{$forms.displayOptionsForm.btn_save.control}
{$forms.displayOptionsForm.close} diff --git a/default.css b/default.css index 98e40562..38de0f53 100644 --- a/default.css +++ b/default.css @@ -363,7 +363,7 @@ input[type="text"].short-text-field { } /* textareas for fields */ -#description, #address, #item_name, #comment, #custom_css, #content { +#description, #address, #item_name, #comment, #custom_css, #custom_translation, #content { width: 220px; border-radius: 4px; border: 1px solid #c9c9c9; @@ -371,7 +371,7 @@ input[type="text"].short-text-field { } /* textareas with focus */ -#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #content:focus { +#description:focus, #address:focus, #item_name:focus, #comment:focus, #custom_css:focus, #custom_translation:focus, #content:focus { background-color: yellow; border: 1px solid black; outline: none; diff --git a/display_options.php b/display_options.php index e449c3c9..e0b7bc98 100644 --- a/display_options.php +++ b/display_options.php @@ -23,6 +23,7 @@ $cl_report_inactive_projects = (bool)($request->getParameter('report_inactive_projects')); $cl_report_cost_per_hour = (bool)$request->getParameter('report_cost_per_hour'); $cl_custom_css = trim($request->getParameter('custom_css')); + $cl_custom_translation = trim($request->getParameter('custom_translation')); } else { $cl_time_note_on_separate_row = $config->getDefinedValue('time_note_on_separate_row'); $cl_time_not_complete_days = $config->getDefinedValue('time_not_complete_days'); @@ -31,6 +32,7 @@ $cl_report_inactive_projects = $config->getDefinedValue('report_inactive_projects'); $cl_report_cost_per_hour = $config->getDefinedValue('report_cost_per_hour'); $cl_custom_css = $user->getCustomCss(); + $cl_custom_translation = $user->getCustomTranslation(); } $form = new Form('displayOptionsForm'); @@ -55,11 +57,13 @@ // TODO: add PDF break controller here. $form->addInput(array('type'=>'textarea','name'=>'custom_css','value'=>$cl_custom_css)); +$form->addInput(array('type'=>'textarea','name'=>'custom_translation','value'=>$cl_custom_translation)); $form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); if ($request->isPost()){ // Validate user input. if (!ttValidCss($cl_custom_css)) $err->add($i18n->get('error.field'), $i18n->get('form.display_options.custom_css')); + if (!ttValidTranslation($cl_custom_translation)) $err->add($i18n->get('error.field'), $i18n->get('form.display_options.custom_translation')); // Finished validating user input. if ($err->no()) { @@ -72,7 +76,8 @@ $config->setDefinedValue('report_cost_per_hour', $cl_report_cost_per_hour); if ($user->updateGroup(array( 'config' => $config->getConfig(), - 'custom_css' => $cl_custom_css))) { + 'custom_css' => $cl_custom_css, + 'custom_translation' => $cl_custom_translation))) { header('Location: success.php'); exit(); } else diff --git a/initialize.php b/initialize.php index 54e0c36d..bb1aa4f9 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.3.5755"); +define("APP_VERSION", "1.22.3.5756"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From bd106a61bb80f88b7c4d6b7f7e3d2e28441f3851 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 19 Dec 2022 21:26:01 +0000 Subject: [PATCH 240/304] More progress on custom translation feature. --- WEB-INF/lib/I18n.class.php | 40 +++++++++++++++++++++++++++++++++-- WEB-INF/lib/common.lib.php | 43 +++++++++++++++++++++++++++++++++++--- initialize.php | 2 +- 3 files changed, 79 insertions(+), 6 deletions(-) diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index 1760da48..99015a93 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -51,9 +51,16 @@ function get($key) { return $value; } + // get - keyExists determines if a key exists. + function keyExists($key) { + $value = $this->get($key); + return ($value != null && strlen($value) > 0); + } + // load - loads localized strings into $keys array by first going through the default file (en.lang.php) - // and then through the requested language file (which is supplied as parameter). - // This means we end up with default English strings when keys are missing in the translation file. + // and then through the requested language file (which is supplied as parameter), + // (this means we end up with default English strings when keys are missing in the translation file), + // and then from a group custom translation field, if available. function load($langName) { // Load default English keys first. $defaultFileName = RESOURCE_DIR . '/' . $this->defaultLang . '.lang.php'; @@ -105,6 +112,35 @@ function load($langName) { } } } + + // Now load custom translation for group. + global $user; + $customTranslation = $user->getCustomTranslation(); + if ($customTranslation != null) { + $lines = preg_split("/\r\n|\n|\r/", $customTranslation); + for ($i = 0; $i < count($lines); $i++) { + $parts = explode('=', $lines[$i]); + if (count($parts) != 2) continue; + + $key = trim($parts[0]); + $value = trim($parts[1]); + if (!$value) continue; + + $value = htmlspecialchars(trim($parts[1])); + + $pos = strpos($key, "."); + if (!($pos === false)) { + $p = explode(".", $key); + $str = ""; + foreach ($p as $w) { + $str .= "[\"".$w."\"]"; + } + eval("\$this->keys".$str."='".$value."';"); + } else { + $this->keys[$key] = $value; + } + } + } } // hasLang determines if a file for requested language exists. diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 7a79e0a7..85ece448 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -169,11 +169,48 @@ function ttValidTranslation($val) if (strlen($val) == 0) return true; - // String must not contain any tags. - if (stristr($val, '<')) + // Validate lines. + $lines = preg_split("/\r\n|\n|\r/", $val); + for ($i = 0; $i < count($lines); $i++) { + if (!ttValidTranslationLine($lines[$i])) + return false; + } + + return true; +} + +// ttValidTranslationLine is used to check an individual line in custom translation. +function ttValidTranslationLine($val) +{ + $val = trim($val); + if (strlen($val) == 0) + return false; // Empty line is not valid. + + $parts = explode('=', $val); + if (count($parts) != 2) { + // We need exactly 2 parts. return false; + } + + $key = trim($parts[0]); + global $i18n; + if (!$i18n->keyExists($key)) { + // Key does not exist. + return false; + } - return false; // Not implemented yet. + $value = trim($parts[1]); + if (!$value) { + // Do not allow empty values. + return false; + } + + // Prohibit apostrophes in values for now until I figure out how to handle them properly. + if (ttContains($value, "'")) { + return false; + } + + return true; } // ttValidTemplateText is used to check template-based user input. diff --git a/initialize.php b/initialize.php index bb1aa4f9..060c63ea 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.3.5756"); +define("APP_VERSION", "1.22.3.5757"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From cd24019d91a1582bbe50c1e65a047c97fc9f19b1 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Tue, 20 Dec 2022 15:40:01 +0000 Subject: [PATCH 241/304] Allowed empty custom translation strings and also containing single quotes. --- WEB-INF/lib/I18n.class.php | 8 ++++---- WEB-INF/lib/common.lib.php | 11 ----------- WEB-INF/resources/ca.lang.php | 3 ++- WEB-INF/resources/cs.lang.php | 3 ++- WEB-INF/resources/da.lang.php | 3 ++- WEB-INF/resources/de.lang.php | 3 ++- WEB-INF/resources/en.lang.php | 3 ++- WEB-INF/resources/es.lang.php | 3 ++- WEB-INF/resources/et.lang.php | 3 ++- WEB-INF/resources/fa.lang.php | 4 +++- WEB-INF/resources/fi.lang.php | 3 ++- WEB-INF/resources/fr.lang.php | 3 ++- WEB-INF/resources/gr.lang.php | 3 ++- WEB-INF/resources/he.lang.php | 3 ++- WEB-INF/resources/hu.lang.php | 3 ++- WEB-INF/resources/it.lang.php | 3 ++- WEB-INF/resources/ja.lang.php | 3 ++- WEB-INF/resources/ko.lang.php | 3 ++- WEB-INF/resources/nl.lang.php | 3 ++- WEB-INF/resources/no.lang.php | 3 ++- WEB-INF/resources/pl.lang.php | 3 ++- WEB-INF/resources/pt-br.lang.php | 3 ++- WEB-INF/resources/pt.lang.php | 3 ++- WEB-INF/resources/ro.lang.php | 3 ++- WEB-INF/resources/ru.lang.php | 3 ++- WEB-INF/resources/sk.lang.php | 3 ++- WEB-INF/resources/sl.lang.php | 3 ++- WEB-INF/resources/sr.lang.php | 3 ++- WEB-INF/resources/sv.lang.php | 3 ++- WEB-INF/resources/tr.lang.php | 3 ++- WEB-INF/resources/zh-cn.lang.php | 3 ++- WEB-INF/resources/zh-tw.lang.php | 3 ++- initialize.php | 2 +- 33 files changed, 66 insertions(+), 46 deletions(-) diff --git a/WEB-INF/lib/I18n.class.php b/WEB-INF/lib/I18n.class.php index 99015a93..bd4e9ffd 100644 --- a/WEB-INF/lib/I18n.class.php +++ b/WEB-INF/lib/I18n.class.php @@ -54,7 +54,7 @@ function get($key) { // get - keyExists determines if a key exists. function keyExists($key) { $value = $this->get($key); - return ($value != null && strlen($value) > 0); + return ($value !== null); } // load - loads localized strings into $keys array by first going through the default file (en.lang.php) @@ -124,9 +124,9 @@ function load($langName) { $key = trim($parts[0]); $value = trim($parts[1]); - if (!$value) continue; - - $value = htmlspecialchars(trim($parts[1])); + // Escape single quotes and backslashes. + $value = addcslashes($value, "'\\"); + $value = htmlspecialchars($value); $pos = strpos($key, "."); if (!($pos === false)) { diff --git a/WEB-INF/lib/common.lib.php b/WEB-INF/lib/common.lib.php index 85ece448..86570a5f 100644 --- a/WEB-INF/lib/common.lib.php +++ b/WEB-INF/lib/common.lib.php @@ -199,17 +199,6 @@ function ttValidTranslationLine($val) return false; } - $value = trim($parts[1]); - if (!$value) { - // Do not allow empty values. - return false; - } - - // Prohibit apostrophes in values for now until I figure out how to handle them properly. - if (ttContains($value, "'")) { - return false; - } - return true; } diff --git a/WEB-INF/resources/ca.lang.php b/WEB-INF/resources/ca.lang.php index 3cb54751..327132ed 100644 --- a/WEB-INF/resources/ca.lang.php +++ b/WEB-INF/resources/ca.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Catalan (Català)'; diff --git a/WEB-INF/resources/cs.lang.php b/WEB-INF/resources/cs.lang.php index 2c32c964..c89457e6 100644 --- a/WEB-INF/resources/cs.lang.php +++ b/WEB-INF/resources/cs.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/da.lang.php b/WEB-INF/resources/da.lang.php index 8c86b742..6fe93c26 100644 --- a/WEB-INF/resources/da.lang.php +++ b/WEB-INF/resources/da.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Danish (Dansk)'; diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index eadc49e7..9cb0340b 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'German (Deutsch)'; diff --git a/WEB-INF/resources/en.lang.php b/WEB-INF/resources/en.lang.php index c1defcb5..5858b63d 100644 --- a/WEB-INF/resources/en.lang.php +++ b/WEB-INF/resources/en.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'English'; diff --git a/WEB-INF/resources/es.lang.php b/WEB-INF/resources/es.lang.php index 63e6fbac..b302de1c 100644 --- a/WEB-INF/resources/es.lang.php +++ b/WEB-INF/resources/es.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Spanish (Español)'; diff --git a/WEB-INF/resources/et.lang.php b/WEB-INF/resources/et.lang.php index 59f6ecf5..19a74b4c 100644 --- a/WEB-INF/resources/et.lang.php +++ b/WEB-INF/resources/et.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/fa.lang.php b/WEB-INF/resources/fa.lang.php index bfe8044d..32dacdf0 100644 --- a/WEB-INF/resources/fa.lang.php +++ b/WEB-INF/resources/fa.lang.php @@ -2,8 +2,10 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. + $i18n_language = 'Persian (فارسی)'; // TODO: translate the following. $i18n_months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); diff --git a/WEB-INF/resources/fi.lang.php b/WEB-INF/resources/fi.lang.php index d5cbe928..cdfc4c5f 100644 --- a/WEB-INF/resources/fi.lang.php +++ b/WEB-INF/resources/fi.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Finnish (Suomi)'; diff --git a/WEB-INF/resources/fr.lang.php b/WEB-INF/resources/fr.lang.php index a0df933e..b488be0b 100644 --- a/WEB-INF/resources/fr.lang.php +++ b/WEB-INF/resources/fr.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'French (Français)'; diff --git a/WEB-INF/resources/gr.lang.php b/WEB-INF/resources/gr.lang.php index c5c0c2b7..34f1890e 100644 --- a/WEB-INF/resources/gr.lang.php +++ b/WEB-INF/resources/gr.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Greek (Ελληνικά)'; diff --git a/WEB-INF/resources/he.lang.php b/WEB-INF/resources/he.lang.php index 1d0c24f4..585a7ec2 100644 --- a/WEB-INF/resources/he.lang.php +++ b/WEB-INF/resources/he.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Hebrew (עברית)'; diff --git a/WEB-INF/resources/hu.lang.php b/WEB-INF/resources/hu.lang.php index 4c133d9f..e2d7500d 100644 --- a/WEB-INF/resources/hu.lang.php +++ b/WEB-INF/resources/hu.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/it.lang.php b/WEB-INF/resources/it.lang.php index 7cf157ba..73ca8a02 100644 --- a/WEB-INF/resources/it.lang.php +++ b/WEB-INF/resources/it.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/ja.lang.php b/WEB-INF/resources/ja.lang.php index 16a882f8..0de6e88e 100644 --- a/WEB-INF/resources/ja.lang.php +++ b/WEB-INF/resources/ja.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Japanese (日本語)'; diff --git a/WEB-INF/resources/ko.lang.php b/WEB-INF/resources/ko.lang.php index f0c695e0..fcbe14d2 100644 --- a/WEB-INF/resources/ko.lang.php +++ b/WEB-INF/resources/ko.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Korean (한국어)'; diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index febb14a9..16fe1ecf 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Dutch (Nederlands)'; diff --git a/WEB-INF/resources/no.lang.php b/WEB-INF/resources/no.lang.php index ec80e93e..720f71f3 100644 --- a/WEB-INF/resources/no.lang.php +++ b/WEB-INF/resources/no.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Norwegian (Norsk)'; diff --git a/WEB-INF/resources/pl.lang.php b/WEB-INF/resources/pl.lang.php index e6eba052..69dddf31 100644 --- a/WEB-INF/resources/pl.lang.php +++ b/WEB-INF/resources/pl.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Polish (Polski)'; diff --git a/WEB-INF/resources/pt-br.lang.php b/WEB-INF/resources/pt-br.lang.php index 04f86045..c9a4ad99 100644 --- a/WEB-INF/resources/pt-br.lang.php +++ b/WEB-INF/resources/pt-br.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Portuguese (Português Brasileiro)'; diff --git a/WEB-INF/resources/pt.lang.php b/WEB-INF/resources/pt.lang.php index fdedcf43..abcd5793 100644 --- a/WEB-INF/resources/pt.lang.php +++ b/WEB-INF/resources/pt.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Please use proper capitalization rules for your language. diff --git a/WEB-INF/resources/ro.lang.php b/WEB-INF/resources/ro.lang.php index 55d010f8..03db7da4 100644 --- a/WEB-INF/resources/ro.lang.php +++ b/WEB-INF/resources/ro.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Please use proper capitalization rules for your language. diff --git a/WEB-INF/resources/ru.lang.php b/WEB-INF/resources/ru.lang.php index 3e804c7d..6c924df2 100644 --- a/WEB-INF/resources/ru.lang.php +++ b/WEB-INF/resources/ru.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Russian (Русский)'; diff --git a/WEB-INF/resources/sk.lang.php b/WEB-INF/resources/sk.lang.php index 1802f518..0404fb8d 100644 --- a/WEB-INF/resources/sk.lang.php +++ b/WEB-INF/resources/sk.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Slovak (Slovenčina)'; diff --git a/WEB-INF/resources/sl.lang.php b/WEB-INF/resources/sl.lang.php index cd614967..b3153ad7 100644 --- a/WEB-INF/resources/sl.lang.php +++ b/WEB-INF/resources/sl.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/sr.lang.php b/WEB-INF/resources/sr.lang.php index 18c64ec7..6902d922 100644 --- a/WEB-INF/resources/sr.lang.php +++ b/WEB-INF/resources/sr.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Serbian (Srpski)'; diff --git a/WEB-INF/resources/sv.lang.php b/WEB-INF/resources/sv.lang.php index 6b2a0d2b..dba0fd6f 100644 --- a/WEB-INF/resources/sv.lang.php +++ b/WEB-INF/resources/sv.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Swedish (Svenska)'; diff --git a/WEB-INF/resources/tr.lang.php b/WEB-INF/resources/tr.lang.php index 0473d081..f2531ee7 100644 --- a/WEB-INF/resources/tr.lang.php +++ b/WEB-INF/resources/tr.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. // Note to translators: Use proper capitalization rules for your language. diff --git a/WEB-INF/resources/zh-cn.lang.php b/WEB-INF/resources/zh-cn.lang.php index 44dc443e..d3051586 100644 --- a/WEB-INF/resources/zh-cn.lang.php +++ b/WEB-INF/resources/zh-cn.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Chinese (简体中文)'; diff --git a/WEB-INF/resources/zh-tw.lang.php b/WEB-INF/resources/zh-tw.lang.php index e5faa1cb..890244f6 100644 --- a/WEB-INF/resources/zh-tw.lang.php +++ b/WEB-INF/resources/zh-tw.lang.php @@ -2,7 +2,8 @@ /* Copyright (c) Anuko International Ltd. https://www.anuko.com License: See license.txt */ -// Note: escape apostrophes with THREE backslashes, like here: choisir l\\\'option. +// Note: escape apostrophes with THREE backslashes, like here: 'choisir l\\\'option'. +// Alternatively: use one backslash and surround by double-quotes: "choisir l\'option". // Other characters (such as double-quotes in http links, etc.) do not have to be escaped. $i18n_language = 'Chinese (簡體中文)'; diff --git a/initialize.php b/initialize.php index 060c63ea..55613a09 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.3.5757"); +define("APP_VERSION", "1.22.3.5758"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 3c7b6f53a0f34d7b9fa712b9a0a7d48f21081b3e Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 21 Dec 2022 13:50:06 +0000 Subject: [PATCH 242/304] Initial release of custom translation feature in display options. --- WEB-INF/templates/display_options.tpl | 2 -- initialize.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/WEB-INF/templates/display_options.tpl b/WEB-INF/templates/display_options.tpl index a6abe34f..0d0418af 100644 --- a/WEB-INF/templates/display_options.tpl +++ b/WEB-INF/templates/display_options.tpl @@ -63,13 +63,11 @@ License: See license.txt *} {$forms.displayOptionsForm.custom_css.control} {$i18n.label.what_is_it}
-{if defined('CUSTOM_TRANSLATION_DEBUG')}
{$i18n.form.display_options.custom_translation} {$forms.displayOptionsForm.custom_translation.control} {$i18n.label.what_is_it}
-{/if}
{$forms.displayOptionsForm.btn_save.control}
{$forms.displayOptionsForm.close} diff --git a/initialize.php b/initialize.php index 55613a09..afb52e81 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.3.5758"); +define("APP_VERSION", "1.22.4.5759"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From f7dbaf2086bb5793ef5e5ecacc74709ac1c7a947 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 23 Dec 2022 13:01:08 +0000 Subject: [PATCH 243/304] Dutch transation improved. --- WEB-INF/resources/nl.lang.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/resources/nl.lang.php b/WEB-INF/resources/nl.lang.php index 16fe1ecf..2ca444c0 100644 --- a/WEB-INF/resources/nl.lang.php +++ b/WEB-INF/resources/nl.lang.php @@ -591,6 +591,5 @@ 'form.display_options.inactive_projects' => 'Niet actieve projecten', 'form.display_options.cost_per_hour' => 'Kosten per uur', 'form.display_options.custom_css' => 'Aangepaste CSS', -// TODO: translate the following. -// 'form.display_options.custom_translation' => 'Custom translation', +'form.display_options.custom_translation' => 'Maatwerk vertaling', ); diff --git a/initialize.php b/initialize.php index afb52e81..08bcf66e 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.4.5759"); +define("APP_VERSION", "1.22.4.5760"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From a38d8502bbcea6f0d877ca4ea0ba202a0a830790 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 25 Dec 2022 16:04:57 +0000 Subject: [PATCH 244/304] Fixed export-import for custom_css and custom_translation fields. --- WEB-INF/lib/ttGroupExportHelper.class.php | 3 ++- WEB-INF/lib/ttOrgImportHelper.class.php | 6 ++++-- initialize.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/WEB-INF/lib/ttGroupExportHelper.class.php b/WEB-INF/lib/ttGroupExportHelper.class.php index fb0f6002..ecd4f80a 100644 --- a/WEB-INF/lib/ttGroupExportHelper.class.php +++ b/WEB-INF/lib/ttGroupExportHelper.class.php @@ -137,7 +137,8 @@ function writeData() { $group_part .= " workday_minutes=\"".$group['workday_minutes']."\""; $group_part .= " custom_logo=\"".$group['custom_logo']."\""; $group_part .= " config=\"".$group['config']."\""; - $group_part .= " custom_css=\"".$group['custom_css']."\""; + $group_part .= " custom_css=\"".htmlspecialchars($group['custom_css'])."\""; + $group_part .= " custom_translation=\"".htmlspecialchars($group['custom_translation'])."\""; $group_part .= ">\n"; // Write group info. diff --git a/WEB-INF/lib/ttOrgImportHelper.class.php b/WEB-INF/lib/ttOrgImportHelper.class.php index aae3267c..cc0ecf1d 100644 --- a/WEB-INF/lib/ttOrgImportHelper.class.php +++ b/WEB-INF/lib/ttOrgImportHelper.class.php @@ -99,7 +99,8 @@ function startElement($parser, $name, $attrs) { 'workday_minutes' => $attrs['WORKDAY_MINUTES'], 'custom_logo' => $attrs['CUSTOM_LOGO'], 'config' => $attrs['CONFIG'], - 'custom_css' => $attrs['CUSTOM_CSS'])); + 'custom_css' => $attrs['CUSTOM_CSS'], + 'custom_translation' => $attrs['CUSTOM_TRANSLATION'])); // Special handling for top group. if (!$this->org_id && $this->current_group_id) { @@ -685,7 +686,7 @@ private function createGroup($fields) { $columns = '(parent_id, org_id, group_key, name, description, currency, decimal_mark, lang, date_format, time_format,'. ' week_start, tracking_mode, project_required, record_type, bcc_email,'. ' allow_ip, password_complexity, plugins, lock_spec,'. - ' workday_minutes, config, custom_css, created, created_ip, created_by)'; + ' workday_minutes, config, custom_css, custom_translation, created, created_ip, created_by)'; $values = ' values ('; $values .= $mdb2->quote($fields['parent_id']); @@ -710,6 +711,7 @@ private function createGroup($fields) { $values .= ', '.(int)$fields['workday_minutes']; $values .= ', '.$mdb2->quote($fields['config']); $values .= ', '.$mdb2->quote($fields['custom_css']); + $values .= ', '.$mdb2->quote($fields['custom_translation']); $values .= ', now(), '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', '.$user->id; $values .= ')'; diff --git a/initialize.php b/initialize.php index 08bcf66e..fb76ba64 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.4.5760"); +define("APP_VERSION", "1.22.4.5761"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From afa80d3b183cadcc586b6ffb3d33f0f4e156e1f8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Wed, 28 Dec 2022 16:53:14 +0000 Subject: [PATCH 245/304] Fixed a bug with deleting custom field dropdown options with 0 as name. --- cf_dropdown_option_delete.php | 2 +- initialize.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cf_dropdown_option_delete.php b/cf_dropdown_option_delete.php index e6eeeeb7..cb8c8a31 100644 --- a/cf_dropdown_option_delete.php +++ b/cf_dropdown_option_delete.php @@ -17,7 +17,7 @@ } $cl_id = (int)$request->getParameter('id'); $option = CustomFields::getOptionName($cl_id); -if (!$option) { +if ($option == null || $option === false) { header('Location: access_denied.php'); exit(); } diff --git a/initialize.php b/initialize.php index fb76ba64..5a0189f2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.4.5761"); +define("APP_VERSION", "1.22.5.5762"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 17705ca52e9e9fbc8cf6c209afecc9c4d5969d7d Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 29 Dec 2022 16:10:51 +0000 Subject: [PATCH 246/304] Work in progress improving German translation. --- WEB-INF/resources/de.lang.php | 99 ++++++++++++++--------------------- initialize.php | 2 +- 2 files changed, 40 insertions(+), 61 deletions(-) diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 9cb0340b..8f0aae4c 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -20,19 +20,16 @@ 'menu.logout' => 'Abmelden', 'menu.forum' => 'Forum', 'menu.help' => 'Hilfe', -// TODO: translate the following. -// 'menu.register' => 'Register', +'menu.register' => 'Registrieren', 'menu.profile' => 'Profil', 'menu.group' => 'Gruppe', 'menu.plugins' => 'Erweiterungen', 'menu.time' => 'Zeiten', -// TODO: translate the following. -// 'menu.puncher' => 'Punch', +'menu.puncher' => 'Stempeluhr', 'menu.week' => 'Woche', 'menu.expenses' => 'Kosten', 'menu.reports' => 'Berichte', -// TODO: translate the following. -// 'menu.timesheets' => 'Timesheets', +'menu.timesheets' => 'Arbeitszeittabellen', 'menu.charts' => 'Diagramme', 'menu.projects' => 'Projekte', 'menu.tasks' => 'Aufgaben', @@ -52,8 +49,7 @@ 'error.access_denied' => 'Zugriff verweigert.', 'error.sys' => 'Systemfehler.', 'error.db' => 'Datenbankfehler.', -// TODO: translate the following. -// 'error.registered_recently' => 'Registered recently.', +'error.registered_recently' => 'Kürzlich registriert.', 'error.feature_disabled' => 'Funktion ist deaktiviert.', 'error.field' => 'Ungültige "{0}" Daten.', 'error.empty' => 'Feld "{0}" ist leer.', @@ -65,40 +61,34 @@ 'error.report' => 'Bericht auswählen.', 'error.record' => 'Eintrag auswählen.', 'error.auth' => 'Benutzername oder Passwort ungültig.', -// TODO: translate the following. -// 'error.2fa_code' => 'Invalid 2FA code.', -// 'error.weak_password' => 'Weak password.', +'error.2fa_code' => 'Ungültiger 2FA-Code.', +'error.weak_password' => 'Schwaches Passwort.', 'error.user_exists' => 'Benutzer mit diesem Konto ist bereits vorhanden.', 'error.object_exists' => 'Objekt mit diesem Namen ist bereits vorhanden.', 'error.invoice_exists' => 'Rechnung mit dieser Nummer existiert bereits.', 'error.role_exists' => 'Rolle mit diesem Rang existiert bereits.', 'error.no_invoiceable_items' => 'Keine Einträge zur Rechnungsstellung gefunden.', -// TODO: translate the following. -// 'error.no_records' => 'There are no records.', +'error.no_records' => 'Es gibt keine Einträge.', 'error.no_login' => 'Benutzer mit diesen Anmeldedaten nicht vorhanden.', 'error.no_groups' => 'Die Datenbank ist leer. Als Administrator anmelden und ein neues Gruppe erzeugen.', 'error.upload' => 'Fehler beim hochladen einer Datei.', 'error.range_locked' => 'Zeitinterval ist gesperrt.', -'error.mail_send' => 'Fehler beim versenden einer E-Mail.', -// TODO: improve the translation above by adding MAIL_SMTP_DEBUG part. -// 'error.mail_send' => 'Error sending mail. Use MAIL_SMTP_DEBUG for diagnostics.', +'error.mail_send' => 'Fehler beim versenden einer E-Mail. Verwenden Sie MAIL_SMTP_DEBUG für die Diagnose.', 'error.no_email' => 'Dieser Benutzer besitzt keine e-Mail Adresse.', 'error.uncompleted_exists' => 'Unvollständiger Eintrag bereits vorhanden. Schließen oder Löschen.', 'error.goto_uncompleted' => 'Zum unvollständigen Eintrag gehen.', 'error.overlap' => 'Der Zeitinterval überschneidet sich mit vorhandenen Einträgen.', 'error.future_date' => 'Datum ist in der Zukunft.', -// TODO: translate the following. -// 'error.xml' => 'Error in XML file at line %d: %s.', -// 'error.cannot_import' => 'Cannot import: %s.', -// 'error.format' => 'Invalid file format.', -// 'error.user_count' => 'Limit on user count.', -// 'error.expired' => 'Expiration date reached.', -// 'error.file_storage' => 'File storage server error.', // See comment in English file. +'error.xml' => 'Fehler in der XML-Datei in der Zeile %d: %s.', +'error.cannot_import' => 'Kann nicht importiert werden: %s.', +'error.format' => 'Ungültiges Dateiformat.', +'error.user_count' => 'Begrenzung der Benutzeranzahl erreicht.', +'error.expired' => 'Ablaufdatum erreicht.', +'error.file_storage' => 'Dateispeicherserver-Fehler.', // Warning messages. 'warn.sure' => 'Sind Sie sicher?', -// TODO: translate the following. -// 'warn.confirm_save' => 'Date has changed. Confirm saving, not copying this item.', +'warn.confirm_save' => 'Das Datum hat sich geändert. Bestätigen Sie das Speichern, nicht das Kopieren dieses Elements.', // Success messages. 'msg.success' => 'Operation vollständig abgeschlossen.', @@ -120,19 +110,14 @@ 'button.export' => 'Gruppe exportieren', 'button.import' => 'Gruppe importieren', 'button.close' => 'Schließen', -// TODO: translate the following. -// 'button.start' => 'Start', +'button.start' => 'Start', 'button.stop' => 'Stop', -// TODO: translate the following. -// (PR#81 suggested 'Freigeben / Genehmigen' for 'Approve' and 'Freigabe zurücknehmen' for 'Disapprove'. -// The problem is they do not appear precise, deviate from the meaning of approval / disaproval of report items.) -// 'button.approve' => 'Approve', (suggested 'Freigeben / Genehmigen' does not appear precise) -// 'button.disapprove' => 'Disapprove', -// 'button.sync' => 'Sync', // Used in Android app. The meaning is to synchronize offline time records with server. +'button.approve' => 'Annehmen', +'button.disapprove' => 'Ablehnen', +'button.sync' => 'Sync', // Labels for controls on forms. Labels in this section are used on multiple forms. -// TODO: translate the following. -// 'label.menu' => 'Menu', +'label.menu' => 'Menü', 'label.group_name' => 'Gruppenname', 'label.address' => 'Adresse', 'label.currency' => 'Währung', @@ -152,9 +137,8 @@ 'label.end_date' => 'Enddatum', 'label.user' => 'Benutzer', 'label.users' => 'Personen', -// TODO: translate the following. -// 'label.group' => 'Group', -// 'label.subgroups' => 'Subgroups', +'label.group' => 'Gruppe', +'label.subgroups' => 'Untergruppen', 'label.roles' => 'Rollen', 'label.client' => 'Kunde', 'label.clients' => 'Kunden', @@ -185,8 +169,7 @@ 'label.select_none' => 'Alle abwählen', 'label.day_view' => 'Tagesansicht', 'label.week_view' => 'Wochenansicht', -// TODO: translate the following: -// 'label.puncher' => 'Puncher', +'label.puncher' => 'Stempeluhr', 'label.id' => 'ID', 'label.language' => 'Sprache', 'label.decimal_mark' => 'Dezimaltrennzeichen', @@ -213,8 +196,7 @@ // Labels for plugins (extensions to Time Tracker that provide additional features). 'label.custom_fields' => 'Benutzerfelder', 'label.monthly_quotas' => 'Monatliche Quoten', -// TODO: translate the following. -// 'label.entity' => 'Entity', +'label.entity' => 'Einheit', 'label.type' => 'Typ', 'label.type_dropdown' => 'Ausklappen', 'label.type_text' => 'Text', @@ -229,33 +211,30 @@ 'label.mark_paid' => 'Als bezahlt setzen', 'label.week_note' => 'Wochennotiz', 'label.week_list' => 'Wochenliste', -// TODO: translate the following: -// 'label.weekends' => 'Weekends', +'label.weekends' => 'Wochenenden', 'label.work_units' => 'Arbeitseinheiten', 'label.work_units_short' => 'Einheiten', 'label.totals_only' => 'Nur Gesamtstunden', 'label.quota' => 'Quote', -// TODO: translate the following. -// 'label.timesheet' => 'Timesheet', -// 'label.submitted' => 'Submitted', -// 'label.approved' => 'Approved', -// 'label.approval' => 'Report approval', -// 'label.mark_approved' => 'Mark approved', -// 'label.template' => 'Template', -// 'label.bind_templates_with_projects' => 'Bind templates with projects', -// 'label.prepopulate_note' => 'Prepopulate Note field', -// 'label.attachments' => 'Attachments', -// 'label.files' => 'Files', -// 'label.file' => 'File', +'label.timesheet' => 'Arbeitszeittabelle', +'label.submitted' => 'Eingereicht', +'label.approved' => 'Genehmigt', +'label.approval' => 'Genehmigung des Berichts', +'label.mark_approved' => 'Als genehmigt markieren', +'label.template' => 'Vorlage', +'label.bind_templates_with_projects' => 'Vorlagen mit Projekten verbinden', +'label.prepopulate_note' => 'Notizfeld vorab ausfüllen', +'label.attachments' => 'Anhänge', +'label.files' => 'Dateien', +'label.file' => 'Datei', 'label.active_users' => 'Aktive Nutzer', 'label.inactive_users' => 'Inaktive Nutzer', // Entity names. We use lower case (in English) because they are used in dropdowns, too. // They are used to associate a custom field with an entity type. -// TODO: translate the following. -// 'entity.time' => 'time', -// 'entity.user' => 'user', -// 'entity.project' => 'project', +'entity.time' => 'Zeit', +'entity.user' => 'Benutzer', +'entity.project' => 'Projekt', // Form titles. 'title.error' => 'Fehler', diff --git a/initialize.php b/initialize.php index 5a0189f2..e71ea88f 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.5.5762"); +define("APP_VERSION", "1.22.5.5763"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 9acc6b2db4c3739bd89632bc1d36216099799931 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 29 Dec 2022 21:44:28 +0000 Subject: [PATCH 247/304] Continued to improve German translation. --- WEB-INF/resources/de.lang.php | 78 +++++++++++++++-------------------- initialize.php | 2 +- 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index 8f0aae4c..d0bbf01b 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -240,8 +240,7 @@ 'title.error' => 'Fehler', 'title.success' => 'Erfol', 'title.login' => 'Anmelden', -// TODO: translate the follolwing. -// 'title.2fa' => 'Two Factor Authentication', +'title.2fa' => 'Zwei-Faktor-Authentifizierung', 'title.groups' => 'Gruppen', 'title.add_group' => 'Gruppe anlegen', 'title.edit_group' => 'Gruppe bearbeiten', @@ -251,9 +250,8 @@ 'title.time' => 'Zeiten', 'title.edit_time_record' => 'Bearbeiten des Stundeneintrags', 'title.delete_time_record' => 'Eintrag löschen', -// TODO: Translate the following. -// 'title.time_files' => 'Time Record Files', -// 'title.puncher' => 'Puncher', +'title.time_files' => 'Zeiterfassungsdateien', +'title.puncher' => 'Stempeluhr', 'title.expenses' => 'Kosten', 'title.edit_expense' => 'Kostenposition ändern', 'title.delete_expense' => 'Kostenposition löschen', @@ -262,10 +260,9 @@ 'title.reports' => 'Berichte', 'title.report' => 'Bericht', 'title.send_report' => 'Bericht senden', -// TODO: Translate the following. -// 'title.timesheets' => 'Timesheets', -// 'title.timesheet' => 'Timesheet', -// 'title.timesheet_files' => 'Timesheet Files', +'title.timesheets' => 'Arbeitszeittabellen', +'title.timesheet' => 'Arbeitszeittabelle', +'title.timesheet_files' => 'Arbeitszeittabellendateien', 'title.invoice' => 'Rechnung', 'title.send_invoice' => 'Rechnung senden', 'title.charts' => 'Diagramme', @@ -298,10 +295,9 @@ 'title.add_notification' => 'Benachrichtigung hinzufügen', 'title.edit_notification' => 'Benachrichtigung bearbeiten', 'title.delete_notification' => 'Benachrichtigung löschen', -// TODO: translate the following. -// 'title.add_timesheet' => 'Adding Timesheet', -// 'title.edit_timesheet' => 'Editing Timesheet', -// 'title.delete_timesheet' => 'Deleting Timesheet', +'title.add_timesheet' => 'Arbeitszeittabelle hinzufügen', +'title.edit_timesheet' => 'Arbeitszeittabelle bearbeiten', +'title.delete_timesheet' => 'Arbeitszeittabelle löschen', 'title.monthly_quotas' => 'Monatliche Quoten', 'title.export' => 'Daten exportieren', 'title.import' => 'Daten importieren', @@ -321,14 +317,13 @@ 'title.week_view' => 'Wochenansicht', 'title.swap_roles' => 'Tausche Rollen', 'title.work_units' => 'Arbeitseinheiten', -// TODO: translate the following. -// 'title.templates' => 'Templates', -// 'title.add_template' => 'Adding Template', -// 'title.edit_template' => 'Editing Template', -// 'title.delete_template' => 'Deleting Template', -// 'title.edit_file' => 'Editing File', -// 'title.delete_file' => 'Deleting File', -// 'title.download_file' => 'Downloading File', +'title.templates' => 'Vorlagen', +'title.add_template' => 'Vorlage hinzufügen', +'title.edit_template' => 'Vorlage bearbeiten', +'title.delete_template' => 'Vorlage löschen', +'title.edit_file' => 'Datei bearbeiten', +'title.delete_file' => 'Datei löschen', +'title.download_file' => 'Datei herunterladen', // 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. @@ -352,20 +347,17 @@ 'dropdown.clients' => 'Kunden', 'dropdown.select' => '--- auswählen ---', 'dropdown.select_invoice' => '--- Rechnung auswählen ---', -// TODO: translate the following. -// 'dropdown.select_timesheet' => '--- select timesheet ---', +'dropdown.select_timesheet' => '--- Arbeitszeittabelle auswählen ---', 'dropdown.status_active' => 'aktiv', 'dropdown.status_inactive' => 'inaktiv', 'dropdown.delete' => 'löschen', 'dropdown.do_not_delete' => 'nicht löschen', -// TODO: translate the following. -// 'dropdown.approved' => 'approved', -// 'dropdown.not_approved' => 'not approved', +'dropdown.approved' => 'genehmigt', +'dropdown.not_approved' => 'abgelehnt', 'dropdown.paid' => 'bezahlt', 'dropdown.not_paid' => 'nicht bezahlt', -// TODO: translate the following. -// 'dropdown.ascending' => 'ascending', -// 'dropdown.descending' => 'descending', +'dropdown.ascending' => 'aufsteigend', +'dropdown.descending' => 'absteigend', // Below is a section for strings that are used on individual forms. When a string is used only on one form it should be placed here. // One exception is for closely related forms such as "Time" and "Editing Time Record" with similar controls. In such cases @@ -377,14 +369,12 @@ 'form.login.about' => 'Anuko Time Tracker ist ein Open-Source Zeiterfassungssystem.', // Email subject and body for two-factor authentication. -// TODO: translate the following. -// 'email.2fa_code.subject' => 'Anuko Time Tracker two-factor authentication code', -// 'email.2fa_code.body' => "Dear User,\n\nYour two-factor authentication code is:\n\n%s\n\n", +'email.2fa_code.subject' => 'Anuko Time Tracker Zwei-Faktor-Authentifizierungscode', +'email.2fa_code.body' => "Sehr geehrter Benutzer,\n\nIhr Zwei-Faktor-Authentifizierungscode lautet:\n\n%s\n\n", // Two-factor authentication form. See example at https://timetracker.anuko.com/2fa.php. -// TODO: translate the following. -// 'form.2fa.hint' => 'Check your email for 2FA code and enter it here.', -// 'form.2fa.2fa_code' => '2FA code', +'form.2fa.hint' => 'Überprüfen Sie Ihre E-Mails auf den 2FA-Code und geben Sie ihn hier ein.', +'form.2fa.2fa_code' => '2FA-Code', // Resetting Password form. See example at https://timetracker.anuko.com/password_reset.php. 'form.reset_password.message' => 'Anfrage zur Zurücksetzung des Passwortes wurde per E-mail gesendet.', @@ -416,19 +406,17 @@ 'form.reports.include_not_billable' => 'nicht in Rechnung stellen', 'form.reports.include_invoiced' => 'berechnet', 'form.reports.include_not_invoiced' => 'nicht berechnet', -// TODO: translate the following. -// 'form.reports.include_assigned' => 'assigned', -// 'form.reports.include_not_assigned' => 'not assigned', -// 'form.reports.include_pending' => 'pending', +'form.reports.include_pending' => 'Ausstehend', 'form.reports.select_period' => 'Zeitraum auswählen', 'form.reports.set_period' => 'oder Datum eingeben', -// TODO: translate the following. -// 'form.reports.note_containing' => 'Note containing', +// TODO: review form.reports.note_containing translation for accuracy. +// This is basically a string filter in user notes, see https://www.anuko.com/time-tracker/what-is/note-containing.htm +'form.reports.note_containing' => 'Enthält Notitz', // The concern is that it may be translated as "Containing a note", which is different + // from "Note containing a substring in this field." 'form.reports.show_fields' => 'Felder anzeigen', -// TODO: translate the following. -// 'form.reports.time_fields' => 'Time fields', -// 'form.reports.user_fields' => 'User fields', -// 'form.reports.project_fields' => 'Project fields', +'form.reports.time_fields' => 'Zeitfelder', +'form.reports.user_fields' => 'Benutzerfelder', +'form.reports.project_fields' => 'Projektfelder', 'form.reports.group_by' => 'Gruppieren nach', 'form.reports.group_by_no' => '--- keine Gruppierung ---', 'form.reports.group_by_date' => 'Datum', diff --git a/initialize.php b/initialize.php index e71ea88f..fb4b2f49 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.5.5763"); +define("APP_VERSION", "1.22.5.5764"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From eb8a5bab0ad7cf9654c40fcf005d6021f3756044 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 30 Dec 2022 16:08:27 +0000 Subject: [PATCH 248/304] Work in progress on German translation. Almost done. --- WEB-INF/resources/de.lang.php | 58 ++++++++++++++++------------------- initialize.php | 2 +- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/WEB-INF/resources/de.lang.php b/WEB-INF/resources/de.lang.php index d0bbf01b..0217fa23 100644 --- a/WEB-INF/resources/de.lang.php +++ b/WEB-INF/resources/de.lang.php @@ -430,18 +430,21 @@ 'form.report.export' => 'Exportiere', 'form.report.per_hour' => 'Stundensatz', 'form.report.assign_to_invoice' => 'Zu Rechnung hinzufügen', -// TODO: translate the following. +// TODO: REVIEW the following. // 'form.report.assign_to_timesheet' => 'Assign to timesheet', +// See how this feature works: https://www.anuko.com/time-tracker/user-guide/timesheets.htm +// Basically, we are selecting records in a report and assign them TO (include IN) one of timesheets. +// The concern is that it is now translated as "Assign timesheet", which is different from how +// form.report.assign_to_invoice above is translated. +'form.report.assign_to_timesheet' => 'Arbeitszeittabelle zuweisen', // Timesheets form. See example at https://timetracker.anuko.com/timesheets.php -// TODO: translate the following. -// 'form.timesheets.active_timesheets' => 'Active Timesheets', -// 'form.timesheets.inactive_timesheets' => 'Inactive Timesheets', +'form.timesheets.active_timesheets' => 'Aktive Arbeitszeittabellen', +'form.timesheets.inactive_timesheets' => 'Inaktive Arbeitszeittabellen', // Templates form. See example at https://timetracker.anuko.com/templates.php -// TODO: translate the following. -// 'form.templates.active_templates' => 'Active Templates', -// 'form.templates.inactive_templates' => 'Inactive Templates', +'form.templates.active_templates' => 'Aktive Vorlagen', +'form.templates.inactive_templates' => 'Inaktive Vorlagen', // Invoice form. See example at https://timetracker.anuko.com/invoice_view.php // (you can get to this form after generating an invoice). @@ -466,8 +469,7 @@ 'form.tasks.inactive_tasks' => 'Inaktive Tasks', // Users form. See example at https://timetracker.anuko.com/users.php -// TODO: translate the following. -// 'form.users.uncompleted_entry_today' => 'User has an uncompleted time entry today', +'form.users.uncompleted_entry_today' => 'Der Benutzer hat heute einen nicht abgeschlossenen Zeiteintrag', 'form.users.uncompleted_entry' => 'Nutzer hat einen unvollständigen Zeiteintrag', 'form.users.role' => 'Rolle', 'form.users.manager' => 'Manager', @@ -521,21 +523,18 @@ 'form.group_edit.type_all' => 'alle', 'form.group_edit.type_start_finish' => 'Start und Ende', 'form.group_edit.type_duration' => 'Dauer', -'form.group_edit.punch_mode' => 'Stechuhr-Modus', -// TODO: translate the following. -// 'form.group_edit.one_uncompleted' => 'One uncompleted', +'form.group_edit.punch_mode' => 'Stempeluhr-Modus', +'form.group_edit.one_uncompleted' => 'Eine unvollendete', 'form.group_edit.allow_overlap' => 'Erlaube Überschneidung', 'form.group_edit.future_entries' => 'Einträge in der Zukunft', 'form.group_edit.uncompleted_indicators' => 'Zeige unfertige Einträge', 'form.group_edit.confirm_save' => 'Speichern bestätigen', -// TODO: translate the following. -// 'form.group_edit.advanced_settings' => 'Advanced settings', +'form.group_edit.advanced_settings' => 'Erweiterte Einstellungen', // Advanced Group Settings form. See example at https://timetracker.anuko.com/group_advanced_edit.php. 'form.group_advanced_edit.allow_ip' => 'Erlaube IP', -// TODO: Translate the following. -// 'form.group_advanced_edit.password_complexity' => 'Password complexity', -// 'form.group_advanced_edit.2fa' => 'Two factor authentication', +'form.group_advanced_edit.password_complexity' => 'Komplexität des Passworts', +'form.group_advanced_edit.2fa' => 'Zwei-Faktor-Authentifizierung', // Deleting Group form. See example at https://timetracker.anuko.com/delete_group.php 'form.group_delete.hint' => 'Sind Sie sicher, dass Sie die gesamte Gruppe löschen möchten?', @@ -569,7 +568,6 @@ 'role.client.low_case_label' => 'Kunde', // TODO: translate the following. // 'role.client.description' => 'A client can view its own data.', -'role.client.description' => 'Ein Kunde kann zu ihm gehörende Berichte und Rechnungen ansehen.', 'role.supervisor.label' => 'Dienstvorgesetzter', 'role.supervisor.low_case_label' => 'Dienstvorgesetzter', 'role.supervisor.description' => 'Eine Person mit ein paar Administrationsrechten.', @@ -587,20 +585,18 @@ 'role.admin.description' => 'Aadminsitrator der Seite.', // Timesheet View form. See example at https://timetracker.anuko.com/timesheet_view.php. -// TODO: translate the following. -// 'form.timesheet_view.submit_subject' => 'Timesheet approval request', -// 'form.timesheet_view.submit_body' => "A new timesheet requires approval.

User: %s.", -// 'form.timesheet_view.approve_subject' => 'Timesheet approved', -// 'form.timesheet_view.approve_body' => "Your timesheet %s was approved.

%s", -// 'form.timesheet_view.disapprove_subject' => 'Timesheet not approved', -// 'form.timesheet_view.disapprove_body' => "Your timesheet %s was not approved.

%s", +'form.timesheet_view.submit_subject' => 'Antrag auf Genehmigung der Arbeitszeittabelle', +'form.timesheet_view.submit_body' => "Eine neue Arbeitszeittabelle muss genehmigt werden.

Benutzer: %s.", +'form.timesheet_view.approve_subject' => 'Arbeitszeittabelle genehmigt', +'form.timesheet_view.approve_body' => "Ihre Arbeitszeittabelle %s wurde genehmigt.

%s", +'form.timesheet_view.disapprove_subject' => 'Arbeitszeittabelle nicht genehmigt', +'form.timesheet_view.disapprove_body' => "Ihre Arbeitszeittabelle %s wurde nicht genehmigt.

%s", // Display Options form. See example at https://timetracker.anuko.com/display_options.php. 'form.display_options.note_on_separate_row' => 'Beschreibung in separater Zeile', -// TODO: translate the following. -// 'form.display_options.not_complete_days' => 'Not complete days', -// 'form.display_options.inactive_projects' => 'Inactive projects', -// 'form.display_options.cost_per_hour' => 'Cost per hour', -// 'form.display_options.custom_css' => 'Custom CSS', -// 'form.display_options.custom_translation' => 'Custom translation', +'form.display_options.not_complete_days' => 'Nicht vollständige Tage', +'form.display_options.inactive_projects' => 'Inaktive Projekte', +'form.display_options.cost_per_hour' => 'Kosten pro Stunde', +'form.display_options.custom_css' => 'Benutzerdefiniertes CSS', +'form.display_options.custom_translation' => 'Benutzerdefinierte Übersetzung', ); diff --git a/initialize.php b/initialize.php index fb4b2f49..67bd4373 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.5.5764"); +define("APP_VERSION", "1.22.5.5765"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From ae138917e7a9e4bf5efcf36bd7969303a0831d19 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 31 Dec 2022 14:48:48 +0000 Subject: [PATCH 249/304] Bug fixes related to using 0 as entity name. --- WEB-INF/lib/form/TextField.class.php | 2 +- WEB-INF/lib/ttAdmin.class.php | 7 +++++-- admin_group_delete.php | 2 +- admin_group_edit.php | 2 +- cf_dropdown_option_delete.php | 2 +- cf_dropdown_option_edit.php | 2 +- initialize.php | 2 +- plugins/CustomFields.class.php | 8 +++++--- 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/WEB-INF/lib/form/TextField.class.php b/WEB-INF/lib/form/TextField.class.php index 91f8b5c2..bfc0e551 100644 --- a/WEB-INF/lib/form/TextField.class.php +++ b/WEB-INF/lib/form/TextField.class.php @@ -56,7 +56,7 @@ function getHtml() { if (!empty($this->on_change)) $html .= " onchange=\"$this->on_change\""; } - $html .= " value=\"".htmlspecialchars($this->getValue() ? $this->getValue() : '')."\""; + $html .= " value=\"".htmlspecialchars($this->getValue())."\""; if(!$this->isEnabled()) $html .= " readonly"; $html .= ">\n"; diff --git a/WEB-INF/lib/ttAdmin.class.php b/WEB-INF/lib/ttAdmin.class.php index 35a26afb..00bd0ff5 100644 --- a/WEB-INF/lib/ttAdmin.class.php +++ b/WEB-INF/lib/ttAdmin.class.php @@ -150,6 +150,8 @@ static function updateSelf($fields) { // getGroupName obtains group name. static function getGroupName($group_id) { + $group_id = (int) $group_id; // Just in case because it is used in sql. + $result = array(); $mdb2 = getConnection(); @@ -158,10 +160,11 @@ static function getGroupName($group_id) { $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); - return $val['name']; + if (isset($val['name'])) + return $val['name']; } - return false; + return null; } // getOrgDetails obtains group name and its top manager details. diff --git a/admin_group_delete.php b/admin_group_delete.php index 0cea02b3..909b2347 100644 --- a/admin_group_delete.php +++ b/admin_group_delete.php @@ -13,7 +13,7 @@ } $group_id = (int)$request->getParameter('id'); $group_name = ttAdmin::getGroupName($group_id); -if (!($group_id && $group_name)) { +if (!($group_id && $group_name != null)) { header('Location: access_denied.php'); exit(); } diff --git a/admin_group_edit.php b/admin_group_edit.php index 81588ebe..496c7b8f 100644 --- a/admin_group_edit.php +++ b/admin_group_edit.php @@ -14,7 +14,7 @@ } $group_id = (int)$request->getParameter('id'); $group_name = ttAdmin::getGroupName($group_id); -if (!($group_id && $group_name)) { +if (!($group_id && $group_name != null)) { header('Location: access_denied.php'); exit(); } diff --git a/cf_dropdown_option_delete.php b/cf_dropdown_option_delete.php index cb8c8a31..50c68501 100644 --- a/cf_dropdown_option_delete.php +++ b/cf_dropdown_option_delete.php @@ -17,7 +17,7 @@ } $cl_id = (int)$request->getParameter('id'); $option = CustomFields::getOptionName($cl_id); -if ($option == null || $option === false) { +if ($option == null) { header('Location: access_denied.php'); exit(); } diff --git a/cf_dropdown_option_edit.php b/cf_dropdown_option_edit.php index eee02f63..2477b057 100644 --- a/cf_dropdown_option_edit.php +++ b/cf_dropdown_option_edit.php @@ -17,7 +17,7 @@ } $cl_id = (int)$request->getParameter('id'); $cl_name = CustomFields::getOptionName($cl_id); -if (!$cl_name) { +if ($cl_name == null) { header('Location: access_denied.php'); exit(); } diff --git a/initialize.php b/initialize.php index 67bd4373..b6d48738 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.5.5765"); +define("APP_VERSION", "1.22.6.5766"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index 0e52871e..b4839cf1 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -221,6 +221,8 @@ static function getOptionName($id) { global $user; $mdb2 = getConnection(); + $id = (int) $id; // Just in case. Better safe than sorry as it is used in sql. + $group_id = $user->getGroup(); $org_id = $user->org_id; @@ -229,10 +231,10 @@ static function getOptionName($id) { $res = $mdb2->query($sql); if (!is_a($res, 'PEAR_Error')) { $val = $res->fetchRow(); - $name = $val['value']; - return $name; + if (isset($val['value'])) + return $val['value']; } - return false; + return null; } // getFields returns an array of custom fields for group. From aa8c6961dcce1ae929f1108033871f9574bddae5 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 31 Dec 2022 15:17:40 +0000 Subject: [PATCH 250/304] Fixes related to using 0 in fields. --- WEB-INF/lib/ttAdmin.class.php | 3 ++- admin_options.php | 2 +- initialize.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttAdmin.class.php b/WEB-INF/lib/ttAdmin.class.php index 00bd0ff5..4a631d5e 100644 --- a/WEB-INF/lib/ttAdmin.class.php +++ b/WEB-INF/lib/ttAdmin.class.php @@ -138,7 +138,8 @@ static function updateSelf($fields) { // Update self. $user_id = $user->id; $login_part = 'login = '.$mdb2->quote($fields['login']); - if ($fields['password1']) + $password_part = ''; + if (isset($fields['password1'])) $password_part = ', password = md5('.$mdb2->quote($fields['password1']).')'; $name_part = ', name = '.$mdb2->quote($fields['name']); $email_part = ', email = '.$mdb2->quote($fields['email']); diff --git a/admin_options.php b/admin_options.php index 84a0ed3a..aed85232 100644 --- a/admin_options.php +++ b/admin_options.php @@ -48,7 +48,7 @@ // If we change login, it must be unique. if ($cl_login != $user->login && ttUserHelper::getUserByLogin($cl_login)) $err->add($i18n->get('error.user_exists')); - if (!$auth->isPasswordExternal() && ($cl_password1 || $cl_password2)) { + if (!$auth->isPasswordExternal() && ($cl_password1 != null || $cl_password2 != null)) { if (!ttValidString($cl_password1)) $err->add($i18n->get('error.field'), $i18n->get('label.password')); if (!ttValidString($cl_password2)) diff --git a/initialize.php b/initialize.php index b6d48738..3e332eba 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.6.5766"); +define("APP_VERSION", "1.22.6.5767"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From d019c044c0e8d21ce463f680fd45f86fcf6c8014 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 1 Jan 2023 16:21:43 +0000 Subject: [PATCH 251/304] Disallowed adding a duplicate custom field with the same name and entity type. --- cf_custom_field_add.php | 2 +- initialize.php | 2 +- plugins/CustomFields.class.php | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index c1080375..87d46bcd 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -15,7 +15,6 @@ header('Location: feature_disabled.php'); exit(); } -$fields = CustomFields::getFields(); // End of access checks. if ($request->isPost()) { @@ -42,6 +41,7 @@ if ($request->isPost()) { // Validate user input. if (!ttValidString($cl_field_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); + if (CustomFields::getFieldByName($cl_field_name, $cl_entity_type) != null) $err->add($i18n->get('error.object_exists')); if ($err->no()) { $res = CustomFields::insertField($cl_field_name, $cl_entity_type, $cl_field_type, $cl_required); diff --git a/initialize.php b/initialize.php index 3e332eba..e43e33d3 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.6.5767"); +define("APP_VERSION", "1.22.6.5768"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/plugins/CustomFields.class.php b/plugins/CustomFields.class.php index b4839cf1..b561af80 100644 --- a/plugins/CustomFields.class.php +++ b/plugins/CustomFields.class.php @@ -278,6 +278,27 @@ static function getField($id) { return false; } + // getFieldByName returns a custom field by name and its entity type. + static function getFieldByName($fieldName, $entityType) { + global $user; + $mdb2 = getConnection(); + + $entityType = (int) $entityType; // Just in case. + $group_id = $user->getGroup(); + $org_id = $user->org_id; + + $sql = "select label, type, required from tt_custom_fields" . + " where label = ". $mdb2->quote($fieldName) . " and entity_type = $entityType". + " and group_id = $group_id and org_id = $org_id and status is not null"; + $res = $mdb2->query($sql); + if (!is_a($res, 'PEAR_Error')) { + $val = $res->fetchRow(); + if (isset($val)) + return $val; + } + return null; + } + // getFieldIdForOption returns field id from an associated option id. static function getFieldIdForOption($option_id) { global $user; From e0b9d2112e4b8134839e9540acb6d133bf1dce6b Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 2 Jan 2023 17:15:59 +0000 Subject: [PATCH 252/304] Fixed a printing problem by eliminating a 1st page break for large reports. --- default.css | 13 +++++++++++++ initialize.php | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/default.css b/default.css index 38de0f53..7c88fc2d 100644 --- a/default.css +++ b/default.css @@ -145,6 +145,19 @@ div.page-hint { border-collapse: collapse; } +/* For printing large tables that do not fit into one page, we have to change the display +property to "block" and also use "break-before: avoid;". This eliminates a page break between +header and large table on print previews. I could not accomplish this with inline-block +because break-before is apparently ignored for inline elements. +inline-block above in itself is needed for nice horizontal centering on screen. */ +@media print +{ + .x-scrollable-table { display: block; break-before: avoid; break-after: auto; } + /* Not sure if we need this, keep commented out for now. + .x-scrollable-table tr { page-break-inside:avoid; page-break-after:auto; } + .x-scrollable-table td { page-break-inside:avoid; page-break-after:auto; } */ +} + /* th in x-scrollable-table */ .x-scrollable-table th { white-space: nowrap; diff --git a/initialize.php b/initialize.php index e43e33d3..c43bafdd 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.6.5768"); +define("APP_VERSION", "1.22.7.5769"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 791d64428e8242a5bc4fd8af311c36ba1379d602 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Mon, 2 Jan 2023 20:57:22 +0000 Subject: [PATCH 253/304] A fix for invoices to allow 0 as invoice name. --- WEB-INF/lib/ttInvoiceHelper.class.php | 3 +-- initialize.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WEB-INF/lib/ttInvoiceHelper.class.php b/WEB-INF/lib/ttInvoiceHelper.class.php index 2ac63db4..44206fa0 100644 --- a/WEB-INF/lib/ttInvoiceHelper.class.php +++ b/WEB-INF/lib/ttInvoiceHelper.class.php @@ -298,8 +298,7 @@ static function createInvoice($fields) { $group_id = $user->getGroup(); $org_id = $user->org_id; - $name = $fields['name']; - if (!$name) return false; + $name = isset($fields['name']) ? $fields['name'] : null; $client_id = (int) $fields['client_id']; diff --git a/initialize.php b/initialize.php index c43bafdd..9f8a7a45 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.7.5769"); +define("APP_VERSION", "1.22.7.5770"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From b3f906536d4f6e8e9eb64e6b7a8c4a7db2969b06 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Thu, 5 Jan 2023 15:48:15 +0000 Subject: [PATCH 254/304] Some fixes for incompatible database structure. --- WEB-INF/lib/ttUser.class.php | 162 +++++++++++++++++++---------------- default.css | 5 +- initialize.php | 2 +- login.php | 12 ++- 4 files changed, 98 insertions(+), 83 deletions(-) diff --git a/WEB-INF/lib/ttUser.class.php b/WEB-INF/lib/ttUser.class.php index 37591fa5..2e86eacb 100644 --- a/WEB-INF/lib/ttUser.class.php +++ b/WEB-INF/lib/ttUser.class.php @@ -62,6 +62,9 @@ class ttUser { var $behalfUser = null; // A ttBehalfUser instance with on behalf user attributes. var $behalfGroup = null; // A ttGroup instance with on behalf group attributes. + var $initialized = false; // Set to true when an object is initialized. + + // Constructor. function __construct($login, $id = null) { if (!$login && !$id) { @@ -69,86 +72,93 @@ function __construct($login, $id = null) { return; } - $mdb2 = getConnection(); - - $sql = "SELECT u.id, u.login, u.name, u.group_id, u.role_id, r.rank, r.name as role_name, r.rights, u.client_id,". - " u.quota_percent, u.email, g.org_id, g.group_key, g.name as group_name, g.currency, g.lang, g.decimal_mark, g.date_format,". - " g.time_format, g.week_start, g.tracking_mode, g.project_required, g.record_type,". - " g.bcc_email, g.allow_ip, g.password_complexity, g.plugins, g.config, g.lock_spec, g.custom_css, g.custom_translation,". - " g.holidays, g.workday_minutes, g.custom_logo". - " FROM tt_users u LEFT JOIN tt_groups g ON (u.group_id = g.id) LEFT JOIN tt_roles r on (r.id = u.role_id) WHERE "; - if ($id) - $sql .= "u.id = $id"; - else - $sql .= "u.login = ".$mdb2->quote($login); - $sql .= " AND u.status = 1"; + try { + $mdb2 = getConnection(); + + $sql = "SELECT u.id, u.login, u.name, u.group_id, u.role_id, r.rank, r.name as role_name, r.rights, u.client_id,". + " u.quota_percent, u.email, g.org_id, g.group_key, g.name as group_name, g.currency, g.lang, g.decimal_mark, g.date_format,". + " g.time_format, g.week_start, g.tracking_mode, g.project_required, g.record_type,". + " g.bcc_email, g.allow_ip, g.password_complexity, g.plugins, g.config, g.lock_spec, g.custom_css, g.custom_translation,". + " g.holidays, g.workday_minutes, g.custom_logo". + " FROM tt_users u LEFT JOIN tt_groups g ON (u.group_id = g.id) LEFT JOIN tt_roles r on (r.id = u.role_id) WHERE "; + if ($id) + $sql .= "u.id = $id"; + else + $sql .= "u.login = ".$mdb2->quote($login); + $sql .= " AND u.status = 1"; + + $res = $mdb2->query($sql); + if (is_a($res, 'PEAR_Error')) { + return; + } - $res = $mdb2->query($sql); - if (is_a($res, 'PEAR_Error')) { - return; - } + $val = $res->fetchRow(); + if ($val['id'] > 0) { + $this->login = $val['login']; + $this->name = $val['name']; + $this->id = $val['id']; + $this->org_id = $val['org_id']; + $this->group_id = $val['group_id']; + $this->group_key = $val['group_key']; + if ($this->org_id == $this->group_key) $this->org_key = $val['group_key']; + $this->role_id = $val['role_id']; + $this->role_name = $val['role_name']; + $this->rights = explode(',', $val['rights']); + $this->rank = $val['rank']; + $this->client_id = $val['client_id']; + $this->is_client = $this->client_id && !in_array('track_own_time', $this->rights); + if ($val['quota_percent']) $this->quota_percent = $val['quota_percent']; + $this->email = $val['email']; + if ($val['lang']) $this->lang = $val['lang']; + if ($val['decimal_mark']) $this->decimal_mark = $val['decimal_mark']; + $this->date_format = $val['date_format']; + $this->time_format = $val['time_format']; + $this->week_start = $val['week_start']; + $this->tracking_mode = $val['tracking_mode']; + $this->project_required = $val['project_required']; + $this->record_type = $val['record_type']; + $this->bcc_email = $val['bcc_email']; + $this->allow_ip = $val['allow_ip']; + $this->password_complexity = $val['password_complexity']; + $this->group_name = $val['group_name']; + $this->currency = $val['currency']; + $this->plugins = $val['plugins']; + $this->lock_spec = $val['lock_spec']; + $this->holidays = $val['holidays']; + $this->workday_minutes = $val['workday_minutes']; + $this->custom_logo = $val['custom_logo']; + + // TODO: refactor this. + $this->config = $val['config']; + $this->configHelper = new ttConfigHelper($val['config']); + + // Set user config options. + $this->punch_mode = $this->configHelper->getDefinedValue('punch_mode'); + $this->allow_overlap = $this->configHelper->getDefinedValue('allow_overlap'); + + $this->custom_css = $val['custom_css']; + $this->custom_translation = $val['custom_translation']; + + // Set "on behalf" id and name (user). + if (isset($_SESSION['behalf_id'])) { + $this->behalf_id = $_SESSION['behalf_id']; + $this->behalf_name = $_SESSION['behalf_name']; + + $this->behalfUser = new ttBehalfUser($this->behalf_id, $this->org_id); + } + // Set "on behalf" id and name (group). + if (isset($_SESSION['behalf_group_id'])) { + $this->behalf_group_id = $_SESSION['behalf_group_id']; + $this->behalf_group_name = $_SESSION['behalf_group_name']; - $val = $res->fetchRow(); - if ($val['id'] > 0) { - $this->login = $val['login']; - $this->name = $val['name']; - $this->id = $val['id']; - $this->org_id = $val['org_id']; - $this->group_id = $val['group_id']; - $this->group_key = $val['group_key']; - if ($this->org_id == $this->group_key) $this->org_key = $val['group_key']; - $this->role_id = $val['role_id']; - $this->role_name = $val['role_name']; - $this->rights = explode(',', $val['rights']); - $this->rank = $val['rank']; - $this->client_id = $val['client_id']; - $this->is_client = $this->client_id && !in_array('track_own_time', $this->rights); - if ($val['quota_percent']) $this->quota_percent = $val['quota_percent']; - $this->email = $val['email']; - if ($val['lang']) $this->lang = $val['lang']; - if ($val['decimal_mark']) $this->decimal_mark = $val['decimal_mark']; - $this->date_format = $val['date_format']; - $this->time_format = $val['time_format']; - $this->week_start = $val['week_start']; - $this->tracking_mode = $val['tracking_mode']; - $this->project_required = $val['project_required']; - $this->record_type = $val['record_type']; - $this->bcc_email = $val['bcc_email']; - $this->allow_ip = $val['allow_ip']; - $this->password_complexity = $val['password_complexity']; - $this->group_name = $val['group_name']; - $this->currency = $val['currency']; - $this->plugins = $val['plugins']; - $this->lock_spec = $val['lock_spec']; - $this->holidays = $val['holidays']; - $this->workday_minutes = $val['workday_minutes']; - $this->custom_logo = $val['custom_logo']; - - // TODO: refactor this. - $this->config = $val['config']; - $this->configHelper = new ttConfigHelper($val['config']); - - // Set user config options. - $this->punch_mode = $this->configHelper->getDefinedValue('punch_mode'); - $this->allow_overlap = $this->configHelper->getDefinedValue('allow_overlap'); - - $this->custom_css = $val['custom_css']; - $this->custom_translation = $val['custom_translation']; - - // Set "on behalf" id and name (user). - if (isset($_SESSION['behalf_id'])) { - $this->behalf_id = $_SESSION['behalf_id']; - $this->behalf_name = $_SESSION['behalf_name']; - - $this->behalfUser = new ttBehalfUser($this->behalf_id, $this->org_id); + $this->behalfGroup = new ttGroup($this->behalf_group_id, $this->org_id); + } } - // Set "on behalf" id and name (group). - if (isset($_SESSION['behalf_group_id'])) { - $this->behalf_group_id = $_SESSION['behalf_group_id']; - $this->behalf_group_name = $_SESSION['behalf_group_name']; - $this->behalfGroup = new ttGroup($this->behalf_group_id, $this->org_id); - } + $this->initialized = true; + } + catch (Exception $e) { + error_log("Exception raised in ttUser constructor: ".$e->getMessage()); } } diff --git a/default.css b/default.css index 7c88fc2d..d1a77ebd 100644 --- a/default.css +++ b/default.css @@ -148,8 +148,9 @@ div.page-hint { /* For printing large tables that do not fit into one page, we have to change the display property to "block" and also use "break-before: avoid;". This eliminates a page break between header and large table on print previews. I could not accomplish this with inline-block -because break-before is apparently ignored for inline elements. -inline-block above in itself is needed for nice horizontal centering on screen. */ +because break-before is apparently ignored for inline-block elements. +inline-block above in itself is needed for nice horizontal centering on screen. +A side effect of this is that printed tables are not horizontally centered. */ @media print { .x-scrollable-table { display: block; break-before: avoid; break-after: auto; } diff --git a/initialize.php b/initialize.php index 9f8a7a45..e2f8a2e2 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,7 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.7.5770"); +define("APP_VERSION", "1.22.8.5771"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/login.php b/login.php index f5dd8eec..2d9dde04 100644 --- a/login.php +++ b/login.php @@ -55,13 +55,17 @@ if ($err->no() && $loginSucceeded) { $user = new ttUser(null, $auth->getUserId()); - // Determine if we have to additionally use two-factor authentication. - $config = $user->getConfigHelper(); - $use2FA = $config->getDefinedValue('2fa'); + if ($user->initialized) { + // Determine if we have to additionally use two-factor authentication. + $config = $user->getConfigHelper(); + $use2FA = $config->getDefinedValue('2fa'); + } else { + $err->add($i18n->get('error.db')); + } } // If we have to use 2FA, email auth code to user and redirect to 2fa.php. - if ($use2FA && !$user->can('override_2fa')) { + if ($err->no() && $use2FA && !$user->can('override_2fa')) { // To keep things simple, we use the same code as for password resets. $cryptographically_strong = true; $random_bytes = openssl_random_pseudo_bytes(16, $cryptographically_strong); From 94765d3b81cbbe5feb8d0a2418e3f29d06c61740 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 6 Jan 2023 16:22:10 +0000 Subject: [PATCH 255/304] An attempt to better support php8.1 or greater. --- initialize.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/initialize.php b/initialize.php index e2f8a2e2..0ed4d1d7 100644 --- a/initialize.php +++ b/initialize.php @@ -12,7 +12,13 @@ // Disable displaying errors on screen. ini_set('display_errors', 'Off'); -define("APP_VERSION", "1.22.8.5771"); +// Disable mysqli fatal error behaviour when using php8.1 or greater. +// See https://php.watch/versions/8.1/mysqli-error-mode +if (version_compare(phpversion(), '8.1', '>=')) { + mysqli_report(MYSQLI_REPORT_OFF); +} + +define("APP_VERSION", "1.22.9.5772"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 6bce8835b9b5a5c185ba44a652b9955993ff27a2 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sat, 7 Jan 2023 18:12:18 +0000 Subject: [PATCH 256/304] Addressed a few more php8.0 warnings. --- dbinstall.php | 44 ++++++++++++++++++++++---------------------- initialize.php | 2 +- time.php | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dbinstall.php b/dbinstall.php index c79cd558..2db0bebc 100644 --- a/dbinstall.php +++ b/dbinstall.php @@ -201,7 +201,7 @@ function ttGenerateKeys() { if ($_POST) { print "Processing...
\n"; - if ($_POST["crstructure"]) { + if (array_key_exists('crstructure', $_POST)) { $sqlQuery = join("\n", file("mysql.sql")); $sqlQuery = str_replace("TYPE=MyISAM","",$sqlQuery); $queries = explode(";",$sqlQuery); @@ -215,7 +215,7 @@ function ttGenerateKeys() { } } - if ($_POST["convert5to7"]) { + if (array_key_exists('convert5to7', $_POST)) { ttExecute("alter table `activity_log` CHANGE al_comment al_comment text"); ttExecute("CREATE TABLE `sysconfig` (`sysc_id` int(11) unsigned NOT NULL auto_increment,`sysc_name` varchar(32) NOT NULL default '',`sysc_value` varchar(70) default NULL, PRIMARY KEY (`sysc_id`), UNIQUE KEY `sysc_id` (`sysc_id`), UNIQUE KEY `sysc_name` (`sysc_name`))"); ttExecute("alter table `companies` add c_locktime int(4) default -1"); @@ -229,7 +229,7 @@ function ttGenerateKeys() { ttExecute("alter table users drop `u_aprojects`"); } - if ($_POST["convert7to133"]) { + if (array_key_exists('convert7to133', $_POST)) { ttExecute("ALTER TABLE users ADD COLUMN u_lang VARCHAR(20) DEFAULT NULL"); ttExecute("ALTER TABLE users ADD COLUMN u_email VARCHAR(100) DEFAULT NULL"); ttExecute("ALTER TABLE `activity_log` drop `al_proof`"); @@ -244,7 +244,7 @@ function ttGenerateKeys() { // The update_projects function updates p_activities field in the projects table so that we could // improve performance of the application by using this field instead of activity_bind table. - if ($_POST["update_projects"]) { + if (array_key_exists('update_projects', $_POST)) { $mdb2 = getConnection(); // $sql = "select p_id from projects where p_status = 1 and p_activities is NULL"; $sql = "select p_id from projects where p_status = 1"; @@ -281,15 +281,15 @@ function ttGenerateKeys() { } } - if ($_POST["convert133to1340"]) { + if (array_key_exists('convert133to1340', $_POST)) { ttExecute("ALTER TABLE companies ADD COLUMN c_show_pie smallint(2) DEFAULT 1"); ttExecute("ALTER TABLE companies ADD COLUMN c_pie_mode smallint(2) DEFAULT 1"); ttExecute("ALTER TABLE companies ADD COLUMN c_lang varchar(20) default NULL"); } // The update_companies function sets up c_show_pie, c_pie_mode, and c_lang - // fields in the companies table from the corresponding manager fields. - if ($_POST["update_companies"]) { + // fields in the companies table from the corresponding manager fields. + if (array_key_exists('update_companies', $_POST)) { $mdb2 = getConnection(); // Get all active managers. $sql = "select u_company_id, u_show_pie, u_pie_mode, u_lang from users @@ -316,7 +316,7 @@ function ttGenerateKeys() { } } - if ($_POST["convert1340to1485"]) { + if (array_key_exists('convert1340to1485', $_POST)) { ttExecute("ALTER TABLE users DROP u_show_pie"); ttExecute("ALTER TABLE users DROP u_pie_mode"); ttExecute("ALTER TABLE users DROP u_lang"); @@ -421,7 +421,7 @@ function ttGenerateKeys() { } // The update_to_team_id function sets team_id field projects, activities, and clients tables. - if ($_POST["update_to_team_id"]) { + if (array_key_exists('update_to_team_id', $_POST)) { $mdb2 = getConnection(); // Update projects. @@ -518,7 +518,7 @@ function ttGenerateKeys() { print "Updated $clients_updated clients...
\n"; } - if ($_POST["convert1485to1579"]) { + if (array_key_exists('convert1485to1579', $_POST)) { ttExecute("ALTER TABLE tt_fav_reports MODIFY id int(11) NOT NULL auto_increment"); ttExecute("RENAME TABLE clients TO tt_clients"); ttExecute("ALTER TABLE tt_clients CHANGE clnt_id id int(11) NOT NULL AUTO_INCREMENT"); @@ -625,7 +625,7 @@ function ttGenerateKeys() { ttExecute("create index invoice_idx on tt_log(invoice_id)"); } - if ($_POST["convert1579to1600"]) { + if (array_key_exists('convert1579to1600', $_POST)) { ttExecute("ALTER TABLE tt_invoices ADD COLUMN date date NOT NULL"); ttExecute("ALTER TABLE tt_teams ADD COLUMN custom_logo tinyint(4) default '0'"); ttExecute("ALTER TABLE tt_tasks ADD COLUMN description varchar(255) default NULL"); @@ -643,7 +643,7 @@ function ttGenerateKeys() { } // The update_clients function updates projects field in tt_clients table. - if ($_POST["update_clients"]) { + if (array_key_exists('update_clients', $_POST)) { $mdb2 = getConnection(); $sql = "select id from tt_clients where status = 1 or status = 0"; $res = $mdb2->query($sql); @@ -682,7 +682,7 @@ function ttGenerateKeys() { } // The update_custom_fields function updates option_id field in tt_custom_field_log table. - if ($_POST['update_custom_fields']) { + if (array_key_exists('update_custom_fields', $_POST)) { $mdb2 = getConnection(); $sql = "update tt_custom_field_log set option_id = value where option_id is null and value is not null and field_id in (select id from tt_custom_fields where type = 2)"; $affected = $mdb2->exec($sql); @@ -693,7 +693,7 @@ function ttGenerateKeys() { } // The update_tracking_mode function sets the tracking_mode field in tt_teams table to 2 (== MODE_PROJECTS_AND_TASKS). - if ($_POST['update_tracking_mode']) { + if (array_key_exists('update_tracking_mode', $_POST)) { $mdb2 = getConnection(); $sql = "update tt_teams set tracking_mode = 2 where tracking_mode = 0"; $affected = $mdb2->exec($sql); @@ -703,7 +703,7 @@ function ttGenerateKeys() { print "Updated $affected teams...
\n"; } - if ($_POST["convert1600to11400"]) { + if (array_key_exists('convert1600to11400', $_POST)) { ttExecute("DROP TABLE IF EXISTS tt_invoice_headers"); ttExecute("ALTER TABLE tt_fav_reports ADD COLUMN `client_id` int(11) default NULL"); ttExecute("ALTER TABLE tt_fav_reports ADD COLUMN `cf_1_option_id` int(11) default NULL"); @@ -751,7 +751,7 @@ function ttGenerateKeys() { ttExecute("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`"); } - if ($_POST["convert11400to11744"]) { + if (array_key_exists('convert11400to11744', $_POST)) { ttExecute("ALTER TABLE `tt_teams` DROP `address`"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `report_spec` text default NULL AFTER `user_id`"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `paid_status` tinyint(4) default NULL AFTER `invoice`"); @@ -794,7 +794,7 @@ function ttGenerateKeys() { } // The update_role_id function assigns a role_id to users, who don't have it. - if ($_POST['update_role_id']) { + if (array_key_exists('update_role_id', $_POST)) { import('I18n'); $mdb2 = getConnection(); @@ -833,7 +833,7 @@ function ttGenerateKeys() { print "Updated $users_updated users...
\n"; } - if ($_POST["convert11744to11797"]) { + if (array_key_exists('convert11744to11797', $_POST)) { ttExecute("update `tt_roles` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.17.44') set rights = replace(rights, 'override_punch_mode,override_date_lock', 'override_punch_mode,override_own_punch_mode,override_date_lock')"); ttExecute("UPDATE `tt_site_config` SET param_value = '1.17.48' where param_name = 'version_db' and param_value = '1.17.44'"); ttExecute("update `tt_users` inner join `tt_site_config` sc on (sc.param_name = 'version_db' and sc.param_value = '1.17.48') set role_id = (select id from tt_roles where team_id = 0 and `rank` = 512) where role = 324"); @@ -938,7 +938,7 @@ function ttGenerateKeys() { } // The update_group_id function updates group_id field in tt_log and tt_expense_items tables. - if ($_POST["update_group_id"]) { + if (array_key_exists('update_group_id', $_POST)) { $mdb2 = getConnection(); $sql = "(select distinct user_id from tt_log where group_id is null) union distinct (select distinct user_id from tt_expense_items where group_id is null)"; @@ -984,7 +984,7 @@ function ttGenerateKeys() { print "Updated $tt_expense_items_updated tt_expense_items records...
\n"; } - if ($_POST["convert11797to11900"]) { + if (array_key_exists('convert11797to11900', $_POST)) { ttExecute("ALTER TABLE `tt_fav_reports` CHANGE `group_by` `group_by1` varchar(20) default NULL"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by2` varchar(20) default NULL AFTER `group_by1`"); ttExecute("ALTER TABLE `tt_fav_reports` ADD `group_by3` varchar(20) default NULL AFTER `group_by2`"); @@ -1151,7 +1151,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.19.0', modified = now() where param_name = 'version_db' and param_value = '1.18.61'"); } - if ($_POST["convert11900to12203"]) { + if (array_key_exists('convert11900to12203', $_POST)) { ttExecute("CREATE TABLE `tt_work_currencies` (`id` int(10) unsigned NOT NULL,`name` varchar(10) NOT NULL,PRIMARY KEY (`id`))"); ttExecute("create unique index currency_idx on tt_work_currencies(`name`)"); ttExecute("INSERT INTO `tt_work_currencies` (`id`, `name`) VALUES ('1', 'USD'), ('2', 'CAD'), ('3', 'AUD'), ('4', 'EUR'), ('5', 'NZD')"); @@ -1203,7 +1203,7 @@ function ttGenerateKeys() { ttExecute("UPDATE `tt_site_config` SET param_value = '1.22.3', modified = now() where param_name = 'version_db' and param_value = '1.21.7'"); } - if ($_POST["cleanup"]) { + if (array_key_exists('cleanup', $_POST)) { $mdb2 = getConnection(); $inactive_orgs = ttOrgHelper::getInactiveOrgs(); diff --git a/initialize.php b/initialize.php index 0ed4d1d7..705d2db1 100644 --- a/initialize.php +++ b/initialize.php @@ -18,7 +18,7 @@ mysqli_report(MYSQLI_REPORT_OFF); } -define("APP_VERSION", "1.22.9.5772"); +define("APP_VERSION", "1.22.9.5773"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); diff --git a/time.php b/time.php index 766ee5fd..931436fa 100644 --- a/time.php +++ b/time.php @@ -386,7 +386,7 @@ if ($showTask && $taskRequired) { if (!$cl_task) $err->add($i18n->get('error.task')); } - if (strlen($cl_duration) == 0) { + if ($cl_duration == null || strlen($cl_duration) == 0) { if ($cl_start || $cl_finish) { if (!ttTimeHelper::isValidTime($cl_start)) $err->add($i18n->get('error.field'), $i18n->get('label.start')); From 0ade9c1b7310e67ac38ee9426f27253a703a32a0 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 8 Jan 2023 15:24:49 +0000 Subject: [PATCH 257/304] Improved handling of a situation when mysqli_report function is not available. --- initialize.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/initialize.php b/initialize.php index 705d2db1..3c819192 100644 --- a/initialize.php +++ b/initialize.php @@ -15,10 +15,13 @@ // Disable mysqli fatal error behaviour when using php8.1 or greater. // See https://php.watch/versions/8.1/mysqli-error-mode if (version_compare(phpversion(), '8.1', '>=')) { - mysqli_report(MYSQLI_REPORT_OFF); + if (function_exists('mysqli_report')) + mysqli_report(MYSQLI_REPORT_OFF); + else + die("mysqli_report function is not available."); // No point to continue as mysqli will not work. } -define("APP_VERSION", "1.22.9.5773"); +define("APP_VERSION", "1.22.9.5774"); define("APP_DIR", dirname(__FILE__)); define("LIBRARY_DIR", APP_DIR."/WEB-INF/lib"); define("TEMPLATE_DIR", APP_DIR."/WEB-INF/templates"); From 88c0ea1884e59e7f1275cff94ca888962750a1e8 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 8 Jan 2023 20:23:12 +0000 Subject: [PATCH 258/304] Updated smarty for better compatibility with php8.1. --- WEB-INF/lib/smarty/Autoloader.php | 9 +- WEB-INF/lib/smarty/Smarty.class.php | 35 ++++---- WEB-INF/lib/smarty/bootstrap.php | 2 +- WEB-INF/lib/smarty/debug.tpl | 53 +++++++----- WEB-INF/lib/smarty/functions.php | 51 +++++++++++ .../plugins/function.html_select_date.php | 73 ++++++++-------- .../lib/smarty/plugins/function.mailto.php | 28 ++++--- WEB-INF/lib/smarty/plugins/function.math.php | 4 +- .../smarty/plugins/modifier.capitalize.php | 2 + WEB-INF/lib/smarty/plugins/modifier.count.php | 36 ++++++++ .../smarty/plugins/modifier.date_format.php | 3 +- .../lib/smarty/plugins/modifier.escape.php | 84 ++----------------- .../lib/smarty/plugins/modifier.explode.php | 25 ++++++ .../smarty/plugins/modifier.number_format.php | 26 ++++++ .../lib/smarty/plugins/modifier.truncate.php | 6 +- .../plugins/modifiercompiler.escape.php | 49 +++-------- .../smarty/plugins/modifiercompiler.nl2br.php | 23 +++++ .../smarty/plugins/modifiercompiler.round.php | 23 +++++ .../plugins/modifiercompiler.str_repeat.php | 23 +++++ .../plugins/modifiercompiler.strip_tags.php | 4 +- .../plugins/modifiercompiler.strlen.php | 23 +++++ .../plugins/modifiercompiler.unescape.php | 26 ++++-- .../smarty/plugins/modifiercompiler.upper.php | 4 +- .../smarty/plugins/shared.mb_str_replace.php | 36 +++++++- WEB-INF/lib/smarty/readme | 7 -- .../sysplugins/smarty_cacheresource.php | 4 +- .../smarty_cacheresource_keyvaluestore.php | 4 +- .../smarty_internal_cacheresource_file.php | 2 +- .../smarty_internal_compile_block.php | 4 +- .../smarty_internal_compile_function.php | 8 +- .../smarty_internal_compile_include.php | 4 +- .../smarty_internal_compile_insert.php | 2 +- ...nternal_compile_private_foreachsection.php | 6 +- ...arty_internal_compile_private_modifier.php | 3 + ...ernal_compile_private_print_expression.php | 2 +- ...ernal_compile_private_special_variable.php | 6 +- .../smarty_internal_config_file_compiler.php | 10 ++- .../sysplugins/smarty_internal_debug.php | 4 +- .../smarty_internal_extension_handler.php | 28 +++---- .../smarty_internal_method_loadplugin.php | 4 +- .../smarty_internal_method_mustcompile.php | 2 +- .../smarty_internal_runtime_codeframe.php | 9 +- .../smarty_internal_runtime_make_nocache.php | 2 +- .../smarty_internal_runtime_writefile.php | 15 +--- .../sysplugins/smarty_internal_template.php | 5 +- .../smarty_internal_templatebase.php | 2 +- .../smarty_internal_templatecompilerbase.php | 19 +++-- .../smarty_internal_testinstall.php | 2 +- .../lib/smarty/sysplugins/smarty_resource.php | 4 +- .../sysplugins/smarty_resource_custom.php | 15 +++- .../lib/smarty/sysplugins/smarty_security.php | 34 +------- .../lib/smarty/sysplugins/smarty_variable.php | 1 + .../sysplugins/smartycompilerexception.php | 28 +++++++ dbinstall.php | 21 +++-- initialize.php | 2 +- 55 files changed, 563 insertions(+), 344 deletions(-) create mode 100644 WEB-INF/lib/smarty/functions.php create mode 100644 WEB-INF/lib/smarty/plugins/modifier.count.php create mode 100644 WEB-INF/lib/smarty/plugins/modifier.explode.php create mode 100644 WEB-INF/lib/smarty/plugins/modifier.number_format.php create mode 100644 WEB-INF/lib/smarty/plugins/modifiercompiler.nl2br.php create mode 100644 WEB-INF/lib/smarty/plugins/modifiercompiler.round.php create mode 100644 WEB-INF/lib/smarty/plugins/modifiercompiler.str_repeat.php create mode 100644 WEB-INF/lib/smarty/plugins/modifiercompiler.strlen.php delete mode 100644 WEB-INF/lib/smarty/readme diff --git a/WEB-INF/lib/smarty/Autoloader.php b/WEB-INF/lib/smarty/Autoloader.php index 1673ce2f..da7e32ab 100644 --- a/WEB-INF/lib/smarty/Autoloader.php +++ b/WEB-INF/lib/smarty/Autoloader.php @@ -5,6 +5,11 @@ * @package Smarty */ + +if (!defined('SMARTY_HELPER_FUNCTIONS_LOADED')) { + include __DIR__ . '/functions.php'; +} + /** * Smarty Autoloader * @@ -73,7 +78,7 @@ public static function registerBC($prepend = false) */ public static function register($prepend = false) { - self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR; + self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : __DIR__ . DIRECTORY_SEPARATOR; self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR : self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR; spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend); @@ -89,7 +94,7 @@ public static function autoload($class) if ($class[ 0 ] !== 'S' || strpos($class, 'Smarty') !== 0) { return; } - $_class = strtolower($class); + $_class = smarty_strtolower_ascii($class); if (isset(self::$rootClasses[ $_class ])) { $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ]; if (is_file($file)) { diff --git a/WEB-INF/lib/smarty/Smarty.class.php b/WEB-INF/lib/smarty/Smarty.class.php index 85a3d9a6..5d2e3a4b 100644 --- a/WEB-INF/lib/smarty/Smarty.class.php +++ b/WEB-INF/lib/smarty/Smarty.class.php @@ -36,7 +36,7 @@ /** * */ - define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); + define('SMARTY_DIR', __DIR__ . DIRECTORY_SEPARATOR); } /** * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins. @@ -61,23 +61,20 @@ define('SMARTY_MBSTRING', function_exists('mb_get_info')); } -// Note: Nik put this back in from smarty3 for php5.4 that we still support. -// See also comment around Smarty::$_CHARSET. -if (!defined('SMARTY_RESOURCE_CHAR_SET')) { - // UTF-8 can only be done properly when mbstring is available! - /** - * @deprecated in favor of Smarty::$_CHARSET - */ - define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'); +/** + * Load helper functions + */ +if (!defined('SMARTY_HELPER_FUNCTIONS_LOADED')) { + include __DIR__ . '/functions.php'; } -// End of inserted fragment by Nik. /** * Load Smarty_Autoloader */ if (!class_exists('Smarty_Autoloader')) { - include dirname(__FILE__) . '/bootstrap.php'; + include __DIR__ . '/bootstrap.php'; } + /** * Load always needed external class files */ @@ -110,7 +107,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '4.1.0'; + const SMARTY_VERSION = '4.3.0'; /** * define variable scopes */ @@ -172,9 +169,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * The character set to adhere to (e.g. "UTF-8") */ - // public static $_CHARSET = SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'; - // Note by Nik: the above assignment only works with php >= 5.6, rolling back to SMARTY_RESOURCE_CHAR_SET as in smarty3. - public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; + public static $_CHARSET = SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'; /** * The date format to be used internally @@ -881,7 +876,7 @@ public function getPluginsDir() $this->plugins_dir = (array)$this->plugins_dir; } foreach ($this->plugins_dir as $k => $v) { - $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, '/\\') . DIRECTORY_SEPARATOR, true); + $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v ?? '', '/\\') . DIRECTORY_SEPARATOR, true); } $this->_cache[ 'plugin_files' ] = array(); $this->_pluginsDirNormalized = true; @@ -1359,7 +1354,7 @@ public function __set($name, $value) */ private function _normalizeDir($dirName, $dir) { - $this->{$dirName} = $this->_realpath(rtrim($dir, "/\\") . DIRECTORY_SEPARATOR, true); + $this->{$dirName} = $this->_realpath(rtrim($dir ?? '', "/\\") . DIRECTORY_SEPARATOR, true); } /** @@ -1381,7 +1376,7 @@ private function _normalizeTemplateConfig($isConfig) } foreach ($dir as $k => $v) { if (!isset($processed[ $k ])) { - $dir[ $k ] = $v = $this->_realpath(rtrim($v, "/\\") . DIRECTORY_SEPARATOR, true); + $dir[ $k ] = $v = $this->_realpath(rtrim($v ?? '', "/\\") . DIRECTORY_SEPARATOR, true); $processed[ $k ] = true; } } @@ -1396,7 +1391,7 @@ private function _normalizeTemplateConfig($isConfig) * * @void */ - public function muteUndefinedOrNullWarnings() { + public function muteUndefinedOrNullWarnings(): void { $this->isMutingUndefinedOrNullWarnings = true; } @@ -1404,7 +1399,7 @@ public function muteUndefinedOrNullWarnings() { * Indicates if PHP7 compatibility mode is set. * @bool */ - public function isMutingUndefinedOrNullWarnings() { + public function isMutingUndefinedOrNullWarnings(): bool { return $this->isMutingUndefinedOrNullWarnings; } diff --git a/WEB-INF/lib/smarty/bootstrap.php b/WEB-INF/lib/smarty/bootstrap.php index 2c830468..a226ac04 100644 --- a/WEB-INF/lib/smarty/bootstrap.php +++ b/WEB-INF/lib/smarty/bootstrap.php @@ -11,6 +11,6 @@ * Load and register Smarty Autoloader */ if (!class_exists('Smarty_Autoloader')) { - include dirname(__FILE__) . '/Autoloader.php'; + include __DIR__ . '/Autoloader.php'; } Smarty_Autoloader::register(true); diff --git a/WEB-INF/lib/smarty/debug.tpl b/WEB-INF/lib/smarty/debug.tpl index edc7bef9..4f82a582 100644 --- a/WEB-INF/lib/smarty/debug.tpl +++ b/WEB-INF/lib/smarty/debug.tpl @@ -1,9 +1,9 @@ {capture name='_smarty_debug' assign=debug_output} - - + + Smarty Debug Console - @@ -112,11 +115,11 @@

included templates & config files (load time in seconds)

{foreach $template_data as $template} - {$template.name} -
   + {$template.name} +
   (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) -
+
{/foreach}
{/if} @@ -125,13 +128,22 @@ {foreach $assigned_vars as $vars} - - + + + - - {/foreach}

${$vars@key}

- {if isset($vars['nocache'])}Nocache
{/if} - {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+

${$vars@key}

+ {if isset($vars['nocache'])}Nocache
{/if} + {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+

Value

+ {$vars['value']|debug_print_var:10:80 nofilter} +
+ {if isset($vars['attributes'])} +

Attributes

+ {$vars['attributes']|debug_print_var nofilter} + {/if}

Value

{$vars['value']|debug_print_var:10:80 nofilter}
{if isset($vars['attributes'])}

Attributes

{$vars['attributes']|debug_print_var nofilter} {/if}
@@ -139,11 +151,14 @@ {foreach $config_vars as $vars} - - + + - {/foreach} diff --git a/WEB-INF/lib/smarty/functions.php b/WEB-INF/lib/smarty/functions.php new file mode 100644 index 00000000..bac00e52 --- /dev/null +++ b/WEB-INF/lib/smarty/functions.php @@ -0,0 +1,51 @@ + $_value) { switch ($_key) { case 'time': - if (!is_array($_value) && $_value !== null) { - $template->_checkPlugins( - array( - array( - 'function' => 'smarty_make_timestamp', - 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php' - ) - ) - ); - $time = smarty_make_timestamp($_value); - } + $$_key = $_value; // we'll handle conversion below break; case 'month_names': if (is_array($_value) && count($_value) === 12) { @@ -178,43 +169,59 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem } // Note: date() is faster than strftime() // Note: explode(date()) is faster than date() date() date() - if (isset($params[ 'time' ]) && is_array($params[ 'time' ])) { - if (isset($params[ 'time' ][ $prefix . 'Year' ])) { + + if (isset($time) && is_array($time)) { + if (isset($time[$prefix . 'Year'])) { // $_REQUEST[$field_array] given - foreach (array( - 'Y' => 'Year', - 'm' => 'Month', - 'd' => 'Day' - ) as $_elementKey => $_elementName) { + foreach ([ + 'Y' => 'Year', + 'm' => 'Month', + 'd' => 'Day' + ] as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); $$_variableName = - isset($params[ 'time' ][ $prefix . $_elementName ]) ? $params[ 'time' ][ $prefix . $_elementName ] : + isset($time[$prefix . $_elementName]) ? $time[$prefix . $_elementName] : date($_elementKey); } - } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Year' ])) { + } elseif (isset($time[$field_array][$prefix . 'Year'])) { // $_REQUEST given - foreach (array( - 'Y' => 'Year', - 'm' => 'Month', - 'd' => 'Day' - ) as $_elementKey => $_elementName) { + foreach ([ + 'Y' => 'Year', + 'm' => 'Month', + 'd' => 'Day' + ] as $_elementKey => $_elementName) { $_variableName = '_' . strtolower($_elementName); - $$_variableName = isset($params[ 'time' ][ $field_array ][ $prefix . $_elementName ]) ? - $params[ 'time' ][ $field_array ][ $prefix . $_elementName ] : date($_elementKey); + $$_variableName = isset($time[$field_array][$prefix . $_elementName]) ? + $time[$field_array][$prefix . $_elementName] : date($_elementKey); } } else { // no date found, use NOW - list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); + [$_year, $_month, $_day] = explode('-', date('Y-m-d')); } + } elseif (isset($time) && preg_match("/(\d*)-(\d*)-(\d*)/", $time, $matches)) { + $_year = $_month = $_day = null; + if ($matches[1] > '') $_year = (int) $matches[1]; + if ($matches[2] > '') $_month = (int) $matches[2]; + if ($matches[3] > '') $_day = (int) $matches[3]; } elseif ($time === null) { if (array_key_exists('time', $params)) { - $_year = $_month = $_day = $time = null; + $_year = $_month = $_day = null; } else { - list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); + [$_year, $_month, $_day] = explode('-', date('Y-m-d')); } } else { - list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time)); + $template->_checkPlugins( + array( + array( + 'function' => 'smarty_make_timestamp', + 'file' => SMARTY_PLUGINS_DIR . 'shared.make_timestamp.php' + ) + ) + ); + $time = smarty_make_timestamp($time); + [$_year, $_month, $_day] = explode('-', date('Y-m-d', $time)); } + // make syntax "+N" or "-N" work with $start_year and $end_year // Note preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match) is slower than trim+substr foreach (array( @@ -309,8 +316,8 @@ function smarty_function_html_select_date($params, Smarty_Internal_Template $tem for ($i = 1; $i <= 12; $i++) { $_val = sprintf('%02d', $i); $_text = isset($month_names) ? smarty_function_escape_special_chars($month_names[ $i ]) : - ($month_format === '%m' ? $_val : strftime($month_format, $_month_timestamps[ $i ])); - $_value = $month_value_format === '%m' ? $_val : strftime($month_value_format, $_month_timestamps[ $i ]); + ($month_format === '%m' ? $_val : @strftime($month_format, $_month_timestamps[ $i ])); + $_value = $month_value_format === '%m' ? $_val : @strftime($month_value_format, $_month_timestamps[ $i ]); $_html_months .= '' . $option_separator; } diff --git a/WEB-INF/lib/smarty/plugins/function.mailto.php b/WEB-INF/lib/smarty/plugins/function.mailto.php index 834d0535..671ac069 100644 --- a/WEB-INF/lib/smarty/plugins/function.mailto.php +++ b/WEB-INF/lib/smarty/plugins/function.mailto.php @@ -48,8 +48,13 @@ */ function smarty_function_mailto($params) { - static $_allowed_encoding = - array('javascript' => true, 'javascript_charcode' => true, 'hex' => true, 'none' => true); + static $_allowed_encoding = [ + 'javascript' => true, + 'javascript_charcode' => true, + 'hex' => true, + 'none' => true + ]; + $extra = ''; if (empty($params[ 'address' ])) { trigger_error("mailto: missing 'address' parameter", E_USER_WARNING); @@ -57,19 +62,19 @@ function smarty_function_mailto($params) } else { $address = $params[ 'address' ]; } + $text = $address; + // netscape and mozilla do not decode %40 (@) in BCC field (bug?) // so, don't encode it. - $search = array('%40', '%2C'); - $replace = array('@', ','); - $mail_parms = array(); + $mail_parms = []; foreach ($params as $var => $value) { switch ($var) { case 'cc': case 'bcc': case 'followupto': if (!empty($value)) { - $mail_parms[] = $var . '=' . str_replace($search, $replace, rawurlencode($value)); + $mail_parms[] = $var . '=' . str_replace(['%40', '%2C'], ['@', ','], rawurlencode($value)); } break; case 'subject': @@ -83,6 +88,7 @@ function smarty_function_mailto($params) default: } } + if ($mail_parms) { $address .= '?' . join('&', $mail_parms); } @@ -94,19 +100,21 @@ function smarty_function_mailto($params) ); return; } + + $string = '' . htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401, Smarty::$_CHARSET) . ''; + if ($encode === 'javascript') { - $string = '' . $text . ''; $js_encode = ''; for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $js_encode .= '%' . bin2hex($string[ $x ]); } return ''; } elseif ($encode === 'javascript_charcode') { - $string = '' . $text . ''; for ($x = 0, $_length = strlen($string); $x < $_length; $x++) { $ord[] = ord($string[ $x ]); } - return ''; + return ''; } elseif ($encode === 'hex') { preg_match('!^(.*)(\?.*)$!', $address, $match); if (!empty($match[ 2 ])) { @@ -129,6 +137,6 @@ function smarty_function_mailto($params) return '' . $text_encode . ''; } else { // no encoding - return '' . $text . ''; + return $string; } } diff --git a/WEB-INF/lib/smarty/plugins/function.math.php b/WEB-INF/lib/smarty/plugins/function.math.php index fd5b3d16..f9cf67fe 100644 --- a/WEB-INF/lib/smarty/plugins/function.math.php +++ b/WEB-INF/lib/smarty/plugins/function.math.php @@ -69,8 +69,8 @@ function smarty_function_math($params, $template) // Adapted from https://www.php.net/manual/en/function.eval.php#107377 $number = '(?:\d+(?:[,.]\d+)?|pi|π)'; // What is a number $functionsOrVars = '((?:0x[a-fA-F0-9]+)|([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*))'; - $operators = '[+\/*\^%-]'; // Allowed math operators - $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)+\)|\((?1)+\)))(?:'.$operators.'(?1))?)+$/'; + $operators = '[,+\/*\^%-]'; // Allowed math operators + $regexp = '/^(('.$number.'|'.$functionsOrVars.'|('.$functionsOrVars.'\s*\((?1)*\)|\((?1)*\)))(?:'.$operators.'(?1))?)+$/'; if (!preg_match($regexp, $equation)) { trigger_error("math: illegal characters", E_USER_WARNING); diff --git a/WEB-INF/lib/smarty/plugins/modifier.capitalize.php b/WEB-INF/lib/smarty/plugins/modifier.capitalize.php index c5fc400a..2903d61d 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.capitalize.php +++ b/WEB-INF/lib/smarty/plugins/modifier.capitalize.php @@ -22,6 +22,8 @@ */ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = false) { + $string = (string) $string; + if (Smarty::$_MBSTRING) { if ($lc_rest) { // uppercase (including hyphenated words) diff --git a/WEB-INF/lib/smarty/plugins/modifier.count.php b/WEB-INF/lib/smarty/plugins/modifier.count.php new file mode 100644 index 00000000..ca35fc11 --- /dev/null +++ b/WEB-INF/lib/smarty/plugins/modifier.count.php @@ -0,0 +1,36 @@ + Prior to PHP 8.0.0, if the parameter was neither an array nor an object that implements the Countable interface, + * > 1 would be returned, unless value was null, in which case 0 would be returned. + */ + + if ($arrayOrObject instanceof Countable || is_array($arrayOrObject)) { + return count($arrayOrObject, (int) $mode); + } elseif ($arrayOrObject === null) { + return 0; + } + return 1; +} diff --git a/WEB-INF/lib/smarty/plugins/modifier.date_format.php b/WEB-INF/lib/smarty/plugins/modifier.date_format.php index 8e7e0b6e..e3589fd0 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.date_format.php +++ b/WEB-INF/lib/smarty/plugins/modifier.date_format.php @@ -78,7 +78,8 @@ function smarty_modifier_date_format($string, $format = null, $default_date = '' } $format = str_replace($_win_from, $_win_to, $format); } - return strftime($format, $timestamp); + // @ to suppress deprecation errors when running in PHP8.1 or higher. + return @strftime($format, $timestamp); } else { return date($format, $timestamp); } diff --git a/WEB-INF/lib/smarty/plugins/modifier.escape.php b/WEB-INF/lib/smarty/plugins/modifier.escape.php index 47489aa9..11e44682 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.escape.php +++ b/WEB-INF/lib/smarty/plugins/modifier.escape.php @@ -23,95 +23,25 @@ */ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $double_encode = true) { - static $_double_encode = true; static $is_loaded_1 = false; static $is_loaded_2 = false; if (!$char_set) { $char_set = Smarty::$_CHARSET; } + + $string = (string)$string; + switch ($esc_type) { case 'html': - if ($_double_encode) { - // php >=5.3.2 - go native - return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode); - } else { - if ($double_encode) { - // php <5.2.3 - only handle double encoding - return htmlspecialchars($string, ENT_QUOTES, $char_set); - } else { - // php <5.2.3 - prevent double encoding - $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); - $string = htmlspecialchars($string, ENT_QUOTES, $char_set); - $string = str_replace( - array( - '%%%SMARTY_START%%%', - '%%%SMARTY_END%%%' - ), - array( - '&', - ';' - ), - $string - ); - return $string; - } - } + return htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode); // no break case 'htmlall': if (Smarty::$_MBSTRING) { - // mb_convert_encoding ignores htmlspecialchars() - if ($_double_encode) { - // php >=5.3.2 - go native - $string = htmlspecialchars($string, ENT_QUOTES, $char_set, $double_encode); - } else { - if ($double_encode) { - // php <5.2.3 - only handle double encoding - $string = htmlspecialchars($string, ENT_QUOTES, $char_set); - } else { - // php <5.2.3 - prevent double encoding - $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); - $string = htmlspecialchars($string, ENT_QUOTES, $char_set); - $string = - str_replace( - array( - '%%%SMARTY_START%%%', - '%%%SMARTY_END%%%' - ), - array( - '&', - ';' - ), - $string - ); - return $string; - } - } - // htmlentities() won't convert everything, so use mb_convert_encoding - return mb_convert_encoding($string, 'HTML-ENTITIES', $char_set); + $string = mb_convert_encoding($string, 'UTF-8', $char_set); + return htmlentities($string, ENT_QUOTES, 'UTF-8', $double_encode); } // no MBString fallback - if ($_double_encode) { - return htmlentities($string, ENT_QUOTES, $char_set, $double_encode); - } else { - if ($double_encode) { - return htmlentities($string, ENT_QUOTES, $char_set); - } else { - $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); - $string = htmlentities($string, ENT_QUOTES, $char_set); - $string = str_replace( - array( - '%%%SMARTY_START%%%', - '%%%SMARTY_END%%%' - ), - array( - '&', - ';' - ), - $string - ); - return $string; - } - } + return htmlentities($string, ENT_QUOTES, $char_set, $double_encode); // no break case 'url': return rawurlencode($string); diff --git a/WEB-INF/lib/smarty/plugins/modifier.explode.php b/WEB-INF/lib/smarty/plugins/modifier.explode.php new file mode 100644 index 00000000..5186fde3 --- /dev/null +++ b/WEB-INF/lib/smarty/plugins/modifier.explode.php @@ -0,0 +1,25 @@ +=8.1 + return explode($separator, $string ?? '', $limit ?? PHP_INT_MAX); +} diff --git a/WEB-INF/lib/smarty/plugins/modifier.number_format.php b/WEB-INF/lib/smarty/plugins/modifier.number_format.php new file mode 100644 index 00000000..8c612601 --- /dev/null +++ b/WEB-INF/lib/smarty/plugins/modifier.number_format.php @@ -0,0 +1,26 @@ +=8.1 + return number_format($num ?? 0.0, $decimals, $decimal_separator, $thousands_separator); +} diff --git a/WEB-INF/lib/smarty/plugins/modifier.truncate.php b/WEB-INF/lib/smarty/plugins/modifier.truncate.php index 33e7e53a..80dcdb53 100644 --- a/WEB-INF/lib/smarty/plugins/modifier.truncate.php +++ b/WEB-INF/lib/smarty/plugins/modifier.truncate.php @@ -42,8 +42,8 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if (!$middle) { return mb_substr($string, 0, $length, Smarty::$_CHARSET) . $etc; } - return mb_substr($string, 0, $length / 2, Smarty::$_CHARSET) . $etc . - mb_substr($string, -$length / 2, $length, Smarty::$_CHARSET); + return mb_substr($string, 0, intval($length / 2), Smarty::$_CHARSET) . $etc . + mb_substr($string, -intval($length / 2), $length, Smarty::$_CHARSET); } return $string; } @@ -56,7 +56,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', $break_wo if (!$middle) { return substr($string, 0, $length) . $etc; } - return substr($string, 0, $length / 2) . $etc . substr($string, -$length / 2); + return substr($string, 0, intval($length / 2)) . $etc . substr($string, -intval($length / 2)); } return $string; } diff --git a/WEB-INF/lib/smarty/plugins/modifiercompiler.escape.php b/WEB-INF/lib/smarty/plugins/modifiercompiler.escape.php index 70b95cc9..602c3dbf 100644 --- a/WEB-INF/lib/smarty/plugins/modifiercompiler.escape.php +++ b/WEB-INF/lib/smarty/plugins/modifiercompiler.escape.php @@ -18,12 +18,10 @@ * @param Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code - * @throws \SmartyException + * @throws SmartyException */ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompilerBase $compiler) { - static $_double_encode = true; - static $is_loaded = false; $compiler->template->_checkPlugins( array( array( @@ -41,53 +39,30 @@ function smarty_modifiercompiler_escape($params, Smarty_Internal_TemplateCompile } switch ($esc_type) { case 'html': - if ($_double_encode) { - return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . - var_export($double_encode, true) . ')'; - } elseif ($double_encode) { - return 'htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')'; - } else { - // fall back to modifier.escape.php - } + return 'htmlspecialchars((string)' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . + var_export($double_encode, true) . ')'; // no break case 'htmlall': if (Smarty::$_MBSTRING) { - if ($_double_encode) { - // php >=5.2.3 - go native - return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . - var_export($char_set, true) . ', ' . var_export($double_encode, true) . - '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; - } elseif ($double_encode) { - // php <5.2.3 - only handle double encoding - return 'mb_convert_encoding(htmlspecialchars(' . $params[ 0 ] . ', ENT_QUOTES, ' . - var_export($char_set, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; - } else { - // fall back to modifier.escape.php - } + return 'htmlentities(mb_convert_encoding((string)' . $params[ 0 ] . ', \'UTF-8\', ' . + var_export($char_set, true) . '), ENT_QUOTES, \'UTF-8\', ' . + var_export($double_encode, true) . ')'; } // no MBString fallback - if ($_double_encode) { - // php >=5.2.3 - go native - return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . - var_export($double_encode, true) . ')'; - } elseif ($double_encode) { - // php <5.2.3 - only handle double encoding - return 'htmlentities(' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ')'; - } else { - // fall back to modifier.escape.php - } + return 'htmlentities((string)' . $params[ 0 ] . ', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . + var_export($double_encode, true) . ')'; // no break case 'url': - return 'rawurlencode(' . $params[ 0 ] . ')'; + return 'rawurlencode((string)' . $params[ 0 ] . ')'; case 'urlpathinfo': - return 'str_replace("%2F", "/", rawurlencode(' . $params[ 0 ] . '))'; + return 'str_replace("%2F", "/", rawurlencode((string)' . $params[ 0 ] . '))'; case 'quotes': // escape unescaped single quotes - return 'preg_replace("%(? "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", " "<\/", "

#{$vars@key}#

- {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+

#{$vars@key}#

+ {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if} +
+ {$vars['value']|debug_print_var:10:80 nofilter} {$vars['value']|debug_print_var:10:80 nofilter}