Merge pull request #4757 from davecivicrm/CRM-15409
[civicrm-core.git] / js / model / crm.uf.js
index 392d0a44141cd4e1c44823eb452f8dfd6dae2936..be089b1a321ec2820fe6ec15d284aca96455b239 100644 (file)
       case 'Case':
         return 'case_1';
       default:
-        throw "Cannot guess entity name for field_type=" + field_type;
+        if (!$.isEmptyObject(CRM.contactSubTypes) && ($.inArray(field_type,CRM.contactSubTypes) > -1)) {
+          return 'contact_1';
+        }
+        else {
+          throw "Cannot guess entity name for field_type=" + field_type;
+        }
     }
   }
 
         type: 'TextArea'
       },
       'help_pre': {
-        title: ts('Pre-form Help '),
+        title: ts('Pre-form Help'),
         help: ts('Explanatory text displayed at the beginning of the form.')
           + ts('Note that this help text is displayed on profile create/edit screens only.'),
         type: 'TextArea'
         options: YESNO
       },
       'is_proximity_search': {
-        title: ts('Proximity search'),
+        title: ts('Proximity Search'),
         help: ts('FIXME'),
         type: 'Select',
         options: YESNO // FIXME
      * @return {Boolean}
      */
     //CRM-15427
-    checkGroupType: function(validTypesExpr, allowAllSubtypes = false) {
+    checkGroupType: function(validTypesExpr, allowAllSubtypes) {
       var allMatched = true;
+      allowAllSubtypes = allowAllSubtypes || false;
       if (! this.get('group_type') || this.get('group_type') == '') {
         return true;
       }