Merge branch '4.5' of https://github.com/civicrm/civicrm-core into 4.6
[civicrm-core.git] / templates / CRM / Contact / Form / Relationship.tpl
index 9a234f6f0bd176d8cee44d86d4d612e576ab9787..dd77d0b844b521fb2c175db2390528d3a3fe070f 100644 (file)
@@ -1,6 +1,6 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
       {literal}
       CRM.$(function($) {
         var
-          $form = $("form#{/literal}{$form.formName}{literal}"),
+          $form = $("form.{/literal}{$form.formClass}{literal}"),
           relationshipData = {/literal}{$relationshipData|@json_encode}{literal};
         $('[name=relationship_type_id]', $form).change(function() {
           var
               if (contact_sub_type) {
                 api.params.contact_sub_type = contact_sub_type;
               }
-              // Todo: pass sub-type to new contact profile otherwise relationship create will fail. Disabling it completely for now.
-              $contactField.data('create-links', !contact_sub_type);
               $contactField
                 .val('')
                 .prop('disabled', false)
                 .data('api-params', api)
+                .data('user-filter', {})
                 .attr('placeholder', relationshipData[rType]['placeholder_' + target])
                 .change();
             }