Skip to content
Snippets Groups Projects
Commit c0f22ac4 authored by Maxime Kohlhaas's avatar Maxime Kohlhaas
Browse files

Task # 355 : autofill contat address with third party address

parent 2ac91cbc
No related branches found
No related tags found
No related merge requests found
......@@ -377,13 +377,20 @@ else
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print 'jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="create";
document.formsoc.submit();
});
})';
$("#copyaddressfromsoc").click(function() {
$(\'textarea[name="address"]\').text("'.addslashes($objsoc->address).'");
$(\'input[name="zipcode"]\').val("'.addslashes($objsoc->zip).'");
$(\'input[name="town"]\').val("'.addslashes($objsoc->town).'");
$(\'select[name="country_id"]\').val("'.addslashes($objsoc->country_id).'");
});
})'."\n";
print '</script>'."\n";
}
......@@ -426,7 +433,9 @@ else
// Address
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) $object->address = $objsoc->address; // Predefined with third party
print '<tr><td>'.$langs->trans("Address").'</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
print '<tr><td>'.$langs->trans("Address");
if ($conf->use_javascript_ajax) print '<br /><a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a></td>';
print '<td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
// Zip / Town
if (($objsoc->typent_code == 'TE_PRIVATE' || ! empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) $object->zip = $objsoc->zip; // Predefined with third party
......
......@@ -77,6 +77,7 @@ Poste= Position
DefaultLang=Language by default
VATIsUsed=VAT is used
VATIsNotUsed=VAT is not used
CopyAddressFromSoc=Copier l'adresse de la société
##### Local Taxes #####
LocalTax1IsUsedES= RE is used
LocalTax1IsNotUsedES= RE is not used
......
......@@ -79,6 +79,7 @@ Poste= Poste
DefaultLang=Langue par défaut
VATIsUsed=Assujetti à TVA
VATIsNotUsed=Non assujetti à TVA
CopyAddressFromSoc=Copier l'adresse de la société
##### Local Taxes #####
LocalTax1IsUsedES= Assujetti à RE
LocalTax1IsNotUsedES= Non assujetti à RE
......
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