This fixes 1 of 2 notices on the Contact import field mapping screen.
- instead of assigning a variable for show-hide it uses jquery
* @param array $fields
* Posted values of the form.
*
- * @return array
+ * @return array|true
* list of errors to be posted back to the form
*/
public static function formRule($fields) {
if (!empty($fields['saveMapping'])) {
$template->assign('isCheked', TRUE);
}
-
- if (!empty($errors)) {
- $_flag = 1;
- $assignError = new CRM_Core_Page();
- $assignError->assign('mappingDetailsError', $_flag);
- return $errors;
- }
- else {
- return TRUE;
- }
+ return empty($errors) ? TRUE : $errors;
}
/**
</tr>
</table>
</div>
- <script type="text/javascript">
- {if $mappingDetailsError }
- cj('#saveDetails').show();
- {else}
- cj('#saveDetails').hide();
- {/if}
-
{literal}
+ <script type="text/javascript">
+ if (cj('#saveMapping').prop('checked')) {
+ cj('#saveDetails').show();
+ } else {
+ cj('#saveDetails').hide();
+ }
+
function showSaveDetails(chkbox) {
if (chkbox.checked) {
document.getElementById("saveDetails").style.display = "block";