Commit 92c7b469 authored by ErikHommel's avatar ErikHommel
Browse files

remove email and pdf from participation case options

parent f5d49c6a
......@@ -10,6 +10,26 @@ use CRM_Nbrprojectvolunteerlist_ExtensionUtil as E;
* @license AGPL-3.0
*/
class CRM_Nbrprojectvolunteerlist_NbrParticipation {
/**
* Method to process the build form hook for caseview
* - when participation, remove email and pdf actions from list
*
* @param $form
*/
public function caseViewBuildForm(&$form) {
$caseId = $form->getVar('_caseID');
$participationType = Civi::service('nbrBackbone')->getParticipationCaseTypeName();
$caseType = $form->getVar('_caseType');
if ($caseType == $participationType) {
$activityList = $form->getElement('add_activity_type_id');
$options = &$activityList->_options;
foreach($options as $optionKey => $optionValues) {
if ($optionValues['text'] == "Email" || $optionValues['text'] == "Print/Merge Document") {
unset($options[$optionKey]);
}
}
}
}
/**
* Method to process the build form hook for email
......
......@@ -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>2020-12-09</releaseDate>
<version>1.27</version>
<releaseDate>2020-12-15</releaseDate>
<version>1.28</version>
<develStage>beta</develStage>
<compatibility>
<ver>4.7</ver>
......
......@@ -42,6 +42,10 @@ function nbrprojectvolunteerlist_civicrm_buildForm($formName, &$form) { # jb2
$nbrParticipation = new CRM_Nbrprojectvolunteerlist_NbrParticipation();
$nbrParticipation->pdfInviteBuildForm($form);
}
if ($form instanceof CRM_Case_Form_CaseView) {
$nbrParticipation = new CRM_Nbrprojectvolunteerlist_NbrParticipation();
$nbrParticipation->caseViewBuildForm($form);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment