Skip to content
Snippets Groups Projects
Commit c20ca2c8 authored by gitsync's avatar gitsync
Browse files

CRM-13078, js fixes to show correct row icon

----------------------------------------
* CRM-13078: Batch Data Entry silently drops 'batch-valid' entries if no contact_id is associated with them
  http://issues.civicrm.org/jira/browse/CRM-13078
parent eeca4aa5
No related branches found
No related tags found
No related merge requests found
......@@ -183,8 +183,21 @@
var validRow = 0;
var inValidRow = 0;
var errorExists = false;
var rowID = parentRow.closest('div.crm-grid-row').attr('entity_id');
parentRow.find('div .required').each(function(){
if ( !cj(this).val( ) ) {
//special case to handle contact autocomplete select
var fieldId = cj(this).attr('id');
if (fieldId.substring(0, 16) == 'primary_contact_') {
// if display value is set then make sure we also check if contact id is set
if ( !cj(this).val( ) ) {
inValidRow++;
}
else if (cj(this).val( ) && !cj('input[name="primary_contact_select_id[' + rowID + ']"]').val()) {
inValidRow++;
errorExists = true;
}
} else if ( !cj(this).val( ) ) {
inValidRow++;
} else if ( cj(this).hasClass('error') && !cj(this).hasClass('valid') ) {
errorExists = true;
......@@ -193,7 +206,7 @@
}
});
// this means use has entered some data
// this means user has entered some data
if ( errorExists ) {
parentRow.find("div:first span").prop('class', 'batch-invalid');
} else if ( inValidRow == 0 && validRow > 0 ) {
......
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