Skip to content

Commit

Permalink
[Jobs] use jobLink() to reference jobs, if available
Browse files Browse the repository at this point in the history
  • Loading branch information
cbleek committed Nov 16, 2017
1 parent e2b04c4 commit c49811a
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 32 deletions.
5 changes: 5 additions & 0 deletions module/Applications/src/Applications/Mail/NewApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ class NewApplication extends StringTemplateMessage
*/
private $callInitOnSetJob = false;

/**
* @var bool
*/
private $callInitOnSetApplication = false;

/**
*
*
Expand Down
75 changes: 43 additions & 32 deletions module/Jobs/view/jobs/admin/index.ajax.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
<thead>
<tr>
<th><?php echo $this->translate('Date of receipt')?></th>
<th><?php echo $this->translate('Title of the job')?></th>
<th><?php echo $this->translate('Companyname') ?></th>
<th><?php echo $this->translate('Title of the job')?> / <?php echo $this->translate('Companyname') ?></th>
<th><?php echo $this->translate('Name') ?></th>
<th><?php echo $this->translate('Note') ?></th>
<th><?php echo $this->translate('Status')?></th>
Expand All @@ -27,6 +26,10 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
<tbody>
<?php /* @var Jobs\Entity\Job $job */?>
<?php foreach ($jobs as $job):

$org = $job->getOrganization();
$href = $job->getLink() ? $job->getLink() : $this->url('lang/jobs/view', [], ['query' => ['id' => $job->getId()]], true);

$isSnapshot = $job->hasSnapshotDraft() && $job->getStatus()->is(\Jobs\Entity\StatusInterface::WAITING_FOR_APPROVAL);
if ($isSnapshot):
$job = $job->getSnapshotDraft();
Expand All @@ -40,16 +43,21 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
endif?>
</td>
<td>
<?php if ($isSnapshot): ?><a href="<?=$this->url('lang/jobs/view', [], [ 'query' => [ 'snapshot' => $job->getSnapshotId() ]], true)?>">
<span class="label label-warning"><?=$this->translate('Changed')?></span>
<?php if ($isSnapshot): ?>
<a href="<?=$this->url('lang/jobs/view', [], [ 'query' => [ 'snapshot' => $job->getSnapshotId() ]], true)?>">
<span class="label label-warning"><?=$this->translate('Changed')?></span>
</a>
<?php endif ?>
<?php $href = $this->url('lang/jobs/view', array(), array('query' => array('id' => $job->getId())), true); ?>
<a href="<?php echo $href ?>" target="_blank" rel="nofollow"><?php echo strip_tags($job->getTitle())?></a>
<p><small><?=$job->getClassifications()->getProfessions()?><br>
<?=$job->getClassifications()->getEmploymentTypes()?></small></p></td>
<td><?php echo $job->getCompany() ?></td>
<td>
<a href="<?php echo $href ?>" target="_blank" rel="nofollow"><?php echo strip_tags($job->getTitle())?></a><br>
<?php echo $job->getCompany() ?>
<p>
<small>
<?=$job->getClassifications()->getProfessions()?><br>
<?=$job->getClassifications()->getEmploymentTypes()?>
</small>
</p>
</td>
<td>
<?php
$displayName = '';
$user = $job->getUser();
Expand All @@ -59,34 +67,36 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
echo $displayName

?>
</td>
<td>
<p><small><?=$job->getClassifications()->getProfessions()?><br>
<?=$job->getClassifications()->getEmploymentTypes()?></small></p>
</td>
<td>
<?php $note = $job->getMetaData('note');
if ($note):
?><div class="note-box"><?=$note?></div><?php
else:
?>&nbsp;<?php
endif;
?>
</td>
<td><?php echo $this->translate($job->getStatus()->getName()); ?></td>
<td class="text-nowrap"><div class="btn-group btn-toolbar">
<a data-title="title"
data-toggle="modal"
class="btn btn-default btn-xs"
data-target="#job-application-history"
href="<?php echo $this->url( 'lang/jobs/history', array('id' => $job->getId() , 'lang' => $this->params('lang'))); ?>"
title="<?php echo $this->translate('Status history')?>">
<i class="yk-icon yk-icon-history"></i>
</a>
<a data-toggle="modal" class="btn btn-default btn-xs" data-target="#job-edit-popup"
href="<?php echo $this->url('lang/admin/jobs', [ 'action' => 'edit', 'lang' => $this->params('lang') ], ['query' => [ 'id' => $job->getId() ]]); ?>"
title="<?php echo $this->translate('Edit state') ?>">
<i class="yk-icon fa-pencil-square-o"></i>
</a>
<a href="<?=$this->plugin('Jobs/AdminEditLink')->__invoke($job)?>" class="btn btn-default btn-xs" title="<?=$this->translate('Edit')?>">
<i class="yk-icon yk-icon-edit"></i>
</a>
</td>
<td><?php echo $this->translate($job->getStatus()->getName()); ?></td>
<td class="text-nowrap"><div class="btn-group btn-toolbar">
<a data-title="title"
data-toggle="modal"
class="btn btn-default btn-xs"
data-target="#job-application-history"
href="<?php echo $this->url( 'lang/jobs/history', array('id' => $job->getId() , 'lang' => $this->params('lang'))); ?>"
title="<?php echo $this->translate('Status history')?>">
<i class="yk-icon yk-icon-history"></i>
</a>
<a data-toggle="modal" class="btn btn-default btn-xs" data-target="#job-edit-popup"
href="<?php echo $this->url('lang/admin/jobs', [ 'action' => 'edit', 'lang' => $this->params('lang') ], ['query' => [ 'id' => $job->getId() ]]); ?>"
title="<?php echo $this->translate('Edit state') ?>">
<i class="yk-icon fa-pencil-square-o"></i>
</a>
<a href="<?=$this->plugin('Jobs/AdminEditLink')->__invoke($job)?>" class="btn btn-default btn-xs" title="<?=$this->translate('Edit')?>">
<i class="yk-icon yk-icon-edit"></i>
</a>
<?php if (\Jobs\Entity\StatusInterface::CREATED == $job->getStatus()->getName()): ?>
<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 ?>
Expand All @@ -97,7 +107,8 @@ $isRecruiter = $this->acl()->isRole( Auth\Entity\User::ROLE_RECRUITER );
<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>
</a>
</div></td>
</div>
</td>
</tr>
<?php endforeach?>
</tbody>
Expand Down

0 comments on commit c49811a

Please sign in to comment.