Fix: set of country
This commit is contained in:
parent
8801d7a1eb
commit
9bc0f54ae8
@ -404,7 +404,7 @@ class Societe extends CommonObject
|
||||
$this->zip = $this->zip?trim($this->zip):trim($this->zip);
|
||||
$this->town = $this->town?trim($this->town):trim($this->town);
|
||||
$this->state_id = trim($this->state_id);
|
||||
$this->country_id = ($this->country_id > 0)?$this->country_id:$this->country_id;
|
||||
$this->country_id = ($this->country_id > 0)?$this->country_id:0;
|
||||
$this->phone = trim($this->phone?$this->phone:$this->tel);
|
||||
$this->phone = preg_replace("/\s/","",$this->phone);
|
||||
$this->phone = preg_replace("/\./","",$this->phone);
|
||||
|
||||
@ -174,6 +174,7 @@ if (empty($reshook))
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
|
||||
|
||||
if (GETPOST('deletephoto')) $object->logo = '';
|
||||
else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
|
||||
|
||||
@ -200,7 +201,7 @@ if (empty($reshook))
|
||||
}
|
||||
|
||||
// We set country_id, country_code and country for the selected country
|
||||
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
|
||||
$object->country_id=GETPOST('country_id')!=''?GETPOST('country_id'):$mysoc->country_id;
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
@ -824,7 +825,7 @@ else
|
||||
|
||||
// Country
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $form->select_country($object->country_id,'country_id');
|
||||
print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1205,7 +1206,7 @@ else
|
||||
print '<input type="text" name="code_fournisseur" size="16" value="'.$object->code_fournisseur.'" maxlength="15">';
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
print $object->code_fournisseur;
|
||||
print '<input type="hidden" name="code_fournisseur" value="'.$object->code_fournisseur.'">';
|
||||
}
|
||||
@ -1243,7 +1244,7 @@ else
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td colspan="3">';
|
||||
print $form->select_country($object->country_id,'country_id');
|
||||
print $form->select_country((GETPOST('country_id')!=''?GETPOST('country_id'):$object->country_id),'country_id');
|
||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1548,9 +1549,12 @@ else
|
||||
|
||||
// Country
|
||||
print '<tr><td>'.$langs->trans("Country").'</td><td colspan="'.(2+(($showlogo || $showbarcode)?0:1)).'" class="nowrap">';
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
if ($object->country_code)
|
||||
{
|
||||
$img=picto_from_langcode($object->country_code);
|
||||
if ($object->isInEEC()) print $form->textwithpicto(($img?$img.' ':'').$object->country,$langs->trans("CountryIsInEEC"),1,0);
|
||||
else print ($img?$img.' ':'').$object->country;
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// State
|
||||
|
||||
Loading…
Reference in New Issue
Block a user