*/
function initAttributes(&$request) {
//$submit_flag = $this->isSubmit();
- $submit_flag = (is_object($request) && ($request->getMethod() == 'POST'));
+ $submit_flag = (is_object($request) && ($request->isPost()));
if ($submit_flag) {
// fill ActionForm and Form from Request
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.9.16.3434 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.9.16.3435 | 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>
exit();
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_password1 = $request->getParameter('password1');
$cl_password2 = $request->getParameter('password2');
}
$form->addInput(array('type'=>'text','aspassword'=>true,'maxlength'=>'30','name'=>'password2','style'=>"width: 150px;",'value'=>$cl_password2));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($cl_password1 || $cl_password2) {
// Validate user input.
if (!ttValidString($cl_password1)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if (ttTeamHelper::markDeleted($team_id)) {
header('Location: admin_teams.php');
$team_id = $request->getParameter('id');
$team_details = ttTeamHelper::getTeamDetails($team_id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_team_name = trim($request->getParameter('team_name'));
$cl_manager_name = trim($request->getParameter('manager_name'));
$cl_manager_login = trim($request->getParameter('manager_login'));
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_save')) {
// Validate user input.
if (!ttValidString($cl_team_name, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
exit();
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_field_name = trim($request->getParameter('name'));
$cl_field_type = $request->getParameter('type');
$cl_required = $request->getParameter('required');
$form->addInput(array('type'=>'checkbox','name'=>'required','data'=>1,'value'=>'0'));
$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_field_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
$form = new Form('fieldDeleteForm');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
// Delete button pressed.
$res = CustomFields::deleteField($id);
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_type = $request->getParameter('type');
$cl_required = $request->getParameter('required');
$form = new Form('customFieldsForm');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_add')) {
// The Add button clicked. Redirect to cf_custom_field_add.php page.
header('Location: cf_custom_field_add.php');
$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_option_name = trim($request->getParameter('name'));
// Validate user input.
$cl_id = $request->getParameter('id');
$form = new Form('optionDeleteForm');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Determine field id for redirect.
$field_id = CustomFields::getFieldIdForOption($cl_id);
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
// Validate user input.
$projects = ttTeamHelper::getActiveProjects($user->team_id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_address = trim($request->getParameter('address'));
$cl_tax = $request->getParameter('tax');
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','data'=>$projects,'layout'=>'H','datakeys'=>array('id','name'),'value'=>$cl_projects));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_name'));
if (!ttValidString($cl_address, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if(ttClientHelper::getClient($id)) {
if ($request->getParameter('btn_delete')) {
if (ttClientHelper::delete($id, $request->getParameter('delete_client_entries'))) {
$projects = ttTeamHelper::getActiveProjects($user->team_id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_address = trim($request->getParameter('address'));
$cl_tax = trim($request->getParameter('tax'));
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_name'));
if (!ttValidString($cl_address, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.client_address'));
// Prohibit deleting invoiced records.
if ($expense_item['invoice_id']) die($i18n->getKey('error.sys'));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
// Initialize variables.
$cl_date = $cl_client = $cl_project = $cl_item_name = $cl_cost = null;
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_date = trim($request->getParameter('date'));
$cl_client = $request->getParameter('client');
$cl_project = $request->getParameter('project');
$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy')));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
$errors->add($i18n->getKey('error.client'));
}
// Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
$form->addInput(array('type'=>'combobox','name'=>'compression','value'=>$cl_compression,'data'=>$compressors));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.export')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$filename = 'team_data.xml';
$mime_type = 'text/xml';
// Note: for the above limit to work make sure to set upload_max_filesize and post_max_size in php.ini to at least 16M.
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.import')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$import = new ttImportHelper($errors);
$import->importXml();
exit();
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_date = $request->getParameter('date');
$cl_client = $request->getParameter('client');
$cl_project = $request->getParameter('project');
$form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'finish','value'=>$cl_finish));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_number)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.invoice.number'));
if (!ttValidDate($cl_date)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.date'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if (ttInvoiceHelper::getInvoice($cl_invoice_id)) {
if (ttInvoiceHelper::delete($cl_invoice_id, $request->getParameter('delete_invoice_entries'))) {
if (!$cl_invoice_id || !$invoice)
die ($i18n->getKey('error.sys'));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_receiver = trim($request->getParameter('receiver'));
$cl_cc = trim($request->getParameter('cc'));
$cl_subject = trim($request->getParameter('subject'));
$form->addInput(array('type'=>'textarea','name'=>'comment','maxlength'=>'250','style'=>'width: 300px; height: 60px;'));
$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->getKey('button.send')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidEmailList($cl_receiver)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.to'));
if (!ttValidEmailList($cl_cc, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.cc'));
$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->getKey('button.login')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
if (!ttValidString($cl_password)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
import('ttTeamHelper');
import('ttUser');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_login = $request->getParameter('login');
} else {
$cl_login = @$_COOKIE['tt_login'];
$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->getKey('button.login')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
if (!ttValidString($cl_password)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
if (in_array('iv', explode(',', $user->plugins))) {
- if ($request->getMethod() == 'POST') {
+ if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
} else
}
// Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
// Initialize variables.
$cl_start = $cl_finish = $cl_duration = $cl_date = $cl_note = $cl_project = $cl_task = $cl_billable = null;
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_start = trim($request->getParameter('start'));
$cl_finish = trim($request->getParameter('finish'));
$cl_duration = trim($request->getParameter('duration'));
$form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.save')));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
if (in_array('iv', explode(',', $user->plugins))) {
- if ($request->getMethod() == 'POST') {
+ if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
} else
}
// Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_start')) {
// Start button clicked. We need to create a new uncompleted record with only the start time.
$cl_finish = null;
$fav_reports = ttFavReportHelper::getReports($user->id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_fav_report = trim($request->getParameter('fav_report'));
$cl_cron_spec = trim($request->getParameter('cron_spec'));
$cl_email = trim($request->getParameter('email'));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'=>'width: 250px;','value'=>$cl_email));
$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!$cl_fav_report) $errors->add($i18n->getKey('error.report'));
if (!ttValidCronSpec($cl_cron_spec)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.cron_schedule'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if(ttNotificationHelper::get($cl_notification_id)) {
if (ttNotificationHelper::delete($cl_notification_id)) {
$notification_id = (int) $request->getParameter('id');
$fav_reports = ttFavReportHelper::getReports($user->id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_fav_report = trim($request->getParameter('fav_report'));
$cl_cron_spec = trim($request->getParameter('cron_spec'));
$cl_email = trim($request->getParameter('email'));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'email','style'=>'width: 250px;','value'=>$cl_email));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!$cl_fav_report) $errors->add($i18n->getKey('error.report'));
if (!ttValidCronSpec($cl_cron_spec)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.cron_schedule'));
$form = new Form('notificationsForm');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_add')) {
// The Add button clicked. Redirect to notification_add.php page.
header('Location: notification_add.php');
$form->addInput(array('type'=>'hidden','name'=>'ref','value'=>$cl_ref));
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_password1)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.password'));
if (!ttValidString($cl_password2)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.confirm_password'));
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'login','style'=>'width: 300px;'));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.reset_password')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_login = $request->getParameter('login');
// Validate user input.
if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$');
$can_change_login = $user->canManageTeam();
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_login = trim($request->getParameter('login'));
if (!$auth->isPasswordExternal()) {
}
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
if ($can_change_login) {
foreach ($tasks as $task_item)
$all_tasks[$task_item['id']] = $task_item['name'];
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('project_name'));
$cl_description = trim($request->getParameter('description'));
$cl_users = $request->getParameter('users', array());
$form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks));
$form->addInput(array('type'=>'submit','name'=>'btn_add','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
if (!ttValidString($cl_description, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if(ttProjectHelper::get($cl_project_id)) {
if (ttProjectHelper::delete($cl_project_id)) {
foreach ($tasks as $task_item)
$all_tasks[$task_item['id']] = $task_item['name'];
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('project_name'));
$cl_description = trim($request->getParameter('description'));
$cl_status = $request->getParameter('status');
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
if (!ttValidString($cl_description, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_team_name = trim($request->getParameter('team_name'));
$cl_currency = trim($request->getParameter('currency'));
if (!$cl_currency) $cl_currency = CURRENCY_DEFAULT;
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_team_name, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
if (!ttValidString($cl_currency, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.currency'));
}
}
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
foreach($_POST as $key => $val) {
if ('log_id_' == substr($key, 0, 7))
$time_log_ids[] = substr($key, 7);
$sc = new ttSysConfig($user->id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_receiver = trim($request->getParameter('receiver'));
$cl_cc = trim($request->getParameter('cc'));
$cl_subject = trim($request->getParameter('subject'));
$form->addInput(array('type'=>'textarea','name'=>'comment','maxlength'=>'250','style'=>'width: 300px; height: 60px;'));
$form->addInput(array('type'=>'submit','name'=>'btn_send','value'=>$i18n->getKey('button.send')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidEmailList($cl_receiver)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.to'));
if (!ttValidEmailList($cl_cc, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('form.mail.cc'));
if (!$bean->getAttribute('favorite_report') || ($bean->getAttribute('favorite_report') == -1))
$form->getElement('btn_delete')->setEnable(false);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if((!$bean->getAttribute('btn_generate') && ($request->getParameter('fav_report_changed')))) {
// User changed favorite report. We need to load new values into the form.
if ($bean->getAttribute('favorite_report')) {
$projects = ttTeamHelper::getActiveProjects($user->team_id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_description = trim($request->getParameter('description'));
$cl_projects = $request->getParameter('projects');
$form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H','data'=>$projects,'datakeys'=>array('id','name'),'value'=>$cl_projects));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.add')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
if (!ttValidString($cl_description, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if(ttTaskHelper::getTask($cl_task_id)) {
if (ttTaskHelper::delete($cl_task_id)) {
$cl_task_id = (int)$request->getParameter('id');
$projects = ttTeamHelper::getActiveProjects($user->team_id);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_description = trim($request->getParameter('description'));
$cl_status = $request->getParameter('status');
$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save')));
$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
if (!ttValidString($cl_description, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
$_SESSION['cf_1'] = $cl_cf_1;
$cl_billable = 1;
if (in_array('iv', explode(',', $user->plugins))) {
- if ($request->getMethod() == 'POST') {
+ if ($request->isPost()) {
$cl_billable = $request->getParameter('billable');
$_SESSION['billable'] = (int) $cl_billable;
} else
}
// Submit.
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_submit')) {
// Validate user input.
// Escape comment for presentation.
$time_rec['comment'] = htmlspecialchars($time_rec['comment']);
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('delete_button')) { // Delete button pressed.
// Determine if it's okay to delete the record.
// Initialize variables.
$cl_start = $cl_finish = $cl_duration = $cl_date = $cl_note = $cl_project = $cl_task = $cl_billable = null;
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_start = trim($request->getParameter('start'));
$cl_finish = trim($request->getParameter('finish'));
$cl_duration = trim($request->getParameter('duration'));
$form->addInput(array('type'=>'submit','name'=>'btn_copy','onclick'=>'browser_today.value=get_date()','value'=>$i18n->getKey('button.copy')));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (in_array('cl', explode(',', $user->plugins)) && in_array('cm', explode(',', $user->plugins)) && !$cl_client)
$clients = ttTeamHelper::getActiveClients($user->team_id);
$assigned_projects = array();
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_login = trim($request->getParameter('login'));
if (!$auth->isPasswordExternal()) {
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));
$form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if (ttUserHelper::markDeleted($user_id)) {
// If we deleted the "on behalf" user reset its info in session.
$projects = ttTeamHelper::getActiveProjects($user->team_id);
$assigned_projects = array();
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_name = trim($request->getParameter('name'));
$cl_login = trim($request->getParameter('login'));
if (!$auth->isPasswordExternal()) {
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.save')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.person_name'));
if (!ttValidString($cl_login)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.login'));