Merge pull request #422 from atm-maxime/develop
Task # 355 : corrections
This commit is contained in:
commit
9f042c9d78
@ -377,12 +377,12 @@ else
|
|||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
||||||
print 'jQuery(document).ready(function () {
|
print 'jQuery(document).ready(function () {
|
||||||
jQuery("#selectcountry_id").change(function() {
|
jQuery("#selectcountry_id").change(function() {
|
||||||
document.formsoc.action.value="create";
|
document.formsoc.action.value="create";
|
||||||
document.formsoc.submit();
|
document.formsoc.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#copyaddressfromsoc").click(function() {
|
$("#copyaddressfromsoc").click(function() {
|
||||||
$(\'textarea[name="address"]\').text("'.addslashes($objsoc->address).'");
|
$(\'textarea[name="address"]\').text("'.addslashes($objsoc->address).'");
|
||||||
@ -391,7 +391,7 @@ else
|
|||||||
$(\'select[name="country_id"]\').val("'.addslashes($objsoc->country_id).'");
|
$(\'select[name="country_id"]\').val("'.addslashes($objsoc->country_id).'");
|
||||||
});
|
});
|
||||||
})'."\n";
|
})'."\n";
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -434,8 +434,8 @@ else
|
|||||||
// Address
|
// 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
|
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");
|
print '<tr><td>'.$langs->trans("Address");
|
||||||
if ($conf->use_javascript_ajax) print '<br /><a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a></td>';
|
if ($conf->use_javascript_ajax) print '<br /><a href="#" id="copyaddressfromsoc">'.$langs->trans('CopyAddressFromSoc').'</a>';
|
||||||
print '<td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
print '</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
||||||
|
|
||||||
// Zip / Town
|
// 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
|
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
|
||||||
@ -577,19 +577,29 @@ else
|
|||||||
$object->country = $tmparray['label'];
|
$object->country = $tmparray['label'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$objsoc = new Societe($db);
|
||||||
|
$objsoc->fetch($object->socid);
|
||||||
|
|
||||||
// Affiche les erreurs
|
// Affiche les erreurs
|
||||||
dol_htmloutput_errors($error,$errors);
|
dol_htmloutput_errors($error,$errors);
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<script type="text/javascript" language="javascript">';
|
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
||||||
print 'jQuery(document).ready(function () {
|
print 'jQuery(document).ready(function () {
|
||||||
jQuery("#selectcountry_id").change(function() {
|
jQuery("#selectcountry_id").change(function() {
|
||||||
document.formsoc.action.value="edit";
|
document.formsoc.action.value="edit";
|
||||||
document.formsoc.submit();
|
document.formsoc.submit();
|
||||||
});
|
});
|
||||||
})';
|
|
||||||
print '</script>';
|
$("#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";
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" name="formsoc">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" name="formsoc">';
|
||||||
@ -630,7 +640,9 @@ else
|
|||||||
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
print '<tr><td>'.$langs->trans("PostOrFunction").'</td><td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="'.(isset($_POST["poste"])?$_POST["poste"]:$object->poste).'"></td></tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
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>';
|
||||||
|
print '</td><td colspan="3"><textarea class="flat" name="address" cols="70">'.(isset($_POST["address"])?$_POST["address"]:$object->address).'</textarea></td>';
|
||||||
|
|
||||||
// Zip / Town
|
// Zip / Town
|
||||||
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td colspan="3">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user