I'd like to change the form that opens when adding an Activity to a Case (depending on activity type). Specifically, I'd like to add a field.
I tried finding the fields I want to change in sites/all/modules/civicrm/CRM/Case/Form/Activity.php but couldn't find them. It seems like the buildQuickForm() function is only creating some of the visible fields but not all.
I also thought about writing an extension based on the hook_civicrm_buildForm function. I want to start checking if $formName == 'CRM_Case_Form_Activity'
but after that I don't really know where to start. Can anyone give me a hint?
Edit: I found an extension changing the same location looking like this (How can I set "Assigned To" for an Activity to default to the logged-in user name?):
function myextension_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Activity_Form_Activity' && $form->getAction() == CRM_Core_Action::ADD) {
$form->setDefaults(array('assignee_contact_id' => $form->_currentUserId));
}
}
Is there anything like $form->addField
or something?