Skip to content

Commit

Permalink
fix: missing $basePath JobController class property
Browse files Browse the repository at this point in the history
Add missing $basePath JobController class property.

Remove commented code in JobController class.

Fix typo while generating $where array in JobController::index().
  • Loading branch information
dfranco committed Jan 14, 2024
1 parent d47b0bf commit 86fb67d
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions application/Controller/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,16 @@
use Valitron\Validator;
use function Core\Helpers\getRequestParams;

;

class JobController
{
private LogTable $logTable;
private JobTable $jobTable;
//private CDBPagination $paginator;
private ClientTable $clientTable;
private PoolTable $poolTable;

private JobFileTable $jobFileTable;
private Twig $view;
private SessionInterface $session;
private ?string $basePath;

public function __construct(
JobTable $jobTable,
Expand All @@ -84,12 +81,13 @@ public function __construct(
/**
* @param Request $request
* @param Response $response
* @param $args
* @return Response
* @throws ConfigFileException
* @throws Exception
* @throws LoaderError
* @throws RuntimeError
* @throws SyntaxError
*/
public function index(Request $request, Response $response, $args): Response
public function index(Request $request, Response $response): Response
{
$tplData = [];
$where = null;
Expand Down Expand Up @@ -287,13 +285,13 @@ public function index(Request $request, Response $response, $args): Response

// Selected level filter
if ($filter_joblevel !== '0') {
$where[] .= "Job.Level = :job_level ";
$where[] = "Job.Level = :job_level ";
$params['job_level'] = $filter_joblevel;
}

// Selected pool filter
if ($filter_poolid !== '0') {
$where[] .= "Job.PoolId = :pool_id ";
$where[] = "Job.PoolId = :pool_id ";
$params['pool_id'] = $filter_poolid;
}

Expand All @@ -304,7 +302,7 @@ public function index(Request $request, Response $response, $args): Response

// Selected client filter
if ($filter_clientid !== '0') {
$where[] .= "Job.ClientId = :client_id";
$where[] = "Job.ClientId = :client_id";
$params['client_id'] = $filter_clientid;
}

Expand Down Expand Up @@ -470,12 +468,7 @@ public function index(Request $request, Response $response, $args): Response
}

$tplData['pagination'] = $pagination;

//$this->view->set('last_jobs', $last_jobs);
$tplData['last_jobs'] = $last_jobs;

// Count jobs
//$this->view->set('jobs_found', count($last_jobs));
$tplData['jobs_found'] = count($last_jobs);

return $this->view->render($response, 'pages/jobs.html.twig', $tplData);
Expand Down

0 comments on commit 86fb67d

Please sign in to comment.