diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 4ecfc2a8cf4..1bc64658735 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -31,6 +31,7 @@ * \brief Page of contacts of thirdparties */ +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; @@ -46,7 +47,9 @@ if (!empty($conf->adherent->enabled)) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } +// Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); + if (!empty($conf->categorie->enabled)) { $langs->load("categories"); } @@ -59,18 +62,23 @@ if (!empty($conf->notification->enabled)) { $mesg = ''; $error = 0; $errors = array(); + +// Get parameters $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'); -$cancel = GETPOST('cancel', 'alpha'); +$cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$confirm = GETPOST('confirm'); -$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); +$confirm = GETPOST('confirm'); +$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int'); + if ($user->socid) { $socid = $user->socid; } + if (empty($socid) && $action == 'view') { $action = 'create'; } +// Initialize objects $object = new Societe($db); $extrafields = new ExtraFields($db);