diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 962d15653e5..a4316343284 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -78,7 +78,7 @@ if ($action == 'setcustomeraccountancycode') $result=$object->update($object->id,$user,1,1,0); if ($result < 0) { - $mesg=join(',',$object->errors); + $mesgs[]=join(',',$object->errors); } $action=""; } @@ -158,11 +158,6 @@ if ($id > 0) dol_print_error($db,$object->error); } - if ($errmesg) - { - print "".$errmesg."
"; - } - /* * Affichage onglets */ @@ -821,6 +816,7 @@ else dol_print_error($db,'Bad value for socid parameter'); } +dol_htmloutput_mesg('',$mesgs); // End of page llxFooter(); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index d866bd1f755..140361265f2 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -389,6 +389,7 @@ function getFormeJuridiqueLabel($code) function show_projects($conf,$langs,$db,$object,$backtopage='') { global $user; + global $bc; $i = -1 ; @@ -517,13 +518,13 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''.$langs->trans("Poste").''.$langs->trans("Tel").''; print ''.$langs->trans("Fax").''.$langs->trans("EMail").''; print " "; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ' '; } print ""; - $sql = "SELECT p.rowid, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note "; + $sql = "SELECT p.rowid, p.name, p.firstname, p.fk_pays, p.poste, p.phone, p.fax, p.email, p.note "; $sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql .= " WHERE p.fk_soc = ".$object->id; $sql .= " ORDER by p.datec"; @@ -552,12 +553,14 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print ''.$obj->poste.''; + $country_code = getCountry($obj->fk_pays, 2); + // Lien click to dial print ''; - print dol_print_phone($obj->phone,$obj->pays_code,$obj->rowid,$object->id,'AC_TEL'); + print dol_print_phone($obj->phone,$country_code,$obj->rowid,$object->id,'AC_TEL'); print ''; print ''; - print dol_print_phone($obj->fax,$obj->pays_code,$obj->rowid,$object->id,'AC_FAX'); + print dol_print_phone($obj->fax,$country_code,$obj->rowid,$object->id,'AC_FAX'); print ''; print ''; print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 012aff5818f..ca9ac156ad9 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -84,20 +84,20 @@ $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->e if (empty($reshook)) { - if ($_POST["getcustomercode"]) + if (GETPOST('getcustomercode')) { // We defined value code_client $_POST["code_client"]="Acompleter"; } - if ($_POST["getsuppliercode"]) + if (GETPOST('getsuppliercode')) { // We defined value code_fournisseur $_POST["code_fournisseur"]="Acompleter"; } // Add new third party - if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) + if ((! GETPOST('getcustomercode') && ! GETPOST('getsuppliercode')) && ($action == 'add' || $action == 'update') && $user->rights->societe->creer) { require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php"); @@ -1444,7 +1444,7 @@ else dol_htmloutput_errors($error,$errors); $showlogo=$object->logo; - $showbarcode=($conf->barcode->enabled && $user->rights->barcode->lire); + $showbarcode=(! empty($conf->barcode->enabled) && $user->rights->barcode->lire); print ''; @@ -1467,9 +1467,9 @@ else // Logo+barcode $rowspan=4; if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++; - if ($object->client) $rowspan++; - if ($conf->fournisseur->enabled && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++; - if ($conf->global->MAIN_MODULE_BARCODE) $rowspan++; + if (! empty($object->client)) $rowspan++; + if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++; + if (! empty($conf->global->MAIN_MODULE_BARCODE)) $rowspan++; if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; $htmllogobar=''; if ($showlogo || $showbarcode) @@ -1502,7 +1502,7 @@ else } // Supplier code - if ($conf->fournisseur->enabled && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) + if (! empty($conf->fournisseur->enabled) && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) { print '
'; print $langs->trans('SupplierCode').''; @@ -1514,7 +1514,7 @@ else } // Barcode - if ($conf->global->MAIN_MODULE_BARCODE) + if (! empty($conf->global->MAIN_MODULE_BARCODE)) { print '
'; print $langs->trans('Gencod').''.$object->barcode;