Skip to content
Snippets Groups Projects
Commit 195da491 authored by VESSILLER's avatar VESSILLER
Browse files

NEW garder le processus lie a la tache planifiee d'indexation

parent 08e5bb96
No related branches found
No related tags found
No related merge requests found
...@@ -270,9 +270,9 @@ class IndexationProcess extends TimedJob { ...@@ -270,9 +270,9 @@ class IndexationProcess extends TimedJob {
$this->_log('Indexation process : Begin'); $this->_log('Indexation process : Begin');
// find process in indexation step // find process in indexation step
$processList = $this->_dematpayslipProcessMapper->findAll(); $processList = $this->_dematpayslipProcessMapper->findAllLast();
if (!empty($processList)) { if (!empty($processList)) {
$process = current($processList); $process = $processList[0];
if ($process->getPhase() == DematpayslipProcess::PHASE_ID_INDEXATION) { if ($process->getPhase() == DematpayslipProcess::PHASE_ID_INDEXATION) {
$process->load($this->_appName, $this->_config, $this->_dbConnection, $this->_l10n, $this->_rootFolder, $this->_shareManager, $this->_userManager, $userId, $this->_dematpayslipProcessMapper, $this->_dematpayslipProcessSkipMapper, $this->_dematpayslipUserMapper, $this->_timeZone); $process->load($this->_appName, $this->_config, $this->_dbConnection, $this->_l10n, $this->_rootFolder, $this->_shareManager, $this->_userManager, $userId, $this->_dematpayslipProcessMapper, $this->_dematpayslipProcessSkipMapper, $this->_dematpayslipUserMapper, $this->_timeZone);
$result = $process->indexation($processMsgList); $result = $process->indexation($processMsgList);
......
...@@ -248,7 +248,7 @@ class PageController extends Controller { ...@@ -248,7 +248,7 @@ class PageController extends Controller {
$this->_dematpayslipUserMapper = $dematpayslipUserMapper; $this->_dematpayslipUserMapper = $dematpayslipUserMapper;
// create process if not exists // create process if not exists
$processList = $this->_dematpayslipProcessMapper->findAll(); $processList = $this->_dematpayslipProcessMapper->findAllLast();
if (empty($processList)) { if (empty($processList)) {
$process = new DematpayslipProcess(); $process = new DematpayslipProcess();
$process->setProcessing(0); $process->setProcessing(0);
...@@ -266,6 +266,7 @@ class PageController extends Controller { ...@@ -266,6 +266,7 @@ class PageController extends Controller {
$this->_dematpayslipProcessMapper->insert($process); $this->_dematpayslipProcessMapper->insert($process);
$this->_dematpaylsipProcess = $process; $this->_dematpaylsipProcess = $process;
} else { } else {
// get last process
$this->_dematpaylsipProcess = $processList[0]; $this->_dematpaylsipProcess = $processList[0];
} }
...@@ -323,7 +324,7 @@ class PageController extends Controller { ...@@ -323,7 +324,7 @@ class PageController extends Controller {
* @throws Exception * @throws Exception
*/ */
public function upload() { public function upload() {
// verifier l'utilisateur // check user
if ($this->_userId === $this->_dematpayslipConfigList['user_id']) { if ($this->_userId === $this->_dematpayslipConfigList['user_id']) {
$this->_dematpaylsipProcess->upload(); $this->_dematpaylsipProcess->upload();
......
This diff is collapsed.
...@@ -30,4 +30,14 @@ class DematpayslipProcessMapper extends QBMapper { ...@@ -30,4 +30,14 @@ class DematpayslipProcessMapper extends QBMapper {
return $this->findEntities($qb); return $this->findEntities($qb);
} }
public function findAllLast() {
$qb = $this->db->getQueryBuilder();
$qb->select('*')
->from($this->getTableName())
->orderBy('id', 'DESC');
return $this->findEntities($qb);
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment