Skip to content

Commit

Permalink
also fix organisation selection
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzmg committed Feb 3, 2022
1 parent 8683985 commit e776b8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/EventListener/GetSearchablePagesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __invoke($pages, $rootId = null, $isSitemap = false, $language =
continue;
}

$jobs = Jobs::findBy(['pid IN('.implode(',', array_map('intval', $organisations)).')'], []);
$jobs = Jobs::findBy(['pid IN(' . implode(',', array_map('intval', $organisations)) . ')'], []);

if (null === $jobs) {
continue;
Expand Down
15 changes: 7 additions & 8 deletions src/Module/JobList.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
namespace Slashworks\ContaoSimpleJobManagerBundle\Module;

use Contao\Controller;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\Date;
use Contao\FilesModel;
use Contao\Image\PictureConfiguration;
use Contao\Input;
use Contao\Module;
use Contao\PageModel;
use Contao\StringUtil;
use Slashworks\ContaoSimpleJobManagerBundle\Models\Jobs;

/**
Expand Down Expand Up @@ -58,11 +54,14 @@ protected function compile()
);

if (!$bExpiredJobs) {
$aOptions['column'][] = ' validthrough >= ' . $dTime;
$aOptions['column'][] = 'validthrough >= ' . $dTime;
}

$aJobsByOrganisation = array();
$oOrganisations = \Slashworks\ContaoSimpleJobManagerBundle\Models\Organisation::findAll();
$organisations = StringUtil::deserialize($this->organisation, true);

if (!empty($organisations)) {
$aOptions['column'][] = 'pid IN(' . implode(',', array_map('intval', $organisations)) . ')';
}

$oJobs = Jobs::findAll($aOptions);

Expand Down

0 comments on commit e776b8f

Please sign in to comment.