mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
fix phpstan (#30860)
* fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan * fix phpstan
This commit is contained in:
parent
fa104fed0f
commit
eb04c5c427
|
|
@ -983,7 +983,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($prod->customcode)) {
|
||||
|
|
@ -993,7 +993,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
|
||||
}
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
|
|
|
|||
|
|
@ -449,7 +449,7 @@ if ($action == 'create') {
|
|||
} elseif (empty($selectedcode)) {
|
||||
$selectedcode = $mysoc->country_code;
|
||||
}
|
||||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||
$object->country_code = getCountry($selectedcode, '2'); // Force country code on account to have following field on bank fields matching country rules
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("BankAccountCountry").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -991,7 +991,7 @@ if ($action == 'create') {
|
|||
} elseif (empty($selectedcode)) {
|
||||
$selectedcode = $mysoc->country_code;
|
||||
}
|
||||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||
$object->country_code = getCountry($selectedcode, '2'); // Force country code on account to have following field on bank fields matching country rules
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
|
|
|
|||
|
|
@ -635,7 +635,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($prod->customcode)) {
|
||||
|
|
@ -645,7 +645,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
|
||||
}
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
|
|
|
|||
|
|
@ -2374,7 +2374,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $outputlangs, 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($prod->customcode)) {
|
||||
|
|
@ -2384,7 +2384,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin").': '.getCountry($prod->country_code, '', $db, $langs, 0);
|
||||
}
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
|
|
|
|||
|
|
@ -3367,7 +3367,7 @@ class Form
|
|||
}
|
||||
$labeltoshow .= ' - ' . dol_trunc($label, $maxlengtharticle);
|
||||
if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
|
||||
$labeltoshow .= ' (' . getCountry($outorigin, 1) . ')';
|
||||
$labeltoshow .= ' (' . getCountry($outorigin, '1') . ')';
|
||||
}
|
||||
|
||||
// Set $labltoshowhtml
|
||||
|
|
@ -3384,7 +3384,7 @@ class Form
|
|||
}
|
||||
$labeltoshowhtml .= ' - ' . dol_trunc($label, $maxlengtharticle);
|
||||
if ($outorigin && getDolGlobalString('PRODUCT_SHOW_ORIGIN_IN_COMBO')) {
|
||||
$labeltoshowhtml .= ' (' . getCountry($outorigin, 1) . ')';
|
||||
$labeltoshowhtml .= ' (' . getCountry($outorigin, '1') . ')';
|
||||
}
|
||||
|
||||
// Stock
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ function societe_admin_prepare_head()
|
|||
* Return country label, code or id from an id, code or label
|
||||
*
|
||||
* @param int|string $searchkey Id or code of country to search
|
||||
* @param string $withcode '0'=Return label,
|
||||
* @param string $withcode '' or '0' = Return label,
|
||||
* '1'=Return code + label,
|
||||
* '2'=Return code from id,
|
||||
* '3'=Return id from code,
|
||||
|
|
@ -610,11 +610,11 @@ function getCountry($searchkey, $withcode = '', $dbtouse = null, $outputlangs =
|
|||
$label = ($obj->code && ($outputlangs->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code)) ? $outputlangs->transnoentitiesnoconv("Country".$obj->code) : $label;
|
||||
}
|
||||
}
|
||||
if ($withcode == 1) {
|
||||
if ($withcode == '1') {
|
||||
$result = $label ? "$obj->code - $label" : "$obj->code";
|
||||
} elseif ($withcode == 2) {
|
||||
} elseif ($withcode == '2') {
|
||||
$result = $obj->code;
|
||||
} elseif ($withcode == 3) {
|
||||
} elseif ($withcode == '3') {
|
||||
$result = $obj->rowid;
|
||||
} elseif ($withcode === 'all') {
|
||||
$result = array('id' => $obj->rowid, 'code' => $obj->code, 'label' => $label);
|
||||
|
|
@ -1528,7 +1528,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
|
|||
$contactstatic->fk_soc = $obj->fk_soc;
|
||||
$contactstatic->entity = $obj->entity;
|
||||
|
||||
$country_code = getCountry($obj->country_id, 2);
|
||||
$country_code = getCountry($obj->country_id, '2');
|
||||
$contactstatic->country_code = $country_code;
|
||||
|
||||
$contactstatic->setGenderFromCivility();
|
||||
|
|
|
|||
|
|
@ -258,7 +258,7 @@ class pdf_standard_asset extends ModelePDFAsset
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'ASSET',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'INVOICE',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -463,7 +463,7 @@ class pdf_octopus extends ModelePDFFactures
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'INVOICE',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ class pdf_sponge extends ModelePDFFactures
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'INVOICE',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2700,7 +2700,7 @@ class EmailCollector extends CommonObject
|
|||
// Search country by name or code
|
||||
if (!empty($contactstatic->country)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$result = getCountry('', 3, $this->db, null, 1, $contactstatic->country);
|
||||
$result = getCountry('', '3', $this->db, null, 1, $contactstatic->country);
|
||||
if ($result == 'NotDefined') {
|
||||
$errorforactions++;
|
||||
$this->error = "Error country not found by this name '" . $contactstatic->country . "'";
|
||||
|
|
@ -2714,7 +2714,7 @@ class EmailCollector extends CommonObject
|
|||
}
|
||||
} elseif (!empty($contactstatic->country_code)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
|
||||
$result = getCountry($contactstatic->country_code, 3, $this->db);
|
||||
$result = getCountry($contactstatic->country_code, '3', $this->db);
|
||||
if ($result == 'NotDefined') {
|
||||
$errorforactions++;
|
||||
$this->error = "Error country not found by this code '" . $contactstatic->country_code . "'";
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $outputlangs, 0);
|
||||
$tmptxt .= $outputlangs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $outputlangs, 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($prod->customcode)) {
|
||||
|
|
@ -638,7 +638,7 @@ if (empty($reshook)) {
|
|||
$tmptxt .= ' - ';
|
||||
}
|
||||
if (!empty($prod->country_code)) {
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0);
|
||||
$tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, '', $db, $langs, 0);
|
||||
}
|
||||
}
|
||||
$tmptxt .= ')';
|
||||
|
|
|
|||
|
|
@ -409,7 +409,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($object->country_id > 0) {
|
||||
$img = picto_from_langcode($object->country_code);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($object->getCountryCode(), 0, $db);
|
||||
print getCountry($object->getCountryCode(), '', $db);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'MYOBJECT',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2866,7 +2866,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
|||
print '<tr><td>'.$langs->trans("CustomCode").'</td><td>'.$object->customcode.'</td></tr>';
|
||||
|
||||
// Origin country code
|
||||
print '<tr><td>'.$langs->trans("Origin").'</td><td>'.getCountry($object->country_id, 0, $db);
|
||||
print '<tr><td>'.$langs->trans("Origin").'</td><td>'.getCountry($object->country_id, '', $db);
|
||||
if (!empty($object->state_id)) {
|
||||
print ' - '.getState($object->state_id, '0', $db);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2893,7 +2893,7 @@ class Product extends CommonObject
|
|||
|
||||
$this->customcode = $obj->customcode;
|
||||
$this->country_id = $obj->fk_country;
|
||||
$this->country_code = getCountry($this->country_id, 2, $this->db);
|
||||
$this->country_code = getCountry($this->country_id, '2', $this->db);
|
||||
$this->state_id = $obj->fk_state;
|
||||
$this->lifetime = $obj->lifetime;
|
||||
$this->qc_frequency = $obj->qc_frequency;
|
||||
|
|
|
|||
|
|
@ -2147,7 +2147,7 @@ while ($i < $imaxinloop) {
|
|||
}
|
||||
// Country
|
||||
if (!empty($arrayfields['p.fk_country']['checked'])) {
|
||||
print '<td>'.getCountry($obj->fk_country, 0, $db).'</td>';
|
||||
print '<td>'.getCountry($obj->fk_country, '', $db).'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -495,8 +495,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
|
|||
$errmsg .= $thirdparty->error;
|
||||
$errors = array_merge($errors, $thirdparty->errors);
|
||||
} else {
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, '2', $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, '', $db, $langs);
|
||||
|
||||
// Update attendee country to match country of thirdparty
|
||||
$confattendee->fk_soc = $thirdparty->id;
|
||||
|
|
@ -858,20 +858,20 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS
|
|||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
$country_id = GETPOST('country_id');
|
||||
if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id', '', 0, 'minwidth200 widthcentpercentminusx maxwidth300');
|
||||
print '</td></tr>';
|
||||
// State
|
||||
|
|
|
|||
|
|
@ -666,20 +666,20 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR
|
|||
print img_picto('', 'country', 'class="pictofixedwidth paddingright"');
|
||||
$country_id = GETPOSTINT('country_id');
|
||||
if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print '</td></tr>';
|
||||
|
||||
|
|
|
|||
|
|
@ -655,20 +655,20 @@ print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
|||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
$country_id = GETPOSTINT('country_id');
|
||||
if (!$country_id && getDolGlobalString('PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->PARTNERSHIP_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print '</td></tr>';
|
||||
// State
|
||||
|
|
|
|||
|
|
@ -521,20 +521,20 @@ print '</td></tr>';
|
|||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
$country_id = GETPOST('country_id');
|
||||
if (!$country_id && getDolGlobalString('PROJECT_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print '</td></tr>';
|
||||
// State
|
||||
|
|
|
|||
|
|
@ -285,8 +285,8 @@ if (empty($reshook) && $action == 'add') {
|
|||
$errmsg .= $thirdparty->error;
|
||||
$errors = array_merge($errors, $thirdparty->errors);
|
||||
} else {
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, '2', $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, '', $db, $langs);
|
||||
}
|
||||
}
|
||||
// From there we have a thirdparty, now looking for the contact
|
||||
|
|
@ -662,20 +662,20 @@ print '<span class="star">*</span>';
|
|||
print '</td><td>';
|
||||
$country_id = GETPOST('country_id');
|
||||
if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print '</td></tr>';
|
||||
// State
|
||||
|
|
|
|||
|
|
@ -286,8 +286,8 @@ if (empty($reshook) && $action == 'add') {
|
|||
$errmsg .= $thirdparty->error;
|
||||
$errors = array_merge($errors, $thirdparty->errors);
|
||||
} else {
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, 2, $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, 0, $db, $langs);
|
||||
$thirdparty->country_code = getCountry($thirdparty->country_id, '2', $db, $langs);
|
||||
$thirdparty->country = getCountry($thirdparty->country_code, '', $db, $langs);
|
||||
}
|
||||
}
|
||||
// From there we have a thirdparty, now looking for the contact
|
||||
|
|
@ -599,20 +599,20 @@ print '</td></tr>';
|
|||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
$country_id = GETPOST('country_id');
|
||||
if (!$country_id && getDolGlobalString('MEMBER_NEWFORM_FORCECOUNTRYCODE')) {
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
|
||||
$country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, '2', $db, $langs);
|
||||
}
|
||||
if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
|
||||
$country_code = dol_user_country();
|
||||
//print $country_code;
|
||||
if ($country_code) {
|
||||
$new_country_id = getCountry($country_code, 3, $db, $langs);
|
||||
$new_country_id = getCountry($country_code, '3', $db, $langs);
|
||||
//print 'xxx'.$country_code.' - '.$new_country_id;
|
||||
if ($new_country_id) {
|
||||
$country_id = $new_country_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
$country_code = getCountry($country_id, 2, $db, $langs);
|
||||
$country_code = getCountry($country_id, '2', $db, $langs);
|
||||
print $form->select_country($country_id, 'country_id');
|
||||
print '</td></tr>';
|
||||
// State
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
|
|||
if ($cert) {
|
||||
$info = array(
|
||||
'Name' => $this->emetteur->name,
|
||||
'Location' => getCountry($this->emetteur->country_code, 0),
|
||||
'Location' => getCountry($this->emetteur->country_code, ''),
|
||||
'Reason' => 'MYOBJECT',
|
||||
'ContactInfo' => $this->emetteur->email
|
||||
);
|
||||
|
|
|
|||
|
|
@ -4468,8 +4468,8 @@ class Societe extends CommonObject
|
|||
// For backward compatibility
|
||||
dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
$country_code = getCountry($country_id, 2, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$country_label = getCountry($country_id, 0, $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$country_code = getCountry($country_id, '2', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
$country_label = getCountry($country_id, '', $this->db); // This need a SQL request, but it's the old feature that should not be used anymore
|
||||
}
|
||||
}
|
||||
$this->country_id = $country_id;
|
||||
|
|
|
|||
|
|
@ -1284,7 +1284,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($companypaymentmodetemp->country_code) {
|
||||
$img = picto_from_langcode($companypaymentmodetemp->country_code);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($companypaymentmodetemp->country_code, 1);
|
||||
print getCountry($companypaymentmodetemp->country_code, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
@ -1391,7 +1391,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($src->country) {
|
||||
$img = picto_from_langcode($src->country);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($src->country, 1);
|
||||
print getCountry($src->country, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
@ -1402,7 +1402,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($src->card->country) {
|
||||
$img = picto_from_langcode($src->card->country);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($src->card->country, 1);
|
||||
print getCountry($src->card->country, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
@ -1412,7 +1412,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($src->sepa_debit->country) {
|
||||
$img = picto_from_langcode($src->sepa_debit->country);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($src->sepa_debit->country, 1);
|
||||
print getCountry($src->sepa_debit->country, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
@ -1423,7 +1423,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($src->card->country) {
|
||||
$img = picto_from_langcode($src->card->country);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($src->card->country, 1);
|
||||
print getCountry($src->card->country, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
@ -1433,7 +1433,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
|
|||
if ($src->sepa_debit->country) {
|
||||
$img = picto_from_langcode($src->sepa_debit->country);
|
||||
print $img ? $img.' ' : '';
|
||||
print getCountry($src->sepa_debit->country, 1);
|
||||
print getCountry($src->sepa_debit->country, '1');
|
||||
} else {
|
||||
print img_warning().' <span class="error">'.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).'</span>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -939,7 +939,7 @@ if ($id && ($action == 'edit' || $action == 'create') && $permissiontoaddbankacc
|
|||
} elseif (empty($selectedcode)) {
|
||||
$selectedcode = $mysoc->country_code;
|
||||
}
|
||||
$account->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||
$account->country_code = getCountry($selectedcode, '2'); // Force country code on account to have following field on bank fields matching country rules
|
||||
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Country").'</td>';
|
||||
print '<td class="maxwidth200onsmartphone">';
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ function updateContact($authentication, $contact)
|
|||
|
||||
$object->country_id = $contact['country_id'];
|
||||
if ($contact['country_code']) {
|
||||
$object->country_id = getCountry($contact['country_code'], 3);
|
||||
$object->country_id = getCountry($contact['country_code'], '3');
|
||||
}
|
||||
$object->province_id = $contact['province_id'];
|
||||
|
||||
|
|
|
|||
|
|
@ -572,7 +572,7 @@ function createProductOrService($authentication, $product)
|
|||
|
||||
$newobject->country_id = isset($product['country_id']) ? $product['country_id'] : 0;
|
||||
if (!empty($product['country_code'])) {
|
||||
$newobject->country_id = getCountry($product['country_code'], 3);
|
||||
$newobject->country_id = getCountry($product['country_code'], '3');
|
||||
}
|
||||
$newobject->customcode = isset($product['customcode']) ? $product['customcode'] : '';
|
||||
|
||||
|
|
@ -742,7 +742,7 @@ function updateProductOrService($authentication, $product)
|
|||
|
||||
$newobject->country_id = isset($product['country_id']) ? $product['country_id'] : 0;
|
||||
if (!empty($product['country_code'])) {
|
||||
$newobject->country_id = getCountry($product['country_code'], 3);
|
||||
$newobject->country_id = getCountry($product['country_code'], '3');
|
||||
}
|
||||
$newobject->customcode = isset($product['customcode']) ? $product['customcode'] : '';
|
||||
|
||||
|
|
|
|||
|
|
@ -487,10 +487,10 @@ function createThirdParty($authentication, $thirdparty)
|
|||
|
||||
$newobject->country_id = $thirdparty['country_id'];
|
||||
if ($thirdparty['country_code']) {
|
||||
$newobject->country_id = getCountry($thirdparty['country_code'], 3);
|
||||
$newobject->country_id = getCountry($thirdparty['country_code'], '3');
|
||||
}
|
||||
$newobject->region_code = empty($thirdparty['region_code']) ? '' : $thirdparty['region_code'];
|
||||
//if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3);
|
||||
//if ($thirdparty['province_code']) $newobject->province_code = getCountry($thirdparty['province_code'], '3');
|
||||
|
||||
$newobject->phone = $thirdparty['phone'];
|
||||
$newobject->fax = $thirdparty['fax'];
|
||||
|
|
@ -626,10 +626,10 @@ function updateThirdParty($authentication, $thirdparty)
|
|||
|
||||
$object->country_id = $thirdparty['country_id'];
|
||||
if ($thirdparty['country_code']) {
|
||||
$object->country_id = getCountry($thirdparty['country_code'], 3);
|
||||
$object->country_id = getCountry($thirdparty['country_code'], '3');
|
||||
}
|
||||
$object->region_code = $thirdparty['region_code'];
|
||||
//if ($thirdparty['province_code']) $newobject->province_code=getCountry($thirdparty['province_code'],3);
|
||||
//if ($thirdparty['province_code']) $newobject->province_code = getCountry($thirdparty['province_code'], '3');
|
||||
|
||||
$object->phone = $thirdparty['phone'];
|
||||
$object->fax = $thirdparty['fax'];
|
||||
|
|
|
|||
|
|
@ -78,7 +78,6 @@ parameters:
|
|||
- '#\(\) expects int, string#'
|
||||
- '#run_sql expects int, string#'
|
||||
- '#on array{url: mixed} in empty\(\) does not exist.#'
|
||||
- '#getCountry expects string, int given#'
|
||||
- '#dolCopyDir expects string, int given#'
|
||||
- '#dol_copy expects string, int given#'
|
||||
- '#info_admin expects string, int given#'
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user