From: Nik Okuntseff Date: Tue, 22 Mar 2016 17:39:47 +0000 (-0700) Subject: Siwtched to using isPost() function X-Git-Tag: timetracker_1.19-1~1793 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a7ba11adfecf6cb906749efe5abce688363aef07;p=timetracker.git Siwtched to using isPost() function --- diff --git a/WEB-INF/lib/form/ActionForm.class.php b/WEB-INF/lib/form/ActionForm.class.php index 2029c203..03994dd5 100644 --- a/WEB-INF/lib/form/ActionForm.class.php +++ b/WEB-INF/lib/form/ActionForm.class.php @@ -74,7 +74,7 @@ class ActionForm { */ 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 diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 5d0b9ca4..4a57c7ad 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.16.3434 | Copyright © Anuko | +  Anuko Time Tracker 1.9.16.3435 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/admin_options.php b/admin_options.php index ac718377..b06af62d 100644 --- a/admin_options.php +++ b/admin_options.php @@ -36,7 +36,7 @@ if (!ttAccessCheck(right_administer_site)) { exit(); } -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_password1 = $request->getParameter('password1'); $cl_password2 = $request->getParameter('password2'); } @@ -46,7 +46,7 @@ $form->addInput(array('type'=>'text','aspassword'=>true,'maxlength'=>'30','name' $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')); diff --git a/admin_team_delete.php b/admin_team_delete.php index 2b308e54..5cb2e854 100644 --- a/admin_team_delete.php +++ b/admin_team_delete.php @@ -45,7 +45,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$team_id)); $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'); diff --git a/admin_team_edit.php b/admin_team_edit.php index d443928b..1ac618ea 100644 --- a/admin_team_edit.php +++ b/admin_team_edit.php @@ -40,7 +40,7 @@ if (!ttAccessCheck(right_administer_site)) { $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')); @@ -72,7 +72,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$team_id)); $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')); diff --git a/cf_custom_field_add.php b/cf_custom_field_add.php index a5053054..d6766ef2 100644 --- a/cf_custom_field_add.php +++ b/cf_custom_field_add.php @@ -36,7 +36,7 @@ if (!ttAccessCheck(right_manage_team)) { 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'); @@ -53,7 +53,7 @@ $form->addInput(array('type'=>'combobox','name'=>'type', $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')); diff --git a/cf_custom_field_delete.php b/cf_custom_field_delete.php index 139253d4..162ddeb1 100644 --- a/cf_custom_field_delete.php +++ b/cf_custom_field_delete.php @@ -40,7 +40,7 @@ $id = $request->getParameter('id'); $form = new Form('fieldDeleteForm'); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { if ($request->getParameter('btn_delete')) { // Delete button pressed. $res = CustomFields::deleteField($id); diff --git a/cf_custom_field_edit.php b/cf_custom_field_edit.php index b6a1f461..0488f64a 100644 --- a/cf_custom_field_edit.php +++ b/cf_custom_field_edit.php @@ -52,7 +52,7 @@ if ($errors->no()) { $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'); diff --git a/cf_custom_fields.php b/cf_custom_fields.php index 17a04af5..33c8b5e7 100644 --- a/cf_custom_fields.php +++ b/cf_custom_fields.php @@ -38,7 +38,7 @@ if (!ttAccessCheck(right_manage_team)) { $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'); diff --git a/cf_dropdown_option_add.php b/cf_dropdown_option_add.php index c1fa7e00..7feae8a4 100644 --- a/cf_dropdown_option_add.php +++ b/cf_dropdown_option_add.php @@ -48,7 +48,7 @@ if ($errors->no()) { $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. diff --git a/cf_dropdown_option_delete.php b/cf_dropdown_option_delete.php index a1f4b139..270d56f5 100644 --- a/cf_dropdown_option_delete.php +++ b/cf_dropdown_option_delete.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_manage_team)) { $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); diff --git a/cf_dropdown_option_edit.php b/cf_dropdown_option_edit.php index 4c5fc4a7..0f47e184 100644 --- a/cf_dropdown_option_edit.php +++ b/cf_dropdown_option_edit.php @@ -48,7 +48,7 @@ if ($errors->no()) { $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. diff --git a/client_add.php b/client_add.php index b2cdbe76..1bdb1609 100644 --- a/client_add.php +++ b/client_add.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_manage_team)) { $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'); @@ -58,7 +58,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t $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')); diff --git a/client_delete.php b/client_delete.php index cdc20b6f..e566455a 100644 --- a/client_delete.php +++ b/client_delete.php @@ -48,7 +48,7 @@ $form->addInput(array('type'=>'combobox','name'=>'delete_client_entries', $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'))) { diff --git a/client_edit.php b/client_edit.php index d594222a..a106cf94 100644 --- a/client_edit.php +++ b/client_edit.php @@ -41,7 +41,7 @@ $cl_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_address = trim($request->getParameter('address')); $cl_tax = trim($request->getParameter('tax')); @@ -71,7 +71,7 @@ if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->t $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')); diff --git a/expense_delete.php b/expense_delete.php index c4953a06..dd3f9125 100644 --- a/expense_delete.php +++ b/expense_delete.php @@ -43,7 +43,7 @@ $expense_item = ttExpenseHelper::getItem($cl_id, $user->getActiveUser()); // 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. diff --git a/expense_edit.php b/expense_edit.php index ffe04555..422e83a2 100644 --- a/expense_edit.php +++ b/expense_edit.php @@ -50,7 +50,7 @@ $item_date = new DateAndTime(DB_DATEFORMAT, $expense_item['date']); // 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'); @@ -129,7 +129,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_to $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')); diff --git a/expenses.php b/expenses.php index 15ccad5e..f9112e31 100644 --- a/expenses.php +++ b/expenses.php @@ -142,7 +142,7 @@ if ($lock_interval > 0) { } // 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) diff --git a/export.php b/export.php index 9f3694ca..5893d80d 100644 --- a/export.php +++ b/export.php @@ -45,7 +45,7 @@ $form = new Form('exportForm'); $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'; diff --git a/import.php b/import.php index f604c4ff..d10ee006 100644 --- a/import.php +++ b/import.php @@ -41,7 +41,7 @@ $form->addInput(array('type'=>'upload','name'=>'xmlfile','value'=>'browse','maxs // 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(); diff --git a/invoice_add.php b/invoice_add.php index 0ee614f9..e536f876 100644 --- a/invoice_add.php +++ b/invoice_add.php @@ -37,7 +37,7 @@ if (!ttAccessCheck(right_manage_team)) { exit(); } -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_date = $request->getParameter('date'); $cl_client = $request->getParameter('client'); $cl_project = $request->getParameter('project'); @@ -64,7 +64,7 @@ $form->addInput(array('type'=>'datefield','maxlength'=>'20','name'=>'start','val $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')); diff --git a/invoice_delete.php b/invoice_delete.php index 4f9ed242..89f132d4 100644 --- a/invoice_delete.php +++ b/invoice_delete.php @@ -49,7 +49,7 @@ $form->addInput(array('type'=>'combobox', $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'))) { diff --git a/invoice_send.php b/invoice_send.php index 18d8db6b..d5f9308e 100644 --- a/invoice_send.php +++ b/invoice_send.php @@ -45,7 +45,7 @@ $sc = new ttSysConfig($user->id); 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')); @@ -64,7 +64,7 @@ $form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;', $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')); diff --git a/login.php b/login.php index 3051a206..67b47da6 100644 --- a/login.php +++ b/login.php @@ -42,7 +42,7 @@ $form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'50','name'=>'pas $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')); diff --git a/mobile/login.php b/mobile/login.php index 1a96526b..3d382db6 100644 --- a/mobile/login.php +++ b/mobile/login.php @@ -31,7 +31,7 @@ import('form.Form'); import('ttTeamHelper'); import('ttUser'); -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { $cl_login = $request->getParameter('login'); } else { $cl_login = @$_COOKIE['tt_login']; @@ -44,7 +44,7 @@ $form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'50','name'=>'pas $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')); diff --git a/mobile/time.php b/mobile/time.php index f638ecae..bc031842 100644 --- a/mobile/time.php +++ b/mobile/time.php @@ -70,7 +70,7 @@ $cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? n $_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 @@ -192,7 +192,7 @@ if ($lock_interval > 0) { } // Submit. -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { if ($request->getParameter('btn_submit')) { // Validate user input. diff --git a/mobile/time_delete.php b/mobile/time_delete.php index cd702f7b..16833025 100644 --- a/mobile/time_delete.php +++ b/mobile/time_delete.php @@ -53,7 +53,7 @@ if ($time_rec['invoice_id']) die($i18n->getKey('error.sys')); // 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. diff --git a/mobile/time_edit.php b/mobile/time_edit.php index 87dc587a..83e89154 100644 --- a/mobile/time_edit.php +++ b/mobile/time_edit.php @@ -59,7 +59,7 @@ $item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']); // 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')); @@ -207,7 +207,7 @@ $form->addInput(array('type'=>'hidden','name'=>'browser_today','value'=>'')); // $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) diff --git a/mobile/timer.php b/mobile/timer.php index 7710f40f..99a88526 100644 --- a/mobile/timer.php +++ b/mobile/timer.php @@ -65,7 +65,7 @@ $cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? n $_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 @@ -188,7 +188,7 @@ if ($lock_interval > 0) { } // 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; diff --git a/notification_add.php b/notification_add.php index fd8d0c84..feeaa048 100644 --- a/notification_add.php +++ b/notification_add.php @@ -41,7 +41,7 @@ if (!ttAccessCheck(right_manage_team)) { $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')); @@ -62,7 +62,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'cron_spec','sty $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')); diff --git a/notification_delete.php b/notification_delete.php index d6a04179..6723824c 100644 --- a/notification_delete.php +++ b/notification_delete.php @@ -45,7 +45,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_notification_id $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)) { diff --git a/notification_edit.php b/notification_edit.php index 6e5bd936..b3d2dc1b 100644 --- a/notification_edit.php +++ b/notification_edit.php @@ -42,7 +42,7 @@ if (!ttAccessCheck(right_manage_team)) { $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')); @@ -66,7 +66,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'cron_spec','sty $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')); diff --git a/notifications.php b/notifications.php index 75b0dbbd..6a66b2f7 100644 --- a/notifications.php +++ b/notifications.php @@ -38,7 +38,7 @@ if (!ttAccessCheck(right_manage_team)) { $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'); diff --git a/password_change.php b/password_change.php index 9302ef04..84e8f6ae 100644 --- a/password_change.php +++ b/password_change.php @@ -64,7 +64,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'120','name'=>'password2','asp $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')); diff --git a/password_reset.php b/password_reset.php index 52e268ca..d67372c5 100644 --- a/password_reset.php +++ b/password_reset.php @@ -40,7 +40,7 @@ $form = new Form('resetPasswordForm'); $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. diff --git a/profile_edit.php b/profile_edit.php index 9732fb66..b39903fa 100644 --- a/profile_edit.php +++ b/profile_edit.php @@ -39,7 +39,7 @@ if (!ttAccessCheck(right_data_entry|right_view_reports)) { 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()) { @@ -179,7 +179,7 @@ if ($user->canManageTeam()) { } $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) { diff --git a/project_add.php b/project_add.php index b7bef62a..e00a2207 100644 --- a/project_add.php +++ b/project_add.php @@ -45,7 +45,7 @@ $tasks = ttTeamHelper::getActiveTasks($user->team_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_users = $request->getParameter('users', array()); @@ -65,7 +65,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) $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')); diff --git a/project_delete.php b/project_delete.php index 68c51b82..6801272a 100644 --- a/project_delete.php +++ b/project_delete.php @@ -45,7 +45,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id)); $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)) { diff --git a/project_edit.php b/project_edit.php index 25bafcbb..cb62d205 100644 --- a/project_edit.php +++ b/project_edit.php @@ -47,7 +47,7 @@ $tasks = ttTeamHelper::getActiveTasks($user->team_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'); @@ -82,7 +82,7 @@ if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) $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')); diff --git a/register.php b/register.php index 035e29b6..eb74948f 100644 --- a/register.php +++ b/register.php @@ -39,7 +39,7 @@ $auth->doLogout(); 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; @@ -61,7 +61,7 @@ $form->addInput(array('type'=>'text','maxlength'=>'30','name'=>'password2','aspa $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')); diff --git a/report.php b/report.php index 775a5dd8..a34238fb 100644 --- a/report.php +++ b/report.php @@ -64,7 +64,7 @@ if ($client_id && $bean->getAttribute('chinvoice') && ('no_grouping' == $bean->g } } -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); diff --git a/report_send.php b/report_send.php index 505613e2..ecd95444 100644 --- a/report_send.php +++ b/report_send.php @@ -40,7 +40,7 @@ if (!ttAccessCheck(right_view_reports)) { $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')); @@ -58,7 +58,7 @@ $form->addInput(array('type'=>'text','name'=>'subject','style'=>'width: 300px;', $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')); diff --git a/reports.php b/reports.php index 004ae6a6..e2b149f7 100644 --- a/reports.php +++ b/reports.php @@ -244,7 +244,7 @@ $form->setValueByElement('fav_report_changed',''); 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')) { diff --git a/task_add.php b/task_add.php index 205bb727..da35416e 100644 --- a/task_add.php +++ b/task_add.php @@ -40,7 +40,7 @@ if (!ttAccessCheck(right_manage_team)) { $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'); @@ -55,7 +55,7 @@ $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: $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')); diff --git a/task_delete.php b/task_delete.php index 96044fea..c0834a7b 100644 --- a/task_delete.php +++ b/task_delete.php @@ -45,7 +45,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_task_id)); $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)) { diff --git a/task_edit.php b/task_edit.php index 47968508..2a901332 100644 --- a/task_edit.php +++ b/task_edit.php @@ -40,7 +40,7 @@ if (!ttAccessCheck(right_manage_team)) { $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'); @@ -66,7 +66,7 @@ $form->addInput(array('type'=>'checkboxgroup','name'=>'projects','layout'=>'H',' $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')); diff --git a/time.php b/time.php index b01cd944..b7ea5726 100644 --- a/time.php +++ b/time.php @@ -73,7 +73,7 @@ $cl_cf_1 = trim($request->getParameter('cf_1', ($request->getMethod()=='POST'? n $_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 @@ -213,7 +213,7 @@ if ($lock_interval > 0) { } // Submit. -if ($request->getMethod() == 'POST') { +if ($request->isPost()) { if ($request->getParameter('btn_submit')) { // Validate user input. diff --git a/time_delete.php b/time_delete.php index 9c53323e..8bbc5971 100644 --- a/time_delete.php +++ b/time_delete.php @@ -53,7 +53,7 @@ if ($time_rec['invoice_id']) die($i18n->getKey('error.sys')); // 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. diff --git a/time_edit.php b/time_edit.php index cc3070c7..c66ae578 100644 --- a/time_edit.php +++ b/time_edit.php @@ -59,7 +59,7 @@ $item_date = new DateAndTime(DB_DATEFORMAT, $time_rec['date']); // 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')); @@ -208,7 +208,7 @@ $form->addInput(array('type'=>'submit','name'=>'btn_save','onclick'=>'browser_to $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) diff --git a/user_add.php b/user_add.php index 92861d90..9834fec4 100644 --- a/user_add.php +++ b/user_add.php @@ -47,7 +47,7 @@ if (in_array('cl', explode(',', $user->plugins))) $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()) { @@ -131,7 +131,7 @@ $form->addInputElement($table); $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')); diff --git a/user_delete.php b/user_delete.php index 079c1140..8ea639c6 100644 --- a/user_delete.php +++ b/user_delete.php @@ -63,7 +63,7 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$user_id)); $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. diff --git a/user_edit.php b/user_edit.php index 060367d8..9026fe08 100644 --- a/user_edit.php +++ b/user_edit.php @@ -64,7 +64,7 @@ if (in_array('cl', explode(',', $user->plugins))) $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()) { @@ -162,7 +162,7 @@ $form->addInputElement($table); $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'));