diff --git a/package/pack.php b/package/pack.php index 32262636..5464ccc5 100755 --- a/package/pack.php +++ b/package/pack.php @@ -400,7 +400,7 @@ 'default_value' => NULL, 'date_modified' => '2018-08-06 20:33:40', 'deleted' => '0', - 'audited' => '0', + 'audited' => '1', 'mass_update' => '0', 'duplicate_merge' => '1', 'reportable' => '1', diff --git a/package/src/custom/Extension/application/Ext/Language/en_us.applicant_prog_score_subject.php b/package/src/custom/Extension/application/Ext/Language/en_us.applicant_prog_score_subject.php new file mode 100644 index 00000000..608fb53c --- /dev/null +++ b/package/src/custom/Extension/application/Ext/Language/en_us.applicant_prog_score_subject.php @@ -0,0 +1,3 @@ +get(Context::class); + $subject = new ApsSubject($bean->id); + $context->activateSubject($subject); + $context->setAttribute('aps_calc_version', $this->version); + // The programming languages are stored as a comma separated list in the bean. Convert them to an array. $programmingLanguages = explode(",", $bean->programminglanguages_c); @@ -23,7 +35,12 @@ public function updateProgrammingScore($bean, $event, $arguments) // Update the calculated fields. This is necessary for the Rating Star field to be updated immediately. $bean->updateCalculatedFields(); - + + //Have to commit the changes we made to the audit log because we didn't call save. + //Passing the subject rather than null here would override the additional attributes that were set on the context + $bean->commitAuditedStateChanges(null); + //Always deactivate the subject before leaving the function + $context->deactivateSubject($subject); } /** diff --git a/package/src/custom/src/Security/Subject/ApplicantProgrammingScore.php b/package/src/custom/src/Security/Subject/ApplicantProgrammingScore.php new file mode 100644 index 00000000..264c205d --- /dev/null +++ b/package/src/custom/src/Security/Subject/ApplicantProgrammingScore.php @@ -0,0 +1,47 @@ +applicantId = $applicantId; + } + + /** + * {@inheritDoc} + */ + public function jsonSerialize() + { + return [ + '_type' => 'aps-hook', + 'applicant_id' => $this->applicantId + ]; + } +}