';
print '| ' . $langs->trans('NotePrivate') . ' | ';
print '';
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index 99a1c85902a..649c24408a1 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -35,10 +35,10 @@ $langs->load("companies");
llxHeader();
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$sortfield = GETPOST("sortfield", 'alpha');
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index cef40f089e1..310f0fc065f 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -95,7 +95,7 @@ if ($id > 0 || ! empty($ref))
// Security check
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', $isdraft);
@@ -2786,7 +2786,7 @@ else
}
print ' | ' . price($sign * $objp->amount) . ' | ';
print '';
- if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
+ if ($object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0)
{
print 'id.'&action=deletepaiement&paiement_id='.$objp->rowid.'">';
print img_delete();
@@ -3089,13 +3089,13 @@ else
}
// Make payments
- if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'confirm_edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
+ if ($object->type != FactureFournisseur::TYPE_CREDIT_NOTE && $action != 'confirm_edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0)
{
print ''; // must use facid because id is for payment id not invoice
}
// Classify paid
- if ($action != 'confirm_edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->societe_id == 0)
+ if ($action != 'confirm_edit' && $object->statut == FactureFournisseur::STATUS_VALIDATED && $object->paye == 0 && $user->socid == 0)
{
print '';
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index 2d2f9006632..18f64d15734 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -41,7 +41,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index d8cf1ecda27..087325e3de0 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -46,7 +46,7 @@ $confirm=GETPOST('confirm', 'alpha');
$ref = GETPOST('ref', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
// Get parameters
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 78abccdc250..0a10d58764a 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -39,10 +39,10 @@ $socid=GETPOST('socid', 'int');
$option = GETPOST('option');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$sortfield = GETPOST("sortfield", 'alpha');
diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php
index 6b4af5dd290..8f10fd94dc4 100644
--- a/htdocs/fourn/facture/info.php
+++ b/htdocs/fourn/facture/info.php
@@ -40,7 +40,7 @@ $id = GETPOST("facid", 'int')?GETPOST("facid", 'int'):GETPOST("id", 'int');
$ref = GETPOST("ref", 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 7c8a78cf8ce..b13e283ea65 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -60,11 +60,11 @@ $contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'supplier
$socid = GETPOST('socid', 'int');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action='';
$_GET["action"] = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$mode=GETPOST("mode");
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index 03a4dda960e..a7200495e96 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -40,7 +40,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$object = new FactureFournisseur($db);
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 38136aa3b64..1dc10406a24 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -78,9 +78,9 @@ $multicurrency_amounts=array();
$multicurrency_amountsresttopay=array();
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$object = new PaiementFourn($db);
diff --git a/htdocs/fourn/facture/rapport.php b/htdocs/fourn/facture/rapport.php
index 94ef53f2372..59ad242fa05 100644
--- a/htdocs/fourn/facture/rapport.php
+++ b/htdocs/fourn/facture/rapport.php
@@ -30,16 +30,16 @@ $langs->loadLangs(array('bills'));
// Security check
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture');
$action=GETPOST('action', 'aZ09');
$socid=0;
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$dir = $conf->fournisseur->facture->dir_output.'/payments';
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index a7107f0a5c8..3615051fa2f 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -32,7 +32,7 @@ $langs->loadLangs(array("suppliers", "orders", "companies"));
// Security check
$socid = GETPOST("socid", 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '');
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 1d8f72d94a3..3977c6ad4be 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -342,7 +342,7 @@ if ($result > 0)
print ' ';
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{
- if ($user->societe_id == 0 && $object->statut == 0 && $action == '')
+ if ($user->socid == 0 && $object->statut == 0 && $action == '')
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->facture->creer))
|| (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate)))
@@ -351,7 +351,7 @@ if ($result > 0)
}
}
}
- if ($user->societe_id == 0 && $action == '')
+ if ($user->socid == 0 && $action == '')
{
if ($user->rights->fournisseur->facture->supprimer)
{
diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php
index b7119e3ae67..860cbde73ba 100644
--- a/htdocs/fourn/product/list.php
+++ b/htdocs/fourn/product/list.php
@@ -54,7 +54,7 @@ if (! $sortfield) $sortfield="p.ref"; // Set here default search field
if (! $sortorder) $sortorder="ASC";
$fourn_id = GETPOST('fourn_id', 'intcomma');
-if ($user->societe_id) $fourn_id=$user->societe_id;
+if ($user->socid) $fourn_id=$user->socid;
$catid = GETPOST('catid', 'intcomma');
diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php
index deee321187b..7f9a7fb11ab 100644
--- a/htdocs/fourn/recap-fourn.php
+++ b/htdocs/fourn/recap-fourn.php
@@ -32,10 +32,10 @@ $langs->loadLangs(array('bills', 'companies'));
// Security check
$socid = GETPOST("socid", 'int');
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
@@ -62,7 +62,7 @@ if ($socid > 0)
$head = societe_prepare_head($societe);
dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"), 0, 'company');
- dol_banner_tab($societe, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($societe, 'socid', '', ($user->socid?0:1), 'rowid', 'nom');
dol_fiche_end();
if (! empty($conf->fournisseur->enabled) && $user->rights->facture->lire)
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 32d8ed44bb4..354fa5c0921 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
$langs->loadLangs(array('ftp', 'companies', 'other'));
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'ftp', '');
// Get parameters
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 530bb125241..1fedae6a61e 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -90,7 +90,7 @@ if (! empty($user->rights->holiday->delete)) $candelete=1;
if ($object->statut == Holiday::STATUS_DRAFT && $user->rights->holiday->write && in_array($object->fk_user, $childids)) $candelete=1;
// Protection if external user
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'holiday', $object->id, 'holiday');
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index e71993a97fd..f18cad2a266 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -2172,7 +2172,7 @@ class Holiday extends CommonObject
// phpcs:enable
global $conf, $langs;
- if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
+ if ($user->socid) return -1; // protection pour eviter appel par utilisateur externe
$now=dol_now();
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index c5ab5e0e5ec..3419d663e30 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -53,7 +53,7 @@ if (! $sortorder) $sortorder="ASC";
// Protection if external user
-if ($user->societe_id > 0) accessforbidden();
+if ($user->socid > 0) accessforbidden();
// If the user does not have perm to read the page
if (!$user->rights->holiday->read) accessforbidden();
diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php
index 02e29774e93..bbf6cac4c87 100644
--- a/htdocs/holiday/document.php
+++ b/htdocs/holiday/document.php
@@ -45,7 +45,7 @@ $action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'holiday', $id, 'holiday');
// Get parameters
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index 7666335d2f0..8b30c03a1a9 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
$langs->loadLangs(array('users', 'holiday', 'hrm'));
// Protection if external user
-if ($user->societe_id > 0) accessforbidden();
+if ($user->socid > 0) accessforbidden();
$action = GETPOST('action', 'aZ09'); // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
@@ -59,9 +59,9 @@ $childids = $user->getAllChildIds(1);
// Security check
$socid=0;
-if ($user->societe_id > 0) // Protection if external user
+if ($user->socid > 0) // Protection if external user
{
- //$socid = $user->societe_id;
+ //$socid = $user->socid;
accessforbidden();
}
$result = restrictedArea($user, 'holiday', '', '');
diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php
index 1d490cc8da3..c09771e47a3 100644
--- a/htdocs/holiday/month_report.php
+++ b/htdocs/holiday/month_report.php
@@ -35,9 +35,9 @@ $langs->loadLangs(array("holiday"));
// Security check
$socid=0;
-if ($user->societe_id > 0) // Protection if external user
+if ($user->socid > 0) // Protection if external user
{
- //$socid = $user->societe_id;
+ //$socid = $user->socid;
accessforbidden();
}
$result = restrictedArea($user, 'holiday', $id, '');
diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php
index 13d4cb7d23a..9e5f0ad0cba 100644
--- a/htdocs/holiday/view_log.php
+++ b/htdocs/holiday/view_log.php
@@ -60,7 +60,7 @@ $pagenext = $page + 1;
// Protection if external user
-if ($user->societe_id > 0) accessforbidden();
+if ($user->socid > 0) accessforbidden();
// Si l'utilisateur n'a pas le droit de lire cette page
if(!$user->rights->holiday->read_all) accessforbidden();
diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php
index 9fa758f8338..5f390ab1d45 100644
--- a/htdocs/hrm/index.php
+++ b/htdocs/hrm/index.php
@@ -46,7 +46,7 @@ $langs->loadLangs(array('users', 'holidays', 'trips', 'boxes'));
$socid=GETPOST("socid", "int");
// Protection if external user
-if ($user->societe_id > 0) accessforbidden();
+if ($user->socid > 0) accessforbidden();
if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1;
@@ -180,7 +180,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$sql.= " WHERE u.rowid = x.fk_user";
$sql.= " AND x.entity = ".$conf->entity;
if (empty($user->rights->holiday->read_all)) $sql.=' AND x.fk_user IN ('.join(',', $childids).')';
- //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
//if (!empty($socid)) $sql.= " AND x.fk_soc = ".$socid;
$sql.= $db->order("x.tms", "DESC");
$sql.= $db->plimit($max, 0);
@@ -259,11 +259,11 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
{
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.login, u.email, u.statut, u.photo, x.rowid, x.ref, x.date_debut as date, x.tms as dm, x.total_ttc, x.fk_statut as status";
$sql.= " FROM ".MAIN_DB_PREFIX."expensereport as x, ".MAIN_DB_PREFIX."user as u";
- //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
+ //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE u.rowid = x.fk_user_author";
$sql.= " AND x.entity = ".$conf->entity;
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)) $sql.=' AND x.fk_user_author IN ('.join(',', $childids).')';
- //if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
+ //if (!$user->rights->societe->client->voir && !$user->socid) $sql.= " AND x.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
//if (!empty($socid)) $sql.= " AND x.fk_soc = ".$socid;
$sql.= $db->order("x.tms", "DESC");
$sql.= $db->plimit($max, 0);
diff --git a/htdocs/imports/index.php b/htdocs/imports/index.php
index f674daddddc..2ce0139f517 100644
--- a/htdocs/imports/index.php
+++ b/htdocs/imports/index.php
@@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/imports/class/import.class.php';
// Load translation files required by the page
$langs->load("exports");
-if (! $user->societe_id == 0)
+if (! $user->socid == 0)
accessforbidden();
$import=new Import($db);
diff --git a/htdocs/index.php b/htdocs/index.php
index 504f77d113e..37ea818817a 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -115,7 +115,7 @@ $boxstatFromHook = '';
// Load translation files required by page
$langs->loadLangs(array('commercial', 'bills', 'orders', 'contracts'));
-if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
+if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{
$object=new stdClass();
$parameters=array();
@@ -437,7 +437,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
// Number of transactions to conciliate
- if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id) {
+ if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid) {
include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php';
$board = new Account($db);
$nb = $board::countAccountToReconcile(); // Get nb of account to reconciliate
@@ -447,14 +447,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
}
// Number of cheque to send
- if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->societe_id && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
+ if (!empty($conf->banque->enabled) && $user->rights->banque->lire && !$user->socid && empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php';
$board = new RemiseCheque($db);
$dashboardlines['RemiseCheque'] = $board->load_board($user);
}
// Number of foundation members
- if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->societe_id) {
+ if (!empty($conf->adherent->enabled) && $user->rights->adherent->lire && !$user->socid) {
include_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php';
$board = new Adherent($db);
$dashboardlines['Adherent'] = $board->load_board($user);
@@ -887,7 +887,7 @@ $boxlist.=$resultboxes['boxlista'];
$boxlist.= ' ';
-if (empty($user->societe_id) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
+if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
{
// Remove allready present info in new dash board
if(!empty($conf->global->MAIN_INCLUDE_GLOBAL_STATS_IN_OPENED_DASHBOARD) && is_array($boxstatItems) && count($boxstatItems) > 0){
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 2da7bd3fae6..3f6c6b493b1 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -56,7 +56,7 @@ $backtopage=GETPOST('backtopage', 'alpha');
// Security check
$id = GETPOST('id', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'expedition', $id, 'livraison', 'livraison');
$object = new Livraison($db);
@@ -706,7 +706,7 @@ else
* Boutons actions
*/
- if ($user->societe_id == 0)
+ if ($user->socid == 0)
{
print '';
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 066399320d8..7cf592a354c 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -44,7 +44,7 @@ $projectid = GETPOST('projectid', 'int');
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'loan', $id, '', '');
$object = new Loan($db);
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 0cbcec2f209..a4bed07949e 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -40,7 +40,7 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'loan', $id, '', '');
// Get parameters
diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php
index b4fb8851ad0..618345518ed 100644
--- a/htdocs/loan/info.php
+++ b/htdocs/loan/info.php
@@ -38,7 +38,7 @@ $action=GETPOST('action', 'aZ09');
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'loan', $id, '', '');
diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php
index 7af7d55fb43..c77d6b1c855 100644
--- a/htdocs/loan/list.php
+++ b/htdocs/loan/list.php
@@ -32,7 +32,7 @@ $langs->loadLangs(array("loan","compta","banks","bills"));
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'loan', '', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php
index 29b9df4bf70..1f937e6fe77 100644
--- a/htdocs/loan/payment/card.php
+++ b/htdocs/loan/payment/card.php
@@ -33,7 +33,7 @@ $langs->loadLangs(array("bills","banks","companies","loan"));
$id=GETPOST("id", 'int');
$action=GETPOST('action', 'aZ09');
$confirm=GETPOST('confirm');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
// TODO ajouter regle pour restreindre acces paiement
//$result = restrictedArea($user, 'facture', $id,'');
@@ -271,7 +271,7 @@ print ' ';
/*
if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{
- if ($user->societe_id == 0 && $payment->statut == 0 && $_GET['action'] == '')
+ if ($user->socid == 0 && $payment->statut == 0 && $_GET['action'] == '')
{
if ($user->rights->facture->paiement)
{
diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php
index 6742b0b1c04..742cf5ea5cf 100644
--- a/htdocs/loan/payment/payment.php
+++ b/htdocs/loan/payment/payment.php
@@ -38,9 +38,9 @@ $last=GETPOST('last');
// Security check
$socid=0;
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$loan = new Loan($db);
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 69ef6826b4e..efbe1a03a5e 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1020,7 +1020,7 @@ $heightforframes=50;
// Init menu manager
if (! defined('NOREQUIREMENU'))
{
- if (empty($user->societe_id)) // If internal user or not defined
+ if (empty($user->socid)) // If internal user or not defined
{
$conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
}
@@ -1048,7 +1048,7 @@ if (! defined('NOREQUIREMENU'))
include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
}
}
- $menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
+ $menumanager = new MenuManager($db, empty($user->socid)?0:1);
$menumanager->loadMenu();
}
diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php
index b8f530660f1..a25528f58fb 100644
--- a/htdocs/margin/customerMargins.php
+++ b/htdocs/margin/customerMargins.php
@@ -36,7 +36,7 @@ $socid = GETPOST('socid', 'int');
$TSelectedProducts = GETPOST('products', 'array');
$TSelectedCats = GETPOST('categories', 'array');
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'societe', '', '');
$result = restrictedArea($user, 'margins');
diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php
index a4aed7f668a..cbc134c0b66 100644
--- a/htdocs/margin/productMargins.php
+++ b/htdocs/margin/productMargins.php
@@ -40,7 +40,7 @@ $TSelectedCats=GETPOST('categories', 'array');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$result=restrictedArea($user, 'margins');
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 0ad3f2f645b..d9677ffa4da 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -36,7 +36,7 @@ $confirm=GETPOST('confirm', 'alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$object = new Product($db);
@@ -94,7 +94,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref');
+ dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref');
print ' ';
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index c5d1f0d1e0b..1edd5349467 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -30,7 +30,7 @@ $langs->loadLangs(array("companies", "bills", "products", "margins"));
// Security check
$socid = GETPOST('socid', 'int');
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'societe', '', '');
@@ -90,7 +90,7 @@ if ($socid > 0)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/modulebuilder/template/mymoduleindex.php b/htdocs/modulebuilder/template/mymoduleindex.php
index 2b681e817f8..d97af3cc99e 100644
--- a/htdocs/modulebuilder/template/mymoduleindex.php
+++ b/htdocs/modulebuilder/template/mymoduleindex.php
@@ -50,10 +50,10 @@ $action=GETPOST('action', 'alpha');
// Securite acces client
if (! $user->rights->mymodule->read) accessforbidden();
$socid=GETPOST('socid', 'int');
-if (isset($user->societe_id) && $user->societe_id > 0)
+if (isset($user->socid) && $user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$max=5;
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 7a15ba2843a..c452d908538 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -61,9 +61,9 @@ if (GETPOST('actioncode', 'array'))
}
else
{
- $actioncode=GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
+ $actioncode = GETPOST("actioncode", "alpha", 3)?GETPOST("actioncode", "alpha", 3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT));
}
-$search_agenda_label=GETPOST('search_agenda_label');
+$search_agenda_label = GETPOST('search_agenda_label');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -77,7 +77,7 @@ if (! $sortfield) $sortfield='a.datep,a.id';
if (! $sortorder) $sortorder='DESC,DESC';
// Initialize technical objects
-$object=new MyObject($db);
+$object = new MyObject($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction=$conf->mymodule->dir_output . '/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('myobjectagenda','globalcard')); // Note that conf->hooks_modules contains array
@@ -89,13 +89,13 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity] . "/" . $object->id;
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $object->id);
/*
- * Actions
+ * Actions
*/
$parameters=array('id'=>$id);
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 2a9d6388552..ec70df73583 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -100,8 +100,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
diff --git a/htdocs/modulebuilder/template/myobject_document.php b/htdocs/modulebuilder/template/myobject_document.php
index 8deb44b9009..f4b918692ca 100644
--- a/htdocs/modulebuilder/template/myobject_document.php
+++ b/htdocs/modulebuilder/template/myobject_document.php
@@ -80,8 +80,8 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu
if ($id > 0 || ! empty($ref)) $upload_dir = $conf->mymodule->multidir_output[$object->entity?$object->entity:$conf->entity] . "/myobject/" . dol_sanitizeFileName($object->ref);
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $object->id);
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index bf9b73e0f53..08fbcbaa98e 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -112,9 +112,9 @@ if (! $sortorder) $sortorder="ASC";
// Security check
if (empty($conf->mymodule->enabled)) accessforbidden('Module not enabled');
$socid=0;
-if ($user->societe_id > 0) // Protection if external user
+if ($user->socid > 0) // Protection if external user
{
- //$socid = $user->societe_id;
+ //$socid = $user->socid;
accessforbidden();
}
//$result = restrictedArea($user, 'mymodule', $id, '');
diff --git a/htdocs/modulebuilder/template/myobject_note.php b/htdocs/modulebuilder/template/myobject_note.php
index c8dbc5d3140..7cf5f418ff1 100644
--- a/htdocs/modulebuilder/template/myobject_note.php
+++ b/htdocs/modulebuilder/template/myobject_note.php
@@ -59,8 +59,8 @@ $hookmanager->initHooks(array('myobjectnote','globalcard')); // Note that co
$extrafields->fetch_name_optionals_label($object->table_element);
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $id);
// Load object
diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php
index a86d062c5e4..884bc234cbf 100644
--- a/htdocs/mrp/mo_agenda.php
+++ b/htdocs/mrp/mo_agenda.php
@@ -54,8 +54,8 @@ else
$search_agenda_label=GETPOST('search_agenda_label');
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mrp', $id);
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php
index 0ecbefc32a7..07b6be426f3 100644
--- a/htdocs/mrp/mo_card.php
+++ b/htdocs/mrp/mo_card.php
@@ -88,8 +88,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->statut == Mo::STATUS_DRAFT) ? 1 : 0);
//$result = restrictedArea($user, 'mrp', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
diff --git a/htdocs/mrp/mo_document.php b/htdocs/mrp/mo_document.php
index 3732754a62f..2c4d1b36c99 100644
--- a/htdocs/mrp/mo_document.php
+++ b/htdocs/mrp/mo_document.php
@@ -41,8 +41,8 @@ $id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mrp', $id);
// Get parameters
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 96f19540a95..b91affe403f 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -98,9 +98,9 @@ if (! $sortorder) $sortorder="ASC";
// Security check
if (empty($conf->mrp->enabled)) accessforbidden('Module not enabled');
$socid=0;
-if ($user->societe_id > 0) // Protection if external user
+if ($user->socid > 0) // Protection if external user
{
- //$socid = $user->societe_id;
+ //$socid = $user->socid;
accessforbidden();
}
//$result = restrictedArea($user, 'mrp', $id, '');
diff --git a/htdocs/mrp/mo_note.php b/htdocs/mrp/mo_note.php
index f815dfbaef6..aeb4630168d 100644
--- a/htdocs/mrp/mo_note.php
+++ b/htdocs/mrp/mo_note.php
@@ -47,8 +47,8 @@ $hookmanager->initHooks(array('monote','globalcard')); // Note that conf->ho
$extrafields->fetch_name_optionals_label($object->table_element);
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mrp', $id);
// Load object
diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php
index 70de7155f39..345bfe3f8dd 100644
--- a/htdocs/mrp/mo_production.php
+++ b/htdocs/mrp/mo_production.php
@@ -88,8 +88,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->statut == Mo::STATUS_DRAFT) ? 1 : 0);
//$result = restrictedArea($user, 'mrp', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index a264171f529..c6585f5e590 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -50,7 +50,7 @@ $search_agenda_label=GETPOST('search_agenda_label');
// Security check
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
-if ($user->societe_id) $id=$user->societe_id;
+if ($user->socid) $id=$user->socid;
$result=restrictedArea($user, 'produit|service', $id, 'product&product');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -132,7 +132,7 @@ if ($id > 0 || $ref)
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/canvas/product/tpl/card_view.tpl.php b/htdocs/product/canvas/product/tpl/card_view.tpl.php
index 594fd6c1b9b..dc7fea3fc0e 100644
--- a/htdocs/product/canvas/product/tpl/card_view.tpl.php
+++ b/htdocs/product/canvas/product/tpl/card_view.tpl.php
@@ -37,7 +37,7 @@ $linkback = ' next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
-if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
?>
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index fa131e1df6e..79511df9640 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -78,7 +78,7 @@ $confirm=GETPOST('confirm', 'alpha');
$socid=GETPOST('socid', 'int');
$duration_value = GETPOST('duration_value', 'int');
$duration_unit = GETPOST('duration_unit', 'alpha');
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$object = new Product($db);
$object->type = $type; // so test later to fill $usercancxxx is correct
@@ -1650,7 +1650,7 @@ else
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php
index 1b0020faa25..947e4292c1a 100644
--- a/htdocs/product/class/api_products.class.php
+++ b/htdocs/product/class/api_products.class.php
@@ -582,7 +582,7 @@ class Products extends DolibarrApi
{
global $db, $conf;
$obj_ret = array();
- $socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
+ $socid = DolibarrApiAccess::$user->socid ? DolibarrApiAccess::$user->socid : '';
$sql = "SELECT t.rowid, t.ref, t.ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."product as t";
if ($category > 0) {
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index a3517c593f1..8fb3420df49 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -45,7 +45,7 @@ $key=GETPOST('key');
$parent=GETPOST('parent');
// Security check
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
@@ -205,7 +205,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ''.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', '', '', '', 0, '', '', 0);
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index f62ea66fd48..ef508c9a200 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -48,7 +48,7 @@ $confirm= GETPOST('confirm', 'alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -215,7 +215,7 @@ if ($object->id)
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index ef0d1bc1c85..402d27c8578 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -64,7 +64,7 @@ if (! empty($_REQUEST['search_fourn_id']))
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if (empty($user->rights->fournisseur->lire)) accessforbidden();
@@ -362,7 +362,7 @@ if ($id > 0 || $ref)
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php
index 639b04cdbcc..2659d325676 100644
--- a/htdocs/product/inventory/card.php
+++ b/htdocs/product/inventory/card.php
@@ -72,8 +72,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $id);
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php
index df67fbd0940..4ee108595e6 100644
--- a/htdocs/product/inventory/inventory.php
+++ b/htdocs/product/inventory/inventory.php
@@ -72,8 +72,8 @@ if (empty($action) && empty($id) && empty($ref)) $action='view';
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'mymodule', $id);
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php
index 0362a3767c3..9a20f00341b 100644
--- a/htdocs/product/inventory/list.php
+++ b/htdocs/product/inventory/list.php
@@ -68,9 +68,9 @@ if (! $sortorder) $sortorder="ASC";
// Security check
$socid=0;
-if ($user->societe_id > 0) // Protection if external user
+if ($user->socid > 0) // Protection if external user
{
- //$socid = $user->societe_id;
+ //$socid = $user->socid;
accessforbidden();
}
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS))
diff --git a/htdocs/product/note.php b/htdocs/product/note.php
index c9a8bc6b1f9..d5593acfb78 100644
--- a/htdocs/product/note.php
+++ b/htdocs/product/note.php
@@ -40,7 +40,7 @@ $action = GETPOST('action', 'aZ09');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$object = new Product($db);
@@ -98,7 +98,7 @@ if ($id > 0 || ! empty($ref))
$object->next_prev_filter=" fk_product_type = ".$object->type;
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index a25ba2808d5..c50ca3538aa 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -36,7 +36,7 @@ $langs->load('propal');
$type=GETPOST("type", "int");
// Security check
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index e8e332d95b5..f6820bc37bc 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -62,7 +62,7 @@ $search_soc = GETPOST('search_soc');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid = $user->societe_id;
+if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
if ($id > 0 || ! empty($ref))
@@ -706,7 +706,7 @@ $linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'ref', $linkback, ($user->societe_id?0:1), 'ref', '', '', '', 0, '', '', 1);
+ dol_banner_tab($object, 'ref', $linkback, ($user->socid?0:1), 'ref', '', '', '', 0, '', '', 1);
dol_fiche_end();
}
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index 58d65810772..e819110c344 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -40,7 +40,7 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -104,7 +104,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 56746cb33bc..ae3b642355a 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -39,8 +39,8 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid = '';
-if (! empty($user->societe_id))
- $socid = $user->societe_id;
+if (! empty($user->socid))
+ $socid = $user->socid;
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -109,7 +109,7 @@ if ($id > 0 || ! empty($ref)) {
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index f779ced92ee..8a14c3f19a4 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -37,7 +37,7 @@ $ref = GETPOST('ref', 'alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -94,7 +94,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index d14eba99fae..6c5379d1ddb 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -41,7 +41,7 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -122,7 +122,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index 5891942079a..70643e9c996 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -41,7 +41,7 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid = '';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -105,7 +105,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 0b8ae599809..4c58a6fb982 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -40,7 +40,7 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -105,7 +105,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php
index fbab22a0d2f..0dc19a47691 100644
--- a/htdocs/product/stats/supplier_proposal.php
+++ b/htdocs/product/stats/supplier_proposal.php
@@ -40,7 +40,7 @@ $ref = GETPOST('ref', 'alpha');
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
$socid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -105,7 +105,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 94012c1b9cf..22f7cc03b63 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -378,7 +378,7 @@ else
$morehtmlref.=' ';
$shownav = 1;
- if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/product/stock/info.php b/htdocs/product/stock/info.php
index 3314fcf642c..692fe17a83d 100644
--- a/htdocs/product/stock/info.php
+++ b/htdocs/product/stock/info.php
@@ -60,7 +60,7 @@ $morehtmlref.=$langs->trans("LocationSummary").' : '.$object->lieu;
$morehtmlref.=' ';
$shownav = 1;
-if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+if ($user->socid && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php
index 5324ef80243..0f4e5476fd2 100644
--- a/htdocs/product/stock/massstockmove.php
+++ b/htdocs/product/stock/massstockmove.php
@@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$langs->loadLangs(array('products', 'stocks', 'orders', 'productbatch'));
// Security check
-if ($user->societe_id) {
- $socid = $user->societe_id;
+if ($user->socid) {
+ $socid = $user->socid;
}
$result=restrictedArea($user, 'produit|service');
diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php
index 86380c5d72f..5f4e1b97aa6 100644
--- a/htdocs/product/stock/movement_card.php
+++ b/htdocs/product/stock/movement_card.php
@@ -567,7 +567,7 @@ if ($resql)
$morehtmlref.=' ';
$shownav = 1;
- if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 57122db7e46..85f40a9d214 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -549,7 +549,7 @@ if ($resql)
$morehtmlref.=' ';
$shownav = 1;
- if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 060bcc57960..3428b75f395 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -76,7 +76,7 @@ if (!empty($batchnumber)) {
}
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit&stock', $id, 'product&product', '', '', $fieldid);
@@ -548,7 +548,7 @@ if ($id > 0 || $ref)
$linkback = ''.$langs->trans("BackToList").'';
$shownav = 1;
- if ($user->societe_id && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('stock', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref');
diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php
index 00299c94459..c7f9a5ae8fa 100644
--- a/htdocs/product/stock/productlot_card.php
+++ b/htdocs/product/stock/productlot_card.php
@@ -53,7 +53,7 @@ if (empty($action) && empty($id) && empty($ref)) $action='list';
// Protection if external user
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
//accessforbidden();
}
@@ -318,7 +318,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$linkback = '' . $langs->trans("BackToList") . '';
$shownav = 1;
- if ($user->societe_id && ! in_array('batch', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('batch', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch');
diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php
index ed4aea8c010..5fb9cc23bca 100644
--- a/htdocs/product/stock/productlot_document.php
+++ b/htdocs/product/stock/productlot_document.php
@@ -48,7 +48,7 @@ $confirm= GETPOST('confirm', 'alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : '');
$fieldtype = 'rowid';
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -132,7 +132,7 @@ if ($object->id)
$linkback = '' . $langs->trans("BackToList") . '';
$shownav = 1;
- if ($user->societe_id && ! in_array('batch', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('batch', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'id', $linkback, $shownav, 'rowid', 'batch');
diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php
index fbbec95f2df..fd2a7c70c13 100644
--- a/htdocs/product/stock/productlot_list.php
+++ b/htdocs/product/stock/productlot_list.php
@@ -67,9 +67,9 @@ if (! $sortorder) $sortorder="ASC";
// Protection if external user
$socid=0;
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
- $socid = $user->societe_id;
+ $socid = $user->socid;
//accessforbidden();
}
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 3536088cab5..168ed5e54f9 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -38,8 +38,8 @@ require_once './lib/replenishment.lib.php';
$langs->loadLangs(array('products', 'stocks', 'orders'));
// Security check
-if ($user->societe_id) {
- $socid = $user->societe_id;
+if ($user->socid) {
+ $socid = $user->socid;
}
$result=restrictedArea($user, 'produit|service');
diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php
index 2f0714737ee..27834923a0e 100644
--- a/htdocs/product/stock/replenishorders.php
+++ b/htdocs/product/stock/replenishorders.php
@@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->loadLangs(array('products', 'stocks', 'orders'));
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service');
$sall = GETPOST('search_all', 'alphanohtml');
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 054947183ab..19a23e1e9d2 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -42,7 +42,7 @@ $cancel=GETPOST('cancel', 'alpha');
// Security check
$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref : ''));
$fieldtype = (! empty($ref) ? 'ref' : 'rowid');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
@@ -203,7 +203,7 @@ dol_fiche_head($head, 'translation', $titre, 0, $picto);
$linkback = ''.$langs->trans("BackToList").'';
$shownav = 1;
-if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, $shownav, 'ref', '', '', '', 0, '', '', 1);
diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php
index 4215b9778e3..cf1249aa9eb 100644
--- a/htdocs/projet/activity/index.php
+++ b/htdocs/projet/activity/index.php
@@ -36,7 +36,7 @@ if ($search_project_user == $user->id) $mine = 1;
// Security check
$socid=0;
-if ($user->societe_id > 0) $socid=$user->societe_id;
+if ($user->socid > 0) $socid=$user->socid;
//$result = restrictedArea($user, 'projet', $projectid);
if (!$user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index b07b41c1b88..77dcaa641d2 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -56,7 +56,7 @@ $hookmanager->initHooks(array('timesheetperdaycard'));
// Security check
$socid=0;
// For external user, no check is done on company because readability is managed by public status of project and assignement.
-//if ($user->societe_id > 0) $socid=$user->societe_id;
+//if ($user->socid > 0) $socid=$user->socid;
$result = restrictedArea($user, 'projet', $projectid);
$now=dol_now();
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index e51b2e4b404..8af733394bf 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -56,7 +56,7 @@ $hookmanager->initHooks(array('timesheetperweekcard'));
// Security check
$socid=0;
// For external user, no check is done on company because readability is managed by public status of project and assignement.
-// if ($user->societe_id > 0) $socid=$user->societe_id;
+// if ($user->socid > 0) $socid=$user->socid;
$result = restrictedArea($user, 'projet', $projectid);
$now=dol_now();
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index e4a8dd078ec..5b3d69777b7 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -71,7 +71,7 @@ if ($id > 0 || ! empty($ref))
// Security check
$socid=GETPOST('socid', 'int');
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $object->id, 'projet&project');
// fetch optionals attributes and labels
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index 0848f87ed19..e049945f235 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -1456,7 +1456,7 @@ class Project extends CommonObject
// Security check
$socid=0;
- if ($user->societe_id > 0) $socid = $user->societe_id;
+ if ($user->socid > 0) $socid = $user->socid;
$tasksarray=$taskstatic->getTasksArray(0, 0, $fromid, $socid, 0);
@@ -1536,7 +1536,7 @@ class Project extends CommonObject
// Security check
$socid=0;
- if ($user->societe_id > 0) $socid = $user->societe_id;
+ if ($user->socid > 0) $socid = $user->socid;
$tasksarray=$taskstatic->getTasksArray(0, 0, $this->id, $socid, 0);
@@ -1767,7 +1767,7 @@ class Project extends CommonObject
global $conf, $langs;
// For external user, no check is done on company because readability is managed by public status of project and assignement.
- //$socid=$user->societe_id;
+ //$socid=$user->socid;
$projectsListId = null;
if (! $user->rights->projet->all->lire) $projectsListId = $this->getProjectsAuthorizedForUser($user, 0, 1);
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 71bf1b17f50..dcc4c18c497 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -1969,7 +1969,7 @@ class Task extends CommonObject
global $conf, $langs;
// For external user, no check is done on company because readability is managed by public status of project and assignement.
- //$socid=$user->societe_id;
+ //$socid=$user->socid;
$projectstatic = new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, $socid);
@@ -2042,7 +2042,7 @@ class Task extends CommonObject
// phpcs:enable
global $user;
- $mine=0; $socid=$user->societe_id;
+ $mine=0; $socid=$user->socid;
$projectstatic = new Project($this->db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $mine, 1, $socid);
diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php
index b535b0f6ada..064f4a12729 100644
--- a/htdocs/projet/comment.php
+++ b/htdocs/projet/comment.php
@@ -49,7 +49,7 @@ $planned_workload=((GETPOST('planned_workloadhour', 'int')!='' || GETPOST('plann
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (! $user->rights->projet->lire) accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index a1735e20ad6..82eb598190b 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -47,7 +47,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$hookmanager->initHooks(array('projectcontactcard','globalcard'));
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index 10c7a140df7..f77419f2e75 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -42,7 +42,7 @@ $mine = (GETPOST('mode', 'alpha') == 'mine' ? 1 : 0);
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user, 'projet', $id, 'projet&project');
$object = new Project($db);
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 5f74a971f87..14dccfedb8d 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -100,7 +100,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
// Security check
$socid=$object->socid;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $object->id, 'projet&project');
$hookmanager->initHooks(array('projectOverview'));
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index 57be29b1bb2..725d99fb673 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -46,7 +46,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
// Load translation files required by the page
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index be8a924e1ab..a2526171b9b 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -45,7 +45,7 @@ if ($search_project_user == $user->id) $mine = 1;
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$sortfield = GETPOST("sortfield", 'alpha');
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index 207bd245d08..ff361e75d3d 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -62,7 +62,7 @@ $search_agenda_label=GETPOST('search_agenda_label');
// Security check
$id = GETPOST("id", 'int');
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user, 'projet', $id, '');
if (!$user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 2c311de7792..6cbe9d68127 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -48,7 +48,7 @@ $title = $langs->trans("Projects");
// Security check
$socid = (is_numeric($_GET["socid"]) ? $_GET["socid"] : 0 );
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if ($socid > 0)
{
$soc = new Societe($db);
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index ef324bb63bb..73c9d39d64d 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -43,7 +43,7 @@ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($ob
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$permissionnote=$user->rights->projet->creer; // Used by the include of actions_setnotes.inc.php
diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php
index f8480f8f322..a7e6bf510b3 100644
--- a/htdocs/projet/stats/index.php
+++ b/htdocs/projet/stats/index.php
@@ -38,10 +38,10 @@ $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
$userid=GETPOST('userid', 'int');
$socid=GETPOST('socid', 'int');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$nowyear=strftime("%Y", dol_now());
$year = GETPOST('year')>0?GETPOST('year'):$nowyear;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 2395f5f0bd1..0bffd50ce62 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -80,7 +80,7 @@ $extrafields->fetch_name_optionals_label($taskstatic->table_element);
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result = restrictedArea($user, 'projet', $id, 'projet&project');
$diroutputmassaction=$conf->projet->dir_output . '/tasks/temp/massgeneration/'.$user->id;
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index d9a251b3c53..31211e59dbf 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -49,7 +49,7 @@ $planned_workload=((GETPOST('planned_workloadhour', 'int')!='' || GETPOST('plann
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (! $user->rights->projet->lire) accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index b09d8345177..aa94d413fc9 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -42,7 +42,7 @@ $project_ref=GETPOST('project_ref', 'alpha');
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
//$result = restrictedArea($user, 'projet', $id, 'projet_task');
if (! $user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index 52795f7a249..1944de13f61 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -46,7 +46,7 @@ $project_ref = GETPOST('project_ref', 'alpha');
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
//$result=restrictedArea($user,'projet',$id,'');
if (!$user->rights->projet->lire) accessforbidden();
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index e13b7092b26..8718806004b 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -83,7 +83,7 @@ $search_array_options=$extrafields->getOptionalsFromPost($object->table_element,
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$diroutputmassaction=$conf->projet->dir_output . '/tasks/temp/massgeneration/'.$user->id;
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index de2707bf734..42dbaa48cc2 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -40,7 +40,7 @@ $project_ref = GETPOST('project_ref', 'alpha');
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
//$result = restrictedArea($user, 'projet', $id, '', 'task'); // TODO ameliorer la verification
diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php
index c94a412be9c..c9e8bc335e7 100644
--- a/htdocs/projet/tasks/stats/index.php
+++ b/htdocs/projet/tasks/stats/index.php
@@ -38,10 +38,10 @@ $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
$userid=GETPOST('userid', 'int');
$socid=GETPOST('socid', 'int');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$nowyear=strftime("%Y", dol_now());
$year = GETPOST('year')>0?GETPOST('year'):$nowyear;
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 78431f983a4..0bc07537ccf 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -48,7 +48,7 @@ $planned_workload=((GETPOST('planned_workloadhour', 'int')!='' || GETPOST('plann
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (! $user->rights->projet->lire) accessforbidden();
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 3dc54cc2223..24e5d067186 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -68,7 +68,7 @@ $search_valuebilled=GETPOST('search_valuebilled', 'int');
// Security check
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
if (!$user->rights->projet->lire) accessforbidden();
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php
index ce93ec020c3..0bde25460e3 100644
--- a/htdocs/public/ticket/create_ticket.php
+++ b/htdocs/public/ticket/create_ticket.php
@@ -348,7 +348,7 @@ llxHeaderTicket($langs->trans("CreateTicket"), "", 0, 0, $arrayofjs, $arrayofcss
print '';
if ($action != "infos_success") {
- $formticket->withfromsocid = isset($socid) ? $socid : $user->societe_id;
+ $formticket->withfromsocid = isset($socid) ? $socid : $user->socid;
$formticket->withtitletopic = 1;
$formticket->withcompany = 0;
$formticket->withusercreate = 1;
diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php
index 832fd4fc70d..2e9dbe5f57b 100644
--- a/htdocs/reception/card.php
+++ b/htdocs/reception/card.php
@@ -72,7 +72,7 @@ $line_id = GETPOST('lineid', 'int')?GETPOST('lineid', 'int'):'';
// Security check
$socid='';
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
if ($origin == 'reception') $result=restrictedArea($user, $origin, $id);
else {
@@ -820,7 +820,7 @@ if ($action == 'create')
print " |
";
// Note Private
- if ($object->note_private && ! $user->societe_id)
+ if ($object->note_private && ! $user->socid)
{
print '| '.$langs->trans("NotePrivate").' | ';
print '';
@@ -2019,7 +2019,7 @@ elseif ($id || $ref)
* Boutons actions
*/
- if (($user->societe_id == 0) && ($action!='presend'))
+ if (($user->socid == 0) && ($action!='presend'))
{
print ' ';
diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php
index c49eec5c82d..da074c420b5 100644
--- a/htdocs/reception/contact.php
+++ b/htdocs/reception/contact.php
@@ -44,7 +44,7 @@ $ref=GETPOST('ref', 'alpha');
$action=GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'reception', $id, '');
$object = new Reception($db);
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index 1a201a4bfd0..a7d7c51b7b1 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -42,7 +42,7 @@ $toselect = GETPOST('toselect', 'array');
// Security check
$receptionid = GETPOST('id', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'reception', $receptionid, '');
$diroutputmassaction=$conf->reception->dir_output . '/temp/massgeneration/'.$user->id;
diff --git a/htdocs/reception/note.php b/htdocs/reception/note.php
index cbc1185aaab..5a2e8745cb7 100644
--- a/htdocs/reception/note.php
+++ b/htdocs/reception/note.php
@@ -48,7 +48,7 @@ $action=GETPOST('action', 'alpha');
// Security check
$socid='';
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result=restrictedArea($user, $origin, $origin_id);
$object = new Reception($db);
diff --git a/htdocs/reception/stats/index.php b/htdocs/reception/stats/index.php
index 76315ccce03..06304a2afb8 100644
--- a/htdocs/reception/stats/index.php
+++ b/htdocs/reception/stats/index.php
@@ -35,10 +35,10 @@ $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height');
$userid=GETPOST('userid', 'int');
$socid=GETPOST('socid', 'int');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$nowyear=strftime("%Y", dol_now());
@@ -74,7 +74,7 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
// $data = array(array('Lib',val1,val2,val3),...)
-if (!$user->rights->societe->client->voir || $user->societe_id)
+if (!$user->rights->societe->client->voir || $user->socid)
{
$filenamenb = $dir.'/receptionsnbinyear-'.$user->id.'-'.$year.'.png';
}
@@ -114,7 +114,7 @@ $data = $stats->getAmountByMonthWithPrevYear($endyear,$startyear);
//var_dump($data);
// $data = array(array('Lib',val1,val2,val3),...)
-if (!$user->rights->societe->client->voir || $user->societe_id)
+if (!$user->rights->societe->client->voir || $user->socid)
{
$filenameamount = $dir.'/receptionsamountinyear-'.$user->id.'-'.$year.'.png';
}
@@ -152,7 +152,7 @@ if (! $mesg)
/*
$data = $stats->getAverageByMonthWithPrevYear($endyear, $startyear);
-if (!$user->rights->societe->client->voir || $user->societe_id)
+if (!$user->rights->societe->client->voir || $user->socid)
{
$filename_avg = $dir.'/receptionsaverage-'.$user->id.'-'.$year.'.png';
}
diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php
index 303db5ec7b3..803190ec699 100644
--- a/htdocs/resource/agenda.php
+++ b/htdocs/resource/agenda.php
@@ -141,7 +141,7 @@ if ($object->id > 0)
$morehtmlref.=' ';
$shownav = 1;
- if ($user->societe_id && ! in_array('resource', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('resource', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/resource/contact.php b/htdocs/resource/contact.php
index 872078ac51d..3e2a004e194 100644
--- a/htdocs/resource/contact.php
+++ b/htdocs/resource/contact.php
@@ -39,7 +39,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'resource', $id, 'resource');
$object = new DolResource($db);
diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php
index 9f1b5af4322..e023134b9f5 100644
--- a/htdocs/resource/document.php
+++ b/htdocs/resource/document.php
@@ -44,7 +44,7 @@ $action = GETPOST('action', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'resource', $id, 'resource');
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index a0c1a724ed8..2ab64799f1d 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -357,7 +357,7 @@ else
}
$morehtmlref.='';
- dol_banner_tab($act, 'element_id', $linkback, ($user->societe_id?0:1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', '');
+ dol_banner_tab($act, 'element_id', $linkback, ($user->socid?0:1), 'id', 'ref', $morehtmlref, '&element='.$element, 0, '', '');
print '';
@@ -453,7 +453,7 @@ else
dol_fiche_head($head, 'resources', $langs->trans("ThirdParty"), -1, 'company');
- dol_banner_tab($socstatic, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom', '', '&element='.$element);
+ dol_banner_tab($socstatic, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '&element='.$element);
print ' ';
@@ -557,7 +557,7 @@ else
dol_fiche_head($head, 'resources', $titre, -1, $picto);
$shownav = 1;
- if ($user->societe_id && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
+ if ($user->socid && ! in_array('product', explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0;
dol_banner_tab($product, 'ref', '', $shownav, 'ref', 'ref', '', '&element='.$element);
dol_fiche_end();
diff --git a/htdocs/resource/note.php b/htdocs/resource/note.php
index 8c7f106285f..322088ef317 100644
--- a/htdocs/resource/note.php
+++ b/htdocs/resource/note.php
@@ -37,7 +37,7 @@ $ref = GETPOST('ref', 'alpha');
$action=GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'resource', $id, 'resource');
$object = new DolResource($db);
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index 32edd342cb8..4e9b9dac118 100644
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -48,7 +48,7 @@ $projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : GETPOS
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
$object = new PaymentSalary($db);
diff --git a/htdocs/salaries/document.php b/htdocs/salaries/document.php
index a7b92d63efb..7bd9a14a718 100644
--- a/htdocs/salaries/document.php
+++ b/htdocs/salaries/document.php
@@ -45,7 +45,7 @@ $confirm = GETPOST('confirm', 'alpha');
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
diff --git a/htdocs/salaries/info.php b/htdocs/salaries/info.php
index 5ba53c45665..a96db0cbd5f 100644
--- a/htdocs/salaries/info.php
+++ b/htdocs/salaries/info.php
@@ -36,7 +36,7 @@ $action=GETPOST('action', 'aZ09');
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php
index 816b734ea23..02a729cb16c 100644
--- a/htdocs/salaries/list.php
+++ b/htdocs/salaries/list.php
@@ -33,7 +33,7 @@ $langs->loadLangs(array("compta","salaries","bills","hrm"));
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/salaries/stats/index.php b/htdocs/salaries/stats/index.php
index a301dc927a1..38a568d5fc0 100644
--- a/htdocs/salaries/stats/index.php
+++ b/htdocs/salaries/stats/index.php
@@ -38,7 +38,7 @@ $id = GETPOST('id', 'int');
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'salaries', '', '', '');
$nowyear=strftime("%Y", dol_now());
diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php
index 231174a0afa..ae2622d7f93 100644
--- a/htdocs/societe/agenda.php
+++ b/htdocs/societe/agenda.php
@@ -47,7 +47,7 @@ $search_agenda_label=GETPOST('search_agenda_label');
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -117,7 +117,7 @@ if ($socid > 0)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index 28f2ec7306b..aafcd8ffc69 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -266,7 +266,7 @@ abstract class ActionsCardCommon
$this->tpl['showhead']=dol_get_fiche_head($head, 'card', '', 0, 'company');
$this->tpl['showend']=dol_get_fiche_end();
- $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
+ $this->tpl['showrefnav'] = $form->showrefnav($this->object, 'socid', '', ($user->socid?0:1), 'rowid', 'nom');
$this->tpl['checkcustomercode'] = $this->object->check_codeclient();
$this->tpl['checksuppliercode'] = $this->object->check_codefournisseur();
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 8cf9dbd1752..edfb3767f11 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -61,7 +61,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
if (empty($socid) && $action == 'view') $action='create';
$object = new Societe($db);
@@ -2241,7 +2241,7 @@ else
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/class/client.class.php b/htdocs/societe/class/client.class.php
index 9c6c15e2f66..c345d195935 100644
--- a/htdocs/societe/class/client.class.php
+++ b/htdocs/societe/class/client.class.php
@@ -63,7 +63,7 @@ class Client extends Societe
$sql = "SELECT count(s.rowid) as nb, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
- if (!$user->rights->societe->client->voir && !$user->societe_id)
+ if (!$user->rights->societe->client->voir && !$user->socid)
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
$sql.= " WHERE sc.fk_user = " .$user->id;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 48c37f044a5..4615290a03d 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2238,7 +2238,7 @@ class Societe extends CommonObject
$linkend='';
global $user;
- if (! $user->rights->societe->client->voir && $user->societe_id > 0 && $this->id != $user->societe_id)
+ if (! $user->rights->societe->client->voir && $user->socid > 0 && $this->id != $user->socid)
{
$linkstart='';
$linkend='';
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 85df9b4f069..0039504e950 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Societe($db);
if ($socid > 0) $object->fetch($socid);
@@ -109,7 +109,7 @@ dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"), -1, 'company')
$linkback = ' '.$langs->trans("BackToList").'';
-dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php
index 1b119e9c89a..352c9c53c35 100644
--- a/htdocs/societe/contact.php
+++ b/htdocs/societe/contact.php
@@ -56,7 +56,7 @@ $cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm');
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
if (empty($socid) && $action == 'view') $action='create';
$object = new Societe($db);
@@ -150,7 +150,7 @@ dol_fiche_head($head, 'contact', $langs->trans("ThirdParty"), 0, 'company');
$linkback = ' '.$langs->trans("BackToList").'';
-dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
+dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom', '', '', 0, '', '', 'arearefnobottom');
dol_fiche_end();
diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php
index 971944c4f30..8e0c36aa451 100644
--- a/htdocs/societe/document.php
+++ b/htdocs/societe/document.php
@@ -40,10 +40,10 @@ $id=(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
// Security check
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
unset($action);
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$result = restrictedArea($user, 'societe', $id, '&societe');
@@ -117,7 +117,7 @@ if ($object->id)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php
index 50b866ca089..5aadc5d3606 100644
--- a/htdocs/societe/index.php
+++ b/htdocs/societe/index.php
@@ -38,7 +38,7 @@ $hookmanager->initHooks(array('thirdpartiesindex'));
$langs->load("companies");
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid = $user->societe_id;
+if ($user->socid) $socid=$user->socid;
// Security check
$result = restrictedArea($user, 'societe', 0, '', '', '', '');
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index ad793fcf63e..8f0d1895c1b 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -55,7 +55,7 @@ if ($contextpage == 'poslist')
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '');
$search_all=trim(GETPOST('search_all', 'alphanohtml')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php
index 4d20f050518..0f2bc4d8002 100644
--- a/htdocs/societe/note.php
+++ b/htdocs/societe/note.php
@@ -35,7 +35,7 @@ $langs->load("companies");
// Security check
$id = GETPOST('id')?GETPOST('id', 'int'):GETPOST('socid', 'int');
-if ($user->societe_id) $id=$user->societe_id;
+if ($user->socid) $id=$user->socid;
$result = restrictedArea($user, 'societe', $id, '&societe');
$object = new Societe($db);
@@ -78,7 +78,7 @@ if ($object->id > 0)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
$cssclass='titlefield';
//if ($action == 'editnote_public') $cssclass='titlefieldcreate';
diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php
index 54536fa7502..d3f4c30f575 100644
--- a/htdocs/societe/notify/card.php
+++ b/htdocs/societe/notify/card.php
@@ -39,7 +39,7 @@ $actionid = GETPOST('actionid');
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -156,7 +156,7 @@ if ($result > 0)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php
index df803b180ab..5ed2b9a148f 100644
--- a/htdocs/societe/paymentmodes.php
+++ b/htdocs/societe/paymentmodes.php
@@ -44,7 +44,7 @@ $langs->loadLangs(array("companies","commercial","banks","bills",'paypal','strip
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', '', '');
$id=GETPOST("id", "int");
@@ -804,7 +804,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
@@ -1615,7 +1615,7 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
@@ -1721,7 +1721,7 @@ if ($socid && $action == 'editcard' && $user->rights->societe->creer)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
@@ -1769,7 +1769,7 @@ if ($socid && $action == 'create' && $user->rights->societe->creer)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
@@ -1869,7 +1869,7 @@ if ($socid && $action == 'createcard' && $user->rights->societe->creer)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index 967f91ca39d..d3c4c75fca5 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -46,8 +46,8 @@ $cancel = GETPOST('cancel', 'alpha');
// Security check
$socid = GETPOST('socid', 'int')?GETPOST('socid', 'int'):GETPOST('id', 'int');
-if ($user->societe_id)
- $socid = $user->societe_id;
+if ($user->socid)
+ $socid = $user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
$object = new Societe($db);
@@ -187,7 +187,7 @@ dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), -1, 'company');
$linkback = ' '.$langs->trans("BackToList").'';
-dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php
index 8f825bfc18c..1ff2c24956e 100644
--- a/htdocs/societe/project.php
+++ b/htdocs/societe/project.php
@@ -35,7 +35,7 @@ $langs->loadLangs(array("companies", "projects"));
// Security check
$socid = GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@@ -82,7 +82,7 @@ if ($socid)
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php
index 7f531498e2f..0894935b962 100644
--- a/htdocs/societe/societecontact.php
+++ b/htdocs/societe/societecontact.php
@@ -51,7 +51,7 @@ $pageprev = $page - 1;
$pagenext = $page + 1;
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $id, '');
$object = new Societe($db);
@@ -166,7 +166,7 @@ if ($id > 0 || ! empty($ref))
$linkback = ' '.$langs->trans("BackToList").'';
- dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom');
+ dol_banner_tab($object, 'socid', $linkback, ($user->socid?0:1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php
index 0e0c5ac2cc8..6878ea8ed44 100644
--- a/htdocs/societe/website.php
+++ b/htdocs/societe/website.php
@@ -47,7 +47,7 @@ $search_status=GETPOST('search_status');
// Security check
$id = GETPOST('id', 'int')?GETPOST('id', 'int'):GETPOST('socid', 'int');
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'societe', $socid, '&societe');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
@@ -195,7 +195,7 @@ dol_fiche_head($head, 'website', $langs->trans("ThirdParty"), - 1, 'company');
$linkback = ' ' . $langs->trans("BackToList") . '';
-dol_banner_tab($object, 'socid', $linkback, ($user->societe_id ? 0 : 1), 'rowid', 'nom');
+dol_banner_tab($object, 'socid', $linkback, ($user->socid ? 0 : 1), 'rowid', 'nom');
print ' ';
diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php
index a9e417aa581..f398a013fb6 100644
--- a/htdocs/stripe/charge.php
+++ b/htdocs/stripe/charge.php
@@ -33,7 +33,7 @@ $langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe'));
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
//$result = restrictedArea($user, 'salaries', '', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php
index 2614c8498f3..e0ed986bfd6 100644
--- a/htdocs/stripe/payment.php
+++ b/htdocs/stripe/payment.php
@@ -65,9 +65,9 @@ $multicurrency_amountsresttopay=array();
// Security check
$socid=0;
-if ($user->societe_id > 0)
+if ($user->socid > 0)
{
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$object=new Facture($db);
diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php
index 70988b339b5..e2f19c560be 100644
--- a/htdocs/stripe/payout.php
+++ b/htdocs/stripe/payout.php
@@ -33,7 +33,7 @@ $langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe'));
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
//$result = restrictedArea($user, 'salaries', '', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php
index 6dc0a1e0815..3bc1050f867 100644
--- a/htdocs/stripe/transaction.php
+++ b/htdocs/stripe/transaction.php
@@ -33,7 +33,7 @@ $langs->loadLangs(array('compta', 'salaries', 'bills', 'hrm', 'stripe'));
// Security check
$socid = GETPOST("socid", "int");
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
//$result = restrictedArea($user, 'salaries', '', '', '');
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index b953087b885..1a8aa755e71 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -74,7 +74,7 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (! empty($co
$NBLINES = 4;
// Security check
-if (! empty($user->societe_id)) $socid = $user->societe_id;
+if (! empty($user->socid)) $socid = $user->socid;
$result = restrictedArea($user, 'supplier_proposal', $id);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index d60fb3c04bc..84b007c53fc 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -39,7 +39,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal', '');
$object = new SupplierProposal($db);
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 991059b9141..da76e9ea897 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -45,9 +45,9 @@ $ref = GETPOST('ref', 'alpha');
// Security check
$socid='';
-if (! empty($user->societe_id))
+if (! empty($user->socid))
{
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$result = restrictedArea($user, 'supplier_proposal', $id);
diff --git a/htdocs/supplier_proposal/index.php b/htdocs/supplier_proposal/index.php
index dd2acd27311..55bde878918 100644
--- a/htdocs/supplier_proposal/index.php
+++ b/htdocs/supplier_proposal/index.php
@@ -38,10 +38,10 @@ $langs->loadLangs(array('supplier_proposal', 'companies'));
// Security check
$socid=GETPOST('socid', 'int');
-if (isset($user->societe_id) && $user->societe_id > 0)
+if (isset($user->socid) && $user->socid > 0)
{
$action = '';
- $socid = $user->societe_id;
+ $socid = $user->socid;
}
$result = restrictedArea($user, 'supplier_proposal');
@@ -90,7 +90,7 @@ $sql.= ", ".MAIN_DB_PREFIX."supplier_proposal as p";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE p.fk_soc = s.rowid";
$sql.= " AND p.entity IN (".getEntity('supplier_proposal').")";
-if ($user->societe_id) $sql.=' AND p.fk_soc = '.$user->societe_id;
+if ($user->socid) $sql.=' AND p.fk_soc = '.$user->socid;
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
$sql.= " AND p.fk_statut IN (0,1,2,3,4)";
$sql.= " GROUP BY p.fk_statut";
diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php
index ec269354af6..7b259b166e4 100644
--- a/htdocs/supplier_proposal/info.php
+++ b/htdocs/supplier_proposal/info.php
@@ -39,7 +39,7 @@ $id=GETPOST('id', 'int');
$socid=GETPOST('socid', 'int');
// Security check
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
$result = restrictedArea($user, 'supplier_proposal', $id);
diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php
index 687d98911f2..c48f3756611 100644
--- a/htdocs/supplier_proposal/list.php
+++ b/htdocs/supplier_proposal/list.php
@@ -103,7 +103,7 @@ $NBLINES=4;
$module='supplier_proposal';
$dbtable='';
$objectid='';
-if (! empty($user->societe_id)) $socid=$user->societe_id;
+if (! empty($user->socid)) $socid=$user->socid;
if (! empty($socid))
{
$objectid=$socid;
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index 447dc057979..0e12da2c104 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -40,7 +40,7 @@ $ref=GETPOST('ref', 'alpha');
$action=GETPOST('action', 'alpha');
// Security check
-if ($user->societe_id) $socid=$user->societe_id;
+if ($user->socid) $socid=$user->socid;
$result = restrictedArea($user, 'supplier_proposal', $id, 'supplier_proposal');
$object = new SupplierProposal($db);
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index dee2168136c..6db51996d12 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -78,19 +78,19 @@ if (!$action) {
// Security check
$id = GETPOST("id", 'int');
$socid=0;
-//if ($user->societe_id > 0) $socid = $user->societe_id; // For external user, no check is done on company because readability is managed by public status of project and assignement.
+//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
$result=restrictedArea($user, 'ticket', $id, '');
if (!$user->rights->ticket->read) {
accessforbidden();
}
// restrict access for externals users
-if ($user->societe_id > 0 && ($object->fk_soc != $user->societe_id))
+if ($user->socid > 0 && ($object->fk_soc != $user->socid))
{
accessforbidden();
}
// or for unauthorized internals users
-if (!$user->societe_id && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
+if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden();
}
@@ -138,15 +138,15 @@ if ($socid > 0) {
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
- dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
+ dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
-if (!$user->societe_id && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
+if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
-} elseif ($user->societe_id > 0) {
- $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
+} elseif ($user->socid > 0) {
+ $object->next_prev_filter = "te.fk_soc = '" . $user->socid . "'";
}
$head = ticket_prepare_head($object);
@@ -172,7 +172,7 @@ if (!empty($object->origin_email)) {
if (! empty($conf->societe->enabled))
{
$morehtmlref.=' '.$langs->trans('ThirdParty');
- /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
+ /*if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('Edit'), 1) . '';
}*/
$morehtmlref.=' : ';
@@ -220,7 +220,7 @@ $morehtmlref.=' ';
$linkback = ' ' . $langs->trans("BackToList") . ' ';
-dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
+dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end();
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index eec2c813d26..6aa6d42e590 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -95,8 +95,8 @@ if ($id || $track_id || $ref) {
$url_page_current = DOL_URL_ROOT.'/ticket/card.php';
// Security check - Protection if external user
-//if ($user->societe_id > 0) access_forbidden();
-//if ($user->societe_id > 0) $socid = $user->societe_id;
+//if ($user->socid > 0) access_forbidden();
+//if ($user->socid > 0) $socid = $user->socid;
$result = restrictedArea($user, 'ticket', $object->id);
$triggermodname = 'TICKET_MODIFY';
@@ -622,7 +622,7 @@ if ($action == 'create' || $action == 'presend')
print load_fiche_titre($langs->trans('NewTicket'), '', 'ticket');
- $formticket->withfromsocid = $socid ? $socid : $user->societe_id;
+ $formticket->withfromsocid = $socid ? $socid : $user->socid;
$formticket->withfromcontactid = $contactid ? $contactid : '';
$formticket->withtitletopic = 1;
$formticket->withnotifytiersatcreate = ($notifyTiers?1:0);
@@ -645,7 +645,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
if ($res > 0)
{
// or for unauthorized internals users
- if (!$user->societe_id && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
+ if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
accessforbidden('', 0, 1);
}
@@ -741,14 +741,14 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$head = societe_prepare_head($object->thirdparty);
dol_fiche_head($head, 'ticket', $langs->trans("ThirdParty"), 0, 'company');
- dol_banner_tab($object->thirdparty, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
+ dol_banner_tab($object->thirdparty, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom');
dol_fiche_end();
}
- if (!$user->societe_id && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
+ if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
$object->next_prev_filter = "te.fk_user_assign = '" . $user->id . "'";
- } elseif ($user->societe_id > 0) {
- $object->next_prev_filter = "te.fk_soc = '" . $user->societe_id . "'";
+ } elseif ($user->socid > 0) {
+ $object->next_prev_filter = "te.fk_soc = '" . $user->socid . "'";
}
$head = ticket_prepare_head($object);
@@ -775,7 +775,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
if (! empty($conf->societe->enabled))
{
$morehtmlref.=' '.$langs->trans('ThirdParty') . ' ';
- if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
+ if ($action != 'editcustomer' && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('Edit'), 0) . ' : ';
}
if ($action == 'editcustomer') {
@@ -821,7 +821,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$linkback = ' ' . $langs->trans("BackToList") . ' ';
- dol_banner_tab($object, 'ref', $linkback, ($user->societe_id ? 0 : 1), 'ref', 'ref', $morehtmlref);
+ dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref);
print ' ';
print ' ';
@@ -845,9 +845,9 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
// Subject
print ' | ';
- print $form->editfieldkey("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->societe_id, 'string');
+ print $form->editfieldkey("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->socid, 'string');
print ' | ';
- print $form->editfieldval("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->societe_id, 'string');
+ print $form->editfieldval("Subject", 'subject', $object->subject, $object, $user->rights->ticket->write && !$user->socid, 'string');
print ' | ';
// Creation date
@@ -889,7 +889,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
}
// Show user list to assignate one if status is "read"
- if (GETPOST('set', 'alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->societe_id && $user->rights->ticket->write) {
+ if (GETPOST('set', 'alpha') == "assign_ticket" && $object->fk_statut < 8 && !$user->socid && $user->rights->ticket->write) {
print ' |