From 9a9200cf19fc4de98b09834e7d598b1b4c6f44b3 Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Fri, 19 Jan 2018 16:18:38 +0000 Subject: [PATCH] Work in progress integrating paid status plugin. --- WEB-INF/templates/footer.tpl | 2 +- WEB-INF/templates/reports.tpl | 8 ++++++++ charts.php | 2 +- expenses.php | 4 ++-- login.php | 3 +-- reports.php | 10 ++++++++++ 6 files changed, 23 insertions(+), 6 deletions(-) diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 52573e79..f994bf1b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
- {/if} +{if ($user->canManageTeam() && $user->isPluginEnabled('ps'))} + + + + + + +{/if} {if $user->canManageTeam() || $user->isClient()} diff --git a/charts.php b/charts.php index 985a1ae8..c76eddfa 100644 --- a/charts.php +++ b/charts.php @@ -84,7 +84,7 @@ $_SESSION['chart_type'] = $cl_type; // Who do we draw charts for? $on_behalf_id = $request->getParameter('onBehalfUser', (isset($_SESSION['behalf_id'])? $_SESSION['behalf_id'] : $user->id)); -if ($request->getMethod( )== 'POST') { +if ($request->isPost()) { // If chart interval changed - save it. $cl_interval = $request->getParameter('interval'); if ($cl_interval) { diff --git a/expenses.php b/expenses.php index 93161f08..8db28653 100644 --- a/expenses.php +++ b/expenses.php @@ -50,9 +50,9 @@ $_SESSION['date'] = $cl_date; // Initialize variables. $on_behalf_id = $request->getParameter('onBehalfUser', (isset($_SESSION['behalf_id']) ? $_SESSION['behalf_id'] : $user->id)); -$cl_client = $request->getParameter('client', ($request->getMethod()=='POST' ? null : @$_SESSION['client'])); +$cl_client = $request->getParameter('client', ($request->isPost() ? null : @$_SESSION['client'])); $_SESSION['client'] = $cl_client; -$cl_project = $request->getParameter('project', ($request->getMethod()=='POST' ? null : @$_SESSION['project'])); +$cl_project = $request->getParameter('project', ($request->isPost() ? null : @$_SESSION['project'])); $_SESSION['project'] = $cl_project; $cl_item_name = $request->getParameter('item_name'); $cl_cost = $request->getParameter('cost'); diff --git a/login.php b/login.php index b0c583fa..d398794c 100644 --- a/login.php +++ b/login.php @@ -32,9 +32,8 @@ import('ttTeamHelper'); import('ttUser'); $cl_login = $request->getParameter('login'); +if ($cl_login == null && $request->isGet()) $cl_login = @$_COOKIE['tt_login']; $cl_password = $request->getParameter('password'); -if ($cl_login == null && $request->getMethod() == 'GET') - $cl_login = @$_COOKIE['tt_login']; $form = new Form('loginForm'); $form->addInput(array('type'=>'text','size'=>'25','maxlength'=>'100','name'=>'login','style'=>'width: 220px;','value'=>$cl_login)); diff --git a/reports.php b/reports.php index 69e74235..f6d9cf05 100644 --- a/reports.php +++ b/reports.php @@ -122,6 +122,16 @@ $form->addInput(array('type'=>'combobox', 'data'=>$include_options, 'empty'=>array(''=>$i18n->getKey('dropdown.all')))); +if ($user->isPluginEnabled('ps')) { + $form->addInput(array('type'=>'combobox', + 'name'=>'paid_status', + 'style'=>'width: 250px;', + 'data'=>array('1'=>$i18n->getKey('dropdown.paid'),'2'=>$i18n->getKey('dropdown.not_paid')), + 'empty'=>array(''=>$i18n->getKey('dropdown.all')) + )); +} + + // Add invoiced / not invoiced selector. $invoice_options = array('1'=>$i18n->getKey('form.reports.include_invoiced'), '2'=>$i18n->getKey('form.reports.include_not_invoiced')); -- 2.20.1
 Anuko Time Tracker 1.15.0.3759 | Copyright © Anuko | +  Anuko Time Tracker 1.15.0.3760 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} diff --git a/WEB-INF/templates/reports.tpl b/WEB-INF/templates/reports.tpl index 5ca7a171..0f9b129f 100644 --- a/WEB-INF/templates/reports.tpl +++ b/WEB-INF/templates/reports.tpl @@ -209,6 +209,14 @@ function handleCheckboxes() { {$forms.reportForm.invoice.control}
{$i18n.label.paid_status}
{$forms.reportForm.paid_status.control}
{$i18n.label.users}