var $mSender;
var $mReceiver;
var $mReceiverCC;
+ var $mReceiverBCC;
function __construct($type='mail') {
$this->mMailMode = $type;
$this->mReceiverCC = $value;
}
+ function setReceiverBCC($value) {
+ $this->mReceiverBCC = $value;
+ }
+
function setSender($value) {
$this->mSender = $value;
}
$headers = array('From' => $this->mSender, 'To' => $this->mReceiver);
if (isset($this->mReceiverCC)) $headers = array_merge($headers, array('CC' => $this->mReceiverCC));
+ if (isset($this->mReceiverBCC)) $headers = array_merge($headers, array('BCC' => $this->mReceiverBCC));
$headers = array_merge($headers, array(
'Subject' => $subject,
'MIME-Version' => '1.0',
break;
case 'smtp':
- // Mail_smtp does not do CC -> recipients conversion
+ // Mail_smtp does not do CC or BCC -> recipients conversion.
if (!empty($this->mReceiverCC)) {
// make exactly one space after a comma
$recipients .= ', ' . preg_replace('/,[[:space:]]+/', ', ', $this->mReceiverCC);
}
+ if (!empty($this->mReceiverBCC)) {
+ // make exactly one space after a comma
+ $recipients .= ', ' . preg_replace('/,[[:space:]]+/', ', ', $this->mReceiverBCC);
+ }
$host = defined('MAIL_SMTP_HOST') ? MAIL_SMTP_HOST : 'localhost';
$port = defined('MAIL_SMTP_PORT') ? MAIL_SMTP_PORT : '25';
// sendFavReport - sends a favorite report to a specified email, called from cron.php
static function sendFavReport($report, $email) {
// We are called from cron.php, we have no $bean in session.
- // cron.php set global $user and $i18n objects to match our favorite report user.
+ // cron.php sets global $user and $i18n objects to match our favorite report user.
global $user;
global $i18n;
$mailer->setCharSet(CHARSET);
$mailer->setContentType('text/html');
$mailer->setSender(SENDER);
+ if (!empty($user->bcc_email))
+ $mailer->setReceiverBCC($user->bcc_email);
$mailer->setReceiver($email);
$mailer->setMailMode(MAIL_MODE);
if (!$mailer->send($report['name'], $body))
$task_required_part = ' , task_required = '.intval($fields['task_required']);
$record_type_part = '';
$uncompleted_indicators_part = '';
+ $bcc_email_part = '';
$plugins_part = '';
$lock_spec_part = '';
$workday_hours_part = '';
if (isset($fields['tracking_mode'])) $tracking_mode_part = ', tracking_mode = '.intval($fields['tracking_mode']);
if (isset($fields['record_type'])) $record_type_part = ', record_type = '.intval($fields['record_type']);
if (isset($fields['uncompleted_indicators'])) $uncompleted_indicators_part = ', uncompleted_indicators = '.intval($fields['uncompleted_indicators']);
+ if (!empty($fields['bcc_email'])) $bcc_email_part = ', bcc_email = '.$mdb2->quote($fields['bcc_email']);
if (isset($fields['plugins'])) $plugins_part = ', plugins = '.$mdb2->quote($fields['plugins']);
if (isset($fields['lock_spec'])) $lock_spec_part = ', lock_spec = '.$mdb2->quote($fields['lock_spec']);
if (isset($fields['workday_hours'])) $workday_hours_part = ', workday_hours = '.$mdb2->quote($fields['workday_hours']);
$sql = "update tt_teams set $name_part $addr_part $currency_part $lang_part $decimal_mark_part
$date_format_part $time_format_part $week_start_part $tracking_mode_part $task_required_part $record_type_part
- $uncompleted_indicators_part $plugins_part $lock_spec_part $workday_hours_part where id = $team_id";
+ $uncompleted_indicators_part $bcc_email_part $plugins_part $lock_spec_part $workday_hours_part where id = $team_id";
$affected = $mdb2->exec($sql);
if (is_a($affected, 'PEAR_Error')) return false;
var $task_required = 0; // Whether task selection is required on time entires.
var $record_type = 0; // Record type (duration vs start and finish, or both).
var $uncompleted_indicators = 0; // Uncompleted time entry indicators (show nowhere or on users page).
+ var $bcc_email = null; // Bcc email.
var $currency = null; // Currency.
var $plugins = null; // Comma-separated list of enabled plugins.
var $team = null; // Team name.
$sql = "SELECT u.id, u.login, u.name, u.team_id, u.role, u.client_id, u.email, t.name as team_name,
t.address, t.currency, t.lang, t.decimal_mark, t.date_format, t.time_format, t.week_start,
t.tracking_mode, t.project_required, t.task_required, t.record_type, t.uncompleted_indicators,
- t.plugins, t.lock_spec, t.workday_hours, t.custom_logo
+ t.bcc_email, t.plugins, t.lock_spec, t.workday_hours, t.custom_logo
FROM tt_users u LEFT JOIN tt_teams t ON (u.team_id = t.id) WHERE ";
if ($id)
$sql .= "u.id = $id";
$this->task_required = $val['task_required'];
$this->record_type = $val['record_type'];
$this->uncompleted_indicators = $val['uncompleted_indicators'];
+ $this->bcc_email = $val['bcc_email'];
$this->team = $val['team_name'];
$this->address = $val['address'];
$this->currency = $val['currency'];
'label.password' => 'Paraula de pas',
'label.confirm_password' => 'Confirmar paraula de pas',
'label.email' => 'E-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Data',
// TODO: translate the following.
// 'label.start_date' => 'Start date',
'label.password' => 'heslo',
'label.confirm_password' => 'potvrdit heslo',
// 'label.email' => 'email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'celkem',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => 'Adgangskode',
'label.confirm_password' => 'Gentag adgangskode',
'label.email' => 'E-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Dato',
'label.start_date' => 'Start dato',
'label.end_date' => 'Slut dato',
'label.password' => 'Passwort',
'label.confirm_password' => 'Passwort bestätigen',
'label.email' => 'E-Mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Datum',
'label.start_date' => 'Anfangsdatum',
'label.end_date' => 'Enddatum',
'label.password' => 'Password',
'label.confirm_password' => 'Confirm password',
'label.email' => 'Email',
+'label.bcc' => 'Bcc',
'label.date' => 'Date',
'label.start_date' => 'Start date',
'label.end_date' => 'End date',
'label.password' => 'Contraseña',
'label.confirm_password' => 'Confirmar Contraseña',
'label.email' => 'Email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Fecha',
'label.start_date' => 'Fecha de inicio',
'label.end_date' => 'Fecha de fin',
'label.confirm_password' => 'Kinnita salasõna',
// TODO: translate the following.
// 'label.email' => 'Email',
+// 'label.bcc' => 'Bcc',
// 'label.date' => 'Date',
// 'label.start_date' => 'Start date',
// 'label.end_date' => 'End date',
'label.password' => 'رمز عبور',
'label.confirm_password' => 'تکرار رمزعبور',
'label.email' => 'ایمیل',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'تاریخ',
'label.start_date' => 'تاریخ شروع',
'label.end_date' => 'تاریخ اتمام',
'label.password' => 'Salasana',
'label.confirm_password' => 'Vahvista salasana',
'label.email' => 'Sähköposti',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Päiväys',
'label.start_date' => 'Aloituspäivä',
'label.end_date' => 'Päättymispäivä',
'label.password' => 'Mot de passe',
'label.confirm_password' => 'Confirmez le mot de passe',
'label.email' => 'Email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Date',
'label.start_date' => 'Date de début',
'label.end_date' => 'Date de fin',
'label.password' => 'סיסמה',
'label.confirm_password' => 'בדיקת סיסמה',
'label.email' => 'דואר אלקטרוני',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'תאריך',
'label.start_date' => 'תאריך התחלה',
'label.end_date' => 'תאריך סיום',
'label.password' => 'jelszó',
'label.confirm_password' => 'jelszó megerősítése',
// 'label.email' => 'email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'összesen',
// Translate the following.
// 'label.page' => 'Page',
'label.password' => 'password',
'label.confirm_password' => 'conferma password',
'label.email' => 'e-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'totale',
// Translate the following.
// 'label.page' => 'Page',
'label.password' => 'パスワード',
'label.confirm_password' => 'パスワードの確認',
'label.email' => 'Eメール',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => '合計',
// Translate the following.
// 'label.page' => 'Page',
'label.password' => '암호',
'label.confirm_password' => '암호 확인',
'label.email' => '이메일',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => '합계',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => 'Wachtwoord',
'label.confirm_password' => 'Bevestig wachtwoord',
'label.email' => 'E-mailadres',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Datum',
'label.start_date' => 'Begindatum',
'label.end_date' => 'Einddatum',
'label.password' => 'Passord',
'label.confirm_password' => 'Bekreft passord',
// 'label.email' => 'email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'totalt',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => 'Hasło',
'label.confirm_password' => 'Potwierdź hasło',
'label.email' => 'E-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Data',
'label.start_date' => 'Data początkowa',
'label.end_date' => 'Data końcowa',
'label.password' => 'Senha',
'label.confirm_password' => 'Confirme a senha',
'label.email' => 'E-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Data',
'label.start_date' => 'Data inicial',
'label.end_date' => 'Data final',
// 'label.manager_login' => 'manager login',
'label.password' => 'senha',
'label.confirm_password' => 'confirme a senha',
-// 'label.email' => 'email',
// TODO: translate the following.
+// 'label.email' => 'email',
+// 'label.bcc' => 'Bcc',
// 'label.page' => 'Page',
// 'label.condition' => 'Condition',
// 'label.manager_login' => 'manager login',
'label.password' => 'parola',
'label.confirm_password' => 'confirma parola',
+// TODO: translate the following.
// 'label.email' => 'email',
+// 'label.bcc' => 'Bcc',
'label.total' => 'total',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => 'Пароль',
'label.confirm_password' => 'Подтверждение пароля',
'label.email' => 'Адрес e-mail',
+'label.bcc' => 'Скрытая копия',
'label.date' => 'Дата',
'label.start_date' => 'Начальная дата',
'label.end_date' => 'Конечная дата',
'label.password' => 'Heslo',
'label.confirm_password' => 'Potvrdenie hesla',
'label.email' => 'E-mail',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Dátum',
'label.start_date' => 'Dátum začiatku',
'label.end_date' => 'Dátum konca',
'label.password' => 'geslo',
// 'label.confirm_password' => 'confirm password',
'label.email' => 'email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'total',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => 'Lozinka',
'label.confirm_password' => 'Potvrdi lozinku',
'label.email' => 'Email',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Datum',
'label.start_date' => 'Početni datum',
'label.end_date' => 'Krajnji datum',
'label.password' => 'Lösenord',
'label.confirm_password' => 'Bekräfta lösenord',
'label.email' => 'E-postadress',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.date' => 'Datum',
'label.start_date' => 'Startdatum',
'label.end_date' => 'Slutdatum',
'label.password' => 'parola',
'label.confirm_password' => 'parolayı tekrala',
'label.email' => 'e-posta',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => 'toplam',
// TODO: translate the following.
// 'label.page' => 'Page',
'label.password' => '密码',
'label.confirm_password' => '确认密码',
'label.email' => '电子邮件',
-// Translate the following.
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
// 'label.date' => 'Date',
// 'label.start_date' => 'Start date',
// 'label.end_date' => 'End date',
'label.password' => '密碼',
'label.confirm_password' => '確認密碼',
'label.email' => '電子郵件',
+// TODO: translate the following.
+// 'label.bcc' => 'Bcc',
'label.total' => '總計',
// TODO: translate the following.
// 'label.page' => 'Page',
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.11.48.3664 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.12.0.3665 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
<td align="right" nowrap>{$i18n.form.profile.uncompleted_indicators}:</td>
<td>{$forms.profileForm.uncompleted_indicators.control}</td>
</tr>
-
+{if $user->isManager()}
+ <tr>
+ <td align="right" nowrap>{$i18n.label.bcc}:</td>
+ <td>{$forms.profileForm.bcc_email.control} <a href="https://www.anuko.com/lp/tt_10.htm" target="_blank">{$i18n.label.what_is_it}</a></td>
+ </tr>
+{/if}
{* initialize preview text *}
<script>
MakeFormatPreview("date_format_preview", document.getElementById("format_date"));
setChange("ALTER TABLE `tt_teams` ADD `project_required` smallint(2) NOT NULL DEFAULT '0' AFTER `tracking_mode`");
setChange("ALTER TABLE `tt_cron` ADD `report_condition` varchar(255) default NULL AFTER `email`");
setChange("ALTER TABLE `tt_fav_reports` ADD `status` tinyint(4) default '1'");
+ setChange("ALTER TABLE `tt_teams` ADD `bcc_email` varchar(100) default NULL AFTER `uncompleted_indicators`");
}
// The update_clients function updates projects field in tt_clients table.
$mailer->setReceiver($cl_receiver);
if (isset($cl_cc))
$mailer->setReceiverCC($cl_cc);
+ if (!empty($user->bcc_email))
+ $mailer->setReceiverBCC($user->bcc_email);
$mailer->setMailMode(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
$msg->add($i18n->getKey('form.mail.invoice_sent'));
`task_required` smallint(2) NOT NULL DEFAULT '0', # whether a task selection is required or optional
`record_type` smallint(2) NOT NULL DEFAULT '0', # time record type ("start and finish", "duration", or both)
`uncompleted_indicators` smallint(2) NOT NULL DEFAULT '0', # whether to show indicators for users with uncompleted time entries
+ `bcc_email` varchar(100) default NULL, # bcc email to copy all reports to
`plugins` varchar(255) default NULL, # a list of enabled plugins for team
`lock_spec` varchar(255) default NULL, # Cron specification for record locking,
# for example: "0 10 * * 1" for "weekly on Mon at 10:00".
$cl_expenses = $request->getParameter('expenses');
$cl_tax_expenses = $request->getParameter('tax_expenses');
$cl_notifications = $request->getParameter('notifications');
+ $cl_bcc_email = trim($request->getParameter('bcc_email'));
$cl_locking = $request->getParameter('locking');
$cl_quotas = $request->getParameter('quotas');
}
$cl_task_required = $user->task_required;
$cl_record_type = $user->record_type;
$cl_uncompleted_indicators = $user->uncompleted_indicators;
+ $cl_bcc_email = $user->bcc_email;
// Which plugins do we have enabled?
$plugins = explode(',', $user->plugins);
$uncompleted_indicators_options[UNCOMPLETED_INDICATORS] = $i18n->getKey('form.profile.uncompleted_indicators_show');
$form->addInput(array('type'=>'combobox','name'=>'uncompleted_indicators','style'=>'width: 150px;','data'=>$uncompleted_indicators_options,'value'=>$cl_uncompleted_indicators));
+ // Add bcc email control, for manager only.
+ if ($user->isManager()) {
+ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'bcc_email','value'=>$cl_bcc_email));
+ }
+
$form->addInput(array('type'=>'checkbox','name'=>'charts','value'=>$cl_charts));
$form->addInput(array('type'=>'checkbox','name'=>'clients','value'=>$cl_clients,'onchange'=>'handlePluginCheckboxes()'));
$form->addInput(array('type'=>'checkbox','name'=>'client_required','value'=>$cl_client_required));
if (!ttValidString($cl_team, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
if (!ttValidString($cl_address, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.address'));
if (!ttValidString($cl_currency, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.currency'));
+ if ($user->isManager()) {
+ if (!ttValidEmail($cl_bcc_email, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.bcc'));
+ }
}
// Finished validating user input.
'task_required' => $cl_task_required,
'record_type' => $cl_record_type,
'uncompleted_indicators' => $cl_uncompleted_indicators,
+ 'bcc_email' => $cl_bcc_email,
'plugins' => $plugins));
}
if ($update_result) {
$mailer->setReceiver($cl_receiver);
if (isset($cl_cc))
$mailer->setReceiverCC($cl_cc);
+ if (!empty($user->bcc_email))
+ $mailer->setReceiverBCC($user->bcc_email);
$mailer->setMailMode(MAIL_MODE);
if ($mailer->send($cl_subject, $body))
$msg->add($i18n->getKey('form.mail.report_sent'));