apps/communications/contacts/js/fb/fb_link.js
// Builds the first query for finding a contact to be linked to
Builds the first query for finding a contact to be linked to
Builds the first query for finding a contact to be linked to
function buildQuery(contact) {
      var filter = [];
      if (contact.tel && contact.tel.length > 0) {
        contact.tel.forEach(function(tel) {
          CELL_COND[2] = tel.value.trim();
          filter.push(CELL_COND.join(''));
          filter.push(' OR ');
        });
      }
      if (contact.email && contact.email.length > 0) {
        contact.email.forEach(function(email) {
          MAIL_COND[2] = email.value.trim();
          filter.push(MAIL_COND.join(''));
          filter.push(' OR ');
        });
      }
      if (filter.length > 0) {
        filter[filter.length - 1] = null;
      }
      var filterStr = filter.join('');
      var out;
      if (filterStr) {
        SEARCH_QUERY[3] = filterStr;
        out = SEARCH_QUERY.join('');
      }
      else {
        out = null;
      }
      return out;
    }
function buildQuery ( contact ) { var filter = [ ] ; if ( contact . tel && contact . tel . length > 0 ) { contact . tel . forEach ( function ( tel ) { CELL_COND [ 2 ] = tel . value . trim ( ) ; filter . push ( CELL_COND . join ( '' ) ) ; filter . push ( ' OR ' ) ; } ) ; } if ( contact . email && contact . email . length > 0 ) { contact . email . forEach ( function ( email ) { MAIL_COND [ 2 ] = email . value . trim ( ) ; filter . push ( MAIL_COND . join ( '' ) ) ; filter . push ( ' OR ' ) ; } ) ; } if ( filter . length > 0 ) { filter [ filter . length - 1 ] = null ; } var filterStr = filter . join ( '' ) ; var out ; if ( filterStr ) { SEARCH_QUERY [ 3 ] = filterStr ; out = SEARCH_QUERY . join ( '' ) ; } else { out = null ; } return out ; }
Builds the first query for finding a contact to be linked to
Builds the first query for finding a contact to be linked to
// Remove the last OR