Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Email a candidate from the candidate page #246

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 19 additions & 9 deletions modules/candidates/CandidatesUI.php
Expand Up @@ -3332,21 +3332,31 @@ private function onEmailCandidates()
}
else
{
$dataGrid = DataGrid::getFromRequest();

$candidateIDs = $dataGrid->getExportIDs();

/* Validate each ID */
foreach ($candidateIDs as $index => $candidateID)
if(isset($_GET['candidateID']))
{
if (!$this->isRequiredIDValid($index, $candidateIDs))
{
if (!$this->isRequiredIDValid('candidateID', $_GET)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
return;
}
$candidateID = $_GET['candidateID'];
$db_str = $candidateID;
}
else
{
$dataGrid = DataGrid::getFromRequest();

$candidateIDs = $dataGrid->getExportIDs();

/* Validate each ID */
foreach ($candidateIDs as $index => $candidateID) {
if (!$this->isRequiredIDValid($index, $candidateIDs)) {
CommonErrors::fatalModal(COMMONERROR_BADINDEX, $this, 'Invalid candidate ID.');
return;
}
}

$db_str = implode(", ", $candidateIDs);
$db_str = implode(", ", $candidateIDs);
}

$db = DatabaseConnection::getInstance();

Expand Down
13 changes: 10 additions & 3 deletions modules/candidates/Show.tpl
Expand Up @@ -78,9 +78,16 @@ use OpenCATS\UI\CandidateDuplicateQuickActionMenu;
<tr>
<td class="vertical">E-Mail:</td>
<td class="data">
<a href="mailto:<?php $this->_($this->data['email1']); ?>">
<?php $this->_($this->data['email1']); ?>
</a>
<?php if ($this->data['email1'] != ""): ?>
<a href="mailto:<?php $this->_($this->data['email1']); ?>" title="Send E-Mail via Email Client">
<?php $this->_($this->data['email1']); ?>
</a>
<a href="index.php?m=candidates&amp;a=emailCandidates&candidateID=<?php echo $this->_($this->data['candidateID']); ?>" title="Send E-Mail via OpenCATS"/>
<img src="images/actions/email.gif" width="16" height="16" alt="" class="absmiddle" border="0" />
</a>
<?php else: ?>
<img src="images/actions/email_no.gif" title="No E-Mail Address" width="16" height="16" alt="" class="absmiddle" border="0" />
<?php endif; ?>
</td>
</tr>
<tr>
Expand Down