Skip to content
Snippets Groups Projects
Commit 689fe2aa authored by ErikHommel's avatar ErikHommel :homes:
Browse files

fix issue 9833 - import reactivate donation company

parent 6f3ba679
No related branches found
No related tags found
1 merge request!1fix issue 9833 - import reactivate donation company
......@@ -32,6 +32,8 @@ class UpdateCallAssignment extends AbstractAction {
$specs->addSpecification(new Specification('activity_id', 'Integer', E::ts('Activity ID'), TRUE, NULL));
$specs->addSpecification(new Specification('result_code', 'String', E::ts('Result Code'), TRUE, NULL));
$specs->addSpecification(new Specification('result_description', 'String', E::ts("Result Description"), FALSE, NULL));
$specs->addSpecification(new Specification('result_agency_reference', 'String', E::ts("Result Agency Reference"), FALSE, NULL));
$specs->addSpecification(new Specification('result_code_sdd', 'String', E::ts("Result Code SDD"), FALSE, NULL));
$specs->addSpecification(new Specification('call_date', 'String', E::ts('Call Date'), FALSE, NULL));
$specs->addSpecification(new Specification('result_upload_date', 'String', E::ts('Result Upload Date'), FALSE, NULL));
$specs->addSpecification(new Specification('call_agent', 'String', E::ts('Call Agent'), FALSE, NULL));
......@@ -102,6 +104,8 @@ class UpdateCallAssignment extends AbstractAction {
$this->setResultUploadDate($parameterBag, $callAssignmentParams);
$this->setResultAgent($parameterBag, $callAssignmentParams);
$this->setResultReasonNo($parameterBag, $callAssignmentParams);
$this->setResultAgencyReference($parameterBag, $callAssignmentParams);
$this->setResultCodeSdd($parameterBag, $callAssignmentParams);
$this->setActivityStatus($parameterBag, $callAssignmentParams);
$this->setCampaignName($parameterBag, $callAssignmentParams);
$this->setNewMandateCode($parameterBag, $callAssignmentParams);
......@@ -159,9 +163,20 @@ class UpdateCallAssignment extends AbstractAction {
$interval = $parameterBag->getParameter('new_frequency');
if ($interval) {
$unitCustomFieldId = "custom_" . \Civi::service('aivlgeneric')->getTmCaResultFreqUnitCustomFieldId();
$intervalCustomFieldId = "custom_" . \Civi::service('aivlgeneric')->getTmCaResultFreqIntervalCustomFieldId();
$callAssignmentParams[$unitCustomFieldId] = "maand";
$callAssignmentParams[$intervalCustomFieldId] = $interval;
switch($interval) {
case 4:
$callAssignmentParams[$unitCustomFieldId] = "kwartaal";
break;
case 2:
$callAssignmentParams[$unitCustomFieldId] = "halfjaarlijks";
break;
case 1:
$callAssignmentParams[$unitCustomFieldId] = "jaarlijks";
break;
default:
$callAssignmentParams[$unitCustomFieldId] = "maand";
break;
}
}
}
/**
......@@ -234,6 +249,34 @@ class UpdateCallAssignment extends AbstractAction {
}
}
/**
* Method to set the result agency reference in call assignment parameters
*
* @param ParameterBagInterface $parameterBag
* @param $callAssignmentParams
*/
private function setResultAgencyReference(ParameterBagInterface $parameterBag, &$callAssignmentParams) {
$reason = $parameterBag->getParameter('result_agency_reference');
if ($reason) {
$reasonCustomField = "custom_" . \Civi::service('aivlgeneric')->getTmCaAgencyReferenceCustomFieldId();
$callAssignmentParams[$reasonCustomField] = $reason;
}
}
/**
* Method to set the result code sdd in call assignment parameters
*
* @param ParameterBagInterface $parameterBag
* @param $callAssignmentParams
*/
private function setResultCodeSdd(ParameterBagInterface $parameterBag, &$callAssignmentParams) {
$reason = $parameterBag->getParameter('result_code_sdd');
if ($reason) {
$reasonCustomField = "custom_" . \Civi::service('aivlgeneric')->getTmCaResultCodeSddCustomFieldId();
$callAssignmentParams[$reasonCustomField] = $reason;
}
}
/**
* Method to set the result agent in call assignment parameters
*
......
......@@ -14,8 +14,8 @@
<url desc="Support">https://civicoop.org</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2022-10-20</releaseDate>
<version>1.23</version>
<releaseDate>2022-10-24</releaseDate>
<version>1.24</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.7</ver>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment