From: Thomas Heck Date: Wed, 8 Jan 2014 08:43:42 +0000 (+0100) Subject: Beim Anlegen von neuen Ansprechpersonen: CVars-Standardwert anzeigen X-Git-Tag: release-3.1.0beta1~22^2~22^2~19^2~7 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a56b873b4586c6b7142a776e1bdfff26bfbb4f59;p=kivitendo-erp.git Beim Anlegen von neuen Ansprechpersonen: CVars-Standardwert anzeigen fixt #2422 --- diff --git a/js/kivi.CustomerVendor.js b/js/kivi.CustomerVendor.js index c51a2aad5..59c07354e 100644 --- a/js/kivi.CustomerVendor.js +++ b/js/kivi.CustomerVendor.js @@ -44,32 +44,25 @@ namespace('kivi.CustomerVendor', function(ns) { this.selectContact = function(params) { var contactId = $('#contact_cp_id').val(); - if( contactId ) { - var url = 'controller.pl?action=CustomerVendor/ajaj_get_contact&id='+ $('#cv_id').val() +'&db='+ $('#db').val() +'&contact_id='+ contactId; + var url = 'controller.pl?action=CustomerVendor/ajaj_get_contact&id='+ $('#cv_id').val() +'&db='+ $('#db').val() +'&contact_id='+ contactId; - $.getJSON(url, function(data) { - var contact = data.contact; - for(var key in contact) - $(document.getElementById('contact_'+ key)).val(contact[key]) + $.getJSON(url, function(data) { + var contact = data.contact; + for(var key in contact) + $(document.getElementById('contact_'+ key)).val(contact[key]) - var cvars = data.contact_cvars; - for(var key in cvars) - $(document.getElementById('contact_cvars_'+ key)).val(cvars[key]); + var cvars = data.contact_cvars; + for(var key in cvars) + $(document.getElementById('contact_cvars_'+ key)).val(cvars[key]); + if ( contactId ) $('#action_delete_contact').show(); + else + $('#action_delete_contact').hide(); - if( params.onFormSet ) - params.onFormSet(); - }); - } - else { - $('#contacts :input').not(':button, :submit, :reset, :hidden').val('').removeAttr('checked').removeAttr('selected'); - - $('#action_delete_contact').hide(); - - if( params.onFormSet ) + if ( params.onFormSet ) params.onFormSet(); - } + }); $('#contact_cp_title_select, #contact_cp_abteilung_select').val(''); };