Skip to content

Commit

Permalink
[Jobs] checks, if snapshot exists.
Browse files Browse the repository at this point in the history
Jobs cam be created with WAITING_FOR_APROVAL state when using the SimpleImport module
  • Loading branch information
cbleek committed Dec 22, 2017
1 parent a99adf8 commit d8c8a47
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions module/Jobs/view/jobs/admin/index.ajax.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,16 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
<a href="<?php echo $this->url('lang/jobs/approval', array('action' => 'edit'), array('query' => array('id' => $job->getId())), true) ?>" class="btn btn-success btn-xs"><span class="yk-icon fa-check"></span></a>
<?php endif ?>
<?php if (\Jobs\Entity\StatusInterface::WAITING_FOR_APPROVAL == $job->getStatus()->getName()):
$snapshot = $isSnapshot ? $job : $this->services('repositories.Jobs/JobSnapshot')->findLatest($job->getId(), true);?>
<a href="<?php echo $this->url('lang/jobs/approval', array('action' => 'edit'), array('query' => array('snapshot' => $snapshot->getSnapshotId())), true) ?>" class="btn btn-success btn-xs"><span class="yk-icon fa-check"></span></a>

$snapshot = $isSnapshot ? $job : $this->services('repositories.Jobs/JobSnapshot')->findLatest($job->getId(), true);

if ($snapshot){
$query=['snapshot' => $snapshot->getSnapshotId()];
}else{
$query=[];
}
?>
<a href="<?php echo $this->url('lang/jobs/approval', array('action' => 'edit'), array('query' => $query), true) ?>" class="btn btn-success btn-xs"><span class="yk-icon fa-check"></span></a>
<?php endif ?>
<a data-jobtitle="<?=$job->getTitle()?>" href="<?=$this->ajaxUrl('jobs.delete', ['id' => $job->getId()])?>" class="delete-link btn btn-danger btn-xs" title="<?=$this->translate('Delete')?>">
<i class="yk-icon yk-icon-delete"></i>
Expand Down

0 comments on commit d8c8a47

Please sign in to comment.