mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Fix: move transverse mode parameters in conf.php
This commit is contained in:
parent
0c5648dd6f
commit
6bbc1a1a77
|
|
@ -151,7 +151,7 @@ $db->commit();
|
|||
$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
$sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
|
||||
$sql.= " AND entity in (".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")";
|
||||
$sql.= " AND entity in (".(!empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is not enabled
|
||||
$sql.= " ORDER BY r.module, r.id";
|
||||
|
||||
|
|
|
|||
|
|
@ -279,4 +279,17 @@ $dolibarr_main_prod='0';
|
|||
#$dolibarr_font_DOL_DEFAULT_TTF="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf";
|
||||
#$dolibarr_font_DOL_DEFAULT_TTF_BOLD="/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf";
|
||||
|
||||
##############################
|
||||
# Extrernal module #
|
||||
##############################
|
||||
|
||||
# multicompany_transverse_mode
|
||||
# Pyramidal (0): The rights and groups are managed in each entity,
|
||||
# users belong to the entity for their rights.
|
||||
# Transversal (1): The groups can belong only to the master entity
|
||||
# and that the user belongs to a particular entity
|
||||
# Default value: 0 (pyramidal)
|
||||
# Examples:
|
||||
# $multicompany_transverse_mode='1';
|
||||
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ class Conf
|
|||
var $top_menu;
|
||||
var $smart_menu;
|
||||
|
||||
//! To store properties of multi-company
|
||||
var $multicompany;
|
||||
//! Used to store instance for multi-company (default 1)
|
||||
var $entity=1;
|
||||
|
||||
|
|
@ -89,9 +91,10 @@ class Conf
|
|||
|
||||
|
||||
/**
|
||||
* Load setup values into conf object (read llx_const)
|
||||
* @param $db Handler d'acces base
|
||||
* @return int < 0 if KO, >= 0 if OK
|
||||
* Load setup values into conf object (read llx_const)
|
||||
*
|
||||
* @param DoliDB $db Handler d'acces base
|
||||
* @return int < 0 if KO, >= 0 if OK
|
||||
*/
|
||||
function setValues($db)
|
||||
{
|
||||
|
|
@ -112,7 +115,14 @@ class Conf
|
|||
$sql = "SELECT ".$db->decrypt('name')." as name,";
|
||||
$sql.= " ".$db->decrypt('value')." as value, entity";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE entity IN (0,".$this->entity.")";
|
||||
if (! empty($this->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= " WHERE entity IN (0,1,".$this->entity.")";
|
||||
}
|
||||
else
|
||||
{
|
||||
$sql.= " WHERE entity IN (0,".$this->entity.")";
|
||||
}
|
||||
$sql.= " ORDER BY entity"; // This is to have entity 0 first, then entity 1 that overwrite.
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
|
|
|||
|
|
@ -973,7 +973,7 @@ class Form
|
|||
}
|
||||
$out.= $userstatic->getFullName($langs);
|
||||
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
if ($obj->admin && ! $obj->entity) $out.=" (".$langs->trans("AllEntities").")";
|
||||
else $out.=" (".$obj->label.")";
|
||||
|
|
@ -3734,7 +3734,7 @@ class Form
|
|||
$out.= '>';
|
||||
|
||||
$out.= $obj->nom;
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1)
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
|
||||
{
|
||||
$out.= " (".$obj->label.")";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey='';
|
|||
if (empty($dolibarr_main_limit_users)) $dolibarr_main_limit_users=0;
|
||||
if (empty($dolibarr_mailing_limit_sendbyweb)) $dolibarr_mailing_limit_sendbyweb=0;
|
||||
if (empty($force_charset_do_notuse)) $force_charset_do_notuse='UTF-8';
|
||||
if (empty($multicompany_transverse_mode)) $multicompany_transverse_mode=0;
|
||||
|
||||
// Security: CSRF protection
|
||||
// This test check if referrer ($_SERVER['HTTP_REFERER']) is same web site than Dolibarr ($_SERVER['HTTP_HOST'])
|
||||
|
|
|
|||
|
|
@ -43,31 +43,31 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/conf.class.php");
|
|||
|
||||
$conf = new Conf();
|
||||
// Identifiant propres au serveur base de donnee
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->prefix = $dolibarr_main_db_prefix;
|
||||
$conf->db->character_set=$dolibarr_main_db_character_set;
|
||||
$conf->db->dolibarr_main_db_collation=$dolibarr_main_db_collation;
|
||||
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
|
||||
$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
|
||||
$conf->file->main_limit_users = $dolibarr_main_limit_users;
|
||||
$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb;
|
||||
$conf->db->host = $dolibarr_main_db_host;
|
||||
$conf->db->port = $dolibarr_main_db_port;
|
||||
$conf->db->name = $dolibarr_main_db_name;
|
||||
$conf->db->user = $dolibarr_main_db_user;
|
||||
$conf->db->pass = $dolibarr_main_db_pass;
|
||||
$conf->db->type = $dolibarr_main_db_type;
|
||||
$conf->db->prefix = $dolibarr_main_db_prefix;
|
||||
$conf->db->character_set = $dolibarr_main_db_character_set;
|
||||
$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
|
||||
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
|
||||
$conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
|
||||
$conf->file->main_limit_users = $dolibarr_main_limit_users;
|
||||
$conf->file->mailing_limit_sendbyweb = $dolibarr_mailing_limit_sendbyweb;
|
||||
if (defined('TEST_DB_FORCE_TYPE')) $conf->db->type=constant('TEST_DB_FORCE_TYPE'); // For test purpose
|
||||
// Identifiant autres
|
||||
$conf->file->main_authentication = empty($dolibarr_main_authentication)?'':$dolibarr_main_authentication;
|
||||
$conf->file->main_authentication = empty($dolibarr_main_authentication)?'':$dolibarr_main_authentication;
|
||||
// Force https
|
||||
$conf->file->main_force_https = empty($dolibarr_main_force_https)?'':$dolibarr_main_force_https;
|
||||
$conf->file->main_force_https = empty($dolibarr_main_force_https)?'':$dolibarr_main_force_https;
|
||||
// Define charset for HTML Output (can set hidden value force_charset in conf file)
|
||||
$conf->file->character_set_client=strtoupper($force_charset_do_notuse);
|
||||
$conf->file->character_set_client = strtoupper($force_charset_do_notuse);
|
||||
// Cookie cryptkey
|
||||
$conf->file->cookie_cryptkey = empty($dolibarr_main_cookie_cryptkey)?'':$dolibarr_main_cookie_cryptkey;
|
||||
$conf->file->cookie_cryptkey = empty($dolibarr_main_cookie_cryptkey)?'':$dolibarr_main_cookie_cryptkey;
|
||||
|
||||
// Define array of document root directories
|
||||
$conf->file->dol_document_root=array('main' => DOL_DOCUMENT_ROOT);
|
||||
$conf->file->dol_document_root = array('main' => DOL_DOCUMENT_ROOT);
|
||||
if (! empty($dolibarr_main_document_root_alt))
|
||||
{
|
||||
// dolibarr_main_document_root_alt contains several directories
|
||||
|
|
@ -78,6 +78,9 @@ if (! empty($dolibarr_main_document_root_alt))
|
|||
}
|
||||
}
|
||||
|
||||
// Multi-Company transverse mode
|
||||
$conf->multicompany->transverse_mode = empty($multicompany_transverse_mode)?'':$multicompany_transverse_mode;
|
||||
|
||||
// Chargement des includes principaux de librairies communes
|
||||
if (! defined('NOREQUIREUSER')) require_once(DOL_DOCUMENT_ROOT ."/user/class/user.class.php"); // Need 500ko memory
|
||||
if (! defined('NOREQUIRETRAN')) require_once(DOL_DOCUMENT_ROOT ."/core/class/translate.class.php");
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ class User extends CommonObject
|
|||
$sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."rights_def as r";
|
||||
$sql.= " WHERE r.id = ur.fk_id";
|
||||
$sql.= " AND r.entity in (0,".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")";
|
||||
$sql.= " AND r.entity in (0,".(!empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
|
||||
$sql.= " AND ur.fk_user= ".$this->id;
|
||||
$sql.= " AND r.perms IS NOT NULL";
|
||||
if ($moduletag) $sql.= " AND r.module = '".$this->db->escape($moduletag)."'";
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ if ($id)
|
|||
}
|
||||
|
||||
//Multicompany in mode transversal
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->multicompany->transverse_mode)
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
|
@ -205,7 +205,7 @@ if ($action == 'add' && $canadduser)
|
|||
// If multicompany is off, admin users must all be on entity 0.
|
||||
if($conf->multicompany->enabled)
|
||||
{
|
||||
if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"]))
|
||||
if($conf->multicompany->transverse_mode || ! empty($_POST["superadmin"]))
|
||||
{
|
||||
$edituser->entity=0;
|
||||
}
|
||||
|
|
@ -261,8 +261,8 @@ if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
|
|||
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($id);
|
||||
if ($action == 'addgroup') $edituser->SetInGroup($group,($conf->global->MULTICOMPANY_TRANSVERSE_MODE?GETPOST("entity"):$editgroup->entity));
|
||||
if ($action == 'removegroup') $edituser->RemoveFromGroup($group,($conf->global->MULTICOMPANY_TRANSVERSE_MODE?GETPOST("entity"):$editgroup->entity));
|
||||
if ($action == 'addgroup') $edituser->SetInGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity));
|
||||
if ($action == 'removegroup') $edituser->RemoveFromGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity));
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
|
|
@ -319,7 +319,7 @@ if ($action == 'update' && ! $_POST["cancel"])
|
|||
$edituser->phenix_pass = $_POST["phenix_pass"];
|
||||
if($conf->multicompany->enabled)
|
||||
{
|
||||
if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"]))
|
||||
if($conf->multicompany->transverse_mode || ! empty($_POST["superadmin"]))
|
||||
{
|
||||
$edituser->entity=0;
|
||||
}
|
||||
|
|
@ -704,7 +704,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
print '<td>';
|
||||
print $form->selectyesno('admin',$_POST["admin"],1);
|
||||
|
||||
if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
|
|
@ -744,7 +744,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
|||
//Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
@ -1076,7 +1076,7 @@ else
|
|||
print '</td></tr>'."\n";
|
||||
|
||||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
print '<tr><td valign="top">'.$langs->trans("Entity").'</td><td width="75%" class="valeur">';
|
||||
if ($fuser->admin && ! $fuser->entity)
|
||||
|
|
@ -1237,7 +1237,7 @@ else
|
|||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || (($fuser->entity == $conf->entity) || $fuser->entity == $user->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
if ($caneditfield && (empty($conf->multicompany->enabled) || (($fuser->entity == $conf->entity) || $fuser->entity == $user->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED))
|
||||
{
|
||||
|
|
@ -1249,7 +1249,7 @@ else
|
|||
}
|
||||
}
|
||||
elseif ($caneditpassword && ! $fuser->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=edit">'.$langs->trans("EditPassword").'</a>';
|
||||
}
|
||||
|
|
@ -1258,13 +1258,13 @@ else
|
|||
if ($conf->global->USER_PASSWORD_GENERATED != 'none')
|
||||
{
|
||||
if (($user->id != $id && $caneditpassword) && $fuser->login && !$fuser->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)))
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=password">'.$langs->trans("ReinitPassword").'</a>';
|
||||
}
|
||||
|
||||
if (($user->id != $id && $caneditpassword) && $fuser->login && !$fuser->ldap_sid &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
if ($fuser->email) print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=passwordsend">'.$langs->trans("SendNewPassword").'</a>';
|
||||
else print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendNewPassword").'</a>';
|
||||
|
|
@ -1273,19 +1273,19 @@ else
|
|||
|
||||
// Activer
|
||||
if ($user->id <> $id && $candisableuser && $fuser->statut == 0 &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
print '<a class="butAction" href="fiche.php?id='.$fuser->id.'&action=enable">'.$langs->trans("Reactivate").'</a>';
|
||||
}
|
||||
// Desactiver
|
||||
if ($user->id <> $id && $candisableuser && $fuser->statut == 1 &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?action=disable&id='.$fuser->id.'">'.$langs->trans("DisableUser").'</a>';
|
||||
}
|
||||
// Delete
|
||||
if ($user->id <> $id && $candisableuser &&
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1)) )
|
||||
(empty($conf->multicompany->enabled) || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)) )
|
||||
{
|
||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$fuser->id.'">'.$langs->trans("DeleteUser").'</a>';
|
||||
}
|
||||
|
|
@ -1311,7 +1311,7 @@ else
|
|||
|
||||
if (! empty($groupslist))
|
||||
{
|
||||
if( ! ($conf->multicompany->enabled && $conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if( ! ($conf->multicompany->enabled && $conf->multicompany->transverse_mode))
|
||||
{
|
||||
foreach($groupslist as $groupforuser)
|
||||
{
|
||||
|
|
@ -1334,7 +1334,7 @@ else
|
|||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if ($conf->entity == 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
if ($conf->entity == 1 && $conf->multicompany->transverse_mode)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print '</td><td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
@ -1362,7 +1362,7 @@ else
|
|||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="liste_titre" width="25%">'.$langs->trans("Groups").'</td>';
|
||||
if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if(! empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
print '<td class="liste_titre" width="25%">'.$langs->trans("Entity").'</td>';
|
||||
}
|
||||
|
|
@ -1387,7 +1387,7 @@ else
|
|||
print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom;
|
||||
}
|
||||
print '</td>';
|
||||
if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if(! empty($conf->multicompany->enabled) && !empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
$mc->getInfo($group->usergroup_entity);
|
||||
|
|
@ -1544,7 +1544,7 @@ else
|
|||
{
|
||||
print $form->selectyesno('admin',$fuser->admin,1);
|
||||
|
||||
if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
|
|
@ -1602,7 +1602,7 @@ else
|
|||
//Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if(empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ $userid=GETPOST("user","int");
|
|||
// Security check
|
||||
$result = restrictedArea($user, 'user', $_GET["id"], 'usergroup', 'user');
|
||||
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->multicompany->transverse_mode)
|
||||
{
|
||||
accessforbidden();
|
||||
}
|
||||
|
|
@ -95,7 +95,7 @@ if ($action == 'add')
|
|||
if (! $message)
|
||||
{
|
||||
$object->nom = trim($_POST["nom"]);
|
||||
if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if($conf->multicompany->enabled && !empty($conf->multicompany->transverse_mode))
|
||||
$object->entity = 0;
|
||||
else
|
||||
$object->entity = $_POST["entity"];
|
||||
|
|
@ -141,8 +141,8 @@ if ($action == 'adduser' || $action =='removeuser')
|
|||
|
||||
$edituser = new User($db);
|
||||
$edituser->fetch($userid);
|
||||
if ($action == 'adduser') $result=$edituser->SetInGroup($object->id,($conf->global->MULTICOMPANY_TRANSVERSE_MODE?GETPOST("entity"):$object->entity));
|
||||
if ($action == 'removeuser') $result=$edituser->RemoveFromGroup($object->id,($conf->global->MULTICOMPANY_TRANSVERSE_MODE?GETPOST("entity"):$object->entity));
|
||||
if ($action == 'adduser') $result=$edituser->SetInGroup($object->id,($conf->multicompany->transverse_mode?GETPOST("entity"):$object->entity));
|
||||
if ($action == 'removeuser') $result=$edituser->RemoveFromGroup($object->id,($conf->multicompany->transverse_mode?GETPOST("entity"):$object->entity));
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
|
|
@ -176,7 +176,7 @@ if ($action == 'update')
|
|||
$object->oldcopy=dol_clone($object);
|
||||
|
||||
$object->nom = trim($_POST["group"]);
|
||||
if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if($conf->multicompany->enabled && !empty($conf->multicompany->transverse_mode))
|
||||
$object->entity = 0;
|
||||
else
|
||||
$object->entity = $_POST["entity"];
|
||||
|
|
@ -231,7 +231,7 @@ if ($action == 'create')
|
|||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
@ -317,7 +317,7 @@ else
|
|||
print "</td></tr>\n";
|
||||
|
||||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
$mc->getInfo($object->entity);
|
||||
|
|
@ -366,7 +366,7 @@ else
|
|||
|
||||
if (! empty($object->members))
|
||||
{
|
||||
if( !($conf->multicompany->enabled && $conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if( !($conf->multicompany->enabled && $conf->multicompany->transverse_mode))
|
||||
{
|
||||
foreach($object->members as $useringroup)
|
||||
{
|
||||
|
|
@ -388,7 +388,7 @@ else
|
|||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if ($conf->entity == 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)
|
||||
if ($conf->entity == 1 && $conf->multicompany->transverse_mode)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print '</td><td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
@ -486,7 +486,7 @@ else
|
|||
// Multicompany
|
||||
if (! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if (empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity)
|
||||
{
|
||||
$mc = new ActionsMulticompany($db);
|
||||
print "<tr>".'<td valign="top">'.$langs->trans("Entity").'</td>';
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ print_fiche_titre($langs->trans("ListOfGroups"));
|
|||
$sql = "SELECT g.rowid, g.nom, g.entity, g.datec, COUNT(ugu.rowid) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity)))
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
|
||||
{
|
||||
$sql.= " WHERE g.entity IS NOT NULL";
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ if ($resql)
|
|||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Group"),$_SERVER["PHP_SELF"],"g.nom",$param,"","",$sortfield,$sortorder);
|
||||
//multicompany
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1)
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
|
||||
{
|
||||
print_liste_field_titre($langs->trans("Entity"),$_SERVER["PHP_SELF"],"g.entity",$param,"",'align="center"',$sortfield,$sortorder);
|
||||
}
|
||||
|
|
@ -106,7 +106,7 @@ if ($resql)
|
|||
}
|
||||
print "</td>";
|
||||
//multicompany
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1)
|
||||
if(! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
|
||||
{
|
||||
dol_include_once("/multicompany/class/actions_multicompany.class.php");
|
||||
$mc = new ActionsMulticompany($db);
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ if ($id)
|
|||
$sql.= " WHERE ugr.fk_id = r.id";
|
||||
if(! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if(empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= " AND r.entity = ".$conf->entity;
|
||||
}
|
||||
|
|
@ -250,7 +250,7 @@ if ($id)
|
|||
//$sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity);
|
||||
if(! empty($conf->multicompany->enabled))
|
||||
{
|
||||
if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
|
||||
if(empty($conf->multicompany->transverse_mode))
|
||||
{
|
||||
$sql.= " AND r.entity = ".$conf->entity;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ $sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.login, u.fk_societe, u.d
|
|||
$sql.= " s.nom, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity)))
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
|
||||
{
|
||||
$sql.= " WHERE u.entity IS NOT NULL";
|
||||
}
|
||||
|
|
@ -196,7 +196,7 @@ if ($canreadperms)
|
|||
|
||||
$sql = "SELECT g.rowid, g.nom, g.note, g.entity, g.datec";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity)))
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
|
||||
{
|
||||
$sql.= " WHERE g.entity IS NOT NULL";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ $sql.= " u.ldap_sid, u.statut, u.entity,";
|
|||
$sql.= " s.nom, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ($user->admin && ! $user->entity)))
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
|
||||
{
|
||||
$sql.= " WHERE u.entity IS NOT NULL";
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user