You have a couple of options:
1) Just turn off accounts as being required. Save Case. Add Contact after.
2) Turn off accounts as being required. Add contact field to case edit page only if new case. Save and it adds the contact to the contact list.
Method 2:
In config.php set the following to false to turn off accounts as being required:
'require_accounts' => false,
Add {CONTACT_POPUP} to EditView.html where you want it to popup. It will replace this variable with the label/input columns:
PHP Code:
<tr valign="top">
<td class="dataLabel" valign="top"><slot> </slot></td>
<td class="dataField"><slot> </slot></td>
{CONTACT_POPUP}
</tr>
Add this to your EditView.php:
PHP Code:
if( (!isset($focus->id) || $focus->new_with_id ) && !isset($focus->contact_id)) {
//contact popup...show only if new record to more quickly associate a contact to a case
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'contact_id',
'name' => 'contact_name',
),
);
$encoded_contact_popup_request_data = $json->encode($popup_request_data);
$contact_popup = " <td class='dataLabel'><span sugar='slot90'>Primary Contact:</span sugar='slot'></td> "
." <td class='dataField'><span sugar='slot90b'> "
." <input tabindex='2' readonly id='contact_name' name='contact_name' type='text' value=''> "
." <input id='contact_id' name='contact_id' type='hidden' value='' /> "
." <input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_BUTTON_KEY']."' type='button' tabindex='2' class='button' value='".$app_strings['LBL_SELECT_BUTTON_LABEL']."' name=btn1 "
." onclick='open_popup(\"Contacts\", 600, 400, \"\", true, false, ".$encoded_contact_popup_request_data.");' /></span sugar='slot'></td> ";
} else {
$contact_popup = " <td class='dataLabel'><span sugar='slot98'> </span sugar='slot'></td> "
." <td class='dataField'><span sugar='slot99'> </span sugar='slot'></td> ";
}
$xtpl->assign('CONTACT_POPUP', $contact_popup);
And Bob's your uncle.
Bookmarks