Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
define('PIPELINE_STATUS_INTERVIEWING', 500);
define('PIPELINE_STATUS_OFFERED', 600);
define('PIPELINE_STATUS_NOTINCONSIDERATION', 650);
define('PIPELINE_STATUS_CANDIDATEDECLINED', 675);
define('PIPELINE_STATUS_CLIENTDECLINED', 700);
define('PIPELINE_STATUS_PLACED', 800);

Expand Down
1 change: 1 addition & 0 deletions db/cats_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_d
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (500,'Interviewing',0,1,1);
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (600,'Offered',0,1,1);
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (650,'Not in Consideration',0,0,1);
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (675,'Candidate Declined',0,0,1);
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (700,'Client Declined',0,0,1);
insert into `candidate_joborder_status`(`candidate_joborder_status_id`,`short_description`,`can_be_scheduled`,`triggers_email`,`is_enabled`) values (800,'Placed',0,1,1);

Expand Down
3 changes: 3 additions & 0 deletions lib/Statistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,7 @@ public function getPipelineData($jobOrderID = -1)
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS submitted,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS interviewing,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS offered,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS candidateDeclined,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS passedOn,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS placed,
SUM(IF(candidate_joborder.status = %s, 1, 0)) AS replied
Expand All @@ -926,6 +927,7 @@ public function getPipelineData($jobOrderID = -1)
PIPELINE_STATUS_SUBMITTED,
PIPELINE_STATUS_INTERVIEWING,
PIPELINE_STATUS_OFFERED,
PIPELINE_STATUS_CANDIDATEDECLINED,
PIPELINE_STATUS_CLIENTDECLINED,
PIPELINE_STATUS_PLACED,
PIPELINE_STATUS_CANDIDATE_REPLIED,
Expand All @@ -945,6 +947,7 @@ public function getPipelineData($jobOrderID = -1)
'submitted' => 0,
'interviewing' => 0,
'offered' => 0,
'candidateDeclined' => 0,
'passedOn' => 0,
'placed' => 0
);
Expand Down
9 changes: 8 additions & 1 deletion modules/candidates/CandidatesUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1906,9 +1906,16 @@ private function changeStatus()
$mailerSettings = new MailerSettings($this->_siteID);
$mailerSettingsRS = $mailerSettings->getAll();
$candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);
if (!is_array($candidateJoborderStatusSendsMessage))
{
$candidateJoborderStatusSendsMessage = array();
}
foreach ($statusRS as $index => $status)
{
$statusRS[$index]['triggersEmail'] = $candidateJoborderStatusSendsMessage[$status['statusID']];
if (isset($candidateJoborderStatusSendsMessage[$status['statusID']]))
{
$statusRS[$index]['triggersEmail'] = $candidateJoborderStatusSendsMessage[$status['statusID']];
}
}

/* Get the change status email template. */
Expand Down
16 changes: 10 additions & 6 deletions modules/graphs/GraphsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@
"Submitted",
"Interviewing",
"Offered",
"Declined",
"Candidate Declined",
"Client Declined",
"Placed"
);
}
Expand All @@ -497,14 +498,16 @@
"Submitted",
"|Interviewing",
"Offered",
"|Declined",
"|Cand Declined",
"Client Declined",
"Placed"
);
}

$x[8] = $statisticsData['placed'];
$x[7] = $statisticsData['passedOn'];
$x[6] = $statisticsData['offered'] + $x[8];
$x[9] = $statisticsData['placed'];

Check notice on line 507 in modules/graphs/GraphsUI.php

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/graphs/GraphsUI.php#L507

Avoid variables with short names like $x. Configured minimum length is 2.
$x[8] = $statisticsData['passedOn'];
$x[7] = $statisticsData['candidateDeclined'];
$x[6] = $statisticsData['offered'] + $x[9];
$x[5] = $statisticsData['interviewing'] + $x[6];
$x[4] = $statisticsData['submitted'] + $x[5];
$x[3] = $statisticsData['qualifying'] + $x[4];
Expand All @@ -515,12 +518,13 @@
$colorOptions = Graphs::getColorOptions();
$colorArray = array();

for ($i = 0; $i < 9; $i++)
for ($i = 0; $i < 10; $i++)
{
$colorArray[] = new LinearGradient(new DarkGreen, new White, 0);
}
$colorArray[4] = new LinearGradient(new Orange, new White, 0);
$colorArray[7] = new LinearGradient(new AlmostBlack, new White, 0);
$colorArray[8] = new LinearGradient(new AlmostBlack, new White, 0);

$graph = new GraphComparisonChart(
$y, $x, $colorArray, 'Status of Candidates', $this->width,
Expand Down
14 changes: 14 additions & 0 deletions modules/install/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,20 @@ public static function get()
SET short_description = \'Not reached\'
WHERE activity_type_id = 100;
',
'377' => '
INSERT INTO candidate_joborder_status
(candidate_joborder_status_id, short_description, can_be_scheduled, triggers_email, is_enabled)
SELECT
675, \'Candidate Declined\', 0, 0, 1
FROM
DUAL
WHERE
NOT EXISTS (
SELECT 1
FROM candidate_joborder_status
WHERE candidate_joborder_status_id = 675
);
',

);
}
Expand Down
9 changes: 8 additions & 1 deletion modules/joborders/JobOrdersUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1573,10 +1573,17 @@ private function changeStatus()
$mailerSettingsRS = $mailerSettings->getAll();

$candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);
if (!is_array($candidateJoborderStatusSendsMessage))
{
$candidateJoborderStatusSendsMessage = array();
}

foreach ($statusRS as $index => $status)
{
$statusRS[$index]['triggersEmail'] = $candidateJoborderStatusSendsMessage[$status['statusID']];
if (isset($candidateJoborderStatusSendsMessage[$status['statusID']]))
{
$statusRS[$index]['triggersEmail'] = $candidateJoborderStatusSendsMessage[$status['statusID']];
}
}

/* Get the change status email template. */
Expand Down
3 changes: 2 additions & 1 deletion modules/settings/EmailSettings.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
<input type="checkbox" name="statusChangeSubmitted" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_SUBMITTED]==1): ?>checked<?php endif; ?>>Status Change: Submitted<br />
<input type="checkbox" name="statusChangeInterviewing" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_INTERVIEWING]==1): ?>checked<?php endif; ?>>Status Change: Interviewing<br />
<input type="checkbox" name="statusChangeOffered" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_OFFERED]==1): ?>checked<?php endif; ?>>Status Change: Offered<br />
<input type="checkbox" name="statusChangeDeclined" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CLIENTDECLINED]==1): ?>checked<?php endif; ?>>Status Change: Declined<br />
<input type="checkbox" name="statusChangeCandidateDeclined" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CANDIDATEDECLINED]==1): ?>checked<?php endif; ?>>Status Change: Candidate Declined<br />
<input type="checkbox" name="statusChangeClientDeclined" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CLIENTDECLINED]==1): ?>checked<?php endif; ?>>Status Change: Client Declined<br />
<input type="checkbox" name="statusChangePlaced" <?php if($this->candidateJoborderStatusSendsMessage[PIPELINE_STATUS_PLACED]==1): ?>checked<?php endif; ?>>Status Change: Placed<br />
<?php foreach ($this->emailTemplatesRS as $index => $data): ?>
<input type="checkbox" name="useThisTemplate<?php echo($data['emailTemplateID']); ?>" id="useThisTemplate<?php echo($data['emailTemplateID']); ?>" <?php if ($data['disabled'] == 0) echo('checked'); ?>> <?php echo($data['emailTemplateTitle']); ?><br />
Expand Down
35 changes: 34 additions & 1 deletion modules/settings/SettingsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,20 @@ private function emailSettings()
$mailerSettingsRS = $mailerSettings->getAll();

$candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);
if (!is_array($candidateJoborderStatusSendsMessage))
{
$candidateJoborderStatusSendsMessage = array();
}

$pipelines = new Pipelines($this->_siteID);
$statusRS = $pipelines->getStatusesForPicking();
foreach ($statusRS as $status)
{
if (!isset($candidateJoborderStatusSendsMessage[$status['statusID']]))
{
$candidateJoborderStatusSendsMessage[$status['statusID']] = $status['triggersEmail'];
}
}

$emailTemplates = new EmailTemplates($this->_siteID);
$emailTemplatesRS = $emailTemplates->getAll();
Expand Down Expand Up @@ -2094,14 +2108,33 @@ private function onEmailSettings()
}

$candidateJoborderStatusSendsMessage = unserialize($mailerSettingsRS['candidateJoborderStatusSendsMessage']);
if (!is_array($candidateJoborderStatusSendsMessage))
{
$candidateJoborderStatusSendsMessage = array();
}

$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CONTACTED] = (UserInterface::isChecked('statusChangeContacted', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CANDIDATE_REPLIED] = (UserInterface::isChecked('statusChangeReplied', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_QUALIFYING] = (UserInterface::isChecked('statusChangeQualifying', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_SUBMITTED] = (UserInterface::isChecked('statusChangeSubmitted', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_INTERVIEWING] = (UserInterface::isChecked('statusChangeInterviewing', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_OFFERED] = (UserInterface::isChecked('statusChangeOffered', $_POST) ? 1 : 0);
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CLIENTDECLINED] = (UserInterface::isChecked('statusChangeDeclined', $_POST) ? 1 : 0);
if (isset($_POST['statusChangeCandidateDeclined']))
{
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CANDIDATEDECLINED] = (UserInterface::isChecked('statusChangeCandidateDeclined', $_POST) ? 1 : 0);
}
else
{
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CANDIDATEDECLINED] = (UserInterface::isChecked('statusChangeDeclined', $_POST) ? 1 : 0);
}
if (isset($_POST['statusChangeClientDeclined']))
{
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CLIENTDECLINED] = (UserInterface::isChecked('statusChangeClientDeclined', $_POST) ? 1 : 0);
}
else
{
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_CLIENTDECLINED] = (UserInterface::isChecked('statusChangeDeclined', $_POST) ? 1 : 0);
}
$candidateJoborderStatusSendsMessage[PIPELINE_STATUS_PLACED] = (UserInterface::isChecked('statusChangePlaced', $_POST) ? 1 : 0);

$mailerSettings->set('candidateJoborderStatusSendsMessage', serialize($candidateJoborderStatusSendsMessage));
Expand Down
Loading